Skip to content

Commit

Permalink
some timestamp detect fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ulasbayraktar committed Jun 22, 2024
1 parent 24e2151 commit 2ebbefb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/chatlog-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(document).ready(function() {
for (var e = $("textarea").val().replace("<script>", "").replace("</script>", "").split("\n"), t = 0; t < e.length; t++)
$(".output").append(
'<div class="generated" id="chatlogOutput">' +
(useRegex(e[t]) ? e[t].slice(11) : e[t].slice(0)) +
(useRegex(e[t]) ? e[t].slice(10) : e[t].slice(0)) +
'</div><div class="clear"></div>'
);
$(".generated").each(function() {
Expand All @@ -33,6 +33,8 @@ $(document).ready(function() {
var formattedText = formattedLines.join('<br>');

navigator.userAgent.indexOf("Chrome") != -1 && $(this).append(" ⠀");


formattedText.toLowerCase().indexOf("*") >= 0 && $(this).addClass("me");

formattedText.toLowerCase().indexOf(" says:") >= 0 && $(this).addClass("white");
Expand All @@ -47,6 +49,13 @@ $(document).ready(function() {
formattedText.toLowerCase().indexOf(":o<") >= 0 && $(this).addClass("whisper");
formattedText.toLowerCase().indexOf(" (phone - low)") >= 0 && $(this).addClass("whisper");

formattedText.toLowerCase().indexOf("[san interview]") == 0 && $(this).addClass("news");
formattedText.toLowerCase().indexOf("**[ch:") == 0 && $(this).addClass("radio");

formattedText.toLowerCase().startsWith("** [") && formattedText.toLowerCase().includes("]") && /\[.*?\]/.test(formattedText) && $(this).addClass("dep");



$(this).html(formattedText);

$(this).textContent += "‎ ";
Expand Down

0 comments on commit 2ebbefb

Please sign in to comment.