diff --git a/src/public/main.js b/src/public/main.js index 2923fba..649d512 100644 --- a/src/public/main.js +++ b/src/public/main.js @@ -94,7 +94,13 @@ $(function() { // Log a message function log (message, options) { - var $el = $('
  • ').addClass('log').text(message); + var html = options && options.html === true || false; + var $el; + if (html) { + $el = $('
  • ').addClass('log').html(message); + } else { + $el = $('
  • ').addClass('log').text(message); + } addMessageElement($el, options); } @@ -244,9 +250,10 @@ $(function() { socket.on('login', function (data) { connected = true; // Display the welcome message - var message = "Fatty.chat - Anonymous Chat - Room ID: " + roomId.replace('/', ''); + var message = "Fatty.chat - Anonymous Chat - Room ID: " + roomId.replace('/', '') + '  '; log(message, { - prepend: true + prepend: true, + html: true }); message = "This chatroom is destroyed after all participants exit. Chat history is client side only and not persistent."; @@ -291,4 +298,18 @@ $(function() { $('#key-modal').modal('show'); }); + var clipboard = new Clipboard('.copyable'); + + clipboard.on('success', function(e) { + $(e.trigger).tooltip({ + title: 'Copied!', + trigger: 'manual', + placement: 'auto' + }); + $(e.trigger).tooltip('show'); + setTimeout(function() { + $(e.trigger).tooltip('hide'); + }, 2000); + }); + }); diff --git a/src/views/index.mustache b/src/views/index.mustache index 258e96c..558553f 100644 --- a/src/views/index.mustache +++ b/src/views/index.mustache @@ -4,9 +4,9 @@ FattyChat - Anonomous Chat - + @@ -46,6 +46,7 @@ +