mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
while you are editing a post you still need to write something dude
This commit is contained in:
@@ -245,12 +245,24 @@ var socket,
|
|||||||
};
|
};
|
||||||
|
|
||||||
app.edit_post = function(pid) {
|
app.edit_post = function(pid) {
|
||||||
var content = document.getElementById('post_content');
|
var content = $('#post_content');
|
||||||
socket.emit('api:posts.edit', { pid: pid, content: content.value });
|
|
||||||
|
if (content.val().length < 5) {
|
||||||
|
app.alert({
|
||||||
|
title: 'Topic Post Failure',
|
||||||
|
message: 'You need to write more dude.',
|
||||||
|
type: 'error',
|
||||||
|
timeout: 2000
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
socket.emit('api:posts.edit', { pid: pid, content: content.val() });
|
||||||
|
|
||||||
jQuery(post_window).slideUp(250);
|
jQuery(post_window).slideUp(250);
|
||||||
$(document.body).removeClass('composing');
|
$(document.body).removeClass('composing');
|
||||||
content.value = '';
|
content.val('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
<a href="/users/{posts.username}">
|
<a href="/users/{posts.username}">
|
||||||
<img src="{posts.gravatar}?s=80" align="left" />
|
<img src="{posts.gravatar}?s=80" align="left" />
|
||||||
</a>
|
</a>
|
||||||
<i class="icon-star"></i><span class="user_rep_{posts.uid} user_reputation_text">{posts.user_rep}</span>
|
<i class="icon-star"></i><span class="user_rep_{posts.uid} formatted-number">{posts.user_rep}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="span11">
|
<div class="span11">
|
||||||
<div class="post-block">
|
<div class="post-block">
|
||||||
@@ -124,11 +124,15 @@
|
|||||||
pinned: '{pinned}'
|
pinned: '{pinned}'
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery('document').ready(function() {
|
function addCommasToNumbers() {
|
||||||
|
$('.formatted-number').each(function(index, element) {
|
||||||
$('.user_reputation_text').each(function(index, element) {
|
|
||||||
$(element).html(app.addCommas($(element).html()));
|
$(element).html(app.addCommas($(element).html()));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery('document').ready(function() {
|
||||||
|
|
||||||
|
addCommasToNumbers();
|
||||||
|
|
||||||
var room = 'topic_' + '{topic_id}',
|
var room = 'topic_' + '{topic_id}',
|
||||||
adminTools = document.getElementById('thread-tools');
|
adminTools = document.getElementById('thread-tools');
|
||||||
|
|||||||
Reference in New Issue
Block a user