diff --git a/lib/modules/quickreply.js b/lib/modules/quickreply.js index a79ae83..f87aaeb 100644 --- a/lib/modules/quickreply.js +++ b/lib/modules/quickreply.js @@ -4,9 +4,9 @@ define('persona/quickreply', ['components'], function(components) { var QuickReply = {}; - + QuickReply.init = function() { - + var element = components.get('topic/quickreply/text'); var data = { element: element, @@ -20,11 +20,11 @@ define('persona/quickreply', ['components'], function(components) { } } }; - + $(window).trigger('composer:autocomplete:init', data); data.element.textcomplete(data.strategies, data.options); $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%'); - + components.get('topic/quickreply/button').on('click', function(e) { e.preventDefault(); var replyMsg = components.get('topic/quickreply/text').val(); @@ -38,10 +38,13 @@ define('persona/quickreply', ['components'], function(components) { if (err) { app.alertError(err.message); } + if (data && data.queued) { + app.alertSuccess(data.message); + } components.get('topic/quickreply/text').val(''); }); }); }; - + return QuickReply; }); diff --git a/library.js b/library.js index d4872eb..f215b3a 100644 --- a/library.js +++ b/library.js @@ -111,6 +111,13 @@ library.addUserToTopic = function(data, callback) { callback(null, data); }); } else { + data.templateData.loggedInUser = { + uid: 0, + username: '[[global:guest]]', + picture: user.getDefaultAvatar(), + 'icon:text': '?', + 'icon:bgColor': '#aaa', + }; callback(null, data); } }; diff --git a/templates/partials/topic/quickreply.tpl b/templates/partials/topic/quickreply.tpl index 4604133..5c3dccb 100644 --- a/templates/partials/topic/quickreply.tpl +++ b/templates/partials/topic/quickreply.tpl @@ -1,4 +1,4 @@ - +