fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Zapis na serwer na Gecko/Webkit/Opera.
[redakcja.git]
/
platforma
/
static
/
js
/
button_scripts.js
diff --git
a/platforma/static/js/button_scripts.js
b/platforma/static/js/button_scripts.js
old mode 100644
(file)
new mode 100755
(executable)
index
40f45f6
..
4af9d72
--- a/
platforma/static/js/button_scripts.js
+++ b/
platforma/static/js/button_scripts.js
@@
-6,6
+6,7
@@
function ScriptletCenter()
{
var text = this.XMLEditorSelectedText(context);
var start_tag = '<'+params.tag;
{
var text = this.XMLEditorSelectedText(context);
var start_tag = '<'+params.tag;
+ var move_cursor = false;
for (var attr in params.attrs) {
start_tag += ' '+attr+'="' + params.attrs[attr] + '"';
for (var attr in params.attrs) {
start_tag += ' '+attr+'="' + params.attrs[attr] + '"';
@@
-39,14
+40,23
@@
function ScriptletCenter()
output += token;
}
else {
output += token;
}
else {
- output = start_tag + end_tag;
+ if(params.nocontent) {
+ output = "<"+params.tag +" />";
+ }
+ else {
+ output = start_tag + end_tag;
+ move_cursor = true;
+ }
}
this.XMLEditorReplaceSelectedText(context, output);
}
this.XMLEditorReplaceSelectedText(context, output);
- if (text.length == 0) {
- this.XMLEditorMoveCursorForward(context, -params.tag.length-3);
- }
+ try {
+ if (move_cursor) {
+ this.XMLEditorMoveCursorForward(context, params.tag.length+2);
+ }
+ } catch(e) {}
+
}.bind(this);
this.scriptlets['lineregexp'] = function(context, params) {
}.bind(this);
this.scriptlets['lineregexp'] = function(context, params) {