From b1d3ebe2f96b5e16e1311e39949aac3793f93baa Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 24 Apr 2009 13:42:13 -0700 Subject: [PATCH] Replace "+" buttons in left and right areas with textual buttons that should be a little clearer. --- static/css/style.css | 10 ++++++++++ static/js/Wiki.js | 14 +++++++------- view/Link_area.py | 14 +++++++------- view/Note_tree_area.py | 7 +++++++ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 510188a..d2707fe 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -464,6 +464,16 @@ h1 { -webkit-border-radius: 3px; } +#new_notebook_button { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + +#new_note_tree_link_button { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + .note_frame { -moz-border-radius: 5px; position: absolute; diff --git a/static/js/Wiki.js b/static/js/Wiki.js index e22b683..ae96fa4 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -448,17 +448,15 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri } ); } - var new_notebook_button = getElement( "new_notebook" ); + var new_notebook_button = getElement( "new_notebook_button" ); if ( new_notebook_button ) { connect( new_notebook_button, "onclick", function ( event ) { self.invoker.invoke( "/notebooks/create", "POST" ); event.stop(); } ); - - this.make_image_button( "new_notebook", true ); } - var new_note_tree_link_button = getElement( "new_note_tree_link" ); + var new_note_tree_link_button = getElement( "new_note_tree_link_button" ); if ( new_note_tree_link_button ) { connect( new_note_tree_link_button, "onclick", function ( event ) { self.clear_pulldowns(); @@ -466,8 +464,6 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri self.note_tree.start_link_add(); event.stop(); } ); - - this.make_image_button( "new_note_tree_link", true ); } } @@ -1352,7 +1348,7 @@ Wiki.prototype.connect_image_button = function ( button ) { function stateless_button( button ) { - return ( button.name == "newNote" || button.name == "new_notebook" || button.name == "new_note_tree_link" ); + return ( button.name == "newNote" ); } connect( button, "onmousedown", function ( event ) { @@ -4827,6 +4823,8 @@ Note_tree.prototype.start_link_add = function () { return; } + addElementClass( "new_note_tree_link_button", "undisplayed" ); + link_field = createDOM( "input", { "type": "text", @@ -4881,6 +4879,8 @@ Note_tree.prototype.start_link_add = function () { } Note_tree.prototype.end_link_add = function ( note ) { + removeElementClass( "new_note_tree_link_button", "undisplayed" ); + // if no note is provided, load it based on the title if ( !note ) { var note_name = getElement( "new_note_tree_link_field" ).value; diff --git a/view/Link_area.py b/view/Link_area.py index edc962c..52287ab 100644 --- a/view/Link_area.py +++ b/view/Link_area.py @@ -1,4 +1,4 @@ -from Tags import Div, P, Span, H4, A, Strong, Img, Br +from Tags import Div, P, Span, H4, A, Strong, Img, Br, Input from Rounded_div import Rounded_div from model.Notebook import Notebook @@ -209,12 +209,12 @@ class Link_area( Div ): id = u"notebooks_area" ) or None, ( not forum_tag ) and Div( - Img( - src = u"/static/images/toolbar/small/new_note_button.png", - width = u"20", height = u"20", - id = "new_notebook", - class_ = u"middle_image", - title = u"Create a new wiki notebook." + Input( + type = u"button", + class_ = u"note_button", + id = u"new_notebook_button", + value = u"add notebook", + title = u"Create a new wiki notebook.", ), class_ = u"link_area_item", ) or None, diff --git a/view/Note_tree_area.py b/view/Note_tree_area.py index 268a785..822d70f 100644 --- a/view/Note_tree_area.py +++ b/view/Note_tree_area.py @@ -58,6 +58,13 @@ class Note_tree_area( Div ): class_ = u"middle_image", title = u"Add one of your notes to this note tree." ), + Input( + type = u"button", + class_ = u"note_button", + id = u"new_note_tree_link_button", + value = u"add quick link", + title = u"Add one of your notes to this note tree.", + ), Span( id = u"new_note_tree_link_area" ), ) or None, id = u"new_note_tree_link_row",