diff --git a/website/public/js/main.js b/website/public/js/main.js index dfd6c38..45e4005 100644 --- a/website/public/js/main.js +++ b/website/public/js/main.js @@ -2,19 +2,26 @@ var days = ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", var months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"] function fancyText(text) { - // Add images and gifs. - var regex = /(https:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig; - text = text.replace(regex, function(img) { - return ""; + var regex = /(https?:\/\/.[^ ]*)/ig; + text = text.replace(regex, function(link) { + if (link.match(/(https:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) { + return "" + link + ""; + } else if (link.match(/(https:\/\/.[^ ]*\.(?:mp4))/ig)) { + return ""; + } else if (link.match(/(https:\/\/.[^ ]*\.(?:ogg))/ig)) { + return ""; + } else { + return "" + link + ""; + } }); - // Add links. - // regex = /(https:\/\/.[^ ]*\.(?:net|com|nl))/ig; - // text = text.replace(regex, function(link) { - // return "LINK"; - // }); - return text; } diff --git a/website/public/styles/chat.css b/website/public/styles/chat.css index 0ba5af4..75a4a6d 100644 --- a/website/public/styles/chat.css +++ b/website/public/styles/chat.css @@ -130,4 +130,8 @@ body { .chat-message img { max-width: 100%; +} + +.chat-message a { + text-decoration: underline; } \ No newline at end of file