{% block tabs-right %}
{% include "wiki/tabs/gallery_view_item.html" %}
+ {% include "wiki/tabs/annotations_view_item.html" %}
{% include "wiki/tabs/search_view_item.html" %}
{% endblock %}
</div>
<div id="sidebar">
{% include "wiki/tabs/gallery_view.html" %}
+ {% include "wiki/tabs/annotations_view.html" %}
{% include "wiki/tabs/search_view.html" %}
</div>
{% endblock %}
--- /dev/null
+{% load i18n %}
+<div id="side-annotations">
+ <!-- annotations toolbar -->
+ <div class="toolbar">
+ <button class="refresh">{% trans "Refresh" %}</button>
+ <div class="toolbar-end">
+ </div>
+ </div>
+ <div class="error-message">
+ </div>
+ <div class="annotations-list">
+ </div>
+</div>
--- /dev/null
+{% load i18n %}
+<li id="AnnotationsPerspective" data-ui-related="side-annotations" data-ui-jsclass="AnnotationsPerspective">
+ <super title="{% trans "Annotations" %}">[1]</super>
+</li>
{% load i18n %}
<li id="ScanGalleryPerspective" data-ui-related="side-gallery" data-ui-jsclass="ScanGalleryPerspective" class='active'>
- <span>{% trans "Gallery" %}</span>
+ <img src="{{STATIC_URL}}icons/image-x-generic.png" alt="{% trans "Gallery" %}" title="{% trans "Gallery" %}" />
</li>
{% load i18n %}
<li id="SearchPerspective" data-ui-related="side-search" data-ui-jsclass="SearchPerspective">
- <span>{% trans "Search and replace" %}</span>
+ <img src="{{STATIC_URL}}icons/system-search.png" alt="{% trans "Search and replace" %}" title="{% trans "Search and replace" %}" />
</li>
'js/wiki/view_editor_source.js',
'js/wiki/view_editor_wysiwyg.js',
'js/wiki/view_gallery.js',
+ 'js/wiki/view_annotations.js',
'js/wiki/view_search.js',
'js/wiki/view_column_diff.js',
),
padding: .5em;
}
+#side-annotations {
+ display: none;
+}
+
+.annotations-list {
+ position: absolute;
+ left: 0;
+ top: 28px;
+ right: 0;
+ bottom: 0;
+ overflow: auto;
+ padding: 1em 1em 0 1em;
+}
+
+#side-annotations p.akap {
+ font-size: 16px;
+ font-family: "Georgia", "Times New Roman", serif;
+ line-height: 1.5em;
+ margin-bottom: 1em;
+}
+
/* =========== */
/* = Gallery = */
/* =========== */
}
.tabs li {
- height: 18px;
margin-top: 6px;
margin-bottom: 0px;
display: block;
float: left;
- padding-left: 12px;
- padding-right: 12px;
- padding-top: 5px;
-
font-weight: bold;
color: #222;
margin-left: 4px;
-webkit-border-bottom-right-radius: 0px;
}
+#tabs li {
+ height: 18px;
+ padding-left: 12px;
+ padding-right: 12px;
+ padding-top: 5px;
+}
+
.tabs li.active {
background-color: #C1C1C1;
}
+
+#tabs-right li {
+ height: 20px;
+ padding-left: 12px;
+ padding-right: 12px;
+ padding-top: 3px;
+}
+
+
+
#tools {
float: right;
clear: right;
$.wiki.state.perspectives.ScanGalleryPerspective.show = false;
$('#sidebar').hide();
$('.vsplitbar').css('right', 0).removeClass('active');
- if($(".vsplitbar-title").html() == "↓ SEARCH AND REPLACE ↓"){
- $(".vsplitbar-title").html("↑ SEARCH AND REPLACE ↑");
- } else {
- $(".vsplitbar-title").html("↑ GALLERY ↑");
+ if($(".vsplitbar-title").html() == "↓ ZNAJDŹ I ZAMIEŃ ↓"){
+ $(".vsplitbar-title").html("↑ ZNAJDŹ I ZAMIEŃ ↑");
+ } else if($(".vsplitbar-title").html() == "↓ PRZYPISY ↓"){
+ $(".vsplitbar-title").html("↑ PRZYPISY ↑");
+ } else {
+ $(".vsplitbar-title").html("↑ GALERIA ↑");
}
$('#editor .editor').css('right', 30);
$(window).resize();
--- /dev/null
+(function($){
+
+ /*
+ * Perspective
+ */
+ function AnnotationsPerspective(options){
+ var old_callback = options.callback || function() { };
+
+ this.noupdate_hash_onenter = true;
+
+ options.callback = function(){
+ var self = this;
+
+ this.$element = $("#side-annotations");
+ this.$error = $('.error-message', this.$element);
+ this.$annos = $('.annotations-list', this.$element);
+ $('.refresh', this.$element).click(function() {
+ self.refresh(self);
+ });
+
+ old_callback.call(this);
+ };
+
+ $.wiki.Perspective.call(this, options);
+ };
+
+ AnnotationsPerspective.prototype = new $.wiki.Perspective();
+
+ AnnotationsPerspective.prototype.refresh = function(self) {
+ var xml;
+
+ persp = $.wiki.activePerspective();
+ if (persp == 'CodeMirrorPerspective') {
+ xml = $.wiki.perspectives[persp].codemirror.getCode();
+ }
+ else if (persp == 'VisualPerspective') {
+ html2text({
+ element: $('#html-view div').get(0),
+ success: function(text){
+ xml = text;
+ },
+ error: function(text){
+ self.$error.html('<p>Wystąpił błąd:</p><pre>' + text + '</pre>');
+ }
+ });
+ }
+ else {
+ xml = this.doc.text;
+ }
+
+ var parser = new DOMParser();
+ var serializer = new XMLSerializer();
+ var doc = parser.parseFromString(xml, 'text/xml');
+ var error = $('parsererror', doc);
+
+ if (error.length > 0) {
+ self.$error.html('Błąd parsowania XML.');
+ self.$error.show();
+ self.$annos.hide();
+ }
+ else {
+ self.$error.hide();
+ self.$annos.hide();
+ self.$annos.html('');
+ var anno_list = new Array();
+ var annos = doc.getElementsByTagName('pe');
+ var counter = annos.length;
+
+ for (var i=0; i<annos.length; i++)
+ {
+ text = serializer.serializeToString(annos[i]).replace(/<(\/?)pe[^>]*>/g, "<$1akap>");
+ 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();
+ }
+ },
+ error: function(text) {
+ $.unblockUI();
+ self.$error.html(text);
+ self.$error.show();
+ }
+ });
+ }
+ }
+ }
+
+
+ AnnotationsPerspective.prototype.onEnter = function(success, failure){
+ var self = this;
+
+ $.wiki.Perspective.prototype.onEnter.call(this);
+
+ $('.vsplitbar').not('.active').trigger('click');
+ $(".vsplitbar-title").html("↓ PRZYPISY ↓");
+
+ this.refresh(this);
+
+ };
+
+ AnnotationsPerspective.prototype.onExit = function(success, failure) {
+
+ };
+
+ $.wiki.AnnotationsPerspective = AnnotationsPerspective;
+
+})(jQuery);
_finalize(success);
},
error: function(text, source){
- $('#html-view').html('<p class="error">Wystąpił błąd:</p><p>'+text+'</p><pre>'+source.replace(/&/g, '&').replace(/</g, '<')+'</pre>');
+ err = '<p class="error">Wystąpił błąd:</p><p>'+text+'</p>';
+ if (source)
+ err += '<pre>'+source.replace(/&/g, '&').replace(/</g, '<')+'</pre>'
+ $('#html-view').html(err);
_finalize(failure);
}
});
$.wiki.Perspective.prototype.onEnter.call(this);
$('.vsplitbar').not('.active').trigger('click');
- $(".vsplitbar-title").html("↓ GALLERY ↓");
+ $(".vsplitbar-title").html("↓ GALERIA ↓");
this.doc.refreshGallery({
success: function(doc, data){
self.$searchCursor = null;
$('.vsplitbar').not('.active').trigger('click');
- $(".vsplitbar-title").html("↓ SEARCH AND REPLACE ↓");
+ $(".vsplitbar-title").html("↓ ZNAJDŹ I ZAMIEŃ ↓");
if ($.wiki.activePerspective() != 'CodeMirrorPerspective')
$.wiki.switchToTab('#CodeMirrorPerspective');