var old_callback = options.callback || function() { };
this.noupdate_hash_onenter = true;
+ this.vsplitbar = 'PRZYPISY';
options.callback = function(){
var self = this;
for (var i=0; i<annos.length; i++)
{
- text = serializer.serializeToString(annos[i]).replace(/<(\/?)pe[^>]*>/g, "<$1akap>");
+ xml_text = serializer.serializeToString(annos[i]).replace(/^<pe[^>]*>|<\/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: "<akap>" + xml_text + "</akap>",
+ success: function(xml_text){
+ return function(elem){
+ elem.sortby = $(elem).text().trim();
+ $(elem).append("<div class='src'>"+ xml_text.replace("&", "&", "g").replace("<", "<", "g") +"</div>")
+ 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);
$.wiki.Perspective.prototype.onEnter.call(this);
$('.vsplitbar').not('.active').trigger('click');
- $(".vsplitbar-title").html("↓ PRZYPISY ↓");
+ $(".vsplitbar-title").html("↓ PRZYPISY ↓");
this.refresh(this);