Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 85abc83427 | |||
| 6d8220629c | |||
| 6ff7ada096 | |||
| 8575049de5 | |||
| bb6fb0c253 | |||
| eb2ad9f840 | |||
| d0dd23fc11 | |||
| 7ae4acbdb0 | |||
| 881590ab37 | |||
| 5e479dc5d9 | |||
| 7db9c2e762 | |||
| 3767a11d21 |
+2
-2
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
||||
s.required_ruby_version = ">= 1.8.7"
|
||||
|
||||
s.name = 'gollum'
|
||||
s.version = '2.1.7'
|
||||
s.date = '2012-08-25'
|
||||
s.version = '2.1.8'
|
||||
s.date = '2012-08-30'
|
||||
s.rubyforge_project = 'gollum'
|
||||
|
||||
s.summary = "A simple, Git-powered wiki."
|
||||
|
||||
+2
-1
@@ -20,9 +20,10 @@ require File.expand_path('../gollum/markup', __FILE__)
|
||||
require File.expand_path('../gollum/sanitization', __FILE__)
|
||||
require File.expand_path('../gollum/tex', __FILE__)
|
||||
require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
||||
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
||||
|
||||
module Gollum
|
||||
VERSION = '2.1.7'
|
||||
VERSION = '2.1.8'
|
||||
|
||||
def self.assets_path
|
||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
||||
|
||||
@@ -100,9 +100,13 @@ module Gollum
|
||||
|
||||
tree.blobs.each do |blob|
|
||||
next if page_path_scheduled_for_deletion?(index.tree, fullpath)
|
||||
file = blob.name.downcase.sub(/\.\w+$/, '')
|
||||
file_ext = ::File.extname(blob.name).sub(/^\./, '')
|
||||
if downpath == file && !(allow_same_ext && file_ext == ext)
|
||||
|
||||
existing_file = blob.name.downcase.sub(/\.\w+$/, '')
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,6 @@ require 'gollum/frontend/views/layout'
|
||||
require 'gollum/frontend/views/editable'
|
||||
require 'gollum/frontend/views/has_page'
|
||||
|
||||
require File.expand_path '../uri_encode_component', __FILE__
|
||||
require File.expand_path '../helpers', __FILE__
|
||||
|
||||
# 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>
|
||||
</div>
|
||||
|
||||
<div class='editor_bg'></div>
|
||||
<div id='editor_bg' class='editor_bg'></div>
|
||||
<div class='toolpanel_bg'></div>
|
||||
|
||||
<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('/');
|
||||
|
||||
// RegExp from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript
|
||||
// Returns value on success and undefined on failure.
|
||||
$.key = function( key ) {
|
||||
var value = new RegExp( '[\\?&]' + key + '=([^&#]*)' ).exec( location.href );
|
||||
return ( !value ) ? 0 : value[ 1 ] || 0;
|
||||
return ( !value ) ? undefined : value[ 1 ] || undefined;
|
||||
}
|
||||
|
||||
// True if &create=true
|
||||
@@ -73,10 +74,6 @@ var create = $.key( 'create' );
|
||||
var pageName = $.key( 'page' );
|
||||
var pathName = $.key( 'path' );
|
||||
|
||||
if ( pathName === 0 ) {
|
||||
pathName = undefined;
|
||||
}
|
||||
|
||||
defaultCommitMessage = function() {
|
||||
var msg = pageName + ' (markdown)';
|
||||
|
||||
@@ -100,7 +97,7 @@ $.save = function( commitMessage ) {
|
||||
var newLocation = baseUrl;
|
||||
|
||||
function clean( str ) {
|
||||
return str.replace(/^\/+/g, '/');
|
||||
return str.replace(/^\/+/, '/');
|
||||
}
|
||||
|
||||
// 'a%2Fb' => a/b
|
||||
@@ -341,10 +338,23 @@ var applyTimeout = function () {
|
||||
/* Load markdown from /data/page into the ace editor.
|
||||
~-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( {
|
||||
type: 'GET',
|
||||
url: baseUrl + '/data/' + $.key( 'page' ),
|
||||
url: baseUrl + '/data/' + path + key_no_leading_slash( 'page' ),
|
||||
success: function( data ) {
|
||||
editorSession.setValue( data );
|
||||
}
|
||||
@@ -455,6 +465,11 @@ var applyTimeout = function () {
|
||||
|
||||
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
|
||||
and will crash the page without debouncing.
|
||||
|
||||
@@ -6,6 +6,11 @@ module Precious
|
||||
|
||||
attr_reader :page, :content
|
||||
|
||||
# return path set in app.rb not @page.path
|
||||
def path
|
||||
@path
|
||||
end
|
||||
|
||||
def title
|
||||
"#{@page.title}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user