]*>|"+atype+">$", "g")
- xml_text = serializer.serializeToString(annos[i]).replace(ann_expr, "");
+ annos.each(function (i, elem) {
+ var xml_text = serializer.serializeToString(elem).replace(ann_expr, "");
xml2html({
xml: "" + xml_text + "",
success: function(xml_text){
return function(elem){
elem.sortby = $(elem).text().trim();
- $(elem).append(""+ xml_text.replace("&", "&", "g").replace("<", "<", "g") +"
")
+ $(elem).append(""+ xml_text.replace(/&/g, "&").replace(/");
anno_list.push(elem);
+ $(".src", elem).click(function() { self.goToAnnotation(self, this); });
counter--;
if (!counter) {
anno_list.sort(function(a, b){return a.sortby.localeCompare(b.sortby);});
- self.$annos.append(anno_list);
+ for (i in anno_list)
+ self.$annos.append(anno_list[i]);
self.$spinner.hide();
self.$annos.show();
}
@@ -115,14 +157,12 @@
self.$error.show();
}
});
- }
+ });
}
- }
-
+ };
- AnnotationsPerspective.prototype.onEnter = function(success, failure){
- var self = this;
+ AnnotationsPerspective.prototype.onEnter = function(){
$.wiki.Perspective.prototype.onEnter.call(this);
$('.vsplitbar').not('.active').trigger('click');
@@ -131,9 +171,9 @@
};
- AnnotationsPerspective.prototype.onExit = function(success, failure) {
+ AnnotationsPerspective.prototype.onExit = function(success, failure) {
- };
+ };
$.wiki.AnnotationsPerspective = AnnotationsPerspective;