Skip to content

Commit

Permalink
Added a method to publish an interview. Set a loadurl for the credits…
Browse files Browse the repository at this point in the history
… editor.
  • Loading branch information
Daniel Bogan committed Oct 24, 2009
1 parent 4be4d16 commit 62ef196
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions public/javascripts/usesthis.js
@@ -1,6 +1,18 @@
$(document).ready(function(){
var edit_url = '/' + slug + '/edit/';

$('a#publish').click(function(){
if(!window.confirm('Publish this interview?')) {
return false;
}

$.post(edit_url + 'published_at', { published_at: Date() }, function(result){
$('p.unpublished').replaceWith("<time>" + result + "</time>");
});

return true;
});

$('h2.person').editable(edit_url + 'person', {
cssclass: 'editor',
name: 'person',
Expand All @@ -11,6 +23,7 @@ $(document).ready(function(){
cssclass: 'editor',
name: 'credits',
id: '',
loadurl: '/' + slug + '/credits',
});

$('p.summary').editable(edit_url + 'summary', {
Expand Down

0 comments on commit 62ef196

Please sign in to comment.