From c4a067bf29930c00c51b3a9df48fbb01acf4b8a9 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Tue, 2 Jul 2013 00:12:20 -0400 Subject: [PATCH] add support for json, text files, web fonts --- models/site.rb | 4 ++-- views/site_files/new.slim | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/models/site.rb b/models/site.rb index 14d8194a..5115b998 100644 --- a/models/site.rb +++ b/models/site.rb @@ -1,7 +1,7 @@ class Site < Sequel::Model # We might need to include fonts in here.. - VALID_MIME_TYPES = ['text/plain', 'text/html', 'text/css', 'application/javascript', 'image/png', 'image/jpeg', 'image/gif', 'image/svg+xml'] - VALID_EXTENSIONS = %w{ html htm txt text css js jpg jpeg png gif svg md markdown } + VALID_MIME_TYPES = ['text/plain', 'text/html', 'text/css', 'application/javascript', 'image/png', 'image/jpeg', 'image/gif', 'image/svg+xml', 'application/vnd.ms-fontobject', 'application/x-font-ttf', 'application/octet-stream'] + VALID_EXTENSIONS = %w{ html htm txt text css js jpg jpeg png gif svg md markdown eot ttf woff json} #USERNAME_SHITLIST = %w{ payment secure login signin www ww web } # I thought they were funny personally, but everybody is freaking out so.. MAX_SPACE = (5242880*2) # 10MB MINIMUM_PASSWORD_LENGTH = 5 diff --git a/views/site_files/new.slim b/views/site_files/new.slim index 36ac46f9..aab77438 100644 --- a/views/site_files/new.slim +++ b/views/site_files/new.slim @@ -26,9 +26,12 @@ ul id="file_criteria" li HTML (.html, .htm) li Image (.jpg, .png, .gif, .svg) - li Markdown (.md) - li JavaScript (.js) + li Markdown (.md, .markdown) + li JavaScript (.js, .json) li CSS (.css) + li Text (.txt, .text) + li Web Fonts (.eot, .ttf, .woff, .svg) + h4 If the file already exists, it will be overwritten without warning. h4 It has to be legal to share this content in the United States. h4 It must fit into your home page space (5MB).