|
|
|
@ -37,11 +37,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
(function() {
|
|
|
|
|
var locked = '{locked}';
|
|
|
|
|
|
|
|
|
|
jQuery('document').ready(function() {
|
|
|
|
|
var room = 'topic_' + '{topic_id}';
|
|
|
|
|
|
|
|
|
|
app.enter_room(room);
|
|
|
|
|
set_up_posts();
|
|
|
|
|
|
|
|
|
|
if (locked === '1') set_locked_state(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -106,11 +111,11 @@ function set_up_posts(div) {
|
|
|
|
|
else div = '#' + div;
|
|
|
|
|
|
|
|
|
|
jQuery(div + ' .post_reply').click(function() {
|
|
|
|
|
app.open_post_window('reply', "{topic_id}", "{topic_name}");
|
|
|
|
|
if (locked !== '1') app.open_post_window('reply', "{topic_id}", "{topic_name}");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
jQuery(div + ' .quote').click(function() {
|
|
|
|
|
app.open_post_window('quote', "{topic_id}", "{topic_name}");
|
|
|
|
|
if (locked !== '1') app.open_post_window('quote', "{topic_id}", "{topic_name}");
|
|
|
|
|
|
|
|
|
|
// this needs to be looked at, obviously. only single line quotes work well I think maybe replace all \r\n with > ?
|
|
|
|
|
document.getElementById('post_content').innerHTML = '> ' + document.getElementById('content_' + this.id.replace('quote_', '')).innerHTML;
|
|
|
|
@ -139,4 +144,28 @@ function set_up_posts(div) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function set_locked_state(locked) {
|
|
|
|
|
var threadReplyBtn = document.getElementById('post_reply'),
|
|
|
|
|
postReplyBtns = document.querySelectorAll('#post-container .post_reply'),
|
|
|
|
|
quoteBtns = document.querySelectorAll('#post-container .quote'),
|
|
|
|
|
numReplyBtns = postReplyBtns.length,
|
|
|
|
|
x;
|
|
|
|
|
if (locked === true) {
|
|
|
|
|
threadReplyBtn.disabled = true;
|
|
|
|
|
threadReplyBtn.innerHTML = 'Locked';
|
|
|
|
|
for(x=0;x<numReplyBtns;x++) {
|
|
|
|
|
postReplyBtns[x].innerHTML = 'Locked <i class="icon-lock"></i>';
|
|
|
|
|
quoteBtns[x].style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
threadReplyBtn.disabled = false;
|
|
|
|
|
threadReplyBtn.innerHTML = 'Reply';
|
|
|
|
|
for(x=0;x<numReplyBtns;x++) {
|
|
|
|
|
postReplyBtns[x].innerHTML = 'Reply <i class="icon-reply"></i>';
|
|
|
|
|
quoteBtns[x].style.display = 'inline-block';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})();
|
|
|
|
|
</script>
|