@@ -147,7 +147,7 @@ module Precious
|
||||
|
||||
post '/preview' do
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
@name = "Preview"
|
||||
@name = params[:page] || "Preview"
|
||||
@page = wiki.preview_page(@name, params[:content], params[:format])
|
||||
@content = @page.formatted_data
|
||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
var $form = $($('#gollum-editor form').get(0));
|
||||
$form.attr('action', this.href || '/preview');
|
||||
$form.attr('target', '_blank');
|
||||
var paths = window.location.pathname.split('/');
|
||||
$form.attr('page', paths[ paths.length - 1 ] || '')
|
||||
$form.submit();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user