@@ -56,7 +56,8 @@ FrameTrail.defineModule('HypervideoFormBuilder', function(FrameTrail){
5656 * name: '',
5757 * captionsVisible: false,
5858 * autohideControls: false,
59- * showExistingSubtitles: false
59+ * showExistingSubtitles: false,
60+ * showExtendedSettings: false
6061 * }
6162 * @return {String } HTML string
6263 */
@@ -67,15 +68,18 @@ FrameTrail.defineModule('HypervideoFormBuilder', function(FrameTrail){
6768 var captionsVisible = options . captionsVisible || false ;
6869 var autohideControls = options . autohideControls || false ;
6970 var showExistingSubtitles = options . showExistingSubtitles || false ;
71+ var showExtendedSettings = options . showExtendedSettings || false ;
7072
7173 var html = '<div class="layoutRow">'
7274 // Row 1: Name (full width)
7375 + ' <div class="column-12">'
7476 + ' <label for="name">' + labels [ 'GenericName' ] + '</label>'
7577 + ' <input type="text" name="name" placeholder="' + labels [ 'SettingsHypervideoName' ] + '" value="' + name + '">'
7678 + ' </div>'
77- + '</div>'
78- + '<div class="layoutRow" style="margin-top: 7px;">'
79+ + '</div>' ;
80+
81+ if ( showExtendedSettings ) {
82+ html += '<div class="layoutRow" style="margin-top: 7px;">'
7983 // Row 2, Column 1: Checkboxes
8084 + ' <div class="column-6">'
8185 + ' <div class="checkboxRow"><label class="switch"><input type="checkbox" name="config[captionsVisible]" id="captionsVisible" value="true" ' + ( captionsVisible ? 'checked' : '' ) + '><span class="slider round"></span></label><label for="captionsVisible">' + labels [ 'SettingsSubtitlesShowByDefault' ] + '</label></div>'
@@ -87,14 +91,15 @@ FrameTrail.defineModule('HypervideoFormBuilder', function(FrameTrail){
8791 + ' <div>' + labels [ 'GenericSubtitles' ] + ' (' + labels [ 'MessageSubtitlesAlsoUsedForInteractiveTranscripts' ] + ')</div>'
8892 + ' <button class="subtitlesPlus" type="button">' + labels [ 'GenericAdd' ] + ' <span class="icon-plus"></span></button>' ;
8993
90- if ( showExistingSubtitles ) {
91- html += ' <div class="existingSubtitlesContainer"></div>' ;
92- }
94+ if ( showExistingSubtitles ) {
95+ html += ' <div class="existingSubtitlesContainer"></div>' ;
96+ }
9397
94- html += ' <div class="newSubtitlesContainer"></div>'
95- + ' </div>'
96- + ' </div>'
97- + '</div>' ;
98+ html += ' <div class="newSubtitlesContainer"></div>'
99+ + ' </div>'
100+ + ' </div>'
101+ + '</div>' ;
102+ }
98103
99104 return html ;
100105 }
@@ -123,7 +128,6 @@ FrameTrail.defineModule('HypervideoFormBuilder', function(FrameTrail){
123128 var isEditMode = options . isEditMode || false ;
124129
125130 var html = '<div class="videoSourceSection">'
126- + ' <div class="message active mb-0">' + labels [ 'SettingsVideoSource' ] + '</div>'
127131 + ' <div class="videoSourceTabs">'
128132 + ' <ul>'
129133 + ' <li><a href="#ChooseVideo">' + labels [ 'SettingsChooseVideo' ] + '</a></li>'
@@ -132,7 +136,7 @@ FrameTrail.defineModule('HypervideoFormBuilder', function(FrameTrail){
132136 + ' <div id="ChooseVideo">' ;
133137
134138 if ( showUploadButton ) {
135- html += ' <button type="button" class="uploadNewVideoResource">' + labels [ 'ResourceUploadVideo' ] + '</button>' ;
139+ html += ' <button type="button" class="uploadNewVideoResource"><span class="icon-plus"></span> ' + labels [ 'ResourceUploadVideo' ] + '</button>' ;
136140 }
137141
138142 html += ' <div class="videoResourceList"></div>'
@@ -201,6 +205,9 @@ FrameTrail.defineModule('HypervideoFormBuilder', function(FrameTrail){
201205 function attachSubtitleHandlers ( formElement ) {
202206 var el = ( formElement instanceof Element ) ? formElement : formElement [ 0 ] ;
203207
208+ // No subtitle elements when extended settings are hidden
209+ if ( ! el . querySelector ( '.subtitlesPlus' ) ) return ;
210+
204211 // Add new subtitle item
205212 el . querySelector ( '.subtitlesPlus' ) . addEventListener ( 'click' , function ( ) {
206213 var subtitleItem = createSubtitleItem ( ) ;
0 commit comments