-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
videojs-standard #3459
videojs-standard #3459
Changes from all commits
d9deaf1
0bea95a
6fcee09
5a5ef4b
ae2ab52
99724c6
d71d8d1
a16d710
12a72f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,17 @@ | |
import window from 'global/window'; | ||
import document from 'global/document'; | ||
|
||
if (window.VIDEOJS_NO_BASE_THEME) return; | ||
if (window.VIDEOJS_NO_BASE_THEME) { | ||
return; | ||
} | ||
|
||
const styles = '{{GENERATED_STYLES}}'; | ||
|
||
if (styles === '{{GENERATED'+'_STYLES}}'); | ||
// Don't think we need this as it's a noop? | ||
// if (styles === '{{GENERATED'+'_STYLES}}'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume it was supposed to be something like if (styles === '{{GENERATED'+'_STYLES'}}) {
return;
} So that if somehow the styles weren't inline, it won't bother with the rest. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, thoughts on what to do, since it's clearly never done that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
const styleNode = document.createElement('style'); | ||
|
||
styleNode.innerHTML = styles; | ||
|
||
document.head.insertBefore(styleNode, document.head.firstChild); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,7 @@ | |
*/ | ||
import ClickableComponent from './clickable-component.js'; | ||
import Component from './component'; | ||
import * as Events from './utils/events.js'; | ||
import * as Fn from './utils/fn.js'; | ||
import log from './utils/log.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are removals like this scattered around: they were unused modules. Note: if we're only trying to import the module, we should be doing something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tend to agree, but the linter doesn't like unused variable names. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it isn't used then we shouldn't import it, sure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the topic of using the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, interesting. I guess that's exactly what we want in |
||
import document from 'global/document'; | ||
import assign from 'object.assign'; | ||
|
||
/** | ||
|
@@ -32,7 +29,7 @@ class Button extends ClickableComponent { | |
* @return {Element} | ||
* @method createEl | ||
*/ | ||
createEl(tag='button', props={}, attributes={}) { | ||
createEl(tag = 'button', props = {}, attributes = {}) { | ||
props = assign({ | ||
className: this.buildCSSClass() | ||
}, props); | ||
|
@@ -53,11 +50,15 @@ class Button extends ClickableComponent { | |
|
||
// Add attributes for button element | ||
attributes = assign({ | ||
type: 'button', // Necessary since the default button type is "submit" | ||
'aria-live': 'polite' // let the screen reader user know that the text of the button may change | ||
|
||
// Necessary since the default button type is "submit" | ||
'type': 'button', | ||
|
||
// let the screen reader user know that the text of the button may change | ||
'aria-live': 'polite' | ||
}, attributes); | ||
|
||
let el = Component.prototype.createEl.call(this, tag, props, attributes); | ||
const el = Component.prototype.createEl.call(this, tag, props, attributes); | ||
|
||
this.createControlTextEl(el); | ||
|
||
|
@@ -73,8 +74,9 @@ class Button extends ClickableComponent { | |
* @deprecated | ||
* @method addChild | ||
*/ | ||
addChild(child, options={}) { | ||
let className = this.constructor.name; | ||
addChild(child, options = {}) { | ||
const className = this.constructor.name; | ||
|
||
log.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`); | ||
|
||
// Avoid the error message generated by ClickableComponent's addChild method | ||
|
@@ -87,13 +89,15 @@ class Button extends ClickableComponent { | |
* @method handleKeyPress | ||
*/ | ||
handleKeyPress(event) { | ||
|
||
// Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button. | ||
if (event.which === 32 || event.which === 13) { | ||
} else { | ||
super.handleKeyPress(event); // Pass keypress handling up for unsupported keys | ||
return; | ||
} | ||
} | ||
|
||
// Pass keypress handling up for unsupported keys | ||
super.handleKeyPress(event); | ||
} | ||
} | ||
|
||
Component.registerComponent('Button', Button); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary step. The final PR in this series will restore automatic linting capabilities, but for now we want them off.