diff --git a/public/css/style.less b/public/css/style.less index 02a11e43fb..af5fb49f18 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -201,6 +201,15 @@ footer.footer { display:inline-block; vertical-align:top; } + +.account-online-status { + .icon-circle-blank { + color:red; + } + .icon-circle { + color:green; + } +} .user-profile-picture { width:128px; @@ -549,26 +558,34 @@ body .navbar .nodebb-inline-block { } #imagedrop { - background: rgba(64, 64, 64, 0.95); - padding: 0.5em; - display: block; - width: 90%; - min-height:25px; - margin: 1em auto; - resize: none; - color:white; - font-size:20px; - - div { - margin-right:10px; - } - span { - line-height:20px; - float:left; - } - button { - padding-left:5px; - } + text-align:center; + color:white; + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height:230px; + line-height:230px; + font-size:20px; + vertical-align: middle; + } + + #imagelist { + position: absolute; + bottom: 5px; + left: 0px; + padding-left:2em; + + div { + margin-right:5px; + } + span { + line-height:20px; + float:left; + } + button { + padding-left:5px; + } } } } diff --git a/public/css/topic.less b/public/css/topic.less index c0e1c51433..e2f9111e56 100644 --- a/public/css/topic.less +++ b/public/css/topic.less @@ -45,6 +45,9 @@ img.hidden-desktop { max-width: 10px; max-height: 10px; + padding-top: 5px; + margin-right: 5px; + } } .post-content { diff --git a/public/src/forum/account.js b/public/src/forum/account.js index ae87fa4e1b..b54d0f39f5 100644 --- a/public/src/forum/account.js +++ b/public/src/forum/account.js @@ -37,7 +37,21 @@ $('.user-recent-posts .topic-row').on('click', function() { ajaxify.go($(this).attr('topic-url')); - }) + }); + + var onlineStatus = $('.account-online-status'); + + socket.on('api:user.isOnline', function(online) { + if(online) { + onlineStatus.find('span span').text('online'); + onlineStatus.find('i').attr('class', 'icon-circle'); + } else { + onlineStatus.find('span span').text('offline'); + onlineStatus.find('i').attr('class', 'icon-circle-blank'); + } + }); + + socket.emit('api:user.isOnline', theirid); }); diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 97c4861f33..3e97fdb92d 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -10,6 +10,7 @@ define(['taskbar'], function(taskbar) { function loadFile(file) { var reader = new FileReader(); var dropDiv = $('#imagedrop'); + var imagelist = $('#imagelist'); var uuid = dropDiv.parents('[data-uuid]').attr('data-uuid'); var posts = composer.posts[uuid]; @@ -33,15 +34,11 @@ define(['taskbar'], function(taskbar) { if(index !== -1) { posts.images.splice(index, 1); } - - if(!dropDiv.children().length) { - dropDiv.html('Drag and drop images here'); - } }); imageLabel.append(closeButton); - dropDiv.append(imageLabel); - + imagelist.append(imageLabel); + dropDiv.hide(); }); reader.readAsDataURL(file); @@ -73,9 +70,6 @@ define(['taskbar'], function(taskbar) { var dt = e.dataTransfer; var files = dt.files; - if(!posts.images.length) - drop.html(''); - for (var i=0; i Discard' + '' + '' + - ''+ - '' + + '
'+ + '
Drag and Drop Images Here
'+ + '' + + '
'+ + '
'+ ''; document.body.insertBefore(composer.postContainer, taskbar); @@ -246,9 +243,12 @@ define(['taskbar'], function(taskbar) { btnRect = taskbarBtn.getBoundingClientRect(), taskbarRect = document.getElementById('taskbar').getBoundingClientRect(), dropDiv = $(composer.postContainer).find('#imagedrop'), + imagelist = $(composer.postContainer).find('#imagelist'), windowRect, leftPos; - dropDiv.html('Drag and drop images here').hide(); + dropDiv.hide(); + imagelist.empty(); + composer.postContainer.style.display = 'block'; windowRect = postWindowEl.getBoundingClientRect(); diff --git a/public/templates/account.tpl b/public/templates/account.tpl index 0813a1d346..79a94cae4d 100644 --- a/public/templates/account.tpl +++ b/public/templates/account.tpl @@ -20,6 +20,9 @@
+
+ offline +
Follow
diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index e22b73972d..c17b5b1029 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -38,7 +38,6 @@
- {main_posts.username} @@ -60,7 +59,7 @@
{main_posts.signature}
- posted by {main_posts.username} {main_posts.relativeTime} ago + posted by {main_posts.username} {main_posts.relativeTime} ago | last edited by {main_posts.editorname} {main_posts.relativeEditTime} ago
diff --git a/src/routes/admin.js b/src/routes/admin.js index e272e6f326..cfc18ebd2c 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -23,7 +23,8 @@ var user = require('./../user.js'), Admin.create_routes = function(app) { (function() { - var routes = ['categories', 'users', 'topics', 'settings', 'themes', 'twitter', 'facebook', 'gplus', 'redis', 'motd']; + var routes = ['categories', 'users', 'topics', 'settings', 'themes', 'twitter', 'facebook', 'gplus', 'redis', 'motd', + 'users/latest', 'users/sort-posts', 'users/sort-reputation', 'users/search']; for (var i=0, ii=routes.length; i 0; + } + socket.on('api:user.get_online_users', function(data) { var returnData = []; for(var i=0; i 0) + if(isUserOnline(uid)) returnData.push(uid); else returnData.push(0); @@ -228,6 +236,10 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }), socket.emit('api:user.get_online_users', returnData); }); + socket.on('api:user.isOnline', function(uid) { + socket.emit('api:user.isOnline', isUserOnline(uid)); + }); + socket.on('api:user.changePassword', function(data) { user.changePassword(socket, uid, data, function(success) { if(success) {