mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
Javascript bugfixes
This commit is contained in:
@@ -53,7 +53,7 @@ function post_form(form, where, statusfunc, nametransformfunc, block) {
|
||||
}
|
||||
};
|
||||
|
||||
function simple_post_form(form, where, fields, block) {
|
||||
function get_form_fields(form, fields) {
|
||||
fields = fields || {};
|
||||
/* consolidate the form's inputs for submission */
|
||||
$(form).find("select, input, textarea").not(".gray").each(function() {
|
||||
@@ -65,8 +65,11 @@ function simple_post_form(form, where, fields, block) {
|
||||
if (fields.id == null) {
|
||||
fields.id = $(form).attr("id") ? ("#" + $(form).attr("id")) : "";
|
||||
}
|
||||
return fields;
|
||||
};
|
||||
|
||||
$.request(where, fields, null, block);
|
||||
function simple_post_form(form, where, fields, block) {
|
||||
$.request(where, get_form_fields(form, fields), null, block);
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
@@ -347,6 +347,8 @@ ${unsafe(txt)}
|
||||
post_site: "${c.site.name if not c.default_sr else ''}",
|
||||
/* are we in an iframe */
|
||||
cnameframe: ${"true" if (c.cname and not c.authorized_cname) else "false"},
|
||||
/* this page's referer" */
|
||||
referer: "${request.referer or ""}",
|
||||
/* the user's voting hash */
|
||||
modhash: ${"'%s'" % c.modhash or "false"},
|
||||
/* current domain */
|
||||
@@ -368,7 +370,7 @@ ${unsafe(txt)}
|
||||
<%def name="logout()">
|
||||
<form method="post" action="/logout" class="logout hover">
|
||||
<input type="hidden" name="uh" value="${c.modhash}"/>
|
||||
<a href="javascript:void()" onclick="$(this).parent().submit()">
|
||||
<a href="javascript:void(0)" onclick="$(this).parent().submit()">
|
||||
${_("logout")}
|
||||
</a>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user