Rename s3 vars, change condition when displaying s3 uploads
This commit is contained in:
parent
b3073175a7
commit
24dfa1b657
|
@ -33,8 +33,8 @@ const Discourse = Ember.Application.extend({
|
|||
// only relative urls
|
||||
if (Discourse.CDN && /^\/[^\/]/.test(url)) {
|
||||
url = Discourse.CDN + url;
|
||||
} else if (Discourse.S3CDN) {
|
||||
url = url.replace(Discourse.S3BaseUrl, Discourse.S3CDN);
|
||||
} else if (Discourse.UploadCDN) {
|
||||
url = url.replace(Discourse.UploadBaseUrl, Discourse.UploadCDN);
|
||||
}
|
||||
return url;
|
||||
},
|
||||
|
|
|
@ -428,7 +428,7 @@ export function uploadLocation(url) {
|
|||
if (Discourse.CDN) {
|
||||
url = Discourse.getURLWithCDN(url);
|
||||
return /^\/\//.test(url) ? "http:" + url : url;
|
||||
} else if (Discourse.SiteSettings.enable_s3_uploads) {
|
||||
} else if (Discourse.UploadBaseUrl) {
|
||||
return "https:" + url;
|
||||
} else {
|
||||
var protocol = window.location.protocol + "//",
|
||||
|
|
|
@ -56,9 +56,9 @@
|
|||
Discourse.HighlightJSPath = <%= HighlightJs.path.inspect.html_safe %>;
|
||||
<%- if SiteSetting.Upload.enable_s3_uploads %>
|
||||
<%- if SiteSetting.Upload.s3_cdn_url.present? %>
|
||||
Discourse.S3CDN = '<%= SiteSetting.Upload.s3_cdn_url %>';
|
||||
Discourse.UploadCDN = '<%= SiteSetting.Upload.s3_cdn_url %>';
|
||||
<%- end %>
|
||||
Discourse.S3BaseUrl = '<%= SiteSetting.Upload.absolute_base_url %>';
|
||||
Discourse.UploadBaseUrl = '<%= SiteSetting.Upload.absolute_base_url %>';
|
||||
<%- end %>
|
||||
})();
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue