From 0f401829e757f7dd19a4baa02247360b96feb439 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 30 Aug 2007 20:39:41 +0000 Subject: [PATCH] Some limitations on trash notebooks: * Can no longer create new notes in the trash. * If you click on a link within a note in the trash, you just get a message telling you to undelete it. --- static/js/Wiki.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 58113d0..3ddb2b5 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -200,6 +200,12 @@ Wiki.prototype.populate = function ( result ) { Wiki.prototype.create_blank_editor = function ( event ) { if ( event ) event.stop(); + // if we're within the trash, don't allow new note creation + if ( this.notebook.name == "trash" ) { + this.display_error( "You can't create notes in the trash." ); + return; + } + // if there is already a blank editor, then highlight it and bail if ( this.blank_editor_id != null ) { var blank_iframe_id = "note_" + this.blank_editor_id; @@ -214,6 +220,11 @@ Wiki.prototype.create_blank_editor = function ( event ) { } Wiki.prototype.load_editor = function ( note_title, note_id, revision, link ) { + if ( this.notebook.name == "trash" ) { + this.display_message( "If you'd like to use this note, try undeleting it first." ); + return; + } + // if a link is given with an open link pulldown, then ignore the note title given and use the // one from the pulldown instead if ( link ) {