mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
closes #197
This commit is contained in:
@@ -94,9 +94,12 @@ var ajaxify = {};
|
|||||||
|
|
||||||
// Enhancing all anchors to ajaxify...
|
// Enhancing all anchors to ajaxify...
|
||||||
$(document.body).on('click', 'a', function(e) {
|
$(document.body).on('click', 'a', function(e) {
|
||||||
if (this.href == window.location.href + "#") return;
|
|
||||||
if(this.href.slice(-1) === "#") return;
|
|
||||||
|
|
||||||
|
function hrefEmpty(href) {
|
||||||
|
return href == 'javascript:;' || href == window.location.href + "#" || href.slice(-1) === "#";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hrefEmpty(this.href)) return;
|
||||||
|
|
||||||
var url = this.href.replace(rootUrl +'/', '');
|
var url = this.href.replace(rootUrl +'/', '');
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ var socket,
|
|||||||
|
|
||||||
app.current_room = null;
|
app.current_room = null;
|
||||||
app.enter_room = function(room) {
|
app.enter_room = function(room) {
|
||||||
|
|
||||||
if(socket) {
|
if(socket) {
|
||||||
if (app.current_room === room)
|
if (app.current_room === room)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -26,17 +26,12 @@
|
|||||||
if (thread_state.pinned === '1') set_pinned_state(true);
|
if (thread_state.pinned === '1') set_pinned_state(true);
|
||||||
|
|
||||||
if (expose_tools === '1') {
|
if (expose_tools === '1') {
|
||||||
var deleteThreadEl = document.getElementById('delete_thread'),
|
var moveThreadModal = $('#move_thread_modal');
|
||||||
lockThreadEl = document.getElementById('lock_thread'),
|
|
||||||
pinThreadEl = document.getElementById('pin_thread'),
|
|
||||||
moveThreadEl = document.getElementById('move_thread'),
|
|
||||||
moveThreadModal = $('#move_thread_modal');
|
|
||||||
|
|
||||||
adminTools.style.visibility = 'inherit';
|
adminTools.style.visibility = 'inherit';
|
||||||
|
|
||||||
// Add events to the thread tools
|
// Add events to the thread tools
|
||||||
deleteThreadEl.addEventListener('click', function(e) {
|
$('#delete_thread').on('click', function(e) {
|
||||||
e.preventDefault();
|
|
||||||
if (thread_state.deleted !== '1') {
|
if (thread_state.deleted !== '1') {
|
||||||
bootbox.confirm('Are you sure you want to delete this thread?', function(confirm) {
|
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 });
|
||||||
@@ -46,30 +41,31 @@
|
|||||||
if (confirm) socket.emit('api:topic.restore', { tid: tid });
|
if (confirm) socket.emit('api:topic.restore', { tid: tid });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, false);
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
lockThreadEl.addEventListener('click', function(e) {
|
$('#lock_thread').on('click', function(e) {
|
||||||
e.preventDefault();
|
|
||||||
if (thread_state.locked !== '1') {
|
if (thread_state.locked !== '1') {
|
||||||
socket.emit('api:topic.lock', { tid: tid });
|
socket.emit('api:topic.lock', { tid: tid });
|
||||||
} else {
|
} else {
|
||||||
socket.emit('api:topic.unlock', { tid: tid });
|
socket.emit('api:topic.unlock', { tid: tid });
|
||||||
}
|
}
|
||||||
}, false);
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
pinThreadEl.addEventListener('click', function(e) {
|
$('#pin_thread').on('click', function(e) {
|
||||||
e.preventDefault();
|
|
||||||
if (thread_state.pinned !== '1') {
|
if (thread_state.pinned !== '1') {
|
||||||
socket.emit('api:topic.pin', { tid: tid });
|
socket.emit('api:topic.pin', { tid: tid });
|
||||||
} else {
|
} else {
|
||||||
socket.emit('api:topic.unpin', { tid: tid });
|
socket.emit('api:topic.unpin', { tid: tid });
|
||||||
}
|
}
|
||||||
}, false);
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
moveThreadEl.addEventListener('click', function(e) {
|
$('#move_thread').on('click', function(e) {
|
||||||
e.preventDefault();
|
|
||||||
moveThreadModal.modal('show');
|
moveThreadModal.modal('show');
|
||||||
}, false);
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
moveThreadModal.on('shown', function() {
|
moveThreadModal.on('shown', function() {
|
||||||
var loadingEl = document.getElementById('categories-loading');
|
var loadingEl = document.getElementById('categories-loading');
|
||||||
|
|||||||
Reference in New Issue
Block a user