Skip to content

Commit

Permalink
get ride of edit in place. use ctrl+e to edit the current page
Browse files Browse the repository at this point in the history
  • Loading branch information
sr committed Oct 3, 2008
1 parent 3125907 commit 0f0b046
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 585 deletions.
43 changes: 1 addition & 42 deletions git-wiki.rb
Expand Up @@ -179,12 +179,6 @@ def list_item(page)
haml :show
end

get '/:page.txt' do
@page = Page.find(params[:page])
content_type 'text/plain', :charset => 'utf-8'
@page.content
end

get '/e/:page' do
@page = Page.find_or_create(params[:page])
haml :edit
Expand Down Expand Up @@ -225,42 +219,7 @@ def list_item(page)
- title @page.name.titleize
:javascript
$(document).ready(function() {
$.editable.addInputType('autogrow', {
element : function(settings, original) {
var textarea = $('<textarea>');
if (settings.rows) {
textarea.attr('rows', settings.rows);
} else {
textarea.height(settings.height);
}
if (settings.cols) {
textarea.attr('cols', settings.cols);
} else {
textarea.width(settings.width);
}
$(this).append(textarea);
return(textarea);
},
plugin : function(settings, original) {
$('textarea', this).autogrow(settings.autogrow);
}
});

$('#page_content').editable('/e/#{@page}', {
loadurl: '/#{@page}.txt',
submit: '<button class="submit" type="submit">Save as the newest version</button>',
cancel: '<a class="cancel" href="" style="margin-left: 5px;">cancel</a>',
event: 'dblclick',
type: 'autogrow',
cols: 84,
rows: 20,
name: 'body',
onblur: 'ignore',
tooltip: ' ',
indicator: 'Saving...',
loadtext: '',
cssclass: 'edit_form',
})
$.hotkeys.add('Ctrl+e', function() { document.location = '/e/#{@page}' })
})
%h1= title
#page_content
Expand Down
114 changes: 0 additions & 114 deletions public/jquery.autogrow.js

This file was deleted.

0 comments on commit 0f0b046

Please sign in to comment.