diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 5215318bb..c21239e11 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -71,6 +71,7 @@ class Reddit(Wrapped): submit_box = True searchbox = True extension_handling = True + enable_login_cover = True def __init__(self, space_compress = True, nav_menus = None, loginbox = True, infotext = '', content = None, title = '', robots = None, @@ -360,6 +361,8 @@ class FormPage(BoringPage): class LoginPage(BoringPage): + enable_login_cover = False + """a boring page which provides the Login/register form""" def __init__(self, **context): context['loginbox'] = False diff --git a/r2/r2/public/static/js/jquery.reddit.js b/r2/r2/public/static/js/jquery.reddit.js index 897ef6c32..d18305beb 100644 --- a/r2/r2/public/static/js/jquery.reddit.js +++ b/r2/r2/public/static/js/jquery.reddit.js @@ -300,16 +300,28 @@ $.fn.new_thing_child = function(what, use_listing) { var where = (use_listing) ? $.listing(id) : this.thing().find(".child:first"); + var new_form; if (typeof(what) == "string") - return where.prepend(what).children(":first"); + new_form = where.prepend(what).children(":first"); else - return what.hide() + new_form = what.hide() .prependTo(where) .show() .find('input[name=parent]').attr('value', id).end(); + return (new_form).randomize_ids(); }; +$.fn.randomize_ids = function() { + var new_id = (Math.random() + "").split('.')[1] + $(this).find("*[id]").each(function() { + $(this).attr('id', $(this).attr("id") + new_id); + }).end() + .find("label").each(function() { + $(this).attr('for', $(this).attr("for") + new_id); + }); + return $(this); +} $.replace_things = function(things, keep_children, reveal, stubs) { /* Given the api-html structured things, insert them into the DOM diff --git a/r2/r2/templates/appservicemonitor.html b/r2/r2/templates/appservicemonitor.html index 0bba7e287..1d5b276e8 100644 --- a/r2/r2/templates/appservicemonitor.html +++ b/r2/r2/templates/appservicemonitor.html @@ -135,9 +135,9 @@ host_id = host.host.replace('.', '-') load = host.load() load_level = min(max(int(load+0.5), 0),5) - empty_cls = '' if len(host.services) else 'empty' %> -