replace line-breaks + css
This commit is contained in:
parent
92d70fcfe2
commit
40f08c39a5
|
@ -3,6 +3,7 @@ body {
|
|||
color: #ccc;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
font-family: "DejaVu Sans", Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
|
|
|
@ -20,7 +20,7 @@ $(function() {
|
|||
var $srtBtn = $('<button />').addClass("srtBtn").text("View SRT").data("fmt", "srt").appendTo($btnsContainer);
|
||||
var $tcBtn = $('<button />').addClass("srtBtn").text("View Time-coded Text").data("fmt", "tc").appendTo($btnsContainer);
|
||||
var $txtBtn = $('<button />').addClass("srtBtn").text("View Plain Text").data("fmt", "txt").appendTo($btnsContainer);
|
||||
var $srt = $('<pre />').addClass('srt').html(txt).appendTo($txtContainer);
|
||||
var $srt = $('<div />').addClass('srt').html(txt.replace(/\n/g, "<br />")).appendTo($txtContainer);
|
||||
$txtContainer.appendTo($parent).slideDown();
|
||||
});
|
||||
});
|
||||
|
@ -36,6 +36,7 @@ $('.srtBtn').live("click", function() {
|
|||
var fmt = $(this).data("fmt");
|
||||
var srt = $(this).parents(".srtContainer").data("srt");
|
||||
var txt = srtToTxt(srt, fmt);
|
||||
txt = txt.replace(/\n/g, "<br />");
|
||||
$(this).parents(".srtContainer").find(".srt").html(txt);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user