witten
/
luminotes
Archived
1
0
Fork 0

Replaced "add new notebook" link with new notebook button next to

"notebooks" heading.
This commit is contained in:
Dan Helfman 2008-06-21 22:13:52 -07:00
parent 69ca866ba0
commit cf7cdefd28
5 changed files with 44 additions and 36 deletions

4
NEWS
View File

@ -1,3 +1,7 @@
1.4.8: June ??, 2008:
* Replaced "add new notebook" link with new notebook button next to
"notebooks" heading.
1.4.7: June 21, 2008:
* New favicon.ico image that looks slightly less dated.

View File

@ -791,9 +791,10 @@ h1 {
cursor: pointer;
}
.rss_image {
.middle_image {
vertical-align: middle;
border: 0;
padding-left: 0.5em;
}
#justify_table td {

View File

@ -337,14 +337,6 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri
} );
}
var add_notebook_link = getElement( "add_notebook_link" );
if ( add_notebook_link ) {
connect( add_notebook_link, "onclick", function ( event ) {
self.invoker.invoke( "/notebooks/create", "POST" );
event.stop();
} );
}
var rename_notebook_link = getElement( "rename_notebook_link" );
if ( rename_notebook_link ) {
connect( rename_notebook_link, "onclick", function ( event ) {
@ -392,6 +384,16 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri
event.stop();
} );
}
var new_notebook_button = getElement( "new_notebook" );
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", "new_note", true );
}
}
Wiki.prototype.background_clicked = function ( event ) {
@ -945,9 +947,9 @@ Wiki.prototype.editor_key_pressed = function ( editor, event ) {
}
}
Wiki.prototype.get_toolbar_image_dir = function () {
Wiki.prototype.get_toolbar_image_dir = function ( always_small ) {
var toolbar_image_dir = IMAGE_DIR + "toolbar/";
if ( this.small_toolbar )
if ( always_small || this.small_toolbar )
toolbar_image_dir += "small/";
return toolbar_image_dir;
@ -959,7 +961,7 @@ Wiki.prototype.resize_toolbar_button = function ( button ) {
var button_size = getElementDimensions( button );
if ( this.small_toolbar ) {
if ( this.small_toolbar || button.always_small ) {
if ( button_size.w == SMALL_BUTTON_SIZE ) return false;
setElementDimensions( button, { "w": SMALL_BUTTON_SIZE, "h": SMALL_BUTTON_SIZE } );
} else {
@ -970,15 +972,16 @@ Wiki.prototype.resize_toolbar_button = function ( button ) {
return true;
}
Wiki.prototype.make_image_button = function ( name, filename_prefix ) {
Wiki.prototype.make_image_button = function ( name, filename_prefix, always_small ) {
var button = getElement( name );
var toolbar_image_dir = this.get_toolbar_image_dir();
var toolbar_image_dir = this.get_toolbar_image_dir( always_small );
if ( !filename_prefix )
filename_prefix = name;
button.name = name;
button.filename_prefix = filename_prefix;
button.always_small = always_small;
this.resize_toolbar_button( button );
this.connect_image_button( button );
@ -988,7 +991,7 @@ Wiki.prototype.connect_image_button = function ( button, filename_prefix ) {
var self = this;
connect( button, "onmouseover", function ( event ) {
var toolbar_image_dir = self.get_toolbar_image_dir();
var toolbar_image_dir = self.get_toolbar_image_dir( button.always_small );
if ( /_down/.test( button.src ) )
button.src = toolbar_image_dir + button.filename_prefix + "_button_down_hover.png";
else
@ -996,23 +999,23 @@ Wiki.prototype.connect_image_button = function ( button, filename_prefix ) {
} );
connect( button, "onmouseout", function ( event ) {
var toolbar_image_dir = self.get_toolbar_image_dir();
var toolbar_image_dir = self.get_toolbar_image_dir( button.always_small );
if ( /_down/.test( button.src ) )
button.src = toolbar_image_dir + button.filename_prefix + "_button_down.png";
else
button.src = toolbar_image_dir + button.filename_prefix + "_button.png";
} );
if ( button.name == "newNote" ) {
if ( button.name == "newNote" || button.name == "new_notebook" ) {
connect( button, "onmousedown", function ( event ) {
var toolbar_image_dir = self.get_toolbar_image_dir();
var toolbar_image_dir = self.get_toolbar_image_dir( button.always_small );
if ( /_hover/.test( button.src ) )
button.src = toolbar_image_dir + button.filename_prefix + "_button_down_hover.png";
else
button.src = toolbar_image_dir + button.filename_prefix + "_button_down.png";
} );
connect( button, "onmouseup", function ( event ) {
var toolbar_image_dir = self.get_toolbar_image_dir();
var toolbar_image_dir = self.get_toolbar_image_dir( button.always_small );
if ( /_hover/.test( button.src ) )
button.src = toolbar_image_dir + button.filename_prefix + "_button_hover.png";
else
@ -1023,7 +1026,7 @@ Wiki.prototype.connect_image_button = function ( button, filename_prefix ) {
Wiki.prototype.down_image_button = function ( name ) {
var button = getElement( name );
var toolbar_image_dir = this.get_toolbar_image_dir();
var toolbar_image_dir = this.get_toolbar_image_dir( button.always_small );
if ( !this.resize_toolbar_button( button ) && /_down/.test( button.src ) )
return;
@ -1037,7 +1040,7 @@ Wiki.prototype.down_image_button = function ( name ) {
Wiki.prototype.up_image_button = function ( name ) {
var button = getElement( name );
var toolbar_image_dir = this.get_toolbar_image_dir();
var toolbar_image_dir = this.get_toolbar_image_dir( button.always_small );
if ( !this.resize_toolbar_button( button ) && !/_down/.test( button.src ) )
return;
@ -1050,7 +1053,7 @@ Wiki.prototype.up_image_button = function ( name ) {
Wiki.prototype.toggle_image_button = function ( name ) {
var button = getElement( name );
var toolbar_image_dir = this.get_toolbar_image_dir();
var toolbar_image_dir = this.get_toolbar_image_dir( button.always_small );
if ( /_down/.test( button.src ) ) {
if ( /_hover/.test( button.src ) )

View File

@ -39,7 +39,7 @@ class Link_area( Div ):
title = u"Subscribe to the RSS feed for the Luminotes blog.",
),
A(
Img( src = u"/static/images/rss.png", width = u"14", height = u"14", class_ = u"rss_image" ),
Img( src = u"/static/images/rss.png", width = u"14", height = u"14", class_ = u"middle_image" ),
href = u"%s?rss" % notebook_path,
title = u"Subscribe to the RSS feed for the Luminotes blog.",
),
@ -52,7 +52,7 @@ class Link_area( Div ):
title = u"Subscribe to the RSS feed for this notebook.",
),
A(
Img( src = u"/static/images/rss.png", width = u"14", height = u"14", class_ = u"rss_image" ),
Img( src = u"/static/images/rss.png", width = u"14", height = u"14", class_ = u"middle_image" ),
href = updates_path,
title = u"Subscribe to the RSS feed for this notebook.",
),
@ -80,16 +80,6 @@ class Link_area( Div ):
class_ = u"link_area_item",
) or None,
Div(
A(
u"add new notebook",
href = u"#",
id = u"add_notebook_link",
title = u"Create a new wiki notebook.",
),
class_ = u"link_area_item",
),
Div(
A(
u"nothing but notes",
@ -136,7 +126,17 @@ class Link_area( Div ):
),
Div(
( len( linked_notebooks ) > 0 ) and H4( u"notebooks", id = u"notebooks_area_title" ) or None,
( len( linked_notebooks ) > 0 ) and H4(
u"notebooks",
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."
),
id = u"notebooks_area_title",
) or None,
[ ( nb.object_id == notebook.object_id ) and Rounded_div(
u"current_notebook",
A(

View File

@ -171,7 +171,7 @@ class Main_page( Page ):
and (
len( notes ) == 1 and A( Strong( notebook.name ), href = notebook_path ) or Strong( notebook.name )
) \
or Span( Strong( notebook.name ), id = u"notebook_header_name" ),
or Span( Strong( notebook.name ), id = u"notebook_header_name", title = "Rename this notebook." ),
parent_id and Span(
u" | ",
A( u"empty trash", href = u"/notebooks/%s" % notebook.object_id, id = u"empty_trash_link" ),