Fix live_preview option #374.

This commit is contained in:
bootstraponline
2012-06-08 16:39:44 -06:00
parent 097f45eeb3
commit cbc37eb006
2 changed files with 4 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 settings.wiki_options[:live_preview] && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
redirect '/livepreview/index.html?page=' + encodeURIComponent(@name)
else
@page = page
+3
View File
@@ -133,6 +133,9 @@ module Gollum
# Gets the Array of chars to sub for ws in filenames.
attr_reader :ws_subs
# Gets the boolean live preview value.
attr_reader :live_preview
# Public: Initialize a new Gollum Repo.
#
# path - The String path to the Git repository that holds the Gollum