X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f938afb8ab4cb091d12e0ef0311eaea14b774798..713b135cf1a9bb373e7bec2f7b5e5841ff334497:/redakcja/static/js/wiki/view_editor_wysiwyg.js
diff --git a/redakcja/static/js/wiki/view_editor_wysiwyg.js b/redakcja/static/js/wiki/view_editor_wysiwyg.js
index 2ae1a8dd..34618c4f 100644
--- a/redakcja/static/js/wiki/view_editor_wysiwyg.js
+++ b/redakcja/static/js/wiki/view_editor_wysiwyg.js
@@ -43,8 +43,8 @@
return true;
}
- /* Convert HTML frament to plaintext */
- var ANNOT_ALLOWED = ['wyroznienie', 'slowo_obce', 'osoba'];
+ /* Convert HTML fragment to plaintext */
+ var ANNOT_FORBIDDEN = ['pt', 'pa', 'pr', 'pe', 'begin', 'end', 'theme'];
function html2plainText(fragment){
var text = "";
@@ -52,11 +52,12 @@
$(fragment.childNodes).each(function(){
if (this.nodeType == 3) // textNode
text += this.nodeValue;
- else
+ else {
if (this.nodeType == 1 &&
- $.inArray($(this).attr('x-node'), ANNOT_ALLOWED) != -1) {
+ $.inArray($(this).attr('x-node'), ANNOT_FORBIDDEN) == -1) {
text += html2plainText(this);
}
+ };
});
return text;
@@ -87,7 +88,7 @@
return false;
}
- // BUG #273 - selected text can contain themes, which should be omited from
+ // BUG #273 - selected text can contain themes, which should be omitted from
// defining term
var text = html2plainText(range.cloneContents());
@@ -96,7 +97,7 @@
range.insertNode(tag[0]);
xml2html({
- xml: '' + text + ' --- ',
+ xml: '' + text + ' --- ',
success: function(text){
var t = $(text);
tag.replaceWith(t);
@@ -225,14 +226,15 @@
}).appendTo($box[0].offsetParent || $box.parent()).show();
if ($origin.is('.motyw')) {
- $('textarea', $overlay).autocomplete(THEMES, {
+ $('textarea', $overlay).autocomplete('/themes', {
autoFill: true,
multiple: true,
- selectFirst: true
+ selectFirst: true,
+ highlight: false
});
}
- if ($origin.is('.motyw')) {
+ if ($origin.is('.motyw')){
$('.delete-button', $overlay).click(function(){
if (window.confirm("Czy jesteÅ pewien, że chcesz usunÄ
Ä ten motyw ?")) {
$('[theme-class=' + $origin.attr('theme-class') + ']').remove();
@@ -240,7 +242,17 @@
$(document).unbind('click.blur-overlay');
return false;
};
- });
+ });
+ }
+ else if($box.is('*[x-annotation-box]')) {
+ $('.delete-button', $overlay).click(function(){
+ if (window.confirm("Czy jesteÅ pewien, że chcesz usunÄ
Ä ten przypis?")) {
+ $origin.remove();
+ $overlay.remove();
+ $(document).unbind('click.blur-overlay');
+ return false;
+ };
+ });
}
else {
$('.delete-button', $overlay).hide();