Compare commits
1 Commits
e3a79972a9
...
a302a45506
Author | SHA1 | Date | |
---|---|---|---|
a302a45506 |
|
@ -66,7 +66,7 @@ def new_post(data):
|
|||
post = data["post"]
|
||||
post = bleach.clean(post.strip())
|
||||
post = post.replace("\n", "<br />")
|
||||
message = tools.handle_img(message)
|
||||
post = tools.handle_img(post)
|
||||
data["post"] = [post]
|
||||
db.insert_quest_post(room, post, int(time.time()))
|
||||
|
||||
|
@ -87,7 +87,7 @@ def update_post(data):
|
|||
|
||||
post = data["post"]
|
||||
post = post.strip().replace("<br>", "<br />")
|
||||
message = tools.handle_img(message)
|
||||
post = tools.handle_img(post)
|
||||
data["post"] = post
|
||||
|
||||
post_id = data["post_id"]
|
||||
|
|
|
@ -75,6 +75,24 @@
|
|||
document.getElementById('savePost-' + post_id).style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function openPostTab(event, modeName) {
|
||||
var i, QMPostTabContent, QMPostTab;
|
||||
|
||||
QMPostTabContent = document.getElementsByClassName("QMPostTabContent");
|
||||
for (i = 0; i < QMPostTabContent.length; i++) {
|
||||
QMPostTabContent[i].style.display = "none";
|
||||
}
|
||||
|
||||
QMPostTab = document.getElementsByClassName("QMPostTab");
|
||||
for (i = 0; i < QMPostTab.length; i++) {
|
||||
QMPostTab[i].className = QMPostTab[i].className.replace(" active", "");
|
||||
}
|
||||
|
||||
document.getElementById(modeName).style.display = "block";
|
||||
event.currentTarget.className += " active";
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block header %}
|
||||
|
@ -86,6 +104,7 @@
|
|||
<div id="questContainer">
|
||||
<div id="questPane">
|
||||
<center><h1>{{ quest_title }}</h1></center>
|
||||
<div id="questPosts">
|
||||
{% for quest_post in quest_posts %}
|
||||
<div class="questPost">
|
||||
<div class="questPostMeta">
|
||||
|
@ -102,13 +121,31 @@
|
|||
</div>
|
||||
</div><br />
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if session.get("user_id") == owner_id %}
|
||||
<div id="postTextDiv">
|
||||
<div id="QMPostPane">
|
||||
<div>
|
||||
<ul id="QMPostTabs">
|
||||
<li><a class="QMPostTab active" href="javascript:void(0);" onclick="openPostTab(event, 'QMPostText')">Text</a></li>
|
||||
<li><a class="QMPostTab" href="javascript:void(0);" onclick="openPostTab(event, 'QMPostDice')">Dice</a></li>
|
||||
<li><a class="QMPostTab" href="javascript:void(0);" onclick="openPostTab(event, 'QMPostPoll')">Poll</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="QMPostText" class="QMPostTabContent" style="display:initial;">
|
||||
<textarea id="postTextArea"></textarea><br />
|
||||
<input type="submit" name="newPost" value="Post" onclick="makePost();"/>
|
||||
</div>
|
||||
<div id="QMPostDice" class="QMPostTabContent" style="display:none;">
|
||||
Dice for the dice god.
|
||||
</div>
|
||||
<div id="QMPostPoll" class="QMPostTabContent" style="display:none;">
|
||||
The polls are rigged.
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<div id="chatPane">
|
||||
<h1>Chat</h1>
|
||||
<div id="chatWindow">
|
||||
|
|
Loading…
Reference in New Issue
Block a user