enhance upload selector

- Change the icon on the button to a file when attachments are enabled
- Display the list of allowed extensions in the upload selector
- FIX : regexps for validating uploads weren't escaping the dots
This commit is contained in:
Régis Hanol
2013-08-02 01:27:48 +02:00
parent c063580275
commit faeb4a9ebd
7 changed files with 48 additions and 30 deletions

View File

@ -92,9 +92,9 @@ describe SiteSetting do
describe "authorized_uploads" do
it "trims space and adds leading dots" do
SiteSetting.stubs(:authorized_extensions).returns(" png | .jpeg|txt|bmp")
SiteSetting.authorized_uploads.should == [".png", ".jpeg", ".txt", ".bmp"]
it "trims spaces and leading dots" do
SiteSetting.stubs(:authorized_extensions).returns(" png | .jpeg|txt|bmp | .tar.gz")
SiteSetting.authorized_uploads.should == ["png", "jpeg", "txt", "bmp", "tar.gz"]
end
end
@ -103,7 +103,7 @@ describe SiteSetting do
it "filters non-image out" do
SiteSetting.stubs(:authorized_extensions).returns(" png | .jpeg|txt|bmp")
SiteSetting.authorized_images.should == [".png", ".jpeg", ".bmp"]
SiteSetting.authorized_images.should == ["png", "jpeg", "bmp"]
end
end