diff --git a/static/css/ie6.css b/static/css/ie6.css index 7e83f2f..9b86eaf 100644 --- a/static/css/ie6.css +++ b/static/css/ie6.css @@ -4,13 +4,20 @@ #toolbar { position: absolute; - float: none; - width: auto; + width: expression( eval( document.all.center_area && ( document.all.center_area.offsetLeft - 50 ) || 0 ) ); + text-align: right; +} + +#note_tree_area { + left: 0; + width: expression( eval( document.all.center_area && ( document.all.center_area.offsetLeft - 50 ) || 0 ) ); + position: absolute; top: expression( eval( document.compatMode && document.compatMode == 'CSS1Compat' ) ? documentElement.scrollTop + 80 : document.body.scrollTop + 80 ); - margin-left: expression( - document.body.clientWidth < ( 900 / 12 ) * - parseInt( document.body.currentStyle.fontSize ) ? "-120px": "-80px" - ); +} + +#note_tree_area_holder { + overflow: auto; + height: expression( eval( documentElement.offsetHeight - 100 ) ); } #status_area { @@ -27,23 +34,15 @@ #everything_area { width:expression( document.body.clientWidth < ( 1300 / 12 ) * - parseInt( document.body.currentStyle.fontSize ) ? "100%": "78em" + parseInt( document.body.currentStyle.fontSize ) ? "100%": "80em" ); } -#toolbar_area { - width:expression( - document.body.clientWidth < ( 1300 / 12 ) * - parseInt( document.body.currentStyle.fontSize ) ? "18%": "15em" - ); - text-align: right; -} - #center_area { float: right; width:expression( document.body.clientWidth < ( 1300 / 12 ) * - parseInt( document.body.currentStyle.fontSize ) ? "60%": "45em" + parseInt( document.body.currentStyle.fontSize ) ? "56%": "45em" ); } @@ -51,17 +50,6 @@ width: 100%; } -#link_area { - width:expression( - document.body.clientWidth < ( 1300 / 12 ) * - parseInt( document.body.currentStyle.fontSize ) ? "17%": "15em" - ); -} - -#link_area_wrapper { - margin-left: 1.5em; -} - .pulldown { height: expression( this.scrollHeight > 200 ? "200px" : "auto" ); width: expression( this.scrollHeight > 200 ? "12em" : "auto" ); diff --git a/static/css/ie7.css b/static/css/ie7.css index 47d10f4..81157b5 100644 --- a/static/css/ie7.css +++ b/static/css/ie7.css @@ -1,7 +1,19 @@ -#toolbar { - left: 2em; +#note_tree_area { + float: right; + margin-left: -6em; +} + +#note_tree_area_holder { + overflow: auto; + height: expression( eval( documentElement.offsetHeight - 100 ) ); +} + +#center_area { + float: right; + max-width: 59%; } #this_notebook_area_title { margin-top: 1.5em; } + diff --git a/static/css/style.css b/static/css/style.css index bb4e750..30cc2e1 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -28,26 +28,24 @@ img { #everything_area { margin: 0 auto; text-align: center; - width: 78em; - max-width: 100%; + max-width: 80em; } -#toolbar_area { +#left_area { float: left; - width: 15em; - max-width: 18%; + width: 17em; + max-width: 20%; } #toolbar { - width: 15em; - max-width: 18%; - position: fixed; text-align: right; z-index: 1; } #toolbar .button_wrapper { float: right; + margin-left: 15px; + margin-right: 15px; } #toolbar .image_button { @@ -232,17 +230,43 @@ img { background-image: url(/static/images/arrow_down_hover.png); } +#note_tree_area { + position: fixed; + width: 17em; + max-width: 20%; + text-align: left; + line-height: 140%; + top: 80px; + bottom: 1em; + overflow-y: visible; +} + +#note_tree_area_holder { + height: 100%; + overflow-y: auto; + padding-left: 1em; + margin-right: 1em; +} + +#note_tree_area_title { + margin-top: 0.5em; + margin-bottom: 0.25em; +} + #link_area { float: right; text-align: left; + line-height: 140%; + width: 20%; +} + +#link_area_holder { + padding-left: 1em; padding-right: 1em; - line-height: 100%; - width: 15em; - max-width: 17%; } #this_notebook_area_title { - margin-top: 0.5em; + margin-top: 0; margin-bottom: 0.25em; } @@ -500,8 +524,19 @@ img { } .link_area_item { - margin-top: 0.25em; - padding: 0.25em 0.25em 0.25em 0.5em; + padding: 0.2em 0.25em 0.2em 0.5em; +} + +.tree_expander { + float: left; + width: 20px; + height: 1.5em; + background: url(/static/images/tree_arrow.png) no-repeat center center; +} + +.tree_expander:hover { + background: url(/static/images/tree_arrow_hover.png) no-repeat center center; + cursor: pointer; } #storage_usage_area { @@ -607,6 +642,7 @@ img { .small_text { font-size: 90%; + font-weight: normal; } .new_feature_text { diff --git a/static/images/tree_arrow.png b/static/images/tree_arrow.png new file mode 100644 index 0000000..17cbf7d Binary files /dev/null and b/static/images/tree_arrow.png differ diff --git a/static/images/tree_arrow.xcf b/static/images/tree_arrow.xcf new file mode 100644 index 0000000..3fcfd6c Binary files /dev/null and b/static/images/tree_arrow.xcf differ diff --git a/static/images/tree_arrow_down.png b/static/images/tree_arrow_down.png new file mode 100644 index 0000000..93559a1 Binary files /dev/null and b/static/images/tree_arrow_down.png differ diff --git a/static/images/tree_arrow_down.xcf b/static/images/tree_arrow_down.xcf new file mode 100644 index 0000000..d7f0955 Binary files /dev/null and b/static/images/tree_arrow_down.xcf differ diff --git a/static/images/tree_arrow_down_hover.png b/static/images/tree_arrow_down_hover.png new file mode 100644 index 0000000..d717e6a Binary files /dev/null and b/static/images/tree_arrow_down_hover.png differ diff --git a/static/images/tree_arrow_down_hover.xcf b/static/images/tree_arrow_down_hover.xcf new file mode 100644 index 0000000..89d1f55 Binary files /dev/null and b/static/images/tree_arrow_down_hover.xcf differ diff --git a/static/images/tree_arrow_hover.png b/static/images/tree_arrow_hover.png new file mode 100644 index 0000000..8da975d Binary files /dev/null and b/static/images/tree_arrow_hover.png differ diff --git a/static/images/tree_arrow_hover.xcf b/static/images/tree_arrow_hover.xcf new file mode 100644 index 0000000..7980bda Binary files /dev/null and b/static/images/tree_arrow_hover.xcf differ diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 92e68d9..227b1c7 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -9,7 +9,6 @@ function Wiki( invoker ) { this.parent_id = getElement( "parent_id" ).value; // id of the notebook containing this one this.startup_notes = new Array(); // map of startup notes: note id to bool this.open_editors = new Array(); // map of open notes: note title to editor - this.all_notes_editor = null; // editor for display of list of all notes this.search_results_editor = null; // editor for display of search results this.invoker = invoker; this.rate_plan = evalJSON( getElement( "rate_plan" ).value ); @@ -19,6 +18,7 @@ function Wiki( invoker ) { this.after_login = getElement( "after_login" ).value; this.signup_plan = getElement( "signup_plan" ).value; this.font_size = null; + this.note_tree = new Note_tree( this, this.notebook_id, this.invoker ); var total_notes_count_node = getElement( "total_notes_count" ); if ( total_notes_count_node ) @@ -312,14 +312,6 @@ Wiki.prototype.populate = function ( startup_notes, current_notes, note_read_wri ); } - var all_notes_link = getElement( "all_notes_link" ); - if ( all_notes_link ) { - connect( all_notes_link, "onclick", function ( event ) { - self.load_editor( "all notes", "null", null, null, getElement( "notes_top" ) ); - event.stop(); - } ); - } - var download_html_link = getElement( "download_html_link" ); if ( download_html_link ) { connect( download_html_link, "onclick", function ( event ) { @@ -398,8 +390,7 @@ Wiki.prototype.create_blank_editor = function ( event ) { var editor = this.create_editor( undefined, undefined, undefined, undefined, undefined, this.notebook.read_write, true, true ); this.increment_total_notes_count(); this.blank_editor_id = editor.id; - - this.add_all_notes_link( editor.id, "" ); + signal( this, "note_added", editor ); } Wiki.prototype.load_editor = function ( note_title, note_id, revision, link, position_after ) { @@ -443,13 +434,6 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, link, pos var self = this; if ( pulldown_title || note_id == undefined || note_id == "new" || note_id == "null" ) { // if the note_title corresponds to a "magic" note's title, then dynamically highlight or create the note - if ( note_title == "all notes" ) { - this.invoker.invoke( - "/notebooks/all_notes", "GET", { "notebook_id": this.notebook.object_id }, - function( result ) { self.display_all_notes_list( result ); } - ); - return; - } if ( note_title == "search results" ) { var editor = this.open_editors[ note_title ]; if ( editor ) { @@ -513,14 +497,12 @@ Wiki.prototype.resolve_link = function ( note_title, link, callback ) { if ( link && link.target ) link.removeAttribute( "target" ); - if ( note_title == "all notes" || note_title == "search results" || note_title == "share this notebook" ) { + if ( note_title == "search results" || note_title == "share this notebook" ) { link.href = "/notebooks/" + this.notebook_id + "?" + queryString( [ "title", "note_id" ], [ note_title, "null" ] ); if ( callback ) { - if ( note_title == "all notes" ) - callback( "list of all notes in this notebook" ); if ( note_title == "search results" ) callback( "current search results" ); else @@ -751,7 +733,7 @@ Wiki.prototype.editor_title_changed = function ( editor, old_title, new_title ) if ( new_title != null && !editor.empty() ) { this.open_editors[ new_title ] = editor; - this.add_all_notes_link( editor.id, new_title ); + signal( this, "note_renamed", editor, new_title ); } } @@ -804,7 +786,7 @@ Wiki.prototype.editor_focused = function ( editor, synchronous ) { // if the formerly focused editor is completely empty, then remove it as the user leaves it and switches to this editor if ( this.focused_editor.id == this.blank_editor_id && this.focused_editor.empty() ) { - this.remove_all_notes_link( this.focused_editor.id ); + signal( this, "note_removed", this.focused_editor.id ); this.focused_editor.shutdown(); this.decrement_total_notes_count(); this.display_empty_message(); @@ -1081,7 +1063,7 @@ Wiki.prototype.hide_editor = function ( event, editor ) { // if the editor to hide is completely empty, then simply remove it if ( editor.id == this.blank_editor_id && editor.empty() ) { - this.remove_all_notes_link( editor.id ); + signal( this, "note_removed", editor.id ); editor.shutdown(); this.decrement_total_notes_count(); } else { @@ -1090,10 +1072,9 @@ Wiki.prototype.hide_editor = function ( event, editor ) { this.save_editor( editor ); editor.shutdown(); - Highlight( "all_notes_link" ); } - this.display_empty_message( id == "all_notes" ); + this.display_empty_message(); } event.stop(); @@ -1142,7 +1123,7 @@ Wiki.prototype.delete_editor = function ( event, editor ) { connect( undo_button, "onclick", function ( event ) { self.undelete_editor_via_undo( event, editor, message_div ); } ); } - self.remove_all_notes_link( editor.id ); + signal( self, "note_removed", editor.id ); editor.shutdown(); self.decrement_total_notes_count(); @@ -1176,7 +1157,7 @@ Wiki.prototype.undelete_editor_via_trash = function ( event, editor ) { if ( editor == this.focused_editor ) this.focused_editor = null; - this.remove_all_notes_link( editor.id ); + signal( this, "note_removed", editor.id ); editor.shutdown(); this.decrement_total_notes_count(); @@ -1199,6 +1180,7 @@ Wiki.prototype.undelete_editor_via_undo = function( event, editor, position_afte this.startup_notes[ editor.id ] = true; this.increment_total_notes_count(); this.load_editor( "Note not found.", editor.id, null, null, position_after ); + signal( this, "note_added", editor ); } event.stop(); @@ -1216,6 +1198,7 @@ Wiki.prototype.undelete_editor_via_undelete = function( event, note_id, position this.startup_notes[ note_id ] = true; this.increment_total_notes_count(); this.load_editor( "Note not found.", note_id, null, null, position_after ); + signal( this, "note_removed", editor.id ); event.stop(); } @@ -1371,40 +1354,6 @@ Wiki.prototype.display_search_results = function ( result ) { this.search_results_editor = this.create_editor( "search_results", "