diff --git a/NEWS b/NEWS index 3ea0afb..b5dd00b 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ 1.5.6: - * + * Added permalinks to blog and discussion forum posts. 1.5.5: November 6, 2008 * Improved speed of Luminotes Desktop by adding some database indices. This diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 2e2643d..05f6436 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -813,7 +813,8 @@ Wiki.prototype.create_editor = function ( id, note_text, deleted_from_id, revisi } if ( creation ) { - note_text = this.make_byline( username, creation ) + note_text; + var note_id = id.split( ' ' )[ 0 ]; + note_text = this.make_byline( username, creation, note_id ) + note_text; } var startup = this.startup_notes[ id ]; @@ -1003,14 +1004,6 @@ Wiki.prototype.update_link_with_suggestion = function ( editor, link, note ) { Wiki.prototype.editor_focused = function ( editor, synchronous ) { if ( editor ) { addElementClass( editor.iframe, "focused_note_frame" ); - - if ( editor.document && editor.read_write ) { - var byline = getFirstElementByTagAndClassName( "p", "byline", editor.document ); - if ( byline ) { - removeElement( byline ); - editor.resize(); - } - } } if ( this.focused_editor && this.focused_editor != editor ) { @@ -1037,7 +1030,7 @@ Wiki.prototype.editor_focused = function ( editor, synchronous ) { } } -Wiki.prototype.make_byline = function ( username, creation ) { +Wiki.prototype.make_byline = function ( username, creation, note_id ) { if ( username == "anonymous" ) username = "admin"; @@ -1051,7 +1044,8 @@ Wiki.prototype.make_byline = function ( username, creation ) { else var timestamp = ''; - return '

Posted' + by + timestamp; + return '

Posted' + by + timestamp + + ' | permalink'; } Wiki.prototype.editor_mouse_hovered = function ( editor, target ) { @@ -1078,6 +1072,14 @@ Wiki.prototype.key_pressed = function ( event ) { } Wiki.prototype.editor_key_pressed = function ( editor, event ) { + if ( editor.document && editor.read_write ) { + var byline = getFirstElementByTagAndClassName( "p", "byline", editor.document ); + if ( byline ) { + removeElement( byline ); + editor.resize(); + } + } + var code = event.key().code; if ( event.modifier().ctrl ) {