1 function ScriptletCenter() {
4 {% for scriptlet in scriptlets %}
5 "{{scriptlet.name}}": function(context, params) {
6 {{scriptlet.code|safe}}
15 ScriptletCenter.prototype.XMLEditorSelectedText = function(panel) {
16 return panel.contentView.editor.selection();
19 ScriptletCenter.prototype.XMLEditorReplaceSelectedText = function(panel, replacement)
21 panel.contentView.editor.replaceSelection(replacement);
22 /* TODO: fire the change event */
25 ScriptletCenter.prototype.XMLEditorMoveCursorForward = function(panel, n) {
26 var pos = panel.contentView.editor.cursorPosition();
27 panel.contentView.editor.selectLines(pos.line, pos.character + n);
30 scriptletCenter = new ScriptletCenter();