From 461ae4f467489c621e586fa4a2eb953ae9c66869 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 14 Dec 2008 23:28:43 -0800 Subject: [PATCH] Got rid of auto-hiding notebook "rename" link, since it didn't work reliably. The link is now back in the link area on the left. --- static/js/Wiki.js | 22 ---------------------- view/Link_area.py | 23 +++++++++++++++++------ view/Main_page.py | 6 +----- 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 9f06eec..26145e9 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -391,16 +391,6 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri self.start_notebook_rename(); event.stop(); } ); - - var notebook_header_area = getElement( "notebook_header_area" ); - if ( notebook_header_area ) { - connect( notebook_header_area, "onmouseover", function ( event ) { - removeElementClass( "notebook_header_links", "invisible" ); - } ); - connect( notebook_header_area, "onmouseout", function ( event ) { - setTimeout( function () { addElementClass( "notebook_header_links", "invisible" ); }, 1000 ); - } ); - } } var delete_notebook_link = getElement( "delete_notebook_link" ); @@ -2827,8 +2817,6 @@ Wiki.prototype.start_notebook_rename = function () { ); replaceChildNodes( "notebook_header_name", rename_form ); - disconnectAll( "notebook_header_area" ); - addElementClass( "notebook_header_links", "invisible" ); var self = this; connect( rename_form, "onsubmit", function ( event ) { @@ -2865,7 +2853,6 @@ Wiki.prototype.end_notebook_rename = function ( new_notebook_name, prevent_renam createDOM( "strong", {}, new_notebook_name ) ); replaceChildNodes( "notebook_header_name", notebook_header_name ); - removeElementClass( "notebook_header_links", "invisible" ); } else { var notebook_header_name = createDOM( "span", @@ -2873,7 +2860,6 @@ Wiki.prototype.end_notebook_rename = function ( new_notebook_name, prevent_renam createDOM( "strong", {}, new_notebook_name ) ); replaceChildNodes( "notebook_header_name", notebook_header_name ); - removeElementClass( "notebook_header_links", "invisible" ); var self = this; connect( notebook_header_name, "onclick", function ( event ) { @@ -2882,14 +2868,6 @@ Wiki.prototype.end_notebook_rename = function ( new_notebook_name, prevent_renam } ); } - var notebook_header_area = getElement( "notebook_header_area" ); - connect( notebook_header_area, "onmouseover", function ( event ) { - removeElementClass( "notebook_header_links", "invisible" ); - } ); - connect( notebook_header_area, "onmouseout", function ( event ) { - setTimeout( function () { addElementClass( "notebook_header_links", "invisible" ); }, 1000 ); - } ); - // rename the notebook link on the right side of the page var notebook_link = getElement( "notebook_" + this.notebook.object_id ); if ( notebook_link ) { diff --git a/view/Link_area.py b/view/Link_area.py index e67e58a..77b719e 100644 --- a/view/Link_area.py +++ b/view/Link_area.py @@ -87,13 +87,13 @@ class Link_area( Div ): ( notebook.read_write == Notebook.READ_WRITE ) and Span( Div( - A( + ( notebook.name != u"trash" ) and A( u"import", href = u"#", id = u"import_link", title = u"Import %ss from other software into Luminotes." % note_word, - ), - u"|", + ) or None, + ( notebook.name != u"trash" ) and u"|" or None, A( u"export", href = u"#", @@ -103,7 +103,7 @@ class Link_area( Div ): class_ = u"link_area_item", ) or None, - Div( + ( notebook.name != u"trash" ) and Div( notebook.trash_id and A( u"trash", href = u"/notebooks/%s?parent_id=%s" % ( notebook.trash_id, notebook.object_id ), @@ -118,9 +118,20 @@ class Link_area( Div ): title = u"Move this %s to the trash." % notebook_word, ) or None, class_ = u"link_area_item", - ), + ) or None, - ( notebook.owner and user.username and rate_plan.get( u"notebook_sharing" ) ) and Div( + ( notebook.owner and notebook.name != u"trash" ) and Div( + A( + u"rename", + href = u"#", + id = u"rename_notebook_link", + title = u"Change the name of this %s." % notebook_word, + ), + class_ = u"link_area_item", + ) or None, + + ( notebook.owner and notebook.name != u"trash" and + user.username and rate_plan.get( u"notebook_sharing" ) ) and Div( A( u"share", href = u"#", diff --git a/view/Main_page.py b/view/Main_page.py index a2c3c5a..89362a9 100644 --- a/view/Main_page.py +++ b/view/Main_page.py @@ -191,11 +191,7 @@ class Main_page( Page ): u" | ", A( u"go back", href = u"/notebooks/%s" % parent_id ), id = u"notebook_header_links", - ) or Span( - A( u"rename", href = u"#", id = u"rename_notebook_link", title = u"Rename this notebook." ), - id = u"notebook_header_links", - class_ = u"invisible", - ), + ) or None, ( notebook.name == u"Luminotes" and title == u"source code" ) and \ Strong( "%s %s" % ( notebook.name, VERSION ) ) or \ Span(