mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-20 20:17:38 +00:00
Format URLs
This commit is contained in:
parent
e6a9e01089
commit
c63944aad2
@ -114,6 +114,8 @@ $(function() {
|
|||||||
|
|
||||||
// Adds the visual chat message to the message list
|
// Adds the visual chat message to the message list
|
||||||
function addChatMessage (data, options) {
|
function addChatMessage (data, options) {
|
||||||
|
if (!data.message.trim().length) return;
|
||||||
|
|
||||||
// Don't fade the message in if there is an 'X was typing'
|
// Don't fade the message in if there is an 'X was typing'
|
||||||
var $typingMessages = getTypingMessages(data);
|
var $typingMessages = getTypingMessages(data);
|
||||||
options = options || {};
|
options = options || {};
|
||||||
@ -126,7 +128,7 @@ $(function() {
|
|||||||
.text(data.username)
|
.text(data.username)
|
||||||
.css('color', getUsernameColor(data.username));
|
.css('color', getUsernameColor(data.username));
|
||||||
var $messageBodyDiv = $('<span class="messageBody">')
|
var $messageBodyDiv = $('<span class="messageBody">')
|
||||||
.text(data.message);
|
.html(data.message);
|
||||||
|
|
||||||
var typingClass = data.typing ? 'typing' : '';
|
var typingClass = data.typing ? 'typing' : '';
|
||||||
var $messageDiv = $('<li class="message"/>')
|
var $messageDiv = $('<li class="message"/>')
|
||||||
@ -185,7 +187,9 @@ $(function() {
|
|||||||
|
|
||||||
// Prevents input from having injected markup
|
// Prevents input from having injected markup
|
||||||
function cleanInput (input) {
|
function cleanInput (input) {
|
||||||
return $('<div/>').text(input).text();
|
var message = $('<div/>').text(input).text();
|
||||||
|
message = Autolinker.link(message);
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates the typing event
|
// Updates the typing event
|
||||||
|
10
src/public/vendor/autolinker.min.js
vendored
Normal file
10
src/public/vendor/autolinker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -24,7 +24,7 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="#">FattyChat</a>
|
<a class="navbar-brand" href="javascript:void(0)">FattyChat</a>
|
||||||
<span class="participants">
|
<span class="participants">
|
||||||
<span class="glyphicon glyphicon-user"></span> <span id="participants"></span>
|
<span class="glyphicon glyphicon-user"></span> <span id="participants"></span>
|
||||||
</span>
|
</span>
|
||||||
@ -175,6 +175,7 @@
|
|||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.5/clipboard.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.5/clipboard.min.js"></script>
|
||||||
<script type="text/javascript" src="vendor/jquery.noty.packaged.min.js"></script>
|
<script type="text/javascript" src="vendor/jquery.noty.packaged.min.js"></script>
|
||||||
|
<script type="text/javascript" src="vendor/autolinker.min.js"></script>
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user