X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/df341bdd09208d2b0f84060454cc0000df19deba..fbb8f42993d02108b506028dc85466a0541be359:/src/redakcja/static/js/wiki/view_annotations.js?ds=sidebyside
diff --git a/src/redakcja/static/js/wiki/view_annotations.js b/src/redakcja/static/js/wiki/view_annotations.js
index 771909b9..8e3671ab 100644
--- a/src/redakcja/static/js/wiki/view_annotations.js
+++ b/src/redakcja/static/js/wiki/view_annotations.js
@@ -3,14 +3,13 @@
/*
* Perspective
*/
- function AnnotationsPerspective(options){
- var old_callback = options.callback || function() { };
+ class AnnotationsPerspective extends $.wiki.SidebarPerspective {
+ vsplitbar = 'PRZYPISY';
- this.vsplitbar = 'PRZYPISY';
+ constructor(options) {
+ super(options);
- options.callback = function(){
var self = this;
-
this.$element = $("#side-annotations");
this.$error = $('.error-message', this.$element);
this.$annos = $('.annotations-list', this.$element);
@@ -27,151 +26,143 @@
self.$annos.hide();
self.$error.hide();
self.$spinner.fadeIn(100, function() {
- self.refresh(self, atype);
+ self.refresh(atype);
});
});
-
- old_callback.call(this);
- };
-
- $.wiki.SidebarPerspective.call(this, options);
- }
-
- AnnotationsPerspective.prototype = new $.wiki.SidebarPerspective();
-
- AnnotationsPerspective.prototype.updateAnnotationIds = function(self){
- self.annotationToAnchor = {};
- $('#html-view').find('.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: '
WystÄ piÅ bÅÄ d:
' + text + '
WystÄ piÅ bÅÄ d:
' + text + '