WIP
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
0
.jshintignore
Normal file
56
.jshintrc
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
// Settings
|
||||||
|
"passfail" : false, // Stop on first error.
|
||||||
|
"maxerr" : 100, // Maximum error before stopping.
|
||||||
|
|
||||||
|
// Predefined globals whom JSHint will ignore.
|
||||||
|
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||||
|
"node" : false,
|
||||||
|
"rhino" : false,
|
||||||
|
"couch" : false,
|
||||||
|
"wsh" : true, // Windows Scripting Host.
|
||||||
|
"jquery" : true,
|
||||||
|
"predef" : [ "jQuery", "$" ],
|
||||||
|
|
||||||
|
// Development.
|
||||||
|
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||||
|
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||||
|
|
||||||
|
// ECMAScript 5.
|
||||||
|
"strict" : false, // Require `use strict` pragma in every file.
|
||||||
|
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
|
||||||
|
|
||||||
|
// The Good Parts.
|
||||||
|
"asi" : true, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
||||||
|
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||||
|
"bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||||
|
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||||
|
"curly" : true, // Require {} for every new block or scope.
|
||||||
|
"eqeqeq" : false, // Require triple equals i.e. `===`.
|
||||||
|
"eqnull" : false, // Tolerate use of `== null`.
|
||||||
|
"evil" : false, // Tolerate use of `eval`.
|
||||||
|
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||||
|
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||||
|
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||||
|
"latedef" : false, // Prohipit variable use before definition.
|
||||||
|
"loopfunc" : true, // Allow functions to be defined within loops.
|
||||||
|
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||||
|
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
|
||||||
|
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
|
||||||
|
"scripturl" : true, // Tolerate script-targeted URLs.
|
||||||
|
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
||||||
|
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||||
|
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||||
|
|
||||||
|
// Personal styling preferences.
|
||||||
|
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||||
|
"noempty" : true, // Prohibit use of empty blocks.
|
||||||
|
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||||
|
"nomen" : true, // Prohibit use of initial or trailing underbars in names.
|
||||||
|
"onevar" : false, // Allow only one `var` statement per function.
|
||||||
|
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||||
|
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||||
|
"trailing" : true, // Prohibit trailing whitespaces.
|
||||||
|
"white" : false, // Check against strict whitespace and indentation rules.
|
||||||
|
"indent" : 2 // Specify indentation spacing
|
||||||
|
}
|
13
assets/icons/collapse.svg
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||||
|
<!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>collapse</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1">
|
||||||
|
<g id="collapse" sketch:type="MSLayerGroup" transform="translate(-1.000000, -1.000000)">
|
||||||
|
<path d="M15.00325,9.01 L15.00325,5.377 L16.29625,6.694 C16.68825,7.082 17.32125,7.082 17.71325,6.694 C18.10525,6.306 18.10425,5.678 17.71325,5.291 L14.74625,2.291 C14.55825,2.105 14.30425,2 14.03725,2 C14.02625,2 14.01425,2 14.00325,2.001 C13.99225,2.002 13.98025,2 13.96925,2 C13.70325,2 13.44825,2.105 13.26025,2.291 L10.29325,5.291 C9.90225,5.679 9.90225,6.307 10.29325,6.694 C10.68425,7.081 11.31825,7.082 11.71025,6.694 L13.00425,5.377 L13.00425,9.01 C13.00425,9.557 13.44725,10 13.99425,10 L14.01225,10 C14.55925,10 15.00225,9.557 15.00225,9.01 L15.00325,9.01 Z" id="Shape" sketch:type="MSShapeGroup" transform="translate(14.003438, 6.000000) rotate(-135.000000) translate(-14.003438, -6.000000) "></path>
|
||||||
|
<path d="M7.00668756,13.377 L8.29968756,14.694 C8.69168756,15.082 9.32468756,15.082 9.71668756,14.694 C10.1086876,14.306 10.1076876,13.678 9.71668756,13.291 L6.74968756,10.291 C6.56168756,10.105 6.30768756,10 6.04068756,10 C6.02968756,10 6.01768756,10 6.00668756,10.001 C5.99568756,10.002 5.98368756,10 5.97268756,10 C5.70668756,10 5.45168756,10.105 5.26368756,10.291 L2.29668756,13.291 C1.90568756,13.679 1.90568756,14.307 2.29668756,14.694 C2.68768756,15.081 3.32168756,15.082 3.71368756,14.694 L5.00768756,13.377 L5.00768756,17.01 C5.00768756,17.557 5.45068756,18 5.99768756,18 C6.56268756,18 7.00568756,17.557 7.00568756,17.01 L7.00668756,13.377 Z" id="Shape-2" sketch:type="MSShapeGroup" transform="translate(6.006875, 14.000000) rotate(45.000000) translate(-6.006875, -14.000000) "></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
13
assets/icons/expand.svg
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||||
|
<!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>expand</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||||
|
<g id="expand" sketch:type="MSLayerGroup" transform="translate(-1.000000, -1.000000)" fill="#444444">
|
||||||
|
<path d="M7.00325,17.01 L7.00325,13.377 L8.29625,14.694 C8.68825,15.082 9.32125,15.082 9.71325,14.694 C10.10525,14.306 10.10425,13.678 9.71325,13.291 L6.74625,10.291 C6.55825,10.105 6.30425,10 6.03725,10 C6.02625,10 6.01425,10 6.00325,10.001 C5.99225,10.002 5.98025,10 5.96925,10 C5.70325,10 5.44825,10.105 5.26025,10.291 L2.29325,13.291 C1.90225,13.679 1.90225,14.307 2.29325,14.694 C2.68425,15.081 3.31825,15.082 3.71025,14.694 L5.00425,13.377 L5.00425,17.01 C5.00425,17.557 5.44725,18 5.99425,18 L6.01225,18 C6.55925,18 7.00225,17.557 7.00225,17.01 L7.00325,17.01 Z" id="Shape" sketch:type="MSShapeGroup" transform="translate(6.003438, 14.000000) rotate(-135.000000) translate(-6.003438, -14.000000) "></path>
|
||||||
|
<path d="M15.0066876,5.377 L16.2996876,6.694 C16.6916876,7.082 17.3246876,7.082 17.7166876,6.694 C18.1086876,6.306 18.1076876,5.678 17.7166876,5.291 L14.7496876,2.291 C14.5616876,2.105 14.3076876,2 14.0406876,2 C14.0296876,2 14.0176876,2 14.0066876,2.001 C13.9956876,2.002 13.9836876,2 13.9726876,2 C13.7066876,2 13.4516876,2.105 13.2636876,2.291 L10.2966876,5.291 C9.90568756,5.679 9.90568756,6.307 10.2966876,6.694 C10.6876876,7.081 11.3216876,7.082 11.7136876,6.694 L13.0076876,5.377 L13.0076876,9.01 C13.0076876,9.557 13.4506876,10 13.9976876,10 C14.5626876,10 15.0056876,9.557 15.0056876,9.01 L15.0066876,5.377 Z" id="Shape-2" sketch:type="MSShapeGroup" transform="translate(14.006875, 6.000000) rotate(45.000000) translate(-14.006875, -6.000000) "></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
6
assets/icons/fast-forward.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M17.569 8.246l-10.569-6.246c-0.552 0-1 0.448-1 1v1.954l-5-2.954c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1l5-2.955v1.955c0 0.552 0.448 1 1 1l10.569-6.246c0.267-0.158 0.431-0.444 0.431-0.754s-0.164-0.597-0.431-0.754zM6 10.722l-4 2.364v-8.172l4 2.364v3.444zM8 13.086v-8.172l6.915 4.086-6.915 4.086z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 635 B |
6
assets/icons/film.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M17 2h-16c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1h16c0.552 0 1-0.448 1-1v-12c0-0.552-0.448-1-1-1zM2 4h2v2h-2v-2zM2 8h2v2h-2v-2zM2 14v-2h2v2h-2zM6 14v-10h6v10h-6zM16 14h-2v-2h2v2zM16 10h-2v-2h2v2zM16 6h-2v-2h2v2z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 553 B |
13
assets/icons/pause.svg
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||||
|
<!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>pause</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||||
|
<g id="pause" sketch:type="MSLayerGroup" transform="translate(3.000000, 3.000000)" stroke="#FFFFFF" stroke-width="2">
|
||||||
|
<rect id="Rectangle-1" sketch:type="MSShapeGroup" x="8" y="0" width="4" height="12" rx="1"></rect>
|
||||||
|
<rect id="Rectangle-2" sketch:type="MSShapeGroup" x="0" y="0" width="4" height="12" rx="1"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 899 B |
6
assets/icons/play.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M5 4.914l6.915 4.086-6.915 4.086v-8.172zM4 2c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1l10.569-6.246c0.267-0.158 0.431-0.444 0.431-0.754s-0.164-0.597-0.431-0.754l-10.569-6.246z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 515 B |
7
assets/icons/refresh.svg
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M8.013 14.006h-0.822c-2.372-0.388-4.187-2.453-4.187-4.934 0-0.831 0.213-1.609 0.574-2.299l0.613 0.85c0.446 0.618 1.409 0.446 1.614-0.289l1.162-4.179c0.162-0.58-0.275-1.155-0.877-1.154l-4.174 0.006c-0.741 0.001-1.17 0.841-0.736 1.443l1.128 1.564c-0.817 1.145-1.302 2.544-1.302 4.059 0 3.499 2.566 6.399 5.918 6.917 0.091 0.014 0.18 0.010 0.267-0.001v0.012h0.822c0.545 0 0.987-0.442 0.987-0.987v-0.020c0-0.545-0.442-0.987-0.987-0.987z"></path>
|
||||||
|
<path d="M16.82 14.551l-1.129-1.564c0.818-1.145 1.302-2.544 1.302-4.059 0-3.499-2.566-6.399-5.918-6.918-0.091-0.014-0.18-0.010-0.267 0.001v-0.013h-0.822c-0.545 0-0.986 0.442-0.986 0.987v0.020c0 0.546 0.442 0.988 0.986 0.988h0.822c2.372 0.388 4.187 2.453 4.187 4.934 0 0.831-0.213 1.609-0.573 2.299l-0.614-0.85c-0.446-0.618-1.409-0.446-1.613 0.289l-1.163 4.179c-0.161 0.581 0.275 1.155 0.878 1.154l4.174-0.006c0.742-0.001 1.17-0.842 0.736-1.443z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
10
assets/icons/rewind.svg
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="21px" viewBox="0 0 18 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||||
|
<!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>rewind</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" sketch:type="MSPage">
|
||||||
|
<path d="M17.569,9.246 L7,3 C6.448,3 6,3.448 6,4 L6,5.954 L1,3 C0.448,3 0,3.448 0,4 L0,16 C0,16.552 0.448,17 1,17 L6,14.045 L6,16 C6,16.552 6.448,17 7,17 L17.569,10.754 C17.836,10.596 18,10.31 18,10 C18,9.69 17.836,9.403 17.569,9.246 L17.569,9.246 Z M6,11.722 L2,14.086 L2,5.914 L6,8.278 L6,11.722 L6,11.722 Z M8,14.086 L8,5.914 L14.915,10 L8,14.086 L8,14.086 Z" id="Shape" sketch:type="MSShapeGroup" transform="translate(9.000000, 10.000000) rotate(-180.000000) translate(-9.000000, -10.000000) "></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1021 B |
7
assets/icons/sound.svg
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M10.214 2c-0.111 0-0.225 0.032-0.334 0.101l-4.048 2.81c-0.083 0.058-0.182 0.089-0.283 0.089h-3.553c-0.55 0-0.996 0.448-0.996 1v6c0 0.552 0.446 1 0.996 1h3.553c0.102 0 0.2 0.031 0.283 0.089l4.048 2.81c0.109 0.069 0.223 0.101 0.334 0.101 0.392 0 0.747-0.4 0.747-0.949v-12.101c0-0.55-0.355-0.949-0.747-0.949zM8.969 12.834l-2.387-1.657c-0.166-0.115-0.364-0.178-0.566-0.178h-2.525c-0.275 0-0.498-0.224-0.498-0.5v-3c0-0.276 0.223-0.5 0.498-0.5h2.525c0.202 0 0.4-0.062 0.566-0.178l2.387-1.657v7.669z"></path>
|
||||||
|
<path d="M16.934 8.799c-0.086-1.748-1.514-2.991-2.507-3.649-0.47-0.312-1.094-0.122-1.325 0.408l-0.038 0.086c-0.188 0.431-0.045 0.939 0.336 1.194 0.706 0.473 1.586 1.247 1.624 2.065 0.032 0.676-0.553 1.468-1.663 2.27-0.398 0.288-0.529 0.839-0.285 1.275l0.042 0.075c0.266 0.475 0.866 0.624 1.3 0.312 1.74-1.251 2.586-2.606 2.516-4.037z"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
19
assets/js/docs.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// ==========================================================================
|
||||||
|
// Docs example
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
/*global InitPxVideo, Mustache, templates */
|
||||||
|
|
||||||
|
// Initialize
|
||||||
|
var video = new InitPxVideo({
|
||||||
|
"videoId": "myvid",
|
||||||
|
"captionsOnDefault": true,
|
||||||
|
"seekInterval": 20,
|
||||||
|
"videoTitle": "PayPal Austin promo",
|
||||||
|
"debug": true,
|
||||||
|
"html": templates.controls.render({
|
||||||
|
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(video);
|
802
assets/js/lib/hogan-3.0.2.mustache.js
Normal file
@ -0,0 +1,802 @@
|
|||||||
|
/*!
|
||||||
|
* Copyright 2011 Twitter, Inc.
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// A wrapper for compatibility with Mustache.js, quirks and all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var Hogan = {};
|
||||||
|
|
||||||
|
(function (Hogan) {
|
||||||
|
Hogan.Template = function (codeObj, text, compiler, options) {
|
||||||
|
codeObj = codeObj || {};
|
||||||
|
this.r = codeObj.code || this.r;
|
||||||
|
this.c = compiler;
|
||||||
|
this.options = options || {};
|
||||||
|
this.text = text || '';
|
||||||
|
this.partials = codeObj.partials || {};
|
||||||
|
this.subs = codeObj.subs || {};
|
||||||
|
this.buf = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.Template.prototype = {
|
||||||
|
// render: replaced by generated code.
|
||||||
|
r: function (context, partials, indent) { return ''; },
|
||||||
|
|
||||||
|
// variable escaping
|
||||||
|
v: hoganEscape,
|
||||||
|
|
||||||
|
// triple stache
|
||||||
|
t: coerceToString,
|
||||||
|
|
||||||
|
render: function render(context, partials, indent) {
|
||||||
|
return this.ri([context], partials || {}, indent);
|
||||||
|
},
|
||||||
|
|
||||||
|
// render internal -- a hook for overrides that catches partials too
|
||||||
|
ri: function (context, partials, indent) {
|
||||||
|
return this.r(context, partials, indent);
|
||||||
|
},
|
||||||
|
|
||||||
|
// ensurePartial
|
||||||
|
ep: function(symbol, partials) {
|
||||||
|
var partial = this.partials[symbol];
|
||||||
|
|
||||||
|
// check to see that if we've instantiated this partial before
|
||||||
|
var template = partials[partial.name];
|
||||||
|
if (partial.instance && partial.base == template) {
|
||||||
|
return partial.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof template == 'string') {
|
||||||
|
if (!this.c) {
|
||||||
|
throw new Error("No compiler available.");
|
||||||
|
}
|
||||||
|
template = this.c.compile(template, this.options);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!template) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We use this to check whether the partials dictionary has changed
|
||||||
|
this.partials[symbol].base = template;
|
||||||
|
|
||||||
|
if (partial.subs) {
|
||||||
|
// Make sure we consider parent template now
|
||||||
|
if (!partials.stackText) partials.stackText = {};
|
||||||
|
for (key in partial.subs) {
|
||||||
|
if (!partials.stackText[key]) {
|
||||||
|
partials.stackText[key] = (this.activeSub !== undefined && partials.stackText[this.activeSub]) ? partials.stackText[this.activeSub] : this.text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template = createSpecializedPartial(template, partial.subs, partial.partials,
|
||||||
|
this.stackSubs, this.stackPartials, partials.stackText);
|
||||||
|
}
|
||||||
|
this.partials[symbol].instance = template;
|
||||||
|
|
||||||
|
return template;
|
||||||
|
},
|
||||||
|
|
||||||
|
// tries to find a partial in the current scope and render it
|
||||||
|
rp: function(symbol, context, partials, indent) {
|
||||||
|
var partial = this.ep(symbol, partials);
|
||||||
|
if (!partial) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return partial.ri(context, partials, indent);
|
||||||
|
},
|
||||||
|
|
||||||
|
// render a section
|
||||||
|
rs: function(context, partials, section) {
|
||||||
|
var tail = context[context.length - 1];
|
||||||
|
|
||||||
|
if (!isArray(tail)) {
|
||||||
|
section(context, partials, this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < tail.length; i++) {
|
||||||
|
context.push(tail[i]);
|
||||||
|
section(context, partials, this);
|
||||||
|
context.pop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// maybe start a section
|
||||||
|
s: function(val, ctx, partials, inverted, start, end, tags) {
|
||||||
|
var pass;
|
||||||
|
|
||||||
|
if (isArray(val) && val.length === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof val == 'function') {
|
||||||
|
val = this.ms(val, ctx, partials, inverted, start, end, tags);
|
||||||
|
}
|
||||||
|
|
||||||
|
pass = !!val;
|
||||||
|
|
||||||
|
if (!inverted && pass && ctx) {
|
||||||
|
ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pass;
|
||||||
|
},
|
||||||
|
|
||||||
|
// find values with dotted names
|
||||||
|
d: function(key, ctx, partials, returnFound) {
|
||||||
|
var found,
|
||||||
|
names = key.split('.'),
|
||||||
|
val = this.f(names[0], ctx, partials, returnFound),
|
||||||
|
doModelGet = this.options.modelGet,
|
||||||
|
cx = null;
|
||||||
|
|
||||||
|
if (key === '.' && isArray(ctx[ctx.length - 2])) {
|
||||||
|
val = ctx[ctx.length - 1];
|
||||||
|
} else {
|
||||||
|
for (var i = 1; i < names.length; i++) {
|
||||||
|
found = findInScope(names[i], val, doModelGet);
|
||||||
|
if (found !== undefined) {
|
||||||
|
cx = val;
|
||||||
|
val = found;
|
||||||
|
} else {
|
||||||
|
val = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (returnFound && !val) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!returnFound && typeof val == 'function') {
|
||||||
|
ctx.push(cx);
|
||||||
|
val = this.mv(val, ctx, partials);
|
||||||
|
ctx.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
|
// find values with normal names
|
||||||
|
f: function(key, ctx, partials, returnFound) {
|
||||||
|
var val = false,
|
||||||
|
v = null,
|
||||||
|
found = false,
|
||||||
|
doModelGet = this.options.modelGet;
|
||||||
|
|
||||||
|
for (var i = ctx.length - 1; i >= 0; i--) {
|
||||||
|
v = ctx[i];
|
||||||
|
val = findInScope(key, v, doModelGet);
|
||||||
|
if (val !== undefined) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
return (returnFound) ? false : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!returnFound && typeof val == 'function') {
|
||||||
|
val = this.mv(val, ctx, partials);
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
|
// higher order templates
|
||||||
|
ls: function(func, cx, partials, text, tags) {
|
||||||
|
var oldTags = this.options.delimiters;
|
||||||
|
|
||||||
|
this.options.delimiters = tags;
|
||||||
|
this.b(this.ct(coerceToString(func.call(cx, text)), cx, partials));
|
||||||
|
this.options.delimiters = oldTags;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// compile text
|
||||||
|
ct: function(text, cx, partials) {
|
||||||
|
if (this.options.disableLambda) {
|
||||||
|
throw new Error('Lambda features disabled.');
|
||||||
|
}
|
||||||
|
return this.c.compile(text, this.options).render(cx, partials);
|
||||||
|
},
|
||||||
|
|
||||||
|
// template result buffering
|
||||||
|
b: function(s) { this.buf += s; },
|
||||||
|
|
||||||
|
fl: function() { var r = this.buf; this.buf = ''; return r; },
|
||||||
|
|
||||||
|
// method replace section
|
||||||
|
ms: function(func, ctx, partials, inverted, start, end, tags) {
|
||||||
|
var textSource,
|
||||||
|
cx = ctx[ctx.length - 1],
|
||||||
|
result = func.call(cx);
|
||||||
|
|
||||||
|
if (typeof result == 'function') {
|
||||||
|
if (inverted) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
textSource = (this.activeSub && this.subsText && this.subsText[this.activeSub]) ? this.subsText[this.activeSub] : this.text;
|
||||||
|
return this.ls(result, cx, partials, textSource.substring(start, end), tags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
|
// method replace variable
|
||||||
|
mv: function(func, ctx, partials) {
|
||||||
|
var cx = ctx[ctx.length - 1];
|
||||||
|
var result = func.call(cx);
|
||||||
|
|
||||||
|
if (typeof result == 'function') {
|
||||||
|
return this.ct(coerceToString(result.call(cx)), cx, partials);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
|
sub: function(name, context, partials, indent) {
|
||||||
|
var f = this.subs[name];
|
||||||
|
if (f) {
|
||||||
|
this.activeSub = name;
|
||||||
|
f(context, partials, this, indent);
|
||||||
|
this.activeSub = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//Find a key in an object
|
||||||
|
function findInScope(key, scope, doModelGet) {
|
||||||
|
var val;
|
||||||
|
|
||||||
|
if (scope && typeof scope == 'object') {
|
||||||
|
|
||||||
|
if (scope[key] !== undefined) {
|
||||||
|
val = scope[key];
|
||||||
|
|
||||||
|
// try lookup with get for backbone or similar model data
|
||||||
|
} else if (doModelGet && scope.get && typeof scope.get == 'function') {
|
||||||
|
val = scope.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createSpecializedPartial(instance, subs, partials, stackSubs, stackPartials, stackText) {
|
||||||
|
function PartialTemplate() {};
|
||||||
|
PartialTemplate.prototype = instance;
|
||||||
|
function Substitutions() {};
|
||||||
|
Substitutions.prototype = instance.subs;
|
||||||
|
var key;
|
||||||
|
var partial = new PartialTemplate();
|
||||||
|
partial.subs = new Substitutions();
|
||||||
|
partial.subsText = {}; //hehe. substext.
|
||||||
|
partial.buf = '';
|
||||||
|
|
||||||
|
stackSubs = stackSubs || {};
|
||||||
|
partial.stackSubs = stackSubs;
|
||||||
|
partial.subsText = stackText;
|
||||||
|
for (key in subs) {
|
||||||
|
if (!stackSubs[key]) stackSubs[key] = subs[key];
|
||||||
|
}
|
||||||
|
for (key in stackSubs) {
|
||||||
|
partial.subs[key] = stackSubs[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
stackPartials = stackPartials || {};
|
||||||
|
partial.stackPartials = stackPartials;
|
||||||
|
for (key in partials) {
|
||||||
|
if (!stackPartials[key]) stackPartials[key] = partials[key];
|
||||||
|
}
|
||||||
|
for (key in stackPartials) {
|
||||||
|
partial.partials[key] = stackPartials[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
return partial;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rAmp = /&/g,
|
||||||
|
rLt = /</g,
|
||||||
|
rGt = />/g,
|
||||||
|
rApos = /\'/g,
|
||||||
|
rQuot = /\"/g,
|
||||||
|
hChars = /[&<>\"\']/;
|
||||||
|
|
||||||
|
function coerceToString(val) {
|
||||||
|
return String((val === null || val === undefined) ? '' : val);
|
||||||
|
}
|
||||||
|
|
||||||
|
function hoganEscape(str) {
|
||||||
|
str = coerceToString(str);
|
||||||
|
return hChars.test(str) ?
|
||||||
|
str
|
||||||
|
.replace(rAmp, '&')
|
||||||
|
.replace(rLt, '<')
|
||||||
|
.replace(rGt, '>')
|
||||||
|
.replace(rApos, ''')
|
||||||
|
.replace(rQuot, '"') :
|
||||||
|
str;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isArray = Array.isArray || function(a) {
|
||||||
|
return Object.prototype.toString.call(a) === '[object Array]';
|
||||||
|
};
|
||||||
|
|
||||||
|
})(typeof exports !== 'undefined' ? exports : Hogan);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(function (Hogan) {
|
||||||
|
// Setup regex assignments
|
||||||
|
// remove whitespace according to Mustache spec
|
||||||
|
var rIsWhitespace = /\S/,
|
||||||
|
rQuot = /\"/g,
|
||||||
|
rNewline = /\n/g,
|
||||||
|
rCr = /\r/g,
|
||||||
|
rSlash = /\\/g,
|
||||||
|
rLineSep = /\u2028/,
|
||||||
|
rParagraphSep = /\u2029/;
|
||||||
|
|
||||||
|
Hogan.tags = {
|
||||||
|
'#': 1, '^': 2, '<': 3, '$': 4,
|
||||||
|
'/': 5, '!': 6, '>': 7, '=': 8, '_v': 9,
|
||||||
|
'{': 10, '&': 11, '_t': 12
|
||||||
|
};
|
||||||
|
|
||||||
|
Hogan.scan = function scan(text, delimiters) {
|
||||||
|
var len = text.length,
|
||||||
|
IN_TEXT = 0,
|
||||||
|
IN_TAG_TYPE = 1,
|
||||||
|
IN_TAG = 2,
|
||||||
|
state = IN_TEXT,
|
||||||
|
tagType = null,
|
||||||
|
tag = null,
|
||||||
|
buf = '',
|
||||||
|
tokens = [],
|
||||||
|
seenTag = false,
|
||||||
|
i = 0,
|
||||||
|
lineStart = 0,
|
||||||
|
otag = '{{',
|
||||||
|
ctag = '}}';
|
||||||
|
|
||||||
|
function addBuf() {
|
||||||
|
if (buf.length > 0) {
|
||||||
|
tokens.push({tag: '_t', text: new String(buf)});
|
||||||
|
buf = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function lineIsWhitespace() {
|
||||||
|
var isAllWhitespace = true;
|
||||||
|
for (var j = lineStart; j < tokens.length; j++) {
|
||||||
|
isAllWhitespace =
|
||||||
|
(Hogan.tags[tokens[j].tag] < Hogan.tags['_v']) ||
|
||||||
|
(tokens[j].tag == '_t' && tokens[j].text.match(rIsWhitespace) === null);
|
||||||
|
if (!isAllWhitespace) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isAllWhitespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterLine(haveSeenTag, noNewLine) {
|
||||||
|
addBuf();
|
||||||
|
|
||||||
|
if (haveSeenTag && lineIsWhitespace()) {
|
||||||
|
for (var j = lineStart, next; j < tokens.length; j++) {
|
||||||
|
if (tokens[j].text) {
|
||||||
|
if ((next = tokens[j+1]) && next.tag == '>') {
|
||||||
|
// set indent to token value
|
||||||
|
next.indent = tokens[j].text.toString()
|
||||||
|
}
|
||||||
|
tokens.splice(j, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (!noNewLine) {
|
||||||
|
tokens.push({tag:'\n'});
|
||||||
|
}
|
||||||
|
|
||||||
|
seenTag = false;
|
||||||
|
lineStart = tokens.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeDelimiters(text, index) {
|
||||||
|
var close = '=' + ctag,
|
||||||
|
closeIndex = text.indexOf(close, index),
|
||||||
|
delimiters = trim(
|
||||||
|
text.substring(text.indexOf('=', index) + 1, closeIndex)
|
||||||
|
).split(' ');
|
||||||
|
|
||||||
|
otag = delimiters[0];
|
||||||
|
ctag = delimiters[delimiters.length - 1];
|
||||||
|
|
||||||
|
return closeIndex + close.length - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (delimiters) {
|
||||||
|
delimiters = delimiters.split(' ');
|
||||||
|
otag = delimiters[0];
|
||||||
|
ctag = delimiters[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
if (state == IN_TEXT) {
|
||||||
|
if (tagChange(otag, text, i)) {
|
||||||
|
--i;
|
||||||
|
addBuf();
|
||||||
|
state = IN_TAG_TYPE;
|
||||||
|
} else {
|
||||||
|
if (text.charAt(i) == '\n') {
|
||||||
|
filterLine(seenTag);
|
||||||
|
} else {
|
||||||
|
buf += text.charAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (state == IN_TAG_TYPE) {
|
||||||
|
i += otag.length - 1;
|
||||||
|
tag = Hogan.tags[text.charAt(i + 1)];
|
||||||
|
tagType = tag ? text.charAt(i + 1) : '_v';
|
||||||
|
if (tagType == '=') {
|
||||||
|
i = changeDelimiters(text, i);
|
||||||
|
state = IN_TEXT;
|
||||||
|
} else {
|
||||||
|
if (tag) {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
state = IN_TAG;
|
||||||
|
}
|
||||||
|
seenTag = i;
|
||||||
|
} else {
|
||||||
|
if (tagChange(ctag, text, i)) {
|
||||||
|
tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag,
|
||||||
|
i: (tagType == '/') ? seenTag - otag.length : i + ctag.length});
|
||||||
|
buf = '';
|
||||||
|
i += ctag.length - 1;
|
||||||
|
state = IN_TEXT;
|
||||||
|
if (tagType == '{') {
|
||||||
|
if (ctag == '}}') {
|
||||||
|
i++;
|
||||||
|
} else {
|
||||||
|
cleanTripleStache(tokens[tokens.length - 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
buf += text.charAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
filterLine(seenTag, true);
|
||||||
|
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanTripleStache(token) {
|
||||||
|
if (token.n.substr(token.n.length - 1) === '}') {
|
||||||
|
token.n = token.n.substring(0, token.n.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function trim(s) {
|
||||||
|
if (s.trim) {
|
||||||
|
return s.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.replace(/^\s*|\s*$/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function tagChange(tag, text, index) {
|
||||||
|
if (text.charAt(index) != tag.charAt(0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 1, l = tag.length; i < l; i++) {
|
||||||
|
if (text.charAt(index + i) != tag.charAt(i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the tags allowed inside super templates
|
||||||
|
var allowedInSuper = {'_t': true, '\n': true, '$': true, '/': true};
|
||||||
|
|
||||||
|
function buildTree(tokens, kind, stack, customTags) {
|
||||||
|
var instructions = [],
|
||||||
|
opener = null,
|
||||||
|
tail = null,
|
||||||
|
token = null;
|
||||||
|
|
||||||
|
tail = stack[stack.length - 1];
|
||||||
|
|
||||||
|
while (tokens.length > 0) {
|
||||||
|
token = tokens.shift();
|
||||||
|
|
||||||
|
if (tail && tail.tag == '<' && !(token.tag in allowedInSuper)) {
|
||||||
|
throw new Error('Illegal content in < super tag.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Hogan.tags[token.tag] <= Hogan.tags['$'] || isOpener(token, customTags)) {
|
||||||
|
stack.push(token);
|
||||||
|
token.nodes = buildTree(tokens, token.tag, stack, customTags);
|
||||||
|
} else if (token.tag == '/') {
|
||||||
|
if (stack.length === 0) {
|
||||||
|
throw new Error('Closing tag without opener: /' + token.n);
|
||||||
|
}
|
||||||
|
opener = stack.pop();
|
||||||
|
if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) {
|
||||||
|
throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n);
|
||||||
|
}
|
||||||
|
opener.end = token.i;
|
||||||
|
return instructions;
|
||||||
|
} else if (token.tag == '\n') {
|
||||||
|
token.last = (tokens.length == 0) || (tokens[0].tag == '\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
instructions.push(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.length > 0) {
|
||||||
|
throw new Error('missing closing tag: ' + stack.pop().n);
|
||||||
|
}
|
||||||
|
|
||||||
|
return instructions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isOpener(token, tags) {
|
||||||
|
for (var i = 0, l = tags.length; i < l; i++) {
|
||||||
|
if (tags[i].o == token.n) {
|
||||||
|
token.tag = '#';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isCloser(close, open, tags) {
|
||||||
|
for (var i = 0, l = tags.length; i < l; i++) {
|
||||||
|
if (tags[i].c == close && tags[i].o == open) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function stringifySubstitutions(obj) {
|
||||||
|
var items = [];
|
||||||
|
for (var key in obj) {
|
||||||
|
items.push('"' + esc(key) + '": function(c,p,t,i) {' + obj[key] + '}');
|
||||||
|
}
|
||||||
|
return "{ " + items.join(",") + " }";
|
||||||
|
}
|
||||||
|
|
||||||
|
function stringifyPartials(codeObj) {
|
||||||
|
var partials = [];
|
||||||
|
for (var key in codeObj.partials) {
|
||||||
|
partials.push('"' + esc(key) + '":{name:"' + esc(codeObj.partials[key].name) + '", ' + stringifyPartials(codeObj.partials[key]) + "}");
|
||||||
|
}
|
||||||
|
return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs);
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.stringify = function(codeObj, text, options) {
|
||||||
|
return "{code: function (c,p,i) { " + Hogan.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
var serialNo = 0;
|
||||||
|
Hogan.generate = function(tree, text, options) {
|
||||||
|
serialNo = 0;
|
||||||
|
var context = { code: '', subs: {}, partials: {} };
|
||||||
|
Hogan.walk(tree, context);
|
||||||
|
|
||||||
|
if (options.asString) {
|
||||||
|
return this.stringify(context, text, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.makeTemplate(context, text, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.wrapMain = function(code) {
|
||||||
|
return 'var t=this;t.b(i=i||"");' + code + 'return t.fl();';
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.template = Hogan.Template;
|
||||||
|
|
||||||
|
Hogan.makeTemplate = function(codeObj, text, options) {
|
||||||
|
var template = this.makePartials(codeObj);
|
||||||
|
template.code = new Function('c', 'p', 'i', this.wrapMain(codeObj.code));
|
||||||
|
return new this.template(template, text, this, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.makePartials = function(codeObj) {
|
||||||
|
var key, template = {subs: {}, partials: codeObj.partials, name: codeObj.name};
|
||||||
|
for (key in template.partials) {
|
||||||
|
template.partials[key] = this.makePartials(template.partials[key]);
|
||||||
|
}
|
||||||
|
for (key in codeObj.subs) {
|
||||||
|
template.subs[key] = new Function('c', 'p', 't', 'i', codeObj.subs[key]);
|
||||||
|
}
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
|
||||||
|
function esc(s) {
|
||||||
|
return s.replace(rSlash, '\\\\')
|
||||||
|
.replace(rQuot, '\\\"')
|
||||||
|
.replace(rNewline, '\\n')
|
||||||
|
.replace(rCr, '\\r')
|
||||||
|
.replace(rLineSep, '\\u2028')
|
||||||
|
.replace(rParagraphSep, '\\u2029');
|
||||||
|
}
|
||||||
|
|
||||||
|
function chooseMethod(s) {
|
||||||
|
return (~s.indexOf('.')) ? 'd' : 'f';
|
||||||
|
}
|
||||||
|
|
||||||
|
function createPartial(node, context) {
|
||||||
|
var prefix = "<" + (context.prefix || "");
|
||||||
|
var sym = prefix + node.n + serialNo++;
|
||||||
|
context.partials[sym] = {name: node.n, partials: {}};
|
||||||
|
context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || '') + '"));';
|
||||||
|
return sym;
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.codegen = {
|
||||||
|
'#': function(node, context) {
|
||||||
|
context.code += 'if(t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),' +
|
||||||
|
'c,p,0,' + node.i + ',' + node.end + ',"' + node.otag + " " + node.ctag + '")){' +
|
||||||
|
't.rs(c,p,' + 'function(c,p,t){';
|
||||||
|
Hogan.walk(node.nodes, context);
|
||||||
|
context.code += '});c.pop();}';
|
||||||
|
},
|
||||||
|
|
||||||
|
'^': function(node, context) {
|
||||||
|
context.code += 'if(!t.s(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){';
|
||||||
|
Hogan.walk(node.nodes, context);
|
||||||
|
context.code += '};';
|
||||||
|
},
|
||||||
|
|
||||||
|
'>': createPartial,
|
||||||
|
'<': function(node, context) {
|
||||||
|
var ctx = {partials: {}, code: '', subs: {}, inPartial: true};
|
||||||
|
Hogan.walk(node.nodes, ctx);
|
||||||
|
var template = context.partials[createPartial(node, context)];
|
||||||
|
template.subs = ctx.subs;
|
||||||
|
template.partials = ctx.partials;
|
||||||
|
},
|
||||||
|
|
||||||
|
'$': function(node, context) {
|
||||||
|
var ctx = {subs: {}, code: '', partials: context.partials, prefix: node.n};
|
||||||
|
Hogan.walk(node.nodes, ctx);
|
||||||
|
context.subs[node.n] = ctx.code;
|
||||||
|
if (!context.inPartial) {
|
||||||
|
context.code += 't.sub("' + esc(node.n) + '",c,p,i);';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'\n': function(node, context) {
|
||||||
|
context.code += write('"\\n"' + (node.last ? '' : ' + i'));
|
||||||
|
},
|
||||||
|
|
||||||
|
'_v': function(node, context) {
|
||||||
|
context.code += 't.b(t.v(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));';
|
||||||
|
},
|
||||||
|
|
||||||
|
'_t': function(node, context) {
|
||||||
|
context.code += write('"' + esc(node.text) + '"');
|
||||||
|
},
|
||||||
|
|
||||||
|
'{': tripleStache,
|
||||||
|
|
||||||
|
'&': tripleStache
|
||||||
|
}
|
||||||
|
|
||||||
|
function tripleStache(node, context) {
|
||||||
|
context.code += 't.b(t.t(t.' + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));';
|
||||||
|
}
|
||||||
|
|
||||||
|
function write(s) {
|
||||||
|
return 't.b(' + s + ');';
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.walk = function(nodelist, context) {
|
||||||
|
var func;
|
||||||
|
for (var i = 0, l = nodelist.length; i < l; i++) {
|
||||||
|
func = Hogan.codegen[nodelist[i].tag];
|
||||||
|
func && func(nodelist[i], context);
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.parse = function(tokens, text, options) {
|
||||||
|
options = options || {};
|
||||||
|
return buildTree(tokens, '', [], options.sectionTags || []);
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.cache = {};
|
||||||
|
|
||||||
|
Hogan.cacheKey = function(text, options) {
|
||||||
|
return [text, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join('||');
|
||||||
|
}
|
||||||
|
|
||||||
|
Hogan.compile = function(text, options) {
|
||||||
|
options = options || {};
|
||||||
|
var key = Hogan.cacheKey(text, options);
|
||||||
|
var template = this.cache[key];
|
||||||
|
|
||||||
|
if (template) {
|
||||||
|
var partials = template.partials;
|
||||||
|
for (var name in partials) {
|
||||||
|
delete partials[name].instance;
|
||||||
|
}
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
|
||||||
|
template = this.generate(this.parse(this.scan(text, options.delimiters), text, options), text, options);
|
||||||
|
return this.cache[key] = template;
|
||||||
|
}
|
||||||
|
})(typeof exports !== 'undefined' ? exports : Hogan);
|
||||||
|
|
||||||
|
|
||||||
|
var Mustache = (function (Hogan) {
|
||||||
|
|
||||||
|
// Mustache.js has non-spec partial context behavior
|
||||||
|
function mustachePartial(name, context, partials, indent) {
|
||||||
|
var partialScope = this.f(name, context, partials, 0);
|
||||||
|
var cx = context;
|
||||||
|
if (partialScope) {
|
||||||
|
cx = cx.concat(partialScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Hogan.Template.prototype.rp.call(this, name, cx, partials, indent);
|
||||||
|
}
|
||||||
|
|
||||||
|
var HoganTemplateWrapper = function(renderFunc, text, compiler){
|
||||||
|
this.rp = mustachePartial;
|
||||||
|
Hogan.Template.call(this, renderFunc, text, compiler);
|
||||||
|
};
|
||||||
|
HoganTemplateWrapper.prototype = Hogan.Template.prototype;
|
||||||
|
|
||||||
|
// Add a wrapper for Hogan's generate method. Mustache and Hogan keep
|
||||||
|
// separate caches, and Mustache returns wrapped templates.
|
||||||
|
var wrapper;
|
||||||
|
var HoganWrapper = function(){
|
||||||
|
this.cache = {};
|
||||||
|
this.generate = function(code, text, options) {
|
||||||
|
return new HoganTemplateWrapper(new Function('c', 'p', 'i', code), text, wrapper);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
HoganWrapper.prototype = Hogan;
|
||||||
|
wrapper = new HoganWrapper();
|
||||||
|
|
||||||
|
return {
|
||||||
|
to_html: function(text, data, partials, sendFun) {
|
||||||
|
var template = wrapper.compile(text);
|
||||||
|
var result = template.render(data, partials);
|
||||||
|
if (!sendFun) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendFun(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})(Hogan);
|
627
assets/js/simple-media.js
Normal file
@ -0,0 +1,627 @@
|
|||||||
|
function InitPxVideo(options) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// Replace all
|
||||||
|
// ---------------------------------
|
||||||
|
if (!String.prototype.replaceAll) {
|
||||||
|
Object.defineProperty(String.prototype, "replaceAll", {
|
||||||
|
value: function(find, replace) {
|
||||||
|
return this.replace(new RegExp(find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), replace);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utilities for caption time codes
|
||||||
|
function video_timecode_min(tc) {
|
||||||
|
var tcpair = [];
|
||||||
|
tcpair = tc.split(" --> ");
|
||||||
|
return videosub_tcsecs(tcpair[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function video_timecode_max(tc) {
|
||||||
|
var tcpair = [];
|
||||||
|
tcpair = tc.split(" --> ");
|
||||||
|
return videosub_tcsecs(tcpair[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function videosub_tcsecs(tc) {
|
||||||
|
if (tc === null || tc === undefined) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var tc1 = [],
|
||||||
|
tc2 = [],
|
||||||
|
seconds;
|
||||||
|
tc1 = tc.split(",");
|
||||||
|
tc2 = tc1[0].split(":");
|
||||||
|
seconds = Math.floor(tc2[0]*60*60) + Math.floor(tc2[1]*60) + Math.floor(tc2[2]);
|
||||||
|
return seconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For "manual" captions, adjust caption position when play time changed (via rewind, clicking progress bar, etc.)
|
||||||
|
function adjustManualCaptions(obj) {
|
||||||
|
obj.subcount = 0;
|
||||||
|
while (video_timecode_max(obj.captions[obj.subcount][0]) < obj.movie.currentTime.toFixed(1)) {
|
||||||
|
obj.subcount++;
|
||||||
|
if (obj.subcount > obj.captions.length-1) {
|
||||||
|
obj.subcount = obj.captions.length-1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display captions container and button (for initialization)
|
||||||
|
function showCaptionContainerAndButton(obj) {
|
||||||
|
//obj.captionsBtnContainer.className = "px-video-captions-btn-container show";
|
||||||
|
if (obj.isCaptionDefault) {
|
||||||
|
obj.captionsContainer.className = "px-video-captions show";
|
||||||
|
obj.captionsBtn.setAttribute("checked", "checked");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unfortunately, due to scattered support, browser sniffing is required
|
||||||
|
function browserSniff() {
|
||||||
|
var nAgt = navigator.userAgent,
|
||||||
|
browserName = navigator.appName,
|
||||||
|
fullVersion = ""+parseFloat(navigator.appVersion),
|
||||||
|
majorVersion = parseInt(navigator.appVersion,10),
|
||||||
|
nameOffset,
|
||||||
|
verOffset,
|
||||||
|
ix;
|
||||||
|
|
||||||
|
// MSIE 11
|
||||||
|
if ((navigator.appVersion.indexOf("Windows NT") !== -1) && (navigator.appVersion.indexOf("rv:11") !== -1)) {
|
||||||
|
browserName = "IE";
|
||||||
|
fullVersion = "11;";
|
||||||
|
}
|
||||||
|
// MSIE
|
||||||
|
else if ((verOffset=nAgt.indexOf("MSIE")) !== -1) {
|
||||||
|
browserName = "IE";
|
||||||
|
fullVersion = nAgt.substring(verOffset+5);
|
||||||
|
}
|
||||||
|
// Chrome
|
||||||
|
else if ((verOffset=nAgt.indexOf("Chrome")) !== -1) {
|
||||||
|
browserName = "Chrome";
|
||||||
|
fullVersion = nAgt.substring(verOffset+7);
|
||||||
|
}
|
||||||
|
// Safari
|
||||||
|
else if ((verOffset=nAgt.indexOf("Safari")) !== -1) {
|
||||||
|
browserName = "Safari";
|
||||||
|
fullVersion = nAgt.substring(verOffset+7);
|
||||||
|
if ((verOffset=nAgt.indexOf("Version")) !== -1) {
|
||||||
|
fullVersion = nAgt.substring(verOffset+8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Firefox
|
||||||
|
else if ((verOffset=nAgt.indexOf("Firefox")) !== -1) {
|
||||||
|
browserName = "Firefox";
|
||||||
|
fullVersion = nAgt.substring(verOffset+8);
|
||||||
|
}
|
||||||
|
// In most other browsers, "name/version" is at the end of userAgent
|
||||||
|
else if ( (nameOffset=nAgt.lastIndexOf(" ")+1) < (verOffset=nAgt.lastIndexOf("/")) ) {
|
||||||
|
browserName = nAgt.substring(nameOffset,verOffset);
|
||||||
|
fullVersion = nAgt.substring(verOffset+1);
|
||||||
|
if (browserName.toLowerCase()==browserName.toUpperCase()) {
|
||||||
|
browserName = navigator.appName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Trim the fullVersion string at semicolon/space if present
|
||||||
|
if ((ix=fullVersion.indexOf(";")) !== -1) {
|
||||||
|
fullVersion=fullVersion.substring(0,ix);
|
||||||
|
}
|
||||||
|
if ((ix=fullVersion.indexOf(" ")) !== -1) {
|
||||||
|
fullVersion=fullVersion.substring(0,ix);
|
||||||
|
}
|
||||||
|
// Get major version
|
||||||
|
majorVersion = parseInt(""+fullVersion,10);
|
||||||
|
if (isNaN(majorVersion)) {
|
||||||
|
fullVersion = ""+parseFloat(navigator.appVersion);
|
||||||
|
majorVersion = parseInt(navigator.appVersion,10);
|
||||||
|
}
|
||||||
|
// Return data
|
||||||
|
return [browserName, majorVersion];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Global variable
|
||||||
|
var obj = {};
|
||||||
|
|
||||||
|
obj.arBrowserInfo = browserSniff();
|
||||||
|
obj.browserName = obj.arBrowserInfo[0];
|
||||||
|
obj.browserMajorVersion = obj.arBrowserInfo[1];
|
||||||
|
|
||||||
|
// If IE8, stop customization (use fallback)
|
||||||
|
// If IE9, stop customization (use native controls)
|
||||||
|
if (obj.browserName === "IE" && (obj.browserMajorVersion === 8 || obj.browserMajorVersion === 9) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If smartphone or tablet, stop customization as video (and captions in latest devices) are handled natively
|
||||||
|
obj.isSmartphoneOrTablet = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
|
||||||
|
if (obj.isSmartphoneOrTablet) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set debug mode
|
||||||
|
if (typeof(options.debug)==="undefined") {
|
||||||
|
options.debug = false;
|
||||||
|
}
|
||||||
|
obj.debug = options.debug;
|
||||||
|
|
||||||
|
// Output browser info to log if debug on
|
||||||
|
if (options.debug) {
|
||||||
|
console.log(obj.browserName + " " + obj.browserMajorVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up aria-label for Play button with the videoTitle option
|
||||||
|
if ((typeof(options.videoTitle)==="undefined") || (options.videoTitle==="")) {
|
||||||
|
obj.playAriaLabel = "Play";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.playAriaLabel = "Play video, " + options.videoTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the container, video element, and controls container
|
||||||
|
obj.container = document.getElementById(options.videoId);
|
||||||
|
obj.container.className = obj.container.className + " stopped";
|
||||||
|
obj.movie = obj.container.getElementsByTagName("video")[0];
|
||||||
|
obj.controls = obj.container.getElementsByClassName("px-video-controls")[0];
|
||||||
|
|
||||||
|
// Remove native video controls
|
||||||
|
obj.movie.removeAttribute("controls");
|
||||||
|
|
||||||
|
// Generate random number for ID/FOR attribute values for controls
|
||||||
|
obj.randomNum = Math.floor(Math.random() * (10000));
|
||||||
|
|
||||||
|
// Insert custom video controls
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("Inserting custom video controls");
|
||||||
|
}
|
||||||
|
obj.controls.innerHTML = options.html
|
||||||
|
.replaceAll("{aria-label}", obj.playAriaLabel)
|
||||||
|
.replaceAll("{id}", obj.randomNum);
|
||||||
|
|
||||||
|
// Responsive ffs
|
||||||
|
// ----
|
||||||
|
// Adjust layout per width of video - container
|
||||||
|
//obj.movieWidth = obj.movie.width;
|
||||||
|
//if (obj.movieWidth < 360) {
|
||||||
|
// obj.movieWidth = 360;
|
||||||
|
//}
|
||||||
|
//obj.container.setAttribute("style", "width:" + obj.movieWidth + "px");
|
||||||
|
|
||||||
|
// Adjust layout per width of video - controls/mute offset
|
||||||
|
obj.labelMute = document.getElementById("labelMute" + obj.randomNum);
|
||||||
|
obj.labelMuteOffset = obj.movieWidth - 390;
|
||||||
|
if (obj.labelMuteOffset < 0) {
|
||||||
|
obj.labelMuteOffset = 0;
|
||||||
|
}
|
||||||
|
obj.labelMute.setAttribute("style", "margin-left:" + obj.labelMuteOffset + "px");
|
||||||
|
|
||||||
|
// Get URL of caption file if exists
|
||||||
|
var captionSrc = "",
|
||||||
|
kind,
|
||||||
|
children = obj.movie.childNodes;
|
||||||
|
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
if (children[i].nodeName.toLowerCase() === "track") {
|
||||||
|
kind = children[i].getAttribute("kind");
|
||||||
|
if (kind === "captions") {
|
||||||
|
captionSrc = children[i].getAttribute("src");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Record if caption file exists or not
|
||||||
|
obj.captionExists = true;
|
||||||
|
if (captionSrc === "") {
|
||||||
|
obj.captionExists = false;
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("No caption track found.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("Caption track found; URI: " + captionSrc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set captions on/off - on by default
|
||||||
|
if (typeof(options.captionsOnDefault) === "undefined") {
|
||||||
|
options.captionsOnDefault = true;
|
||||||
|
}
|
||||||
|
obj.isCaptionDefault = options.captionsOnDefault;
|
||||||
|
|
||||||
|
// Number of seconds for rewind and forward buttons
|
||||||
|
if (typeof(options.seekInterval) === "undefined") {
|
||||||
|
options.seekInterval = 10;
|
||||||
|
}
|
||||||
|
obj.seekInterval = options.seekInterval;
|
||||||
|
|
||||||
|
// Get the elements for the controls
|
||||||
|
obj.btnPlay = obj.container.getElementsByClassName("px-video-play")[0];
|
||||||
|
obj.btnPause = obj.container.getElementsByClassName("px-video-pause")[0];
|
||||||
|
obj.btnRestart = obj.container.getElementsByClassName("px-video-restart")[0];
|
||||||
|
obj.btnRewind = obj.container.getElementsByClassName("px-video-rewind")[0];
|
||||||
|
obj.btnForward = obj.container.getElementsByClassName("px-video-forward")[0];
|
||||||
|
obj.btnVolume = obj.container.getElementsByClassName("px-video-volume")[0];
|
||||||
|
obj.btnMute = obj.container.getElementsByClassName("px-video-mute")[0];
|
||||||
|
obj.progressBar = obj.container.getElementsByClassName("px-video-progress")[0];
|
||||||
|
obj.progressBarSpan = obj.progressBar.getElementsByTagName("span")[0];
|
||||||
|
obj.captionsContainer = obj.container.getElementsByClassName("px-video-captions")[0];
|
||||||
|
obj.captionsBtn = obj.container.getElementsByClassName("px-video-btnCaptions")[0];
|
||||||
|
obj.captionsBtnContainer = obj.container.getElementsByClassName("px-video-captions-btn-container")[0];
|
||||||
|
obj.duration = obj.container.getElementsByClassName("px-video-duration")[0];
|
||||||
|
obj.txtSeconds = obj.container.getElementsByClassName("px-seconds");
|
||||||
|
|
||||||
|
// Update number of seconds in rewind and fast forward buttons
|
||||||
|
obj.txtSeconds[0].innerHTML = obj.seekInterval;
|
||||||
|
obj.txtSeconds[1].innerHTML = obj.seekInterval;
|
||||||
|
|
||||||
|
// Determine if HTML5 textTracks is supported (for captions)
|
||||||
|
obj.isTextTracks = false;
|
||||||
|
if (obj.movie.textTracks) {
|
||||||
|
obj.isTextTracks = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Play
|
||||||
|
obj.btnPlay.addEventListener("click", function() {
|
||||||
|
obj.movie.play();
|
||||||
|
|
||||||
|
obj.container.className = obj.container.className.replace("stopped", "playing");
|
||||||
|
|
||||||
|
obj.btnPlay.className = "px-video-play hide";
|
||||||
|
obj.btnPause.className = "px-video-pause px-video-show-inline";
|
||||||
|
obj.btnPause.focus();
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Pause
|
||||||
|
obj.btnPause.addEventListener("click", function() {
|
||||||
|
obj.movie.pause();
|
||||||
|
|
||||||
|
obj.container.className = obj.container.className.replace("playing", "stopped");
|
||||||
|
|
||||||
|
obj.btnPlay.className = "px-video-play px-video-show-inline";
|
||||||
|
obj.btnPause.className = "px-video-pause hide";
|
||||||
|
obj.btnPlay.focus();
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Restart
|
||||||
|
obj.btnRestart.addEventListener("click", function() {
|
||||||
|
// Move to beginning
|
||||||
|
obj.movie.currentTime = 0;
|
||||||
|
|
||||||
|
// Special handling for "manual" captions
|
||||||
|
if (!obj.isTextTracks) {
|
||||||
|
obj.subcount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Play and ensure the play button is in correct state
|
||||||
|
obj.movie.play();
|
||||||
|
obj.btnPlay.className = "px-video-play hide";
|
||||||
|
obj.btnPause.className = "px-video-pause px-video-show-inline";
|
||||||
|
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Rewind
|
||||||
|
obj.btnRewind.addEventListener("click", function() {
|
||||||
|
var targetTime = obj.movie.currentTime - obj.seekInterval;
|
||||||
|
if (targetTime < 0) {
|
||||||
|
obj.movie.currentTime = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.movie.currentTime = targetTime;
|
||||||
|
}
|
||||||
|
// Special handling for "manual" captions
|
||||||
|
if (!obj.isTextTracks) {
|
||||||
|
adjustManualCaptions(obj);
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Fast forward
|
||||||
|
obj.btnForward.addEventListener("click", function() {
|
||||||
|
var targetTime = obj.movie.currentTime + obj.seekInterval;
|
||||||
|
if (targetTime > obj.movie.duration) {
|
||||||
|
obj.movie.currentTime = obj.movie.duration;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.movie.currentTime = targetTime;
|
||||||
|
}
|
||||||
|
// Special handling for "manual" captions
|
||||||
|
if (!obj.isTextTracks) {
|
||||||
|
adjustManualCaptions(obj);
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Get the HTML5 range input element and append audio volume adjustment on change
|
||||||
|
obj.btnVolume.addEventListener("change", function() {
|
||||||
|
obj.movie.volume = parseFloat(this.value / 10);
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Mute
|
||||||
|
obj.btnMute.addEventListener("click", function() {
|
||||||
|
if (obj.movie.muted === true) {
|
||||||
|
obj.movie.muted = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.movie.muted = true;
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Duration
|
||||||
|
obj.movie.addEventListener("timeupdate", function() {
|
||||||
|
obj.secs = parseInt(obj.movie.currentTime % 60);
|
||||||
|
obj.mins = parseInt((obj.movie.currentTime / 60) % 60);
|
||||||
|
|
||||||
|
// Ensure it"s two digits. For example, 03 rather than 3.
|
||||||
|
obj.secs = ("0" + obj.secs).slice(-2);
|
||||||
|
obj.mins = ("0" + obj.mins).slice(-2);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
obj.duration.innerHTML = obj.mins + ":" + obj.secs;
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Progress bar
|
||||||
|
obj.movie.addEventListener("timeupdate", function() {
|
||||||
|
obj.percent = (100 / obj.movie.duration) * obj.movie.currentTime;
|
||||||
|
if (obj.percent > 0) {
|
||||||
|
obj.progressBar.value = obj.percent;
|
||||||
|
obj.progressBarSpan.innerHTML = obj.percent;
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// Skip when clicking progress bar
|
||||||
|
obj.progressBar.addEventListener("click", function(e) {
|
||||||
|
obj.pos = (e.pageX - this.offsetLeft) / this.offsetWidth;
|
||||||
|
obj.movie.currentTime = obj.pos * obj.movie.duration;
|
||||||
|
|
||||||
|
// Special handling for "manual" captions
|
||||||
|
if (!obj.isTextTracks) {
|
||||||
|
adjustManualCaptions(obj);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Clear captions at end of video
|
||||||
|
obj.movie.addEventListener("ended", function() {
|
||||||
|
obj.captionsContainer.innerHTML = "";
|
||||||
|
});
|
||||||
|
|
||||||
|
// ***
|
||||||
|
// Captions
|
||||||
|
// ***
|
||||||
|
|
||||||
|
// Toggle display of captions via captions button
|
||||||
|
obj.captionsBtn.addEventListener("click", function() {
|
||||||
|
if (this.checked) {
|
||||||
|
obj.captionsContainer.className = "px-video-captions show";
|
||||||
|
} else {
|
||||||
|
obj.captionsContainer.className = "px-video-captions hide";
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
// If no caption file exists, hide container for caption text
|
||||||
|
if (!obj.captionExists) {
|
||||||
|
obj.captionsContainer.className = "px-video-captions hide";
|
||||||
|
}
|
||||||
|
|
||||||
|
// If caption file exists, process captions
|
||||||
|
else {
|
||||||
|
|
||||||
|
// If IE 10/11 or Firefox 31+ or Safari 7+, don"t use native captioning (still doesn"t work although they claim it"s now supported)
|
||||||
|
if ((obj.browserName==="IE" && obj.browserMajorVersion===10) ||
|
||||||
|
(obj.browserName==="IE" && obj.browserMajorVersion===11) ||
|
||||||
|
(obj.browserName==="Firefox" && obj.browserMajorVersion>=31) ||
|
||||||
|
(obj.browserName==="Safari" && obj.browserMajorVersion>=7)) {
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("Detected IE 10/11 or Firefox 31+ or Safari 7+");
|
||||||
|
}
|
||||||
|
// set to false so skips to "manual" captioning
|
||||||
|
obj.isTextTracks = false;
|
||||||
|
|
||||||
|
// turn off native caption rendering to avoid double captions [doesn"t work in Safari 7; see patch below]
|
||||||
|
var track = {};
|
||||||
|
var tracks = obj.movie.textTracks;
|
||||||
|
for (var j=0; j < tracks.length; j++) {
|
||||||
|
track = obj.movie.textTracks[j];
|
||||||
|
track.mode = "hidden";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rendering caption tracks - native support required - http://caniuse.com/webvtt
|
||||||
|
if (obj.isTextTracks) {
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("textTracks supported");
|
||||||
|
}
|
||||||
|
showCaptionContainerAndButton(obj);
|
||||||
|
|
||||||
|
var track = {};
|
||||||
|
var tracks = obj.movie.textTracks;
|
||||||
|
for (var j=0; j < tracks.length; j++) {
|
||||||
|
track = obj.movie.textTracks[j];
|
||||||
|
track.mode = "hidden";
|
||||||
|
if (track.kind === "captions") {
|
||||||
|
track.addEventListener("cuechange",function() {
|
||||||
|
if (this.activeCues[0]) {
|
||||||
|
if (this.activeCues[0].hasOwnProperty("text")) {
|
||||||
|
obj.captionsContainer.innerHTML = this.activeCues[0].text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Caption tracks not natively supported
|
||||||
|
else {
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("textTracks not supported so rendering captions manually");
|
||||||
|
}
|
||||||
|
showCaptionContainerAndButton(obj);
|
||||||
|
|
||||||
|
// Render captions from array at appropriate time
|
||||||
|
obj.currentCaption = "";
|
||||||
|
obj.subcount = 0;
|
||||||
|
obj.captions = [];
|
||||||
|
|
||||||
|
obj.movie.addEventListener("timeupdate", function() {
|
||||||
|
// Check if the next caption is in the current time range
|
||||||
|
if (obj.movie.currentTime.toFixed(1) > video_timecode_min(obj.captions[obj.subcount][0]) &&
|
||||||
|
obj.movie.currentTime.toFixed(1) < video_timecode_max(obj.captions[obj.subcount][0])) {
|
||||||
|
obj.currentCaption = obj.captions[obj.subcount][1];
|
||||||
|
}
|
||||||
|
// Is there a next timecode?
|
||||||
|
if (obj.movie.currentTime.toFixed(1) > video_timecode_max(obj.captions[obj.subcount][0]) &&
|
||||||
|
obj.subcount < (obj.captions.length-1)) {
|
||||||
|
obj.subcount++;
|
||||||
|
}
|
||||||
|
// Render the caption
|
||||||
|
obj.captionsContainer.innerHTML = obj.currentCaption;
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
if (captionSrc !== "") {
|
||||||
|
// Create XMLHttpRequest object
|
||||||
|
var xhr;
|
||||||
|
if (window.XMLHttpRequest) {
|
||||||
|
xhr = new XMLHttpRequest();
|
||||||
|
} else if (window.ActiveXObject) { // IE8
|
||||||
|
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
|
}
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("xhr = 200");
|
||||||
|
}
|
||||||
|
|
||||||
|
obj.captions = [];
|
||||||
|
var records = [],
|
||||||
|
record,
|
||||||
|
req = xhr.responseText;
|
||||||
|
records = req.split("\n\n");
|
||||||
|
for (var r=0; r < records.length; r++) {
|
||||||
|
record = records[r];
|
||||||
|
obj.captions[r] = [];
|
||||||
|
obj.captions[r] = record.split("\n");
|
||||||
|
}
|
||||||
|
// Remove first element ("VTT")
|
||||||
|
obj.captions.shift();
|
||||||
|
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("Successfully loaded the caption file via ajax.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (options.debug) {
|
||||||
|
console.log("There was a problem loading the caption file via ajax.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.open("get", captionSrc, true);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If Safari 7, removing track from DOM [see "turn off native caption rendering" above]
|
||||||
|
if (obj.browserName === "Safari" && obj.browserMajorVersion === 7) {
|
||||||
|
console.log("Safari 7 detected; removing track from DOM");
|
||||||
|
var tracks = obj.movie.getElementsByTagName("track");
|
||||||
|
obj.movie.removeChild(tracks[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*$(function() {
|
||||||
|
$("video").simplePlayer();
|
||||||
|
});*/
|
||||||
|
|
||||||
|
// Simple player plugin
|
||||||
|
// ---------------------------------
|
||||||
|
/*;(function($) {
|
||||||
|
$.fn.simplePlayer = function (settings) {
|
||||||
|
// Config defaults
|
||||||
|
var config = {
|
||||||
|
wrapperClass: "media", // Class name added to replaced selects
|
||||||
|
shownClass: "in",
|
||||||
|
autoplay: false,
|
||||||
|
templates: {
|
||||||
|
controls: "<div class="media-controls js-media-controls"> \
|
||||||
|
<button type="button" class="play button-toggle-play js-button-toggle-play"> \
|
||||||
|
<span class="icon-play"></span> \
|
||||||
|
</button> \
|
||||||
|
<div class="progress progress-play js-progress-play" role="progress-bar"> \
|
||||||
|
<div class="progress-buffered js-progress-buffered"></div> \
|
||||||
|
<div class="progress-played js-progress-played"></div> \
|
||||||
|
</div> \
|
||||||
|
<div class="time js-time"> \
|
||||||
|
<span class="time-elapsed js-time-elapsed">88:88</span> \
|
||||||
|
<span class="time-seperator js-time-seperator">/</span> \
|
||||||
|
<span class="time-total js-time-total">88:88</span> \
|
||||||
|
</div> \
|
||||||
|
<div class="volume has-popover js-volume"> \
|
||||||
|
<button type="button" class="button-toggle-mute js-button-toggle-mute"> \
|
||||||
|
<span class="icon-volume-up"></span> \
|
||||||
|
</button> \
|
||||||
|
<div class="popover popover-volume js-popover-volume"> \
|
||||||
|
<div class="progress vertical-progress progress-audio-volume js-progress-audio-volume"> \
|
||||||
|
<div class="progress-volume js-progress-volume" style="height: 80%"></div> \
|
||||||
|
</div> \
|
||||||
|
<div class="volume-label js-volume-label">100%</div> \
|
||||||
|
</div> \
|
||||||
|
</div> \
|
||||||
|
<button type="button" class="fullscreen button-fullscreen js-button-fullscreen"> \
|
||||||
|
<span class="icon-resize-full"></span> \
|
||||||
|
</button> \
|
||||||
|
</div>",
|
||||||
|
overlay: "<div class="overlay overlay-play"><span><i class="icon-play"></i></span></div>"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Extend settings if they"re passed
|
||||||
|
if (settings) {
|
||||||
|
$.extend(config, settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.each(function() {
|
||||||
|
var player = this,
|
||||||
|
status = {},
|
||||||
|
$player = $(this).wrap("<div class="" + config.wrapperClass + (config.autoplay ? " playing" : " stopped") + "" />"),
|
||||||
|
$wrapper = $player.parents("." + config.wrapperClass),
|
||||||
|
supportMP4 = (function (v) { return (v.canPlayType && v.canPlayType("video/mp4")); }(document.createElement("video")));
|
||||||
|
|
||||||
|
console.log($wrapper);
|
||||||
|
|
||||||
|
// Inject the controls
|
||||||
|
$(config.templates.controls).insertAfter($player);
|
||||||
|
$(config.templates.overlay).insertAfter($player);
|
||||||
|
|
||||||
|
// Select controls
|
||||||
|
var $playbackToggle = $(".js-button-toggle-play"),
|
||||||
|
$muteToggle = $(".js-button-toggle-mute");
|
||||||
|
|
||||||
|
function togglePlayback() {
|
||||||
|
if(status.playing && status.playing == true) {
|
||||||
|
player.pause();
|
||||||
|
status.playing = false;
|
||||||
|
$wrapper.removeClass("playing").addClass("paused");
|
||||||
|
} else {
|
||||||
|
player.play();
|
||||||
|
status.playing = true;
|
||||||
|
$wrapper.removeClass("paused stopped").addClass("playing");
|
||||||
|
}
|
||||||
|
$("span", this).attr("class", "icon-" + (status.playing ? "pause" : "play"));
|
||||||
|
};
|
||||||
|
|
||||||
|
function toggleMute() {
|
||||||
|
player.muted = !status.muted;
|
||||||
|
status.muted = player.muted;
|
||||||
|
$("span", this).attr("class", "icon-" + (status.muted ? "mute" : "volume-up"));
|
||||||
|
};
|
||||||
|
|
||||||
|
$playbackToggle.on("click", togglePlayback);
|
||||||
|
$muteToggle.on("click", toggleMute);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
})(jQuery);*/
|
37
assets/less/docs.less
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// ==========================================================================
|
||||||
|
// HTML5 Video Player Demo Page
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
// Reset
|
||||||
|
@import "lib/normalize.less";
|
||||||
|
// Mixins
|
||||||
|
@import "lib/mixins.less";
|
||||||
|
|
||||||
|
// BORDER-BOX ALL THE THINGS!
|
||||||
|
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||||
|
*, *::after, *::before {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
font-size: 62.5%;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
.font-size(18);
|
||||||
|
color: #6D797F;
|
||||||
|
line-height: 1.5;
|
||||||
|
background: #ECF0F1;
|
||||||
|
max-width: 960px;
|
||||||
|
margin: 50px auto;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
.font-size(48);
|
||||||
|
letter-spacing: -.025em;
|
||||||
|
color: #2E3C44;
|
||||||
|
margin: 0 0 20px;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0 0 20px;
|
||||||
|
}
|
27
assets/less/lib/mixins.less
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// ==========================================================================
|
||||||
|
// Mixins
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
|
||||||
|
.clearfix() {
|
||||||
|
zoom: 1;
|
||||||
|
&:before,
|
||||||
|
&:after { content: ""; display: table; }
|
||||||
|
&:after { clear: both; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Webkit-style focus
|
||||||
|
.tab-focus() {
|
||||||
|
// Default
|
||||||
|
outline: thin dotted @gray-dark;
|
||||||
|
// Webkit
|
||||||
|
//outline: 5px auto -webkit-focus-ring-color;
|
||||||
|
outline-offset: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use rems for font sizing
|
||||||
|
.font-size(@font-size: 16){
|
||||||
|
@rem: (@font-size / 10);
|
||||||
|
font-size: @font-size * 1px;
|
||||||
|
font-size: ~"@{rem}rem";
|
||||||
|
}
|
406
assets/less/lib/normalize.less
vendored
Normal file
@ -0,0 +1,406 @@
|
|||||||
|
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
HTML5 display definitions
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct `block` display not defined in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
details,
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
hgroup,
|
||||||
|
main,
|
||||||
|
nav,
|
||||||
|
section,
|
||||||
|
summary {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct `inline-block` display not defined in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio,
|
||||||
|
canvas,
|
||||||
|
video {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent modern browsers from displaying `audio` without controls.
|
||||||
|
* Remove excess height in iOS 5 devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio:not([controls]) {
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address `[hidden]` styling not present in IE 8/9.
|
||||||
|
* Hide the `template` element in IE, Safari, and Firefox < 22.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[hidden],
|
||||||
|
template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Base
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Set default font family to sans-serif.
|
||||||
|
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||||
|
* user zoom.
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: sans-serif; /* 1 */
|
||||||
|
-ms-text-size-adjust: 100%; /* 2 */
|
||||||
|
-webkit-text-size-adjust: 100%; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove default margin.
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Links
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the gray background color from active links in IE 10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address `outline` inconsistency between Chrome and other browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a:focus {
|
||||||
|
outline: thin dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Improve readability when focused and also mouse hovered in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a:active,
|
||||||
|
a:hover {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Typography
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address variable `h1` font-size and margin within `section` and `article`
|
||||||
|
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0.67em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address styling not present in IE 8/9, Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: 1px dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address styling not present in Safari 5 and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address differences between Firefox and other browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
hr {
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address styling not present in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
mark {
|
||||||
|
background: #ff0;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct font family set oddly in Safari 5 and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
pre,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, serif;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Improve readability of pre-formatted text in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set consistent quote types.
|
||||||
|
*/
|
||||||
|
|
||||||
|
q {
|
||||||
|
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address inconsistent and variable font size in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Embedded content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove border when inside `a` element in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct overflow displayed oddly in IE 9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
svg:not(:root) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Figures
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address margin not present in IE 8/9 and Safari 5.
|
||||||
|
*/
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Forms
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define consistent border, margin, and padding.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
margin: 0 2px;
|
||||||
|
padding: 0.35em 0.625em 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct `color` not being inherited in IE 8/9.
|
||||||
|
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||||
|
*/
|
||||||
|
|
||||||
|
legend {
|
||||||
|
border: 0; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct font family not being inherited in all browsers.
|
||||||
|
* 2. Correct font size not being inherited in all browsers.
|
||||||
|
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: inherit; /* 1 */
|
||||||
|
font-size: 100%; /* 2 */
|
||||||
|
margin: 0; /* 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||||
|
* the UA stylesheet.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input {
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||||
|
* All other form control elements do not inherit `text-transform` values.
|
||||||
|
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
|
||||||
|
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
select {
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||||
|
* and `video` controls.
|
||||||
|
* 2. Correct inability to style clickable `input` types in iOS.
|
||||||
|
* 3. Improve usability and consistency of cursor style between image-type
|
||||||
|
* `input` and others.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
html input[type="button"], /* 1 */
|
||||||
|
input[type="reset"],
|
||||||
|
input[type="submit"] {
|
||||||
|
-webkit-appearance: button; /* 2 */
|
||||||
|
cursor: pointer; /* 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Re-set default cursor for disabled elements.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button[disabled],
|
||||||
|
html input[disabled] {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||||
|
* 2. Remove excess padding in IE 8/9/10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="checkbox"],
|
||||||
|
input[type="radio"] {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||||
|
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||||
|
* (include `-moz` to future-proof).
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="search"] {
|
||||||
|
-webkit-appearance: textfield; /* 1 */
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
-webkit-box-sizing: content-box; /* 2 */
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
||||||
|
* on OS X.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="search"]::-webkit-search-cancel-button,
|
||||||
|
input[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove inner padding and border in Firefox 4+.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
input::-moz-focus-inner {
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Remove default vertical scrollbar in IE 8/9.
|
||||||
|
* 2. Improve readability and alignment in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto; /* 1 */
|
||||||
|
vertical-align: top; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Tables
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove most spacing between table cells.
|
||||||
|
*/
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
552
assets/less/simple-player.less
Normal file
@ -0,0 +1,552 @@
|
|||||||
|
// ==========================================================================
|
||||||
|
// HTML5 Media Player
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
// Variables
|
||||||
|
// -------------------------------
|
||||||
|
@base-color: #2E3C44;
|
||||||
|
@green: #1ABC9C;
|
||||||
|
@red: #D44334;
|
||||||
|
//@green: #4CB953;
|
||||||
|
@blue: #3498DB;
|
||||||
|
@control-color: @blue;
|
||||||
|
|
||||||
|
|
||||||
|
// BORDER-BOX ALL THE THINGS! (http://paulirish.com/2012/box-sizing-border-box-ftw/)
|
||||||
|
// -------------------------------
|
||||||
|
.player,
|
||||||
|
.player *,
|
||||||
|
.player *::after,
|
||||||
|
.player *::before {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utility classes & mixins
|
||||||
|
// -------------------------------
|
||||||
|
.sr-only {
|
||||||
|
position: absolute !important;
|
||||||
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
|
padding: 0 !important;
|
||||||
|
border: 0 !important;
|
||||||
|
height: 1px !important;
|
||||||
|
width: 1px !important;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.show-inline {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
|
||||||
|
.clearfix() {
|
||||||
|
zoom: 1;
|
||||||
|
&:before,
|
||||||
|
&:after { content: ""; display: table; }
|
||||||
|
&:after { clear: both; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Base
|
||||||
|
.player {
|
||||||
|
position: relative;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden; // For the controls
|
||||||
|
|
||||||
|
video {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
svg {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
.controls {
|
||||||
|
.clearfix();
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 10px 5px;
|
||||||
|
background: rgba(0,0,0, .75);
|
||||||
|
transition: transform .3s ease;
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
|
button {
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
label,
|
||||||
|
button {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin: 0 2px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
color: #ddd;
|
||||||
|
transition: background .3s ease;
|
||||||
|
border-radius: 3px;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
display: block;
|
||||||
|
fill: currentColor;
|
||||||
|
transition: fill .3s ease;
|
||||||
|
}
|
||||||
|
&:focus {
|
||||||
|
background: #000;
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background: @control-color;
|
||||||
|
}
|
||||||
|
&:hover svg,
|
||||||
|
&:focus svg {
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.px-video-time {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding-top: 3px;
|
||||||
|
margin-left: 10px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
progress {
|
||||||
|
position: absolute;
|
||||||
|
top: -10px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 10px;
|
||||||
|
margin: 0;
|
||||||
|
vertical-align: top;
|
||||||
|
|
||||||
|
&[value] {
|
||||||
|
/* Reset the default appearance */
|
||||||
|
-webkit-appearance: none;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
&::-webkit-progress-bar {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
&::-webkit-progress-value {
|
||||||
|
background-color: @control-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.play-controls {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.sound-controls {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
/*&.playing .controls {
|
||||||
|
transform: translateY(100%);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* containers */
|
||||||
|
.px-video-img-captions-container * {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.px-video-img-captions-container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* progress indicator */
|
||||||
|
.px-video-progress {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* time */
|
||||||
|
/*.px-video-time {
|
||||||
|
float: right;
|
||||||
|
margin-top: 2px;
|
||||||
|
font-size: 14px;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/* caption area */
|
||||||
|
.px-video-captions {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: .5em;
|
||||||
|
min-height: 2.5em;
|
||||||
|
background-color: #000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 1.1em;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.75;
|
||||||
|
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* buttons */
|
||||||
|
.px-video-controls button {
|
||||||
|
|
||||||
|
//background: no-repeat url('../images/px-video-sprite.png');
|
||||||
|
}
|
||||||
|
.px-video-controls button:focus {
|
||||||
|
//border: 1px #999 dotted;
|
||||||
|
//outline: none;
|
||||||
|
}
|
||||||
|
.px-video-controls button {
|
||||||
|
//cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* captions button */
|
||||||
|
.px-video-captions-btn-container label {
|
||||||
|
display: inline-block;
|
||||||
|
width: 25px;
|
||||||
|
height: 20px;
|
||||||
|
margin-left: 25px;
|
||||||
|
background: no-repeat url('../images/px-video-sprite.png');
|
||||||
|
background-position: -6px -835px;
|
||||||
|
}
|
||||||
|
.px-video-captions-btn-container input[type="checkbox"]:focus+label {
|
||||||
|
outline: 1px #999 dotted;
|
||||||
|
background-position: -6px -799px;
|
||||||
|
}
|
||||||
|
.px-video-captions-btn-container input[type="checkbox"]:hover+label {
|
||||||
|
background-position: -6px -799px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.px-video-captions-btn-container input[type="checkbox"]:focus+label {
|
||||||
|
outline: 1px #999 dotted;
|
||||||
|
background-position: -6px -799px;
|
||||||
|
}
|
||||||
|
.px-video-captions-btn-container input[type="checkbox"]:checked+label {
|
||||||
|
background-position: -6px -871px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* mute button */
|
||||||
|
.px-video-mute-btn-container label {
|
||||||
|
display: inline-block;
|
||||||
|
width: 25px;
|
||||||
|
height: 20px;
|
||||||
|
margin-left: 240px;
|
||||||
|
margin-top: 2px;
|
||||||
|
background: no-repeat url('../images/px-video-sprite.png');
|
||||||
|
background-position: -6px -476px;
|
||||||
|
}
|
||||||
|
.px-video-mute-btn-container input[type="checkbox"]:focus+label {
|
||||||
|
outline: 1px #999 dotted;
|
||||||
|
background-position: -6px -440px;
|
||||||
|
}
|
||||||
|
.px-video-mute-btn-container input[type="checkbox"]:hover+label {
|
||||||
|
background-position: -6px -440px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.px-video-mute-btn-container input[type="checkbox"]:focus+label {
|
||||||
|
outline: 1px #999 dotted;
|
||||||
|
background-position: -6px -440px;
|
||||||
|
}
|
||||||
|
/* checked state of mute button */
|
||||||
|
.px-video-mute-btn-container input[type="checkbox"]:checked+label {
|
||||||
|
background-position: -6px -692px;
|
||||||
|
}
|
||||||
|
.px-video-mute-btn-container input[type="checkbox"]:checked:hover+label,
|
||||||
|
.px-video-mute-btn-container input[type="checkbox"]:checked:focus+label {
|
||||||
|
background-position: -6px -656px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* volume range input */
|
||||||
|
.px-video-controls input[type='range'] {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
height: 6px;
|
||||||
|
width: 100px;
|
||||||
|
margin-top: 8px;
|
||||||
|
background-color: #E6E6E6;
|
||||||
|
outline:none;
|
||||||
|
}
|
||||||
|
.px-video-controls input[type='range']:focus::-webkit-slider-thumb {
|
||||||
|
outline: 1px #999 dotted;
|
||||||
|
}
|
||||||
|
.px-video-controls input[type='range']::-moz-range-track {
|
||||||
|
-moz-appearance: none;
|
||||||
|
height: 6px;
|
||||||
|
background-color: #E6E6E6;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.px-video-controls input[type='range']::-webkit-slider-thumb {
|
||||||
|
-webkit-appearance: none !important;
|
||||||
|
height: 10px;
|
||||||
|
width: 6px;
|
||||||
|
background-color: #666;
|
||||||
|
}
|
||||||
|
.px-video-controls input[type='range']::-moz-range-thumb {
|
||||||
|
height: 12px;
|
||||||
|
width: 8px;
|
||||||
|
}
|
||||||
|
/* fixing display for IE10+ */
|
||||||
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
||||||
|
.px-video-controls input[type='range'] {
|
||||||
|
position: relative;
|
||||||
|
padding: 0;
|
||||||
|
height: 8px;
|
||||||
|
top: -3px;
|
||||||
|
}
|
||||||
|
.px-video-time {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.px-video-captions {
|
||||||
|
padding: 8px;
|
||||||
|
min-height: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*.media {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
|
||||||
|
video {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&::-webkit-media-controls {
|
||||||
|
display:none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.stopped,
|
||||||
|
&.paused {
|
||||||
|
.overlay-play {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.media-controls {
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.media-controls {
|
||||||
|
height: 50px;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
.translate3d(0, 100%, 0);
|
||||||
|
.transition-transform(.5s);
|
||||||
|
|
||||||
|
background-color: @base-color;
|
||||||
|
color: #fff;
|
||||||
|
.font-size(15);
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
font-weight: 600;
|
||||||
|
.user-select(none);
|
||||||
|
|
||||||
|
button {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 8px 15px;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
-webkit-appearance: none;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: #fff;
|
||||||
|
.font-size(24);
|
||||||
|
|
||||||
|
.transition();
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
text-shadow: 0 0 15px @green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
position: relative;
|
||||||
|
.border-radius(10px);
|
||||||
|
height: 10px;
|
||||||
|
background: lighten(@base-color, 10%);
|
||||||
|
|
||||||
|
div {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
left: 0;
|
||||||
|
.border-radius(10px);
|
||||||
|
height: 10px;
|
||||||
|
min-width: 10px; // So it doesn't look strange at 0%
|
||||||
|
|
||||||
|
&.progress-played,
|
||||||
|
&.progress-volume {
|
||||||
|
background: @green;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
&.progress-buffered {
|
||||||
|
background: lighten(@base-color, 20%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.vertical-progress {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 10px;
|
||||||
|
height: auto;
|
||||||
|
min-height: 100px;
|
||||||
|
|
||||||
|
div {
|
||||||
|
bottom: 0;
|
||||||
|
width: 10px;
|
||||||
|
height: auto;
|
||||||
|
min-height: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popover {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
bottom: 100%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
background: @base-color;
|
||||||
|
.border-radius(4px);
|
||||||
|
|
||||||
|
-webkit-animation: pop-upwards 160ms forwards linear;
|
||||||
|
-moz-animation: pop-upwards 160ms forwards linear;
|
||||||
|
-ms-animation: pop-upwards 160ms forwards linear;
|
||||||
|
-o-animation: pop-upwards 160ms forwards linear;
|
||||||
|
animation: pop-upwards 160ms forwards linear;
|
||||||
|
|
||||||
|
.transition();
|
||||||
|
|
||||||
|
// Psuedo bits
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -7px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -7px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-top: 7px solid @base-color;
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
content: '';
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.has-popover:focus,
|
||||||
|
.has-popover:hover {
|
||||||
|
.popover {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popover-volume {
|
||||||
|
width: 54px;
|
||||||
|
padding: 15px 5px 8px;
|
||||||
|
margin-left: -27px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
height: 120px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Layout
|
||||||
|
.play,
|
||||||
|
.progress-play,
|
||||||
|
.volume,
|
||||||
|
.time,
|
||||||
|
.fullscreen {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.play {
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
.progress-play {
|
||||||
|
left: 70px;
|
||||||
|
right: 240px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
right: 120px;
|
||||||
|
width: 100px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1;
|
||||||
|
padding-top: 17px;
|
||||||
|
}
|
||||||
|
.volume {
|
||||||
|
right: 60px;
|
||||||
|
}
|
||||||
|
.fullscreen {
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen
|
||||||
|
and (max-width: 480px) {
|
||||||
|
.time-seperator,
|
||||||
|
.time-total {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
width: 50px;
|
||||||
|
right: 70px;
|
||||||
|
}
|
||||||
|
.fullscreen {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.volume {
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
.progress-play {
|
||||||
|
right: 140px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen
|
||||||
|
and (max-width: 320px) {
|
||||||
|
.time {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.progress-play {
|
||||||
|
right: 70px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.media-pause .mejs-overlay-play {
|
||||||
|
background: rgba(0,0,0, .1);
|
||||||
|
}
|
||||||
|
.overlay {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
background: rgba(0,0,0, .1);
|
||||||
|
}
|
||||||
|
.overlay-play > span {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 1.5;
|
||||||
|
margin: -34px 0 0 -34px !important;
|
||||||
|
text-align: center;
|
||||||
|
background: rgba(red(@base-color), green(@base-color), blue(@base-color), .8);
|
||||||
|
border: 4px solid #fff;
|
||||||
|
color: #fff;
|
||||||
|
.border-radius(50%);
|
||||||
|
@shadow: 0 1px 5px rgba(0,0,0, .25), inset 0 1px 1px rgba(0,0,0,.25);
|
||||||
|
.box-shadow(@shadow);
|
||||||
|
.font-size(34);
|
||||||
|
}*/
|
51
assets/templates/controls.html
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<div class="controls">
|
||||||
|
<progress class="px-video-progress" max="100" value="0"><span>0</span>% played</progress>
|
||||||
|
|
||||||
|
<div class="play-controls">
|
||||||
|
<button class="px-video-restart" data-player="restart">
|
||||||
|
<svg><use xlink:href="#icon-refresh"></use></svg>
|
||||||
|
<span class="sr-only">Restart</span>
|
||||||
|
</button>
|
||||||
|
<button class="px-video-rewind" data-player="rewind">
|
||||||
|
<svg><use xlink:href="#icon-rewind"></use></svg>
|
||||||
|
<span class="sr-only">Rewind <span class="px-seconds">10</span> seconds</span>
|
||||||
|
</button>
|
||||||
|
<button class="px-video-play" aria-label="{aria-label}" data-player="play">
|
||||||
|
<svg><use xlink:href="#icon-play"></use></svg>
|
||||||
|
<span class="sr-only">Play</span>
|
||||||
|
</button>
|
||||||
|
<button class="px-video-pause hide" data-player="pause">
|
||||||
|
<svg><use xlink:href="#icon-pause"></use></svg>
|
||||||
|
<span class="sr-only">Pause</span>
|
||||||
|
</button>
|
||||||
|
<button class="px-video-forward" data-player="fast-forward">
|
||||||
|
<svg><use xlink:href="#icon-fast-forward"></use></svg>
|
||||||
|
<span class="sr-only">Fast forward <span class="px-seconds">10</span> seconds</span>
|
||||||
|
</button>
|
||||||
|
<div class="px-video-time">
|
||||||
|
<span class="sr-only">Time</span>
|
||||||
|
<span class="px-video-duration">00:00</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sound-controls">
|
||||||
|
<!--<div class="px-video-mute-btn-container">-->
|
||||||
|
<input class="px-video-mute sr-only" id="btnMute{id}" type="checkbox">
|
||||||
|
<label id="labelMute{id}" for="btnMute{id}">
|
||||||
|
<svg><use xlink:href="#icon-sound"></use></svg>
|
||||||
|
<span class="sr-only">Mute</span>
|
||||||
|
</label>
|
||||||
|
<!--</div>-->
|
||||||
|
|
||||||
|
<label for="volume{id}" class="sr-only">Volume:</label>
|
||||||
|
<input id="volume{id}" class="px-video-volume" type="range" min="0" max="10" value="5">
|
||||||
|
|
||||||
|
<!--<div class="px-video-captions-btn-container hide">-->
|
||||||
|
<input class="px-video-btnCaptions sr-only" id="btnCaptions{id}" type="checkbox">
|
||||||
|
<label for="btnCaptions{id}">
|
||||||
|
<svg><use xlink:href="#icon-film"></use></svg>
|
||||||
|
<span class="sr-only">Captions</span>
|
||||||
|
</label>
|
||||||
|
<!--</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
29
bower.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "simple-media",
|
||||||
|
"description": "A simple HTML5 media player using custom controls",
|
||||||
|
"homepage": "https://github.com/sampotts/simple-media",
|
||||||
|
"keywords": [
|
||||||
|
"Audio",
|
||||||
|
"Video",
|
||||||
|
"HTML5 Audio",
|
||||||
|
"HTml5 Video"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
"Sam Potts <me@sampotts.me>"
|
||||||
|
],
|
||||||
|
"dependencies": {},
|
||||||
|
"main": [
|
||||||
|
"dist/css/simple-media.css",
|
||||||
|
"dist/js/simple-media.js"
|
||||||
|
],
|
||||||
|
"ignore": [
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
".gitignore"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/sampotts/simple-media.git"
|
||||||
|
},
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
14
bundles.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"less": {
|
||||||
|
"simple-media.css": ["assets/less/simple-media.less"],
|
||||||
|
"docs.css": ["assets/less/docs.less"]
|
||||||
|
},
|
||||||
|
"js": {
|
||||||
|
"simple-media.js": ["assets/js/simple-media.js"],
|
||||||
|
"docs.js": [
|
||||||
|
"assets/js/lib/hogan-3.0.2.mustache.js",
|
||||||
|
"dist/js/templates.js",
|
||||||
|
"assets/js/docs.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
BIN
design/IcoMoon - 7 Icons/PNG/fast-forward.png
Executable file
After Width: | Height: | Size: 360 B |
BIN
design/IcoMoon - 7 Icons/PNG/film.png
Executable file
After Width: | Height: | Size: 157 B |
BIN
design/IcoMoon - 7 Icons/PNG/monitor.png
Executable file
After Width: | Height: | Size: 199 B |
BIN
design/IcoMoon - 7 Icons/PNG/play.png
Executable file
After Width: | Height: | Size: 329 B |
BIN
design/IcoMoon - 7 Icons/PNG/refresh.png
Executable file
After Width: | Height: | Size: 441 B |
BIN
design/IcoMoon - 7 Icons/PNG/sound.png
Executable file
After Width: | Height: | Size: 328 B |
BIN
design/IcoMoon - 7 Icons/PNG/up.png
Executable file
After Width: | Height: | Size: 419 B |
7
design/IcoMoon - 7 Icons/Read Me.txt
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
The *SVG* folder contains the icons you selected as separate SVG files.
|
||||||
|
|
||||||
|
The *demo.html* lists the icons that you selected. To learn how to insert your icons as inline SVGs (with the <use> element), refer to the source of this HTML file. If you prefer to reference an external SVG instead of embedding it in the HTML, you will need to use javascript to fetch the SVG in order to make sure your SVGs will work fine in IE. IcoMoon's Quick Usage mode can take care of that and host your SVGs too.
|
||||||
|
|
||||||
|
You can ignore the *svgdefs.svg* file. It contains the same SVG <symbol> definitions as the ones you can find in the demo.html file.
|
||||||
|
|
||||||
|
If you prefer using PNGs or CSS sprites, refer to the Preferences panel of the IcoMoon app before downloading your zip pack.
|
6
design/IcoMoon - 7 Icons/SVG/fast-forward.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M17.569 8.246l-10.569-6.246c-0.552 0-1 0.448-1 1v1.954l-5-2.954c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1l5-2.955v1.955c0 0.552 0.448 1 1 1l10.569-6.246c0.267-0.158 0.431-0.444 0.431-0.754s-0.164-0.597-0.431-0.754zM6 10.722l-4 2.364v-8.172l4 2.364v3.444zM8 13.086v-8.172l6.915 4.086-6.915 4.086z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 650 B |
6
design/IcoMoon - 7 Icons/SVG/film.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M17 2h-16c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1h16c0.552 0 1-0.448 1-1v-12c0-0.552-0.448-1-1-1zM2 4h2v2h-2v-2zM2 8h2v2h-2v-2zM2 14v-2h2v2h-2zM6 14v-10h6v10h-6zM16 14h-2v-2h2v2zM16 10h-2v-2h2v2zM16 6h-2v-2h2v2z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 568 B |
6
design/IcoMoon - 7 Icons/SVG/monitor.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M16 1h-14c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1h5.5c-0.829 0-1.5 0.671-1.5 1.5v0.5h6v-0.5c0-0.829-0.671-1.5-1.5-1.5h5.5c0.552 0 1-0.448 1-1v-12c0-0.552-0.448-1-1-1zM15 12.5c0 0.276-0.224 0.5-0.5 0.5h-11c-0.276 0-0.5-0.224-0.5-0.5v-9c0-0.276 0.224-0.5 0.5-0.5h11c0.276 0 0.5 0.224 0.5 0.5v9z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 649 B |
6
design/IcoMoon - 7 Icons/SVG/play.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M5 4.914l6.915 4.086-6.915 4.086v-8.172zM4 2c-0.552 0-1 0.448-1 1v12c0 0.552 0.448 1 1 1l10.569-6.246c0.267-0.158 0.431-0.444 0.431-0.754s-0.164-0.597-0.431-0.754l-10.569-6.246z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 530 B |
7
design/IcoMoon - 7 Icons/SVG/refresh.svg
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M8.013 14.006h-0.822c-2.372-0.388-4.187-2.453-4.187-4.934 0-0.831 0.213-1.609 0.574-2.299l0.613 0.85c0.446 0.618 1.409 0.446 1.614-0.289l1.162-4.179c0.162-0.58-0.275-1.155-0.877-1.154l-4.174 0.006c-0.741 0.001-1.17 0.841-0.736 1.443l1.128 1.564c-0.817 1.145-1.302 2.544-1.302 4.059 0 3.499 2.566 6.399 5.918 6.917 0.091 0.014 0.18 0.010 0.267-0.001v0.012h0.822c0.545 0 0.987-0.442 0.987-0.987v-0.020c0-0.545-0.442-0.987-0.987-0.987z" fill="#444444"></path>
|
||||||
|
<path d="M16.82 14.551l-1.129-1.564c0.818-1.145 1.302-2.544 1.302-4.059 0-3.499-2.566-6.399-5.918-6.918-0.091-0.014-0.18-0.010-0.267 0.001v-0.013h-0.822c-0.545 0-0.986 0.442-0.986 0.987v0.020c0 0.546 0.442 0.988 0.986 0.988h0.822c2.372 0.388 4.187 2.453 4.187 4.934 0 0.831-0.213 1.609-0.573 2.299l-0.614-0.85c-0.446-0.618-1.409-0.446-1.613 0.289l-1.163 4.179c-0.161 0.581 0.275 1.155 0.878 1.154l4.174-0.006c0.742-0.001 1.17-0.842 0.736-1.443z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
7
design/IcoMoon - 7 Icons/SVG/sound.svg
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M10.214 2c-0.111 0-0.225 0.032-0.334 0.101l-4.048 2.81c-0.083 0.058-0.182 0.089-0.283 0.089h-3.553c-0.55 0-0.996 0.448-0.996 1v6c0 0.552 0.446 1 0.996 1h3.553c0.102 0 0.2 0.031 0.283 0.089l4.048 2.81c0.109 0.069 0.223 0.101 0.334 0.101 0.392 0 0.747-0.4 0.747-0.949v-12.101c0-0.55-0.355-0.949-0.747-0.949zM8.969 12.834l-2.387-1.657c-0.166-0.115-0.364-0.178-0.566-0.178h-2.525c-0.275 0-0.498-0.224-0.498-0.5v-3c0-0.276 0.223-0.5 0.498-0.5h2.525c0.202 0 0.4-0.062 0.566-0.178l2.387-1.657v7.669z" fill="#444444"></path>
|
||||||
|
<path d="M16.934 8.799c-0.086-1.748-1.514-2.991-2.507-3.649-0.47-0.312-1.094-0.122-1.325 0.408l-0.038 0.086c-0.188 0.431-0.045 0.939 0.336 1.194 0.706 0.473 1.586 1.247 1.624 2.065 0.032 0.676-0.553 1.468-1.663 2.27-0.398 0.288-0.529 0.839-0.285 1.275l0.042 0.075c0.266 0.475 0.866 0.624 1.3 0.312 1.74-1.251 2.586-2.606 2.516-4.037z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
7
design/IcoMoon - 7 Icons/SVG/up.svg
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generated by IcoMoon.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||||
|
<path d="M17 9c0-4.418-3.582-8-8-8s-8 3.582-8 8c0 4.418 3.582 8 8 8s8-3.582 8-8zM3 9c0-3.309 2.691-6 6-6s6 2.691 6 6-2.691 6-6 6-6-2.691-6-6z" fill="#444444"></path>
|
||||||
|
<path d="M9.998 12.010v-3.633l1.293 1.317c0.392 0.388 1.025 0.388 1.417 0s0.391-1.016 0-1.403l-2.967-3c-0.188-0.186-0.442-0.291-0.709-0.291-0.011 0-0.023 0-0.034 0.001s-0.023-0.001-0.034-0.001c-0.266 0-0.521 0.105-0.709 0.291l-2.967 3c-0.391 0.388-0.391 1.016 0 1.403s1.025 0.388 1.417 0l1.294-1.317v3.633c0 0.547 0.443 0.99 0.99 0.99h0.018c0.547 0 0.99-0.443 0.99-0.99z" fill="#444444"></path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 880 B |
147
design/IcoMoon - 7 Icons/demo-files/demo.css
Executable file
@ -0,0 +1,147 @@
|
|||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 1em;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #555;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: normal;
|
||||||
|
box-shadow: 0 1px #ddd, 0 2px #fff, 0 3px #ddd;
|
||||||
|
}
|
||||||
|
small {
|
||||||
|
font-size: .66666667em;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #e74c3c;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover, a:focus {
|
||||||
|
box-shadow: 0 1px #e74c3c;
|
||||||
|
}
|
||||||
|
.bshadow0, input {
|
||||||
|
box-shadow: inset 0 -2px #e7e7e7;
|
||||||
|
}
|
||||||
|
input:hover {
|
||||||
|
box-shadow: inset 0 -2px #ccc;
|
||||||
|
}
|
||||||
|
input, fieldset {
|
||||||
|
font-size: 1em;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
color: inherit;
|
||||||
|
line-height: 1.5;
|
||||||
|
height: 1.5em;
|
||||||
|
padding: .25em 0;
|
||||||
|
}
|
||||||
|
input:focus {
|
||||||
|
outline: none;
|
||||||
|
box-shadow: inset 0 -2px #449fdb;
|
||||||
|
}
|
||||||
|
.glyph {
|
||||||
|
font-size: 16px;
|
||||||
|
width: 17em;
|
||||||
|
margin-right: 1.5em;
|
||||||
|
float: left;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.glyph svg {
|
||||||
|
color: #444444;
|
||||||
|
}
|
||||||
|
.liga {
|
||||||
|
width: 80%;
|
||||||
|
width: calc(100% - 2.5em);
|
||||||
|
}
|
||||||
|
.talign-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.talign-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.bgc1 {
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
.fgc0 {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.fgc1 {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
.mvm {
|
||||||
|
margin-top: .75em;
|
||||||
|
margin-bottom: .75em;
|
||||||
|
}
|
||||||
|
.mtn {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.mtl, .mal {
|
||||||
|
margin-top: 1.5em;
|
||||||
|
}
|
||||||
|
.mbl, .mal {
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
}
|
||||||
|
.mal, .mhl {
|
||||||
|
margin-left: 1.5em;
|
||||||
|
margin-right: 1.5em;
|
||||||
|
}
|
||||||
|
.mhmm {
|
||||||
|
margin-left: 1em;
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
.mls {
|
||||||
|
margin-left: .25em;
|
||||||
|
}
|
||||||
|
.ptl {
|
||||||
|
padding-top: 1.5em;
|
||||||
|
}
|
||||||
|
.pbs, .pvs {
|
||||||
|
padding-bottom: .25em;
|
||||||
|
}
|
||||||
|
.pvs, .pts {
|
||||||
|
padding-top: .25em;
|
||||||
|
}
|
||||||
|
.unit {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.unitRight {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.size1of2 {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.size1of1 {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.clearfix:before, .clearfix:after {
|
||||||
|
content: " ";
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
.clearfix:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
.hidden-true {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.textbox0 {
|
||||||
|
width: 3em;
|
||||||
|
background: #f1f1f1;
|
||||||
|
padding: .25em .5em;
|
||||||
|
line-height: 1.5;
|
||||||
|
height: 1.5em;
|
||||||
|
}
|
||||||
|
.fs0 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.fs1 {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
90
design/IcoMoon - 7 Icons/demo.html
Executable file
@ -0,0 +1,90 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>IcoMoon - SVG Icons</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<link rel="stylesheet" href="demo-files/demo.css">
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<svg display="none" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<defs>
|
||||||
|
<symbol id="icon-sound" viewBox="0 0 1024 1024">
|
||||||
|
<title>sound</title>
|
||||||
|
<path class="path1" d="M581.056 113.778c-6.332 0-12.779 1.819-19.001 5.764l-230.277 159.847c-4.722 3.292-10.332 5.056-16.11 5.056h-202.112c-31.305 0-56.667 25.472-56.667 56.889v341.333c0 31.417 25.362 56.889 56.667 56.889h202.112c5.778 0 11.388 1.764 16.11 5.056l230.277 159.847c6.222 3.945 12.695 5.764 19.001 5.764 22.277 0 42.5-22.736 42.5-54v-688.43c0-31.278-20.222-54.014-42.5-54.014zM510.222 730.139l-135.78-94.265c-9.472-6.569-20.722-10.1-32.222-10.1h-143.666c-15.666 0-28.334-12.736-28.334-28.444v-170.667c0-15.708 12.667-28.444 28.334-28.444h143.668c11.5 0 22.75-3.527 32.222-10.098l135.778-94.26v436.277z"></path>
|
||||||
|
<path class="path2" d="M963.333 500.583c-4.889-99.417-86.112-170.139-142.612-207.57-26.75-17.737-62.222-6.93-75.364 23.195l-2.137 4.889c-10.667 24.5-2.583 53.403 19.111 67.945 40.167 26.903 90.222 70.958 92.389 117.486 1.833 38.473-31.445 83.5-94.612 129.111-22.667 16.375-30.112 47.708-16.222 72.555l2.389 4.292c15.111 27.001 49.278 35.486 73.945 17.762 98.999-71.15 147.111-148.233 143.111-229.664z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-monitor" viewBox="0 0 1024 1024">
|
||||||
|
<title>monitor</title>
|
||||||
|
<path class="path1" d="M910.222 56.889h-796.444c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h312.889c-47.14 0-85.333 38.194-85.333 85.333v28.444h341.333v-28.444c0-47.14-38.194-85.333-85.333-85.333h312.889c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM853.333 711.111c0 15.723-12.722 28.444-28.444 28.444h-625.778c-15.723 0-28.444-12.722-28.444-28.444v-512c0-15.723 12.722-28.444 28.444-28.444h625.778c15.723 0 28.444 12.722 28.444 28.444v512z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-up" viewBox="0 0 1024 1024">
|
||||||
|
<title>up</title>
|
||||||
|
<path class="path1" d="M967.111 512c0-251.362-203.749-455.111-455.111-455.111s-455.111 203.749-455.111 455.111c0 251.362 203.749 455.111 455.111 455.111s455.111-203.749 455.111-455.111zM170.667 512c0-188.222 153.111-341.333 341.333-341.333s341.333 153.111 341.333 341.333-153.111 341.333-341.333 341.333-341.333-153.111-341.333-341.333z"></path>
|
||||||
|
<path class="path2" d="M568.784 683.221v-206.667l73.584 74.917c22.277 22.055 58.332 22.055 80.612 0 22.251-22.055 22.251-57.778 0-79.833l-168.779-170.667c-10.695-10.583-25.166-16.528-40.306-16.528-0.651 0-1.3 0.025-1.95 0.048-0.649-0.023-1.296-0.048-1.948-0.048-15.141 0-29.611 5.945-40.306 16.528l-168.779 170.667c-22.251 22.055-22.251 57.778 0 79.833 22.277 22.055 58.332 22.055 80.612 0l73.588-74.917v206.667c0 31.111 25.223 56.334 56.334 56.334h1.006c31.111 0 56.332-25.223 56.332-56.334z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-play" viewBox="0 0 1024 1024">
|
||||||
|
<title>play</title>
|
||||||
|
<path class="path1" d="M284.444 279.556l393.388 232.444-393.388 232.444v-464.889zM227.556 113.778c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.166-8.972 24.5-25.278 24.5-42.917s-9.333-33.945-24.5-42.917l-601.278-355.305z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-fast-forward" viewBox="0 0 1024 1024">
|
||||||
|
<title>fast-forward</title>
|
||||||
|
<path class="path1" d="M999.5 469.083l-601.278-355.305c-31.417 0-56.889 25.472-56.889 56.889v111.184l-284.444-168.073c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l284.444-168.084v111.195c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.195-8.972 24.5-25.278 24.5-42.917s-9.305-33.945-24.5-42.917zM341.333 609.972l-227.556 134.473v-464.889l227.556 134.473v195.943zM455.111 744.444v-464.889l393.388 232.444-393.388 232.444z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-refresh" viewBox="0 0 1024 1024">
|
||||||
|
<title>refresh</title>
|
||||||
|
<path class="path1" d="M455.874 796.763h-46.741c-134.912-22.064-238.203-139.554-238.203-280.692 0-47.296 12.142-91.534 32.651-130.773l34.875 48.352c25.397 35.179 80.169 25.371 91.813-16.452l66.11-237.758c9.198-33.013-15.646-65.719-49.909-65.664l-237.451 0.363c-42.183 0.055-66.555 47.852-41.877 82.087l64.19 88.951c-46.489 65.136-74.084 144.722-74.084 230.894 0 199.076 146 364.055 336.684 393.513 5.196 0.805 10.256 0.583 15.2-0.055v0.693h46.741c31.012 0 56.133-25.122 56.133-56.162v-1.14c0-31.012-25.122-56.158-56.133-56.158z"></path>
|
||||||
|
<path class="path2" d="M956.871 827.803l-64.219-88.951c46.517-65.138 74.084-144.722 74.084-230.894 0-199.076-145.972-364.057-336.656-393.54-5.198-0.805-10.256-0.583-15.202 0.084v-0.724h-46.768c-30.985 0-56.105 25.148-56.105 56.16v1.14c0 31.040 25.12 56.188 56.105 56.188h46.768c134.914 22.064 238.174 139.554 238.174 280.692 0 47.296-12.142 91.534-32.622 130.773l-34.903-48.352c-25.371-35.18-80.171-25.371-91.785 16.423l-66.137 237.756c-9.17 33.042 15.671 65.721 49.936 65.666l237.451-0.334c42.185-0.057 66.555-47.881 41.879-82.087z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-film" viewBox="0 0 1024 1024">
|
||||||
|
<title>film</title>
|
||||||
|
<path class="path1" d="M967.111 113.778h-910.222c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h910.222c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM113.778 227.556h113.778v113.778h-113.778v-113.778zM113.778 455.111h113.778v113.778h-113.778v-113.778zM113.778 796.444v-113.778h113.778v113.778h-113.778zM341.333 796.444v-568.889h341.333v568.889h-341.333zM910.222 796.444h-113.778v-113.778h113.778v113.778zM910.222 568.889h-113.778v-113.778h113.778v113.778zM910.222 341.333h-113.778v-113.778h113.778v113.778z"></path>
|
||||||
|
</symbol>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<header class="bgc1 clearfix">
|
||||||
|
<p class="mhl">SVG Icons - Generated by <a href="https://icomoon.io/app">IcoMoon</a></p>
|
||||||
|
</header>
|
||||||
|
<div class="clearfix mhl ptl">
|
||||||
|
<h1 class="mvm mtn fgc1">Grid Size: 18</h1>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-sound"><use xlink:href="#icon-sound"></use></svg><span class="mls"> icon-sound</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-monitor"><use xlink:href="#icon-monitor"></use></svg><span class="mls"> icon-monitor</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-up"><use xlink:href="#icon-up"></use></svg><span class="mls"> icon-up</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-play"><use xlink:href="#icon-play"></use></svg><span class="mls"> icon-play</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-fast-forward"><use xlink:href="#icon-fast-forward"></use></svg><span class="mls"> icon-fast-forward</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-refresh"><use xlink:href="#icon-refresh"></use></svg><span class="mls"> icon-refresh</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="glyph fs1">
|
||||||
|
<div class="clearfix pbs">
|
||||||
|
<svg class="icon icon-film"><use xlink:href="#icon-film"></use></svg><span class="mls"> icon-film</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
6
design/IcoMoon - 7 Icons/style.css
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
.icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
fill: currentColor;
|
||||||
|
}
|
35
design/IcoMoon - 7 Icons/svgdefs.svg
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
<svg display="none" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<defs>
|
||||||
|
<symbol id="icon-sound" viewBox="0 0 1024 1024">
|
||||||
|
<title>sound</title>
|
||||||
|
<path class="path1" d="M581.056 113.778c-6.332 0-12.779 1.819-19.001 5.764l-230.277 159.847c-4.722 3.292-10.332 5.056-16.11 5.056h-202.112c-31.305 0-56.667 25.472-56.667 56.889v341.333c0 31.417 25.362 56.889 56.667 56.889h202.112c5.778 0 11.388 1.764 16.11 5.056l230.277 159.847c6.222 3.945 12.695 5.764 19.001 5.764 22.277 0 42.5-22.736 42.5-54v-688.43c0-31.278-20.222-54.014-42.5-54.014zM510.222 730.139l-135.78-94.265c-9.472-6.569-20.722-10.1-32.222-10.1h-143.666c-15.666 0-28.334-12.736-28.334-28.444v-170.667c0-15.708 12.667-28.444 28.334-28.444h143.668c11.5 0 22.75-3.527 32.222-10.098l135.778-94.26v436.277z"></path>
|
||||||
|
<path class="path2" d="M963.333 500.583c-4.889-99.417-86.112-170.139-142.612-207.57-26.75-17.737-62.222-6.93-75.364 23.195l-2.137 4.889c-10.667 24.5-2.583 53.403 19.111 67.945 40.167 26.903 90.222 70.958 92.389 117.486 1.833 38.473-31.445 83.5-94.612 129.111-22.667 16.375-30.112 47.708-16.222 72.555l2.389 4.292c15.111 27.001 49.278 35.486 73.945 17.762 98.999-71.15 147.111-148.233 143.111-229.664z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-monitor" viewBox="0 0 1024 1024">
|
||||||
|
<title>monitor</title>
|
||||||
|
<path class="path1" d="M910.222 56.889h-796.444c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h312.889c-47.14 0-85.333 38.194-85.333 85.333v28.444h341.333v-28.444c0-47.14-38.194-85.333-85.333-85.333h312.889c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM853.333 711.111c0 15.723-12.722 28.444-28.444 28.444h-625.778c-15.723 0-28.444-12.722-28.444-28.444v-512c0-15.723 12.722-28.444 28.444-28.444h625.778c15.723 0 28.444 12.722 28.444 28.444v512z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-up" viewBox="0 0 1024 1024">
|
||||||
|
<title>up</title>
|
||||||
|
<path class="path1" d="M967.111 512c0-251.362-203.749-455.111-455.111-455.111s-455.111 203.749-455.111 455.111c0 251.362 203.749 455.111 455.111 455.111s455.111-203.749 455.111-455.111zM170.667 512c0-188.222 153.111-341.333 341.333-341.333s341.333 153.111 341.333 341.333-153.111 341.333-341.333 341.333-341.333-153.111-341.333-341.333z"></path>
|
||||||
|
<path class="path2" d="M568.784 683.221v-206.667l73.584 74.917c22.277 22.055 58.332 22.055 80.612 0 22.251-22.055 22.251-57.778 0-79.833l-168.779-170.667c-10.695-10.583-25.166-16.528-40.306-16.528-0.651 0-1.3 0.025-1.95 0.048-0.649-0.023-1.296-0.048-1.948-0.048-15.141 0-29.611 5.945-40.306 16.528l-168.779 170.667c-22.251 22.055-22.251 57.778 0 79.833 22.277 22.055 58.332 22.055 80.612 0l73.588-74.917v206.667c0 31.111 25.223 56.334 56.334 56.334h1.006c31.111 0 56.332-25.223 56.332-56.334z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-play" viewBox="0 0 1024 1024">
|
||||||
|
<title>play</title>
|
||||||
|
<path class="path1" d="M284.444 279.556l393.388 232.444-393.388 232.444v-464.889zM227.556 113.778c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.166-8.972 24.5-25.278 24.5-42.917s-9.333-33.945-24.5-42.917l-601.278-355.305z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-fast-forward" viewBox="0 0 1024 1024">
|
||||||
|
<title>fast-forward</title>
|
||||||
|
<path class="path1" d="M999.5 469.083l-601.278-355.305c-31.417 0-56.889 25.472-56.889 56.889v111.184l-284.444-168.073c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889l284.444-168.084v111.195c0 31.417 25.472 56.889 56.889 56.889l601.278-355.305c15.195-8.972 24.5-25.278 24.5-42.917s-9.305-33.945-24.5-42.917zM341.333 609.972l-227.556 134.473v-464.889l227.556 134.473v195.943zM455.111 744.444v-464.889l393.388 232.444-393.388 232.444z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-refresh" viewBox="0 0 1024 1024">
|
||||||
|
<title>refresh</title>
|
||||||
|
<path class="path1" d="M455.874 796.763h-46.741c-134.912-22.064-238.203-139.554-238.203-280.692 0-47.296 12.142-91.534 32.651-130.773l34.875 48.352c25.397 35.179 80.169 25.371 91.813-16.452l66.11-237.758c9.198-33.013-15.646-65.719-49.909-65.664l-237.451 0.363c-42.183 0.055-66.555 47.852-41.877 82.087l64.19 88.951c-46.489 65.136-74.084 144.722-74.084 230.894 0 199.076 146 364.055 336.684 393.513 5.196 0.805 10.256 0.583 15.2-0.055v0.693h46.741c31.012 0 56.133-25.122 56.133-56.162v-1.14c0-31.012-25.122-56.158-56.133-56.158z"></path>
|
||||||
|
<path class="path2" d="M956.871 827.803l-64.219-88.951c46.517-65.138 74.084-144.722 74.084-230.894 0-199.076-145.972-364.057-336.656-393.54-5.198-0.805-10.256-0.583-15.202 0.084v-0.724h-46.768c-30.985 0-56.105 25.148-56.105 56.16v1.14c0 31.040 25.12 56.188 56.105 56.188h46.768c134.914 22.064 238.174 139.554 238.174 280.692 0 47.296-12.142 91.534-32.622 130.773l-34.903-48.352c-25.371-35.18-80.171-25.371-91.785 16.423l-66.137 237.756c-9.17 33.042 15.671 65.721 49.936 65.666l237.451-0.334c42.185-0.057 66.555-47.881 41.879-82.087z"></path>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="icon-film" viewBox="0 0 1024 1024">
|
||||||
|
<title>film</title>
|
||||||
|
<path class="path1" d="M967.111 113.778h-910.222c-31.417 0-56.889 25.472-56.889 56.889v682.667c0 31.417 25.472 56.889 56.889 56.889h910.222c31.417 0 56.889-25.472 56.889-56.889v-682.667c0-31.417-25.472-56.889-56.889-56.889zM113.778 227.556h113.778v113.778h-113.778v-113.778zM113.778 455.111h113.778v113.778h-113.778v-113.778zM113.778 796.444v-113.778h113.778v113.778h-113.778zM341.333 796.444v-568.889h341.333v568.889h-341.333zM910.222 796.444h-113.778v-113.778h113.778v113.778zM910.222 568.889h-113.778v-113.778h113.778v113.778zM910.222 341.333h-113.778v-113.778h113.778v113.778z"></path>
|
||||||
|
</symbol>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
BIN
design/collapse.sketch
Normal file
BIN
design/expand.sketch
Normal file
BIN
design/pause.sketch
Normal file
BIN
design/rewind.sketch
Normal file
1
dist/css/docs.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0}a:focus{outline:dotted thin}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}*,::after,::before{box-sizing:border-box}html{font-size:62.5%}body{font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:18px;font-size:1.8rem;color:#6D797F;line-height:1.5;background:#ECF0F1;max-width:960px;margin:50px auto;text-align:center}h1{font-size:48px;font-size:4.8rem;letter-spacing:-.025em;color:#2E3C44;margin:0 0 20px;line-height:1.2}p{margin:0 0 20px}
|
1
dist/css/simple-player.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.player,.player *,.player ::after,.player ::before{box-sizing:border-box}.sr-only{position:absolute!important;clip:rect(1px,1px,1px,1px);padding:0!important;border:0!important;height:1px!important;width:1px!important;overflow:hidden}.hide{display:none}.show-inline{display:inline-block}.player{position:relative;max-width:100%;overflow:hidden}.player video{width:100%;height:auto;vertical-align:middle}.player svg{width:18px;height:18px}.player .controls{zoom:1;position:absolute;bottom:0;left:0;right:0;padding:10px 5px;background:rgba(0,0,0,.75);transition:-webkit-transform .3s ease;transition:transform .3s ease;line-height:1}.player .controls:after,.player .controls:before{content:"";display:table}.player .controls:after{clear:both}.player .controls button{border:0;background:0 0;overflow:hidden}.player .controls button,.player .controls label{display:inline-block;vertical-align:middle;margin:0 2px;padding:5px 10px;color:#ddd;transition:background .3s ease;border-radius:3px}.player .controls button svg,.player .controls label svg{display:block;fill:currentColor;transition:fill .3s ease}.player .controls button:focus,.player .controls label:focus{background:#000;outline:0}.player .controls button:hover,.player .controls label:hover{background:#3498db}.player .controls button:focus svg,.player .controls button:hover svg,.player .controls label:focus svg,.player .controls label:hover svg{fill:#fff}.player .controls .px-video-time{display:inline-block;vertical-align:middle;padding-top:3px;margin-left:10px;color:#fff;font-weight:600;font-size:14px;-webkit-font-smoothing:antialiased}.player progress{position:absolute;top:-10px;left:0;right:0;width:100%;height:10px;margin:0;vertical-align:top}.player progress[value]{-webkit-appearance:none;border:none}.player progress[value]::-webkit-progress-bar{background-color:#eee}.player progress[value]::-webkit-progress-value{background-color:#3498db}.player .play-controls{float:left}.player .sound-controls{float:right}.px-video-img-captions-container *{box-sizing:border-box}.px-video-img-captions-container{position:relative}.px-video-captions{position:absolute;top:0;left:0;width:100%;padding:.5em;min-height:2.5em;background-color:#000;color:#fff;font-size:1.1em;text-align:center;opacity:.75;-webkit-font-smoothing:antialiased;font-weight:500}.px-video-captions-btn-container label{display:inline-block;width:25px;height:20px;margin-left:25px;background:url(../images/px-video-sprite.png) -6px -835px no-repeat}.px-video-captions-btn-container input[type=checkbox]:hover+label{background-position:-6px -799px;cursor:pointer}.px-video-captions-btn-container input[type=checkbox]:focus+label{outline:#999 dotted 1px;background-position:-6px -799px}.px-video-captions-btn-container input[type=checkbox]:checked+label{background-position:-6px -871px}.px-video-mute-btn-container label{display:inline-block;width:25px;height:20px;margin-left:240px;margin-top:2px;background:url(../images/px-video-sprite.png) -6px -476px no-repeat}.px-video-mute-btn-container input[type=checkbox]:hover+label{background-position:-6px -440px;cursor:pointer}.px-video-mute-btn-container input[type=checkbox]:focus+label{outline:#999 dotted 1px;background-position:-6px -440px}.px-video-mute-btn-container input[type=checkbox]:checked+label{background-position:-6px -692px}.px-video-mute-btn-container input[type=checkbox]:checked:focus+label,.px-video-mute-btn-container input[type=checkbox]:checked:hover+label{background-position:-6px -656px}.px-video-controls input[type=range]{-webkit-appearance:none;height:6px;width:100px;margin-top:8px;background-color:#E6E6E6;outline:0}.px-video-controls input[type=range]:focus::-webkit-slider-thumb{outline:#999 dotted 1px}.px-video-controls input[type=range]::-moz-range-track{-moz-appearance:none;height:6px;background-color:#E6E6E6;border:none}.px-video-controls input[type=range]::-webkit-slider-thumb{-webkit-appearance:none!important;height:10px;width:6px;background-color:#666}.px-video-controls input[type=range]::-moz-range-thumb{height:12px;width:8px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.px-video-controls input[type=range]{position:relative;padding:0;height:8px;top:-3px}.px-video-time{margin-top:4px}.px-video-captions{padding:8px;min-height:36px}}
|
1
dist/js/docs.js
vendored
Normal file
1
dist/js/simple-player.js
vendored
Normal file
2
dist/js/templates.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
var templates = {};
|
||||||
|
templates['controls'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"controls\">");t.b("\n" + i);t.b(" <progress class=\"px-video-progress\" max=\"100\" value=\"0\"><span>0</span>% played</progress>");t.b("\n");t.b("\n" + i);t.b(" <div class=\"play-controls\">");t.b("\n" + i);t.b(" <button class=\"px-video-restart\" data-player=\"restart\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-refresh\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Restart</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button class=\"px-video-rewind\" data-player=\"rewind\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-rewind\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Rewind <span class=\"px-seconds\">10</span> seconds</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button class=\"px-video-play\" aria-label=\"{aria-label}\" data-player=\"play\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-play\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Play</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button class=\"px-video-pause hide\" data-player=\"pause\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-pause\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Pause</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <button class=\"px-video-forward\" data-player=\"fast-forward\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-fast-forward\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Fast forward <span class=\"px-seconds\">10</span> seconds</span>");t.b("\n" + i);t.b(" </button>");t.b("\n" + i);t.b(" <div class=\"px-video-time\">");t.b("\n" + i);t.b(" <span class=\"sr-only\">Time</span>");t.b("\n" + i);t.b(" <span class=\"px-video-duration\">00:00</span>");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b(" </div>");t.b("\n");t.b("\n" + i);t.b(" <div class=\"sound-controls\">");t.b("\n" + i);t.b(" <!--<div class=\"px-video-mute-btn-container\">-->");t.b("\n" + i);t.b(" <input class=\"px-video-mute sr-only\" id=\"btnMute{id}\" type=\"checkbox\">");t.b("\n" + i);t.b(" <label id=\"labelMute{id}\" for=\"btnMute{id}\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-sound\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Mute</span>");t.b("\n" + i);t.b(" </label>");t.b("\n" + i);t.b(" <!--</div>-->");t.b("\n");t.b("\n" + i);t.b(" <label for=\"volume{id}\" class=\"sr-only\">Volume:</label>");t.b("\n" + i);t.b(" <input id=\"volume{id}\" class=\"px-video-volume\" type=\"range\" min=\"0\" max=\"10\" value=\"5\">");t.b("\n");t.b("\n" + i);t.b(" <!--<div class=\"px-video-captions-btn-container hide\">-->");t.b("\n" + i);t.b(" <input class=\"px-video-btnCaptions sr-only\" id=\"btnCaptions{id}\" type=\"checkbox\">");t.b("\n" + i);t.b(" <label for=\"btnCaptions{id}\">");t.b("\n" + i);t.b(" <svg><use xlink:href=\"#icon-film\"></use></svg>");t.b("\n" + i);t.b(" <span class=\"sr-only\">Captions</span>");t.b("\n" + i);t.b(" </label>");t.b("\n" + i);t.b(" <!--</div>-->");t.b("\n" + i);t.b(" </div>");t.b("\n" + i);t.b("</div>");t.b("\n");return t.fl(); },partials: {}, subs: { }});
|
1
dist/svg/sprite.svg
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-collapse" viewBox="0 0 18 18"><title>collapse</title><g><g><path d="M14.424 2.165l-2.57 2.568.018-1.845c-.003-.552-.45-1-1.002-1.002-.55-.003-.994.442-.992.992l-.023 4.22c.002.263.107.517.296.706l.025.023c.01.007.016.017.024.025.187.188.44.294.706.295l4.218-.023c.55.002.995-.442.992-.992-.002-.55-.45-1-1-1.002l-1.847.016 2.567-2.568c.387-.387.387-1.013 0-1.4l-.013-.013c-.386-.386-1.013-.386-1.4 0z"/><path d="M6.154 13.266l-.017 1.846c.003.55.45 1 1.002 1 .55.004.994-.44.99-.99l.024-4.22c0-.264-.106-.517-.295-.706l-.026-.024-.023-.024c-.187-.188-.442-.294-.706-.296l-4.22.023c-.55-.002-.994.442-.99.992.002.55.45 1 1 1.002l1.847-.017-2.568 2.57c-.386.385-.386 1.012 0 1.398.4.4 1.026.4 1.413.014l2.57-2.568z"/></g></g></symbol><symbol id="icon-expand" viewBox="0 0 18 18"><title>expand</title><g fill="none" fill-rule="evenodd"><g fill="#444"><path d="M6.424 10.165l-2.57 2.568.018-1.845c-.003-.552-.45-1-1.002-1.002-.55-.003-.994.442-.992.992l-.023 4.22c.002.263.107.517.296.706l.025.023c.01.007.016.017.024.025.187.188.44.294.706.295l4.218-.023c.55.002.995-.442.992-.992-.002-.55-.45-1-1-1.002l-1.847.016 2.567-2.568c.387-.387.387-1.013 0-1.4l-.013-.013c-.386-.386-1.013-.386-1.4 0z"/><path d="M14.154 5.266l-.017 1.846c.003.55.45 1 1.002 1 .55.004.994-.44.99-.99l.024-4.22c0-.264-.106-.517-.295-.706l-.026-.024-.023-.024c-.187-.188-.442-.294-.706-.296l-4.22.023c-.55-.002-.994.442-.99.992.002.55.45 1 1 1.002l1.847-.017-2.568 2.57c-.386.385-.386 1.012 0 1.398.4.4 1.026.4 1.413.014l2.57-2.568z"/></g></g></symbol><symbol id="icon-fast-forward" viewBox="0 0 18 18"><path d="M17.57 8.246L7 2c-.552 0-1 .448-1 1v1.954L1 2c-.552 0-1 .448-1 1v12c0 .552.448 1 1 1l5-2.955V15c0 .552.448 1 1 1l10.57-6.246c.266-.158.43-.444.43-.754s-.164-.597-.43-.754zM6 10.722l-4 2.364V4.914l4 2.364v3.444zm2 2.364V4.914L14.915 9 8 13.086z"/></symbol><symbol id="icon-film" viewBox="0 0 18 18"><path d="M17 2H1c-.552 0-1 .448-1 1v12c0 .552.448 1 1 1h16c.552 0 1-.448 1-1V3c0-.552-.448-1-1-1zM2 4h2v2H2V4zm0 4h2v2H2V8zm0 6v-2h2v2H2zm4 0V4h6v10H6zm10 0h-2v-2h2v2zm0-4h-2V8h2v2zm0-4h-2V4h2v2z"/></symbol><symbol id="icon-pause" viewBox="0 0 18 18"><title>pause</title><g fill="none" fill-rule="evenodd"><g transform="translate(3 3)" stroke="#fff" stroke-width="2"><rect x="8" width="4" height="12" rx="1"/><rect width="4" height="12" rx="1"/></g></g></symbol><symbol id="icon-play" viewBox="0 0 18 18"><path d="M5 4.914L11.915 9 5 13.086V4.914zM4 2c-.552 0-1 .448-1 1v12c0 .552.448 1 1 1l10.57-6.246c.266-.158.43-.444.43-.754s-.164-.597-.43-.754L4 2z"/></symbol><symbol id="icon-refresh" viewBox="0 0 18 18"><path d="M8.013 14.006H7.19c-2.37-.388-4.186-2.453-4.186-4.934 0-.83.213-1.61.574-2.3l.613.85c.447.62 1.41.447 1.615-.288l1.162-4.18C7.13 2.575 6.692 2 6.09 2.002l-4.174.007c-.74 0-1.17.84-.736 1.443l1.128 1.564C1.49 6.16 1.006 7.558 1.006 9.074c0 3.498 2.566 6.398 5.918 6.916.09.014.18.01.267 0V16h.823c.545 0 .987-.44.987-.986v-.02c0-.545-.442-.987-.987-.987zM16.82 14.55l-1.13-1.563c.82-1.145 1.303-2.544 1.303-4.06 0-3.498-2.566-6.398-5.918-6.917-.09-.014-.18-.01-.267 0V2h-.822c-.545 0-.986.442-.986.987v.02c0 .546.442.988.986.988h.822c2.372.388 4.187 2.453 4.187 4.934 0 .83-.213 1.61-.573 2.3l-.614-.85c-.446-.62-1.41-.447-1.613.288l-1.163 4.18c-.16.58.275 1.154.878 1.153l4.174-.006c.742 0 1.17-.842.736-1.443z"/></symbol><symbol id="icon-rewind" viewBox="0 0 18 21"><title>rewind</title><g><path d="M.43 10.754L11 17c.552 0 1-.448 1-1v-1.954L17 17c.552 0 1-.448 1-1V4c0-.552-.448-1-1-1l-5 2.955V4c0-.552-.448-1-1-1L.43 9.246C.165 9.404 0 9.69 0 10s.164.597.43.754zM12 8.278l4-2.364v8.172l-4-2.364V8.278zm-2-2.364v8.172L3.085 10 10 5.914z"/></g></symbol><symbol id="icon-sound" viewBox="0 0 18 18"><path d="M10.214 2c-.11 0-.225.032-.334.1L5.832 4.91C5.75 4.97 5.65 5 5.55 5H1.995C1.446 5 1 5.448 1 6v6c0 .552.446 1 .996 1H5.55c.1 0 .2.03.282.09L9.88 15.9c.11.068.223.1.334.1.392 0 .747-.4.747-.95V2.95c0-.55-.354-.95-.746-.95zM8.97 12.834L6.58 11.177c-.166-.115-.364-.178-.566-.178H3.49c-.274 0-.497-.225-.497-.5v-3c0-.277.223-.5.498-.5h2.526c.202 0 .4-.063.566-.18L8.97 5.165v7.67zM16.934 8.8c-.086-1.75-1.514-2.992-2.507-3.65-.47-.312-1.094-.122-1.325.408l-.038.086c-.188.43-.045.94.336 1.194.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27-.397.288-.528.84-.284 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.25 2.586-2.606 2.516-4.037z"/></symbol></svg>
|
After Width: | Height: | Size: 4.5 KiB |
52
docs/index.html
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Simple HTML5 Video Player</title>
|
||||||
|
<meta name="description" content="Custom HTML5 video controls and WebVTT captions.">
|
||||||
|
<meta name="author" content="Sam Potts">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<!-- Styles -->
|
||||||
|
<link rel="stylesheet" href="../dist/css/simple-player.css">
|
||||||
|
<link rel="stylesheet" href="../dist/css/docs.css">
|
||||||
|
</head>
|
||||||
|
<body class="container">
|
||||||
|
<header>
|
||||||
|
<h1>HTML5 Media Player</h1>
|
||||||
|
<p>A simple HTML5 media player</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="player px-video-container" id="myvid">
|
||||||
|
<div class="px-video-img-captions-container">
|
||||||
|
<div class="px-video-captions hide"></div>
|
||||||
|
<video width="640" height="360" poster="../media/poster_PayPal_Austin2.jpg" controls>
|
||||||
|
<!-- video files -->
|
||||||
|
<source src="https://www.paypalobjects.com/webstatic/mktg/videos/PayPal_AustinSMB_baseline.mp4" type="video/mp4" />
|
||||||
|
<source src="https://www.paypalobjects.com/webstatic/mktg/videos/PayPal_AustinSMB_baseline.webm" type="video/webm" />
|
||||||
|
|
||||||
|
<!-- text track file -->
|
||||||
|
<track kind="captions" label="English captions" src="../media/captions_PayPal_Austin_en.vtt" srclang="en" default />
|
||||||
|
|
||||||
|
<!-- fallback for browsers that don't support the video element -->
|
||||||
|
<div>
|
||||||
|
<a href="https://www.paypalobjects.com/webstatic/mktg/videos/PayPal_AustinSMB_baseline.mp4">
|
||||||
|
<img src="../media/poster_PayPal_Austin2.jpg" width="640" height="360" alt="download video" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
<!-- Inject these... -->
|
||||||
|
<div class="px-video-controls"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 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");</script>
|
||||||
|
|
||||||
|
<!-- Core player -->
|
||||||
|
<script src="../dist/js/simple-player.js"></script>
|
||||||
|
|
||||||
|
<!-- Docs setup -->
|
||||||
|
<script src="../dist/js/docs.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
139
gulpfile.js
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
// ==========================================================================
|
||||||
|
// Gulp build script
|
||||||
|
// ==========================================================================
|
||||||
|
/*global require, __dirname*/
|
||||||
|
|
||||||
|
var fs = require("fs"),
|
||||||
|
path = require("path"),
|
||||||
|
gulp = require("gulp"),
|
||||||
|
gutil = require("gulp-util"),
|
||||||
|
concat = require("gulp-concat"),
|
||||||
|
uglify = require("gulp-uglify"),
|
||||||
|
less = require("gulp-less"),
|
||||||
|
minifyCss = require("gulp-minify-css"),
|
||||||
|
runSequence = require("run-sequence"),
|
||||||
|
prefix = require("gulp-autoprefixer"),
|
||||||
|
svgstore = require("gulp-svgstore"),
|
||||||
|
svgmin = require("gulp-svgmin"),
|
||||||
|
hogan = require("gulp-hogan-compile");
|
||||||
|
|
||||||
|
var projectPath = __dirname;
|
||||||
|
var paths = {
|
||||||
|
project: projectPath,
|
||||||
|
|
||||||
|
// 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"),
|
||||||
|
|
||||||
|
// Output paths
|
||||||
|
js: path.join(projectPath, "dist/js/"),
|
||||||
|
css: path.join(projectPath, "dist/css/"),
|
||||||
|
icons: path.join(projectPath, "dist/svg/")
|
||||||
|
},
|
||||||
|
|
||||||
|
// Task names
|
||||||
|
taskNames = {
|
||||||
|
jsAll: "js-all",
|
||||||
|
lessBuild: "less-",
|
||||||
|
jsBuild: "js-",
|
||||||
|
iconBuild: "icon-build",
|
||||||
|
templates: "templates"
|
||||||
|
},
|
||||||
|
// Task arrays
|
||||||
|
lessBuildTasks = [],
|
||||||
|
jsBuildTasks = [],
|
||||||
|
|
||||||
|
// Fetch bundles from JSON
|
||||||
|
bundles = loadJSON(path.join(paths.project, "bundles.json"));
|
||||||
|
|
||||||
|
// Load json
|
||||||
|
function loadJSON(path) {
|
||||||
|
return JSON.parse(fs.readFileSync(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build templates
|
||||||
|
gulp.task(taskNames.templates, function () {
|
||||||
|
return gulp
|
||||||
|
.src(paths.watchtemplates)
|
||||||
|
.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));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Process JS
|
||||||
|
for (var key in bundles.js) {
|
||||||
|
(function(key) {
|
||||||
|
var taskName = taskNames.jsBuild + key;
|
||||||
|
jsBuildTasks.push(taskName);
|
||||||
|
|
||||||
|
gulp.task(taskName, function () {
|
||||||
|
return gulp
|
||||||
|
.src(bundles.js[key])
|
||||||
|
.pipe(concat(key))
|
||||||
|
.pipe(uglify())
|
||||||
|
.pipe(gulp.dest(paths.js));
|
||||||
|
});
|
||||||
|
})(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process CSS
|
||||||
|
for (var key in bundles.less) {
|
||||||
|
(function (key) {
|
||||||
|
var taskName = taskNames.lessBuild + key;
|
||||||
|
lessBuildTasks.push(taskName);
|
||||||
|
|
||||||
|
gulp.task(taskName, function () {
|
||||||
|
return gulp
|
||||||
|
.src(bundles.less[key])
|
||||||
|
.pipe(less())
|
||||||
|
.on("error", gutil.log)
|
||||||
|
.pipe(concat(key))
|
||||||
|
.pipe(prefix(["last 2 versions", "> 1%", "ie 9"], { cascade: true }))
|
||||||
|
.pipe(minifyCss())
|
||||||
|
.pipe(gulp.dest(paths.css));
|
||||||
|
});
|
||||||
|
})(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process Icons
|
||||||
|
gulp.task(taskNames.iconBuild, function () {
|
||||||
|
return gulp
|
||||||
|
.src(paths.svg)
|
||||||
|
.pipe(svgmin({
|
||||||
|
plugins: [{
|
||||||
|
removeDesc: true
|
||||||
|
}]
|
||||||
|
}))
|
||||||
|
.pipe(svgstore({
|
||||||
|
prefix: "icon-",
|
||||||
|
fileName: "sprite.svg"
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(paths.icons));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Default gulp task
|
||||||
|
gulp.task("default", function(){
|
||||||
|
runSequence(taskNames.jsAll, lessBuildTasks.concat(taskNames.iconBuild, "watch"));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Build all JS (inc. templates)
|
||||||
|
gulp.task(taskNames.jsAll, function(){
|
||||||
|
runSequence(taskNames.templates, jsBuildTasks);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
});
|
145
media/captions_PayPal_Austin_en.vtt.txt
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
WEBVTT
|
||||||
|
|
||||||
|
00:00:00.000 --> 00:00:00.500
|
||||||
|
|
||||||
|
|
||||||
|
00:00:00.501 --> 00:00:06.000
|
||||||
|
[ music ]
|
||||||
|
|
||||||
|
00:00:06.001 --> 00:00:09.500
|
||||||
|
Austin is an <b>absolutely</b> thriving place
|
||||||
|
|
||||||
|
00:00:09.501 --> 00:00:12.000
|
||||||
|
for small business. And for <u>locally owned</u> businesses.
|
||||||
|
|
||||||
|
00:00:12.001 --> 00:00:15.000
|
||||||
|
We have <i>more locally owned businesses</i> per capita
|
||||||
|
|
||||||
|
00:00:15.001 --> 00:00:17.500
|
||||||
|
than any other city our size in the nation.
|
||||||
|
|
||||||
|
00:00:17.501 --> 00:00:19.000
|
||||||
|
I'm Marsha Lane, the owner of
|
||||||
|
|
||||||
|
00:00:19.001 --> 00:00:22.000
|
||||||
|
Ragalicious and Flashback in Austin, Texas.
|
||||||
|
|
||||||
|
00:00:22.001 --> 00:00:23.000
|
||||||
|
Everybody in Austin it seems like
|
||||||
|
|
||||||
|
00:00:23.001 --> 00:00:25.000
|
||||||
|
is a potential entrepreneur.
|
||||||
|
|
||||||
|
00:00:25.001 --> 00:00:27.000
|
||||||
|
I moved here in 1982. I thought I had a job.
|
||||||
|
|
||||||
|
00:00:27.001 --> 00:00:31.500
|
||||||
|
It fell through, so I started my own business then.
|
||||||
|
|
||||||
|
00:00:31.501 --> 00:00:34.500
|
||||||
|
|
||||||
|
|
||||||
|
00:00:34.501 --> 00:00:38.500
|
||||||
|
Well Tom made a cash box out of a shoe box.
|
||||||
|
|
||||||
|
00:00:38.501 --> 00:00:40.500
|
||||||
|
I didn't want to throw the money in a drawer.
|
||||||
|
|
||||||
|
00:00:41.501 --> 00:00:44.500
|
||||||
|
But I just cut a shoebox and made it dividers
|
||||||
|
|
||||||
|
00:00:44.501 --> 00:00:48.000
|
||||||
|
and put in the cash and the change. [laughs]
|
||||||
|
|
||||||
|
00:00:48.001 --> 00:00:51.500
|
||||||
|
|
||||||
|
|
||||||
|
00:00:51.501 --> 00:00:54.000
|
||||||
|
Today we installed PayPal Here.
|
||||||
|
|
||||||
|
00:00:54.001 --> 00:00:57.000
|
||||||
|
And we're really looking forward to using it in the future.
|
||||||
|
|
||||||
|
00:00:57.001 --> 00:01:01.000
|
||||||
|
[music]
|
||||||
|
|
||||||
|
00:01:01.001 --> 00:01:03.000
|
||||||
|
One of the things that excites me the most
|
||||||
|
|
||||||
|
00:01:03.001 --> 00:01:05.500
|
||||||
|
is that PayPal didn't come in and say,
|
||||||
|
|
||||||
|
00:01:05.501 --> 00:01:07.000
|
||||||
|
"Here's what we want you to buy."
|
||||||
|
|
||||||
|
00:01:07.001 --> 00:01:08.500
|
||||||
|
They've come in to say,
|
||||||
|
|
||||||
|
00:01:08.501 --> 00:01:10.000
|
||||||
|
"How can we help you?"
|
||||||
|
|
||||||
|
00:01:10.001 --> 00:01:13.500
|
||||||
|
"How can we be a partner to you as a local business?"
|
||||||
|
|
||||||
|
00:01:13.501 --> 00:01:16.500
|
||||||
|
[music]
|
||||||
|
|
||||||
|
00:01:16.501 --> 00:01:18.500
|
||||||
|
I'm really pleased to be one of the first people in Austin
|
||||||
|
|
||||||
|
00:01:18.501 --> 00:01:21.000
|
||||||
|
using the new cash for registers program
|
||||||
|
|
||||||
|
00:01:21.001 --> 00:01:24.000
|
||||||
|
and especially because we get free processing
|
||||||
|
|
||||||
|
00:01:24.001 --> 00:01:27.000
|
||||||
|
for 6 whole months and that is huge.
|
||||||
|
|
||||||
|
00:01:27.001 --> 00:01:29.000
|
||||||
|
I used PayPal Here for the first time this morning
|
||||||
|
|
||||||
|
00:01:29.001 --> 00:01:33.000
|
||||||
|
and I really like that it's really user friendly, self-explanatory
|
||||||
|
|
||||||
|
00:01:33.001 --> 00:01:35.000
|
||||||
|
I think customers will appreciate that
|
||||||
|
|
||||||
|
00:01:35.001 --> 00:01:39.000
|
||||||
|
it won't take me as long to add up their total.
|
||||||
|
|
||||||
|
00:01:39.001 --> 00:01:43.000
|
||||||
|
You just put in the amount; it figures the sales tax for you
|
||||||
|
|
||||||
|
00:01:43.001 --> 00:01:46.000
|
||||||
|
and everything goes into the bank account daily.
|
||||||
|
|
||||||
|
00:01:46.001 --> 00:01:49.000
|
||||||
|
One of the important things for a local business
|
||||||
|
|
||||||
|
00:01:49.001 --> 00:01:51.000
|
||||||
|
is to get as many customers as they can and
|
||||||
|
|
||||||
|
00:01:51.001 --> 00:01:54.000
|
||||||
|
make it easy for those customers to come do business with them.
|
||||||
|
|
||||||
|
00:01:54.001 --> 00:01:59.000
|
||||||
|
Being able to use PayPal in a retail situation like that
|
||||||
|
|
||||||
|
00:01:59.001 --> 00:02:02.000
|
||||||
|
just gives them one more option.
|
||||||
|
|
||||||
|
00:02:02.001 --> 00:02:05.000
|
||||||
|
Everything's very exciting; I'm really looking forward to it.
|
||||||
|
|
||||||
|
00:02:05.001 --> 00:02:09.000
|
||||||
|
I so appreciate especially the support PayPal is giving us.
|
||||||
|
|
||||||
|
00:02:09.001 --> 00:02:12.000
|
||||||
|
I would definitely recommend PayPal to other small businesses.
|
||||||
|
|
||||||
|
00:02:12.001 --> 00:02:16.000
|
||||||
|
Thanks to PayPal I found a better use for my shoe box.
|
||||||
|
|
||||||
|
00:02:16.001 --> 00:02:30.000
|
||||||
|
[music]
|
BIN
media/poster_PayPal_Austin2.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
36
package.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"name": "simple-media",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "A simple HTML5 media player using custom controls",
|
||||||
|
"main": "gulpfile.js",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"gulp": "~3.8.6",
|
||||||
|
"gulp-autoprefixer": "^0.0.8",
|
||||||
|
"gulp-concat": "~2.3.3",
|
||||||
|
"gulp-hogan-compile": "^0.4.1",
|
||||||
|
"gulp-less": "~1.3.1",
|
||||||
|
"gulp-minify-css": "~0.3.6",
|
||||||
|
"gulp-svgmin": "^1.0.0",
|
||||||
|
"gulp-svgstore": "^4.0.1",
|
||||||
|
"gulp-uglify": "~0.3.1",
|
||||||
|
"gulp-util": "~2.2.20",
|
||||||
|
"run-sequence": "^0.3.6"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"preinstall": "npm install -g gulp"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"HTML5 Video",
|
||||||
|
"HTML5 Audio",
|
||||||
|
"Media Player"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/sampotts/simple-media.git"
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
"Sam Potts <me@sampotts.me>"
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
12
readme.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Useful links
|
||||||
|
|
||||||
|
- [http://www.w3.org/2010/05/video/mediaevents.html](http://www.w3.org/2010/05/video/mediaevents.html)
|
||||||
|
- [http://www.osmf.org/strobe_mediaplayback.html](http://www.osmf.org/strobe_mediaplayback.html)
|
||||||
|
- [http://osmf.org/dev/2.0gm/](http://osmf.org/dev/2.0gm/)
|
||||||
|
- [http://stackoverflow.com/questions/4763042/html5-video-fallback-to-flash-if-no-ogv-file](http://stackoverflow.com/questions/4763042/html5-video-fallback-to-flash-if-no-ogv-file)
|
||||||
|
- [http://css-tricks.com/snippets/html/video-for-everybody-html5-video-with-flash-fallback/](http://css-tricks.com/snippets/html/video-for-everybody-html5-video-with-flash-fallback/)
|
||||||
|
- [http://stackoverflow.com/questions/21552914/flash-fallback-in-html5-video-tag-does-not-work-in-opera](http://stackoverflow.com/questions/21552914/flash-fallback-in-html5-video-tag-does-not-work-in-opera)
|
||||||
|
- [http://osmf.org/configurator/fmp/#](http://osmf.org/configurator/fmp/#)
|
||||||
|
- [http://stackoverflow.com/questions/5138077/html5-video-file-loading-complete-event](http://stackoverflow.com/questions/5138077/html5-video-file-loading-complete-event)
|
||||||
|
- [http://www.sitepoint.com/essential-audio-and-video-events-for-html5/](http://www.sitepoint.com/essential-audio-and-video-events-for-html5/)
|
||||||
|
- [http://dev.opera.com/articles/view/simple-html5-video-flash-fallback-custom-controls/](http://dev.opera.com/articles/view/simple-html5-video-flash-fallback-custom-controls/)
|