function AnnotationsPerspective(options){
var old_callback = options.callback || function() { };
- this.noupdate_hash_onenter = true;
this.vsplitbar = 'PRZYPISY';
options.callback = function(){
self.$annos.hide();
self.$error.hide();
- self.$spinner.show(100, function(){
+ self.$spinner.fadeIn(100, function() {
self.refresh(self, atype);
});
});
old_callback.call(this);
};
- $.wiki.Perspective.call(this, options);
+ $.wiki.SidebarPerspective.call(this, options);
}
- AnnotationsPerspective.prototype = new $.wiki.Perspective();
+ AnnotationsPerspective.prototype = new $.wiki.SidebarPerspective();
AnnotationsPerspective.prototype.updateAnnotationIds = function(self){
self.annotationToAnchor = {};
},
error: function(text) {
$.unblockUI();
- self.$error.html(text);
+ self.$error.html('<div class="alert alert-danger">' + text + '</div>');
self.$spinner.hide();
self.$error.show();
}
var persp = $.wiki.activePerspective();
if (persp == 'CodeMirrorPerspective') {
- xml = $.wiki.perspectives[persp].codemirror.getCode();
+ xml = $.wiki.perspectives[persp].codemirror.getValue();
}
else if (persp == 'VisualPerspective') {
html2text({
xml = text;
},
error: function(text){
- self.$error.html('<p>Wystąpił błąd:</p><pre>' + text + '</pre>');
+ self.$error.html('<div class="alert alert-danger"><p>Wystąpił błąd:</p><pre>' + text + '</pre></div>');
self.$spinner.hide();
self.$error.show();
}
var error = $('parsererror', doc);
if (error.length > 0) {
- self.$error.html('Błąd parsowania XML.');
+ self.$error.html('<div class="alert alert-danger">Błąd parsowania XML.</a>');
self.$spinner.hide();
self.$error.show();
}
if (annos.length == 0)
{
- self.$annos.html('Nie ma żadnych przypisów');
+ self.$annos.html('<div class="alert alert-info">Nie ma żadnych przypisów</div>');
self.$spinner.hide();
self.$annos.show();
}
}(xml_text),
error: function(text) {
$.unblockUI();
- self.$error.html(text);
+ self.$error.html('<div class="alert alert-danger">' + text + '</div>');
self.$spinner.hide();
self.$error.show();
}
AnnotationsPerspective.prototype.onEnter = function(){
- $.wiki.Perspective.prototype.onEnter.call(this);
+ $.wiki.SidebarPerspective.prototype.onEnter.call(this);
- $('.vsplitbar').not('.active').trigger('click');
- $(".vsplitbar-title").html("↓ PRZYPISY ↓");
this.$refresh.filter('.active').trigger('click');
};