diff --git a/.gitignore b/.gitignore index 3253ba6e..1beac75b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ coverage pkg .DS_Store +.bundle diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..c80ee369 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "http://rubygems.org" + +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..50e67278 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,58 @@ +PATH + remote: . + specs: + gollum (1.1.0) + albino (~> 1.0) + github-markup (>= 0.4.0, < 1.0.0) + grit (~> 2.3) + mustache (>= 0.11.2, < 1.0.0) + nokogiri (~> 1.4) + sanitize (~> 1.1) + sinatra (~> 1.0) + +GEM + remote: http://rubygems.org/ + specs: + RedCloth (4.2.3) + albino (1.0) + diff-lcs (1.1.2) + github-markup (0.5.0) + grit (2.3.0) + diff-lcs (~> 1.1) + mime-types (~> 1.15) + mime-types (1.16) + mocha (0.9.9) + rake + mustache (0.11.2) + nokogiri (1.4.3.1) + org-ruby (0.5.3) + rubypants (>= 0.2.0) + rack (1.2.1) + rake (0.8.7) + rdiscount (1.6.5) + rubypants (0.2.0) + sanitize (1.2.1) + nokogiri (~> 1.4.1) + shoulda (2.11.3) + sinatra (1.1.0) + rack (~> 1.1) + tilt (~> 1.1) + tilt (1.1) + +PLATFORMS + ruby + +DEPENDENCIES + RedCloth + albino (~> 1.0) + github-markup (>= 0.4.0, < 1.0.0) + gollum! + grit (~> 2.3) + mocha + mustache (>= 0.11.2, < 1.0.0) + nokogiri (~> 1.4) + org-ruby + rdiscount + sanitize (~> 1.1) + shoulda + sinatra (~> 1.0) diff --git a/HISTORY.md b/HISTORY.md index 4c977194..e2620f58 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,15 @@ # HEAD +* Minor Enhancements + * Add `:sanitization` and `:history_sanitization` options for customizing + how `Sanitize.clean` modifies formatted wiki content. + * Add `--config` option for the command line, to specify a ruby file that is + run during startup. +* Bug Fixes + * Use `@wiki.page_class` in Gollum::Markup where appropriate (#63). + +# 1.1.0 / 2010-10-28 + * Major Enhancements * Optimize page write/update/delete to use Grit::Index::read_tree instead of manually recreating entire index contents. diff --git a/bin/gollum b/bin/gollum index dcfd8156..11d9e91b 100755 --- a/bin/gollum +++ b/bin/gollum @@ -35,6 +35,10 @@ opts = OptionParser.new do |opts| exit 0 end + opts.on("--config [CONFIG]", "Path to additional configuration file") do |config| + options['config'] = config + end + opts.on("--irb", "Start an irb process with gollum loaded for the current wiki.") do options['irb'] = true end @@ -99,5 +103,11 @@ if options['irb'] else require 'gollum/frontend/app' Precious::App.set(:gollum_path, gollum_path) + if cfg = options['config'] + # If the path begins with a '/' it will be considered an absolute path, + # otherwise it will be relative to the CWD + cfg = File.join(Dir.getwd, cfg) unless cfg.slice(0) == File::SEPARATOR + require cfg + end Precious::App.run!(options) end diff --git a/gollum.gemspec b/gollum.gemspec index 521f8bbf..e2586d7e 100644 --- a/gollum.gemspec +++ b/gollum.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |s| s.rubygems_version = '1.3.5' s.name = 'gollum' - s.version = '1.0.1' - s.date = '2010-10-11' + s.version = '1.1.0' + s.date = '2010-10-28' s.rubyforge_project = 'gollum' s.summary = "A simple, Git-powered wiki." diff --git a/lib/gollum.rb b/lib/gollum.rb index 36bcab92..78b0010a 100644 --- a/lib/gollum.rb +++ b/lib/gollum.rb @@ -18,54 +18,13 @@ require 'gollum/page' require 'gollum/file' require 'gollum/markup' require 'gollum/albino' +require 'gollum/sanitization' module Gollum - VERSION = '1.0.1' - - SANITIZATION_OPTIONS = { - :elements => [ - 'a', 'abbr', 'acronym', 'address', 'area', 'b', 'big', - 'blockquote', 'br', 'button', 'caption', 'center', 'cite', - 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', - 'div', 'dl', 'dt', 'em', 'fieldset', 'font', 'form', 'h1', - 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', - 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', - 'ol', 'optgroup', 'option', 'p', 'pre', 'q', 's', 'samp', - 'select', 'small', 'span', 'strike', 'strong', 'sub', - 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', - 'thead', 'tr', 'tt', 'u', 'ul', 'var' - ], - :attributes => { - :all => ['abbr', 'accept', 'accept-charset', - 'accesskey', 'action', 'align', 'alt', 'axis', - 'border', 'cellpadding', 'cellspacing', 'char', - 'charoff', 'charset', 'checked', 'cite', - 'class', 'clear', 'cols', 'colspan', 'color', - 'compact', 'coords', 'datetime', 'dir', - 'disabled', 'enctype', 'for', 'frame', - 'headers', 'height', 'href', 'hreflang', - 'hspace', 'id', 'ismap', 'label', 'lang', - 'longdesc', 'maxlength', 'media', 'method', - 'multiple', 'name', 'nohref', 'noshade', - 'nowrap', 'prompt', 'readonly', 'rel', 'rev', - 'rows', 'rowspan', 'rules', 'scope', - 'selected', 'shape', 'size', 'span', 'src', - 'start', 'summary', 'tabindex', 'target', - 'title', 'type', 'usemap', 'valign', 'value', - 'vspace', 'width'] - }, - :protocols => { - 'a' => {'href' => ['http', 'https', 'mailto', :relative]}, - 'img' => {'href' => ['http', 'https', :relative]} - } - } - HISTORY_SANITIZATION_OPTIONS = SANITIZATION_OPTIONS.merge( - :add_attributes => { - 'a' => {'rel' => 'nofollow'} - } - ) + VERSION = '1.1.0' class Error < StandardError; end + class DuplicatePageError < Error attr_accessor :dir attr_accessor :existing_path diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index b91e23d0..a814c752 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -80,10 +80,13 @@ module Precious end post '/preview' do - format = params['wiki_format'] - data = params['text'] + @name = params['page'] + format = params['format'] + data = params['content'] wiki = Gollum::Wiki.new(settings.gollum_path) - wiki.preview_page("Preview", data, format).formatted_data + @page = wiki.preview_page("Preview", data, format) + @content = @page.formatted_data + mustache :page end get '/history/:name' do @@ -134,6 +137,7 @@ module Precious @query = params[:q] wiki = Gollum::Wiki.new(settings.gollum_path) @results = wiki.search @query + @name = @query mustache :search end diff --git a/lib/gollum/frontend/public/css/dialog.css b/lib/gollum/frontend/public/css/dialog.css new file mode 100644 index 00000000..78171c08 --- /dev/null +++ b/lib/gollum/frontend/public/css/dialog.css @@ -0,0 +1,140 @@ +/* @control dialog */ + +#gollum-dialog-dialog { + display: none; + top: 50%; + left: 50%; + position: absolute; +} + +#gollum-dialog-dialog.active { + display: block; +} + +#gollum-dialog-dialog-inner { + background: transparent; + margin: 0 0 0 -225px; + overflow: hidden; + position: relative; + width: 450px; + + border: 7px solid rgba(0, 0, 0, 0.3); + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +#gollum-dialog-dialog-bg { + background-color: #fff; + overflow: hidden; + padding: 1em; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f7f7f7', endColorstr='#ffffff'); + background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#ffffff)); + background: -moz-linear-gradient(top, #f7f7f7, #ffffff); +} + +#gollum-dialog-dialog-inner h4 { + border-bottom: 1px solid #ddd; + color: #000; + font-size: 1.8em; + line-height: normal; + font-weight: bold; + margin: 0 0 0.75em 0; + padding: 0 0 0.3em 0; +} + +#gollum-dialog-dialog-body { + font-size: 1.2em; + line-height: 1.6em; +} + +#gollum-dialog-dialog-body fieldset { + border: 0; + margin: 0; + padding: 0; +} + +#gollum-dialog-dialog-body fieldset .field { + margin: 0 0 1.5em 0; + padding: 0; +} + + #gollum-dialog-dialog-body fieldset .field label { + color: #000; + display: block; + font-size: 1.2em; + font-weight: bold; + line-height: 1.6em; + margin: 0; + padding: 0; + min-width: 80px; + } + + #gollum-dialog-dialog-body fieldset .field input[type="text"] { + border: 1px solid #ddd; + display: block; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 1.2em; + line-height: 1.6em; + margin: 0.3em 0 0 0; + padding: 0.3em 0.5em; + width: 96.5%; + } + + #gollum-dialog-dialog-body fieldset .field input.code { + font-family: 'Monaco', 'Courier New', Courier, monospace; + } + +#gollum-dialog-dialog-body fieldset .field:last-child { + margin: 0 0 1em 0; +} + +#gollum-dialog-dialog-buttons { + border-top: 1px solid #ddd; + overflow: hidden; + margin: 1.5em 0 0 0; + padding: 1em 0 0 0; +} + +#gollum-dialog-dialog a.minibutton { + float: right; + margin-right: 0.5em; + width: auto; +} + +#gollum-dialog-dialog a.minibutton, +#gollum-dialog-dialog a.minibutton:visited { + background-color: #f7f7f7; + border: 1px solid #d4d4d4; + color: #333; + cursor: pointer; + display: block; + font-size: 1.2em; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: bold; + margin: 0 0 0 0.8em; + padding: 0.4em 1em; + + text-shadow: 0 1px 0 #fff; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec'); + background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec)); + background: -moz-linear-gradient(top, #f4f4f4, #ececec); + + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + +#gollum-dialog-dialog a.minibutton:hover { + background: #3072b3; + border-color: #518cc6 #518cc6 #2a65a0; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); + text-decoration: none; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3'); + background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3)); + background: -moz-linear-gradient(top, #599bdc, #3072b3); +} \ No newline at end of file diff --git a/lib/gollum/frontend/public/css/editor.css b/lib/gollum/frontend/public/css/editor.css index ad1862e4..18086ed3 100644 --- a/lib/gollum/frontend/public/css/editor.css +++ b/lib/gollum/frontend/public/css/editor.css @@ -3,6 +3,10 @@ Wiki editor formatting */ +a { + -moz-outline: none !important; +} + .jaws { /* JAWS should see it, but you can't */ display: block; @@ -147,6 +151,7 @@ a#function-h2 span { background-position: -244px 0; } a#function-h3 span { background-position: -271px 0; } a#function-link span { background-position: -298px 0; } a#function-image span { background-position: -324px 0; } +a#function-help span { background-position: -405px 0; } a#function-bold:hover span { background-position: 0 -28px; } a#function-italic:hover span { background-position: -27px -28px; } @@ -161,6 +166,7 @@ a#function-h2:hover span { background-position: -244px -28px; } a#function-h3:hover span { background-position: -271px -28px; } a#function-link:hover span { background-position: -298px -28px; } a#function-image:hover span { background-position: -324px -28px; } +a#function-help:hover span { background-position: -405px -28px; } #gollum-editor #gollum-editor-function-bar a.disabled { @@ -180,6 +186,7 @@ a#function-image:hover span { background-position: -324px -28px; } float: right; font-size: 1.1em; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: bold; line-height: 1.6em; padding: 0.5em 0.7em; @@ -189,7 +196,6 @@ a#function-image:hover span { background-position: -324px -28px; } border-radius: 0.5em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em; - -moz-outline: none; } @@ -200,7 +206,22 @@ a#function-image:hover span { background-position: -324px -28px; } -moz-outline: none; } - +#gollum-editor #gollum-editor-function-bar + #gollum-editor-format-selector label { + color: #999; + float: right; + font-size: 1.1em; + font-weight: bold; + line-height: 1.6em; + padding: 0.6em 0.5em 0 0; +} + +#gollum-editor #gollum-editor-function-bar + #gollum-editor-format-selector label:after { + content: ':'; +} + + /* @section form-fields */ #gollum-editor textarea#gollum-editor-body { @@ -215,14 +236,13 @@ a#function-image:hover span { background-position: -324px -28px; } height: 20em; } -#gollum-editor input#gollum-editor-submit, -#gollum-editor-dialog a.minibutton, -#gollum-editor-dialog a.minibutton:visited { +#gollum-editor input#gollum-editor-submit { background-color: #f7f7f7; border: 1px solid #d4d4d4; color: #333; cursor: pointer; display: block; + float: left; font-size: 1.2em; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: bold; @@ -240,8 +260,7 @@ a#function-image:hover span { background-position: -324px -28px; } -webkit-border-radius: 3px; } -#gollum-editor input#gollum-editor-submit:hover, -#gollum-editor-dialog a.minibutton:hover { +#gollum-editor input#gollum-editor-submit:hover { background: #3072b3; border-color: #518cc6 #518cc6 #2a65a0; color: #fff; @@ -350,104 +369,138 @@ a#function-image:hover span { background-position: -324px -28px; } width: 98%; } +/* @control minibutton */ - -/* @control dialog */ - -#gollum-editor-dialog { - display: none; - top: 50%; - left: 50%; - position: absolute; -} - -#gollum-editor-dialog.active { +#gollum-editor a.minibutton, +#gollum-editor a.minibutton:visited { + background-color: #f7f7f7; + border: 1px solid #d4d4d4; + color: #333; + cursor: pointer; display: block; -} - -#gollum-editor-dialog-inner { - background: transparent; - margin: 0 0 0 -225px; - overflow: hidden; - position: relative; - width: 450px; - - border: 7px solid rgba(0, 0, 0, 0.3); - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -#gollum-editor-dialog-bg { - background-color: #fff; - overflow: hidden; - padding: 1em; - - filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f7f7f7', endColorstr='#ffffff'); - background: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#ffffff)); - background: -moz-linear-gradient(top, #f7f7f7, #ffffff); -} - -#gollum-editor-dialog-inner h4 { - border-bottom: 1px solid #ddd; - color: #000; - font-size: 1.8em; - line-height: normal; + font-size: 1.2em; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: bold; - margin: 0 0 0.75em 0; - padding: 0 0 0.3em 0; + line-height: 1.2em; + margin: 0 0 0 0.8em; + padding: 0.5em 1em; + + text-shadow: 0 1px 0 #fff; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec'); + background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec)); + background: -moz-linear-gradient(top, #f4f4f4, #ececec); + + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; } -#gollum-editor-dialog-body fieldset { - border: 0; +#gollum-editor a.minibutton:hover { + background: #3072b3; + border-color: #518cc6 #518cc6 #2a65a0; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); + text-decoration: none; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3'); + background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3)); + background: -moz-linear-gradient(top, #599bdc, #3072b3); +} + + +#gollum-editor #gollum-editor-preview { + float: left; + font-weight: normal; + padding: left; +} + + +/* @section help */ +#gollum-editor-help { margin: 0; + overflow: hidden; padding: 0; + border: 1px solid #ddd; + border-width: 0 1px 1px 1px; } -#gollum-editor-dialog-body fieldset .field { - margin: 0 0 1.5em 0; - padding: 0; -} - - #gollum-editor-dialog-body fieldset .field label { - color: #000; + #gollum-editor-help-parent, + #gollum-editor-help-list { display: block; + float: left; + height: 17em; + list-style-type: none; + overflow: auto; + margin: 0; + padding: 1em 0; + width: 18%; + } + + #gollum-editor-help-parent { + border-right: 1px solid #eee; + } + + #gollum-editor-help-list { + background: #fafafa; + border-right: 1px solid #eee; + } + + #gollum-editor-help-parent li, + #gollum-editor-help-list li { font-size: 1.2em; - font-weight: bold; line-height: 1.6em; margin: 0; padding: 0; - min-width: 80px; + } + + #gollum-editor-help-parent li a, + #gollum-editor-help-list li a { + border: 1px solid transparent; + border-width: 1px 0; + display: block; + font-weight: bold; + height: 100%; + width: auto; + padding: 0.2em 1em; + text-shadow: 0 -1px 0 #fff; + } + + #gollum-editor-help-parent li a:hover, + #gollum-editor-help-list li a:hover { + background: #fff; + border-color: #f0f0f0; + text-decoration: none; + + box-shadow: none; + } + + #gollum-editor-help-parent li a.selected, + #gollum-editor-help-list li a.selected { + border: 1px solid #eee; + border-bottom-color: #e7e7e7; + border-width: 1px 0; + background: #fff; + color: #000; + + box-shadow: 0 1px 2px #f0f0f0; + } + + #gollum-editor-help-wrapper { + background: #fff; + overflow: auto; + height: 17em; + padding: 1em; } - #gollum-editor-dialog-body fieldset .field input[type="text"] { - border: 1px solid #ddd; - display: block; - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 1.2em; - line-height: 1.6em; - margin: 0.3em 0 0 0; - padding: 0.3em 0.5em; - width: 96.5%; - } - - #gollum-editor-dialog-body fieldset .field input.code { - font-family: 'Monaco', 'Courier New', Courier, monospace; - } - -#gollum-editor-dialog-body fieldset .field:last-child { - margin: 0 0 1em 0; -} - -#gollum-editor-dialog-buttons { - border-top: 1px solid #ddd; - overflow: hidden; - margin: 1.5em 0 0 0; - padding: 1em 0 0 0; -} - -#gollum-editor-dialog a.minibutton { - float: right; - margin-right: 0.5em; - width: auto; -} \ No newline at end of file + #gollum-editor-help-content { + font-size: 1.2em; + margin: 0 1em 0 0.5em; + padding: 0; + line-height: 1.8em; + } + + #gollum-editor-help-content p { + margin: 0 0 1em 0; + padding: 0; + } \ No newline at end of file diff --git a/lib/gollum/frontend/public/css/gollum.css b/lib/gollum/frontend/public/css/gollum.css index 627d98ef..5a22566b 100644 --- a/lib/gollum/frontend/public/css/gollum.css +++ b/lib/gollum/frontend/public/css/gollum.css @@ -23,6 +23,7 @@ a:link { } a:hover, a:visited { + color: #4183c4; text-decoration: underline; } @@ -41,13 +42,13 @@ a:hover, a:visited { line-height: normal; margin: 0; padding: 0.08em 0 0 0; + width: 50%; } #head ul.actions { float: right; } - /* @section content */ #wiki-content { height: 1%; @@ -267,6 +268,7 @@ a:hover, a:visited { } #wiki-history table tr td.checkbox { + min-width: 2em; padding: 0.3em; } @@ -330,6 +332,7 @@ a:hover, a:visited { #wiki-history table tr td.revert-action { border-left: 0; + min-width: 10em; text-align: right; } @@ -360,6 +363,121 @@ a:hover, a:visited { } +/* @section search */ +.results h1 { + color: #999; + font-weight: normal; +} + + .results h1 strong { + color: #000; + font-weight: bold; + } + + .results #results { + border-bottom: 1px solid #ccc; + margin-bottom: 2em; + padding-bottom: 2em; + } + + .results #results ul { + margin: 2em 0 0 0; + padding: 0; + } + + .results #results ul li { + font-size: 1.2em; + line-height: 1.6em; + list-style-position: outside; + padding: 0.2em 0; + } + + .results #results ul li span.count { + color: #999; + } + + .results p#no-results { + font-size: 1.2em; + line-height: 1.6em; + margin-top: 2em; + } + + .results #footer ul.actions li { + margin: 0 1em 0 0; + } + + +/* @section compare */ +.compare h1 { + color: #999; + font-weight: normal; +} + + .compare h1 strong { + color: #000; + font-weight: bold; + } + + .compare .data { + border: 1px solid #ddd; + margin-top: 1em; + } + + .compare .data pre { + margin: 0; + padding: 0; + } + + .compare .data pre div { + padding: 0 0 0 1em; + } + + .compare .data tr td { + font-family: "Consolas", "Monaco", "Andale Mono", "Courier New", monospace; + font-size: 1.2em; + line-height: 1.8em; + margin: 0; + padding: 0; + } + + .compare .data td.line_numbers { + background: #f7f7f7; + border-right: 1px solid #999; + color: #999; + padding: 0 0 0 0.5em; + } + +.compare #footer ul.actions li { + margin-left: 0; + margin-right: 0.6em; +} + + + +/* @control syntax */ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } +.highlight .err { color: #a61717; background-color: #e3d2d2 } +.highlight .k { font-weight: bold } +.highlight .o { font-weight: bold } +.highlight .cm { color: #999988; font-style: italic } +.highlight .cp { color: #999999; font-weight: bold } +.highlight .c1 { color: #999988; font-style: italic } +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } +.highlight .gd { color: #000000; background-color: #ffdddd } +.highlight .gd .x { color: #000000; background-color: #ffaaaa } +.highlight .ge { font-style: italic } +.highlight .gr { color: #aa0000 } +.highlight .gh { color: #999999 } +.highlight .gi { color: #000000; background-color: #ddffdd } +.highlight .gi .x { color: #000000; background-color: #aaffaa } +.highlight .gc { color: #999; background-color: #EAF2F5 } +.highlight .go { color: #888888 } +.highlight .gp { color: #555555 } +.highlight .gs { font-weight: bold } +.highlight .gu { color: #aaaaaa } +.highlight .gt { color: #aa0000 } + /* @control minibutton */ ul.actions { @@ -367,7 +485,7 @@ ul.actions { list-style-type: none; overflow: hidden; padding: 0; - } +} ul.actions li { float: left; @@ -375,7 +493,8 @@ ul.actions { margin-left: 0.6em; } -.minibutton a { +.minibutton a, +#search-submit { background-color: #f7f7f7; border: 1px solid #d4d4d4; color: #333; @@ -395,7 +514,8 @@ ul.actions { -webkit-border-radius: 3px; } -.minibutton a:hover { +.minibutton a:hover, +#search-submit:hover { background: #3072b3; border-color: #518cc6 #518cc6 #2a65a0; color: #fff; @@ -405,4 +525,110 @@ ul.actions { filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3'); background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3)); background: -moz-linear-gradient(top, #599bdc, #3072b3); +} + + +/* @special error */ +#wiki-wrapper.error { + height: 1px; + position: absolute; + overflow: visible; + top: 50%; + width: 100%; +} + +#error { + background-color: #f9f9f9; + border: 1px solid #e4e4e4; + left: 50%; + overflow: hidden; + padding: 2%; + margin: -10% 0 0 -35%; + position: absolute; + width: 70%; + + border-radius: 0.5em; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; +} + +#error h1 { + font-size: 3em; + line-height: normal; + margin: 0; + padding: 0; +} + +#error p { + font-size: 1.2em; + line-height: 1.6em; + margin: 1em 0 0.5em; + padding: 0; +} + + +/* @control searchbar */ +#head #searchbar { + float: right; + margin: 1em 0 0 0; + padding: 0; + overflow: hidden; +} + + #head #searchbar #searchbar-fauxtext { + background: #fff; + border: 1px solid #d4d4d4; + overflow: hidden; + + border-radius: 0.3em; + -moz-border-radius: 0.3em; + -webkit-border-radius: 0.3em; + } + + #head #searchbar #searchbar-fauxtext input#search-query { + border: 0; + color: #000; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 1.2em; + line-height: 1.6em; + padding: 0.4em 0.6em; + } + + #head #searchbar #searchbar-fauxtext input#search-query.ph { + color: #999; + } + + #head #searchbar #searchbar-fauxtext #search-submit { + border: 0; + border-left: 1px solid #d4d4d4; + cursor: pointer; + margin: 0 !important; + padding: 0; + float: right; + font-size: 1.2em; + + border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + -webkit-border-radius: 0 3px 3px 0; + } + + #head #searchbar #searchbar-fauxtext #search-submit span { + background-image: url(/images/icon-sprite.png); + background-position: -431px -1px; + background-repeat: no-repeat; + display: block; + height: 25px; + overflow: hidden; + text-indent: -5000px; + width: 28px; + } + + #head #searchbar #searchbar-fauxtext #search-submit:hover span { + background-position: -431px -28px; + padding: 0; + } + + +#MathJax_Message { + display: none; } \ No newline at end of file diff --git a/lib/gollum/frontend/public/images/icon-sprite.png b/lib/gollum/frontend/public/images/icon-sprite.png index bc00ae8e..83e8c6fd 100644 Binary files a/lib/gollum/frontend/public/images/icon-sprite.png and b/lib/gollum/frontend/public/images/icon-sprite.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/MathJax.js b/lib/gollum/frontend/public/javascript/MathJax/MathJax.js new file mode 100644 index 00000000..87c3e9ed --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/MathJax.js @@ -0,0 +1,43 @@ +/************************************************************* + * + * MathJax.js + * + * The main code for the MathJax math-typesetting library. See + * http://www.mathjax.org/ for details. + * + * --------------------------------------------------------------------- + * + * Copyright (c) 2009-2010 Design Science, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +if (!window.MathJax) {window.MathJax = {}} + +MathJax.Unpack = function (data) { + var k, d, n, m, i; + for (k = 0, m = data.length; k < m; k++) { + d = data[k]; + for (i = 0, n = d.length; i < n; i++) + {if (typeof(d[i]) == 'number') {d[i] = d[d[i]]}} + data[k] = d.join(''); + } + eval(data.join('')); +}; +MathJax.isPacked = true; + +MathJax.Unpack([ + ['if(','document.','getElementById','&&',1,'childNodes&&',1,'createElement','){','if(!','window.MathJax','){',10,'={}}',9,'MathJax.Hub','){MathJax.version="1.0.1";(','function(','d){','var b=','window[d];if(!','b){b','=window[d]={}}var ','f','=[];','var c=',17,'g','){var h=','g.','constructor',';if(!','h){h=','new Function','("")}','for(var ','i in g){if(i!=="',30,'"&&g','.hasOwnProperty','(i)){h[i]=g[i]}}','return ','h};var a=','function(){',41,33,'("',41,'arguments','.callee','.Init','.call(this,',48,')")};var e=a();e','.prototype','={bug_test:1};',9,'e',54,'.bug_test){a=',43,41,43,41,48,49,50,51,48,')}}}b.','Object','=c({',30,':a(),Subclass:',17,'g,i',28,'a();h.SUPER=this;h',50,'=this',50,';h','.Subclass','=this',82,';h.Augment=this.Augment;h.','protoFunction','=this.',86,';h.can=this.can;h.has=this.has;h.isa=this.isa;h',54,'=new this(f);h',54,'.',30,'=h;h.Augment(g,i);',41,'h},Init:',17,'g',28,'this;if(g','.length===','1&&g[0]===f','){return ','h}if(!(h ','instanceof ','g',49,')){h=new g',49,'(f)}',41,'h',50,'.apply(','h,g)||h},Augment:',17,'g,h){var i;if(g','!=null){for(i in ','g){if(g',39,'(i)){this','.',86,'(i,g[i','])}}if(g.toString!==this.prototype.toString&&g.toString!=={}.toString){this.protoFunction("toString",g.toString)}}','if(h',119,'h){if(','h',39,122,'[i]=h[i]}}}',41,'this},',86,':',17,'h,g){this',54,'[h]=g;','if(typeof',' g','==="function"){','g.SUPER=this.SUPER',54,'}},prototype:{Init',':function(){},','SUPER:',17,'g',104,'g',49,'.SUPER},can:',17,'g',104,'typeof(this[g','])==="function"},has:',17,'g',104,159,'])!=="undefined','"},isa:',17,'g){return(g ',106,70,')&&(this ',106,'g)}},can:',17,'g',104,'this',54,'.can',51,'g)},has:',17,'g',104,'this',54,'.has',51,'g)},isa:',17,'h){var g=this;while(',120,'===h',104,'true}else{g=g.SUPER}}',41,'false},SimpleSUPER:c({',30,':',17,'g',104,'this.SimpleSUPER.define(g)},define:',17,'g){var i={};if(g!=null){',35,'h in ',120,39,'(h)){this.',86,'(h,g[h',126,41,'i},wrap:',17,'i,h){',142,'(h',')==="function"&&','h','.toString','().match(/\\.\\s*SUPER\\s*\\(/)){var g=',33,'(this.wrapper);g.label=i;g','.original','=h;h=g;g',222,'=this.stringify}',41,'h},wrapper:',43,'var h=',48,49,';this.SUPER=h.SUPER[h.label];try{var g=h',226,'.apply(this',',',48,')}catch(i){','delete this.','SUPER;','throw i}',242,243,41,'g}.','toString().replace','(/^\\s*function \\(\\)\\s*\\{\\s*/i,"").replace(/\\s*\\}\\s*$/i,""),toString:',43,41,'this',226,222,238,226,',',48,')}})})})("MathJax");(',17,'BASENAME){var ','BASE=window[BASENAME','];',9,'BASE){',263,']={}}var ','CALLBACK','=',17,'data){var cb=',33,'("',41,48,49,'.execute',115,48,49,',',48,')");',35,'id in ','CALLBACK.prototype','){if(',287,39,'(id)){',142,'(data[id',165,'"){cb[id]=data[id]}else{cb[id]=',287,'[id]}}}cb',222,'=',287,222,';',41,'cb};',287,'={isCallback:true,hook',148,'data:[],object:window,execute:',43,9,'this.called||this.autoReset){this.called=!this.autoReset;',41,'this.hook',238,'.object,this','.data.concat([].slice.call(',48,',0)))}},reset:',43,242,'called},toString:',43,41,313,222,238,'.hook,',48,')}};var ISCALLBACK=',17,'f){return(typeof(f',220,'f.isCallback)};var EVAL=',17,'code',104,'eval.call(window,code)};EVAL("var __TeSt_VaR__ = 1','");if(','window.__TeSt_VaR__','){delete ',339,'}else{if(','window.execScript','){EVAL=',17,'code){BASE.__code=code;code="try {"+BASENAME+".__result = eval("+BASENAME+".__code)} catch(err) {"+BASENAME+".__result = err}";',343,'(code',');var result=BASE.__result;delete BASE.__result;delete BASE.__code;if(result instanceof Error){throw result}return result','}}else{EVAL=',17,346,'var head=(',1,'getElementsByTagName("head"))[0];if(!','head){head=',1,'body}var script=',1,7,'("script");','script','.appendChild(',1,'createTextNode','(code));head',363,'script);','head.removeChild(','script',349,'}}}var USING=',17,'args,i','){if(',48,'.length','>1){if(',48,102,'2&&!(typeof ',48,'[0]==="function")&&',48,'[0] ',106,'Object&&typeof ',48,'[1]==="number"){','args=[].slice.call(',374,')}else{',390,48,',0)}}if(args ',106,'Array&&args',102,'1){args=args[0]}',142,' args',144,'if(args',278,'===',287,278,104,'args}',41,269,'({hook:args})}else{if(args ',106,'Array){',142,'(args[0])==="string"&&args[1] ',106,387,'args[1][args[0]]==="','function"){return CALLBACK({hook:args[','1][args[0]],object:args[1','],data:args.slice(','2)})}else{',142,' args[0]==="',420,'0',422,'1)})}else{',142,' args[1]==="',420,'1],object:args[0',422,'2)})}}}}else{',142,'(args)==="','string"){',41,269,'({hook:EVAL,data:[args]})}else{if(args ',106,70,104,269,'(args',392,142,437,'undefined"){',41,269,'({})}}}}}','throw Error("Can\'t ','make ','callback',' from given data")};var DELAY=',17,'time,',456,'){callback=USING(callback);',456,'.timeout=','setTimeout(',456,',time);','return callback','};var WAITFOR=',17,456,',signal',461,9,456,'.called){','WAITSIGNAL(',456,471,');signal.pending++}};var WAITEXECUTE=',43,'var ','signals','=this','.signal',';',242,'signal;this',278,'=this.','oldExecute;',242,490,'var result=','this',278,238,',',48,');','if(ISCALLBACK(result)&&!result.called){',476,'result,',482,392,'for(var i=0,m=',482,'.length;if){f=',1,927,377,'}',9,'h){h=(',1,355,32,1,'body}}',41,'h};var e',24,19,43,35,'j=0,h=e',377,';j=',1030,'){h(','this.STATUS.ERROR',');',41,'1}',41,'0},file:',17,'i,',129,'h<0){',953,1020,'(i',392,953,'loadComplete','(i)}},execute:',43,313,737,315,',this.data[0],this.data[1])},',1074,':',17,'h,i,j){if(h.time(j)){return}if(',1,927,377,'>i&&',1,927,'[i].cssRules','&&',1,927,1133,377,'){j(h',1067,464,'h,h.delay',')}},checkLength:',17,'h,k,m){if(h.time(m)){return}var l=0;var i=(k.sheet||k.styleSheet);try{if((i.cssRules||i.rules||[]).length>0){l=1}}catch(j){','if(j.message.match(/','protected variable|restricted URI/)){l=1}else{',1146,'Security error/)){l=1}}}if(l){',464,1018,'([m,h.STATUS.OK]),0',392,464,1142,708,1116,':',17,32,999,'h);var i=',976,'[h];if(','i){a.Message.Clear(i.',775,'clearTimeout(',1093,');if(i.script){if(e',102,'0){',464,'b,0)}e',549,'i.script)}this.loaded[h]=i.status;delete ',976,1164,1003,'h]){',1018,'.Queue([a',913,',',1003,'h],i.status],[a',913,',i.',600,',i.status',552,'a',913,'(i.',600,1189,708,1020,':',17,129,976,'[h].timeout','){',1167,976,1202,')}',976,'[h].status=',1101,';this.loadError(h);this.',1116,'(h)},loadError:',17,'h){a.Message.Set("File failed to load: "+h,null,2000)},Styles:',17,'j,k',28,'this.StyleString(','j);if(h===""){k',962,'k);k()}else{var i=',1,7,'("style");',1041,982,1033,363,1060,'i',1063,'i',1065,'.styleSheet.cssText=h}else{i',363,1,365,'(h))}k=this.timer.create',51,'k,i)}',41,'k},StyleString:',17,'m){',142,'(m)==="',438,41,'m}var j="",n,l;for(n in m){if(m',39,'(n)){',142,' m[n]==="',438,'j+=n+" {"+','m[n]+"}\\n"}else{if(m[n] ',106,414,35,'k=0;k1?d[1]:""));g=null}if(f&&(!b.',190,'||d)){c',54,'=c',54,552,533,',(f',14,'>1?f[1]:""))}if(g&&!g',54,'.match(/\\S/)){','g=g',515,'}}if(b.',195,'&&g&&g.className==b.',195,'){try{g.innerHTML=""}catch(e){}g.style.display="none"}',310,'a.',152,512,'=1}},',435,3,'(h,b,d){if(',386,'){',1,354,'q,o=',152,327,';var p=',224,205,',c=',224,207,';try{if(!b){b=','new Date().getTime','()}var j=0,l,f;while(jthis.',213,'&&j=0;g--){if(f[g].src.match(e)){n.script=f[g].innerHTML;m.root=f[g].src',552,'(/(^|\\/)[^\\/]*$/,"");break}}b.Ajax.config=m;var j={isMac',':(navigator.platform.substr(0,3)==="','Mac"),isPC',1353,'Win"),isMSIE:(',709,'all!=null&&!','window.opera','),isFirefox:(',709,'ATTRIBUTE_NODE!=null&&window.directories!=null),isSafari',':(navigator.vendor!=null&&navigator.vendor.match(/','Apple/)!=null&&!navigator.omniWebString),isOpera:(',1359,'!=null&&',1359,'.version!=null),isChrome',1363,'Google/)!=null),isKonqueror:(window',734,'&&window',734,'("konqueror")),versionAtLeast',3,'(r){var q=(this','.version).split','(".");r=(','new String','(r)).split(".");',168,'s=0,p=r',14,';s=parseInt(r[s])}}',1,'true},Select',3,'(p',1029,'p[d.Browser];if(i){',1,'i(d.Browser)}',1,'null}};var a=navigator.userAgent',552,'(/^Mozilla\\/(\\d+\\.)+\\d+ /,"").replace(/[a-z][-a-z0-9._: ]+\\/\\d+[^ ]*-[^ ]*\\.([a-z][a-z])?\\d+ /i,"").replace(/Gentoo |Ubuntu\\/(\\d+\\.)*\\d+ (\\([^)]*\\) )?/,"");d.Browser=d',221,'d',221,1379,'("Unknown"),{version:"0.0"}),j);',168,'h in j){if(j',734,'(h)){if(j[h]&&h',158,'2)==="is"){h=h.slice(2);if(h==="Mac"||h==="PC"){continue}d.Browser=d',221,1379,'(h),j);var o',526,'(".*(Version',')/((?:\\\\d+\\\\.)+\\\\d','+)|.*("+h+")"+(h=="MSIE"?" ":"/")+"((?:\\\\d+\\\\.)*\\\\d+)|(?:^|\\\\(| )([a-z][-a-z0-9._: ]+|WebKit',1415,'+)");var c=o.exec(a)||["","","","unknown","0.0"];d.Browser.name=(c[1]=="Version"?h:(c[3]||c[5]));d.Browser.version=c[2]||c[4]||c[6];break}}}','d.Browser.Select','({Safari',3,'(p',1029,'parseInt((String(p',1377,'("."))[0]);if(i>=526){','p.version="','4.0','"}else{if(i','>=525){',1427,'3.1',1429,'>500){',1427,'3.0',1429,'>400){',1427,'2.0',1429,'>85){',1427,'1.0"}}}}}},Firefox',3,'(p){if(p.version==="0.0"&&navigator.product==="Gecko"&&','navigator.productSub',1029,1447,158,'8);if(i>="20090630"){',1427,'3.5',1429,'>="20080617"){',1427,'3.0',1429,'>="20061024"){',1427,'2.0"}}}}},Opera',3,'(i){i.version=opera.version()}});',1419,'(',152,678,'browsers);d.queue=b.Callback.Queue();d.queue.Push(["','Post",n.signal,"','Begin',382,218,'",n],["',846,1473,877,1473,'Jax',1473,913,'",n],n.onLoad(),',938,152,'isReady=true},["',347,1473,1469,'End"])})("MathJax")}};'] +]); + diff --git a/lib/gollum/frontend/public/javascript/MathJax/config/MMLorHTML.js b/lib/gollum/frontend/public/javascript/MathJax/config/MMLorHTML.js new file mode 100644 index 00000000..90dcb4d2 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/config/MMLorHTML.js @@ -0,0 +1,18 @@ +/* + * ../SourceForge/trunk/mathjax/config/MMLorHTML.js + * + * Copyright (c) 2010 Design Science, Inc. + * + * Part of the MathJax library. + * See http://www.mathjax.org for details. + * + * Licensed under the Apache License, Version 2.0; + * you may not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +MathJax.Unpack([ + ['(function(c){var i="1.0";var g=','MathJax.Hub','.Insert({prefer:{MSIE:"MML",Firefox:"MML",Opera:"HTML",other:"HTML"}},(',1,'.config.MMLorHTML||{}));var e={Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4};var h=(c','.Browser','.version==="0.0"||','c.Browser.versionAtLeast','(e[c',5,']||0));var b;try{new ActiveXObject("MathPlayer.Factory.1");b=true}catch(d){b=false}var f=(c',5,'.isFirefox&&',7,'("1.5"))||(c',5,'.isMSIE&&b)||(c',5,'.isOpera&&',7,'("9.52"));var a=(g.prefer&&typeof(g.prefer)==="object"?g.prefer[',1,5,']||g.prefer.other||"HTML":g.prefer);if(h||f){if(f&&(a==="MML"||!h)){','c.config.jax.unshift("output/','NativeMML")}else{',24,'HTML-CSS")}}else{c.PreProcess','.disabled=true;','c.prepareScripts',28,'MathJax.Message.Set("Your browser does not support MathJax",null,4000);c.Startup.signal.Post("MathJax not supported")}})(',1,');MathJax.Ajax.loadComplete("[MathJax]/config/MMLorHTML.js");'] +]); + diff --git a/lib/gollum/frontend/public/javascript/MathJax/config/MathJax.js b/lib/gollum/frontend/public/javascript/MathJax/config/MathJax.js new file mode 100644 index 00000000..f3327a61 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/config/MathJax.js @@ -0,0 +1,590 @@ +/************************************************************* + * + * MathJax/config/MathJax.js + * + * This configuration file is loaded when there is no explicit + * configuration script in the + // + // would display "[math]" in place of the math until MathJax is able to typeset it. + // + preRemoveClass: "MathJax_Preview", + + // + // This value controls whether the "Processing Math: nn%" message are displayed + // in the lower left-hand corner. Set to "false" to prevent those messages (though + // file loading and other messages will still be shown). + // + showProcessingMessages: true, + + // + // This value controls the verbosity of the messages in the lower left-hand corner. + // Set it to "none" to eliminate all messages, or set it to "simple" to show + // "Loading..." and "Processing..." rather than showing the full file name and the + // percentage of the mathematics processed. + // + messageStyle: "normal", + + // + // These two parameters control the alignment and shifting of displayed equations. + // The first can be "left", "center", or "right", and determines the alignment of + // displayed equations. When the alignment is not "center", the second determines + // an indentation from the left or right side for the displayed equations. + // + displayAlign: "center", + displayIndent: "0em", + + // + // Normally MathJax will perform its starup commands (loading of + // configuration, styles, jax, and so on) as soon as it can. If you + // expect to be doing additional configuration on the page, however, you + // may want to have it wait until the page's onload hander is called. If so, + // set this to "onload". + // + delayStartupUntil: "none", + + // + // Normally MathJax will typeset the mathematics on the page as soon as + // the page is loaded. If you want to delay that process, in which case + // you will need to call MathJax.Hub.Typeset() yourself by hand, set + // this value to true. + // + skipStartupTypeset: false, + + //============================================================================ + // + // These parameters control the tex2jax preprocessor (when you have included + // "tex2jax.js" in the extensions list above). + // + tex2jax: { + + // + // The Id of the element to be processed (defaults to full document) + // + element: null, + + // + // The delimiters that surround in-line math expressions. The first in each + // pair is the initial delimiter and the second is the terminal delimiter. + // Comment out any that you don't want, but be sure there is no extra + // comma at the end of the last item in the list -- some browsers won't + // be able to handle that. + // + inlineMath: [ +// ['$','$'], // uncomment this for standard TeX math delimiters + ['\\(','\\)'] + ], + + // + // The delimiters that surround displayed math expressions. The first in each + // pair is the initial delimiter and the second is the terminal delimiter. + // Comment out any that you don't want, but be sure there is no extra + // comma at the end of the last item in the list -- some browsers won't + // be able to handle that. + // + displayMath: [ + ['$$','$$'], + ['\\[','\\]'] + ], + + // + // This array lists the names of the tags whose contents should not be + // processed by tex2jax (other than to look for ignore/process classes + // as listed below). You can add to (or remove from) this list to prevent + // MathJax from processing mathematics in specific contexts. + // + skipTags: ["script","noscript","style","textarea","pre","code"], + + // + // This is the class name used to mark elements whose contents should + // not be processed by tex2jax (other than to look for the + // processClass pattern below). Note that this is a regular + // expression, and so you need to be sure to quote any regexp special + // characters. The pattern is automatically preceeded by '(^| )(' and + // followed by ')( |$)', so your pattern will have to match full words + // in the class name. Assigning an element this class name will + // prevent `tex2jax` from processing its contents. + // + ignoreClass: "tex2jax_ignore", + + // + // This is the class name used to mark elements whose contents SHOULD + // be processed by tex2jax. This is used to turn on processing within + // tags that have been marked as ignored or skipped above. Note that + // this is a regular expression, and so you need to be sure to quote + // any regexp special characters. The pattern is automatically + // preceeded by '(^| )(' and followed by ')( |$)', so your pattern + // will have to match full words in the class name. Use this to + // restart processing within an element that has been marked as + // ignored above. + // + processClass: "tex2jax_process", + + // + // Set to "true" to allow \$ to produce a dollar without starting in-line + // math mode. If you uncomment the ['$','$'] line above, you should change + // this to true so that you can insert plain dollar signs into your documents + // + processEscapes: false, + + // + // Controls whether tex2jax processes LaTeX environments outside of math + // mode. Set to "false" to prevent processing of environments except within + // math mode. + // + processEnvironments: true, + + // + // Controls whether tex2jax inserts MathJax_Preview spans to make a + // preview available, and what preview to use, when it locates in-line + // and display mathetics on the page. The default is "TeX", which + // means use the TeX code as the preview (until it is processed by + // MathJax). Set to "none" to prevent the previews from being + // inserted (the math will simply disappear until it is typeset). Set + // to an array containing the description of an HTML snippet in order + // to use the same preview for all equations on the page (e.g., you + // could have it say "[math]" or load an image). + // + // E.g., preview: ["[math]"], + // or preview: [["img",{src: "http://myserver.com/images/mypic.jpg"}]] + // + preview: "TeX" + + }, + + //============================================================================ + // + // These parameters control the mml2jax preprocessor (when you have included + // "mml2jax.js" in the extensions list above). + // + mml2jax: { + + // + // The Id of the element to be processed (defaults to full document) + // + element: null, + + // + // Controls whether mml2jax inserts MathJax_Preview spans to make a + // preview available, and what preview to use, whrn it locates + // mathematics on the page. The default is "alttext", which means use + // the tag's alttext attribute as the preview (until it is + // processed by MathJax), if the tag has one. Set to "none" to + // prevent the previews from being inserted (the math will simply + // disappear until it is typeset). Set to an array containing the + // description of an HTML snippet in order to use the same preview for + // all equations on the page (e.g., you could have it say "[math]" or + // load an image). + // + // E.g., preview: ["[math]"], + // or preview: [["img",{src: "http://myserver.com/images/mypic.jpg"}]] + // + preview: "alttext" + + }, + + //============================================================================ + // + // These parameters control the jsMath2jax preprocessor (when you have included + // "jsMath2jax.js" in the extensions list above). + // + jsMath2jax: { + + // + // The Id of the element to be processed (defaults to full document) + // + element: null, + + // + // Controls whether jsMath2jax inserts MathJax_Preview spans to make a + // preview available, and what preview to use, when it locates + // mathematics on the page. The default is "TeX", which means use the + // TeX code as the preview (until it is processed by MathJax). Set to + // "none" to prevent the previews from being inserted (the math will + // simply disappear until it is typeset). Set to an array containing + // the description of an HTML snippet in order to use the same preview + // for all equations on the page (e.g., you could have it say "[math]" + // or load an image). + // + // E.g., preview: ["[math]"], + // or preview: [["img",{src: "http://myserver.com/images/mypic.jpg"}]] + // + preview: "TeX" + + }, + + //============================================================================ + // + // These parameters control the TeX input jax. + // + TeX: { + + // + // This specifies the side on which \tag{} macros will place the tags. + // Set to "left" to place on the left-hand side. + // + TagSide: "right", + + // + // This is the amound of indentation (from right or left) for the tags. + // + TagIndent: ".8em", + + // + // This is the width to use for the multline environment + // + MultLineWidth: "85%", + + // + // List of macros to define. These are of the form + // name: value + // where 'value' is the replacement text for the macro \name. + // The 'value' can also be [value,n] where 'value' is the replacement + // text and 'n' is the number of parameters for the macro. + // Note that backslashes must be doubled in the replacement string. + // + // E.g., + // + // Macros: { + // RR: '{\\bf R}', + // bold: ['{\\bf #1}', 1] + // } + // + Macros: {} + + }, + + //============================================================================ + // + // These parameters control the MathML inupt jax. + // + MathML: { + // + // This specifies whether to use TeX spacing or MathML spacing when the + // HTML-CSS output jax is used. + // + useMathMLspacing: false + }, + + //============================================================================ + // + // These parameters control the HTML-CSS output jax. + // + "HTML-CSS": { + + // + // This controls the global scaling of mathematics as compared to the + // surrounding text. Values between 100 and 133 are usually good choices. + // + scale: 100, + + // + // This is a list of the fonts to look for on a user's computer in + // preference to using MathJax's web-based fonts. These must + // correspond to directories available in the jax/output/HTML-CSS/fonts + // directory, where MathJax stores data about the characters available + // in the fonts. Set this to ["TeX"], for example, to prevent the + // use of the STIX fonts, or set it to an empty list, [], if + // you want to force MathJax to use web-based or image fonts. + // + availableFonts: ["STIX","TeX"], + + // + // This is the preferred font to use when more than one of those + // listed above is available. + // + preferredFont: "TeX", + + // + // This is the web-based font to use when none of the fonts listed + // above are available on the user's computer. Note that currently + // only the TeX font is available in a web-based form. Set this to + // + // webFont: null, + // + // if you want to prevent the use of web-based fonts. + // + webFont: "TeX", + + // + // This is the font to use for image fallback mode (when none of the + // fonts listed above are available and the browser doesn't support + // web-fonts via the @font-face CSS directive). Note that currently + // only the TeX font is available as an image font. Set this to + // + // imageFont: null, + // + // if you want to prevent the use of image fonts (e.g., you have not + // installed the image fonts on your server). In this case, only + // browsers that support web-based fonts will be able to view your pages + // without having the fonts installed on the client computer. The browsers + // that support web-based fonts include: IE6 and later, Chrome, Safari3.1 + // and above, Firefox3.5 and later, and Opera10 and later. Note that + // Firefox3.0 is NOT on this list, so without image fonts, FF3.0 users + // will be required to to download and install either the STIX fonts or the + // MathJax TeX fonts. + // + imageFont: "TeX", + + // + // This controls whether the MathJax contextual menu will be available + // on the mathematics in the page. If true, then right-clicking (on + // the PC) or control-clicking (on the Mac) will produce a MathJax + // menu that allows you to get the source of the mathematics in + // various formats, change the size of the mathematics relative to the + // surrounding text, and get information about MathJax. + // + // Set this to false to disable the menu. When true, the MathMenu + // items below configure the actions of the menu. + // + showMathMenu: true, + + // + // This allows you to define or modify the styles used to display + // various math elements created by MathJax. + // + // Example: + // styles: { + // ".MathJax_Preview": { + // "font-size": "80%", // preview uses a smaller font + // color: "red" // and is in red + // } + // } + // + styles: {}, + + // + // Configuration for tooltips + // (see also the #MathJax_Tooltip CSS in MathJax/jax/output/HTML-CSS/config.js, + // which can be overriden using the styles values above). + // + tooltip: { + delayPost: 600, // milliseconds delay before tooltip is posted after mouseover + delayClear: 600, // milliseconds delay before tooltip is cleared after mouseout + offsetX: 10, offsetY: 5 // pixels to offset tooltip from mouse position + } + }, + + //============================================================================ + // + // These parameters control the NativeMML output jax. + // + NativeMML: { + + // + // This controls the global scaling of mathematics as compared to the + // surrounding text. Values between 100 and 133 are usually good choices. + // + scale: 100, + + // + // This controls whether the MathJax contextual menu will be available + // on the mathematics in the page. If true, then right-clicking (on + // the PC) or control-clicking (on the Mac) will produce a MathJax + // menu that allows you to get the source of the mathematics in + // various formats, change the size of the mathematics relative to the + // surrounding text, and get information about MathJax. + // + // Set this to false to disable the menu. When true, the MathMenu + // items below configure the actions of the menu. + // + // There is a separate setting for MSIE, since the code to handle that + // is a bit delicate; if it turns out to have unexpected consequences, + // you can turn it off without turing off other browser support. + // + showMathMenu: true, + showMathMenuMSIE: true, + + // + // This allows you to define or modify the styles used to display + // various math elements created by MathJax. + // + // Example: + // styles: { + // ".MathJax_MathML": { + // color: "red" // MathML is in red + // } + // } + // + styles: {} + }, + + //============================================================================ + // + // These parameters control the contextual menus that are available on the + // mathematics within the page (provided the showMathMenu value is true above). + // + MathMenu: { + // + // This is the hover delay for the display of submenus in the + // contextual menu. When the mouse is still over a submenu label for + // this long, the menu will appear. (The menu also will appear if you + // click on the label.) It is in milliseconds. + // + delay: 400, + + // + // This is the URL for the MathJax Help menu item. + // + helpURL: "http://www.mathjax.org/help/user/", + + // + // These control whether the "Math Renderer", "Font Preferences", + // and "Contextual Menu" submenus will be displayed or not. + // + showRenderer: true, + showFontMenu: false, + showContext: false, + + // + // These are the settings for the Show Source window. The initial + // width and height will be reset after the source is shown in an + // attempt to make the window fit the output better. + // + windowSettings: { + status: "no", toolbar: "no", locationbar: "no", menubar: "no", + directories: "no", personalbar: "no", resizable: "yes", scrollbars: "yes", + width: 100, height: 50 + }, + + // + // This allows you to change the CSS that controls the menu + // appearance. See the extensions/MathMenu.js file for details + // of the default settings. + // + styles: {} + + }, + + //============================================================================ + // + // These parameters control the MMLorHTML configuration file. + // NOTE: if you add MMLorHTML.js to the config array above, + // you must REMOVE the output jax from the jax array. + // + MMLorHTML: { + // + // The output jax that is to be preferred when both are possible + // (set to "MML" for native MathML, "HTML" for MathJax's HTML-CSS output jax). + // + prefer: { + MSIE: "MML", + Firefox: "MML", + Opera: "HTML", + other: "HTML" + } + } +}); + +MathJax.Ajax.loadComplete("[MathJax]/config/MathJax.js"); diff --git a/lib/gollum/frontend/public/javascript/MathJax/config/local/local.js b/lib/gollum/frontend/public/javascript/MathJax/config/local/local.js new file mode 100644 index 00000000..7bf733cb --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/config/local/local.js @@ -0,0 +1,37 @@ +/************************************************************* + * + * MathJax/config/local/local.js + * + * Include changes and configuration local to your installation + * in this file. For example, common macros can be defined here + * (see below). To use this file, add "local/local.js" to the + * config array in MathJax.js or your MathJax.Hub.Config() call. + * + * --------------------------------------------------------------------- + * + * Copyright (c) 2009 Design Science, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { + var TEX = MathJax.InputJax.TeX; + + // place macros here. E.g.: + // TEX.Macro("R","{\\bf R}"); + // TEX.Macro("op","\\mathop{\\rm #1}",1); // a macro with 1 parameter + +}); + +MathJax.Ajax.loadComplete("[MathJax]/config/local/local.js"); diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.buildinfo b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.buildinfo new file mode 100644 index 00000000..16fe5e99 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: fedf9ba9a5b2ef65b82b1fa1eea24e52 +tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/CSS-styles.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/CSS-styles.doctree new file mode 100644 index 00000000..e75e38e4 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/CSS-styles.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/HTML-snippets.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/HTML-snippets.doctree new file mode 100644 index 00000000..5c0215a8 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/HTML-snippets.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/ajax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/ajax.doctree new file mode 100644 index 00000000..a0742da6 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/ajax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/callback.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/callback.doctree new file mode 100644 index 00000000..30ab6dda Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/callback.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/elementjax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/elementjax.doctree new file mode 100644 index 00000000..d0e18200 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/elementjax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/html.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/html.doctree new file mode 100644 index 00000000..ad0c7791 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/html.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/hub.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/hub.doctree new file mode 100644 index 00000000..a21a592c Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/hub.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/index.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/index.doctree new file mode 100644 index 00000000..5c247f75 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/index.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/inputjax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/inputjax.doctree new file mode 100644 index 00000000..cea69644 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/inputjax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/jax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/jax.doctree new file mode 100644 index 00000000..d380eda8 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/jax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/message.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/message.doctree new file mode 100644 index 00000000..3c35445b Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/message.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/object.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/object.doctree new file mode 100644 index 00000000..8da7a6c3 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/object.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/outputjax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/outputjax.doctree new file mode 100644 index 00000000..a35b93c0 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/outputjax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/queue.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/queue.doctree new file mode 100644 index 00000000..0e18b82e Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/queue.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/signal.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/signal.doctree new file mode 100644 index 00000000..1ab8dbea Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/signal.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/variable.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/variable.doctree new file mode 100644 index 00000000..d1085fbb Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/api/variable.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/callbacks.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/callbacks.doctree new file mode 100644 index 00000000..a1c1df2c Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/callbacks.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/community.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/community.doctree new file mode 100644 index 00000000..ddfdcb67 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/community.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/configuration.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/configuration.doctree new file mode 100644 index 00000000..deadf324 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/configuration.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/dynamic.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/dynamic.doctree new file mode 100644 index 00000000..feeaa3b7 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/dynamic.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/environment.pickle b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/environment.pickle new file mode 100644 index 00000000..675ba4c4 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/environment.pickle differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/glossary.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/glossary.doctree new file mode 100644 index 00000000..97ecbb49 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/glossary.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/index.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/index.doctree new file mode 100644 index 00000000..d0f36ad4 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/index.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/installation.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/installation.doctree new file mode 100644 index 00000000..a1b8b330 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/installation.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/jsMath.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/jsMath.doctree new file mode 100644 index 00000000..54abdc4d Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/jsMath.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/mathjax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/mathjax.doctree new file mode 100644 index 00000000..d3934284 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/mathjax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/mathml.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/mathml.doctree new file mode 100644 index 00000000..21519a9e Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/mathml.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/model.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/model.doctree new file mode 100644 index 00000000..e8993225 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/model.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/FontWarnings.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/FontWarnings.doctree new file mode 100644 index 00000000..c215cf9b Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/FontWarnings.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/HTML-CSS.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/HTML-CSS.doctree new file mode 100644 index 00000000..6f1ce0e2 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/HTML-CSS.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MMLorHTML.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MMLorHTML.doctree new file mode 100644 index 00000000..c464a9e2 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MMLorHTML.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathML.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathML.doctree new file mode 100644 index 00000000..54bc3486 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathML.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathMenu.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathMenu.doctree new file mode 100644 index 00000000..8da7c6aa Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathMenu.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathZoom.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathZoom.doctree new file mode 100644 index 00000000..fab47063 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/MathZoom.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/NativeMML.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/NativeMML.doctree new file mode 100644 index 00000000..6c4222ca Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/NativeMML.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/TeX.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/TeX.doctree new file mode 100644 index 00000000..5731cb6d Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/TeX.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/hub.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/hub.doctree new file mode 100644 index 00000000..db4a7795 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/hub.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/jsMath2jax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/jsMath2jax.doctree new file mode 100644 index 00000000..c1b6c2b5 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/jsMath2jax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/mml2jax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/mml2jax.doctree new file mode 100644 index 00000000..7a89e23e Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/mml2jax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/tex2jax.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/tex2jax.doctree new file mode 100644 index 00000000..6735bfbb Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/options/tex2jax.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/output.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/output.doctree new file mode 100644 index 00000000..6c3d3b4c Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/output.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/index.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/index.doctree new file mode 100644 index 00000000..988a2058 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/index.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/movable-type.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/movable-type.doctree new file mode 100644 index 00000000..7aefc1a6 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/movable-type.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/wordpress.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/wordpress.doctree new file mode 100644 index 00000000..772d6797 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/platforms/wordpress.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/queues.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/queues.doctree new file mode 100644 index 00000000..1e263eae Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/queues.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/signals.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/signals.doctree new file mode 100644 index 00000000..befa9df3 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/signals.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/start.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/start.doctree new file mode 100644 index 00000000..65c02752 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/start.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/startup.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/startup.doctree new file mode 100644 index 00000000..e1962420 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/startup.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/synchronize.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/synchronize.doctree new file mode 100644 index 00000000..1b5a3c27 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/synchronize.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/tex.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/tex.doctree new file mode 100644 index 00000000..92f08a12 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/tex.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/typeset.doctree b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/typeset.doctree new file mode 100644 index 00000000..637ae265 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/.doctrees/typeset.doctree differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/CSS-styles.html b/lib/gollum/frontend/public/javascript/MathJax/docs/html/CSS-styles.html new file mode 100644 index 00000000..cdaa4357 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/CSS-styles.html @@ -0,0 +1,173 @@ + + + + + + + + CSS Style Objects — MathJax v1.0 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

CSS Style Objects

+

Many MathJax components allow you to specify CSS styles that control +the look of the elements they create. These are described using CSS +style objects, which are JavaScript objects that represent standard +CSS declarations. The main CSS style object is a collection of +name:value pairs where the name is the CSS selector that is being +defined, and the value is an object that gives the style for that +selector. Most often, the selector will need to be enclosed in +quotation marks, as it will contain special characters, so you would +need to use "#myID" rather than just #myID and "ul li" +rather than just ul li.

+

The value used to define the CSS style can either be a string +containing the CSS definition, or a javascript object that is itself a +collection of name:value pairs, where the name is the attribute +being defined and value is the value that attibute should be given. +Note that, since this is a JavaScript object, the pairs are separated +by commas (not semi-colons) and the values are enclosed in quotation +marks. If the name contains dashes, it should be enclosed in +quotation marks as well.

+

For example, jax/output/HTML-CSS/config.js includes the following +declaration:

+
styles: {
+
+  ".MathJax .merror": {
+    "background-color": "#FFFF88",
+    color:   "#CC0000",
+    border:  "1px solid #CC0000",
+    padding: "1px 3px",
+    "font-family": "serif",
+    "font-style": "normal",
+    "font-size":  "90%"
+  },
+
+  ".MathJax_Preview": {color: "#888888"},
+
+}
+
+
+

This defines two CSS styles, one for the selector .MathJax +.merror, which specifies a background color, foreground color, +border, and so on, and a second for .MathJax_Preview that sets its +color.

+

You can add as many such definitions to a styles object as you +wish. Note, however, that since this is a JavaScript object, the +selectors must be unique (e.g., you can’t use two definitions for +"img", for example, as only the last one would be saved). If you +need to use more than one entry for a single selector, you can add +comments like /* 1 */ and /* 2 */ to the selector to make them +unique.

+

It is possible to include selectors like "@media print", in which +case the value is a CSS style object. For example:

+
styles: {
+  "@media print": {
+    ".MathJax .merror": {
+       "background-color": "white",
+       border: 0
+    }
+  }
+}
+
+
+

The various extensions and output processors include more examples of +CSS style objects, so see the code for those files for additional +samples. In particular, the extensions/MathMenu.js, +extensions/MathZoom.js, extensions/FontWarnsing.js, and +jax/output/HTML-CSS/jax.js files include such definitions.

+
+ + +
+
+
+
+
+

Previous topic

+

Describing HTML snippets

+

Next topic

+

Glossary

+

This Page

+ + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/HTML-snippets.html b/lib/gollum/frontend/public/javascript/MathJax/docs/html/HTML-snippets.html new file mode 100644 index 00000000..47e3a900 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/HTML-snippets.html @@ -0,0 +1,170 @@ + + + + + + + + Describing HTML snippets — MathJax v1.0 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

Describing HTML snippets

+

A number of MathJax configuration options allow you to specify an HTML +snippet using a JavaScript object. This lets you include HTML in your +configutation files even though they are not HTML files themselves. +The format is fairly simple, but flexible enough to let you represent +complicated HTML trees.

+

An HTML snippet is an array consisting of a series elements that formt +he HTML tree. Those elements are one of two things: either a string, +which represents text to be included in the snippet, or an array, +which represents an HTML tag to be included. In the latter case, the +array consists of three items: a string that is the tag name (e.g., +“img”), an optional object that gives attributes for the tag (as +described below), and an optional HTML snippet array that gives the +contents of the tag.

+

When attributes are provided, they are given as name:value pairs, +with the name giving the attribute name, and value giving its +value. For example

+
[["img",{src:"/images/mypic.jpg"}]]
+
+
+

represents an HTML snippet that includes one element: an <img> tag +with src set to /images/mypic.jpg. That is, this is +equivalent to

+
<img src="/images/mypic.jpg">
+
+
+

Note that the snippet has two sets of square brackets. The outermost +one is for the array that holds the snippet, and the innermost set is +because the first (and only) element in the snippet is a tag, not +text. Note that the code ["img",{src:"/images/mypic.jpg"}] +is invalid as an HTML snippet. It would represent a snippet that +starts with “img” as text in the snippet (not a tag), but the second +item is neither a string nor an array, and so is illegal. This is a +common mistake that should be avoided.

+

A more complex example is the following:

+
[
+  "Please read the ",
+  ["a",{href:"instructions.html"},["instructions"]],
+  " carefully before proceeding"
+]
+
+
+

which is equivalent to

+
please read the <a href="instructions.html">instructions</a> carefully
+before proceeding.
+
+
+

A final example shows how to set style attributes on an object:

+
[["span",
+  {
+    id:"mySpan",
+    style: {color:"red", "font-weight":"bold"}
+  },
+  [" This is bold text shown in red "]
+]]
+
+
+

which is equivalent to

+
<span id="mySpan" style="color: red; font-weight: bold;">
+This is bold text shown in red
+</span>
+
+
+
+ + +
+
+
+
+
+

Previous topic

+

Converting to MathJax from jsMath

+

Next topic

+

CSS Style Objects

+

This Page

+ + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/badge.gif b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/badge.gif new file mode 100644 index 00000000..e5082b65 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/badge.gif differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_head.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_head.png new file mode 100644 index 00000000..eb81080e Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_head.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_menu.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_menu.png new file mode 100644 index 00000000..e64f2ae9 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_menu.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_templates.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_templates.png new file mode 100644 index 00000000..ddf22f49 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/mt_templates.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/wp_menu.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/wp_menu.png new file mode 100644 index 00000000..c10cc6d1 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/wp_menu.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/wp_templates.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/wp_templates.png new file mode 100644 index 00000000..35c9105d Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_images/wp_templates.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/CSS-styles.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/CSS-styles.txt new file mode 100644 index 00000000..32920c9b --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/CSS-styles.txt @@ -0,0 +1,79 @@ +.. _css-style-objects: + +***************** +CSS Style Objects +***************** + +Many MathJax components allow you to specify CSS styles that control +the look of the elements they create. These are described using CSS +style objects, which are JavaScript objects that represent standard +CSS declarations. The main CSS style object is a collection of +`name:value` pairs where the `name` is the CSS selector that is being +defined, and the `value` is an object that gives the style for that +selector. Most often, the selector will need to be enclosed in +quotation marks, as it will contain special characters, so you would +need to use ``"#myID"`` rather than just ``#myID`` and ``"ul li"`` +rather than just ``ul li``. + +The value used to define the CSS style can either be a string +containing the CSS definition, or a javascript object that is itself a +collection of `name:value` pairs, where the `name` is the attribute +being defined and `value` is the value that attibute should be given. +Note that, since this is a JavaScript object, the pairs are separated +by commas (not semi-colons) and the values are enclosed in quotation +marks. If the name contains dashes, it should be enclosed in +quotation marks as well. + +For example, ``jax/output/HTML-CSS/config.js`` includes the following +declaration: + +.. code-block:: javascript + + styles: { + + ".MathJax .merror": { + "background-color": "#FFFF88", + color: "#CC0000", + border: "1px solid #CC0000", + padding: "1px 3px", + "font-family": "serif", + "font-style": "normal", + "font-size": "90%" + }, + + ".MathJax_Preview": {color: "#888888"}, + + } + +This defines two CSS styles, one for the selector ``.MathJax +.merror``, which specifies a background color, foreground color, +border, and so on, and a second for ``.MathJax_Preview`` that sets its +color. + +You can add as many such definitions to a ``styles`` object as you +wish. Note, however, that since this is a JavaScript object, the +selectors must be unique (e.g., you can't use two definitions for +``"img"``, for example, as only the last one would be saved). If you +need to use more than one entry for a single selector, you can add +comments like ``/* 1 */`` and ``/* 2 */`` to the selector to make them +unique. + +It is possible to include selectors like ``"@media print"``, in which +case the value is a CSS style object. For example: + +.. code-block:: javascript + + styles: { + "@media print": { + ".MathJax .merror": { + "background-color": "white", + border: 0 + } + } + } + +The various extensions and output processors include more examples of +CSS style objects, so see the code for those files for additional +samples. In particular, the ``extensions/MathMenu.js``, +``extensions/MathZoom.js``, ``extensions/FontWarnsing.js``, and +``jax/output/HTML-CSS/jax.js`` files include such definitions. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/HTML-snippets.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/HTML-snippets.txt new file mode 100644 index 00000000..305f0c62 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/HTML-snippets.txt @@ -0,0 +1,83 @@ +.. _html-snippets: + +************************ +Describing HTML snippets +************************ + +A number of MathJax configuration options allow you to specify an HTML +snippet using a JavaScript object. This lets you include HTML in your +configutation files even though they are not HTML files themselves. +The format is fairly simple, but flexible enough to let you represent +complicated HTML trees. + +An HTML snippet is an array consisting of a series elements that formt +he HTML tree. Those elements are one of two things: either a string, +which represents text to be included in the snippet, or an array, +which represents an HTML tag to be included. In the latter case, the +array consists of three items: a string that is the tag name (e.g., +"img"), an optional object that gives attributes for the tag (as +described below), and an optional HTML snippet array that gives the +contents of the tag. + +When attributes are provided, they are given as `name:value` pairs, +with the `name` giving the attribute name, and `value` giving its +value. For example + +.. code-block:: javascript + + [["img",{src:"/images/mypic.jpg"}]] + +represents an HTML snippet that includes one element: an ```` tag +with ``src`` set to ``/images/mypic.jpg``. That is, this is +equivalent to + +.. code-block:: html + + + +Note that the snippet has two sets of square brackets. The outermost +one is for the array that holds the snippet, and the innermost set is +because the first (and only) element in the snippet is a tag, not +text. Note that the code ``["img",{src:"/images/mypic.jpg"}]`` +is invalid as an HTML snippet. It would represent a snippet that +starts with "img" as text in the snippet (not a tag), but the second +item is neither a string nor an array, and so is illegal. This is a +common mistake that should be avoided. + +A more complex example is the following: + +.. code-block:: javascript + + [ + "Please read the ", + ["a",{href:"instructions.html"},["instructions"]], + " carefully before proceeding" + ] + +which is equivalent to + +.. code-block:: html + + please read the instructions carefully + before proceeding. + +A final example shows how to set style attributes on an object: + +.. code-block:: javascript + + [["span", + { + id:"mySpan", + style: {color:"red", "font-weight":"bold"} + }, + [" This is bold text shown in red "] + ]] + +which is equivalent to + +.. code-block:: html + + + This is bold text shown in red + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/ajax.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/ajax.txt new file mode 100644 index 00000000..0da172d6 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/ajax.txt @@ -0,0 +1,196 @@ +.. _api-ajax: + +*********************** +The MathJax.Ajax Object +*********************** + +The `MathJax.Ajax` structure holds the data and functions for handling +loading of external modules. Modules are loaded only once, even if +called for in several places. The loading of files is asynchronous, +and so the code that requests an external module will continue to run +even when that module has not completed loading, so it is important to +be aware of the timing issues this may cause. Similarly, creating or +loading stylesheets is an asynchronous action. In particular, all +actions that rely on the file or stylesheet having been loaded must be +delayed until after the file has been downloaded completely. This is +the reason for the large number of routines that take callback +functions. + +Any operation that could cause the loading of a file or stylesheet +must be synchronized with the rest of the code via such callbacks. +Since processing any mathematics might cause files to be loaded (e.g., +little-used markup might be implemented in an extension that is loaded +only when that markup is used), any code that dynamically typesets +mathematics will need to be structured to use callbacks to guarantee +that the mathematics has been completely processed before the code +tries to use it. See the :ref:`Synchronizing with MathJax ` +documentation for details on how to do this properly. + + +Properties +========== + +.. describe:: timeout + + Number of milliseconds to wait for a file to load before + it is considered to have failed to load. + + *Default:* 20 seconds + +.. describe:: STATUS.OK + + The value used to indicate that a file load has occurred + successfully. + +.. describe:: STATUS.ERROR + + The value used to indicate that a file load has caused an error or + a timeout to occur. + +.. describe:: loaded + + An object containing the names of the files that have been loaded (or + requested) so far. ``MathJax.Ajax.loaded["file"]`` will be + non-``null`` when the file has been loaded, with the value being + the ``MathJax.Ajax.STATUS`` value of the load attempt. + +.. describe:: loading + + An object containing the files that are currently loading, the + callbacks that are to be run when they load or timeout, and + additional internal data. + + +Methods +======= + +.. method:: Require(file[,callback]) + + Loads the given file if it hasn't been already. The file must be a + JavaScript file or a CSS stylesheet; i.e., it must end in ``.js`` + or ``.css``. Alternatively, it can be an object with a single + `key:value` pair where the `key` is one of ``js`` or ``css`` and + the `value` is the file of that type to be loaded (this makes it + possible to have the file be created by a CGI script, for example, + or to use a ``data::`` URL). The file must be relative to the + MathJax home directory and can not contain ``../`` file path + components. + + When the file is completely loaded and run, the `callback`, if + provided, will be executed passing it the status of the file load. + If there was an error while loading the file, or if the file fails + to load within the time limit given by ``MathJax.Ajax.timout``, + the status will be ``MathJax.Ajax.STATUS.ERROR`` otherwise it + will be ``MathJax.Ajax.STATUS.OK``. If the file is already + loaded, the callback will be called immediately and the file will + not be loaded again. + + :Parameters: + - **file** --- name of the file to be loaded + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: Load(file[,callback]) + + Used internally to load a given file without checking if it + already has been loaded, or where it is to be found. + + :Parameters: + - **file** --- name of the file to be loaded + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: loadComplete(file) + + Called from within the loaded files to inform MathJax that the + file has been completely loaded and initialized. The `file` + parameter is the name of the file that has been loaded. This + routine will cause any callback functions registered for the file + or included in the :meth:``MathJax.Ajax.Require()`` calls to be + executed, passing them the status or the load + (`MathJax.Ajax.STATUS.OK`` or ``MathJax.Ajax.STATUS.ERROR``) as + their last parameter. + + :Parameters: + - **file** --- name of the file that has been loaded + :Returns: ``null`` + +.. method:: loadTimeout(file) + + Called when the timeout period is over and the file hasn't loaded. + This indicates an error condition, and the + :meth:`MathJax.Ajax.loadError()` method will be executed, then the + file's callback will be run with ``MathJax.Ajax.STATUS.ERROR`` as + its parameter. + + :Parameters: + - **file** --- name of the file that timed out + :Returns: ``null`` + +.. method:: loadError(file) + + The default error handler called when a file fails to load. It + puts a warning message into the MathJax message box on screen. + + :Parameters: + - **file** --- the name of the file that failed to load + :Returns: ``null`` + +.. method:: loadHook(file,callback) + + Registers a callback to be executed when the given file is + loaded. The file load operation need to be started when this + method is called, so it can be used to register a hook for a file + that may be loaded in the future. + + :Parameters: + - **file** --- the name of the file to wait for + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: Styles(styles[,callback]) + + Creates a stylesheet from the given style data. `styles` can + either be a string containing a stylesheet definition, or an + object containing a :ref:`CSS Style Object `. + For example: + + .. code-block:: javascript + + MathJax.Ajax.Styles("body {font-family: serif; font-style: italic}"); + + and + + .. code-block:: javascript + + MathJax.Ajax.Styles({ + body: { + "font-family": "serif", + "font-style": "italic" + } + }); + + both set the body font family and style. + + The callback routine is called when the stylesheet has been + created and is available for use. + + :Parameters: + - **styles** --- CSS style object for the styles to set + - **callback** --- the callback specification + :Returns: the callback object + + .. note:: + + Internet Explorer has a limit of 32 dynamically created + stylesheets, so it is best to combine your styles into one + large group rather than making several smaller calls. + +.. method:: fileURL(file) + + Returns a complete URL to a file (replacing ``[MathJax]`` with the + actual root URL location). + + :Parameters: + - **file** --- the file name possibly including ``[MathJax]`` + :Returns: the full URL for the file diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/callback.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/callback.txt new file mode 100644 index 00000000..3e51db0d --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/callback.txt @@ -0,0 +1,259 @@ +.. _api-callback: + +************************** +The MathJax.Callback Class +************************** + +The ``MathJax.Callback`` object is one of the key mechanisms used by +MathJax to synchronize its actions with those that occur +asynchronously, like loading files and stylesheets. A `Callback` +object is used to tie the execution of a function to the completion of +an asynchronous action. See :ref:`Synchronizing with MathJax +` for more details, and :ref:`Using Callbacks +` in particular for examples of how to specify and +use MathJax `Callback` objects. + + +Specifying a callback +--------------------- + +When a method includes a callback as one of its arguments, that +callback can be specified in a number of different ways, depending on +the functionality that is required of the callback. The easiest case +is to simply provide a function to be called, but it is also possible +to include data to pass to the function when it is executed, and even +the object that will be used as the javascript `this` object when the +function is called. + +Most functions that take callbacks as arguments accept a `callback +specification` rather than an actual callback object, though you can +use the :meth:`MathJax.Callback` function to convert a callback +specification into a Callback object if needed. + +A callback specification is any one of the following: + + .. describe:: fn + + A function that is to be called when the callback is executed. + No additional data is passed to it (other that what it is + called with at the time the callback is executed), and `this` + will be the window object. + + .. describe:: [fn] + + An array containing a function to be called when the callback + is executed (as above). + + .. describe:: [fn, data...] + + An array containing a function together with data to be passed + to that function when the callback is executed; `this` is still + the window object. For example, + + .. code-block:: javascript + + [function (x,y) {return x+y}, 2, 3] + + would specify a callback that would pass ``2`` and ``3`` to + the given function, and it would return their sum, ``5``, when + the callback is executed. + + .. describe:: [object, fn] + + An array containing an object to use as `this` and a function to + call for the callback. For example, + + .. code-block:: javascript + + [{x:'foo', y:'bar'}, function () {this.x}] + + would produce a callback that returns the string ``"foo"`` + when it is called. + + .. describe:: [object, fn, data...] + + Similar to the previous case, but with data that is passed to + the function as well. + + ..describe:: ["method", object] + + Here, `object` is an object that has a method called `method`, and + the callback will execute that method (with the object as + `this`) when it is called. For example, + + .. code-block:: javascript + + ["length",[1,2,3,4]] + + would call the `length` method on the array ``[1,2,3,4]`` when + the callback is called, returning ``4``. + + .. describe:: ["method", object, data...] + + Similar to the previous case, but with data that is passed to + the method. E.g., + + .. code-block:: javascript + + ["slice",[1,2,3,4],1,3] + + would perform the equivalent of ``[1,2,3,4].slice(1,3)``, + which returns the array ``[2,3]`` as a result. + + .. describe:: {hook: fn, data: [...], object: this} + + Here the data for the callback are given in an associative + array of `key:value` pairs. The value of `hook` is the + function to call, the value of `data` is an array of the + arguments to pass to the function, and the value of `object` + is the object to use as `this` in the function call. The + specification need not include all three `key:value` pairs; any + that are missing get default values (a function that does + nothing, an empty array, and the window object, respectively). + + .. describe:: "string" + + This specifies a callback where the string is executed via an + ``eval()`` statement. The code is run in the global context, + so any variables or functions created by the string become + part of the global namespace. The return value is the value of + the last statement executed in the string. + + +Executing a Callback Object +=========================== + +The `Callback` object is itself a function, and calling that function +executes the callback. You can pass the callback additional +parameters, just as you can any function, and these will be added to +the callback function's argument list following any data that was +supplied at the time the callback was created. For example + +.. code-block:: javascript + + var f = function (x,y) {return x + " and " +y} + var cb = MathJax.Callback([f, "foo"]); + var result = cb("bar"); // sets result to "foo and bar" + +Usually, the callback is not executed by the code that creates it (as +it is in the example above), but by some other code that runs at a +later time at the completion of some other activity (say the loading +of a file), or in response to a user action. For example: + +.. code-block:: javascript + + function f(x) {alert("x contains "+x)}; + function DelayedX(time) { + var x = "hi"; + setTimeout(MathJax.Callback([f, x], time); + } + +The ``DelayedX`` function arranges for the function ``f`` to be called at +a later time, passing it the value of a local variable, ``x``. Normally, +this would require the use of a closure, but that is not needed when a +`MathJax.Callback` object is used. + + +Callback Object Properties +-------------------------- + +.. describe:: hook + + The function to be called when the callback is executed. + +.. describe:: data + + An array containing the arguments to pass to the callback + function when it is executed. + +.. describe:: object + + The object to use as `this` during the call to the callback + function. + +.. describe:: called + + Set to ``true`` after the callback has been called, and undefined + otherwise. A callback will not be exectued a second time unless + the callback's :meth:`reset()` method is called first, or its + ``autoReset`` property is set to ``true``. + +.. describe:: autoReset + + Set this to ``true`` if you want to be able to call the callback + more than once. (This is the case for signal listeners, for example). + +.. describe:: isCallback + + Always set to ``true`` (used to detect if an object is a callback + or not). + + +Callback Object Methods +----------------------- + +.. method:: reset() + + Clears the callback's `called` property. + + +MathJax.Callback Methods +------------------------ + +.. method:: Delay(time[, callback]) + + Waits for the specified time (given in milliseconds) and then + performs the callback. It returns the Callback object (or a blank + one if none was supplied). The returned callback structure has a + `timeout` property set to the result of the ``setTimeout()`` call + that was used to perform the wait so that you can cancel the wait, + if needed. Thus :meth:`MathJax.Callback.Delay()` can be used to + start a timeout delay that executes the callback if an action + doesn't occur within the given time (and if the action does occur, + the timeout can be canceled). Since + :meth:`MathJax.Callback.Delay()` returns a callback structure, it + can be used in a callback queue to insert a delay between queued + commands. + + :Parameters: + - **time** --- the amount of time to wait + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: executeHooks(hooks[, data[,reset]]) + + Calls each callback in the `hooks` array (or the single hook if it + is not an array), passing it the arguments stored in the data + array. It `reset` is ``true``, then the callback's + :meth:`reset()` method will be called before each hook is + executed. If any of the hooks returns a `Callback` object, then + it collects those callbacks and returns a new callback that will + execute when all the ones returned by the hooks have been + completed. Otherwise, :meth:`MathJax.Callback.executeHooks()` + returns ``null``. + + :Parameters: + - **hooks** --- array of hooks to be called, or a hook + - **data** --- array of arguments to pass to each hook in turn + - **reset** --- ``true`` if the :meth:`reset()` method should be called + :Returns: callback that waits for all the hooks to complete, or ``null`` + +.. method:: Queue([callback,...]) + + Creates a `MathJax.CallBack.Queue` object and pushes the given + callbacks into the queue. See :ref:`Using Queues ` + for more details about MathJax queues. + + :Parameters: + - **callback** --- one or more callback specifications + :Returns: the `Queue` object + +.. method:: Signal(name) + + Looks for a named signal, creates it if it doesn't already exist, + and returns the signal object. See + :ref:`Using Signals ` for more details. + + :Parameters: + - **name** --- name of the signal to get or create + :Returns: the `Signal` object diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/elementjax.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/elementjax.txt new file mode 100644 index 00000000..8ef99627 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/api/elementjax.txt @@ -0,0 +1,122 @@ +.. _api-element-jax: + +**************************** +The MathJax.ElementJax Class +**************************** + +The element jax is the bridge between the input and output jax, and +contains the data produced by the input jax needed by the output jax +to display the results. It is tied to the individual `` + +where ``path-to-MathJax`` is replaced by the URL of the MathJax +directory on your server, or (if you are using MathJax locally rather +than through a server) the location of that directory on your hard +disk. For example, if the MathJax directory is at the top level of +your web server's directory hierarchy, you might use + +.. code-block:: html + + + +to load MathJax. + +Although it is possible to load MathJax from a site other than your +own web server, there are issues involved in doing so that you need to +take into consideration. See the :ref:`Notes About Shared Servers +` for more details. Please do **not** link to +the copy of MathJax at ``www.mathjax.org``, as we do not have the +resources to act as a web service for all the sites on the web that +would like to display mathematics. If you are able to run MathJax +from your own server, please do so (this will probably give you better +response time in any case). + +It is best to load MathJax in the document's ```` block, but it +is also possible to load MathJax into the ```` section, if +needed. If you do this, load it as early as possible, as +MathJax will begin to load its components as soon as it is included in +the page, and that will help speed up the processing of the +mathematics on your page. MathJax does expect there to be a +```` section to the document, however, so be sure there is one +if you are loading MathJax in the ````. + +It is also possible to load MathJax dynamically after the page has +been prepared, for example, via a `GreaseMonkey +`_ script, or using a specially prepared +`bookmarklet `_. This is an +advanced topic, however; see :ref:`Loading MathJax Dynamically +` for more details. + + +Configuring MathJax +=================== + +There are several ways to configure MathJax, but the easiest is to use +the ``config/MathJax.js`` file that comes with MathJax. See the +comments in that file, or the :ref:`configuration details +` section, for explanations of the meanings of the various +configuration options. You can edit the ``config/MathJax.js`` file to +change any of the settings that you want to customize. When you +include MathJax in your page via + +.. code-block:: html + + + +it will load ``config/MathJax.js`` automatically as one of its +first actions. + +Alternatively, you can configure MathJax efficiently by calling +:meth:`MathJax.Hub.Config()` when you include MathJax in your page, as +follows: + +.. code-block:: html + + + +This example includes the ``tex2jax`` preprocessor and configures it +to use both the standard TeX and LaTeX math delimiters. It uses the +TeX input processor and the HTML-CSS output processor, and forces the +HTML-CSS processor to use the TeX fonts rather that other locally +installed fonts (e.g., :term:`STIX` fonts). See the +:ref:`configuration options ` section (or the comments +in the ``config/MathJax.js`` file) for more information about the +configuration options that you can include in the +:meth:`MathJax.Hub.Config()` call. Note that if you configure MathJax +using this in-line approach, the ``config/MathJax.js`` file is **not** +loaded. + +Finally, if you would like to use several different configuration +files (like ``config/MathJax.js``, but with different settings in each +one), you can copy ``config/MathJax.js`` to ``config/MathJax-2.js``, +or some other convenient name, and use + +.. code-block:: html + + + +to load the alternative configuration file ``config/MathJax-2.js`` +from the MathJax ``config`` directory. In this way, you can have as +many distinct configuration files as you need. + + +.. _common-configurations: + +Common Configurations +===================== + +The following examples show configurations that are useful for some +common situations. This is certainly not an exhaustive list, and +there are variations possible for any of them. Again, the comments in +the ``config/MathJax.js`` file can help you decide what settings to +include, even if you are using the in-line configuration method. + +The TeX setup +------------- + +This example calls the ``tex2jax`` preprocessor to identify +mathematics in the page by looking for TeX and LaTeX math delimiters. +It uses ``$...$`` and ``\(...\)`` for in-line mathematics, while +``$$...$$`` and ``\[...\]`` mark displayed equations. Because dollar +signs are used to mark mathematics, if you want to produce an actual +dollar sign in your document, you must "escape" it using a slash: +``\$``. This configuration also loads the ``AMSmath`` and +``AMSsymbols`` extensions so that the macros and environments they +provide are defined for use on the page. + +.. code-block:: javascript + + MathJax.Hub.config({ + extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"], + jax: ["input/TeX","output/HTML-CSS"], + tex2jax: { + inlineMath: [['$','$'],["\\(","\\)"]], + processEscapes: true, + }, + }); + +Other extensions that you may consider adding to the `extensions` +array include: ``TeX/noErrors.js``, which shows the original TeX code +if an error occurs while processing the mathematics (rather than an +error message), ``TeX/noUndefined.js``, which shows undefined +macros names in red (rather than producing an error), and +``TeX/autobold.js``, which automatically inserts ``\boldsymbol{...}`` +around your mathematics when it appears in a section of your page that +is in bold. Most of the other TeX extensions are loaded automatically +when needed, and so do not need to be included explicitly in your +`extensions` array. + +See the :ref:`tex2jax configuration ` section for +other configuration options for the ``tex2jax`` preprocessor, and the +:ref:`TeX input jax configuration ` section for options +that control the TeX input processor. + + +The MathML setup +---------------- + +This example calls the ``mml2jax`` preprocessor to identify +mathematics in the page that is in :term:`MathML` format, which uses +```` to indicate displayed equations, and +```` or simply ```` to mark in-line +formulas. + +.. code-block:: javascript + + MathJax.Hub.config({ + extensions: ["mml2jax.js"], + jax: ["input/MathML","output/HTML-CSS"] + }); + +Note that this will work in HTML files, not just XHTML files (MathJax +works with both), and that the web page need not be served with any +special MIME-type. Also note that, unless you are using XHTML rather +than HTML, you should not include a namespace prefix for your +```` tags; for example, you should not use ```` except +in a file where you have tied the ``m`` namespace to the MathML DTD. + +See the :ref:`mml2jax configuration ` section for +other configuration options for the ``mml2jax`` preprocessor, and the +:ref:`MathML input jax configuration ` section for +options that control the MathML input processor. + + +Both TeX and MathML +------------------- + +This example provides for both TeX and MathML input in the same file. +It calls on both the ``tex2jax`` and ``mml2jax`` preprocessors and the +TeX and MathML input jax to do the job. + +.. code-block:: javascript + + MathJax.Hub.config({ + extensions: ["tex2jax.js", "mml2jax.js"], + jax: ["input/TeX", "input/MathML", "output/HTML-CSS"], + }); + +Notice that no ``tex2jax`` configuration section is included, so it +uses its default options (no single dollar signs for in-line math). + +The majority of the code for the TeX and MathML input processors are +not loaded until they are actually needed by the mathematics on the +page, so if this configuration is used on a page that include only +MathML, the TeX input processor will not be loaded. Thus it is +reasonably efficient to specify both input processors even if only one +(or neither one) is used. + + +TeX input with MathML output +---------------------------- + +This example configures MathJax to use the ``tex2jax`` preprocessor +and TeX input processor, but the choice of output format is determined +by MathJax depending on the capabilities of the users's browser. The +is performed by the ``MMLorHTML.js`` configuration file that is loaded +in the `config`` array. + +.. code-block:: javascript + + MathJax.Hub.Config({ + config: ["MMLorHTML.js"], + extensions: ["tex2jax.js"], + jax: ["input/TeX"] + }); + +With this setup, Firefox or Internet Explorer with the `MathPlayer +plugin `_ installed +will use the NativeMML output processor, while all other browsers will +use the HTML-CSS output processor. Since native MathML support is +faster than MathJax's HTML-CSS processor, this will mean that the web +pages will display faster for Firefox and IE than they woudl +otherwise. This speed comes at the cost, however, as you are now +relying on the native MathML support to render the mathematics, and +that is outside of MathJax's control. There may be spacing or other +display differences (compared to MathJax's HTML-CSS output) when the +NativeMML output processor is used. + +See :ref:`MathJax Output Formats ` for more +information on the NativeMML and HTML-CSS output processors. See the +:ref:`MMLorHTML configuration ` section for +details on the options that control the ``MMLorHTML`` configuration. + + +MathML input and output in all browsers +--------------------------------------- + +This example configures MathJax to look for MathML within your page, +and to display it using the browser's native MathML support, if +possible, or its HTML-CSS output if not. + +.. code-block:: javascript + + MathJax.Hub.Config({ + config: ["MMLorHTML.js"], + extensions: ["mml2jax.js"], + jax: ["input/MathML"] + }); + +Using this configuration, MathJax finally makes MathML available in +all modern browsers. + +See the :ref:`MMLorHTML configuration ` section +for details on the options that control the ``MMLorHTML`` +configuration file, the :ref:`MathML configuration ` +section for the options that control the MathML output processor, and +the :ref:`mml2jax configuration ` section for the +options that control the ``mml2jax`` preprocessor. + + +.. _configuration: + +Configuration Objects +===================== + +The various components of MathJax, including its input and output +processors, its preprocessors, its extensions, and the MathJax core, +all can be configured through the ``config/MathJax.js`` file, or via a +:meth:`MathJax.Hub.Config()` call (indeed, if you look closely, you +will see that ``config/MathJax.js`` is itself one big call to +:meth:`MathJax.Hub.Config()`). Anything that is in +``config/MathJax.js`` can be included in-line to configure MathJax. + +The structure that you pass to :meth:`MathJax.Hub.Config()` is a +JavaScript object that includes name-value pairs giving the names of +parameters and their values, with pairs separated by commas. Be +careful not to include a comma after the last value, however, as some +browsers (namely Internet Explorer) will fail to process the +configuration if you do. + +The MathJax components, like the TeX input processor, have their own +sections in the configuration object, labeled by the component name, +and using an configuration object as its value. The object is itself +a configuration object made up of name-value pairs that give the +configuration options for the component. + +For example, + +.. code-block:: javascript + + MathJax.Hub.Config({ + showProcessingMessages: false, + jax: ["input/TeX", "output/HTML-CSS"], + TeX: { + TagSide: "left", + Macros: { + RR: '{\\bf R}', + bold: ['{\\bf #1}',1] + } + } + }); + +is a configration that includes two settings for the MathJax Hub (one +for `showProcessingMessages` and one of the `jax` array), and a +configuration object for the TeX input processor. The latter includes +a setting for the TeX input processor's `TagSide` option (to set tags +on the left rather than the right) and a setting for `Macros`, which +defines new TeX macros (in this case, two macros, one called ``\RR`` +that produces a bold "R", and one called ``\bold`` that puts is +argument in bold face). + +The ``config/MathJax.js`` file is another example that shows nearly +all the configuration options for all of MathJax's components. + + +Configuration Options by Component +================================== + +The individual options are explained in the following sections, which +are categorized by the component they affect. + +.. toctree:: + :maxdepth: 1 + + The core options + +.. toctree:: + :maxdepth: 1 + + The tex2jax preprocessor options + The mml2jax preprocessor options + The jsMath2jax preprocessor options + +.. toctree:: + :maxdepth: 1 + + The TeX input processor options + The MathML input processor options + The HTML-CSS output processor options + The NativeMML output processor options + The MMLorHTML configuration options + +.. toctree:: + :maxdepth: 1 + + The MathMenu options + The MathZoom options + The FontWarnings options + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/dynamic.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/dynamic.txt new file mode 100644 index 00000000..ef386435 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/dynamic.txt @@ -0,0 +1,181 @@ +.. _ajax-mathjax: + +*************************** +Loading MathJax Dynamically +*************************** + +MathJax is designed to be included via a ```` section of your HTML document, and it does rely on being +part of the original document in that it uses an ``onload`` event +handler to synchronize its actions with the loading of the page. +If you wish to insert MathJax into a document after it has +been loaded, that will normally occur *after* the page's ``onload`` +handler has fired, and so MathJax will not be able to tell if it is +safe for it to process the contents of the page. Indeed, it will wait +forever for its ``onload`` handler to fire, and so will never process +the page. + +To solve this problem, you will need to call MathJax's ``onload`` +handler yourself, to let it know that it is OK to typeset the +mathematics on the page. You accomplish this by calling the +:meth:`MathJax.Hub.Startup.onload()` method as part of your MathJax +startup script. To do this, you will need to give MathJax an in-line +configuration, so you will not be able to use the +``config/MathJax.js`` file (though you can add it to your in-line +configuration's `config` array). + +Here is an example of how to load and configure MathJax dynamically: + +.. code-block:: javascript + + (function () { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "/MathJax/MathJax.js"; // use the location of your MathJax + + var config = 'MathJax.Hub.Config({' + + 'extensions: ["tex2jax.js"],' + + 'jax: ["input/TeX","output/HTML-CSS"]' + + '});' + + 'MathJax.Hub.Startup.onload();'; + + if (window.opera) {script.innerHTML = config} + else {script.text = config} + + document.getElementsByTagName("head")[0].appendChild(script); + })(); + +Be sure to set the ``src`` to the correct URL for your copy of +MathJax. You can adjust the ``config`` variable to your needs, but be +careful to get the commas right. The ``window.opera`` test is because +Opera doesn't handle setting ``script.text`` properly, while Internet +Explorer doesn't handle setting the ``innerHTML`` of a script tag. + +Here is a version that uses the ``config/MathJax.js`` file to +configure MathJax: + +.. code-block:: javascript + + (function () { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "/MathJax/MathJax.js"; // use the location of your MathJax + + var config = 'MathJax.Hub.Config({ config: "MathJax.js" }); ' + + 'MathJax.Hub.Startup.onload();'; + + if (window.opera) {script.innerHTML = config} + else {script.text = config} + + document.getElementsByTagName("head")[0].appendChild(script); + })(); + +Note that the **only** reliable way to configure MathJax is to use an +in-line configuration of the type discussed above. You should **not** +call :meth:`MathJax.Hub.Config()` directly in your code, as it will +not run at the correct time --- it will either run too soon, in which +case ``MathJax`` may not be defined and the function will throw an +error, or it will run too late, after MathJax has already finished its +configuration process, so your changes will not have the desired +effect. + + +MathJax and GreaseMonkey +======================== + +You can use techniques like the ones discussed above to good effect in +GreaseMonkey scripts. There are GreaseMonkey work-alikes for all the +major browsers: + +- Firefox: `GreaseMonkey `_ +- Safari: `GreaseKit `_ (also requires `SIMBL `_) +- Opera: Built-in (`instructions `_) +- Internet Explorer: `IEPro7 `_ +- Chrome: Built-in for recent releases + +Note, however, that most browsers don't allow you to insert a script +that loads a ``file://`` URL into a page that comes from the web (for +security reasons). That means that you can't have your GreaseMonkey +script load a local copy of MathJax, so you have to refer to a +server-based copy. In the scripts below, you need to insert the URL +of a copy of MathJax from your own server. + +---- + +Here is a script that runs MathJax in any document that contains +MathML (whether its includes MathJax or not). That allows +browsers that don't have native MathML support to view any web pages +with MathML, even if they say it only works in Forefox and +IE+MathPlayer. + +.. code-block:: javascript + + // ==UserScript== + // @name MathJax MathML + // @namespace http://www.mathjax.org/ + // @description Insert MathJax into pages containing MathML + // @include * + // ==/UserScript== + + if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + if ((document.getElementsByTagName("math").length > 0) || + (document.getElementsByTagNameNS == null ? false : + (document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math").length > 0))) { + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'extensions:["mml2jax.js"],' + + 'jax:["input/MathML","output/HTML-CSS"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); + } + } + +**Source**: `mathjax_mathml.user.js <_statis/mathjax_mathml.user.js>`_ + +---- + +Here is a script that runs MathJax in Wikipedia pages after first +converting the math images to their original TeX code. + +.. code-block:: javascript + + // ==UserScript== + // @name MathJax in Wikipedia + // @namespace http://www.mathjax.org/ + // @description Insert MathJax into Wikipedia pages + // @include http://en.wikipedia.org/wiki/* + // ==/UserScript== + + if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + // + // Replace the images with MathJax scripts of type math/tex + // + var images = document.getElementsByTagName('img'); + for (var i = images.length - 1; i >= 0; i--) { + var img = images[i]; + if (img.className === "tex") { + var script = document.createElement("script"); script.type = "math/tex"; + if (window.opera) {script.innerHTML = img.alt} else {script.text = img.alt} + img.parentNode.replaceChild(script,img); + } + } + // + // Load MathJax and have it process the page + // + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'config: ["MMLorHTML.js"],' + + 'extensions:["TeX/noErrors.js","TeX/noUndefined.js",' + + '"TeX/AMSmath.js","TeX/AMSsymbols.js"],' + + 'jax:["input/TeX"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); + } + +**Source**: `mathjax_wikipedia.user.js <_statis/mathjax_wikipedia.user.js>`_ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/glossary.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/glossary.txt new file mode 100644 index 00000000..30a3d082 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/glossary.txt @@ -0,0 +1,75 @@ +.. _glossary: + +******** +Glossary +******** + +.. if you add new entries, keep the alphabetical sorting! + +.. glossary:: + + Callback + A JavaScript function that is used to perform actions that + must wait for other actions to complete before they are + performed. + + Callback Queue + MathJax uses `Queues` to synchronize its activity so that + actions that operate asynchronously (like loading files) will + be performed in the right order. :term:`Callback` functions + are pushed onto the queue, and are performed in order, with + MathJax handling the synchronization if operations need to + wait for other actions to finish. + + Callback Signal + A JavaScript object that acts as a mailbox for MathJax events. + Like an event handler, but it also keeps a history of + messages. Your code can register an "interest" in a signal, + or can register a :term:`callback` to be called when a + particular message is sent along the signal channel. + + HTML-CSS + MathJax output form that employs only on HTML and CSS 2.1, + allowing MathJax to remain compatible across all browsers. + + jax + MathJax's input and output processors are called "jax", as is + its internal format manager. The code for the jax are in the + ``MathJax/jax`` directory. + + LaTeX + LaTeX is a variant of :term:`TeX` that is now the dominant TeX style. + + .. seealso:: + + `LaTeX Wikipedia entry `_ + + MathML + An XML specification created to describe mathematical + notations and capture both its structure and content. MathML + is much more verbose than :term:`TeX`, but is much more + machine-readable. + + .. seealso:: + + `MathML Wikipedia entry `_ + + STIX + The Scientific and Technical Information Exchange font + package. A comprehensive set of scientific glyphs. + + .. seealso:: + + `STIX project `_ + + TeX + A document markup language with robust math markup commands + developed by Donald Knuth in the late 1970's, but still in + extensive use today. It became the industry standard for + typesetting of mathematics, and is one of the most common + formats for mathematical journals, articles, and books. + + .. seealso:: + + `TeX Wikipedia entry `_ + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/index.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/index.txt new file mode 100644 index 00000000..23a387c5 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/index.txt @@ -0,0 +1,71 @@ +##################### +MathJax Documentation +##################### + +MathJax is an open-source JavaScript display engine for LaTeX and +MathML that works in all modern browsers. + +Basic Usage +=========== + +.. toctree:: + :maxdepth: 1 + + What is MathJax? + Getting Started with MathJax + Installing and Testing MathJax + Loading and Configuring MathJax + Using MathJax in Web Platforms + +.. toctree:: + :maxdepth: 1 + + MathJax TeX and LaTeX Support + MathJax MathML Support + MathJax Output Formats + +.. toctree:: + :maxdepth: 1 + + The MathJax Community + + +.. _advanced-topics: + +Advanced Topics +=============== + +.. toctree:: + :maxdepth: 1 + + The MathJax Processing Model + The MathJax Startup Sequence + Synchronizing Your Code with MathJax + Loading MathJax Dynamically + Modifying Math on the Page + +.. toctree:: + :maxdepth: 1 + + Details of the MathJax API + +.. toctree:: + :maxdepth: 1 + + Converting to MathJax from jsMath + +Reference Pages +=============== + +.. toctree:: + :maxdepth: 1 + + HTML snippets + CSS style objects + Glossary + +* :ref:`Search ` + +-------- + +This version of the documentation was built |today|. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/installation.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/installation.txt new file mode 100644 index 00000000..799dee2a --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/installation.txt @@ -0,0 +1,184 @@ +.. _installation: + +****************************** +Installing and Testing MathJax +****************************** + +MathJax can be loaded from a public web server or privately from your +hard drive or other local media. To use MathJax in either way, you +will need to obtain a copy of MathJax and its font package. There are +two main ways to do this: via ``svn`` or via a pre-packaged archive. +We recommend the former, as it is easier to keep your installation up +to date using ``svn``. + + +.. _getting-mathjax-svn: + +Obtaining MathJax via SVN +========================= + +The easiest way to get MathJax and keep it up to date is to use the +`subversion `_ source control system, +``svn``. Use the commands + +.. code-block:: sh + + svn co http://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk/mathjax mathjax + cd mathjax + unzip fonts.zip + +to obtain and set up a copy of MathJax. (The `SourceForge development +page `_ also shows +how to do this.) + +Whenever you want to update MathJax, you can now use + +.. code-block:: sh + + cd mathjax + svn status + +to check if there are updates to MathJax. If MathJax needs updating, +use + +.. code-block:: sh + + cd mathjax + svn update + # if fonts.zip is updated, do the following as well: + rm -rf fonts + unzip fonts.zip + +to udpate your copy of MathJax to the current release version. If the +``fonts.zip`` file has been updated, you will need to remove the old +fonts directory and unpack the new one bring your installation up to +date. If you keep MathJax updated in this way, you will be sure that +you have the latest bug fixes and new features as they become +available. + +This gets you the current development copy of MathJax, which is the +"bleeding-edge" version that contains all the latest changes to +MathJax. At times, however, these may be less stable than the +"release" version. If you prefer to use the most stable version (that +may not include all the latest patches and features), use + +.. code-block:: sh + + svn co http://mathjax.svn.sourcesforge.net/svnroot/mathjax/tags/mathjax-1.0 mathajx + cd mathjax + unzip fonts.zip + +to obtain the version 1.0 release. When you wish to update to a new +release, you will need to check out a new copy of MathJax with the new +release number. + + +.. _getting-mathjax-zip: + +Obtaining MathJax via an archive +================================ + +Release versions of MathJax are available in archive files from the +`MathJax download page `_ or the +`SourceForge files page +`_, where you can +download the archives that you need. + +You should download the ``MathJax-v1.0.zip`` file, then simply unzip +it. Once the MathJax directory is unpacked, you should move it to the +desired location on your server (or your hard disk, if you are using +it locally rather then through a web server). One natural location is +to put it at the top level of your web server's hierarchy. That would +let you refer to the main MathJax file as ``/MathJax/MathJax.js`` from +within any page on your server. + + +Testing your installation +========================= + +Use the HTML files in the ``test`` directory to see if your +installation is working properly:: + + test/ + index.html # Tests default configuration + index-images.html # Tests image-font fallback display + sample.html # Sample page with lots of pretty equations + +Open these files in your browser to see that they appear to be working +properly. If you have installed MathJax on a server, use the web +address for those files rather than opening them locally. When you +view the ``index.html`` file, you should see (after a few moments) a +message that MathJax appears to be working. If not, you should check +that the files have been transferred to the server completely, that +the fonts archive has been unpacked in the correct location, and that +the permissions allow the server to access the files and folders that +are part of the MathJax directory (be sure to verify the MathJax +folder's permissions as well). Checking the server logs may help +locate problems with the installation. + + +.. _cross-domain-linking: + +Notes about shared installations +================================ + +Typically, you want to have MathJax installed on the same server as +your web pages that use MathJax. There are times, however, when that +may be impractical, or when you want to use a MathJax installation at +a different site. For example, a departmental server at +``www.math.yourcollege.edu`` might like to use a college-wide +installation at ``www.yourcollege.edu`` rather than installing a +separate copy on the departmental machine. MathJax can certainly +be loaded from another server, but there is one imporant caveat --- +Firefox's same-origin security policy for cross-domain scripting. + +Firefox’s interpretation of the same-origin policy is more strict than +most other browsers, and it affects how fonts are loaded with the +`@font-face` CSS directive. MathJax uses this directory to load +web-based math fonts into a page when the user doesn't have them +installed locally on their own computer. Firefox's security policy, +however, only allows this when the fonts come from the same server as +the web page itself, so if you load MathJax (and hence its web fonts) +from a different server, Firefox won't be able to access those web +fonts. In this case, MathJax will pause while waiting for the font to +download (which will never happen) and will time out after about 15 +seconds for each font it tries to access. Typically that is three or +four fonts, so your Foirefox users will experience a minute or so +delay before mathematics is displayed, and then it will probably +display incorrectly because the browser doesn't have access to the +correct fonts. + +There is a solution to this, however, if you manage the server where +MathJax is installed, and if that server is running the `Apache web +server `_. In the remote server's +``MathJax/fonts/HTML-CSS/TeX/otf`` folder, create a file called +``.htaccess`` that contains the following lines: :: + + + + Header set Access-Control-Allow-Origin "*" + + + +and make sure the permissions allow the server to read this file. +(The file's name starts with a period, which causes it to be an +"invisible" file on unix-based operating systems. Some systems, +particularly graphic user interfaces, may not allow you to create such +files, so you might need to use the command-line interface to +accomplish this.) + +This file should make it possible for pages at other sites to load +MathJax from this server in such a way that Firefox will be able to +download the web-based fonts. If you want to restrict the sites that +can access the web fonts, change the ``Access-Control-Allow-Origin`` +line to something like:: + + Header set Access-Control-Allow-Origin "http://www.math.yourcollege.edu" + +so that only pages at ``www.math.yourcollege.edu`` will be able to +download the fonts from this site. See the open font library +discussion of `web-font linking +`_ +for more details. + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/jsMath.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/jsMath.txt new file mode 100644 index 00000000..3f40feba --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/jsMath.txt @@ -0,0 +1,31 @@ +.. _jsMath-support: + +********************************* +Converting to MathJax from jsMath +********************************* + +MathJax is the successor to the popular `jsMath +`_ package for rendering +mathematics in web pages. Like jsMath, MathJax works by locating and +processing the mathematics within the webpage once it has been loaded +in the browser by a user viewing your web pages. If you are using +jsMath with its ``tex2math`` preprocessor, then switching to MathJax +should be easy, and is simply a matter of configuring MathJax +appropriately. See the section on :ref:`Configuring MathJax +` for details about loading and configuring MathJax. + +On the other hand, if you are using jsMath's ``...`` and ``
...
`` tags to +mark the mathematics in your document, then you should use MathJax's +``jsMath2jax`` preprocessor when you switch to MathJax. To do this, +include ``"jsMath2jax.js"`` in the `extensions` array of your +configuration, with the `jax` array set to include ``"input/TeX"``. + +.. code-block:: javascript + + extensions: ["jsMath2jax.js"], + jax: ["input/TeX", ...] + +There are a few configuration options for ``jsMath2jax``, which you +can find in the ``config/MathJax.js`` file, or in the :ref:`jsMath +configuration options ` section. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/mathjax.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/mathjax.txt new file mode 100644 index 00000000..70d3b3b5 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/mathjax.txt @@ -0,0 +1,36 @@ +**************** +What is MathJax? +**************** + +MathJax is an open-source JavaScript display engine for LaTeX and +MathML that works in all modern browsers. It was designed with the +goal of consolidating the recent advances in web technologies into a +single, definitive, math-on-the-web platform supporting the major +browsers and operating systems. It requires no setup on the part of +the user (no plugins to downlaod or software to install), so the page +author can write web documents that include mathematics and be +confident that users will be able to view it naturally and easily. +One simply includes MathJax and some mathematics in a web page, and +MathJax does the rest. + +MathJax uses web-based fonts (in those browsers that support it) to +produce high-quality typesetting that scales and prints at full +resolution (unlike mathematics included as images). MathJax can be +used with screen readers, providing accessibility for the visually +impaired. With MathJax, mathematics is text-based rather than +image-based, and so it is available for search engines, meaning that +your equations can be searchable, just like the text of your pages. +MathJax allows page authors to write formulas using TeX and LaTeX +notation, or `MathML `_, a World Wide +Web Constortium standard for representing mathematics in XML format. +MathJax will even convert TeX notation into MathML, so that it can be +rendered more quickly by those browsers that support MathML natively, +or so that you can copy and past it into other programs. + +MathJax is modular, so it loads components only when necessary, and +can be extended to include new capabilities as needed. MathJax is +highly configurable, allowing authors to customize it for the special +requirements of their web sites. Finally, MathJax has a rich +application programming interface (API) that can be used to make the +mathematics on your web pages interactive and dynamic. + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/mathml.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/mathml.txt new file mode 100644 index 00000000..13acda76 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/mathml.txt @@ -0,0 +1,97 @@ +.. _MathML-support: + +********************** +MathJax MathML Support +********************** + +The support for :term:`MathML` in MathJax consists of three parts: the +`mml2jax` preprocessor, the MathML input processor, and the NativeMML +output processor. The first of these looks for ```` tags within +your document and marks them for later processing by MathJax. The +second converts the MathML to the internal format used by MathJax, and +the third turns the internal format into MathML within the page so +that it can be displayed by the browser's native MathML support. + +Because of MathJax's modular design, you do not need to use all three +of these components. For example, you could use the `tex2jax` +preprocessor and the TeX input processor, but the NativeMML output +processor, so that your mathematics is entered in TeX format, but +displayed as MathML. Or you could use the `mml2jax` reprocessor and +MathML input processor with the HTML-CSS output processor to make +MathML available in browsers that don't have native MathML support. +It is also possible to have MathJax select the output processor for +you so that MathML is used in those browsers that support it, while +HTML-CSS is used for those that don't. See the :ref:`common +configurations ` section for details and +examples. + +Of course it is also possible to use all three components together. +It may seem strange to go through an internal format just to return to +MathML in the end, but this is actually what makes it possible to view +MathML within an HTML page (rather than an XHTML page), without +the complications of handling special MIME-types for the document, or +any of the other setup issues that make using native MathML +difficult. MathJax handles the setup and properly marks the +mathematics so that the browser will render it as MathML. In +addition, MathJax provides its contextual menu for the MathML, which +lets the user zoom the mathematics for easier reading, get the copy +the source markup, and so on, so there is added value to using MathJax +even whith a pure MathML workflow. + + +MathML in HTML pages +==================== + +For MathML that is handled via the pre-processor, you should not use +the named MathML entities, but rather use the numeric entities like +``√`` or unicode characters embedded in the page itself. The +reason is that entities are replaced by the browser before MathJax +runs, and some browsers report errors for unknown entities. For +browsers that are not MathML-aware, that will cause errors to be +displayed for the MathML entities. While that might not occur in the +browser you are using to compose your pages, it can happen with other +browsers, so you should avoid the named entities whenever possible. +If you must use named entities, you may need to declare them in the +`DOCTYPE` declaration by hand. + +When you use MathML in an HTML document rather than an XHTML one +(MathJax will work woth both), you should not use the "self-closing" +form for tags with no content, but should use separate open and close +tags. That is, use + +.. code-block:: html + + + +rather than ````, since there is no closing tag, the rest of +the mathematics will become the content of the ```` tag; but +since ```` should have no content, the rest of the mathematics +will not be displayed. This is a common error that should be avoided. + + +Supported MathML commands +========================= + +MathJax supports the `MathML3.0 `_ +presentation mathematics tags, with some limitations. The MathML +support is still under active development, so some tags are not yet +implemented, and some features are not fully developed, but are +coming. + +The deficiencies include: + +- No support for the elementary math tags: ``mstack``, ``mlongdiv``, + ``msgroup``, ``msrow``, ``mscarries``, and ``mscarry``. + +- Limited support for line breaking (they are only allowed in direct + children of ``mrow`` or implied ``mrow`` elements. + +- No support for alignment groups in table. + +- No support for right-to-left rendering. + +See the `results of the MathML3.0 test suite +`_ for details. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/model.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/model.txt new file mode 100644 index 00000000..acc7ea24 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/model.txt @@ -0,0 +1,224 @@ +**************************** +The MathJax Processing Model +**************************** + +The purpose of MathJax is to bring the ability to include mathematics +easily in web pages to as wide a range of browsers as possible. +Authors can specify mathematics in a variety of formats (e.g., +:term:`MathML` or :term:`LaTeX`), and MathJax provides high-quality +mathematical typesetting even in those browsers that do not have +native MathML support. This all happens without the need for special +downloads or plugins, but rendering will be enhanced if high-quality +math fonts (e.g., :term:`STIX`) are available to the browser. + +MathJax is broken into several different kinds of components: page +preprocessors, input processors, output processors, and the MathJax +Hub that organizes and connects the others. The input and output +processors are called :term:`jax`, and are described in more detail +below. + +When MathJax runs, it looks through the page for special tags that +hold mathematics; for each such tag, it locates an appropriate input +jax which it uses to convert the mathematics into an internal form +(called an element jax), and then calls an output jax to transform the +internal format into HTML content that displays the mathematics within +the page. The page author configures MathJax by indicating which +input and output jax are to be used. + +Often, and especially with pages that are authored by hand, the +mathematics is not stored (initially) within the special tags needed +by MathJax, as that would require more notation than the average page +author is willing to type. Instead, it is entered in a form that is +more natural to the page author, for example, using the standard TeX +math delimiters ``$...$`` and ``$$...$$`` to indicate what part of the +document is to be typeset as mathematics. In this case, MathJax can +run a preprocessor to locate the math delimiters and replace them by +the special tags that it uses to mark the formulas. There are +preprocessors for :ref:`TeX notation `, :ref:`MathML +notation `, and the :ref:`jsMath notation +` that uses `span` and `div` tags. + +For pages that are constructed programatically, such as HTML +pages that result from running a processor on text in some other +format (e.g., pages produced from Markdown documents, or via programs +like `tex4ht`), it would be best to use MathJax's special tags +directly, as described below, rather than having MathJax run +another preprocessor. This will speed up the final display of the +mathematics, since the extra preprocessing step would not be needed, +and it also avoids the conflict between the use of the less-than sign, +``<``, in mathematics and asn an HTML special character (that starts +an HTML tag). + + +How mathematics is stored in the page +===================================== + +In order to identify mathematics in the page, MathJax uses special +``[math] + + would display "[math]" in place of the math until MathJax is able + to typeset it. + + See also the ``preJax`` and ``postJax`` comments above. + +.. describe:: showProcessingMessages: true + + This value controls whether the `Processing Math: nn%` message are + displayed in the lower left-hand corner. Set to ``false`` to + prevent those messages (though file loading and other messages + will still be shown). + +.. describe:: messageStyle: "normal" + + This value controls the verbosity of the messages in the lower + left-hand corner. Set it to ``"none"`` to eliminate all messages, + or set it to ``"simple"`` to show "Loading..." and "Processing..." + rather than showing the full file name or the percentage of the + mathematics processed. + +.. describe:: displayAlign: "center" and displayIndent: "0em" + + These two parameters control the alignment and shifting of + displayed equations. The first can be ``"left"``, ``"center"``, + or ``"right"``, and determines the alignment of displayed + equations. When the alignment is not ``"center"``, the second + determines an indentation from the left or right side for the + displayed equations. + + +.. describe:: delayStartupUntil: "none" + + Normally MathJax will perform its starup commands (loading of + configuration, styles, jax, and so on) as soon as it can. If you + expect to be doing additional configuration on the page, however, + you may want to have it wait until the page's onload hander is + called. If so, set this to ``"onload"``. + +.. describe:: skipStartupTypeset: false + + Normally MathJax will typeset the mathematics on the page as soon + as the page is loaded. If you want to delay that process, in + which case you will need to call :meth:`MathJax.Hub.Typeset()` + yourself by hand, set this value to ``true``. + +.. describe:: menuSettings: { ... } + + This block contains settings for the mathematics contextual menu + that act as the defaults for the user's settings in that menu. + The possible values are: + + .. describe:: zoom: "none" + + This indicates when typeset mathematics should be zoomed. It + can be set to ``"None"``, ``"Hover"``, ``"Click"``, or + ``"Double-Click"`` to set the zoom trigger. + + .. describe:: CTRL: false, ALT: false, CMD: false, Shift: false + + These values indicate which keys must be pressed in order for + math zoom to be triggered. For example, if ``CTRL`` is set to + ``true`` and ``zoom`` is ``"Click"``, then math will be zoomed + only when the user control-clicks on mathematics (i.e., clicks + while holding down the `CTRL` key). If more than one is + ``true``, then all the indicated keys must be pressed for the + zoom to occur. + + .. describe:: zscale: "200%" + + This is the zoom scaling factor, and it can be set to any of + the values available in the `Zoom Factor` menu of the + `Settings` submenu of the contextual menu. + + .. describe:: context: "MathJax" + + This controls what contextual menu will be presented when a + right click (on a PC) or CTRL-click (on the Mac) occurs over a + typeset equation. When set to ``"MathJax"``, the MathJax + contextual menu will appear; when set to ``"Browser"``, the + browser's contextual menu will be used. For example, in + Internet Explorer with the MathPlayer plugin, if this is set + to ``"Browser"``, you will get the MathPlayer contextual menu + rather than the MathJax menu. + + There are also settings for ``format``, ``renderer``, and ``font``, + but these are maintained by MathJax and should not be set by the + page author. + +.. describe:: errorSettings: { ... } + + This block contains settings that control how MathJax responds to + unexpected errors while processing mathematical equations. Rather + than simply crash, MathJax can report an error and go on. The + options you can set include: + + .. describe:: message: ["[Math Processing Error"]] + + This is an HTML snippet that will be inserted at the location + of the mathematics for any formula that causes MathJax to + produce an internal error (i.e., an error in the MathJax code + itself). See the :ref:`description of HTML snippets + ` for details on how to represent HTML code in + this way. + + .. describe:: style: {color:"#CC0000", "font-style":"italic"} + + This is the CSS style description to use for the error + messages produced by internal MathJax errors. See the section + on :ref:`CSS style objects ` for details on + how these are specified in JavaScript. + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/jsMath2jax.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/jsMath2jax.txt new file mode 100644 index 00000000..7bba6a99 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/jsMath2jax.txt @@ -0,0 +1,53 @@ +.. _configure-jsMath2jax: + +*************************** +The jsMath2jax Preprocessor +*************************** + +The options below control the operation of the `jsMath2jax` +preprocessor that is run when you include ``"jsMath2jax.js"`` in the +`extensions` array of your configuration. They are listed with their +default values. To set any of these options, include a ``jsMath2jax`` +section in your :meth:`MathJax.Hub.Config()` call. For example + +.. code-block:: javascript + + MathJax.Hub.Config({ + jsMath2jax: { + preview: "none" + } + }); + +would set the ``preview`` parameter to ``"none"``. + + +.. describe:: element: null + + The id name of the element that should be processed by `jsMath2jax`. + The default is the whole document. + +.. describe:: preview: "TeX" + + This controls whether `jsMath2jax` inserts ``MathJax_Preview`` spans + to make a preview available, and what preview to use, when it + locates in-line or display mathematics in the page. The default + is ``"TeX"``, which means use the TeX code as the preview (which + will be visible until it is processed by MathJax). Set to + ``"none"`` to prevent previews from being inserted (the math + will simply disappear until it is typeset). Set to an array + containing the description of an HTML snippet in order to use the + same preview for all equations on the page. + + Examples: + + .. code-block:: javascript + + preview: ["[math]"], // insert the text "[math]" as the preview + + .. code-block:: javascript + + preview: [["img",{src: "/images/mypic.jpg"}]], // insert an image as the preview + + See the :ref:`description of HTML snippets ` for + details on how to represent HTML code in this way. + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/mml2jax.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/mml2jax.txt new file mode 100644 index 00000000..ab36f475 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/mml2jax.txt @@ -0,0 +1,53 @@ +.. _configure-mml2jax: + +************************ +The mml2jax Preprocessor +************************ + +The options below control the operation of the `mml2jax` preprocessor +that is run when you include ``"mml2jax.js"`` in the `extensions` array +of your configuration. They are listed with their default values. To +set any of these options, include a ``mml2jax`` section in your +:meth:`MathJax.Hub.Config()` call. For example + +.. code-block:: javascript + + MathJax.Hub.Config({ + mml2jax: { + preview: "none" + } + }); + +would set the ``preview`` parameter to ``"none"``. + +.. describe:: element: null + + The id name of the element that should be processed by `mml2jax`. + The default is the whole document. + +.. describe:: preview: "alttext" + + This controls whether `mml2jax` inserts ``MathJax_Preview`` spans + to make a preview available, and what preview to use, when it + locates mathematics on the page. The default is ``"alttext"``, + which means use the ```` tag's ``alttext`` attribute as the + preview (visible until it is processed by MathJax), if the tag has + one. Set it to ``"none"`` to prevent the previews from being + inserted (the math will simply disappear until it is typeset). + Set it to an array containing the description of an HTML snippet + in order to use the same preview for all equations on the page. + + Examples: + + .. code-block:: javascript + + preview: ["[math]"], // insert the text "[math]" as the preview + + .. code-block:: javascript + + preview: [["img",{src: "/images/mypic.jpg"}]], // insert an image as the preview + + See the :ref:`description of HTML snippets ` for + details on how to represent HTML code in this way. + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/tex2jax.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/tex2jax.txt new file mode 100644 index 00000000..adfc126c --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/options/tex2jax.txt @@ -0,0 +1,137 @@ +.. _configure-tex2jax: + +************************ +The tex2jax Preprocessor +************************ + +The options below control the operation of the `tex2jax` preprocessor +that is run when you include ``"tex2jax.js"`` in the `extensions` array +of your configuration. They are listed with their default values. To +set any of these options, include a ``tex2jax`` section in your +:meth:`MathJax.Hub.Config()` call. For example + +.. code-block:: javascript + + MathJax.Hub.Config({ + tex2jax: { + inlineMath: [ ['$','$'], ['\\(','\\)'] ] + } + }); + +would set the ``inlineMath`` delimiters for the `tex2jax` +preprocessor. + + +.. describe:: element: null + + The id name of the element that should be processed by `tex2jax`. + The default is the whole document. + +.. describe:: inlineMath: [['\\(','\\)']] + + Array of pairs of strings that are to be used as in-line math + delimters. The first in each pair is the initial delimiter and + the second is the terminal delimiter. You can have as many pairs + as you want. For example, + + .. code-block:: javascript + + inlineMath: [ ['$','$'], ['\\(','\\)'] ] + + would cause `tex2jax` to look for ``$...$`` and ``\(...\)`` as + delimiters for inline mathematics. (Note that the single dollar + signs are not enabled by default because they are used too + frequently in normal text, so if you want to use them for math + delimiters, you must specify them explicitly.) + + Note that the delimiters can't look like HTML tags (i.e., can't + include the less-than sign), as these would be turned into tags by + the browser before MathJax has the chance to run. You can only + include text, not tags, as your math delimiters. + +.. describe:: displayMath: [ ['$$','$$'], ['\\[','\\]'] ] + + Array of pairs of strings that are to be used as delimters for + displayed equations. The first in each pair is the initial + delimiter and the second is the terminal delimiter. You can have + as many pairs as you want. + + Note that the delimiters can't look like HTML tags (i.e., can't + include the less-than sign), as these would be turned into tags by + the browser before MathJax has the chance to run. You can only + include text, not tags, as your math delimiters. + +.. describe:: processEscapes: false + + When set to ``true``, you may use ``\$`` to represent a literal + dollar sign, rather than using it as a math delimiter. When + ``false``, ``\$`` will not be altered, and the dollar sign may be + considered part of a math delimiter. Typically this is set to + ``true`` if you enable the ``$ ... $`` in-line delimiters, so you + can type ``\$`` and `tex2jax` will convert it to a regular dollar + sign in the rendered document. + +.. describe:: processEnvironments: true + + When ``true``, `tex2jax` looks not only for the in-line and + display math delimters, but also for LaTeX environments + (``\begin{something}...\end{something}``) and marks them for + processing by MathJax. When ``false``, LaTeX environments will + not be processed outside of math mode. + +.. describe:: preview: "TeX" + + This controls whether `tex2jax` inserts ``MathJax_Preview`` spans + to make a preview available, and what preview to use, when it + locates in-line or display mathematics in the page. The default + is ``"TeX"``, which means use the TeX code as the preview (which + will be visible until it is processed by MathJax). Set to + ``"none"`` to prevent previews from being inserted (the math + will simply disappear until it is typeset). Set to an array + containing the description of an HTML snippet in order to use the + same preview for all equations on the page. + + Examples: + + .. code-block:: javascript + + preview: ["[math]"], // insert the text "[math]" as the preview + + .. code-block:: javascript + + preview: [["img",{src: "/images/mypic.jpg"}]], // insert an image as the preview + + See the :ref:`description of HTML snippets ` for + details on how to represent HTML code in this way. + +.. describe:: skipTags: ["script","noscript","style","textarea","pre","code"] + + This array lists the names of the tags whose contents should not + be processed by `tex2jax` (other than to look for ignore/process + classes as listed below). You can add to (or remove from) this + list to prevent MathJax from processing mathematics in specific + contexts. + +.. describe:: ignoreClass: "tex2jax_ignore" + + This is the class name used to mark elements whose contents should + not be processed by tex2jax (other than to look for the + ``processClass`` pattern below). Note that this is a regular + expression, and so you need to be sure to quote any `regexp` + special characters. The pattern is automatically preceeded by + ``'(^| )('`` and followed by ``')( |$)'``, so your pattern will + have to match full words in the class name. Assigning an element + this class name will prevent `tex2jax` from processing its + contents. + +.. describe:: processClass: "tex2jax_process" + + This is the class name used to mark elements whose contents + *should* be processed by `tex2jax`. This is used to turn on + processing within tags that have been marked as ignored or skipped + above. Note that this is a regular expression, and so you need to + be sure to quote any `regexp` special characters. The pattern is + automatically preceeded by ``'(^| )('`` and followed by ``')( + |$)'``, so your pattern will have to match full words in the class + name. Use this to restart processing within an element that has + been marked as ignored above. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/output.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/output.txt new file mode 100644 index 00000000..30e7b20a --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/output.txt @@ -0,0 +1,126 @@ +.. _output-formats: + +********************** +MathJax Output Formats +********************** + +Currently, MathJax can render math in two ways: + +- Using HTML-with-CSS to lay out the mathematics, or +- Using a browser's native MathML support. + +These are implemented by the `HTML-CSS` and `NativeMML` output +processors. You select which one you want to use by including either +``"output/HTML-CSS"`` or ``"output/NativeMML"`` in the `jax` array of +your MathJax configuration. For example + +.. code-block:: javascript + + jax: ["input/TeX","output/HTML-CSS"] + +would specify TeX input and HTML-with-CSS output for the mathematics +in your document. + +The HTML-CSS output processor produces high-quality output in all +major browsers, with results that are consistent across browsers and +operating systems. This is MathJax's primary output mode. It's major +advantage is its quality and consistency; it's drawback is that it is +slower that the NativeMML mode at rendering the mathematics. (The +HTML-CSS processor has not yet been optimized for speed, so you can +expect some improvement in the future. Note that IE8 in "IE8 +standards mode" is an order of magnitude slower than any other browser +when processing math through the HTML-CSS output processor; see +:ref:`HTML-CSS with IE8 ` below for some strategies +to deal with this.) + +The NativeMML output processor uses the browser's internal MathML support (if +any) to render the mathematics. Currently, Firefox has native support +for MathML, and IE has the `MathPlayer plugin +`_ for rendering +MathML. Opera has some built-in support for MathML that works well +with simple equations, but fails with more complex formulas, so we +don't recommend using the NativeMML output processor with Opera. Safari, +Chrome, Konqueror, and most other browsers don't support MathML +natively. + +The advantage of the NativeMML output Processor is its speed, since +native MathML support is much faster than using complicated HTML and +CSS to lay out mathematics via an interpreted language like JavaScript +(as the HTML-CSS output processor does). The disadvantage is that you +are dependent on the browser's MathML implementation for your +rendering, and these vary in quality of output and completeness of +implementation. MathJax may rely on features that are not available +in some renderers (for example, Firefox's MathML support does not +implement some of the named widths, such as +``negativethinmathspace``). The results using the NativeMML output +processor may have spacing or other rendering problems that are +outside of MathJax's control. + +Automatic Selection of the Output Processor +=========================================== + +Since not all browsers support MathML natively, it would be unwise to +choose the NativeMML output processor unless you are sure of your +audience's browser capabilities. MathJax can help with that, however, +since there is a special configuration file that will choose between +NativeMML and HTML-CSS depending on the browser in use. To invoke it, +add ``"MMLorHTML.js"`` to your configurations `config` array, and **do +not** include an output processor in your `jax` array; MathJax will +fill that in for you based on the abilities of your user's browser. + +.. code-block:: javascript + + config: ["MMLorHTML.js"], + jax: ["input/TeX"] + +You can customize which choice to make on a browser-by-browser basis +or a global basis. See the ``config/MathJax.js`` file or the +:ref:`Configuring MathJax ` section for futher +details. + +MathJax produces MathML that models the underlying mathematics as best +it can, rather than using complicated hacks to improve output for a +particular MathML implementation. When you make the choice to use the +NativeMML output processor, you are making a trade-off: gaining speed +at the expense of quality and reliability, a decision that should not +be taken lightly. Note, however, that a user can employ the MathJax +contectual menu to select the other other renderer if he or she +wishes. + + +.. _html-css-with-ie8: + +HTML-CSS with IE8 +================= + +Internet Explorer 8 has at least eight different rendering modes in +which can operate, and that are triggered by the `DOCTYPE` of the +document being viewed. It's "quirks" mode is its fasted mode, and its +"IE8 standards" mode is its slowest. This is the mode triggered by +strict HTML document types, and since most modern content management +systems now include a `DOCTYPE` that activates "standards" mode, IE8 +will operate in its slowest manner. This is particularly apparent +when MathJax is used, since IE8 in standards mode runs 20 to 30 times +slower than its does in its IE7 emulation mode, and 60 times slower +than in quirks mode. + +Most users find this speed reduction unacceptable when there is much +mathematics on the page. To overcome this problem, you may wish to +tell IE8 to use its IE7 emulation mode rather than its IE8 standards +mode. You can accomplish this by including the line + +.. code-block:: html + + + +at the top of the ```` section of your HTML documents. This +lets you keep the strict `DOCTYPE` for validation purposes, while +still managing to get reasonable perforance from Internext Explorer +8. Note that this line must come at the beginning of the ````, +before any stylesheets or other content are loaded. + +Altertnatively, you can use the `MMLorHTML` configuration file +described above to select NativeMML output when possible, and request +that your users install the `MathPlayer plugin +`_, which will render +the mathematics much more quickly. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/index.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/index.txt new file mode 100644 index 00000000..2349c3d8 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/index.txt @@ -0,0 +1,65 @@ +.. _platforms: + +====================================== +Using MathJax in popular web platforms +====================================== + +Most web-based content-management systems include a theme or template +layer that determines how the pages look, and that loads information +common to all pages. Such theme files provide one popular way to +include MathJax in your web templates in the absense of +MathJax-specific plugins for the system you are using. To take +advantage of this approach, you will need access to your theme files, +which probably means you need to be an administrator for the site; if +you are not, you may need to have an administrator do these steps for +you. + +To enable MathJax in your web platform, add the line:: + + + +(where ``path-to-MathJax`` is the web-address of the main MathJax +directory for your server) either just before the ```` tag in +your theme file, or at the end of the file if it contains no +````. + +The theme files for various popular platforms are: + + `WordPress `_ + ``wp-content/themes/[current_theme]/header.php`` + + `Movable Type `_ + ``[current_theme_templates]/html_head.mhtml`` + + `Drupal `_ + ``themes/[current_theme]/page.tpl.php`` + + `Joomla `_ + ``templates/[current_theme]/index.php`` + + `MediaWiki `_ + ``skins/[current_skin].php`` + + `TiddlyWiki `_ + ``*.php`` (Whatever you call your TiddlyWiki php file) + + `Moodle `_ + ``theme/[current_theme]/header.html`` + +Keep in mind that this will enable MathJax for your current +theme/template only. If you change themes or update your theme, you +will have to repeat these steps. + + +Insructions for Specific Platforms +================================== + +Some programs, such as WordPress and Moveable Type, allow you to edit +template files from inside their administrator interfaces. Specific +instructions for these are given via the links below. + +.. toctree:: + :maxdepth: 1 + + Wordpress + Movable Type diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/movable-type.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/movable-type.txt new file mode 100644 index 00000000..86ae2dba --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/movable-type.txt @@ -0,0 +1,41 @@ +.. _platform-movable-type: + +========================== +Using MathJax in WordPress +========================== + +These instructions assume you already have placed the MathJax files on +your server (see :ref:`Installing and Testing MathJax `). + +1. Open Moveable Type Admin interface for the site on which you want to enable + MathJax. + +2. In the dashboard menu on the left, open up the Design menu. This + should show you the templates you are currently using on the site. + + .. image:: ../images/mt_menu.png + + +3. Scroll down to the Template Modules section in the template list + and open the `HTML Head` template. + + .. image:: ../images/mt_templates.png + +4. At the end of the file, insert + + .. code-block:: html + + + + where ``path-to-MathJax`` is replaced by the web-address of the + main MathJax dorectory on your server. + + .. image:: ../images/mt_head.png + +5. Save the file. This should enable MathJax, so you should be able + to start adding mathematical content to your pages. Use the + ``config/MathJas.js`` file in the MathJax directory to configure + MathJax to your needs (see :ref:`Configuring MathJax + ` for details). + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/wordpress.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/wordpress.txt new file mode 100644 index 00000000..efe1063e --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/platforms/wordpress.txt @@ -0,0 +1,42 @@ +.. _platform-wordpress: + +=============================== +Installing MathJax in WordPress +=============================== + +These instructions assume you already have placed the MathJax files on +your server (see :ref:`Installing MathJax `). + +1. Open the WordPress admin interface. + +2. In the administration menu on the left, open up the `Appearance` + menu and click on the `Editor` submenu option. + + .. image:: ../images/wp_menu.png + + When you click on the editor option, WordPress should open up the + first stylesheet in the current theme. + +3. In the template list on the right side of the page, click on the + header file (it should be ``header.php``). + + .. image:: ../images/wp_templates.png + + This part depends slightly on how your current theme is written. + In the ``header.php`` file, look for the end-of-head tag, + ````. If you find it, insert + + .. code-block:: html + + + + just before that. Otherwise, insert the same code at the very + bottom of the file. Here, ``path-to-MathJax`` should be replaced + by the web-address of the main MathJax directory on your server, + e.g., ``src="/mathjax/MathJax.js"``. + +4. Save the file. This should enable MathJax, so you should be able to + start adding mathematical content to your pages. Use the + ``config/MathJas.js`` file in the MathJax directory to configure + MathJax to your needs (see :ref:`Configuring MathJax + ` for details). diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/queues.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/queues.txt new file mode 100644 index 00000000..d85fa50d --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/queues.txt @@ -0,0 +1,254 @@ +.. _using-queues: + +************ +Using Queues +************ + +The `callback queue` is one of MathJax's main tools for synchronizing +its actions, both internally, and with external programs, like +javascript code that you may write as part of dynamic web pages. +Because many actions in MathJax (like loading files) operate +asynchornously, MathJax needs a way to coordinate those actions so +that they occur in the right order. The +`MathJax.Callback.Queue` object provides that mechanism. + +A `callback queue` is a list of commands that will be performed one at +a time, in order. If the return value of one of the commands is a +`Callback` object, processing is suspended until that callback is +called, and then processing of the commands is resumed. In this way, +if a command starts an asynchronous operation like loading a file, it +can return the callback for that file-load operation and the queue +will wait until the file has loaded before continuing. Thus a queue +can be used to guarantee that commands don't get performed until other +ones are known to be finished, even if those commands usually operate +asynchronously. + + +Constructing Queues +=================== + +A queue is created via the :meth:`MathJax.Callback.Queue()` command, +which returns a `MathJax.Callback.Queue` object. The queue +itself consists of a series of commands given as callback +specifications (see :ref:`Using Callbacks ` for +details on callbacks), which allow you to provide functions (together +with their arguments) to be executed. You can provide the collection +of callback specifications when the queue is created by passing them +as arguments to :meth:`MathJax.Callback.Queue()`, or you can create an +empty queue to which commands are added later. Once a +`MathJax.Callback.Queue` object is created, you can push +additional callbacks on the end of the queue; if the queue is empty, +the command will be performed immediately, while if the queue is +waiting for another command to complete, the new command will be +queued for later processing. + +For example, + +.. code-block:: javascript + + function f(x) {alert(x)} + var queue = MathJax.Callback.Queue([f, 15], [f, 10], [f, 5]); + queue.Push([f, 0]); + +would create a queue containing three commands, each calling the +function ``f`` with a different input, that are performed in order. A +fourth command is then added to the queue, to be performed after the +other three. In this case, the result will be four alerts, the first +with the number 15, the second with 10, the third with 5 and the +fourth with 0. Of course ``f`` is not a function that operates +asynchronously, so it would have been easier to just call ``f`` four +times directly. The power of the queue comes from calling commands +that could operate asynchronously. For example: + +.. code-block:: javascript + + function f(x) {alert(x)} + MathJax.Callback.Queue( + [f, 1], + ["Require", MathJax.Ajax, "[MathJax]/extensions/AMSmath.js"], + [f, 2] + ); + +Here, the command ``MathJax.Ajax.require("extensions/AMSmath.js")`` is +queued between two calls to ``f``. The first call to ``f(1)`` will be +made immediately, then the :meth:`MathJax.Ajax.Require` statement will +be performed. Since the ``Require`` method loads a file, it operates +asynchronously, and its return value is a `MathJax.Callback` +object that will be called when the file is loaded. The call to +``f(2)`` will not be made until that callback is performed, +effectively synchronizing the second call to ``f`` with the completion +of the file loading. This is equivalent to + +.. code-block:: javascript + + f(1); + MathJax.Ajax.Require("[MathJax]/extensions/AMSmath.js", [f, 2]); + +since the ``Require()`` command allows you to specify a (single) +callback to be performed on the completion of the file load. Note, +however, that the queue could be used to synchronize several file +loads along with multiple function calls, so is more flexible. + +For example, + +.. code-block:: javascript + + MathJax.Callback.Queue( + ["Require", MathJax.Ajax, "[MathJax]/extensions/AMSmath.js"], + [f, 1], + ["Require", MathJax.Ajax, "[MathJax]/config/local/AMSmathAdditions.js"], + [f, 2] + ); + +would load the AMSmath extension, then call ``f(1)`` then load the +local AMSmath modifications, and then call ``f(2)``, with each action +waiting for the previous one to complete before being performed +itself. + + +Callbacks versus Callback Specifications +======================================== + +If one of the callback specifications is an actual callback object +itself, then the queue will wait for that action to be performed +before proceeding. For example, + +.. code-block:: javascript + + MathJax.Callback.Queue( + [f, 1], + MathJax.Ajax.Require("[MathJax]/extensions/AMSmath.js"), + [f, 2], + ); + +starts the loading of the AMSmath extension before the queue is +created, and then creates the queue containing the call to ``f``, the +callback for the file load, and the second call to ``f``. The queue +performs ``f(1)``, waits for the file load callback to be called, and +then calls ``f(2)``. The difference between this and the second +example above is that, in this example the file load is started before +the queue is even created, so the file is potentially loaded and +executed before the call to ``f(1)``, while in the example above, the +file load is guaranteed not to begin until after ``f(1)`` is executed. + +As a further example, consider + +.. code-block:: javascript + + MathJax.Callback.Queue( + MathJax.Ajax.Require("[MathJax]/extensions/AMSmath.js"), + [f, 1], + MathJax.Ajax.Require("[MathJax]/config/local/AMSmathAdditions.js"), + [f, 2] + ); + +in comparison to the example above that uses ``["Require", +MathJax.Ajax, "[MathJax]/extensions/AMSmath.js"]`` and ``["Require", +MathJax.Ajax, "[MathJax]/config/local/AMSmathAdditions.js"]`` instead. In that +example, ``AMSmath.js`` is loaded, then ``f(1)`` is called, then the +local additions are loaded, then ``f(2)`` is called. + +Here, however, both file loads are started before the queue is +created, and are operating in parallel (rather than sequentially as in +the earlier example). It is possible for the loading of the local +additions to complete before the AMSmath extension is loaded in this +case, which was guaranteed **not** to happen in the other example. +Note, however, that ``f(1)`` is guaranteed not to be performed until +after the AMSmath extensions load, and ``f(2)`` will not occur until +after both files are loaded. + +In this way, it is possible to start asynchronous loading of several +files simultaneously, and wait until all of them are loaded (in +whatever order) to perform some command. For instance, + +.. code-block:: javascript + + MathJax.Callback.Queue( + MathJax.Ajax.Require("file1.js"), + MathJax.Ajax.Require("file2.js"), + MathJax.Ajax.Require("file3.js"), + MathJax.Ajax.Require("file4.js"), + [f, "all done"] + ); + +starts four files loading all at once, and waits for all four to +complete before calling ``f("all done")``. The order in which they +complete is immaterial, and they all are being requested +simultaneously. + + +The MathJax Processing Queue +============================ + +MathJax uses a queue stored as ``MathJax.Hub.queue`` to regulate its +own actions so that they operate in the right order even when some +of them include asynchronous operations. You can take advantage of +that queue when you make calls to MathJax methods that need to be +synchronized with the other actions taken by MathJax. It may not +always be apparent, however, which methods fall into that category. + +The main source of asynchronous actions in MathJax is the loading of +external files, so any action that may cause a file to be loaded may +act asynchronously. Many important actions do so, including some that +you might not expect; e.g., typesetting mathematics can cause files to +be loaded. This is because some TeX commands, for example, are rare +enough that they are not included in the core TeX input processor, but +instead are defined in extensions that are loaded automatically when +needed. The typesetting of an expression containing one of these TeX +commands can cause the typesetting process to be suspended while the +file is loaded, and then restarted when the extension has become +evailable. + +As a result, any call to :meth:`MathJax.Hub.Typeset()` (or +:meth:`MathJax.Hub.Process()`, or :meth:`MathJax.Hub.Update()`, etc.) +could return long before the mathematics is actually typeset, and the +rest of your code may run before the mathematics is available. If you +have code that relys on the mathematics being visible on screen, you +will need to break that out into a separate operation that is +synchronized with the typesetting via the MathJax queue. + +Furthermore, your own typesetting calls may need to wait for file loading +to occur that is already underway, so even if you don't need to access +the mathematics after it is typeset, you may still need to queue the +typeset command in order to make sure it is properly synchronized with +*previous* typeset calls. For instance, if an earlier call +started loading an extension and you start another typeset call before +that extension is fully loaded, MathJax's internal state may be in +flux, and it may not be prepared to handle another typeset operation +yet. This is even more important if you are using other libraries +that may call MathJax, in which case your code may not be aware of the +state that MathJax is in. + +For these reasons, it is always best to perform typesetting operations +through the MathJax queue, and the same goes for any other action +that could cause files to load. A good rule of thumb is that, if a +MathJax function includes a callback argument, that function may operate +asynchronously; you should use the MathJax queue to perform it and +any actions that rely on its results. + +To place an action in the MathJax queue, use the +:meth:`MathJax.Hub.Queue()` command. For example + +.. code-block:: javascript + + MathJax.Hub.Queue(["Typeset",MathJax.Hub,"MathDiv"]); + +would queue the command ``MathJax.Hub.Typeset("MathDiv")``, causing +the contents of the DOM element with `id` equal to ``MathDiv`` to be +typeset. + +One of the uses of the MathJax queue is to allow you to synchronize an +action with the startup process for MathJax. If you want to have a +function performed after MathJax has become completely set up (and +performed its initial typesetting of the page), you can push it onto +the ``MathJax.Hub.queue`` so that it won't be performed until MathJax +finishes everything it has queued when it was loaded. For example, + +.. code-block:: html + + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/signals.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/signals.txt new file mode 100644 index 00000000..f4ca8f6c --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/signals.txt @@ -0,0 +1,161 @@ +.. _using-signals: + +************* +Using Signals +************* + +Because much of MathJax operates asynchronously, it is important for +MathJax to be able to indicated to other components operating on the +page that certain actions have been taken. For example, as MathJax is +starting up, it loads external files such as its configuration files +and the various input and output :term:`jax` that are used on the +page. This means that MathJax may not be ready to run until well +after the `` + +in your document's ```` block. Here, ``path-to-MathJax`` should +be replaced by the URL for the main MathJax directory, so if you have +put the ``MathJax`` directory at the top level of you server's web +site, you could use + +.. code-block:: html + + + +to load MathJax in your page. For example, your page could look like + +.. code-block:: html + + + + ... + + + + ... + + + +Although it is possible to load MathJax from a site other than your +own web server, there are issues involved in doing so that you need to +take into consideration. See the :ref:`Notes About Shared Servers +` for more details. Please do **not** link to +the copy of MathJax at ``www.mathjax.org``, as we do not have the +resources to act as a web service for all the sites on the web that +would like to display mathematics. If you are able to run MathJax +from your own server, please do so (this will probably give you better +response time in any case). + + +Putting mathematics in a web page +================================= + +To put mathematics in your web page, you can use either TeX and LaTeX +notation, or MathML notation (or both); the configuration file tells +MathJax which you want to use, and how you plan to indicate the +mathematics when you are using TeX notation. The following sections +tell you how to use each of these formats. + + +.. _tex-and-latex-input: + +TeX and LaTeX input +------------------- + +To process mathematics that is written in :term:`TeX` or :term:`LaTeX` +format, include ``"input/TeX"`` in your configuration's `jax` array, +and add ``"tex2jax.js"`` to the `extensions` array so that MathJax +will look for TeX-style math delimiters to identify the mathematics on +the page. + +.. code-block:: javascript + + extensions: ["tex2math.js"], + jax: ["input/TeX", "output/HTML-CSS"] + +Note that the default math delimiters are ``$$...$$`` and ``\[...\]`` +for displayed mathematics, and ``\(...\)`` for in-line mathematics. +In particular, the ``$...$`` in-line delimiters are **not** used by +default. That is because dollar signs appear too often in +non-mathematical settings, which could cause some text to be treated +as mathematics unexpectedly. For example, with single-dollar +delimiters, "... the cost is $2.50 for the first one, and $2.00 for +each additional one ..." would cause the phrase "2.50 for the first +one, and" to be treated as mathematics since it falls between dollar +signs. For this reason, if you want to use single-dollars for in-line +math mode, you must enable that explicitly in your configuration: + +.. code-block:: javascript + + tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} + +See the ``config/MathJax.js`` file, or the :ref:`tex2jax configuration +options ` page, for additional configuration +parameters that you can specify for the ``tex2jax`` preprocessor. + +Here is a complete sample page containing TeX mathematics (which +assumes that ``config/MathJax.js`` is configured as described above): + +.. code-block:: html + + + + MathJax TeX Test Page + + + + When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are + $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ + + + +There are a number of extensions for the TeX input processor that you +might want to add to the `extensions` array. These include: + +- `TeX/AMSmath.js`, which defines the AMS math environments and + macros, + +- `TeX/AMSsymbols.js`, which defines the macros for the symbols in + the msam10 and msbm10 fonts, + +- `TeX/noErrors.js`, which shows the original TeX code rather than + an error message when there is a problem processing the TeX, and + +- `TeX/noUndefined.js`, which prevents undefined macros from + producing an error message, and instead shows the macro name in red. + +For example, + +.. code-block:: javascript + + extensions: ["tex2math.js","TeX/noErrors.js","TeX/noUndefined.js", + "TeX/AMSmath.js","TeX/AMSsymbols.js"] + +loads all four extensions, in addition to the ``tex2math`` +preprocessor. + + +MathML input +------------ + +To process mathematics written in :term:`MathML`, include +``"input/MathML"`` in your configuration's `jax` array, and add +``"mml2jax.js"`` to the `extensions` array so that MathJax will +locate the ```` elements in the page automatically. + +.. code-block:: javascript + + extensions: ["mml2jax.js"], + jax: ["input/MathML", "output/HTML-CSS"] + +With this configuration, you would mark your mathematics using +standard ```` tags, where ```` represents +displayed mathematics and ```` or just +```` represents in-line mathematics. + +Note that this will work in HTML files, not just XHTML files (MathJax +works with both), and that the web page need not be served with any +special MIME-type. Also note that, unless you are using XHTML rather +than HTML, you should not include a namespace prefix for your +```` tags; for example, you should not use ```` except +in a file where you have tied the ``m`` namespace to the MathML DTD. + +Here is a complete sample page containing MathML mathematics (which +assumes that ``config/MathJax.js`` is configured as described above): + +.. code-block:: html + + + + MathJax MathML Test Page + + + + + When a0, + there are two solutions to + ax2 + + bx + + c = 0 + and they are + + x = + + + + + b + ± + + b2 + + 4ac + + + 2a + + + . + + + + + +The ``mml2jax`` has only a few configuration options; see the +``config/MathJax.js`` file or the :ref:`mml2jax configuration options +` page for more details. + + +Where to go from here? +====================== + +If you have followed the instructions above, you should now have +MathJax installed and configured on your web server, and you should be +able to use it to write web pages that include mathematics. At this +point, you can start making pages that contain mathematical content! + +You could also read more about the details of how to :ref:`customize +MathJax `. + +If you are trying to use MathJax in blog or wiki software or in some +other content-management system, you might want to read about :ref:`using +MathJax in popular platforms `. + +If you are working on dynamic pages that include mathematics, you +might want to read about the :ref:`MathJax Application Programming +Interface ` (its API), so you know how to include +mathematics in your interactive pages. + +If you are having trouble getting MathJax to work, you can read more +about :ref:`installing MathJax `, or :ref:`loading and +configuring MathJax `. + +Finally, if you have questions or comments, or want to help support +MathJax, you could visit the :ref:`MathJax community forums +` or the :ref:`MathJax bug tracker +`. diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/startup.txt b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/startup.txt new file mode 100644 index 00000000..3ae50c5c --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_sources/startup.txt @@ -0,0 +1,152 @@ +.. _startup-sequence: + +**************************** +The MathJax Startup Sequence +**************************** + +When you load ``MathJax.js`` into a web page, it configures itself and +immediately begins loading the components it needs. As MathJax starts +up, it uses its :ref:`signaling mechanism ` +to indicate the actions that it is taking so that MathJax extensions +can tie into the initialization process, and so other applications +within the page can synchronize their actions with MathJax. + +The startup process performs the following actions: + +- It creates the ``MathJax`` variable, and defines the following + subsystems: + + - ``MathJax.Object`` (object-oriented programming model) + - ``MathJax.Callback`` (callbacks, signals, and queues) + - ``MathJax.Ajax`` (file-loading and style-creation code) + - ``MathJax.HTML`` (support code for creating HTML elements) + - ``MathJax.Message`` (manages the menu line in the lower left) + - ``MathJax.Hub`` (the core MathJax functions) + +.. + +- It then creates the base ``MathJax.InputJax``, + ``MathJax.OutputJax``, and ``MathJax.ElementJax`` objects. + +.. + +- MathJax sets up the default configuration, and creates the + signal objects used for the startup and hub actions. + +.. + +- MathJax locates the `` + + + + + + + Type some TeX code: + +

+ +

+ You typed: ${}$ +
+ + + diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/basic.css b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/basic.css new file mode 100644 index 00000000..69f30d4f --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/basic.css @@ -0,0 +1,509 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +img { + border: 0; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +.align-left { + text-align: left; +} + +.align-center { + clear: both; + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.refcount { + color: #060; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/doctools.js b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/doctools.js new file mode 100644 index 00000000..eeea95ea --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/doctools.js @@ -0,0 +1,247 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for all documentation. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +} + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * small function to check if an array contains + * a given item. + */ +jQuery.contains = function(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == item) + return true; + } + return false; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('.sidebar .this-page-menu')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/file.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/file.png new file mode 100644 index 00000000..d18082e3 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/file.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/jquery.js b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/jquery.js new file mode 100644 index 00000000..7c243080 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/jquery.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mathjax_mathml.user.js b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mathjax_mathml.user.js new file mode 100644 index 00000000..5a98950c --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mathjax_mathml.user.js @@ -0,0 +1,22 @@ +// ==UserScript== +// @name MathJax MathML +// @namespace http://www.mathjax.org/ +// @description Insert MathJax into pages containing MathML +// @include * +// ==/UserScript== + +if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + if ((document.getElementsByTagName("math").length > 0) || + (document.getElementsByTagNameNS == null ? false : + (document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math").length > 0))) { + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'extensions:["mml2jax.js"],' + + 'jax:["input/MathML","output/HTML-CSS"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); + } +} diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mathjax_wikipedia.user.js b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mathjax_wikipedia.user.js new file mode 100644 index 00000000..3c0e7bc3 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mathjax_wikipedia.user.js @@ -0,0 +1,35 @@ +// ==UserScript== +// @name MathJax in Wikipedia +// @namespace http://www.mathjax.org/ +// @description Insert MathJax into Wikipedia pages +// @include http://en.wikipedia.org/wiki/* +// ==/UserScript== + +if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + // + // Replace the images with MathJax scripts of type math/tex + // + var images = document.getElementsByTagName('img'); + for (var i = images.length - 1; i >= 0; i--) { + var img = images[i]; + if (img.className === "tex") { + var script = document.createElement("script"); script.type = "math/tex"; + if (window.opera) {script.innerHTML = img.alt} else {script.text = img.alt} + img.parentNode.replaceChild(script,img); + } + } + // + // Load MathJax and have it process the page + // + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'config: ["MMLorHTML.js"],' + + 'extensions:["TeX/noErrors.js","TeX/noUndefined.js",' + + '"TeX/AMSmath.js","TeX/AMSsymbols.js"],' + + 'jax:["input/TeX"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); +} diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/minus.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/minus.png new file mode 100644 index 00000000..da1c5620 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/minus.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mj.css b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mj.css new file mode 100644 index 00000000..ffb3b8ee --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/mj.css @@ -0,0 +1,223 @@ +/** + * Sphinx stylesheet -- default theme + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #d4e9f7; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #222222; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #191a19; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #3a3a3a; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #3a3a3a; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #3a3a3a; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #3a3a3a; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #3a3a3a; +} + +div.sphinxsidebar ul li { + margin-top: .2em; +} + +div.sphinxsidebar a { + color: #3a8942; +} + +div.sphinxsidebar input { + border: 1px solid #3a8942; + font-family: sans-serif; + font-size: 1em; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-top: 1px solid #cccccc; + border-bottom: 2px solid #cccccc; + margin: 30px -20px 20px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; padding-left: 20px; } +div.body h4 { font-size: 120%; padding-left: 20px; } +div.body h5 { font-size: 110%; padding-left: 20px; } +div.body h6 { font-size: 100%; padding-left: 20px; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: #f1f8ff; + color: #333333; + line-height: 130%; + border: 2px solid #6799b3; + border-left: none; + border-right: none; +} + +tt { + background-color: #ecf0f3; + padding: 0 1px 0 1px; +/* font-size: 0.95em;*/ +} + +.warning tt { + background: #efc2c2; +} + +.note tt { + background: #d6d6d6; +} \ No newline at end of file diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/plus.png b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/plus.png new file mode 100644 index 00000000..b3cb3742 Binary files /dev/null and b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/plus.png differ diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/pygments.css b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/pygments.css new file mode 100644 index 00000000..1f2d2b61 --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/pygments.css @@ -0,0 +1,61 @@ +.hll { background-color: #ffffcc } +.c { color: #408090; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #007020; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.cp { color: #007020 } /* Comment.Preproc */ +.c1 { color: #408090; font-style: italic } /* Comment.Single */ +.cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #303030 } /* Generic.Output */ +.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0040D0 } /* Generic.Traceback */ +.kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #007020 } /* Keyword.Pseudo */ +.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #902000 } /* Keyword.Type */ +.m { color: #208050 } /* Literal.Number */ +.s { color: #4070a0 } /* Literal.String */ +.na { color: #4070a0 } /* Name.Attribute */ +.nb { color: #007020 } /* Name.Builtin */ +.nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.no { color: #60add5 } /* Name.Constant */ +.nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.ne { color: #007020 } /* Name.Exception */ +.nf { color: #06287e } /* Name.Function */ +.nl { color: #002070; font-weight: bold } /* Name.Label */ +.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.nt { color: #062873; font-weight: bold } /* Name.Tag */ +.nv { color: #bb60d5 } /* Name.Variable */ +.ow { color: #007020; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #208050 } /* Literal.Number.Float */ +.mh { color: #208050 } /* Literal.Number.Hex */ +.mi { color: #208050 } /* Literal.Number.Integer */ +.mo { color: #208050 } /* Literal.Number.Oct */ +.sb { color: #4070a0 } /* Literal.String.Backtick */ +.sc { color: #4070a0 } /* Literal.String.Char */ +.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #4070a0 } /* Literal.String.Double */ +.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #4070a0 } /* Literal.String.Heredoc */ +.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.sx { color: #c65d09 } /* Literal.String.Other */ +.sr { color: #235388 } /* Literal.String.Regex */ +.s1 { color: #4070a0 } /* Literal.String.Single */ +.ss { color: #517918 } /* Literal.String.Symbol */ +.bp { color: #007020 } /* Name.Builtin.Pseudo */ +.vc { color: #bb60d5 } /* Name.Variable.Class */ +.vg { color: #bb60d5 } /* Name.Variable.Global */ +.vi { color: #bb60d5 } /* Name.Variable.Instance */ +.il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/searchtools.js b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/searchtools.js new file mode 100644 index 00000000..513a7bad --- /dev/null +++ b/lib/gollum/frontend/public/javascript/MathJax/docs/html/_static/searchtools.js @@ -0,0 +1,505 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for the full-text search. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words, hlwords is the list of normal, unstemmed + * words. the first one is used to find the occurance, the + * latter for highlighting it. + */ + +jQuery.makeSearchSummary = function(text, keywords, hlwords) { + var textLower = text.toLowerCase(); + var start = 0; + $.each(keywords, function() { + var i = textLower.indexOf(this.toLowerCase()); + if (i > -1) + start = i; + }); + start = Math.max(start - 120, 0); + var excerpt = ((start > 0) ? '...' : '') + + $.trim(text.substr(start, 240)) + + ((start + 240 - text.length) ? '...' : ''); + var rv = $('
').text(excerpt); + $.each(hlwords, function() { + rv = rv.highlightText(this, 'highlighted'); + }); + return rv; +} + +/** + * Porter Stemmer + */ +var PorterStemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + + +/** + * Search Module + */ +var Search = { + + _index : null, + _queued_query : null, + _pulse_status : -1, + + init : function() { + var params = $.getQueryParameters(); + if (params.q) { + var query = params.q[0]; + $('input[name="q"]')[0].value = query; + this.performSearch(query); + } + }, + + loadIndex : function(url) { + $.ajax({type: "GET", url: url, data: null, success: null, + dataType: "script", cache: true}); + }, + + setIndex : function(index) { + var q; + this._index = index; + if ((q = this._queued_query) !== null) { + this._queued_query = null; + Search.query(q); + } + }, + + hasIndex : function() { + return this._index !== null; + }, + + deferQuery : function(query) { + this._queued_query = query; + }, + + stopPulse : function() { + this._pulse_status = 0; + }, + + startPulse : function() { + if (this._pulse_status >= 0) + return; + function pulse() { + Search._pulse_status = (Search._pulse_status + 1) % 4; + var dotString = ''; + for (var i = 0; i < Search._pulse_status; i++) + dotString += '.'; + Search.dots.text(dotString); + if (Search._pulse_status > -1) + window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something + */ + performSearch : function(query) { + // create the required interface elements + this.out = $('#search-results'); + this.title = $('

' + _('Searching') + '

').appendTo(this.out); + this.dots = $('').appendTo(this.title); + this.status = $('

').appendTo(this.out); + this.output = $(' -
-
- {{>editor}} -
+
+ {{>editor}}
+ + - - {{title}} diff --git a/lib/gollum/frontend/templates/page.mustache b/lib/gollum/frontend/templates/page.mustache index 4cafd2bf..b9ac37a5 100644 --- a/lib/gollum/frontend/templates/page.mustache +++ b/lib/gollum/frontend/templates/page.mustache @@ -1,12 +1,13 @@
@@ -47,3 +48,5 @@

Last edited by {{author}}, {{date}}

+ + \ No newline at end of file diff --git a/lib/gollum/frontend/templates/search.mustache b/lib/gollum/frontend/templates/search.mustache index f6a413fb..1d5a7d4e 100644 --- a/lib/gollum/frontend/templates/search.mustache +++ b/lib/gollum/frontend/templates/search.mustache @@ -1,19 +1,38 @@ -
-
-
-
- Home | -
-
-

Search for “{{query}}”

-
- {{#has_results}} - - {{/has_results}} -
-
+
+ +
+ +{{#has_results}} +
    + {{#results}} +
  • + {{name}} + ({{count}} matches) +
  • + {{/results}} +
+{{/has_results}} + +{{#no_results}} +

+ There are no results for your search {{query}}. +

+{{/no_results}} + +
+ +
+ diff --git a/lib/gollum/frontend/templates/searchbar.mustache b/lib/gollum/frontend/templates/searchbar.mustache new file mode 100644 index 00000000..1a54a919 --- /dev/null +++ b/lib/gollum/frontend/templates/searchbar.mustache @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/lib/gollum/frontend/views/create.rb b/lib/gollum/frontend/views/create.rb index a4cce0cf..073cc5af 100644 --- a/lib/gollum/frontend/views/create.rb +++ b/lib/gollum/frontend/views/create.rb @@ -9,11 +9,11 @@ module Precious "Create a new page" end - def show_title + def is_create_page true end - def hidden_title + def is_edit_page false end diff --git a/lib/gollum/frontend/views/edit.rb b/lib/gollum/frontend/views/edit.rb index 15bc5727..bf789ed0 100644 --- a/lib/gollum/frontend/views/edit.rb +++ b/lib/gollum/frontend/views/edit.rb @@ -9,11 +9,11 @@ module Precious @name.gsub('-', ' ') end - def edit_title + def is_create_page false end - def hidden_title + def is_edit_page true end diff --git a/lib/gollum/frontend/views/search.rb b/lib/gollum/frontend/views/search.rb index 31789255..bea755a1 100644 --- a/lib/gollum/frontend/views/search.rb +++ b/lib/gollum/frontend/views/search.rb @@ -3,9 +3,17 @@ module Precious class Search < Layout attr_reader :content, :page, :footer, :results, :query + def title + "Search results for " + @query + end + def has_results !@results.empty? end + + def no_results + @results.empty? + end end end diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index 2a78bbbf..4c72c3b9 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -11,7 +11,7 @@ module Gollum def initialize(page) @wiki = page.wiki @name = page.filename - @data = page.raw_data + @data = page.text_data @version = page.version.id @dir = ::File.dirname(page.path) @tagmap = {} @@ -27,9 +27,10 @@ module Gollum # # Returns the formatted String content. def render(no_follow = false) - sanitize_options = no_follow ? - HISTORY_SANITIZATION_OPTIONS : - SANITIZATION_OPTIONS + sanitize_options = no_follow ? + @wiki.history_sanitization : + @wiki.sanitization + data = extract_tex(@data) data = extract_code(data) data = extract_tags(data) @@ -43,7 +44,7 @@ module Gollum end data = process_tags(data) data = process_code(data) - data = Sanitize.clean(data, sanitize_options) + data = Sanitize.clean(data, sanitize_options.to_hash) if sanitize_options data = process_tex(data) data.gsub!(/

<\/p>/, '') data @@ -284,7 +285,7 @@ module Gollum def process_page_link_tag(tag, no_follow = false) parts = tag.split('|') name = parts[0].strip - cname = Page.cname((parts[1] || parts[0]).strip) + cname = @wiki.page_class.cname((parts[1] || parts[0]).strip) tag = if name =~ %r{^https?://} && parts[1].nil? %{#{name}} else @@ -292,7 +293,7 @@ module Gollum link_name = cname page, extra = find_page_from_name(cname) if page - link_name = Page.cname(page.name) + link_name = @wiki.page_class.cname(page.name) presence = "present" end link = ::File.join(@wiki.base_path, CGI.escape(link_name)) diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb index ba091458..6e2e66d7 100644 --- a/lib/gollum/page.rb +++ b/lib/gollum/page.rb @@ -116,6 +116,19 @@ module Gollum @blob && @blob.data end + # Public: A text data encoded in specified encoding. + # + # encoding - An Encoding or nil + # + # Returns a character encoding aware String. + def text_data(encoding=nil) + if raw_data.respond_to?(:encoding) + raw_data.force_encoding(encoding || Encoding::UTF_8) + else + raw_data + end + end + # Public: The formatted contents of the page. # # Returns the String data. @@ -344,4 +357,4 @@ module Gollum end end end -end \ No newline at end of file +end diff --git a/lib/gollum/sanitization.rb b/lib/gollum/sanitization.rb new file mode 100644 index 00000000..72ba2ec9 --- /dev/null +++ b/lib/gollum/sanitization.rb @@ -0,0 +1,109 @@ +module Gollum + + # Encapsulate sanitization options. + # + # This class does not yet support all options of Sanitize library. + # See http://github.com/rgrove/sanitize/. + class Sanitization + # Default whitelisted elements. + ELEMENTS = [ + 'a', 'abbr', 'acronym', 'address', 'area', 'b', 'big', + 'blockquote', 'br', 'button', 'caption', 'center', 'cite', + 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', + 'div', 'dl', 'dt', 'em', 'fieldset', 'font', 'form', 'h1', + 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', + 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', + 'ol', 'optgroup', 'option', 'p', 'pre', 'q', 's', 'samp', + 'select', 'small', 'span', 'strike', 'strong', 'sub', + 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', + 'thead', 'tr', 'tt', 'u', 'ul', 'var' + ].freeze + + # Default whitelisted attributes. + ATTRIBUTES = { + 'a' => ['href'], + 'img' => ['src'], + :all => ['abbr', 'accept', 'accept-charset', + 'accesskey', 'action', 'align', 'alt', 'axis', + 'border', 'cellpadding', 'cellspacing', 'char', + 'charoff', 'class', 'charset', 'checked', 'cite', + 'clear', 'cols', 'colspan', 'color', + 'compact', 'coords', 'datetime', 'dir', + 'disabled', 'enctype', 'for', 'frame', + 'headers', 'height', 'hreflang', + 'hspace', 'ismap', 'label', 'lang', + 'longdesc', 'maxlength', 'media', 'method', + 'multiple', 'name', 'nohref', 'noshade', + 'nowrap', 'prompt', 'readonly', 'rel', 'rev', + 'rows', 'rowspan', 'rules', 'scope', + 'selected', 'shape', 'size', 'span', + 'start', 'summary', 'tabindex', 'target', + 'title', 'type', 'usemap', 'valign', 'value', + 'vspace', 'width'] + }.freeze + + # Default whitelisted protocols for URLs. + PROTOCOLS = { + 'a' => {'href' => ['http', 'https', 'mailto', :relative]}, + 'img' => {'src' => ['http', 'https', :relative]} + }.freeze + + # Gets an Array of whitelisted HTML elements. Default: ELEMENTS. + attr_reader :elements + + # Gets a Hash describing which attributes are allowed in which HTML + # elements. Default: ATTRIBUTES. + attr_reader :attributes + + # Gets a Hash describing which URI protocols are allowed in HTML + # attributes. Default: PROTOCOLS + attr_reader :protocols + + # Gets a Hash describing HTML attributes that Sanitize should add. + # Default: {} + attr_reader :add_attributes + + # Sets a boolean determining whether Sanitize allows HTML comments in the + # output. Default: false. + attr_writer :allow_comments + + def initialize + @elements = ELEMENTS + @attributes = ATTRIBUTES + @protocols = PROTOCOLS + @add_attributes = {} + @allow_comments = false + yield self if block_given? + end + + # Determines if Sanitize should allow HTML comments. + # + # Returns True if comments are allowed, or False. + def allow_comments? + !!@allow_comments + end + + # Modifies the current Sanitization instance to sanitize older revisions + # of pages. + # + # Returns a Sanitization instance. + def history_sanitization + self.class.new do |sanitize| + sanitize.add_attributes['a'] = {'rel' => 'nofollow'} + end + end + + # Builds a Hash of options suitable for Sanitize.clean. + # + # Returns a Hash. + def to_hash + { :elements => elements, + :attributes => attributes, + :protocols => protocols, + :add_attributes => add_attributes, + :allow_comments => allow_comments? + } + end + end +end + diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index 30fade8a..6afd74da 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -15,6 +15,14 @@ module Gollum # Sets the default email for commits. attr_accessor :default_committer_email + # Sets sanitization options. Set to false to deactivate + # sanitization altogether. + attr_writer :sanitization + + # Sets sanitization options. Set to false to deactivate + # sanitization altogether. + attr_writer :history_sanitization + # Gets the page class used by all instances of this Wiki. # Default: Gollum::Page. def page_class @@ -36,6 +44,26 @@ module Gollum ::Gollum::File end end + + # Gets the default sanitization options for current pages used by + # instances of this Wiki. + def sanitization + if @sanitization.nil? + @sanitization = Sanitization.new + end + @sanitization + end + + # Gets the default sanitization options for older page revisions used by + # instances of this Wiki. + def history_sanitization + if @history_sanitization.nil? + @history_sanitization = sanitization ? + sanitization.history_sanitization : + false + end + @history_sanitization + end end self.default_committer_name = 'Anonymous' @@ -46,23 +74,34 @@ module Gollum # to "/". attr_reader :base_path + # Gets the sanitization options for current pages used by this Wiki. + attr_reader :sanitization + + # Gets the sanitization options for older page revisions used by this Wiki. + attr_reader :history_sanitization + # Public: Initialize a new Gollum Repo. # # repo - The String path to the Git repository that holds the Gollum # site. # options - Optional Hash: - # :base_path - String base path for all Wiki links. - # Default: "/" - # :page_class - The page Class. Default: Gollum::Page - # :file_class - The file Class. Default: Gollum::File + # :base_path - String base path for all Wiki links. + # Default: "/" + # :page_class - The page Class. Default: Gollum::Page + # :file_class - The file Class. Default: Gollum::File + # :sanitization - An instance of Sanitization. # # Returns a fresh Gollum::Repo. def initialize(path, options = {}) - @path = path - @repo = Grit::Repo.new(path) - @base_path = options[:base_path] || "/" - @page_class = options[:page_class] || self.class.page_class - @file_class = options[:file_class] || self.class.file_class + @path = path + @repo = Grit::Repo.new(path) + @base_path = options[:base_path] || "/" + @page_class = options[:page_class] || self.class.page_class + @file_class = options[:file_class] || self.class.file_class + @sanitization = options[:sanitization] || self.class.sanitization + @history_sanitization = options[:history_sanitization] || + self.class.history_sanitization + clear_cache end diff --git a/scratch/TODO b/scratch/TODO index 4fd99a9a..b789b739 100644 --- a/scratch/TODO +++ b/scratch/TODO @@ -1,8 +1,23 @@ * Editor * Create rest of markup lang definitions - * Hook up format selector -* Create Error Page -* Create Compare Revisions Page (like, when comparing the two) -* Create Search Results Page + * Finish RDoc + * Finish rst + * Org-mode + * Create inline help for langs + * Create mathjax inline help + * Write Editor/Sidebar implementation notes for Rick -* Write print.css \ No newline at end of file +* Find some clever way to represent page hierarchy. + +HIERARCHY + _Footer.md + _Sidebar.md + Page1.md + projects/ + Page2.md (uses root sidebar) + _Footer.md + experiments/ + _Sidebar.md + Page3.md (uses footer.md) + +Images work the same way. You can keep similar pages in a directory with their own images. \ No newline at end of file diff --git a/scratch/css/gollum.css b/scratch/css/gollum.css index b8b14894..6282cf3b 100644 --- a/scratch/css/gollum.css +++ b/scratch/css/gollum.css @@ -400,4 +400,43 @@ ul.actions { filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3'); background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3)); background: -moz-linear-gradient(top, #599bdc, #3072b3); +} + + +/* @special error */ +#wiki-wrapper.error { + height: 1px; + position: absolute; + overflow: visible; + top: 50%; + width: 100%; +} + +#error { + background-color: #f9f9f9; + border: 1px solid #e4e4e4; + left: 50%; + overflow: hidden; + padding: 2%; + margin: -10% 0 0 -35%; + position: absolute; + width: 70%; + + border-radius: 0.5em; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; +} + +#error h1 { + font-size: 3em; + line-height: normal; + margin: 0; + padding: 0; +} + +#error p { + font-size: 1.2em; + line-height: 1.6em; + margin: 1em 0 0.5em; + padding: 0; } \ No newline at end of file diff --git a/test/examples/yubiwa.git/HEAD b/test/examples/yubiwa.git/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/test/examples/yubiwa.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/examples/yubiwa.git/config b/test/examples/yubiwa.git/config new file mode 100644 index 00000000..c53d818d --- /dev/null +++ b/test/examples/yubiwa.git/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true + ignorecase = true diff --git a/test/examples/yubiwa.git/description b/test/examples/yubiwa.git/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/test/examples/yubiwa.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/examples/yubiwa.git/hooks/applypatch-msg.sample b/test/examples/yubiwa.git/hooks/applypatch-msg.sample new file mode 100755 index 00000000..8b2a2fe8 --- /dev/null +++ b/test/examples/yubiwa.git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +test -x "$GIT_DIR/hooks/commit-msg" && + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} +: diff --git a/test/examples/yubiwa.git/hooks/commit-msg.sample b/test/examples/yubiwa.git/hooks/commit-msg.sample new file mode 100755 index 00000000..6ef1d29d --- /dev/null +++ b/test/examples/yubiwa.git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by git-commit with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/test/examples/yubiwa.git/hooks/post-commit.sample b/test/examples/yubiwa.git/hooks/post-commit.sample new file mode 100755 index 00000000..22668216 --- /dev/null +++ b/test/examples/yubiwa.git/hooks/post-commit.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script that is called after a successful +# commit is made. +# +# To enable this hook, rename this file to "post-commit". + +: Nothing diff --git a/test/examples/yubiwa.git/hooks/post-receive.sample b/test/examples/yubiwa.git/hooks/post-receive.sample new file mode 100755 index 00000000..7a83e17a --- /dev/null +++ b/test/examples/yubiwa.git/hooks/post-receive.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script for the "post-receive" event. +# +# The "post-receive" script is run after receive-pack has accepted a pack +# and the repository has been updated. It is passed arguments in through +# stdin in the form +# +# For example: +# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master +# +# see contrib/hooks/ for a sample, or uncomment the next line and +# rename the file to "post-receive". + +#. /usr/share/doc/git-core/contrib/hooks/post-receive-email diff --git a/test/examples/yubiwa.git/hooks/post-update.sample b/test/examples/yubiwa.git/hooks/post-update.sample new file mode 100755 index 00000000..5323b56b --- /dev/null +++ b/test/examples/yubiwa.git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git-update-server-info diff --git a/test/examples/yubiwa.git/hooks/pre-applypatch.sample b/test/examples/yubiwa.git/hooks/pre-applypatch.sample new file mode 100755 index 00000000..b1f187c2 --- /dev/null +++ b/test/examples/yubiwa.git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} +: diff --git a/test/examples/yubiwa.git/hooks/pre-commit.sample b/test/examples/yubiwa.git/hooks/pre-commit.sample new file mode 100755 index 00000000..439eefda --- /dev/null +++ b/test/examples/yubiwa.git/hooks/pre-commit.sample @@ -0,0 +1,46 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by git-commit with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git-rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ascii filenames set this variable to true. +allownonascii=$(git config hooks.allownonascii) + +# Cross platform projects tend to avoid non-ascii filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test "$(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0')" +then + echo "Error: Attempt to add a non-ascii file name." + echo + echo "This can cause problems if you want to work" + echo "with people on other platforms." + echo + echo "To be portable it is advisable to rename the file ..." + echo + echo "If you know what you are doing you can disable this" + echo "check using:" + echo + echo " git config hooks.allownonascii true" + echo + exit 1 +fi + +exec git diff-index --check --cached $against -- diff --git a/test/examples/yubiwa.git/hooks/pre-rebase.sample b/test/examples/yubiwa.git/hooks/pre-rebase.sample new file mode 100755 index 00000000..be1b06e2 --- /dev/null +++ b/test/examples/yubiwa.git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git-rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git-rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git-rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git-rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"` + perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git-rev-list ^master ^topic next + git-rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git-rev-list master..topic + + if this is empty, it is fully merged to "master". diff --git a/test/examples/yubiwa.git/hooks/prepare-commit-msg.sample b/test/examples/yubiwa.git/hooks/prepare-commit-msg.sample new file mode 100755 index 00000000..36524249 --- /dev/null +++ b/test/examples/yubiwa.git/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by git-commit with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/test/examples/yubiwa.git/hooks/update.sample b/test/examples/yubiwa.git/hooks/update.sample new file mode 100755 index 00000000..fd63b2d6 --- /dev/null +++ b/test/examples/yubiwa.git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to blocks unannotated tags from entering. +# Called by git-receive-pack with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git-cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/test/examples/yubiwa.git/info/exclude b/test/examples/yubiwa.git/info/exclude new file mode 100644 index 00000000..2c87b72d --- /dev/null +++ b/test/examples/yubiwa.git/info/exclude @@ -0,0 +1,6 @@ +# git-ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/test/examples/yubiwa.git/objects/10/fa2ddc4e3b4009d8a453aace10bd6148c1ad00 b/test/examples/yubiwa.git/objects/10/fa2ddc4e3b4009d8a453aace10bd6148c1ad00 new file mode 100644 index 00000000..3da50073 Binary files /dev/null and b/test/examples/yubiwa.git/objects/10/fa2ddc4e3b4009d8a453aace10bd6148c1ad00 differ diff --git a/test/examples/yubiwa.git/objects/52/4b82874327ea7cbf730389964ba7cb3de966de b/test/examples/yubiwa.git/objects/52/4b82874327ea7cbf730389964ba7cb3de966de new file mode 100644 index 00000000..b81d59a6 Binary files /dev/null and b/test/examples/yubiwa.git/objects/52/4b82874327ea7cbf730389964ba7cb3de966de differ diff --git a/test/examples/yubiwa.git/objects/58/3fc201cb457fb3f1480f3e1e5999b119633835 b/test/examples/yubiwa.git/objects/58/3fc201cb457fb3f1480f3e1e5999b119633835 new file mode 100644 index 00000000..e8d6efb3 Binary files /dev/null and b/test/examples/yubiwa.git/objects/58/3fc201cb457fb3f1480f3e1e5999b119633835 differ diff --git a/test/examples/yubiwa.git/objects/87/bc1dd46ab3d3874d4e898d45dd512cc20a7cc8 b/test/examples/yubiwa.git/objects/87/bc1dd46ab3d3874d4e898d45dd512cc20a7cc8 new file mode 100644 index 00000000..12a06cf7 --- /dev/null +++ b/test/examples/yubiwa.git/objects/87/bc1dd46ab3d3874d4e898d45dd512cc20a7cc8 @@ -0,0 +1 @@ +xAj0E)ȒPJC4i${ YA-ދm`jJs{4@;iGO[SJ7Fr{̌g3=cҿ݉91wZFRv-8]ϗሸRش﯏ÄT[N \ No newline at end of file diff --git a/test/examples/yubiwa.git/objects/89/64ed1b4e21aa90e831763bbce9034bfda81b70 b/test/examples/yubiwa.git/objects/89/64ed1b4e21aa90e831763bbce9034bfda81b70 new file mode 100644 index 00000000..334d4080 Binary files /dev/null and b/test/examples/yubiwa.git/objects/89/64ed1b4e21aa90e831763bbce9034bfda81b70 differ diff --git a/test/examples/yubiwa.git/objects/9f/f6dd0660da5fba2d3374adb2b84fa653bb538b b/test/examples/yubiwa.git/objects/9f/f6dd0660da5fba2d3374adb2b84fa653bb538b new file mode 100644 index 00000000..e9d7565d Binary files /dev/null and b/test/examples/yubiwa.git/objects/9f/f6dd0660da5fba2d3374adb2b84fa653bb538b differ diff --git a/test/examples/yubiwa.git/objects/ac/e97abf2b177815a1972d7db22f229f58c83309 b/test/examples/yubiwa.git/objects/ac/e97abf2b177815a1972d7db22f229f58c83309 new file mode 100644 index 00000000..d61523f3 Binary files /dev/null and b/test/examples/yubiwa.git/objects/ac/e97abf2b177815a1972d7db22f229f58c83309 differ diff --git a/test/examples/yubiwa.git/objects/b1/f443863a4816628807fbf86141ebef055dda34 b/test/examples/yubiwa.git/objects/b1/f443863a4816628807fbf86141ebef055dda34 new file mode 100644 index 00000000..0b94e18c Binary files /dev/null and b/test/examples/yubiwa.git/objects/b1/f443863a4816628807fbf86141ebef055dda34 differ diff --git a/test/examples/yubiwa.git/refs/heads/master b/test/examples/yubiwa.git/refs/heads/master new file mode 100644 index 00000000..f4753c0d --- /dev/null +++ b/test/examples/yubiwa.git/refs/heads/master @@ -0,0 +1 @@ +8964ed1b4e21aa90e831763bbce9034bfda81b70 diff --git a/test/test_markup.rb b/test/test_markup.rb index 4a7b54c3..c75ad1a6 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -17,6 +17,14 @@ context "Markup" do assert @wiki.pages[0].formatted_data end + # This test is to assume that Sanitize.clean doesn't raise Encoding::CompatibilityError on ruby 1.9 + test "formats non ASCII-7 character page from Wiki#pages" do + wiki = Gollum::Wiki.new(testpath("examples/yubiwa.git")) + assert_nothing_raised(defined?(Encoding) && Encoding::CompatibilityError) do + assert wiki.page("strider").formatted_data + end + end + ######################################################################### # # Links diff --git a/test/test_wiki.rb b/test/test_wiki.rb index 51cd287b..c4beadea 100644 --- a/test/test_wiki.rb +++ b/test/test_wiki.rb @@ -83,6 +83,19 @@ context "Wiki" do entry = @wiki.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0] assert_equal 'Bilbo-Baggins.md', entry.path end + + test "text_data" do + wiki = Gollum::Wiki.new(testpath("examples/yubiwa.git")) + if String.instance_methods.include?(:encoding) + utf8 = wiki.page("strider").text_data + assert_equal Encoding::UTF_8, utf8.encoding + sjis = wiki.page("sjis").text_data(Encoding::SHIFT_JIS) + assert_equal Encoding::SHIFT_JIS, sjis.encoding + else + page = wiki.page("strider") + assert_equal page.raw_data, page.text_data + end + end end context "Wiki page previewing" do