mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
post replies, unfinished
This commit is contained in:
@@ -78,12 +78,16 @@ var socket,
|
||||
}
|
||||
}
|
||||
|
||||
var post_window = null;
|
||||
app.open_post_window = function() {
|
||||
var post_window = null,
|
||||
mode = 'topic',
|
||||
topic_id = null;
|
||||
app.open_post_window = function(post_mode, id) {
|
||||
post_window = post_window || document.getElementById('post_window');
|
||||
jQuery(post_window).slideToggle(250);
|
||||
document.getElementById('post_title').focus();
|
||||
|
||||
mode = (post_mode == null) ? 'topic' : mode;
|
||||
topic_id = (mode == 'reply') ? topic_id : null;
|
||||
};
|
||||
|
||||
app.post_topic = function() {
|
||||
|
||||
@@ -6,3 +6,11 @@
|
||||
</li>
|
||||
<!-- END posts -->
|
||||
</ul>
|
||||
<hr />
|
||||
<button id="post_reply" class="btn btn-primary btn-large">Reply</button>
|
||||
<script type="text/javascript">
|
||||
var post_reply = document.getElementById('post_reply');
|
||||
post_reply.onclick = function() {
|
||||
app.open_post_window('reply', {TOPIC_ID});
|
||||
}
|
||||
</script>
|
||||
@@ -46,7 +46,7 @@ var RDB = require('./redis.js');
|
||||
});
|
||||
}
|
||||
|
||||
callback({'posts': posts});
|
||||
callback({'posts': posts, 'TOPIC_ID': tid});
|
||||
});
|
||||
} else {
|
||||
callback({});
|
||||
|
||||
@@ -60,7 +60,7 @@ var fs = require('fs');
|
||||
var template = this.html, regex, block;
|
||||
|
||||
return (function parse(data, namespace, template) {
|
||||
if (data.length == 0) {
|
||||
if (Object.keys(data).length == 0) {
|
||||
regex = makeRegex('[^]*');
|
||||
template = template.replace(regex, '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user