Fixed bug that prevented you from opening a note with a title that looked
like an external URL.
This commit is contained in:
parent
17b7dfc74e
commit
08cd7057f3
5
NEWS
5
NEWS
|
@ -1,8 +1,11 @@
|
||||||
1.1.0: January ??, 2007
|
1.1.0: January ??, 2007
|
||||||
* Ability to invite people to your notebook as a collaborator or owner.
|
* Ability to invite people to your notebook as a collaborator or owner.
|
||||||
* Feature to preview a notebook as a viewer would see it.
|
* Feature to preview a notebook as a viewer would see it.
|
||||||
* Note revisions list now include username of the user who made that revision.
|
* Note revisions list now include username of the user who made that
|
||||||
|
revision.
|
||||||
* Fixed bug where passwords with special characters broke password hashing.
|
* Fixed bug where passwords with special characters broke password hashing.
|
||||||
|
* Fixed bug that prevented you from opening a note with a title that looked
|
||||||
|
like an external URL.
|
||||||
* Fixed bug where link info box summaries sometimes contained HTML tags.
|
* Fixed bug where link info box summaries sometimes contained HTML tags.
|
||||||
|
|
||||||
1.0.4: December 30, 2007
|
1.0.4: December 30, 2007
|
||||||
|
|
|
@ -375,13 +375,6 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, link, pos
|
||||||
note_title = pulldown_title;
|
note_title = pulldown_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the title looks like a URL, then make it a link to an external site
|
|
||||||
if ( /^\w+:\/\//.test( note_title ) ) {
|
|
||||||
link.target = "_new";
|
|
||||||
link.href = note_title;
|
|
||||||
window.open( link.href );
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ( link.target )
|
if ( link.target )
|
||||||
link.removeAttribute( "target" );
|
link.removeAttribute( "target" );
|
||||||
}
|
}
|
||||||
|
@ -468,12 +461,11 @@ Wiki.prototype.load_editor = function ( note_title, note_id, revision, link, pos
|
||||||
|
|
||||||
Wiki.prototype.resolve_link = function ( note_title, link, callback ) {
|
Wiki.prototype.resolve_link = function ( note_title, link, 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 ) )
|
||||||
link.target = "_new";
|
var title_looks_like_url = true;
|
||||||
link.href = note_title;
|
else
|
||||||
if ( callback ) callback( "web link" );
|
var title_looks_like_url = false;
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( link && link.target )
|
if ( link && link.target )
|
||||||
link.removeAttribute( "target" );
|
link.removeAttribute( "target" );
|
||||||
|
|
||||||
|
@ -523,6 +515,11 @@ Wiki.prototype.resolve_link = function ( note_title, link, callback ) {
|
||||||
function ( result ) {
|
function ( result ) {
|
||||||
if ( result && result.note ) {
|
if ( result && result.note ) {
|
||||||
link.href = "/notebooks/" + self.notebook_id + "?note_id=" + result.note.object_id;
|
link.href = "/notebooks/" + self.notebook_id + "?note_id=" + result.note.object_id;
|
||||||
|
} else if ( title_looks_like_url ) {
|
||||||
|
link.target = "_new";
|
||||||
|
link.href = note_title;
|
||||||
|
callback( "web link" );
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
link.href = "/notebooks/" + self.notebook_id + "?" + queryString(
|
link.href = "/notebooks/" + self.notebook_id + "?" + queryString(
|
||||||
[ "title", "note_id" ],
|
[ "title", "note_id" ],
|
||||||
|
@ -544,6 +541,9 @@ Wiki.prototype.resolve_link = function ( note_title, link, callback ) {
|
||||||
function ( result ) {
|
function ( result ) {
|
||||||
if ( result && result.note_id ) {
|
if ( result && result.note_id ) {
|
||||||
link.href = "/notebooks/" + self.notebook_id + "?note_id=" + result.note_id;
|
link.href = "/notebooks/" + self.notebook_id + "?note_id=" + result.note_id;
|
||||||
|
} else if ( title_looks_like_url ) {
|
||||||
|
link.target = "_new";
|
||||||
|
link.href = note_title;
|
||||||
} else {
|
} else {
|
||||||
link.href = "/notebooks/" + self.notebook_id + "?" + queryString(
|
link.href = "/notebooks/" + self.notebook_id + "?" + queryString(
|
||||||
[ "title", "note_id" ],
|
[ "title", "note_id" ],
|
||||||
|
@ -580,6 +580,14 @@ Wiki.prototype.parse_loaded_editor = function ( result, note_title, requested_re
|
||||||
var note_text = result.note.contents;
|
var note_text = result.note.contents;
|
||||||
var deleted_from_id = result.note.deleted;
|
var deleted_from_id = result.note.deleted;
|
||||||
} else {
|
} else {
|
||||||
|
// if the title looks like a URL, then make it a link to an external site
|
||||||
|
if ( /^\w+:\/\//.test( note_title ) ) {
|
||||||
|
link.target = "_new";
|
||||||
|
link.href = note_title;
|
||||||
|
window.open( link.href );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var id = null;
|
var id = null;
|
||||||
var note_text = "<h3>" + note_title;
|
var note_text = "<h3>" + note_title;
|
||||||
var deleted_from_id = null;
|
var deleted_from_id = null;
|
||||||
|
|
Reference in New Issue