slibras.functions.js
975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var indexTextoAtual;
var textoAtual;
function srtToSeconds(srt) {
var arr = srt.split(":");
var hours = arr[0];
var minutes = arr[1];
var seconds = arr[2].replace(',', '.');
return parseFloat(hours) * 60 * 60 + parseFloat(minutes) * 60 + parseFloat(seconds);
}
function saveSub() {
var txa = document.getElementById('subcurrent');
if (txa.value != "") {
var title = document.getElementById('titles' + indexTextoAtual);
title.innerHTML = txa.value;
txa.value = "";
}
}
function showSubtitle(num) {
var textarea = document.getElementById('subcurrent');
var titles = document.getElementById('titles' + num);
textarea.value = "";
textarea.value = titles.innerHTML;
indexTextoAtual = num;
}
function changeSubtitle() {
var txa = document.getElementById("subcurrent");
var subsContainer = document.getElementById("subtitle");
var childs = subsContainer.childNodes;
childs[Number(indexTextoAtual)-1].innerHTML = txa.value;
}