X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/352b8591bd1c7163835a6fa1db34d3e2861c1071..4f9f0e6fbf1be3805f9995c536a583eda1260bee:/project/templates/toolbar_api/scriptlets.js?ds=inline

diff --git a/project/templates/toolbar_api/scriptlets.js b/project/templates/toolbar_api/scriptlets.js
index ae7e2df4..6f5258c9 100644
--- a/project/templates/toolbar_api/scriptlets.js
+++ b/project/templates/toolbar_api/scriptlets.js
@@ -1,4 +1,4 @@
-function SciptletCenter() {
+function ScriptletCenter() {
 
     this.scriptlets = {
         {% for scriptlet in scriptlets %}
@@ -8,8 +8,23 @@ function SciptletCenter() {
         {% endfor %}
 
         _none: null
-    };
+    };   
             
 }
 
+ScriptletCenter.prototype.XMLEditorSelectedText = function(panel) {
+    return panel.contentView.editor.selection();
+}
+
+ScriptletCenter.prototype.XMLEditorReplaceSelectedText = function(panel, replacement)
+{
+    panel.contentView.editor.replaceSelection(replacement);
+    /* TODO: fire the change event */
+}
+
+ScriptletCenter.prototype.XMLEditorMoveCursorForward = function(panel, n) {
+    var pos = panel.contentView.editor.cursorPosition();
+    panel.contentView.editor.selectLines(pos.line, pos.character + n);
+}
+
 scriptletCenter = new ScriptletCenter();
\ No newline at end of file