X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/17ea853baef7703291df8ae230a2aa433f8f5656..f32fa7850a8cf57e38d2a7bb4f19c4aeb5d6224a:/project/templates/toolbar_api/scriptlets.js diff --git a/project/templates/toolbar_api/scriptlets.js b/project/templates/toolbar_api/scriptlets.js deleted file mode 100644 index 6f5258c9..00000000 --- a/project/templates/toolbar_api/scriptlets.js +++ /dev/null @@ -1,30 +0,0 @@ -function ScriptletCenter() { - - this.scriptlets = { - {% for scriptlet in scriptlets %} - "{{scriptlet.name}}": function(context, params) { - {{scriptlet.code|safe}} - }, - {% 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