mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
removed api: from client side socket calls
This commit is contained in:
@@ -45,7 +45,7 @@ define(['taskbar'], function(taskbar) {
|
||||
|
||||
composer.editPost = function(pid) {
|
||||
if(allowed()) {
|
||||
socket.emit('api:modules.composer.push', {
|
||||
socket.emit('modules.composer.push', {
|
||||
pid: pid
|
||||
}, function(threadData) {
|
||||
push({
|
||||
@@ -108,7 +108,7 @@ define(['taskbar'], function(taskbar) {
|
||||
} else if (parseInt(postData.pid) > 0) {
|
||||
titleEl.val(postData.title);
|
||||
titleEl.prop('readOnly', true);
|
||||
socket.emit('api:modules.composer.editCheck', postData.pid, function(editCheck) {
|
||||
socket.emit('modules.composer.editCheck', postData.pid, function(editCheck) {
|
||||
if (editCheck.titleEditable) {
|
||||
postContainer.find('input').prop('readonly', false);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ define(['taskbar'], function(taskbar) {
|
||||
|
||||
// Still here? Let's post.
|
||||
if (parseInt(postData.cid) > 0) {
|
||||
socket.emit('api:topics.post', {
|
||||
socket.emit('topics.post', {
|
||||
'title' : titleEl.val(),
|
||||
'content' : bodyEl.val(),
|
||||
'category_id' : postData.cid
|
||||
@@ -442,14 +442,14 @@ define(['taskbar'], function(taskbar) {
|
||||
composer.discard(post_uuid);
|
||||
});
|
||||
} else if (parseInt(postData.tid) > 0) {
|
||||
socket.emit('api:posts.reply', {
|
||||
socket.emit('posts.reply', {
|
||||
'topic_id' : postData.tid,
|
||||
'content' : bodyEl.val()
|
||||
}, function() {
|
||||
composer.discard(post_uuid);
|
||||
});
|
||||
} else if (parseInt(postData.pid) > 0) {
|
||||
socket.emit('api:posts.edit', {
|
||||
socket.emit('posts.edit', {
|
||||
pid: postData.pid,
|
||||
content: bodyEl.val(),
|
||||
title: titleEl.val()
|
||||
@@ -568,12 +568,12 @@ define(['taskbar'], function(taskbar) {
|
||||
dropDiv.hide();
|
||||
|
||||
if(file.type.match('image.*')) {
|
||||
uploadFile('api:posts.uploadImage', post_uuid, fileData);
|
||||
uploadFile('posts.uploadImage', post_uuid, fileData);
|
||||
} else {
|
||||
if(file.size > parseInt(config.maximumFileSize, 10) * 1024) {
|
||||
return composerAlert('File too big', 'Maximum allowed file size is ' + config.maximumFileSize + 'kbs');
|
||||
}
|
||||
uploadFile('api:posts.uploadFile', post_uuid, fileData);
|
||||
uploadFile('posts.uploadFile', post_uuid, fileData);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -582,7 +582,7 @@ define(['taskbar'], function(taskbar) {
|
||||
|
||||
|
||||
function uploadFile(method, post_uuid, img) {
|
||||
var linkStart = method === 'api:posts.uploadImage' ? '!' : '',
|
||||
var linkStart = method === 'posts.uploadImage' ? '!' : '',
|
||||
postContainer = $('#cmp-uuid-' + post_uuid),
|
||||
textarea = postContainer.find('textarea'),
|
||||
text = textarea.val(),
|
||||
|
||||
Reference in New Issue
Block a user