Add option to disable livepreview from settings

This commit is contained in:
Arran Cudbard-Bell
2012-06-07 10:40:52 +02:00
parent 59ac86cf6e
commit 8554654ee9
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ module Precious
@name = params[:splat].first
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
if page = wiki.page(@name)
if page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
if settings.wiki_options[:live_preview] && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
redirect '/livepreview/index.html?page=' + encodeURIComponent(@name)
else
@page = page