fix html export

This commit is contained in:
j 2016-02-29 17:45:40 +05:30
parent 030aaeb910
commit f805f93110

View file

@ -64,7 +64,7 @@ TextArea.prototype.insertTc = function(tcNpt) {
TextArea.prototype.getWord = function(pos, val) {
if (!val) {
val = this.elem.val();
}
}
var c;
var i = pos;
var j = pos;
@ -114,7 +114,7 @@ TextArea.prototype.fromSrt = function(txt) {
out += "\n";
}
} else if (parseInt(sp.tcOutMs) < Video.player.duration) {
out += "\n" + Ox.formatDuration(sp.tcOutMs, 3) + "\n\n";
out += "\n" + Ox.formatDuration(sp.tcOutMs, 3) + "\n\n";
}
});
this.elem.val(out);
@ -165,6 +165,7 @@ TextArea.prototype.toSrt = function(fmt) {
TextArea.prototype.toHTML = function() {
this.toSrt();
var spans = this.spans;
var html = '';
var span, txt;
@ -172,7 +173,7 @@ TextArea.prototype.toHTML = function() {
span = spans[i];
txt = '';
txt += '<p>\n';
txt += '<a href="https://pad.ma/PADMA_VIDEO_ID/' + Ox.formatDuration(span.tcInMs, 3) + "-" + Ox.formatDuration(span.tcOutMs, 3) + '">';
txt += '<a href="https://pad.ma/PADMA_VIDEO_ID/' + Ox.formatDuration(span.tcInMs, 3) + "," + Ox.formatDuration(span.tcOutMs, 3) + '">';
txt += (i + 1).toString();
txt += "</a>\n";
txt += '<br />\n';
@ -180,10 +181,9 @@ TextArea.prototype.toHTML = function() {
txt += "</p>\n\n";
html += txt;
}
return Ox.encodeUTF8(html);
return html;
}
//creates new Span (tcIn and tcOut in npt format)
var Span = function(tcIn, tcOut, text, index) {
this.index = index;