witten
/
luminotes
Archived
1
0
Fork 0

Replaced title button with font face button. Needs more work in IE. Also added more rounded corners to several display elements.

This commit is contained in:
Dan Helfman 2008-12-10 23:21:44 -08:00
parent 233b800978
commit c07d315ffe
27 changed files with 178 additions and 37 deletions

4
NEWS
View File

@ -1,6 +1,8 @@
1.5.11:
* Added a font selection button to the toolbar.
* Decreased the default note text font size, so now you can see more of your
notes at once.
note text at once.
* Added more rounded corners to several display elements.
1.5.10: December 4, 2008
* Fixed a bug in which certain new installations of Luminotes Desktop

View File

@ -26,7 +26,7 @@ settings = {
"session_filter.storage_type": "ram",
"session_filter.timeout": 60 * 24 * 365, # one year
"static_filter.root": os.getcwd(),
"server.log_to_screen": False,
"server.log_to_screen": True,
"server.log_file": os.path.join( gettempdir(), "luminotes_error%s.log" % username_postfix ),
"server.log_access_file": os.path.join( gettempdir(), "luminotes%s.log" % username_postfix ),
"server.log_tracebacks": True,

View File

@ -741,7 +741,9 @@ class Notebooks( object ):
# if the note is already in the given notebook, load it and update it
if note and note.notebook_id == notebook.object_id:
print "LOADING OLD NOTE..."
old_note = self.__database.load( Note, note_id, previous_revision )
print "OLD NOTE: %s" % old_note
previous_user = self.__database.load( User, note.user_id )
previous_revision = User_revision( note.revision, note.user_id, previous_user and previous_user.username or None )

View File

@ -136,8 +136,10 @@ class Note( Persistent ):
@staticmethod
def sql_load( object_id, revision = None ):
if revision:
print "select id, revision, title, contents, notebook_id, startup, deleted_from_id, rank, user_id from note where id = %s and revision = %s;" % ( quote( object_id ), quote( revision ) )
return "select id, revision, title, contents, notebook_id, startup, deleted_from_id, rank, user_id from note where id = %s and revision = %s;" % ( quote( object_id ), quote( revision ) )
print "select id, revision, title, contents, notebook_id, startup, deleted_from_id, rank, user_id from note_current where id = %s;" % quote( object_id )
return "select id, revision, title, contents, notebook_id, startup, deleted_from_id, rank, user_id from note_current where id = %s;" % quote( object_id )
@staticmethod

View File

@ -14,6 +14,7 @@ body {
}
.note_frame {
-moz-border-radius: 5px;
text-align: left;
margin: 0em;
padding: 1.5em;

View File

@ -40,10 +40,10 @@
background-image: url(/static/images/toolbar/strikethrough_button.png);
}
#title_button_preload {
#font_button_preload {
height: 0;
overflow: hidden;
background-image: url(/static/images/toolbar/title_button.png);
background-image: url(/static/images/toolbar/font_button.png);
}
#bullet_list_button_preload {
@ -65,6 +65,8 @@
}
.hook_area {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding-top: 1.5em;
padding-bottom: 1.5em;
width: 100%;
@ -156,6 +158,8 @@
}
.thumbnail_area {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #fffece;
padding-bottom: 0.5em;
}

View File

@ -107,10 +107,10 @@ h1 {
background-image: url(/static/images/toolbar/strikethrough_button_hover.png);
}
#title_button_hover_preload {
#font_button_hover_preload {
height: 0;
overflow: hidden;
background-image: url(/static/images/toolbar/title_button_hover.png);
background-image: url(/static/images/toolbar/font_button_hover.png);
}
#bullet_list_button_hover_preload {
@ -167,10 +167,10 @@ h1 {
background-image: url(/static/images/toolbar/strikethrough_button_down_hover.png);
}
#title_button_down_hover_preload {
#font_button_down_hover_preload {
height: 0;
overflow: hidden;
background-image: url(/static/images/toolbar/title_button_down_hover.png);
background-image: url(/static/images/toolbar/font_button_down_hover.png);
}
#bullet_list_button_down_hover_preload {
@ -227,10 +227,10 @@ h1 {
background-image: url(/static/images/toolbar/strikethrough_button_down.png);
}
#title_button_down_preload {
#font_button_down_preload {
height: 0;
overflow: hidden;
background-image: url(/static/images/toolbar/title_button_down.png);
background-image: url(/static/images/toolbar/font_button_down.png);
}
#bullet_list_button_down_preload {
@ -427,6 +427,12 @@ h1 {
color: #ff6600;
}
#notebook_header_links {
position: absolute;
top: 1.7em;
right: 1em;
}
#rename_form {
margin: 0;
}
@ -493,6 +499,9 @@ h1 {
}
.note_button {
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-radius: 4px;
border-style: outset;
border-width: 0px;
background-color: #d0e0f0;
@ -511,9 +520,12 @@ h1 {
#save_button {
margin-left: 0.5em;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
.note_frame {
-moz-border-radius: 5px;
margin: 0em;
padding: 0em;
overflow: hidden;
@ -549,6 +561,7 @@ h1 {
}
.pulldown {
-moz-border-radius: 4px;
position: absolute;
font-size: 72%;
text-align: left;
@ -579,16 +592,23 @@ h1 {
}
.pulldown_label {
-moz-user-select: none;
color: #000000;
text-decoration: none;
}
.font_label {
font-size: 125%;
}
.pulldown_label:hover {
color: #ff6600;
cursor: pointer;
}
.message {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 0.5em;
margin-bottom: 0.5em;
font-weight: bold;
@ -596,12 +616,16 @@ h1 {
}
.message_inner {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 0.5em;
line-height: 140%;
background-color: #ffaa44;
}
.error {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 0.5em;
border: 1px solid #550000;
margin-bottom: 0.5em;
@ -611,6 +635,8 @@ h1 {
}
.error_inner {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 0.5em;
line-height: 140%;
color: #ffffff;
@ -618,6 +644,8 @@ h1 {
}
.message_button {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
margin-left: 0.5em;
border-style: outset;
border-width: 0px;
@ -861,6 +889,8 @@ h1 {
}
.hook_action_area {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #ffff99;
font-weight: bold;
padding: 1em;

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

View File

@ -330,7 +330,7 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri
connect( "italic", "onclick", function ( event ) { self.toggle_button( event, "italic" ); } );
connect( "underline", "onclick", function ( event ) { self.toggle_button( event, "underline" ); } );
connect( "strikethrough", "onclick", function ( event ) { self.toggle_button( event, "strikethrough" ); } );
connect( "title", "onclick", function ( event ) { self.toggle_button( event, "title" ); } );
connect( "font", "onclick", this, "toggle_font_button" );
connect( "insertUnorderedList", "onclick", function ( event ) { self.toggle_button( event, "insertUnorderedList" ); } );
connect( "insertOrderedList", "onclick", function ( event ) { self.toggle_button( event, "insertOrderedList" ); } );
@ -342,7 +342,7 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri
this.make_image_button( "italic" );
this.make_image_button( "underline" );
this.make_image_button( "strikethrough" );
this.make_image_button( "title" );
this.make_image_button( "font" );
this.make_image_button( "insertUnorderedList", "bullet_list" );
this.make_image_button( "insertOrderedList", "numbered_list" );
@ -393,6 +393,17 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri
} );
}
// FIXME: don't do this (hide and show the links on hover) if this is the trash
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" );
if ( delete_notebook_link ) {
connect( delete_notebook_link, "onclick", function ( event ) {
@ -1332,7 +1343,7 @@ Wiki.prototype.update_toolbar = function() {
this.update_button( "italic", "i", node_names );
this.update_button( "underline", "u", node_names );
this.update_button( "strikethrough", "strike", node_names );
this.update_button( "title", "h3", node_names );
this.update_button( "font", "font", node_names );
this.update_button( "insertUnorderedList", "ul", node_names );
this.update_button( "insertOrderedList", "ol", node_names );
@ -1407,6 +1418,30 @@ Wiki.prototype.toggle_attach_button = function ( event ) {
event.stop();
}
Wiki.prototype.toggle_font_button = function ( event ) {
if ( this.focused_editor && this.focused_editor.read_write ) {
this.focused_editor.focus();
// if a pulldown is already open, then just close it
var existing_div = getElement( "font_pulldown" );
if ( existing_div ) {
this.up_image_button( "font" );
existing_div.pulldown.shutdown();
existing_div.pulldown = null;
return;
}
this.down_image_button( "font" );
this.clear_messages();
this.clear_pulldowns();
new Font_pulldown( this, this.notebook.object_id, this.invoker, event.target(), this.focused_editor );
}
event.stop();
}
Wiki.prototype.hide_editor = function ( event, editor ) {
this.clear_messages();
this.clear_pulldowns();
@ -2792,7 +2827,9 @@ Wiki.prototype.start_notebook_rename = function () {
"form", { "id": "rename_form" }, notebook_name_field, ok_button
);
replaceChildNodes( "notebook_header_area", rename_form );
replaceChildNodes( "notebook_header_name", rename_form );
disconnectAll( "notebook_header_area" );
addElementClass( "notebook_header_links", "invisible" );
var self = this;
connect( rename_form, "onsubmit", function ( event ) {
@ -2809,6 +2846,7 @@ Wiki.prototype.start_notebook_rename = function () {
}
Wiki.prototype.end_notebook_rename = function ( new_notebook_name, prevent_rename_on_click ) {
try{
if ( !new_notebook_name )
new_notebook_name = getElement( "notebook_name_field" ).value;
@ -2827,14 +2865,16 @@ Wiki.prototype.end_notebook_rename = function ( new_notebook_name, prevent_renam
"span", {},
createDOM( "strong", {}, new_notebook_name )
);
replaceChildNodes( "notebook_header_area", notebook_header_name );
replaceChildNodes( "notebook_header_name", notebook_header_name );
removeElementClass( "notebook_header_links", "invisible" );
} else {
var notebook_header_name = createDOM(
"span",
{ "id": "notebook_header_name", "title": "Rename this notebook." },
createDOM( "strong", {}, new_notebook_name )
);
replaceChildNodes( "notebook_header_area", notebook_header_name );
replaceChildNodes( "notebook_header_name", notebook_header_name );
removeElementClass( "notebook_header_links", "invisible" );
var self = this;
connect( notebook_header_name, "onclick", function ( event ) {
@ -2843,6 +2883,14 @@ 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 ) {
@ -2866,6 +2914,7 @@ Wiki.prototype.end_notebook_rename = function ( new_notebook_name, prevent_renam
"notebook_id": this.notebook.object_id,
"name": new_notebook_name
} );
}catch(e){console.log(e); }
}
Wiki.prototype.delete_notebook = function () {
@ -4196,6 +4245,63 @@ Suggest_pulldown.prototype.shutdown = function () {
}
function Font_pulldown( wiki, notebook_id, invoker, anchor, editor ) {
anchor.pulldown = this;
this.anchor = anchor;
this.editor = editor;
Pulldown.call( this, wiki, notebook_id, "font_pulldown", anchor );
this.invoker = invoker;
var fonts = [
[ "Sans Serif", "sans-serif" ],
[ "Serif", "serif" ],
[ "Monospace", "monospace" ],
[ "Comic", "comic sans ms,sans-serif" ],
[ "Garamond", "garamond,serif" ],
[ "Georgia", "georgia,serif" ],
[ "Tahoma", "tahoma,sans-serif" ],
[ "Trebuchet", "trebuchet ms,sans-serif" ],
[ "Verdana", "verdana,sans-serif" ]
];
var self = this;
for ( var i in fonts ) {
var font = fonts[ i ];
var font_name = font[ 0 ];
var font_family = font[ 1 ];
var label = createDOM( "label", { "class": "pulldown_label font_label", "style": "font-family: " + font_family + ";" },
font_name
);
label.font_family = font_family;
appendChildNodes( this.div, createDOM( "div", {}, label ) );
connect( label, "onclick", function ( event ) { self.font_name_clicked( event ); } );
}
Pulldown.prototype.finish_init.call( this );
}
Font_pulldown.prototype = new function () { this.prototype = Pulldown.prototype; };
Font_pulldown.prototype.constructor = Font_pulldown;
Font_pulldown.prototype.font_name_clicked = function ( event ) {
var label = event.src();
this.editor.focus();
// FIXME: this doesn't work in IE 7 from this click handler, but it works elsewhere (like in the constructor)
this.editor.exec_command( "fontname", label.font_family );
this.shutdown();
}
Font_pulldown.prototype.shutdown = function () {
Pulldown.prototype.shutdown.call( this );
this.anchor.pulldown = null;
disconnectAll( this );
}
function Note_tree( wiki, notebook_id, invoker ) {
this.wiki = wiki;
this.notebook_id = notebook_id;

View File

@ -103,16 +103,6 @@ class Link_area( Div ):
class_ = u"link_area_item",
) or None,
( 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 Div(
A(
u"delete",

View File

@ -186,6 +186,16 @@ class Main_page( Page ):
) or None,
Rounded_div(
( notebook.name == u"trash" ) and u"trash_notebook" or u"current_notebook",
parent_id and Span(
A( u"empty", href = u"/notebooks/%s" % notebook.object_id, id = u"empty_trash_link" ),
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",
),
( notebook.name == u"Luminotes" and title == u"source code" ) and \
Strong( "%s %s" % ( notebook.name, VERSION ) ) or \
Span(
@ -193,12 +203,6 @@ class Main_page( Page ):
and Strong( notebook.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" ),
u" | ",
A( u"return to notebook", href = u"/notebooks/%s" % parent_id ),
) or None,
id = u"notebook_header_area",
corners = ( u"tl", u"tr", u"br" ),
),

View File

@ -62,8 +62,8 @@ class Toolbar( Div ):
) ),
Div( Input(
type = u"image",
id = u"title", title = u"title",
src = u"/static/images/toolbar/title_button.png",
id = u"font", title = u"font",
src = u"/static/images/toolbar/font_button.png",
width = u"40", height = u"40",
class_ = "image_button",
) ),
@ -94,7 +94,7 @@ class Toolbar( Div ):
Span( id = "italic_button_hover_preload" ),
Span( id = "underline_button_hover_preload" ),
Span( id = "strikethrough_button_hover_preload" ),
Span( id = "title_button_hover_preload" ),
Span( id = "font_button_hover_preload" ),
Span( id = "bullet_list_button_hover_preload" ),
Span( id = "numbered_list_button_hover_preload" ),
@ -105,7 +105,7 @@ class Toolbar( Div ):
Span( id = "italic_button_down_hover_preload" ),
Span( id = "underline_button_down_hover_preload" ),
Span( id = "strikethrough_button_down_hover_preload" ),
Span( id = "title_button_down_hover_preload" ),
Span( id = "font_button_down_hover_preload" ),
Span( id = "bullet_list_button_down_hover_preload" ),
Span( id = "numbered_list_button_down_hover_preload" ),
@ -116,7 +116,7 @@ class Toolbar( Div ):
Span( id = "italic_button_down_preload" ),
Span( id = "underline_button_down_preload" ),
Span( id = "strikethrough_button_down_preload" ),
Span( id = "title_button_down_preload" ),
Span( id = "font_button_down_preload" ),
Span( id = "bullet_list_button_down_preload" ),
Span( id = "numbered_list_button_down_preload" ),