From 22ce1728f4aa320f257375f1778d8224dc7fad36 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sat, 27 Oct 2007 03:22:34 +0000 Subject: [PATCH] Adding a blank note stub box thingy at the bottom of the notes. When you hover over it, you see its outline. When you click on it, a new blank note is created. Also, now creating a blank now closes open pulldowns/messages. --- static/css/style.css | 20 ++++++++++++++++++++ static/js/Wiki.js | 16 ++++++++++++++++ view/Main_page.py | 4 ++++ 3 files changed, 40 insertions(+) diff --git a/static/css/style.css b/static/css/style.css index ecd8865..fb8bec0 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -295,6 +295,26 @@ ol li { #notes { text-align: left; margin-top: 1em; +} + +#blank_note_stub { + text-align: left; + padding: 0.5em; + background-color: #fafafa; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; +} + +.blank_note_stub_hidden_border { + border: 1px solid #fafafa; +} + +.blank_note_stub_border { + border: 1px solid #999999; +} + +#notebook_background { + padding-bottom: 0.25em; margin-bottom: 1em; } diff --git a/static/js/Wiki.js b/static/js/Wiki.js index d37b035..96085c4 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -47,6 +47,19 @@ function Wiki( invoker ) { connect( "search_form", "onsubmit", this, "search" ); connect( "html", "onclick", this, "background_clicked" ); + var blank_note_stub = getElement( "blank_note_stub" ); + if ( blank_note_stub ) { + connect( blank_note_stub, "onmouseover", function ( event ) { + addElementClass( blank_note_stub, "blank_note_stub_border" ); + removeElementClass( blank_note_stub, "blank_note_stub_hidden_border" ); + } ); + connect( blank_note_stub, "onmouseout", function ( event ) { + addElementClass( blank_note_stub, "blank_note_stub_hidden_border" ); + removeElementClass( blank_note_stub, "blank_note_stub_border" ); + } ); + connect( blank_note_stub, "onclick", this, "create_blank_editor" ); + } + var self = this; var logout_link = getElement( "logout_link" ); if ( logout_link ) { @@ -190,6 +203,9 @@ Wiki.prototype.background_clicked = function ( event ) { Wiki.prototype.create_blank_editor = function ( event ) { if ( event ) event.stop(); + this.clear_messages(); + this.clear_pulldowns(); + // 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." ); diff --git a/view/Main_page.py b/view/Main_page.py index 8df81b2..4f22853 100644 --- a/view/Main_page.py +++ b/view/Main_page.py @@ -111,6 +111,10 @@ class Main_page( Page ): Div( id = u"notes", ), + notebook.read_write and Div( + id = u"blank_note_stub", + class_ = u"blank_note_stub_hidden_border", + ) or None, static_notes, # Sort of simulate the