mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
Merge branch 'master' of github.com:designcreateplay/NodeBB
This commit is contained in:
@@ -201,6 +201,15 @@ footer.footer {
|
|||||||
display:inline-block;
|
display:inline-block;
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.account-online-status {
|
||||||
|
.icon-circle-blank {
|
||||||
|
color:red;
|
||||||
|
}
|
||||||
|
.icon-circle {
|
||||||
|
color:green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.user-profile-picture {
|
.user-profile-picture {
|
||||||
width:128px;
|
width:128px;
|
||||||
@@ -549,26 +558,34 @@ body .navbar .nodebb-inline-block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#imagedrop {
|
#imagedrop {
|
||||||
background: rgba(64, 64, 64, 0.95);
|
text-align:center;
|
||||||
padding: 0.5em;
|
color:white;
|
||||||
display: block;
|
position: absolute;
|
||||||
width: 90%;
|
top: 0px;
|
||||||
min-height:25px;
|
left: 0px;
|
||||||
margin: 1em auto;
|
width: 100%;
|
||||||
resize: none;
|
height:230px;
|
||||||
color:white;
|
line-height:230px;
|
||||||
font-size:20px;
|
font-size:20px;
|
||||||
|
vertical-align: middle;
|
||||||
div {
|
}
|
||||||
margin-right:10px;
|
|
||||||
}
|
#imagelist {
|
||||||
span {
|
position: absolute;
|
||||||
line-height:20px;
|
bottom: 5px;
|
||||||
float:left;
|
left: 0px;
|
||||||
}
|
padding-left:2em;
|
||||||
button {
|
|
||||||
padding-left:5px;
|
div {
|
||||||
}
|
margin-right:5px;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
line-height:20px;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
padding-left:5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,9 @@
|
|||||||
img.hidden-desktop {
|
img.hidden-desktop {
|
||||||
max-width: 10px;
|
max-width: 10px;
|
||||||
max-height: 10px;
|
max-height: 10px;
|
||||||
|
padding-top: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.post-content {
|
.post-content {
|
||||||
|
|||||||
@@ -37,7 +37,21 @@
|
|||||||
|
|
||||||
$('.user-recent-posts .topic-row').on('click', function() {
|
$('.user-recent-posts .topic-row').on('click', function() {
|
||||||
ajaxify.go($(this).attr('topic-url'));
|
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);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
function loadFile(file) {
|
function loadFile(file) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
var dropDiv = $('#imagedrop');
|
var dropDiv = $('#imagedrop');
|
||||||
|
var imagelist = $('#imagelist');
|
||||||
var uuid = dropDiv.parents('[data-uuid]').attr('data-uuid');
|
var uuid = dropDiv.parents('[data-uuid]').attr('data-uuid');
|
||||||
var posts = composer.posts[uuid];
|
var posts = composer.posts[uuid];
|
||||||
|
|
||||||
@@ -33,15 +34,11 @@ define(['taskbar'], function(taskbar) {
|
|||||||
if(index !== -1) {
|
if(index !== -1) {
|
||||||
posts.images.splice(index, 1);
|
posts.images.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!dropDiv.children().length) {
|
|
||||||
dropDiv.html('Drag and drop images here');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
imageLabel.append(closeButton);
|
imageLabel.append(closeButton);
|
||||||
dropDiv.append(imageLabel);
|
imagelist.append(imageLabel);
|
||||||
|
dropDiv.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
@@ -73,9 +70,6 @@ define(['taskbar'], function(taskbar) {
|
|||||||
var dt = e.dataTransfer;
|
var dt = e.dataTransfer;
|
||||||
var files = dt.files;
|
var files = dt.files;
|
||||||
|
|
||||||
if(!posts.images.length)
|
|
||||||
drop.html('');
|
|
||||||
|
|
||||||
for (var i=0; i<files.length; i++) {
|
for (var i=0; i<files.length; i++) {
|
||||||
loadFile(files[i]);
|
loadFile(files[i]);
|
||||||
}
|
}
|
||||||
@@ -107,8 +101,11 @@ define(['taskbar'], function(taskbar) {
|
|||||||
'<button class="btn" data-action="discard" tabIndex="5"><i class="icon-remove"></i> Discard</button>' +
|
'<button class="btn" data-action="discard" tabIndex="5"><i class="icon-remove"></i> Discard</button>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div id="imagedrop" style="display:none;"></div>'+
|
'<div style="position:relative;">'+
|
||||||
'<textarea tabIndex="2"></textarea>' +
|
'<div id="imagedrop" class=""><div>Drag and Drop Images Here</div></div>'+
|
||||||
|
'<textarea tabIndex="2"></textarea>' +
|
||||||
|
'<div id="imagelist"></div>'+
|
||||||
|
'</div>'+
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
document.body.insertBefore(composer.postContainer, taskbar);
|
document.body.insertBefore(composer.postContainer, taskbar);
|
||||||
@@ -246,9 +243,12 @@ define(['taskbar'], function(taskbar) {
|
|||||||
btnRect = taskbarBtn.getBoundingClientRect(),
|
btnRect = taskbarBtn.getBoundingClientRect(),
|
||||||
taskbarRect = document.getElementById('taskbar').getBoundingClientRect(),
|
taskbarRect = document.getElementById('taskbar').getBoundingClientRect(),
|
||||||
dropDiv = $(composer.postContainer).find('#imagedrop'),
|
dropDiv = $(composer.postContainer).find('#imagedrop'),
|
||||||
|
imagelist = $(composer.postContainer).find('#imagelist'),
|
||||||
windowRect, leftPos;
|
windowRect, leftPos;
|
||||||
|
|
||||||
dropDiv.html('Drag and drop images here').hide();
|
dropDiv.hide();
|
||||||
|
imagelist.empty();
|
||||||
|
|
||||||
|
|
||||||
composer.postContainer.style.display = 'block';
|
composer.postContainer.style.display = 'block';
|
||||||
windowRect = postWindowEl.getBoundingClientRect();
|
windowRect = postWindowEl.getBoundingClientRect();
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
<div class="account-picture-block">
|
<div class="account-picture-block">
|
||||||
<img src="{picture}" class="user-profile-picture img-polaroid"/>
|
<img src="{picture}" class="user-profile-picture img-polaroid"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="account-online-status">
|
||||||
|
<span><i class="icon-circle-blank"></i> <span>offline</span></span>
|
||||||
|
</div>
|
||||||
<div id="user-actions">
|
<div id="user-actions">
|
||||||
<a id="follow-btn" href="#" class="btn">Follow</a>
|
<a id="follow-btn" href="#" class="btn">Follow</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div class="topic-buttons pull-left">
|
<div class="topic-buttons pull-left">
|
||||||
<a href="/users/{main_posts.userslug}" class="username-field btn hidden-phone">{main_posts.username}</a>
|
|
||||||
<a target="_blank" class="btn hidden-phone" href="../{topic_id}.rss" title="RSS Feed"><i class="icon-rss-sign"></i></a>
|
<a target="_blank" class="btn hidden-phone" href="../{topic_id}.rss" title="RSS Feed"><i class="icon-rss-sign"></i></a>
|
||||||
<button class="btn follow" type="button" title="Be notified of new replies in this topic"><i class="icon-eye-open"></i></button>
|
<button class="btn follow" type="button" title="Be notified of new replies in this topic"><i class="icon-eye-open"></i></button>
|
||||||
<button id="ids_{main_posts.pid}_{main_posts.uid}" class="btn edit {main_posts.display_moderator_tools}" type="button" title="Edit"><i class="icon-pencil"></i></button>
|
<button id="ids_{main_posts.pid}_{main_posts.uid}" class="btn edit {main_posts.display_moderator_tools}" type="button" title="Edit"><i class="icon-pencil"></i></button>
|
||||||
@@ -60,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="post-signature">{main_posts.signature}</div>
|
<div class="post-signature">{main_posts.signature}</div>
|
||||||
<div class="profile-block">
|
<div class="profile-block">
|
||||||
<img class="hidden-desktop" src="{main_posts.picture}" align="left" /> posted by <strong><a class="" href="/users/{main_posts.userslug}">{main_posts.username}</a></strong> {main_posts.relativeTime} ago
|
<img class="hidden-desktop" src="{main_posts.picture}" align="left" /> posted by <strong><a class="username-field" href="/users/{main_posts.userslug}">{main_posts.username}</a></strong> {main_posts.relativeTime} ago
|
||||||
<span class="{main_posts.edited-class} hidden-phone">| last edited by <strong><a href="/users/{main_posts.editorslug}">{main_posts.editorname}</a></strong> {main_posts.relativeEditTime} ago</span>
|
<span class="{main_posts.edited-class} hidden-phone">| last edited by <strong><a href="/users/{main_posts.editorslug}">{main_posts.editorname}</a></strong> {main_posts.relativeEditTime} ago</span>
|
||||||
<span class="{main_posts.edited-class}"><i class="icon-edit visible-phone" title="edited by {main_posts.editorname} {main_posts.relativeEditTime} ago"></i></span>
|
<span class="{main_posts.edited-class}"><i class="icon-edit visible-phone" title="edited by {main_posts.editorname} {main_posts.relativeEditTime} ago"></i></span>
|
||||||
<div class="post-buttons visible-phone">
|
<div class="post-buttons visible-phone">
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ var user = require('./../user.js'),
|
|||||||
Admin.create_routes = function(app) {
|
Admin.create_routes = function(app) {
|
||||||
|
|
||||||
(function() {
|
(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<ii; i++) {
|
for (var i=0, ii=routes.length; i<ii; i++) {
|
||||||
(function(route) {
|
(function(route) {
|
||||||
|
|||||||
@@ -337,7 +337,9 @@ var utils = require('./../public/src/utils.js'),
|
|||||||
|
|
||||||
function iterator(uid, callback) {
|
function iterator(uid, callback) {
|
||||||
User.getUserData(uid, function(userData) {
|
User.getUserData(uid, function(userData) {
|
||||||
data.push(userData);
|
if(userData) {
|
||||||
|
data.push(userData);
|
||||||
|
}
|
||||||
callback(null);
|
callback(null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
|
|||||||
|
|
||||||
userSockets[uid] = userSockets[uid] || [];
|
userSockets[uid] = userSockets[uid] || [];
|
||||||
userSockets[uid].push(socket);
|
userSockets[uid].push(socket);
|
||||||
|
if(uid)
|
||||||
|
io.sockets.in('global').emit('api:user.isOnline', isUserOnline(uid));
|
||||||
socket.join('uid_' + uid);
|
socket.join('uid_' + uid);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -61,8 +62,11 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
|
|||||||
userSockets[uid].splice(index, 1);
|
userSockets[uid].splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userSockets[uid].length === 0)
|
if(userSockets[uid].length === 0) {
|
||||||
delete users[sessionID];
|
delete users[sessionID];
|
||||||
|
if(uid)
|
||||||
|
io.sockets.in('global').emit('api:user.isOnline', isUserOnline(uid));
|
||||||
|
}
|
||||||
|
|
||||||
for(var roomName in rooms) {
|
for(var roomName in rooms) {
|
||||||
|
|
||||||
@@ -215,12 +219,16 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
|
|||||||
user.reset.commit(socket, data.code, data.password);
|
user.reset.commit(socket, data.code, data.password);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function isUserOnline(uid) {
|
||||||
|
return !!userSockets[uid] && userSockets[uid].length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
socket.on('api:user.get_online_users', function(data) {
|
socket.on('api:user.get_online_users', function(data) {
|
||||||
var returnData = [];
|
var returnData = [];
|
||||||
|
|
||||||
for(var i=0; i<data.length; ++i) {
|
for(var i=0; i<data.length; ++i) {
|
||||||
var uid = data[i];
|
var uid = data[i];
|
||||||
if(userSockets[uid] && userSockets[uid].length > 0)
|
if(isUserOnline(uid))
|
||||||
returnData.push(uid);
|
returnData.push(uid);
|
||||||
else
|
else
|
||||||
returnData.push(0);
|
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.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) {
|
socket.on('api:user.changePassword', function(data) {
|
||||||
user.changePassword(socket, uid, data, function(success) {
|
user.changePassword(socket, uid, data, function(success) {
|
||||||
if(success) {
|
if(success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user