Archived
1
0

* add captcha reloader

* update posted template
This commit is contained in:
Jeff Becker 2016-11-08 06:49:52 -05:00
parent 6cdcc4c3b9
commit 56b90bf5f7
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
4 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,10 @@
/** captcha.js */
onready(function(){
var e = document.getElementById("captcha_img");
if(!e) return; // no captcha
var original_url = e.src;
e.onclick = function() {
e.src = original_url + "?t="+new Date().getTime();
}
});

View File

@ -78,4 +78,6 @@ def createPost(newsgroup, ref, form, files):
response = nntp.post(msg.as_bytes()) response = nntp.post(msg.as_bytes())
except Exception as e: except Exception as e:
return None, 'connection to backend failed, {}'.format(e) return None, 'connection to backend failed, {}'.format(e)
if ref:
return ref, None
return msg["Message-ID"], None return msg["Message-ID"], None

View File

@ -8,6 +8,7 @@
<script type="text/javascript" src="{% static 'postform.js' %}"></script> <script type="text/javascript" src="{% static 'postform.js' %}"></script>
<script type="text/javascript" src="{% static 'banners.js' %}"></script> <script type="text/javascript" src="{% static 'banners.js' %}"></script>
<script type="text/javascript" src="{% static 'settings.js' %}"></script> <script type="text/javascript" src="{% static 'settings.js' %}"></script>
<script type="text/javascript" src="{% static 'captcha.js' %}"></script>
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body> <body>

View File

@ -9,7 +9,7 @@
<pre class="error"> failed to post: {{error}} </pre> <pre class="error"> failed to post: {{error}} </pre>
{% else %} {% else %}
{% if msgid %} {% if msgid %}
<pre class="posted"> posted as {{msgid}} </pre> <pre class="posted"> posted </pre>
{% else %} {% else %}
<pre class="posted"> message was not posted </pre> <pre class="posted"> message was not posted </pre>
{% endif %} {% endif %}