diff --git a/r2/r2/public/static/js/reddit.js b/r2/r2/public/static/js/reddit.js index f926011b4..0e84a5aaf 100644 --- a/r2/r2/public/static/js/reddit.js +++ b/r2/r2/public/static/js/reddit.js @@ -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; }; diff --git a/r2/r2/templates/utils.html b/r2/r2/templates/utils.html index d0bdbdaa2..9d9823355 100644 --- a/r2/r2/templates/utils.html +++ b/r2/r2/templates/utils.html @@ -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()">
- + ${_("logout")}