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.
This commit is contained in:
parent
55e6e38ad5
commit
22ce1728f4
|
@ -295,6 +295,26 @@ ol li {
|
||||||
#notes {
|
#notes {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-top: 1em;
|
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;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,19 @@ function Wiki( invoker ) {
|
||||||
connect( "search_form", "onsubmit", this, "search" );
|
connect( "search_form", "onsubmit", this, "search" );
|
||||||
connect( "html", "onclick", this, "background_clicked" );
|
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 self = this;
|
||||||
var logout_link = getElement( "logout_link" );
|
var logout_link = getElement( "logout_link" );
|
||||||
if ( logout_link ) {
|
if ( logout_link ) {
|
||||||
|
@ -190,6 +203,9 @@ Wiki.prototype.background_clicked = function ( event ) {
|
||||||
Wiki.prototype.create_blank_editor = function ( event ) {
|
Wiki.prototype.create_blank_editor = function ( event ) {
|
||||||
if ( event ) event.stop();
|
if ( event ) event.stop();
|
||||||
|
|
||||||
|
this.clear_messages();
|
||||||
|
this.clear_pulldowns();
|
||||||
|
|
||||||
// if we're within the trash, don't allow new note creation
|
// if we're within the trash, don't allow new note creation
|
||||||
if ( this.notebook.name == "trash" ) {
|
if ( this.notebook.name == "trash" ) {
|
||||||
this.display_error( "You can't create notes in the trash." );
|
this.display_error( "You can't create notes in the trash." );
|
||||||
|
|
|
@ -111,6 +111,10 @@ class Main_page( Page ):
|
||||||
Div(
|
Div(
|
||||||
id = u"notes",
|
id = u"notes",
|
||||||
),
|
),
|
||||||
|
notebook.read_write and Div(
|
||||||
|
id = u"blank_note_stub",
|
||||||
|
class_ = u"blank_note_stub_hidden_border",
|
||||||
|
) or None,
|
||||||
static_notes,
|
static_notes,
|
||||||
# Sort of simulate the <noscript> tag by hiding the static version of the notes.
|
# Sort of simulate the <noscript> tag by hiding the static version of the notes.
|
||||||
# This code won't be executed if JavaScript is disabled. I'm not actually using
|
# This code won't be executed if JavaScript is disabled. I'm not actually using
|
||||||
|
|
Reference in New Issue