X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/b5f8d214ba00903379f8716ef563f19743a120b6..298031e8a452a9012bc43098a32f60f5b5a2b152:/redakcja/static/js/wiki/view_annotations.js diff --git a/redakcja/static/js/wiki/view_annotations.js b/redakcja/static/js/wiki/view_annotations.js index d51ce9c8..72946789 100644 --- a/redakcja/static/js/wiki/view_annotations.js +++ b/redakcja/static/js/wiki/view_annotations.js @@ -7,6 +7,7 @@ var old_callback = options.callback || function() { }; this.noupdate_hash_onenter = true; + this.vsplitbar = 'PRZYPISY'; options.callback = function(){ var self = this; @@ -68,20 +69,23 @@ for (var i=0; i]*>/g, "<$1akap>"); + xml_text = serializer.serializeToString(annos[i]).replace(/^]*>|<\/pe>$/g, ""); xml2html({ - xml: text, - success: function(elem){ - elem.txt = $(elem).text().trim(); - anno_list.push(elem); - counter--; - - if (!counter) { - anno_list.sort(function(a, b){return (a.txt < b.txt) ? -1 : (a.txt > b.txt ? 1 : 0)}); - self.$annos.append(anno_list); - self.$annos.show(); + xml: "" + xml_text + "", + success: function(xml_text){ + return function(elem){ + elem.sortby = $(elem).text().trim(); + $(elem).append("
"+ xml_text.replace("&", "&", "g").replace("<", "<", "g") +"
") + anno_list.push(elem); + counter--; + + if (!counter) { + anno_list.sort(function(a, b){return a.sortby.localeCompare(b.sortby);}); + self.$annos.append(anno_list); + self.$annos.show(); + } } - }, + }(xml_text), error: function(text) { $.unblockUI(); self.$error.html(text); @@ -99,7 +103,7 @@ $.wiki.Perspective.prototype.onEnter.call(this); $('.vsplitbar').not('.active').trigger('click'); - $(".vsplitbar-title").html("↓ PRZYPISY ↓"); + $(".vsplitbar-title").html("↓ PRZYPISY ↓"); this.refresh(this);