Merge pull request #661 from wojciechka/prefix_fixes

Fix for reply to user avatar and picture uploading not working when editing post when using prefix
This commit is contained in:
Robin Ward 2013-04-05 08:23:31 -07:00
commit ab85d4a757
3 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ Discourse.Utilities = {
if (template) {
return template.replace(/\{size\}/g, rawSize);
}
return "/users/" + (username.toLowerCase()) + "/avatar/" + rawSize + "?__ws=" + (encodeURIComponent(Discourse.BaseUrl || ""));
return Discourse.getURL("/users/") + (username.toLowerCase()) + "/avatar/" + rawSize + "?__ws=" + (encodeURIComponent(Discourse.BaseUrl || ""));
},
avatarImg: function(options) {

View File

@ -270,7 +270,7 @@ Discourse.ComposerView = Discourse.View.extend({
$uploadTarget.off();
$uploadTarget.fileupload({
url: '/uploads',
url: Discourse.getURL('/uploads'),
dataType: 'json',
timeout: 20000,
formData: { topic_id: 1234 }

View File

@ -48,7 +48,7 @@ class Upload < ActiveRecord::Base
File.open("#{path}/#{clean_name}", "wb") do |f|
f.write File.read(file.tempfile)
end
upload.url = "#{url_root}/#{clean_name}"
upload.url = Discourse::base_uri + "#{url_root}/#{clean_name}"
upload.save
upload