Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f64bf4c0
Commit
f64bf4c0
authored
May 31, 2016
by
Chris Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "AC-454 adding visual clarify for selected menu options"
This reverts commit
41756165
.
parent
ef213488
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
56 deletions
+18
-56
common/lib/xmodule/xmodule/css/video/display.scss
+0
-2
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
+0
-2
common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js
+6
-8
common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js
+9
-35
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
+3
-9
No files found.
common/lib/xmodule/xmodule/css/video/display.scss
View file @
f64bf4c0
...
@@ -535,8 +535,6 @@
...
@@ -535,8 +535,6 @@
.speed-option
,
.speed-option
,
.control-lang
{
.control-lang
{
@include
border-left
(
$baseline
/
10
solid
rgb
(
14
,
166
,
236
));
font-weight
:
$font-bold
;
color
:
rgb
(
14
,
166
,
236
);
// UXPL primary accent
color
:
rgb
(
14
,
166
,
236
);
// UXPL primary accent
}
}
}
}
...
...
common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js
View file @
f64bf4c0
...
@@ -266,7 +266,6 @@
...
@@ -266,7 +266,6 @@
expect
(
$
(
'.closed-captions'
)).
toHaveAttrs
({
expect
(
$
(
'.closed-captions'
)).
toHaveAttrs
({
'lang'
:
'de'
'lang'
:
'de'
});
});
expect
(
link
).
toHaveAttr
(
'aria-pressed'
,
'true'
);
});
});
it
(
'when clicking on link with current language'
,
function
()
{
it
(
'when clicking on link with current language'
,
function
()
{
...
@@ -285,7 +284,6 @@
...
@@ -285,7 +284,6 @@
expect
(
state
.
storage
.
setItem
)
expect
(
state
.
storage
.
setItem
)
.
not
.
toHaveBeenCalledWith
(
'language'
,
'en'
);
.
not
.
toHaveBeenCalledWith
(
'language'
,
'en'
);
expect
(
$
(
'.langs-list li.is-active'
).
length
).
toBe
(
1
);
expect
(
$
(
'.langs-list li.is-active'
).
length
).
toBe
(
1
);
expect
(
link
).
toHaveAttr
(
'aria-pressed'
,
'true'
);
});
});
it
(
'open the language toggle on hover'
,
function
()
{
it
(
'open the language toggle on hover'
,
function
()
{
...
...
common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js
View file @
f64bf4c0
...
@@ -203,18 +203,16 @@
...
@@ -203,18 +203,16 @@
describe
(
'onSpeedChange'
,
function
()
{
describe
(
'onSpeedChange'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
state
=
jasmine
.
initializePlayer
();
state
=
jasmine
.
initializePlayer
();
$
(
'li[data-speed="1.0"]'
).
addClass
(
'is-active'
)
.
attr
(
'aria-pressed'
,
'true'
)
;
$
(
'li[data-speed="1.0"]'
).
addClass
(
'is-active'
);
state
.
videoSpeedControl
.
setSpeed
(
0.75
);
state
.
videoSpeedControl
.
setSpeed
(
0.75
);
});
});
it
(
'set the new speed as active'
,
function
()
{
it
(
'set the new speed as active'
,
function
()
{
expect
(
$
(
'li[data-speed="1.0"]'
)).
not
.
toHaveClass
(
'is-active'
);
expect
(
$
(
'.video-speeds li[data-speed="1.0"]'
))
expect
(
$
(
'li[data-speed="1.0"] .speed-option'
).
attr
(
'aria-pressed'
)).
not
.
toEqual
(
'true'
);
.
not
.
toHaveClass
(
'is-active'
);
expect
(
$
(
'.video-speeds li[data-speed="0.75"]'
))
expect
(
$
(
'li[data-speed="0.75"]'
)).
toHaveClass
(
'is-active'
);
.
toHaveClass
(
'is-active'
);
expect
(
$
(
'li[data-speed="0.75"] .speed-option'
).
attr
(
'aria-pressed'
)).
toEqual
(
'true'
);
expect
(
$
(
'.speeds .value'
)).
toHaveHtml
(
'0.75x'
);
expect
(
$
(
'.speeds .speed-button .value'
)).
toHaveHtml
(
'0.75x'
);
});
});
});
});
...
...
common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js
View file @
f64bf4c0
...
@@ -95,15 +95,14 @@ function (Iterator) {
...
@@ -95,15 +95,14 @@ function (Iterator) {
* Creates any necessary DOM elements, attach them, and set their,
* Creates any necessary DOM elements, attach them, and set their,
* initial configuration.
* initial configuration.
* @param {array} speeds List of speeds available for the player.
* @param {array} speeds List of speeds available for the player.
* @param {string} currentSpeed The current speed set to the player.
*/
*/
render
:
function
(
speeds
,
currentSpeed
)
{
render
:
function
(
speeds
)
{
var
speedsContainer
=
this
.
speedsContainer
,
var
speedsContainer
=
this
.
speedsContainer
,
reversedSpeeds
=
speeds
.
concat
().
reverse
(),
reversedSpeeds
=
speeds
.
concat
().
reverse
(),
speedsList
=
$
.
map
(
reversedSpeeds
,
function
(
speed
)
{
speedsList
=
$
.
map
(
reversedSpeeds
,
function
(
speed
)
{
return
[
return
[
'<li data-speed="'
,
speed
,
'">'
,
'<li data-speed="'
,
speed
,
'">'
,
'<button class="control speed-option" tabindex="-1"
aria-pressed="false"
>'
,
'<button class="control speed-option" tabindex="-1">'
,
speed
,
'x'
,
speed
,
'x'
,
'</button>'
,
'</button>'
,
'</li>'
'</li>'
...
@@ -113,7 +112,6 @@ function (Iterator) {
...
@@ -113,7 +112,6 @@ function (Iterator) {
speedsContainer
.
html
(
speedsList
.
join
(
''
));
speedsContainer
.
html
(
speedsList
.
join
(
''
));
this
.
speedLinks
=
new
Iterator
(
speedsContainer
.
find
(
'.speed-option'
));
this
.
speedLinks
=
new
Iterator
(
speedsContainer
.
find
(
'.speed-option'
));
this
.
state
.
el
.
find
(
'.secondary-controls'
).
prepend
(
this
.
el
);
this
.
state
.
el
.
find
(
'.secondary-controls'
).
prepend
(
this
.
el
);
this
.
setActiveSpeed
(
currentSpeed
);
},
},
/**
/**
...
@@ -218,38 +216,17 @@ function (Iterator) {
...
@@ -218,38 +216,17 @@ function (Iterator) {
if
(
speed
!==
this
.
currentSpeed
||
forceUpdate
)
{
if
(
speed
!==
this
.
currentSpeed
||
forceUpdate
)
{
this
.
speedsContainer
this
.
speedsContainer
.
find
(
'li'
)
.
find
(
'li'
)
.
siblings
(
"li[data-speed='"
+
speed
+
"']"
);
.
removeClass
(
'is-active'
)
.
siblings
(
"li[data-speed='"
+
speed
+
"']"
)
.
addClass
(
'is-active'
);
this
.
speedButton
.
find
(
'.value'
).
text
(
speed
+
'x'
);
this
.
speedButton
.
find
(
'.value'
).
html
(
speed
+
'x'
);
this
.
currentSpeed
=
speed
;
this
.
currentSpeed
=
speed
;
if
(
!
silent
)
{
if
(
!
silent
)
{
this
.
el
.
trigger
(
'speedchange'
,
[
speed
,
this
.
state
.
speed
]);
this
.
el
.
trigger
(
'speedchange'
,
[
speed
,
this
.
state
.
speed
]);
}
}
}
}
this
.
resetActiveSpeed
();
this
.
setActiveSpeed
(
speed
);
},
resetActiveSpeed
:
function
()
{
var
speedOptions
=
this
.
speedsContainer
.
find
(
'li'
);
$
(
speedOptions
).
each
(
function
(
index
,
el
)
{
$
(
el
).
removeClass
(
'is-active'
)
.
find
(
'.speed-option'
)
.
attr
(
'aria-pressed'
,
'false'
);
});
},
setActiveSpeed
:
function
(
speed
)
{
var
speedOption
=
this
.
speedsContainer
.
find
(
'li[data-speed="'
+
speed
+
'"]'
);
speedOption
.
addClass
(
'is-active'
)
.
find
(
'.speed-option'
)
.
attr
(
'aria-pressed'
,
'true'
);
this
.
speedButton
.
attr
(
'title'
,
gettext
(
'Video speed: '
)
+
speed
+
'x'
);
},
},
/**
/**
...
@@ -267,13 +244,10 @@ function (Iterator) {
...
@@ -267,13 +244,10 @@ function (Iterator) {
* @param {jquery Event} event
* @param {jquery Event} event
*/
*/
clickLinkHandler
:
function
(
event
)
{
clickLinkHandler
:
function
(
event
)
{
var
el
=
$
(
event
.
currentTarget
).
parent
(),
var
speed
=
$
(
event
.
currentTarget
).
parent
().
data
(
'speed'
);
speed
=
$
(
el
).
data
(
'speed'
);
this
.
closeMenu
();
this
.
resetActiveSpeed
();
this
.
setActiveSpeed
(
speed
);
this
.
state
.
videoCommands
.
execute
(
'speed'
,
speed
);
this
.
state
.
videoCommands
.
execute
(
'speed'
,
speed
);
this
.
closeMenu
(
true
);
return
false
;
return
false
;
},
},
...
...
common/lib/xmodule/xmodule/js/src/video/09_video_caption.js
View file @
f64bf4c0
...
@@ -662,11 +662,10 @@
...
@@ -662,11 +662,10 @@
$
.
each
(
languages
,
function
(
code
,
label
)
{
$
.
each
(
languages
,
function
(
code
,
label
)
{
var
li
=
$
(
'<li data-lang-code="'
+
code
+
'" />'
),
var
li
=
$
(
'<li data-lang-code="'
+
code
+
'" />'
),
link
=
$
(
'<button class="control control-lang"
aria-pressed="false"
>'
+
label
+
'</button>'
);
link
=
$
(
'<button class="control control-lang">'
+
label
+
'</button>'
);
if
(
currentLang
===
code
)
{
if
(
currentLang
===
code
)
{
li
.
addClass
(
'is-active'
);
li
.
addClass
(
'is-active'
);
link
.
attr
(
'aria-pressed'
,
'true'
);
}
}
li
.
append
(
link
);
li
.
append
(
link
);
...
@@ -684,11 +683,7 @@
...
@@ -684,11 +683,7 @@
state
.
lang
=
langCode
;
state
.
lang
=
langCode
;
el
.
addClass
(
'is-active'
)
el
.
addClass
(
'is-active'
)
.
siblings
(
'li'
)
.
siblings
(
'li'
)
.
removeClass
(
'is-active'
)
.
removeClass
(
'is-active'
);
.
find
(
'.control-lang'
)
.
attr
(
'aria-pressed'
,
'false'
);
$
(
e
.
currentTarget
).
attr
(
'aria-pressed'
,
'true'
);
state
.
el
.
trigger
(
'language_menu:change'
,
[
langCode
]);
state
.
el
.
trigger
(
'language_menu:change'
,
[
langCode
]);
self
.
fetchCaption
();
self
.
fetchCaption
();
...
@@ -698,7 +693,6 @@
...
@@ -698,7 +693,6 @@
// update the transcript lang attribute
// update the transcript lang attribute
self
.
subtitlesMenuEl
.
attr
(
'lang'
,
langCode
);
self
.
subtitlesMenuEl
.
attr
(
'lang'
,
langCode
);
self
.
closeLanguageMenu
(
e
);
}
}
});
});
},
},
...
@@ -721,7 +715,7 @@
...
@@ -721,7 +715,7 @@
'data-index'
:
index
,
'data-index'
:
index
,
'data-start'
:
start
[
index
],
'data-start'
:
start
[
index
],
'tabindex'
:
0
'tabindex'
:
0
}).
text
(
text
);
}).
html
(
text
);
return
liEl
[
0
];
return
liEl
[
0
];
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment