Fix mathjax on edit and create pages (#1773)
* Fix mathjax on edit and create pages
This commit is contained in:
+2
-2
@@ -20,6 +20,7 @@ require 'gollum/views/layout'
|
|||||||
require 'gollum/views/editable'
|
require 'gollum/views/editable'
|
||||||
require 'gollum/views/has_page'
|
require 'gollum/views/has_page'
|
||||||
require 'gollum/views/has_user_icons'
|
require 'gollum/views/has_user_icons'
|
||||||
|
require 'gollum/views/has_math'
|
||||||
require 'gollum/views/pagination'
|
require 'gollum/views/pagination'
|
||||||
require 'gollum/views/rss.rb'
|
require 'gollum/views/rss.rb'
|
||||||
require 'gollum/views/template_cascade'
|
require 'gollum/views/template_cascade'
|
||||||
@@ -125,6 +126,7 @@ module Precious
|
|||||||
@css = settings.wiki_options[:css]
|
@css = settings.wiki_options[:css]
|
||||||
@js = settings.wiki_options[:js]
|
@js = settings.wiki_options[:js]
|
||||||
@mathjax_config = settings.wiki_options[:mathjax_config]
|
@mathjax_config = settings.wiki_options[:mathjax_config]
|
||||||
|
@mathjax = settings.wiki_options[:mathjax]
|
||||||
|
|
||||||
@use_static_assets = settings.wiki_options.fetch(:static, settings.environment != :development)
|
@use_static_assets = settings.wiki_options.fetch(:static, settings.environment != :development)
|
||||||
@static_assets_path = settings.wiki_options.fetch(:static_assets_path, ::File.join(File.dirname(__FILE__), 'public/assets'))
|
@static_assets_path = settings.wiki_options.fetch(:static_assets_path, ::File.join(File.dirname(__FILE__), 'public/assets'))
|
||||||
@@ -217,7 +219,6 @@ module Precious
|
|||||||
if page = wikip.page
|
if page = wikip.page
|
||||||
@page = page
|
@page = page
|
||||||
@content = page.text_data
|
@content = page.text_data
|
||||||
@mathjax = wiki.mathjax
|
|
||||||
@etag = page.sha
|
@etag = page.sha
|
||||||
mustache :edit
|
mustache :edit
|
||||||
else
|
else
|
||||||
@@ -613,7 +614,6 @@ module Precious
|
|||||||
# Extensions and layout data
|
# Extensions and layout data
|
||||||
@editable = true
|
@editable = true
|
||||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||||
@mathjax = wiki.mathjax
|
|
||||||
@h1_title = wiki.h1_title
|
@h1_title = wiki.h1_title
|
||||||
@bar_side = wiki.bar_side
|
@bar_side = wiki.bar_side
|
||||||
@allow_uploads = wiki.allow_uploads
|
@allow_uploads = wiki.allow_uploads
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module Precious
|
|||||||
module Views
|
module Views
|
||||||
class Create < Layout
|
class Create < Layout
|
||||||
include Editable
|
include Editable
|
||||||
|
include HasMath
|
||||||
|
|
||||||
attr_reader :page, :name
|
attr_reader :page, :name
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ module Precious
|
|||||||
class Edit < Layout
|
class Edit < Layout
|
||||||
include Editable
|
include Editable
|
||||||
include HasPage
|
include HasPage
|
||||||
|
include HasMath
|
||||||
|
|
||||||
attr_reader :page, :content
|
attr_reader :page, :content
|
||||||
|
|
||||||
@@ -19,10 +20,6 @@ module Precious
|
|||||||
@name
|
@name
|
||||||
end
|
end
|
||||||
|
|
||||||
def mathjax
|
|
||||||
@mathjax
|
|
||||||
end
|
|
||||||
|
|
||||||
def header
|
def header
|
||||||
if @header.nil?
|
if @header.nil?
|
||||||
if page = @page.header
|
if page = @page.header
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
module Precious
|
||||||
|
module HasMath
|
||||||
|
def mathjax
|
||||||
|
@mathjax
|
||||||
|
end
|
||||||
|
|
||||||
|
def mathjax_config
|
||||||
|
@mathjax_config
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -2,6 +2,7 @@ module Precious
|
|||||||
module Views
|
module Views
|
||||||
class Page < Layout
|
class Page < Layout
|
||||||
include HasPage
|
include HasPage
|
||||||
|
include HasMath
|
||||||
|
|
||||||
attr_reader :content, :page, :header, :footer, :preview, :historical
|
attr_reader :content, :page, :header, :footer, :preview, :historical
|
||||||
|
|
||||||
@@ -157,14 +158,6 @@ module Precious
|
|||||||
@toc_content
|
@toc_content
|
||||||
end
|
end
|
||||||
|
|
||||||
def mathjax
|
|
||||||
@mathjax
|
|
||||||
end
|
|
||||||
|
|
||||||
def mathjax_config
|
|
||||||
@mathjax_config
|
|
||||||
end
|
|
||||||
|
|
||||||
def use_identicon
|
def use_identicon
|
||||||
@page.wiki.user_icons == 'identicon'
|
@page.wiki.user_icons == 'identicon'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user