Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #2270

Closed
wants to merge 31 commits into from
Closed

Master #2270

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
24b53c3
JSDoc comments
mboles Jun 15, 2015
899ea81
JSDoc comments
mboles Jun 15, 2015
022e2de
Review of JSDoc comments in component.js
mboles Jun 15, 2015
d341e49
Minor edit
mboles Jun 17, 2015
4a51394
Minor edits and error-display.js class commented
mboles Jun 17, 2015
f65382c
Adding JSDoc comments
mboles Jun 17, 2015
40d202a
JSDoc comments inserted
mboles Jun 17, 2015
43ceb7c
Insert JSDoc comments for progress-control classes
mboles Jun 17, 2015
1cc17eb
Inserted JSDoc comment for spacer-controls classes
mboles Jun 17, 2015
88aae60
Inserted JSDoc comments for text-track-control classes
mboles Jun 17, 2015
6785832
Inserted JSDoc comments for time-controls classes
mboles Jun 17, 2015
0c1c590
Inserted JSDoc comments for volume-control classes
mboles Jun 17, 2015
134ec9e
Inserted JSDoc comments for control-bar root classes
mboles Jun 19, 2015
b3daa73
Inserted JSDoc comments for menu classes
mboles Jun 19, 2015
b288c19
Inserted JSDoc comments for slider class
mboles Jun 21, 2015
642d8ce
Inserted JSDoc comments for slider class - minor update
mboles Jun 21, 2015
ac13f39
Inserted JSDoc comments for Flash and HTML5 techs, plus corrected ear…
mboles Jun 22, 2015
daeeec6
Inserted JSDoc comments for tech classes
mboles Jun 23, 2015
a351c71
Inserted JSDoc comments for tracks classes
mboles Jun 23, 2015
79bbfe2
Inserted JSDoc comments for utils classes
mboles Jun 23, 2015
3138e3c
Inserted JSDoc comments for root classes
mboles Jun 23, 2015
bfe3201
Edits to correct JSDoc errors
mboles Jun 23, 2015
e7d99bc
Wrong name for deprecated method
mboles Jun 25, 2015
9c50397
Added @file to get proper folder/file path
mboles Jun 28, 2015
a71eb37
Cleaning up comments per discussion with Steve
mboles Jul 2, 2015
765df3d
Cleaning up comments per conversation with Steve
mboles Jul 2, 2015
4f927b5
Cleaning up comments per conversation with Steve
mboles Jul 2, 2015
7659187
Cleaned up descriptions (no blanks lines contained therein) - Added m…
mboles Jul 2, 2015
864760c
Added constructor for JSDoc consistency
mboles Jul 7, 2015
78e156e
Changing indentation
mboles Jul 8, 2015
565aeca
Changing indentation
mboles Jul 8, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/js/base-styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* This code injects the required base styles in the head of the document.
*/
* @file base-styles.js
*
* This code injects the required base styles in the head of the document.
*/
import window from 'global/window';
import document from 'global/document';

Expand Down
31 changes: 25 additions & 6 deletions src/js/big-play-button.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
/**
* @file big-play-button.js
*/
import Button from './button.js';
import Component from './component.js';

/* Big Play Button
================================================================================ */
/ * Big Play Button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mboles FYI, the find replace wasn't 100% safe. It added a comment-breaking space in a few places like this. I cleaned them up, but just a heads up in case you use that again.

================================================================================ */
/**
* Initial play button. Shows before the video has played. The hiding of the
* big play button is done via CSS and player states.
* @param {Player|Object} player
* @param {Object=} options
* @class
* @constructor
*
* @param {Object} player Main Player
* @param {Object=} options Object of option names and values
* @extends Button
* @class BigPlayButton
*/
class BigPlayButton extends Button {

constructor(player, options) {
super(player, options);
}

/**
* Allow sub components to stack CSS class names
*
* @return {String} The constructed class name
* @method buildCSSClass
*/
buildCSSClass() {
return 'vjs-big-play-button';
}

/**
* Handles click for play
*
* @method handleClick
*/
handleClick() {
this.player_.play();
}
Expand Down
57 changes: 49 additions & 8 deletions src/js/button.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
/**
* @file button.js
*/
import Component from './component';
import * as Dom from './utils/dom.js';
import * as Events from './utils/events.js';
import * as Fn from './utils/fn.js';
import document from 'global/document';
import assign from 'object.assign';

/* Button - Base class for all buttons
================================================================================ */
/ * Button - Base class for all buttons
================================================================================ */
/**
* Base class for all buttons
* @param {Player|Object} player
* @param {Object=} options
*
* @param {Object} player Main Player
* @param {Object=} options Object of option names and values
* @extends Component
* @class Button
*/
Expand All @@ -27,6 +31,14 @@ class Button extends Component {
this.on('blur', this.handleBlur);
}

/**
* Create the component's DOM element
*
* @param {String=} type Element's node type. e.g. 'div'
* @param {Object=} props An object of element attributes that should be set on the element Tag name
* @return {Element}
* @method createEl
*/
createEl(type='button', props={}) {
// Add standard Aria and Tabindex info
props = assign({
Expand All @@ -49,6 +61,13 @@ class Button extends Component {
return el;
}

/**
* Controls text - both request and localize
*
* @param {String} text Text for button
* @return {String}
* @method controlText
*/
controlText(text) {
if (!text) return this.controlText_ || 'Need Text';

Expand All @@ -58,19 +77,37 @@ class Button extends Component {
return this;
}

/**
* Allows sub components to stack CSS class names
*
* @return {String}
* @method buildCSSClass
*/
buildCSSClass() {
return `vjs-control vjs-button ${super.buildCSSClass()}`;
}

// Click - Override with specific functionality for button
/**
* Handle Click - Override with specific functionality for button
*
* @method handleClick
*/
handleClick() {}

// Focus - Add keyboard functionality to element
/**
* Handle Focus - Add keyboard functionality to element
*
* @method handleFocus
*/
handleFocus() {
Events.on(document, 'keydown', Fn.bind(this, this.handleKeyPress));
}

// KeyPress (document level) - Trigger click when keys are pressed
/**
* Handle KeyPress (document level) - Trigger click when keys are pressed
*
* @method handleKeyPress
*/
handleKeyPress(event) {
// Check for space bar (32) or enter (13) keys
if (event.which === 32 || event.which === 13) {
Expand All @@ -79,7 +116,11 @@ class Button extends Component {
}
}

// Blur - Remove keyboard triggers
/**
* Handle Blur - Remove keyboard triggers
*
* @method handleBlur
*/
handleBlur() {
Events.off(document, 'keydown', Fn.bind(this, this.handleKeyPress));
}
Expand Down
Loading