(function ($) { AblePlayer.prototype.setupTranscript = function() { var deferred = new $.Deferred(); var promise = deferred.promise(); if (!this.transcriptType) { // previously set transcriptType to null since there are no elements // check again to see if captions have been collected from other sources (e.g., YouTube) if (this.captions.length && (!(this.usingYouTubeCaptions || this.usingVimeoCaptions))) { // captions are possible! Use the default type (popup) // if other types ('external' and 'manual') were desired, transcriptType would not be null here this.transcriptType = 'popup'; } } if (this.transcriptType) { if (this.transcriptType === 'popup' || this.transcriptType === 'external') { this.injectTranscriptArea(); deferred.resolve(); } else if (this.transcriptType === 'manual') { this.setupManualTranscript(); deferred.resolve(); } } else { // there is no transcript deferred.resolve(); } return promise; }; AblePlayer.prototype.injectTranscriptArea = function() { var thisObj, $autoScrollLabel, $languageSelectWrapper, $languageSelectLabel, i, $option; thisObj = this; this.$transcriptArea = $('
', { 'class': 'able-transcript-area', 'tabindex': '-1' }); this.$transcriptToolbar = $('
', { 'class': 'able-window-toolbar able-' + this.toolbarIconColor + '-controls' }); this.$transcriptDiv = $('
', { 'class' : 'able-transcript' }); // Transcript toolbar content // Add auto Scroll checkbox this.$autoScrollTranscriptCheckbox = $('', { 'id': 'autoscroll-transcript-checkbox', 'type': 'checkbox' }); $autoScrollLabel = $('