diff --git a/controller/Notebooks.py b/controller/Notebooks.py
index 004fec5..ffa3b6a 100644
--- a/controller/Notebooks.py
+++ b/controller/Notebooks.py
@@ -489,12 +489,12 @@ class Notebooks( object ):
# if it has a link target, it's a link to an external web site
if target:
- items.append( Note_tree_area.make_item( title, attributes, "note_tree_external_link" ) )
+ items.append( Note_tree_area.make_item( title, attributes, u"note_tree_external_link", target = u"_new" ) )
continue
# if it has '/files/' in its path, it's an uploaded file link
if self.FILE_PATTERN.search( href ):
- items.append( Note_tree_area.make_item( title, attributes, "note_tree_file_link" ) )
+ items.append( Note_tree_area.make_item( title, attributes, u"note_tree_file_link", target = u"_new" ) )
continue
# if it has a note_id, load that child note and see whether it has any children of its own
@@ -504,11 +504,11 @@ class Notebooks( object ):
child_note_id = child_note_ids[ 0 ]
child_note = self.__database.load( Note, child_note_id )
if child_note and self.LINK_PATTERN.search( child_note.contents ):
- items.append( Note_tree_area.make_item( title, attributes, "note_tree_link", has_children = True ) )
+ items.append( Note_tree_area.make_item( title, attributes, u"note_tree_link", has_children = True ) )
continue
# otherwise, it's childless
- items.append( Note_tree_area.make_item( title, attributes, "note_tree_link", has_children = False ) )
+ items.append( Note_tree_area.make_item( title, attributes, u"note_tree_link", has_children = False ) )
return dict(
tree_html = unicode( Note_tree_area.make_tree( items ) ),
diff --git a/static/js/Wiki.js b/static/js/Wiki.js
index 8dd4545..da3f422 100644
--- a/static/js/Wiki.js
+++ b/static/js/Wiki.js
@@ -2690,6 +2690,8 @@ Note_tree.prototype.expand_link = function ( event, note_id ) {
}
);
+ // TODO: add onclick handler for each link that's to a note
+
return;
}
diff --git a/view/Note_tree_area.py b/view/Note_tree_area.py
index 7c8cdab..27af0c0 100644
--- a/view/Note_tree_area.py
+++ b/view/Note_tree_area.py
@@ -35,15 +35,16 @@ class Note_tree_area( Div ):
)
@staticmethod
- def make_item( title, link_attributes, link_class, has_children = False, root_note_id = None ):
+ def make_item( title, link_attributes, link_class, has_children = False, root_note_id = None, target = None ):
return Tr(
has_children and \
Td( id = root_note_id and u"note_tree_expander_" + root_note_id or None, class_ = u"tree_expander" ) or
Td( id = root_note_id and u"note_tree_expander_" + root_note_id or None, class_ = u"tree_expander_empty" ),
Td(
- u"%s" % (
+ u"%s" % (
link_attributes,
- root_note_id and u" id=note_tree_link_" + root_note_id or None,
+ root_note_id and u' id="note_tree_link_%s"' % root_note_id or "",
+ target and u' target="%s"' % target or "",
link_class,
title or u"untitled note",
),