Skip to content

Commit

Permalink
Version 6.0.0-rc13
Browse files Browse the repository at this point in the history
  • Loading branch information
HitkoDev committed Dec 15, 2016
1 parent 1c979c6 commit 0c9b737
Show file tree
Hide file tree
Showing 24 changed files with 169 additions and 107 deletions.
6 changes: 3 additions & 3 deletions dist/videobox.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videobox.bundle.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videobox.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videobox.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videobox.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videobox.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/assets/js/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/vbinline.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/vbslider.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/classes/videobox.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/globals.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/index.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/interfaces/jquery.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/interfaces/jquerystatic.html

Large diffs are not rendered by default.

52 changes: 45 additions & 7 deletions docs/interfaces/vboptions.html

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions docs/interfaces/vborigin.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/interfaces/vbslideroptions.html

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/interfaces/vbvideo.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ gulp.task('images', () => {
})

gulp.task('scripts:rollup', shell.task([
'rollup -c'
path.join('node_modules', '.bin', 'rollup') + ' -c'
]))

var bcd = function(options) {
var bcd = function (options) {

var base = ''
if ('base' in options && options['base'])
Expand Down Expand Up @@ -134,7 +134,7 @@ var bcd = function(options) {
return through.obj(transform);
}

var efg = function() {
var efg = function () {

function transform(file, encoding, callback) {
if (file.sourceMap) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"license": "GPL-3.0",
"version": "6.0.0-rc12",
"version": "6.0.0-rc13",
"name": "videobox",
"description": "Pop-up video player plugin",
"copyright": "Hitko",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@types/jquery": ">=2.0.33",
"@types/zepto": ">=1.0.27",
"bourbon": ">=4.2.7",
"google-closure-compiler": "^20161024.3.0",
"google-closure-compiler": ">=20161024.3.0",
"gulp": ">=3.9.1",
"gulp-add-src": ">=0.2.0",
"gulp-changed": ">=1.3.2",
Expand All @@ -53,7 +53,7 @@
"merge2": ">=1.0.2",
"rollup": ">=0.36.3",
"rollup-plugin-sourcemaps": "^0.4.1",
"sorcery": "^0.10.0",
"sorcery": "git+https://github.com/HitkoDev/sorcery.git",
"through2": "^2.0.3",
"typedoc": ">=0.5.1"
},
Expand Down
29 changes: 19 additions & 10 deletions src/ts/components/box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export class Videobox {
height: 405,
closeText: 'Close',
padding: 30,
closeKeys: [27, 81],
hideBottom: false,
root: document.body,
animation: {
duration: 500,
Expand All @@ -35,10 +37,8 @@ export class Videobox {
/** @internal */
constructor(links?: Array<HTMLElement> | string, options: vbOptions = {}, linkMapper?: ((el: HTMLElement) => vbVideo)) {
this.overlay = <HTMLDivElement>create('div', 'vbOverlay', () => this.close())
//this.defaults.root.appendChild(this.overlay)

this.wrap = <HTMLDivElement>create('div', 'vbWrap')
//this.defaults.root.appendChild(this.wrap)

this.center = <HTMLDivElement>create('div', 'vbCenter')
this.wrap.appendChild(this.center)
Expand Down Expand Up @@ -72,6 +72,11 @@ export class Videobox {
this.setPlayerSizePosition()
})

window.addEventListener('keyup', (evt) => {
if (this.activeVideo && this.activeVideo.options.closeKeys.indexOf(evt.keyCode) >= 0)
this.close()
})

if (links)
this.bind(links, options, linkMapper || this.linkMapper)
}
Expand Down Expand Up @@ -261,14 +266,18 @@ export class Videobox {
}

private animateBotton(): void {
let bottomAnimation = this.bottomContainer.animate([
{ 'maxHeight': '0px' },
{ 'maxHeight': '200px' }
], this.activeVideo.options.animation)
toggleClass(this.bottomContainer, 'visible', true)
bottomAnimation.onfinish = () => this.showVideo()
this.animations.push(bottomAnimation)
bottomAnimation.play()
if (this.activeVideo.options.hideBottom) {
this.showVideo()
} else {
let bottomAnimation = this.bottomContainer.animate([
{ 'maxHeight': '0px' },
{ 'maxHeight': '200px' }
], this.activeVideo.options.animation)
toggleClass(this.bottomContainer, 'visible', true)
bottomAnimation.onfinish = () => this.showVideo()
this.animations.push(bottomAnimation)
bottomAnimation.play()
}
}

private showVideo(): void {
Expand Down
10 changes: 10 additions & 0 deletions src/ts/components/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ export interface vbOptions {
*/
closeTimeout?: number,

/**
* keycodes to close the pop-up / inlie player
*/
closeKeys?: number[],

/**
* if true, the bottom line on the pop-up player won't be displayed
*/
hideBottom?: boolean

/**
* animation properties (see <a href="https://w3c.github.io/web-animations/">web animations specifications</a>)
*/
Expand Down
7 changes: 6 additions & 1 deletion src/ts/components/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class VbInline {
closeText: 'Close',
padding: 30,
closeTimeout: 1000,
closeKeys: [27, 81],
animation: {
duration: 500,
iterations: 1,
Expand Down Expand Up @@ -51,9 +52,13 @@ export class VbInline {
hide(this.video)
this.responsive.appendChild(this.video)

window.addEventListener('keyup', (evt) => {
if (this.activeVideo && this.activeVideo.options.closeKeys.indexOf(evt.keyCode) >= 0)
this.close()
})

if (links)
this.bind(links, options, linkMapper || this.linkMapper)

}

/**
Expand Down

0 comments on commit 0c9b737

Please sign in to comment.