fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing admin line.
[redakcja.git]
/
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
4554bbe
..
2f510a2
100644
(file)
--- a/
src/redakcja/static/js/wiki/view_editor_wysiwyg.js
+++ b/
src/redakcja/static/js/wiki/view_editor_wysiwyg.js
@@
-6,8
+6,8
@@
selection.removeAllRanges();
var range = document.createRange();
selection.removeAllRanges();
var range = document.createRange();
- var s = $("
.motyw
[theme-class='" + themeId + "']")[0];
- var e = $("
.end
[theme-class='" + themeId + "']")[0];
+ var s = $("
[x-node='motyw']
[theme-class='" + themeId + "']")[0];
+ var e = $("
[x-node='end']
[theme-class='" + themeId + "']")[0];
if (s && e) {
range.setStartAfter(s);
if (s && e) {
range.setStartAfter(s);
@@
-237,7
+237,7
@@
spoint.insertNode(btag[0])
btag.replaceWith(text);
selection.removeAllRanges();
spoint.insertNode(btag[0])
btag.replaceWith(text);
selection.removeAllRanges();
- openForEdit($('
.motyw
[theme-class="' + id + '"]'));
+ openForEdit($('
[x-node="motyw"]
[theme-class="' + id + '"]'));
}
});
}
}
});
}
@@
-465,11
+465,11
@@
$('.akap-edit-button').remove();
}
$('.akap-edit-button').remove();
}
- if ($origin.is('
.motyw
')) {
+ if ($origin.is('
[x-node="motyw"]
')) {
$.themes.autocomplete($('textarea', $overlay));
}
$.themes.autocomplete($('textarea', $overlay));
}
- if ($origin.is('
.motyw
')){
+ if ($origin.is('
[x-node="motyw"]
')){
$('.delete-button', $overlay).click(function(){
if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten motyw?")) {
$('[theme-class="' + $origin.attr('theme-class') + '"]').remove();
$('.delete-button', $overlay).click(function(){
if (window.confirm("Czy jesteś pewien, że chcesz usunąć ten motyw?")) {
$('[theme-class="' + $origin.attr('theme-class') + '"]').remove();
@@
-505,7
+505,7
@@
if($box.attr("x-edit-attribute")) {
source = $('<span x-pass-thru="true"/>');
if($box.attr("x-edit-attribute")) {
source = $('<span x-pass-thru="true"/>');
- 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];
source = source[0];
} else {
source = $box[0];
@@
-525,7
+525,7
@@
var nodeName = $box.attr('x-node') || 'pe';
var insertedText = $('textarea', $overlay).val();
var nodeName = $box.attr('x-node') || 'pe';
var insertedText = $('textarea', $overlay).val();
- if ($origin.is('
.motyw
')) {
+ if ($origin.is('
[x-node="motyw"]
')) {
insertedText = insertedText.replace(/,\s*$/, '');
}
insertedText = insertedText.replace(/,\s*$/, '');
}
@@
-687,7
+687,7
@@
}
}
- $(document).on('click', '
.motyw
', function(){
+ $(document).on('click', '
[x-node="motyw"]
', function(){
selectTheme($(this).attr('theme-class'));
});
selectTheme($(this).attr('theme-class'));
});
@@
-727,14
+727,6
@@
var htmlView = $('#html-view');
htmlView.html(element);
var htmlView = $('#html-view');
htmlView.html(element);
- htmlView.find('*[x-node]').dblclick(function(e) {
- if($(e.target).is('textarea'))
- return;
- var selection = window.getSelection();
- selection.collapseToStart();
- selection.modify('extend', 'forward', 'word');
- e.stopPropagation();
- });
_finalize(success);
},
error: function(text, source){
_finalize(success);
},
error: function(text, source){
@@
-784,7
+776,7
@@
let selection = window.getSelection();
var n = selection.rangeCount;
let selection = window.getSelection();
var n = selection.rangeCount;
- if (n != 1) {
+ if (n != 1
|| selection.isCollapsed
) {
window.alert("Nie zaznaczono obszaru");
return false
}
window.alert("Nie zaznaczono obszaru");
return false
}