X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d3802aac61418039b0951f7fcfdd3dcc1ae299af..d9bec7e66b9e33e3aca3cca1abd78e9151b5d03a:/redakcja/static/js/wiki/view_annotations.js?ds=inline
diff --git a/redakcja/static/js/wiki/view_annotations.js b/redakcja/static/js/wiki/view_annotations.js
index 5bac593c..76a0ae9e 100644
--- a/redakcja/static/js/wiki/view_annotations.js
+++ b/redakcja/static/js/wiki/view_annotations.js
@@ -40,6 +40,45 @@
AnnotationsPerspective.prototype = new $.wiki.Perspective();
+ AnnotationsPerspective.prototype.updateAnnotationIds = function(self){
+ self.annotationToAnchor = {};
+ $('#html-view .annotation-inline-box').each(
+ function(i, annoBox) {
+ var $annoBox = $(annoBox);
+ var $anchor = $("a[name|=anchor]", $annoBox);
+ var htmlContent = $('span', $annoBox).html();
+ // TBD: perhaps use a hash of htmlContent as key
+ self.annotationToAnchor[htmlContent] = $anchor.attr('name');
+ });
+ }
+
+ AnnotationsPerspective.prototype.goToAnnotation = function(self, srcNode){
+ var content = $(srcNode).html();
+ content = content.replace('>', '>', 'g').replace('<', '<', 'g').replace('&', '&', 'g');
+ xml2html({
+ xml: '