|
|
|
@ -34,11 +34,15 @@
|
|
|
|
|
$('#delete_thread').on('click', function(e) {
|
|
|
|
|
if (thread_state.deleted !== '1') {
|
|
|
|
|
bootbox.confirm('Are you sure you want to delete this thread?', function(confirm) {
|
|
|
|
|
if (confirm) socket.emit('api:topic.delete', { tid: tid });
|
|
|
|
|
if (confirm) socket.emit('api:topic.delete', {
|
|
|
|
|
tid: tid
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
bootbox.confirm('Are you sure you want to restore this thread?', function(confirm) {
|
|
|
|
|
if (confirm) socket.emit('api:topic.restore', { tid: tid });
|
|
|
|
|
if (confirm) socket.emit('api:topic.restore', {
|
|
|
|
|
tid: tid
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
@ -46,18 +50,26 @@
|
|
|
|
|
|
|
|
|
|
$('#lock_thread').on('click', function(e) {
|
|
|
|
|
if (thread_state.locked !== '1') {
|
|
|
|
|
socket.emit('api:topic.lock', { tid: tid });
|
|
|
|
|
socket.emit('api:topic.lock', {
|
|
|
|
|
tid: tid
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
socket.emit('api:topic.unlock', { tid: tid });
|
|
|
|
|
socket.emit('api:topic.unlock', {
|
|
|
|
|
tid: tid
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#pin_thread').on('click', function(e) {
|
|
|
|
|
if (thread_state.pinned !== '1') {
|
|
|
|
|
socket.emit('api:topic.pin', { tid: tid });
|
|
|
|
|
socket.emit('api:topic.pin', {
|
|
|
|
|
tid: tid
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
socket.emit('api:topic.unpin', { tid: tid });
|
|
|
|
|
socket.emit('api:topic.unpin', {
|
|
|
|
|
tid: tid
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
@ -132,7 +144,10 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
socket.emit('api:topic.move', { tid: tid, cid: targetCid });
|
|
|
|
|
socket.emit('api:topic.move', {
|
|
|
|
|
tid: tid,
|
|
|
|
|
cid: targetCid
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -242,7 +257,9 @@
|
|
|
|
|
cmp.push(tid, null, null, quoted);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
socket.emit('api:posts.getRawPost', { pid: pid });
|
|
|
|
|
socket.emit('api:posts.getRawPost', {
|
|
|
|
|
pid: pid
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -252,10 +269,15 @@
|
|
|
|
|
|
|
|
|
|
var element = $(this).find('i');
|
|
|
|
|
if (element.attr('class') == 'icon-star-empty') {
|
|
|
|
|
socket.emit('api:posts.favourite', {pid: pid, room_id: app.current_room});
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
socket.emit('api:posts.unfavourite', {pid: pid, room_id: app.current_room});
|
|
|
|
|
socket.emit('api:posts.favourite', {
|
|
|
|
|
pid: pid,
|
|
|
|
|
room_id: app.current_room
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
socket.emit('api:posts.unfavourite', {
|
|
|
|
|
pid: pid,
|
|
|
|
|
room_id: app.current_room
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -276,8 +298,12 @@
|
|
|
|
|
|
|
|
|
|
if (confirmDel) {
|
|
|
|
|
deleteAction ?
|
|
|
|
|
socket.emit('api:posts.delete', { pid: pid }) :
|
|
|
|
|
socket.emit('api:posts.restore', { pid: pid });
|
|
|
|
|
socket.emit('api:posts.delete', {
|
|
|
|
|
pid: pid
|
|
|
|
|
}) :
|
|
|
|
|
socket.emit('api:posts.restore', {
|
|
|
|
|
pid: pid
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -655,8 +681,7 @@
|
|
|
|
|
var height = Math.floor(el.height());
|
|
|
|
|
var elBottom = elTop + (height < 300 ? height : 300);
|
|
|
|
|
|
|
|
|
|
var inView = ((elBottom >= scrollTop) && (elTop <= scrollBottom)
|
|
|
|
|
&& (elBottom <= scrollBottom) && (elTop >= scrollTop));
|
|
|
|
|
var inView = ((elBottom >= scrollTop) && (elTop <= scrollBottom) && (elBottom <= scrollBottom) && (elTop >= scrollTop));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (inView) {
|
|
|
|
|