v1.18.x
Baris Soner Usakli 12 years ago
parent f29b375ed4
commit ea2c03e28b

@ -1,4 +1,4 @@
define(function() { define(['composer'], function(composer) {
var Topic = {}, var Topic = {},
infiniteLoaderActive = false, infiniteLoaderActive = false,
pagination; pagination;
@ -274,9 +274,7 @@ define(function() {
} }
if (thread_state.locked !== '1') { if (thread_state.locked !== '1') {
require(['composer'], function(cmp) { composer.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username);
cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username);
});
} }
}); });
@ -284,15 +282,11 @@ define(function() {
if (thread_state.locked !== '1') { if (thread_state.locked !== '1') {
var pid = $(this).parents('li').attr('data-pid'); var pid = $(this).parents('li').attr('data-pid');
socket.once('api:posts.getRawPost', function(data) { socket.emit('api:posts.getRawPost', {pid: pid}, function(data) {
quoted = '> ' + data.post.replace(/\n/g, '\n> ') + '\n\n'; quoted = '> ' + data.post.replace(/\n/g, '\n> ') + '\n\n';
require(['composer'], function(cmp) {
cmp.push(tid, null, null, quoted); composer.push(tid, null, null, quoted);
});
});
socket.emit('api:posts.getRawPost', {
pid: pid
}); });
} }
}); });
@ -343,9 +337,8 @@ define(function() {
$('#post-container').delegate('.edit', 'click', function(e) { $('#post-container').delegate('.edit', 'click', function(e) {
var pid = $(this).parents('li').attr('data-pid'); var pid = $(this).parents('li').attr('data-pid');
require(['composer'], function(cmp) {
cmp.push(null, null, pid); composer.push(null, null, pid);
});
}); });
$('#post-container').delegate('.delete', 'click', function(e) { $('#post-container').delegate('.delete', 'click', function(e) {

@ -603,9 +603,9 @@ websockets.init = function(io) {
posts.uploadPostImage(data, callback); posts.uploadPostImage(data, callback);
}); });
socket.on('api:posts.getRawPost', function(data) { socket.on('api:posts.getRawPost', function(data, callback) {
posts.getPostField(data.pid, 'content', function(err, raw) { posts.getPostField(data.pid, 'content', function(err, raw) {
socket.emit('api:posts.getRawPost', { callback({
post: raw post: raw
}); });
}); });

Loading…
Cancel
Save