Move https buttons to S3 for now.

This commit is contained in:
Max Goodman
2012-05-31 17:11:17 -07:00
parent 491e91f019
commit 66d0d4f627
4 changed files with 23 additions and 8 deletions

View File

@@ -1,7 +1,11 @@
(function() {
var prefix = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.reddit.com';
if ('https:' == document.location.protocol) {
var base_url = 'https://redditstatic.s3.amazonaws.com'
} else {
var base_url = 'http://www.reddit.com/static'
}
var write_string="<iframe src=\"" + prefix + "/static/button/button1.html?width=120&url=";
var write_string="<iframe src=\"" + base_url + "/button/button1.html?width=120&url=";
if (window.reddit_url) {
write_string += encodeURIComponent(reddit_url);

View File

@@ -1,7 +1,11 @@
(function() {
var prefix = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.reddit.com';
if ('https:' == document.location.protocol) {
var base_url = 'https://redditstatic.s3.amazonaws.com'
} else {
var base_url = 'http://www.reddit.com/static'
}
var write_string="<iframe src=\"" + prefix + "/static/button/button2.html?width=51&url=";
var write_string="<iframe src=\"" + base_url + "/button/button2.html?width=51&url=";
if (window.reddit_url) {
write_string += encodeURIComponent(reddit_url);

View File

@@ -1,7 +1,11 @@
(function() {
var prefix = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.reddit.com';
if ('https:' == document.location.protocol) {
var base_url = 'https://redditstatic.s3.amazonaws.com'
} else {
var base_url = 'http://www.reddit.com/static'
}
var write_string="<iframe src=\"" + prefix + "/static/button/button3.html?width=69&url=";
var write_string="<iframe src=\"" + base_url + "/button/button3.html?width=69&url=";
if (window.reddit_url) {
write_string += encodeURIComponent(reddit_url);

View File

@@ -160,11 +160,11 @@ $(function() {
infoTarget = "/r/" + querydict.sr + infoTarget;
}
var secure = 'https:' == document.location.protocol;
if ($.cookie_read("session", "reddit_").data) {
options.url = infoTarget;
options.dataType = "json";
} else {
var secure = 'https:' == document.location.protocol;
var prefix = secure ? "https://ssl.reddit.com" : "http://buttons.reddit.com";
options.url = prefix + infoTarget;
options.dataType = options.jsonp = "jsonp";
@@ -179,7 +179,10 @@ $(function() {
options.data["id"] = querydict.id;
}
$.ajax(options);
// Secure button info is disabled for now due to load.
if (!secure) {
$.ajax(options);
}
}
);