Fixed a bug in which renaming a link title and then pressing ctrl-L would replace the link destination.
This commit is contained in:
parent
9fed61aae1
commit
b7e07fbc72
4
NEWS
4
NEWS
|
@ -1,6 +1,8 @@
|
||||||
1.4.22:
|
1.4.22: August 1, 2008:
|
||||||
* Skipping clearing of messages/errors if they haven't been open long enough
|
* Skipping clearing of messages/errors if they haven't been open long enough
|
||||||
to read.
|
to read.
|
||||||
|
* Fixed a bug in which renaming a link title and then pressing ctrl-L would
|
||||||
|
replace the link destination.
|
||||||
|
|
||||||
1.4.21: July 30, 2008:
|
1.4.21: July 30, 2008:
|
||||||
* Fixed bug in IE 7 in which there was too much horizontal spacing at very
|
* Fixed bug in IE 7 in which there was too much horizontal spacing at very
|
||||||
|
|
|
@ -554,7 +554,7 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, previous_
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Wiki.prototype.resolve_link = function ( note_title, link, callback ) {
|
Wiki.prototype.resolve_link = function ( note_title, link, force, callback ) {
|
||||||
// if the title looks like a URL, then make it a link to an external site
|
// if the title looks like a URL, then make it a link to an external site
|
||||||
if ( /^\w+:\/\//.test( note_title ) )
|
if ( /^\w+:\/\//.test( note_title ) )
|
||||||
var title_looks_like_url = true;
|
var title_looks_like_url = true;
|
||||||
|
@ -583,8 +583,11 @@ Wiki.prototype.resolve_link = function ( note_title, link, callback ) {
|
||||||
var id = parse_query( link ).note_id;
|
var id = parse_query( link ).note_id;
|
||||||
|
|
||||||
// if the link already has a valid-looking id, it's already resolved, so bail
|
// if the link already has a valid-looking id, it's already resolved, so bail
|
||||||
if ( !callback && id != undefined && id != "new" && id != "null" )
|
if ( !force && id != undefined && id != "new" && id != "null" ) {
|
||||||
|
if ( callback )
|
||||||
|
callback( null );
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( note_title.length == 0 )
|
if ( note_title.length == 0 )
|
||||||
return;
|
return;
|
||||||
|
@ -1248,7 +1251,7 @@ Wiki.prototype.toggle_link_button = function ( event ) {
|
||||||
|
|
||||||
if ( link && link.parentNode != null ) {
|
if ( link && link.parentNode != null ) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.resolve_link( link_title( link ), link, function ( summary ) {
|
this.resolve_link( link_title( link ), link, false, function ( summary ) {
|
||||||
self.display_link_pulldown( self.focused_editor, link );
|
self.display_link_pulldown( self.focused_editor, link );
|
||||||
} );
|
} );
|
||||||
} else {
|
} else {
|
||||||
|
@ -3024,7 +3027,7 @@ Link_pulldown.prototype.title_field_changed = function ( event, note ) {
|
||||||
this.display_summary( note.title, summarize_html( note.contents, note.title ) );
|
this.display_summary( note.title, summarize_html( note.contents, note.title ) );
|
||||||
// otherwise, try to resolve the link title
|
// otherwise, try to resolve the link title
|
||||||
} else {
|
} else {
|
||||||
this.wiki.resolve_link( title, this.link, function ( summary ) {
|
this.wiki.resolve_link( title, this.link, true, function ( summary ) {
|
||||||
self.display_summary( title, summary );
|
self.display_summary( title, summary );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue