MDL-63431 atto_media: Add title global attribute support.
This commit is contained in:
@@ -50,6 +50,7 @@ $string['descriptions_help'] = 'Audio descriptions may be used to provide a narr
|
||||
$string['descriptionssourcelabel'] = 'Description track URL';
|
||||
$string['displayoptions'] = 'Display options';
|
||||
$string['entername'] = 'Enter name';
|
||||
$string['entertitle'] = 'Enter title';
|
||||
$string['entersource'] = 'Source URL';
|
||||
$string['enterurl'] = 'Enter URL';
|
||||
$string['height'] = 'Height';
|
||||
|
||||
@@ -53,7 +53,7 @@ function atto_media_strings_for_js() {
|
||||
'descriptionssourcelabel',
|
||||
'displayoptions',
|
||||
'entername',
|
||||
'entername',
|
||||
'entertitle',
|
||||
'entersource',
|
||||
'enterurl',
|
||||
'height',
|
||||
@@ -79,7 +79,7 @@ function atto_media_strings_for_js() {
|
||||
'videosourcelabel',
|
||||
'videowidth',
|
||||
'width'),
|
||||
'atto_media');
|
||||
'atto_media');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,9 +61,10 @@ Feature: Add media to Atto
|
||||
And I change window size to "large"
|
||||
And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_width_entry ')]" to "420"
|
||||
And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_height_entry ')]" to "69"
|
||||
And I set the field "Enter title" to "VideoTitle"
|
||||
And I click on "Display options" "link"
|
||||
When I click on "Insert media" "button"
|
||||
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69]" "xpath_element" should exist
|
||||
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69][@title='VideoTitle']" "xpath_element" should exist
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media as a video with advanced settings
|
||||
|
||||
Vendored
+33
-6
@@ -51,6 +51,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
TRACK_SOURCE: 'atto_media_track_source',
|
||||
DISPLAY_OPTIONS: 'atto_media_display_options',
|
||||
NAME_INPUT: 'atto_media_name_entry',
|
||||
TITLE_INPUT: 'atto_media_title_entry',
|
||||
URL_INPUT: 'atto_media_url_entry',
|
||||
POSTER_SIZE: 'atto_media_poster_size',
|
||||
LINK_SIZE: 'atto_media_link_size',
|
||||
@@ -82,6 +83,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
TRACK_SOURCE: '.' + CSS.TRACK_SOURCE,
|
||||
DISPLAY_OPTIONS: '.' + CSS.DISPLAY_OPTIONS,
|
||||
NAME_INPUT: '.' + CSS.NAME_INPUT,
|
||||
TITLE_INPUT: '.' + CSS.TITLE_INPUT,
|
||||
URL_INPUT: '.' + CSS.URL_INPUT,
|
||||
POSTER_SIZE: '.' + CSS.POSTER_SIZE,
|
||||
LINK_SIZE: '.' + CSS.LINK_SIZE,
|
||||
@@ -162,7 +164,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'<input name="mform_isexpanded_{{elementid}}_video-display-options" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "displayoptions" component}}</legend>' +
|
||||
'<div class="fcontainer">' +
|
||||
'{{> form_components.display_options}}' +
|
||||
'{{renderPartial "form_components.display_options" context=this id=CSS.VIDEO mediatype_video=true}}' +
|
||||
'</div>' +
|
||||
'</fieldset>' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_video-advanced-settings">' +
|
||||
@@ -182,6 +184,13 @@ var COMPONENTNAME = 'atto_media',
|
||||
AUDIO: '' +
|
||||
'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="audiosourcelabel"' +
|
||||
' addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_audio-display-options">' +
|
||||
'<input name="mform_isexpanded_{{elementid}}_audio-display-options" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "displayoptions" component}}</legend>' +
|
||||
'<div class="fcontainer">' +
|
||||
'{{renderPartial "form_components.display_options" context=this id=CSS.AUDIO}}' +
|
||||
'</div>' +
|
||||
'</fieldset>' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_audio-advanced-settings">' +
|
||||
'<input name="mform_isexpanded_{{elementid}}_audio-advanced-settings" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "advancedsettings" component}}</legend>' +
|
||||
@@ -235,6 +244,13 @@ var COMPONENTNAME = 'atto_media',
|
||||
'</div>',
|
||||
DISPLAY_OPTIONS: '' +
|
||||
'<div class="{{CSS.DISPLAY_OPTIONS}}">' +
|
||||
'<div class="m-b-1">' +
|
||||
'<label for="{{id}}_media-title-entry">{{get_string "entertitle" component}}</label>' +
|
||||
'<input class="form-control fullwidth {{CSS.TITLE_INPUT}}" type="text" id="{{id}}_media-title-entry"' +
|
||||
'size="32"/>' +
|
||||
'</div>' +
|
||||
'<div class="clearfix"></div>' +
|
||||
'{{#mediatype_video}}' +
|
||||
'<div class="m-b-1">' +
|
||||
'<label>{{get_string "size" component}}</label>' +
|
||||
'<div class="form-inline {{CSS.POSTER_SIZE}}">' +
|
||||
@@ -247,6 +263,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'</div>' +
|
||||
'<div class="clearfix"></div>' +
|
||||
'{{renderPartial "form_components.source" context=this id=CSS.POSTER_SOURCE entersourcelabel="poster"}}' +
|
||||
'{{/mediatype_video}}' +
|
||||
'<div>',
|
||||
ADVANCED_SETTINGS: '' +
|
||||
'<div class="{{CSS.ADVANCED_SETTINGS}}">' +
|
||||
@@ -368,6 +385,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'{{#loop}}loop="true" {{/loop}}' +
|
||||
'{{#muted}}muted="true" {{/muted}}' +
|
||||
'{{#autoplay}}autoplay="true" {{/autoplay}}' +
|
||||
'{{#title}}title="{{../title}}" {{/title}}' +
|
||||
'>' +
|
||||
'{{#sources}}<source src="{{source}}">{{/sources}}' +
|
||||
'{{#tracks}}' +
|
||||
@@ -382,6 +400,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'{{#loop}}loop="true" {{/loop}}' +
|
||||
'{{#muted}}muted="true" {{/muted}}' +
|
||||
'{{#autoplay}}autoplay="true" {{/autoplay}}' +
|
||||
'{{#title}}title="{{../title}}" {{/title}}' +
|
||||
'>' +
|
||||
'{{#sources}}<source src="{{source}}">{{/sources}}' +
|
||||
'{{#tracks}}' +
|
||||
@@ -647,17 +666,23 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
}, this);
|
||||
|
||||
// Populate values.
|
||||
tabPane.one(SELECTORS.POSTER_SOURCE + ' ' + SELECTORS.URL_INPUT).setAttribute('value', properties.poster);
|
||||
tabPane.one(SELECTORS.WIDTH_INPUT).set('value', properties.width);
|
||||
tabPane.one(SELECTORS.HEIGHT_INPUT).set('value', properties.height);
|
||||
tabPane.one(SELECTORS.TITLE_INPUT).set('value', properties.title);
|
||||
tabPane.one(SELECTORS.MEDIA_CONTROLS_TOGGLE).set('checked', properties.controls);
|
||||
tabPane.one(SELECTORS.MEDIA_AUTOPLAY_TOGGLE).set('checked', properties.autoplay);
|
||||
tabPane.one(SELECTORS.MEDIA_MUTE_TOGGLE).set('checked', properties.muted);
|
||||
tabPane.one(SELECTORS.MEDIA_LOOP_TOGGLE).set('checked', properties.loop);
|
||||
|
||||
// Switch to the correct tab.
|
||||
// Determine medium type.
|
||||
var mediumType = this._getMediumTypeFromTabPane(tabPane);
|
||||
|
||||
if (mediumType === 'video') {
|
||||
// Populate values unique for video.
|
||||
tabPane.one(SELECTORS.POSTER_SOURCE + ' ' + SELECTORS.URL_INPUT).setAttribute('value', properties.poster);
|
||||
tabPane.one(SELECTORS.WIDTH_INPUT).set('value', properties.width);
|
||||
tabPane.one(SELECTORS.HEIGHT_INPUT).set('value', properties.height);
|
||||
}
|
||||
|
||||
// Switch to the correct tab.
|
||||
// Remove active class from all tabs + tab panes.
|
||||
tabPane.siblings('.active').removeClass('active');
|
||||
content.all('.root.nav-tabs .nav-item a').removeClass('active');
|
||||
@@ -703,6 +728,7 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
type: medium.test('video') ? MEDIA_TYPES.VIDEO : MEDIA_TYPES.AUDIO,
|
||||
sources: medium.all('source').get('src'),
|
||||
poster: medium.getAttribute('poster'),
|
||||
title: medium.getAttribute('title'),
|
||||
width: medium.getAttribute('width'),
|
||||
height: medium.getAttribute('height'),
|
||||
autoplay: boolAttr(medium, 'autoplay'),
|
||||
@@ -947,7 +973,8 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
showControls: tab.one(SELECTORS.MEDIA_CONTROLS_TOGGLE).get('checked'),
|
||||
autoplay: tab.one(SELECTORS.MEDIA_AUTOPLAY_TOGGLE).get('checked'),
|
||||
muted: tab.one(SELECTORS.MEDIA_MUTE_TOGGLE).get('checked'),
|
||||
loop: tab.one(SELECTORS.MEDIA_LOOP_TOGGLE).get('checked')
|
||||
loop: tab.one(SELECTORS.MEDIA_LOOP_TOGGLE).get('checked'),
|
||||
title: tab.one(SELECTORS.TITLE_INPUT).get('value') || false
|
||||
};
|
||||
}
|
||||
}, {
|
||||
|
||||
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+33
-6
@@ -51,6 +51,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
TRACK_SOURCE: 'atto_media_track_source',
|
||||
DISPLAY_OPTIONS: 'atto_media_display_options',
|
||||
NAME_INPUT: 'atto_media_name_entry',
|
||||
TITLE_INPUT: 'atto_media_title_entry',
|
||||
URL_INPUT: 'atto_media_url_entry',
|
||||
POSTER_SIZE: 'atto_media_poster_size',
|
||||
LINK_SIZE: 'atto_media_link_size',
|
||||
@@ -82,6 +83,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
TRACK_SOURCE: '.' + CSS.TRACK_SOURCE,
|
||||
DISPLAY_OPTIONS: '.' + CSS.DISPLAY_OPTIONS,
|
||||
NAME_INPUT: '.' + CSS.NAME_INPUT,
|
||||
TITLE_INPUT: '.' + CSS.TITLE_INPUT,
|
||||
URL_INPUT: '.' + CSS.URL_INPUT,
|
||||
POSTER_SIZE: '.' + CSS.POSTER_SIZE,
|
||||
LINK_SIZE: '.' + CSS.LINK_SIZE,
|
||||
@@ -162,7 +164,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'<input name="mform_isexpanded_{{elementid}}_video-display-options" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "displayoptions" component}}</legend>' +
|
||||
'<div class="fcontainer">' +
|
||||
'{{> form_components.display_options}}' +
|
||||
'{{renderPartial "form_components.display_options" context=this id=CSS.VIDEO mediatype_video=true}}' +
|
||||
'</div>' +
|
||||
'</fieldset>' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_video-advanced-settings">' +
|
||||
@@ -182,6 +184,13 @@ var COMPONENTNAME = 'atto_media',
|
||||
AUDIO: '' +
|
||||
'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="audiosourcelabel"' +
|
||||
' addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_audio-display-options">' +
|
||||
'<input name="mform_isexpanded_{{elementid}}_audio-display-options" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "displayoptions" component}}</legend>' +
|
||||
'<div class="fcontainer">' +
|
||||
'{{renderPartial "form_components.display_options" context=this id=CSS.AUDIO}}' +
|
||||
'</div>' +
|
||||
'</fieldset>' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_audio-advanced-settings">' +
|
||||
'<input name="mform_isexpanded_{{elementid}}_audio-advanced-settings" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "advancedsettings" component}}</legend>' +
|
||||
@@ -235,6 +244,13 @@ var COMPONENTNAME = 'atto_media',
|
||||
'</div>',
|
||||
DISPLAY_OPTIONS: '' +
|
||||
'<div class="{{CSS.DISPLAY_OPTIONS}}">' +
|
||||
'<div class="m-b-1">' +
|
||||
'<label for="{{id}}_media-title-entry">{{get_string "entertitle" component}}</label>' +
|
||||
'<input class="form-control fullwidth {{CSS.TITLE_INPUT}}" type="text" id="{{id}}_media-title-entry"' +
|
||||
'size="32"/>' +
|
||||
'</div>' +
|
||||
'<div class="clearfix"></div>' +
|
||||
'{{#mediatype_video}}' +
|
||||
'<div class="m-b-1">' +
|
||||
'<label>{{get_string "size" component}}</label>' +
|
||||
'<div class="form-inline {{CSS.POSTER_SIZE}}">' +
|
||||
@@ -247,6 +263,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'</div>' +
|
||||
'<div class="clearfix"></div>' +
|
||||
'{{renderPartial "form_components.source" context=this id=CSS.POSTER_SOURCE entersourcelabel="poster"}}' +
|
||||
'{{/mediatype_video}}' +
|
||||
'<div>',
|
||||
ADVANCED_SETTINGS: '' +
|
||||
'<div class="{{CSS.ADVANCED_SETTINGS}}">' +
|
||||
@@ -368,6 +385,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'{{#loop}}loop="true" {{/loop}}' +
|
||||
'{{#muted}}muted="true" {{/muted}}' +
|
||||
'{{#autoplay}}autoplay="true" {{/autoplay}}' +
|
||||
'{{#title}}title="{{../title}}" {{/title}}' +
|
||||
'>' +
|
||||
'{{#sources}}<source src="{{source}}">{{/sources}}' +
|
||||
'{{#tracks}}' +
|
||||
@@ -382,6 +400,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'{{#loop}}loop="true" {{/loop}}' +
|
||||
'{{#muted}}muted="true" {{/muted}}' +
|
||||
'{{#autoplay}}autoplay="true" {{/autoplay}}' +
|
||||
'{{#title}}title="{{../title}}" {{/title}}' +
|
||||
'>' +
|
||||
'{{#sources}}<source src="{{source}}">{{/sources}}' +
|
||||
'{{#tracks}}' +
|
||||
@@ -647,17 +666,23 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
}, this);
|
||||
|
||||
// Populate values.
|
||||
tabPane.one(SELECTORS.POSTER_SOURCE + ' ' + SELECTORS.URL_INPUT).setAttribute('value', properties.poster);
|
||||
tabPane.one(SELECTORS.WIDTH_INPUT).set('value', properties.width);
|
||||
tabPane.one(SELECTORS.HEIGHT_INPUT).set('value', properties.height);
|
||||
tabPane.one(SELECTORS.TITLE_INPUT).set('value', properties.title);
|
||||
tabPane.one(SELECTORS.MEDIA_CONTROLS_TOGGLE).set('checked', properties.controls);
|
||||
tabPane.one(SELECTORS.MEDIA_AUTOPLAY_TOGGLE).set('checked', properties.autoplay);
|
||||
tabPane.one(SELECTORS.MEDIA_MUTE_TOGGLE).set('checked', properties.muted);
|
||||
tabPane.one(SELECTORS.MEDIA_LOOP_TOGGLE).set('checked', properties.loop);
|
||||
|
||||
// Switch to the correct tab.
|
||||
// Determine medium type.
|
||||
var mediumType = this._getMediumTypeFromTabPane(tabPane);
|
||||
|
||||
if (mediumType === 'video') {
|
||||
// Populate values unique for video.
|
||||
tabPane.one(SELECTORS.POSTER_SOURCE + ' ' + SELECTORS.URL_INPUT).setAttribute('value', properties.poster);
|
||||
tabPane.one(SELECTORS.WIDTH_INPUT).set('value', properties.width);
|
||||
tabPane.one(SELECTORS.HEIGHT_INPUT).set('value', properties.height);
|
||||
}
|
||||
|
||||
// Switch to the correct tab.
|
||||
// Remove active class from all tabs + tab panes.
|
||||
tabPane.siblings('.active').removeClass('active');
|
||||
content.all('.root.nav-tabs .nav-item a').removeClass('active');
|
||||
@@ -703,6 +728,7 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
type: medium.test('video') ? MEDIA_TYPES.VIDEO : MEDIA_TYPES.AUDIO,
|
||||
sources: medium.all('source').get('src'),
|
||||
poster: medium.getAttribute('poster'),
|
||||
title: medium.getAttribute('title'),
|
||||
width: medium.getAttribute('width'),
|
||||
height: medium.getAttribute('height'),
|
||||
autoplay: boolAttr(medium, 'autoplay'),
|
||||
@@ -947,7 +973,8 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
showControls: tab.one(SELECTORS.MEDIA_CONTROLS_TOGGLE).get('checked'),
|
||||
autoplay: tab.one(SELECTORS.MEDIA_AUTOPLAY_TOGGLE).get('checked'),
|
||||
muted: tab.one(SELECTORS.MEDIA_MUTE_TOGGLE).get('checked'),
|
||||
loop: tab.one(SELECTORS.MEDIA_LOOP_TOGGLE).get('checked')
|
||||
loop: tab.one(SELECTORS.MEDIA_LOOP_TOGGLE).get('checked'),
|
||||
title: tab.one(SELECTORS.TITLE_INPUT).get('value') || false
|
||||
};
|
||||
}
|
||||
}, {
|
||||
|
||||
+33
-6
@@ -49,6 +49,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
TRACK_SOURCE: 'atto_media_track_source',
|
||||
DISPLAY_OPTIONS: 'atto_media_display_options',
|
||||
NAME_INPUT: 'atto_media_name_entry',
|
||||
TITLE_INPUT: 'atto_media_title_entry',
|
||||
URL_INPUT: 'atto_media_url_entry',
|
||||
POSTER_SIZE: 'atto_media_poster_size',
|
||||
LINK_SIZE: 'atto_media_link_size',
|
||||
@@ -80,6 +81,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
TRACK_SOURCE: '.' + CSS.TRACK_SOURCE,
|
||||
DISPLAY_OPTIONS: '.' + CSS.DISPLAY_OPTIONS,
|
||||
NAME_INPUT: '.' + CSS.NAME_INPUT,
|
||||
TITLE_INPUT: '.' + CSS.TITLE_INPUT,
|
||||
URL_INPUT: '.' + CSS.URL_INPUT,
|
||||
POSTER_SIZE: '.' + CSS.POSTER_SIZE,
|
||||
LINK_SIZE: '.' + CSS.LINK_SIZE,
|
||||
@@ -160,7 +162,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'<input name="mform_isexpanded_{{elementid}}_video-display-options" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "displayoptions" component}}</legend>' +
|
||||
'<div class="fcontainer">' +
|
||||
'{{> form_components.display_options}}' +
|
||||
'{{renderPartial "form_components.display_options" context=this id=CSS.VIDEO mediatype_video=true}}' +
|
||||
'</div>' +
|
||||
'</fieldset>' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_video-advanced-settings">' +
|
||||
@@ -180,6 +182,13 @@ var COMPONENTNAME = 'atto_media',
|
||||
AUDIO: '' +
|
||||
'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="audiosourcelabel"' +
|
||||
' addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_audio-display-options">' +
|
||||
'<input name="mform_isexpanded_{{elementid}}_audio-display-options" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "displayoptions" component}}</legend>' +
|
||||
'<div class="fcontainer">' +
|
||||
'{{renderPartial "form_components.display_options" context=this id=CSS.AUDIO}}' +
|
||||
'</div>' +
|
||||
'</fieldset>' +
|
||||
'<fieldset class="collapsible collapsed" id="{{elementid}}_audio-advanced-settings">' +
|
||||
'<input name="mform_isexpanded_{{elementid}}_audio-advanced-settings" type="hidden">' +
|
||||
'<legend class="ftoggler">{{get_string "advancedsettings" component}}</legend>' +
|
||||
@@ -233,6 +242,13 @@ var COMPONENTNAME = 'atto_media',
|
||||
'</div>',
|
||||
DISPLAY_OPTIONS: '' +
|
||||
'<div class="{{CSS.DISPLAY_OPTIONS}}">' +
|
||||
'<div class="m-b-1">' +
|
||||
'<label for="{{id}}_media-title-entry">{{get_string "entertitle" component}}</label>' +
|
||||
'<input class="form-control fullwidth {{CSS.TITLE_INPUT}}" type="text" id="{{id}}_media-title-entry"' +
|
||||
'size="32"/>' +
|
||||
'</div>' +
|
||||
'<div class="clearfix"></div>' +
|
||||
'{{#mediatype_video}}' +
|
||||
'<div class="m-b-1">' +
|
||||
'<label>{{get_string "size" component}}</label>' +
|
||||
'<div class="form-inline {{CSS.POSTER_SIZE}}">' +
|
||||
@@ -245,6 +261,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'</div>' +
|
||||
'<div class="clearfix"></div>' +
|
||||
'{{renderPartial "form_components.source" context=this id=CSS.POSTER_SOURCE entersourcelabel="poster"}}' +
|
||||
'{{/mediatype_video}}' +
|
||||
'<div>',
|
||||
ADVANCED_SETTINGS: '' +
|
||||
'<div class="{{CSS.ADVANCED_SETTINGS}}">' +
|
||||
@@ -366,6 +383,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'{{#loop}}loop="true" {{/loop}}' +
|
||||
'{{#muted}}muted="true" {{/muted}}' +
|
||||
'{{#autoplay}}autoplay="true" {{/autoplay}}' +
|
||||
'{{#title}}title="{{../title}}" {{/title}}' +
|
||||
'>' +
|
||||
'{{#sources}}<source src="{{source}}">{{/sources}}' +
|
||||
'{{#tracks}}' +
|
||||
@@ -380,6 +398,7 @@ var COMPONENTNAME = 'atto_media',
|
||||
'{{#loop}}loop="true" {{/loop}}' +
|
||||
'{{#muted}}muted="true" {{/muted}}' +
|
||||
'{{#autoplay}}autoplay="true" {{/autoplay}}' +
|
||||
'{{#title}}title="{{../title}}" {{/title}}' +
|
||||
'>' +
|
||||
'{{#sources}}<source src="{{source}}">{{/sources}}' +
|
||||
'{{#tracks}}' +
|
||||
@@ -645,17 +664,23 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
}, this);
|
||||
|
||||
// Populate values.
|
||||
tabPane.one(SELECTORS.POSTER_SOURCE + ' ' + SELECTORS.URL_INPUT).setAttribute('value', properties.poster);
|
||||
tabPane.one(SELECTORS.WIDTH_INPUT).set('value', properties.width);
|
||||
tabPane.one(SELECTORS.HEIGHT_INPUT).set('value', properties.height);
|
||||
tabPane.one(SELECTORS.TITLE_INPUT).set('value', properties.title);
|
||||
tabPane.one(SELECTORS.MEDIA_CONTROLS_TOGGLE).set('checked', properties.controls);
|
||||
tabPane.one(SELECTORS.MEDIA_AUTOPLAY_TOGGLE).set('checked', properties.autoplay);
|
||||
tabPane.one(SELECTORS.MEDIA_MUTE_TOGGLE).set('checked', properties.muted);
|
||||
tabPane.one(SELECTORS.MEDIA_LOOP_TOGGLE).set('checked', properties.loop);
|
||||
|
||||
// Switch to the correct tab.
|
||||
// Determine medium type.
|
||||
var mediumType = this._getMediumTypeFromTabPane(tabPane);
|
||||
|
||||
if (mediumType === 'video') {
|
||||
// Populate values unique for video.
|
||||
tabPane.one(SELECTORS.POSTER_SOURCE + ' ' + SELECTORS.URL_INPUT).setAttribute('value', properties.poster);
|
||||
tabPane.one(SELECTORS.WIDTH_INPUT).set('value', properties.width);
|
||||
tabPane.one(SELECTORS.HEIGHT_INPUT).set('value', properties.height);
|
||||
}
|
||||
|
||||
// Switch to the correct tab.
|
||||
// Remove active class from all tabs + tab panes.
|
||||
tabPane.siblings('.active').removeClass('active');
|
||||
content.all('.root.nav-tabs .nav-item a').removeClass('active');
|
||||
@@ -701,6 +726,7 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
type: medium.test('video') ? MEDIA_TYPES.VIDEO : MEDIA_TYPES.AUDIO,
|
||||
sources: medium.all('source').get('src'),
|
||||
poster: medium.getAttribute('poster'),
|
||||
title: medium.getAttribute('title'),
|
||||
width: medium.getAttribute('width'),
|
||||
height: medium.getAttribute('height'),
|
||||
autoplay: boolAttr(medium, 'autoplay'),
|
||||
@@ -945,7 +971,8 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
showControls: tab.one(SELECTORS.MEDIA_CONTROLS_TOGGLE).get('checked'),
|
||||
autoplay: tab.one(SELECTORS.MEDIA_AUTOPLAY_TOGGLE).get('checked'),
|
||||
muted: tab.one(SELECTORS.MEDIA_MUTE_TOGGLE).get('checked'),
|
||||
loop: tab.one(SELECTORS.MEDIA_LOOP_TOGGLE).get('checked')
|
||||
loop: tab.one(SELECTORS.MEDIA_LOOP_TOGGLE).get('checked'),
|
||||
title: tab.one(SELECTORS.TITLE_INPUT).get('value') || false
|
||||
};
|
||||
}
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user