Revert "Rename s3 vars, change condition when displaying s3 uploads"

The new variables do not reflect that they represent S3 settings.

This reverts commit 24dfa1b657.
This commit is contained in:
Guo Xiang Tan 2018-07-06 15:46:41 +08:00
parent 4f41ccd975
commit 73e30ff4c2
3 changed files with 5 additions and 5 deletions

View File

@ -33,8 +33,8 @@ const Discourse = Ember.Application.extend({
// only relative urls // only relative urls
if (Discourse.CDN && /^\/[^\/]/.test(url)) { if (Discourse.CDN && /^\/[^\/]/.test(url)) {
url = Discourse.CDN + url; url = Discourse.CDN + url;
} else if (Discourse.UploadCDN) { } else if (Discourse.S3CDN) {
url = url.replace(Discourse.UploadBaseUrl, Discourse.UploadCDN); url = url.replace(Discourse.S3BaseUrl, Discourse.S3CDN);
} }
return url; return url;
}, },

View File

@ -428,7 +428,7 @@ export function uploadLocation(url) {
if (Discourse.CDN) { if (Discourse.CDN) {
url = Discourse.getURLWithCDN(url); url = Discourse.getURLWithCDN(url);
return /^\/\//.test(url) ? "http:" + url : url; return /^\/\//.test(url) ? "http:" + url : url;
} else if (Discourse.UploadBaseUrl) { } else if (Discourse.S3BaseUrl) {
return "https:" + url; return "https:" + url;
} else { } else {
var protocol = window.location.protocol + "//", var protocol = window.location.protocol + "//",

View File

@ -56,9 +56,9 @@
Discourse.HighlightJSPath = <%= HighlightJs.path.inspect.html_safe %>; Discourse.HighlightJSPath = <%= HighlightJs.path.inspect.html_safe %>;
<%- if SiteSetting.Upload.enable_s3_uploads %> <%- if SiteSetting.Upload.enable_s3_uploads %>
<%- if SiteSetting.Upload.s3_cdn_url.present? %> <%- if SiteSetting.Upload.s3_cdn_url.present? %>
Discourse.UploadCDN = '<%= SiteSetting.Upload.s3_cdn_url %>'; Discourse.S3CDN = '<%= SiteSetting.Upload.s3_cdn_url %>';
<%- end %> <%- end %>
Discourse.UploadBaseUrl = '<%= SiteSetting.Upload.absolute_base_url %>'; Discourse.S3BaseUrl = '<%= SiteSetting.Upload.absolute_base_url %>';
<%- end %> <%- end %>
})(); })();
</script> </script>