mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Remove dead client side cnameframe parameter.
Thanks to /u/largenocream for reporting this.
This commit is contained in:
@@ -124,8 +124,6 @@ def js_config(extra_config=None):
|
||||
"logged": logged,
|
||||
# the subreddit's name (for posts)
|
||||
"post_site": c.site.name if not c.default_sr else "",
|
||||
# are we in an iframe?
|
||||
"cnameframe": bool(c.cname and not c.authorized_cname),
|
||||
# the user's voting hash
|
||||
"modhash": c.modhash or False,
|
||||
# the current rendering style
|
||||
|
||||
@@ -162,9 +162,8 @@ $.request = function(op, parameters, worker_in, block, type,
|
||||
/*
|
||||
Uniquitous reddit AJAX poster. Automatically addes
|
||||
handleResponse(action) worker to deal with the API result. The
|
||||
current subreddit (reddit.post_site), the user's modhash
|
||||
(reddit.modhash) and whether or not we are in a frame
|
||||
(reddit.cnameframe) are also automatically sent across.
|
||||
current subreddit (reddit.post_site) and the user's modhash
|
||||
(reddit.modhash) are also automatically sent across.
|
||||
*/
|
||||
var action = op;
|
||||
var worker = worker_in;
|
||||
@@ -176,7 +175,7 @@ $.request = function(op, parameters, worker_in, block, type,
|
||||
return
|
||||
}
|
||||
|
||||
if (window != window.top && !reddit.cnameframe && !reddit.external_frame) {
|
||||
if (window != window.top && !reddit.external_frame) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -207,10 +206,6 @@ $.request = function(op, parameters, worker_in, block, type,
|
||||
if (reddit.post_site)
|
||||
parameters.r = reddit.post_site;
|
||||
|
||||
/* flag whether or not we are on a cname */
|
||||
if (reddit.cnameframe)
|
||||
parameters.cnameframe = 1;
|
||||
|
||||
/* add the modhash if the user is logged in */
|
||||
if (reddit.logged)
|
||||
parameters.uh = reddit.modhash;
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
r.login = {
|
||||
post: function(form, action) {
|
||||
if (r.config.cnameframe && !r.config.https_endpoint) {
|
||||
form.$el.unbind()
|
||||
form.$el.submit()
|
||||
return
|
||||
}
|
||||
|
||||
var username = $('input[name="user"]', form.$el).val(),
|
||||
endpoint = r.config.https_endpoint || ('http://'+r.config.ajax_domain),
|
||||
apiTarget = endpoint+'/api/'+action+'/'+username
|
||||
|
||||
@@ -559,15 +559,10 @@ function last_click() {
|
||||
}
|
||||
|
||||
function login(elem) {
|
||||
if(cnameframe)
|
||||
return true;
|
||||
|
||||
return post_user(this, "login");
|
||||
};
|
||||
|
||||
function register(elem) {
|
||||
if(cnameframe)
|
||||
return true;
|
||||
return post_user(this, "register");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user