X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/5085f47552e7c265a37f9fc0e5b3413154f902f0..2de0fde86873c879961365b4b9ce3904a158e84f:/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
diff --git a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
index 7baa00da..e5b0796b 100644
--- a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
+++ b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
@@ -479,9 +479,20 @@
};
});
}
- else if($box.is('*[x-annotation-box]') || $origin.is('*[x-edit-attribute]')) {
+ else if($box.is('*[x-annotation-box]') || $origin.is('*[x-edit-attribute]') || $origin.is('*[x-node="uwaga"]')) {
+ let q;
+ switch ($origin.attr('x-node')) {
+ case 'uwaga':
+ q = 'tÄ uwagÄ';
+ break;
+ case 'ref':
+ q = 'tÄ referencjÄ';
+ break
+ default:
+ q = 'ten przypis';
+ }
$('.delete-button', $overlay).click(function(){
- if (window.confirm("Czy jesteÅ pewien, że chcesz usunÄ
Ä ten przypis?")) {
+ if (window.confirm("Czy jesteÅ pewien, że chcesz usunÄ
Ä " + q + "?")) {
$origin.remove();
$overlay.remove();
$(document).unbind('click.blur-overlay');
@@ -505,7 +516,7 @@
if($box.attr("x-edit-attribute")) {
source = $('');
- source.text($box.attr("data-wlf-" + $box.attr("x-edit-attribute")));
+ source.text($box.attr("x-a-wl-" + $box.attr("x-edit-attribute")));
source = source[0];
} else {
source = $box[0];
@@ -621,6 +632,16 @@
});
}
+ function createUwagaBefore(before) {
+ xml2html({
+ xml: '',
+ success: function(element){
+ let $element = $(element);
+ $element.insertBefore(before);
+ openForEdit($element);
+ }
+ });
+ }
function VisualPerspective(options){
perspective = this;
@@ -629,26 +650,25 @@
options.callback = function(){
var element = $("#html-view");
- var button = $('');
+ var button = $('');
+ var uwagaButton = $('');
if (!CurrentDocument.readonly) {
$('#html-view').bind('mousemove', function(event){
var editable = $(event.target).closest('*[x-editable]');
- $('.active', element).not(editable).removeClass('active').children('.edit-button').remove();
+ $('.active', element).not(editable).removeClass('active').children('.active-block-button').remove();
if (!editable.hasClass('active')) {
editable.addClass('active').append(button);
+ if (!editable.is('[x-edit-attribute]')) {
+ editable.append(uwagaButton);
+ }
}
if (editable.is('.annotation-inline-box')) {
$('*[x-annotation-box]', editable).css({
-// left: event.clientX - editable.offset().left + 5,
-// top: event.clientY - editable.offset().top + 5
}).show();
}
- else {
-// $('*[x-annotation-box]').hide();
- }
});
perspective.caret = new Caret(element);
@@ -685,6 +705,10 @@
openForEdit($(this).parent());
});
+ $(document).on('click', '.uwaga-button', function(event){
+ event.preventDefault();
+ createUwagaBefore($(this).parent());
+ });
}
$(document).on('click', '[x-node="motyw"]', function(){
@@ -743,6 +767,8 @@
var self = this;
self.caret.detach();
+
+ $.wiki.exitTab('#PropertiesPerspective');
$.blockUI({
message: 'Zapisywanie widoku...'