Skip to content

Commit

Permalink
Merge branch 'master' into issue/294
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmyadams committed Jun 17, 2024
2 parents 0a5ab6f + e229c1d commit 64353b2
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-contrib-media",
"version": "6.4.6",
"version": "6.6.0",
"framework": ">=5.19.1",
"homepage": "https://github.com/adaptlearning/adapt-contrib-media",
"bugs": "https://github.com/adaptlearning/adapt-contrib-media/issues",
Expand Down
21 changes: 14 additions & 7 deletions js/mediaView.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ class MediaView extends ComponentView {
}).removeClass('inline-transcript-open');
$button.attr('aria-expanded', false);
$buttonText.html(this.model.get('_transcript').inlineTranscriptButton);
this.transcriptTriggers('closed');

return;
}
Expand All @@ -501,17 +502,23 @@ class MediaView extends ComponentView {

$button.attr('aria-expanded', true);
$buttonText.html(this.model.get('_transcript').inlineTranscriptCloseButton);
this.transcriptTriggers('opened');
}

if (this.model.get('_transcript')._setCompletionOnView !== false) {
Adapt.trigger('media:transcriptComplete', this);
this.setCompletionStatus();
}
onExternalTranscriptClicked() {
this.transcriptTriggers('external');
}

onExternalTranscriptClicked(event) {
if (this.model.get('_transcript')._setCompletionOnView === false) return;
Adapt.trigger('media:transcriptComplete', this);
transcriptTriggers(state) {
const setCompletionOnView = this.model.get('_transcript')._setCompletionOnView;
const isComplete = this.model.get('_isComplete');
const shouldComplete = (setCompletionOnView && !isComplete);

if (!shouldComplete) {
return Adapt.trigger('media:transcript', state, this);
}
this.setCompletionStatus();
Adapt.trigger('media:transcript', 'complete', this);
}

/**
Expand Down
24 changes: 20 additions & 4 deletions less/media.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

// Transcript
// --------------------------------------------------
&__transcript-body-inline {
display: none;
}

// Skip to transcript button
&__skip-to-transcript {

Expand All @@ -26,6 +22,26 @@
}
}

// Transcript container
&__transcript-btn {
display: inline-flex;
align-items: center;
justify-content: center;
}

&__transcript-btn-icon {
margin-inline-start: @icon-padding / 2;
}

&.is-complete &__transcript-btn-icon .icon {
.icon-tick;
}

&__transcript-body-inline {
display: none;
}


// Cross browser bug fixes
// --------------------------------------------------
.me-plugin {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-contrib-media",
"version": "6.4.6",
"version": "6.6.0",
"framework": ">=5.19.1",
"homepage": "https://github.com/adaptlearning/adapt-contrib-media",
"bugs": "https://github.com/adaptlearning/adapt-contrib-media/issues",
Expand Down
6 changes: 6 additions & 0 deletions templates/media.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
{{_transcript.transcriptLink}}
{{/if}}
</span>
<span class="media__transcript-btn-icon">
<span class="icon" aria-hidden="true"></span>
</span>
</button>
{{/if}}

Expand All @@ -73,6 +76,9 @@
{{_transcript.transcriptLink}}
{{/if}}
</span>
<span class="media__transcript-btn-icon">
<span class="icon" aria-hidden="true"></span>
</span>
</button>
{{/if}}

Expand Down

0 comments on commit 64353b2

Please sign in to comment.