diff --git a/NEWS b/NEWS index 866cbc6..f9cebc1 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ unformatted. * Fixed a bug in which toolbar buttons didn't depress based on the current location of the text cursor. + * Fixed a bug in which discussion forum bylines ("Posted by...") were + sometimes duplicated several times on a given post. Now bylines are + displayed below each post rather than within it. 1.6.10: March 20, 2009 * Faster uploads and downloads for users of luminotes.com. diff --git a/static/css/style.css b/static/css/style.css index e7ff323..fc83582 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -436,6 +436,7 @@ h1 { .note_controls { text-align: right; margin-right: 1.5em; + min-height: 0.5em; } .note_button { @@ -1210,3 +1211,7 @@ h1 { margin-left: 0.75em; margin-right: 0.75em; } + +.byline { + margin-left: 1em; +} diff --git a/static/js/Wiki.js b/static/js/Wiki.js index ae96fa4..f52c15c 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -830,11 +830,6 @@ Wiki.prototype.create_editor = function ( id, note_text, deleted_from_id, revisi '' + note_text; } - if ( creation && note_text != "

" ) { - var note_id = id.split( ' ' )[ 0 ]; - note_text = note_text + this.make_byline( username, creation, note_id ); - } - var startup = this.startup_notes[ id ]; var editor = new Editor( id, this.notebook.object_id, note_text, deleted_from_id, revision, read_write, startup, highlight, focus, position_after, dirty, own_notes_only ); if ( focus ) @@ -842,6 +837,11 @@ Wiki.prototype.create_editor = function ( id, note_text, deleted_from_id, revisi else if ( !read_write ) this.editor_focused( null ); + if ( creation && note_text != "

" ) { + var note_id = id.split( ' ' )[ 0 ]; + appendChildNodes( editor.holder, this.make_byline( username, creation, note_id ) ); + } + if ( this.notebook.read_write ) { connect( editor, "state_changed", this, "editor_state_changed" ); connect( editor, "title_changed", this, "editor_title_changed" ); @@ -1080,18 +1080,15 @@ Wiki.prototype.make_byline = function ( username, creation, note_id ) { else var timestamp = ''; - return '
Posted' + by + timestamp + - ' | permalink'; -} - -Wiki.prototype.remove_byline = function ( editor ) { - if ( editor.document && editor.read_write ) { - var byline = getFirstElementByTagAndClassName( "div", "byline", editor.document ); - if ( byline ) { - removeElement( byline ); - editor.resize(); - } - } + return createDOM( + "span", + { "class": "byline small_text" }, + 'Posted' + by + timestamp + ' | ', + createDOM( "a", { + "href": window.location.pathname + '?note_id=' + note_id, + "target": "_top" + }, "permalink" ) + ); } Wiki.prototype.editor_mouse_hovered = function ( editor, target ) { @@ -1138,8 +1135,6 @@ Wiki.prototype.key_pressed = function ( event ) { } Wiki.prototype.editor_key_pressed = function ( editor, event ) { - this.remove_byline( editor ); - var code = event.key().code; if ( event.modifier().ctrl ) { @@ -1795,7 +1790,6 @@ Wiki.prototype.save_editor = function ( editor, fire_and_forget, callback, synch if ( editor && editor.read_write && !editor.closed && ( ( !editor.empty() && editor.dirty() ) || position_after || position_before ) ) { editor.scrape_title(); - this.remove_byline( editor ); this.invoker.invoke( "/notebooks/save_note", "POST", { "notebook_id": this.notebook.object_id,