Compare commits

...

16 Commits

Author SHA1 Message Date
bootstraponline 2ed262cacd v2.1.9 2012-08-30 20:12:28 -06:00
bootstraponline 29a1ef8f8a Skip doc on install 2012-08-30 20:04:20 -06:00
bootstraponline 772d18ee62 Fix uninstall command 2012-08-30 20:00:54 -06:00
bootstraponline dd604d9942 Fix #498 2012-08-30 19:57:20 -06:00
bootstraponline 85abc83427 v2.1.8 2012-08-30 19:41:54 -06:00
bootstraponline 6d8220629c Fix #500 2012-08-30 19:37:57 -06:00
bootstraponline 6ff7ada096 Fix #495 2012-08-30 18:31:35 -03:00
bootstraponline 8575049de5 Update get /data
Remove leading slash from page
Fix edge case with path set to '/'
2012-08-30 11:40:07 -03:00
bootstraponline bb6fb0c253 pathName is undefined when not found instead of 0 2012-08-30 11:18:02 -03:00
bootstraponline eb2ad9f840 Fix path
.key now returns undefined on failure so path can be 0.
If path is undefined then use an empty string.
2012-08-30 11:14:24 -03:00
bootstraponline d0dd23fc11 Fix path 2012-08-30 11:09:44 -03:00
bootstraponline 7ae4acbdb0 Fix #497 #492
Data url now includes path.
2012-08-30 11:03:11 -03:00
bootstraponline 881590ab37 Merge pull request #494 from releu/fix-requiring-uri-encoding-components
Move require "uri_encode_component"
2012-08-28 18:33:18 -07:00
Jan Bernacki 5e479dc5d9 move require 2012-08-28 22:44:09 +04:00
bootstraponline 7db9c2e762 Merge pull request #487 from jm/master
Fix bug with missing variable 'ext'
2012-08-27 11:08:19 -07:00
Jeremy McAnally 3767a11d21 Rename variables to be more clear and fix reference to non-existent 'ext' variable 2012-07-04 12:33:09 -04:00
9 changed files with 43 additions and 19 deletions
+2 -2
View File
@@ -528,8 +528,8 @@ your changes merged back into core is as follows:
$ gem push gollum-X.Y.Z.gem $ gem push gollum-X.Y.Z.gem
## BUILDING THE GEM FROM MASTER ## BUILDING THE GEM FROM MASTER
$ gem uninstall -aix gollum $ gem uninstall -ax gollum
$ git clone https://github.com/github/gollum.git $ git clone https://github.com/github/gollum.git
$ cd gollum $ cd gollum
gollum$ rake build gollum$ rake build
gollum$ gem install pkg/gollum*.gem gollum$ gem install --no-ri --no-rdoc pkg/gollum*.gem
+2 -2
View File
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 1.8.7" s.required_ruby_version = ">= 1.8.7"
s.name = 'gollum' s.name = 'gollum'
s.version = '2.1.7' s.version = '2.1.9'
s.date = '2012-08-25' s.date = '2012-08-30'
s.rubyforge_project = 'gollum' s.rubyforge_project = 'gollum'
s.summary = "A simple, Git-powered wiki." s.summary = "A simple, Git-powered wiki."
+2 -1
View File
@@ -20,9 +20,10 @@ require File.expand_path('../gollum/markup', __FILE__)
require File.expand_path('../gollum/sanitization', __FILE__) require File.expand_path('../gollum/sanitization', __FILE__)
require File.expand_path('../gollum/tex', __FILE__) require File.expand_path('../gollum/tex', __FILE__)
require File.expand_path('../gollum/web_sequence_diagram', __FILE__) require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
module Gollum module Gollum
VERSION = '2.1.7' VERSION = '2.1.9'
def self.assets_path def self.assets_path
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__)) ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
+7 -3
View File
@@ -100,9 +100,13 @@ module Gollum
tree.blobs.each do |blob| tree.blobs.each do |blob|
next if page_path_scheduled_for_deletion?(index.tree, fullpath) next if page_path_scheduled_for_deletion?(index.tree, fullpath)
file = blob.name.downcase.sub(/\.\w+$/, '')
file_ext = ::File.extname(blob.name).sub(/^\./, '') existing_file = blob.name.downcase.sub(/\.\w+$/, '')
if downpath == file && !(allow_same_ext && file_ext == ext) existing_file_ext = ::File.extname(blob.name).sub(/^\./, '')
new_file_ext = ::File.extname(path).sub(/^\./, '')
if downpath == existing_file && !(allow_same_ext && new_file_ext == existing_file_ext)
raise DuplicatePageError.new(dir, blob.name, path) raise DuplicatePageError.new(dir, blob.name, path)
end end
end end
-1
View File
@@ -9,7 +9,6 @@ require 'gollum/frontend/views/layout'
require 'gollum/frontend/views/editable' require 'gollum/frontend/views/editable'
require 'gollum/frontend/views/has_page' require 'gollum/frontend/views/has_page'
require File.expand_path '../uri_encode_component', __FILE__
require File.expand_path '../helpers', __FILE__ require File.expand_path '../helpers', __FILE__
# Fix to_url # Fix to_url
@@ -16,7 +16,7 @@
<a id='toggle' class='edit' href='javascript:void(0)' onclick='jsm.toggleLeftRight();'><img src='images/lr_24.png' alt='Toggle left to right' title='Toggle left to right'></a> <a id='toggle' class='edit' href='javascript:void(0)' onclick='jsm.toggleLeftRight();'><img src='images/lr_24.png' alt='Toggle left to right' title='Toggle left to right'></a>
</div> </div>
<div class='editor_bg'></div> <div id='editor_bg' class='editor_bg'></div>
<div class='toolpanel_bg'></div> <div class='toolpanel_bg'></div>
<div id='commenttoolpanel' class='toolpanel edit' style='width: 500px; right: 0px; '> <div id='commenttoolpanel' class='toolpanel edit' style='width: 500px; right: 0px; '>
@@ -62,9 +62,10 @@ initAce( commentEditor, commentEditorSession );
var baseUrl = location.pathname.split('/').slice(0,-2).join('/'); var baseUrl = location.pathname.split('/').slice(0,-2).join('/');
// RegExp from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript // RegExp from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript
// Returns value on success and undefined on failure.
$.key = function( key ) { $.key = function( key ) {
var value = new RegExp( '[\\?&]' + key + '=([^&#]*)' ).exec( location.href ); var value = new RegExp( '[\\?&]' + key + '=([^&#]*)' ).exec( location.href );
return ( !value ) ? 0 : value[ 1 ] || 0; return ( !value ) ? undefined : value[ 1 ] || undefined;
} }
// True if &create=true // True if &create=true
@@ -73,10 +74,6 @@ var create = $.key( 'create' );
var pageName = $.key( 'page' ); var pageName = $.key( 'page' );
var pathName = $.key( 'path' ); var pathName = $.key( 'path' );
if ( pathName === 0 ) {
pathName = undefined;
}
defaultCommitMessage = function() { defaultCommitMessage = function() {
var msg = pageName + ' (markdown)'; var msg = pageName + ' (markdown)';
@@ -100,7 +97,7 @@ $.save = function( commitMessage ) {
var newLocation = baseUrl; var newLocation = baseUrl;
function clean( str ) { function clean( str ) {
return str.replace(/^\/+/g, '/'); return str.replace(/^\/+/, '/');
} }
// 'a%2Fb' => a/b // 'a%2Fb' => a/b
@@ -341,10 +338,23 @@ var applyTimeout = function () {
/* Load markdown from /data/page into the ace editor. /* Load markdown from /data/page into the ace editor.
~-1 == false; !~-1 == true; ~-1 == false; !~-1 == true;
*/ */
if ( !~location.host.indexOf('github.com') ) { if ( !~ location.host.indexOf( 'github.com' ) ) {
// returns unescaped key with leading slashes removed
function key_no_leading_slash( key ) {
return unescape( $.key( key ) || '' ).replace( /^\/+/, '' );
}
// ensure leading / is removed from path and that it ends with /
var path = key_no_leading_slash( 'path' );
// don't append '/' if path is empty from removing leading slash
if ( path !== '' && path.charAt( path.length - 1 ) !== '/' ) {
path += '/';
}
jQuery.ajax( { jQuery.ajax( {
type: 'GET', type: 'GET',
url: baseUrl + '/data/' + $.key( 'page' ), url: baseUrl + '/data/' + path + key_no_leading_slash( 'page' ),
success: function( data ) { success: function( data ) {
editorSession.setValue( data ); editorSession.setValue( data );
} }
@@ -455,6 +465,11 @@ var applyTimeout = function () {
win.jsm.resize = resize; win.jsm.resize = resize;
// remove editor_bg after loading because
// it'll cause problems if toggle left right is used
var ebg = doc.getElementById('editor_bg');
ebg.parentNode.removeChild(ebg);
/* /*
Resize can be called an absurd amount of times Resize can be called an absurd amount of times
and will crash the page without debouncing. and will crash the page without debouncing.
+5
View File
@@ -6,6 +6,11 @@ module Precious
attr_reader :page, :content attr_reader :page, :content
# return path set in app.rb not @page.path
def path
@path
end
def title def title
"#{@page.title}" "#{@page.title}"
end end
+1 -1
View File
@@ -591,7 +591,7 @@ module Gollum
######################################################################### #########################################################################
# Extract metadata for data and build metadata table. Metadata # Extract metadata for data and build metadata table. Metadata
# is content found between `<!-- ---` and `-->` markers, and must # is content found between ` <!-- --- ` and ` --> ` markers, and must
# be a valid YAML mapping. # be a valid YAML mapping.
# #
# Returns the String of formatted data with metadata removed. # Returns the String of formatted data with metadata removed.