gollum 2.3.7 → 2.3.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

data/README.md CHANGED
@@ -532,9 +532,9 @@ Your Rack middleware can pass author details to Gollum in a Hash in the session
532
532
  ## WINDOWS FILENAME VALIDATION
533
533
  Note that filenames on windows must not contain any of the following characters `\ / : * ? " < > |`. See [this support article](http://support.microsoft.com/kb/177506) for details.
534
534
 
535
- ## LIB.SO ERROR
535
+ ## CONFIG FILE
536
536
 
537
- `Could not open library 'lib.so'` may be solved by installing `python-devel` on Fedora or `python-dev` on Ubuntu. Gentoo requires a rubypython [patch](https://gist.github.com/2802480) to use python2.7.
537
+ Gollum optionaly takes a `--config file`. See [config.rb](https://github.com/github/gollum/blob/master/config.rb) for an example.
538
538
 
539
539
  ## CONTRIBUTE
540
540
 
data/config.rb ADDED
@@ -0,0 +1,28 @@
1
+ # Example gollum config
2
+ # gollum ../wiki --config config.rb
3
+ #
4
+ # or run from source with
5
+ #
6
+ # bundle exec bin/gollum ../wiki/ --config config.rb
7
+
8
+ # Remove const to avoid
9
+ # warning: already initialized constant FORMAT_NAMES
10
+ #
11
+ # only remove if it's defined.
12
+ # constant Gollum::Page::FORMAT_NAMES not defined (NameError)
13
+ Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
14
+ # limit to one format
15
+ Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown" }
16
+
17
+ =begin
18
+ Valid formats are:
19
+ { :markdown => "Markdown",
20
+ :textile => "Textile",
21
+ :rdoc => "RDoc",
22
+ :org => "Org-mode",
23
+ :creole => "Creole",
24
+ :rest => "reStructuredText",
25
+ :asciidoc => "AsciiDoc",
26
+ :mediawiki => "MediaWiki",
27
+ :pod => "Pod" }
28
+ =end
data/gollum.gemspec CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '2.3.7'
9
- s.date = '2012-11-06'
8
+ s.version = '2.3.8'
9
+ s.date = '2012-11-07'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
12
12
  s.summary = "A simple, Git-powered wiki."
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
53
53
  README.md
54
54
  Rakefile
55
55
  bin/gollum
56
+ config.rb
56
57
  docs/sanitization.md
57
58
  gollum.gemspec
58
59
  lib/gollum.rb
data/lib/gollum.rb CHANGED
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
23
23
  require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
24
24
 
25
25
  module Gollum
26
- VERSION = '2.3.7'
26
+ VERSION = '2.3.8'
27
27
 
28
28
  def self.assets_path
29
29
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -212,4 +212,20 @@ $(document).ready(function() {
212
212
  $('#gollum-revert-form').submit();
213
213
  });
214
214
  }
215
+
216
+ if( $('#wiki-wrapper.edit').length ){
217
+ $("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
218
+ $("#gollum-editor-body").one('change', function(){
219
+ window.onbeforeunload = function(){ return "Leaving will discard all edits!" };
220
+ });
221
+ $.GollumEditor();
222
+ }
223
+
224
+ if( $('#wiki-wrapper.create').length ){
225
+ $("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
226
+ $("#gollum-editor-body").one('change', function(){
227
+ window.onbeforeunload = function(){ return "Leaving will not create a new page!" };
228
+ )};
229
+ $.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
230
+ }
215
231
  });
@@ -1,4 +1,4 @@
1
- <div id="wiki-wrapper">
1
+ <div id="wiki-wrapper" class="create">
2
2
  <div id="head">
3
3
  <h1>Create New Page</h1>
4
4
  </div>
@@ -8,13 +8,5 @@
8
8
  </div>
9
9
  </div>
10
10
  </div>
11
- <script type="text/javascript">
12
- window.onbeforeunload = function(){ return "Leaving will not create a new page!" };
13
- $("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
14
-
15
- jQuery(document).ready(function() {
16
- $.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
17
- });
18
- </script>
19
11
 
20
12
  {{something}}
@@ -10,11 +10,3 @@
10
10
  </div>
11
11
  <div id="wiki-content">{{>editor}}</div>
12
12
  </div>
13
- <script type="text/javascript">
14
- window.onbeforeunload = function(){ return "Leaving will discard all edits!" };
15
- $("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
16
-
17
- jQuery(document).ready(function() {
18
- $.GollumEditor();
19
- });
20
- </script>
data/lib/gollum/wiki.rb CHANGED
@@ -181,8 +181,8 @@ module Gollum
181
181
  self.class.default_ws_subs
182
182
  @history_sanitization = options[:history_sanitization] ||
183
183
  self.class.history_sanitization
184
- @live_preview = options.fetch(:live_preview, true)
185
- @universal_toc = options.fetch(:universal_toc, false)
184
+ @live_preview = options[:live_preview] || true
185
+ @universal_toc = options[:universal_toc] || false
186
186
  @mathjax = options[:mathjax] || false
187
187
  @show_all = options[:show_all] || false
188
188
  @collapse_tree = options[:collapse_tree] || false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.7
4
+ version: 2.3.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-06 00:00:00.000000000 Z
13
+ date: 2012-11-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: grit
@@ -343,6 +343,7 @@ files:
343
343
  - README.md
344
344
  - Rakefile
345
345
  - bin/gollum
346
+ - config.rb
346
347
  - docs/sanitization.md
347
348
  - gollum.gemspec
348
349
  - lib/gollum.rb