+ /* This won't work, 'cause the JS below might be synchronous :( */
+ /* var timer = setTimeout(function() {
+ $.blockUI({message: $progress});
+ timer = null;
+ }, 1000); */
+
+ $.blockUI({message: $progress, showOverlay: false});
+
+ var input = self.XMLEditorSelectedText(opts.context);
+ self.scriptlets[opts.action](opts.context, opts.extra, input, 0, function(output, move_forward){
+ /*if(timer)
+ clearTimeout(timer);
+ else */
+ if (input != output) {
+ self.XMLEditorReplaceSelectedText(opts.context, output)
+ }
+ if (move_forward) {
+ try {
+ self.XMLEditorMoveCursorForward(opts.context, move_forward)
+ }
+ catch(e) {}
+ }
+ $.unblockUI(); // done