// ==UserScript==
// @name Lynda Subtitle Translate Tool ( moved to linkedin learning. not working)
// @namespace https://github.com/coderantidote
// @version 0.5
// @description You can add subtitles in any language while watching videos on Lynda.com.
// @author Antidote
// @match *.lynda.com/*
// @grant none
// @license CC BY-NC-ND 4.0 International. https://creativecommons.org/licenses/by-nc-nd/4.0/
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @downloadURL https://update.greasyfork.icu/scripts/416270/Lynda%20Subtitle%20Translate%20Tool%20%28%20moved%20to%20linkedin%20learning%20not%20working%29.user.js
// @updateURL https://update.greasyfork.icu/scripts/416270/Lynda%20Subtitle%20Translate%20Tool%20%28%20moved%20to%20linkedin%20learning%20not%20working%29.meta.js
// ==/UserScript==
(function() {
'use strict';
var $ = jQuery.noConflict();
function YandexWidget(){
$('#course-feedback').before("
");
};
function NoTranslate(){
var whitelist = ["#sidebar-container", ".breadcrumb", ".headline-from",".headline-course-title","#eyebrow","#course-tags",".course-actions","#footer","",".default-title","title","#suggested-courses"];
whitelist.forEach(function(entry) {
$(entry).attr("translate","no")
});
}
function LyndaToolbar(){
$(".translate-plugin").remove();
$('#video-container').after('Lynda Subtitle Translate Tools
Text color : Text size(px): ');
}
$( document ).ready(function() {
console.log( "Lynda Subtitle Translate Tool is Ready!" );
NoTranslate();
LyndaToolbar();
$( "#btn-start" ).click(function() {
console.log( "Starting Translate!" );
YandexWidget();
});
let flag = false
$( "#btn-hide-widget" ).click(function() {
if(flag == false){
$(".translate-plugin").remove();
$(this).text("Show");
flag=true
}else{
YandexWidget();
$(this).text("Hide");
flag=false
}
});
});
/*
Translate Automation
*/
$(document).on("DOMSubtreeModified", ".mejs-captions-text", function() {
$(this).hide();
$("#dragsubtitle").remove();
$(this).before("" + $('.transcript.ga.current').text() + "
");
});
})();