replace line-breaks + css

This commit is contained in:
Sanj 2011-12-22 18:15:22 +05:30
parent 92d70fcfe2
commit 40f08c39a5
2 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@ body {
color: #ccc;
width: 100%;
font-size: 14px;
font-family: "DejaVu Sans", Arial, sans-serif;
}
.container {

View File

@ -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);
});