site change and file recording, better share support

This commit is contained in:
Kyle Drake 2014-06-04 18:05:29 -07:00
parent 9275b92d9f
commit da9d1e4eb3
15 changed files with 125 additions and 65 deletions

8
app.rb
View file

@ -11,6 +11,14 @@ use Rack::Session::Cookie, key: 'neocities',
use Rack::Recaptcha, public_key: $config['recaptcha_public_key'], private_key: $config['recaptcha_private_key']
helpers Rack::Recaptcha::Helpers
helpers do
def site_change_file_display_class(filename)
return 'html' if filename.match(Site::HTML_REGEX)
return 'image' if filename.match(Site::IMAGE_REGEX)
'misc'
end
end
before do
if request.path.match /^\/api\//i
@api = true