From cbc37eb006c7df28ebc0ea15ec384b00aec953b9 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 8 Jun 2012 16:39:44 -0600 Subject: [PATCH] Fix live_preview option #374. --- lib/gollum/frontend/app.rb | 2 +- lib/gollum/wiki.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 82415c68..1ec7c85e 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -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 diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index c9c1308a..a77721ec 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -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