onSuccessCaptchaRPCSolve : function(result) { var update = clone(this.state); update.solved = 1; this.emit(update); WindowsActions.windowCloseByType('captcha'); },
onSuccessCaptchaRPCFetch : function(result) { var update = clone(this.state); update.guid = result.guid; update.url = result.url; this.emit(update); },
onHideTopWindow : function() { var topWindow = _.chain(clone(this.state)) .values() .sortBy('layer') .reverse() .first() .value(); if (topWindow) { this.onHideWindow(topWindow.id); } },
onBringWindowToTop : function(id) { if (this.isOnTop(id, this.state)) { return; } var windows = clone(this.state); if (windows[id]) { windows[id].layer = this.getNextLayerNumber(windows); } this.emit(windows); },
onAddWindow : function(type, options) { var id = 'window_' + type; var windows = clone(this.state); windows[id] = { id : id, type : type, options : options, layer : this.getNextLayerNumber(windows) }; this.emit(windows); },
onHideWindow : function(id) { var windows = clone(this.state); delete windows[id]; this.emit(windows); },
onCaptchaWindowShow : function(window) { var update = clone(this.state); update.window = window; this.emit(update); },