+Editor.prototype.showPopup = function(name, text)
+{
+ var self = this;
+ self.popupQueue.push( [name, text] )
+
+ if( self.popupQueue.length > 1)
+ return;
+
+ var box = $('#message-box > #' + name);
+ $('*.data', box).html(text);
+ box.fadeIn();
+
+ self._nextPopup = function() {
+ var elem = self.popupQueue.pop()
+ if(elem) {
+ var box = $('#message-box > #' + elem[0]);
+
+ box.fadeOut(300, function() {
+ $('*.data', box).html();
+
+ if( self.popupQueue.length > 0) {
+ box = $('#message-box > #' + self.popupQueue[0][0]);
+ $('*.data', box).html(self.popupQueue[0][1]);
+ box.fadeIn();
+ setTimeout(self._nextPopup, 5000);
+ }
+ });
+ }
+ }
+
+ setTimeout(self._nextPopup, 5000);
+}
+
+Editor.prototype.registerScriptlet = function(scriptlet_id, scriptlet_func)
+{
+ // I briefly assume, that it's verified not to break the world on SS
+ if (!this[scriptlet_id])
+ this[scriptlet_id] = scriptlet_func;
+}
+
+Editor.prototype.callScriptlet = function(scriptlet_id, panel, params) {
+ var func = this[scriptlet_id]
+ if(!func)
+ throw 'No scriptlet named "' + scriptlet_id + '" found.';
+
+ return func(this, panel, params);
+}
+