witten
/
luminotes
Archived
1
0
Fork 0

Added permalinks to blog and discussion forum posts.

This commit is contained in:
Dan Helfman 2008-11-10 12:32:52 -08:00
parent 8f4cdd662d
commit 25b2f2fe84
2 changed files with 14 additions and 12 deletions

2
NEWS
View File

@ -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

View File

@ -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 '<p class="byline small_text">Posted' + by + timestamp;
return '<p class="byline small_text">Posted' + by + timestamp +
' | <a href="' + window.location.pathname + '?note_id=' + note_id + '" target="_top">permalink</a>';
}
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 ) {