initialize (options) { this.exportLength = options.exportLength || EXPORT_LENGTH; this.displayLength = options.displayLength || DISPLAY_LENGTH; this.streaming = false; if (this.broker.isAutomatedBrowser()) { var ARTIFICIAL_DELAY = new Duration('3s').milliseconds(); // mock some things out for automated browser testing this.streaming = true; this.startStream = () => this.enableForm(); this.stream = { stop () {} }; this.window.setTimeout(_.bind(this.onLoadedMetaData, this), ARTIFICIAL_DELAY); } }, startStream () { var constraints = { audio: false, video: true }; // navigator.mediaDevices is polyfilled by WebRTC for older browsers. return this.window.navigator.mediaDevices.getUserMedia(constraints) .then((stream) => { this.stream = stream; WebRTC.attachMediaStream(this.video, stream); this.video.play();
function (method) { exports[method] = _.bind(runLogInstance[method], runLogInstance); });
mappedSet = util.pluralize(mappedSet, function (model) { model.save = _.bind(collection.__save, collection, collection.identity, model); model.destroy = _.bind(collection.__destroy, collection, collection.identity, model); model.values = _.omit(model,['save','destroy','values']) || {}; return model; });
_(self.currentContext.sortedSchedule).each(function(s, scheduleIndex) { var dayScheduleInfos = { speakersDeferred: null, speakersDeferredStates: [], speakerInfosDeferredStates: [], presentationInfoPromise: null, presentationInfoPromiseState: null, mainPromise: null, mainPromiseState: null, scheduleIndex: scheduleIndex, schedule: s }; function createObservedDeferred(promiseStateFieldName) { var deferred = Q.defer(); var setPromiseStateFieldValue; if(_.isFunction(promiseStateFieldName)){ setPromiseStateFieldValue = promiseStateFieldName; } else { setPromiseStateFieldValue = function(value){ return dayScheduleInfos[promiseStateFieldName] = value; }; } setPromiseStateFieldValue("pending"); Q.when(deferred.promise) .then(function(){ setPromiseStateFieldValue("resolved"); }) .fail(function(){ setPromiseStateFieldValue("failed"); }); return deferred; } console.log("Handling talk number "+scheduleIndex+"..."); self.event.nbPresentations++; var fromTime = new Date(Date.parse(s.fromTime)), daySchedule = self.daySchedules[dateformat(fromTime, 'yyyy-mm-dd')]; dayScheduleInfos.speakersDeferred = []; _(s.speakers).each(function(sp, speakerIndex) { console.log("Handling speaker "+speakerIndex+"..."); // Generating speaker uri sp.uri = '/events/' + self.event.id + '/speakers/' + sp.id; var speakerDeferred = createObservedDeferred(function(value){ dayScheduleInfos.speakersDeferredStates[speakerIndex] = value; }); dayScheduleInfos.speakersDeferred.push(speakerDeferred.promise); var speakerInfosDeferred = createObservedDeferred(function(value){ dayScheduleInfos.speakerInfosDeferredStates[speakerIndex] = value; }); self.options.fetchSpeakerInfosFrom.call(self, speakerInfosDeferred, sp); Q.when(speakerInfosDeferred.promise) .then(function(fetchedSpeaker) { console.log("Speaker infos "+speakerIndex+" for talk "+scheduleIndex+" fetched !"); var speakerImage = fetchedSpeaker.imageUrl; delete fetchedSpeaker.imageUrl; var voxxrinSpeakerUri; if(speakerImage) { var imageExt = speakerImage.substring(speakerImage.lastIndexOf('.')); imageExt = imageExt.length > 5 ? ".png" : imageExt; voxxrinSpeakerUri = "/events/" + self.event.id + "/speakers/" + fetchedSpeaker.id + "/picture" + imageExt; } else { voxxrinSpeakerUri = null; } fetchedSpeaker.pictureURI = voxxrinSpeakerUri; // Updating initial speaker object's pictureURI sp.pictureURI = voxxrinSpeakerUri; speakerDeferred.resolve(); self.sendQueries++; send(baseUrl + '/r' + sp.uri, fetchedSpeaker) .then(function() { if(speakerImage){ self.provideSpeakerImage(speakerImage, voxxrinSpeakerUri); } console.log('SPEAKER: ', fetchedSpeaker.id, fetchedSpeaker.name); }).fail(self.options.onFailureCallback); }).fail(_.bind(self.onDeferredFailureCallback, {deferred: speakerInfosDeferred})); }); var prezId = (event.id + "-" + s.id).toLowerCase().replace(/_/gi, "-"); if(event.idTransformer){ prezId = event.idTransformer(prezId, event.id, s); } var voxxrinPres = { 'id': prezId, 'title': s.title, 'type': s.type, 'kind': s.kind, 'dayId': daySchedule.id, 'uri': '/events/' + self.event.id + "/presentations/" + prezId, 'speakers': s.speakers, 'room': _(self.rooms).find(function(room){ return room.name === (s.roomName?s.roomName:"???"); }), 'slot': dateformat(fromTime, fromTime.getMinutes() ? 'h:MMtt' : 'htt'), 'fromTime': typeof(s.fromTime) === "string" ? s.fromTime : moment(s.fromTime).tz(self.event.timezone).format("YYYY-MM-DD HH:mm:ss.0"), 'toTime': typeof(s.toTime) === "string" ? s.toTime : moment(s.toTime).tz(self.event.timezone).format("YYYY-MM-DD HH:mm:ss.0") }; var shouldStop = self.options.decorateVoxxrinPresentation.call(self, voxxrinPres, daySchedule); if(shouldStop){ return; } console.log("Presentation "+scheduleIndex+" ready..."); self.event.days[daySchedule.dayNumber].nbPresentations++; dayScheduleInfos.presentationInfoPromise = createObservedDeferred("presentationInfoPromiseState"); self.options.fetchPresentationInfosFrom.call(self, dayScheduleInfos.presentationInfoPromise, s, voxxrinPres); dayScheduleInfos.mainPromise = createObservedDeferred("mainPromiseState"); daySchedulesPromises.push(dayScheduleInfos); Q.all([dayScheduleInfos.presentationInfoPromise.promise].concat(dayScheduleInfos.speakersDeferred)) .spread(function(presentationInfos) { console.log("Presentation "+scheduleIndex+" required infos available !"); daySchedule.schedule.push(presentationInfos); dayScheduleInfos.mainPromise.resolve(presentationInfos); self.sendQueries++; send(baseUrl + '/r' + voxxrinPres.uri, presentationInfos) .then(function() {console.log('PRESENTATION: ', voxxrinPres.id, voxxrinPres.title, daySchedule.id, voxxrinPres.slot)}) .fail(self.options.onFailureCallback); }).fail(_.bind(self.onDeferredFailureCallback, {deferred: dayScheduleInfos.mainPromise}));; });
finish: function(command, deferred) { if (!this.gitCommandsIssued.length || !this.definedGoal) { command.set('error', new Errors.GitError({ msg: intl.str('solution-empty') })); deferred.resolve(); return; } while (!this.level.name) { this.defineName(); } var masterDeferred = Q.defer(); var chain = masterDeferred.promise; if (this.level.hint === undefined) { var askForHintDeferred = Q.defer(); chain = chain.then(function() { return askForHintDeferred.promise; }); // ask for a hint if there is none var askForHintView = new ConfirmCancelTerminal({ markdowns: [ intl.str('want-hint') ] }); askForHintView.getPromise() .then(_.bind(this.defineHint, this)) .fail(_.bind(function() { this.level.hint = {'en_US': ''}; }, this)) .done(function() { askForHintDeferred.resolve(); }); } if (this.startDialogObj === undefined) { var askForStartDeferred = Q.defer(); chain = chain.then(function() { return askForStartDeferred.promise; }); var askForStartView = new ConfirmCancelTerminal({ markdowns: [ intl.str('want-start-dialog') ] }); askForStartView.getPromise() .then(_.bind(function() { // oh boy this is complex var whenEditedDialog = Q.defer(); // the undefined here is the command that doesnt need resolving just yet... this.editDialog(undefined, whenEditedDialog); return whenEditedDialog.promise; }, this)) .fail(function() { // if they dont want to edit the start dialog, do nothing }) .done(function() { askForStartDeferred.resolve(); }); } chain = chain.done(_.bind(function() { // ok great! lets just give them the goods new MarkdownPresenter({ fillerText: JSON.stringify(this.getExportObj(), null, 2), previewText: intl.str('share-json') }); command.finishWith(deferred); }, this)); masterDeferred.resolve(); },
* * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. **/ import _ from 'underscore'; import i18next from 'i18next-client'; import translations from './translations/core.json'; var defaultLocale = 'en-US'; var i18n = _.extend(_.bind(i18next.t, i18next), { getLocaleName(locale) { return i18n('language', {lng: locale}); }, getLanguageName(locale) { return i18n('language_name', {lng: locale}); }, getAvailableLocales() { return _.keys(translations).sort(); }, getCurrentLocale() { return i18next.lng(); }, setLocale(locale) { i18next.setLng(locale, {}); },
startIntervals : function () { this.stopIntervals(); console.log("start intervals"); this.gameLoopIntervalesId = setInterval(_.bind(this.gameLoop, this), 100); this.addFoodIntervalId = setInterval(_.bind(this.addFood, this), 3000); },
function WorldModule(game) { events.EventEmitter.call(this); var _this = this; this._listenersAdded = []; this._spawns = {}; // Make all regular globals available within the modules (is this a // good idea?) _.extend(this, global); // Inject underscore this._ = _; this.game = game; this.require = require; // Make available world creation commands this.command = _.bind(game.createCommand, game); // Create a command that expects an item name following it. Will // automatically check that the item is present. this.itemCommand = function (command, item, description, fn) { game.createCommand(command + ' ' + item, description, fn); }; this.room = _.bind(game.createRoom, game); this.character = function (name, properties) { var player = game.createPlayer(name); properties.npc = true; _.extend(player, properties); return player; }; this.setTimeout = function (fn, time) { setTimeout(function () { try { fn(); } catch(e) { game.broadcast('Error running timeout'); game.broadcast(e); game.broadcast(e.stack); console.trace(); } }, time); }; this.handler = function (event, fn) { var wrapped = function () { try { fn.apply(_this, arguments); } catch (e) { game.broadcast('Error running handler for event: ' + event); game.broadcast(e); game.broadcast(e.stack); console.log('Error running handler for event: ' + event); console.trace(); _this.removeListener(event, wrapped); } }; _this.on(event, wrapped); }; // Create an item in the given room every spawnFrequency seconds if // one of the same name does not already exist. this.item = function (room, name, spawnFrequency, item) { item.name = name; _this._spawns[room + ':' + name] = {room: room, lastSpawn: 0, spawnFrequency: spawnFrequency, item: item}; }; // Set up a tick handler to check for spawns this.handler('tick', function () { _.each(_this._spawns, function (spawn) { var t = (new Date()).getTime()/1000, room = game.rooms[spawn.room]; if (t-spawn.lastSpawn > spawn.spawnFrequency) { spawn.lastSpawn = t; if (!room.getItem(spawn.item.name)) { var item = _.clone(spawn.item); room.items.push(item); game.emit('spawn', room, item); } } }); }); }
onCourseComplete: function() { if(Adapt.course.get('_isComplete') === true) { this.set('_attempts', this.get('_attempts')+1); } _.defer(_.bind(this.checkTrackingCriteriaMet, this)); },
define("ub-ria/mvc/FormAction",["require","er/util","underscore","er/Deferred","./BaseAction","./FormModel","er/events"],function(require){function e(){s.apply(this,arguments)}function t(e){var t=this.handleSubmitError(e);if(!t)require("er/events").notifyError(e.responseText)}function n(){var e=this.fire("submitcancel"),t=this.fire("handlefinish");if(!e.isDefaultPrevented()&&!t.isDefaultPrevented())this.redirectAfterCancel()}function i(){var e=this.view.getEntity();this.view.disableSubmit(),require("er/Deferred").when(this.submitEntity(e)).ensure(r.bind(this.view.enableSubmit,this.view))}var a=require("er/util"),r=require("underscore"),o=require("er/Deferred"),s=require("./BaseAction");return a.inherits(e,s),e.prototype.modelType=require("./FormModel"),e.prototype.category="form",e.prototype.handleSubmitError=function(e){if(409===e.status)e=a.parseJSON(e.responseText);if(e.fields)return this.view.notifyErrors(e),!0;else return!1},e.prototype.handleSubmitResult=function(e){var t=this.fire("entitysave",{entity:e});if(!t.isDefaultPrevented()){var n=this.getSubmitHandler();if(n)n.handle(e,this)}this.fire("handlefinish")},e.prototype.getSubmitHandler=function(){return this.submitHandler},e.prototype.setSubmitHandler=function(e){this.submitHandler=e},e.prototype.getMethod=function(e){var t={create:"save",update:"update",copy:"save"};return t[e]||null},e.prototype.submitEntity=function(e){var n=this.getMethod(this.context.formType);try{if(n)return this.model[n](e).then(r.bind(this.handleSubmitResult,this),r.bind(t,this));else throw new Error("Cannot find formType in methodMap")}catch(i){return o.rejected(i)}},e.prototype.cancelConfirmTitle="确认取消编辑",e.prototype.getCancelConfirmTitle=function(){return this.cancelConfirmTitle},e.prototype.cancelConfirmMessage="取消编辑将不保留已经填写的数据,确定继续吗?",e.prototype.getCancelConfirmMessage=function(){return this.cancelConfirmMessage},e.prototype.cancelEdit=function(){var e=this.model.get("initialFormData");if(this.isFormDataChanged(e)){var t={title:this.getCancelConfirmTitle(),content:this.getCancelConfirmMessage()};this.view.waitCancelConfirm(t).then(r.bind(n,this))}else n.call(this)},e.prototype.redirectAfterCancel=function(){this.back("/"+this.getEntityName()+"/list")},e.prototype.isFormDataChanged=function(){return!1},e.prototype.initBehavior=function(){s.prototype.initBehavior.apply(this,arguments);var e=this.view.getFormData();this.model.set("initialFormData",e,{silent:!0}),this.view.on("submit",i,this),this.view.on("cancel",this.cancelEdit,this)},e});
// Set the initial time parameters for read from the adapter and // schedule the initial run. start() { // First tell the adapter to kick off the process of reading. this.adapter.start(); // Then check if the adapter wants pseudo-live behavior for reading. // // If not, then simply call into the adapter with the time bounds (if // any) that were set in the options. The adapter is responsible for // handling the potentially undefined values. if (! this.adapter.periodicLiveRead()) { this.readFrom = this.from; this.readTo = this.to; this.run(); return; } // Otherwise for all sources that want periodic live reads, from and to // must have been set to valid moments, so use them to calculate the // time bounds for reading. // // If from is in the past or to is finite, then the program starts off // in historical mode. Once the historical portion of the read is // complete, then it will either complete the full query (if `to` is // finite) or transition into live mode if `to` is `:end:`. In the // latter case, we stop the historical part of the query at (now - lag) // since we'll pick up from there after waiting the appropriate amount // of time. // // XXX This all totally breaks down if there is any clock skew between // the juttle runtime and the data points in the back end. else if (this.from.lt(this.program.now) || !this.to.isEnd()) { this.readFrom = this.from; if (this.to.isEnd()) { // XXX/demmer need to handle the case where now - lag > from this.readTo = this.program.now.subtract(this.lag); } else { this.readTo = this.to; } this.logger.debug('starting historical read at', this.program.now.toJSON(), 'from', this.readFrom.toJSON(), 'to', this.readTo.toJSON()); this.run(); } // For fully "live", the first chunk of points to read is from // [now ... now + readEvery). // // So before we can actually read this initial set of points are // read, we need to wait for both the readEvery period as well as // the lag time to pass. else { this.readFrom = this.program.now; this.readTo = this.program.now.add(this.readEvery); var firstRead = this.program.now.add(this.readEvery).add(this.lag); this.logger.debug('scheduling first live read at', firstRead.toJSON()); this.program.scheduler.schedule(firstRead.unixms(), _.bind(this.run, this)); } if (this.params.optimization_info._reduce_every && this.to.isEnd()) { var every = JuttleMoment.duration(this.params.optimization_info._reduce_every); this.readTo = this.readFrom.quantize(every).add(every); this.readEvery = every; } }
Instruments.prototype.startSocketServer = function(sock) { // remove socket if it currently exists try { fs.unlinkSync(sock); } catch (Exception) {} var onSocketNeverConnect = function() { logger.error("Instruments socket client never checked in; timing out".red); if (this.proc !== null) { this.proc.kill('SIGTERM'); } this.exitHandler(1); }; var socketConnectTimeout = setTimeout(_.bind(onSocketNeverConnect, this), 300000); this.socketServer = net.createServer({allowHalfOpen: true}, _.bind(function(conn) { if (!this.hasConnected) { this.hasConnected = true; this.debug("Instruments is ready to receive commands"); clearTimeout(socketConnectTimeout); this.readyHandler(this); this.readyHandler = this.defaultReadyHandler; } conn.setEncoding('utf8'); // get strings from sockets rather than buffers conn.on('data', _.bind(function(data) { // when data comes in, route it according to the "event" property this.debug("Socket data received (" + data.length + " bytes)"); this.bufferedData += data; }, this)); this.currentSocket = conn; //this.debug("Socket Connected"); conn.on('close', _.bind(function() { //this.debug("Socket Completely closed"); this.currentSocket = null; }, this)); conn.on('end', _.bind(function() { //this.debug("Socket closed by other side"); var data = this.bufferedData; this.bufferedData = ""; try { data = JSON.parse(data); } catch (e) { logger.error("Couldn't parse JSON data from socket, maybe buffer issue?"); logger.error(data); data = { event: 'cmd' , result: { status: codes.UnknownError , value: "Error parsing socket data from instruments" } }; } if (!_.has(data, 'event')) { logger.error("Socket data came in without event, it was:"); logger.error(JSON.stringify(data)); } else if (!_.has(this.eventRouter, data.event)) { logger.error("Socket is asking for event '" + data.event + "' which doesn't exist"); } else { this.debug("Socket data being routed for '" + data.event + "' event"); _.bind(this.eventRouter[data.event], this)(data, conn); } }, this)); }, this)); this.socketServer.on('close', _.bind(function() { this.debug("Instruments socket server closed"); }, this)); exec('xcrun -find instruments', _.bind(function (error, stdout) { this.instrumentsPath = stdout.trim(); logger.info("instruments is: " + this.instrumentsPath); this.socketServer.listen(sock, _.bind(function() { this.debug("Instruments socket server started at " + sock); this.launch(); }, this)); }, this)); };
_.each(args, function(arg, i) { if(_.isFunction(arg)) args[i] = _.bind(arg, self); });
Cache.prototype.initialise = function(callback){ this.intervalObject = setInterval(_.bind(this._updateCache, this), this.config.cacheIntervalMs); this._updateCache(callback); };
resizeColumns: function () { this.grid.$container = this.grid.$el.closest('.table-wrapper'); this.grid.resizeColumns(); $(window).on('resize' + windowEventNS, _.bind(this.grid.resizeColumns, this.grid)); },
initStructure: function () { var tpl = [ // 标题栏 '${head}', // 内容 '<div data-ui="type:Panel;childName:body;" class="${bodyClass}">', // 搜索框 ' ${searchInput}', // 列表区 ' <div data-ui="type:Panel;childName:content" class="${contentClass}">', // 结果为空提示 ' <div data-ui="type:Label;childName:emptyText" ', ' class="${emptyTextClass}">${emptyText}</div>', // 结果列表 ' <div data-ui="type:Panel;childName:queryList" class="${queryListClass}"></div>', ' </div>', '</div>', // 底部概要信息 '${footInfo}' ]; this.main.innerHTML = lib.format( tpl.join('\n'), { head: this.hasHead ? this.getHeadHTML() : '', bodyClass: this.helper.getPartClassName('body'), searchInput: this.hasSearchBox ? this.getSearchBoxHTML() : '', contentClass: this.helper.getPartClassName('content-wrapper'), emptyTextClass: this.helper.getPartClassName('empty-text'), emptyText: this.emptyText, queryListClass: this.helper.getPartClassName('query-list'), footInfo: this.hasFoot ? this.getFootHTML() : '' } ); this.initChildren(); // 初始化模式状态 this.addState(this.mode || 'delete'); // 绑事件 // 批量操作 if (this.needBatchAction) { this.helper.addDOMEvent( this.helper.getPart('batch-action'), 'click', u.bind(this.batchAction, this) ); } // 搜索框 if (this.hasSearchBox) { this.addState('has-search'); var searchBox = this.getSearchBox(); searchBox.on('search', u.bind(search, this)); searchBox.on('clear', u.bind(this.clearQuery, this)); } // 为备选区绑定点击事件 var queryList = this.getQueryList().main; this.helper.addDOMEvent( queryList, 'click', u.bind(this.eventDispatcher, this) ); },
_.each(notifiers, function(notifier) { notifications.push(_.bind(notifier.notify, notifier, repoData)); });
loadRealtimeData: function() { debug('load realtime data'); _.delay(_.bind(function() { this.emitChange(); }, this), 1000); }
this.io.sockets.on('connection', function (socket) { socket.on('addPlayer', _.bind(self.onSocketAddPlayer, self, socket)); socket.on('disconnect', _.bind(self.onSocketDisconnect, self, socket)); socket.on('keydown', _.bind(self.onSocketKeydown, self, socket)); });
bind: function(data) { var defaults = { id: '', title: '', description: '', url: '' }; data = _.defaults(data, defaults); _.each(['pk','name' , 'judge','place', 'type' , 'education','number', 'examplace','workdesc','jobdesc', 'condition'], _.bind(function(attr) { this.el[attr].value = data[attr]; }, this)); },
_.each(['run', 'get', 'post', 'put', 'patch', 'del'], function(method) { exports[method] = _.bind(exports.queue[method], exports.queue); });
onHide: function() { _.each(['pk', 'name' , 'judge','place' ,'type', 'education','number','examplace','workdesc','jobdesc', 'condition'], _.bind(function(attr) { $(this.el[attr]).val(''); if(attr=='judge'){ this.el[attr].checked = false; } if(attr=='place'||attr=='examplace'){ $(this.el[attr]).select2('val',''); } if(attr=='type') $(this.el[attr]).select2('val','TE'); if(attr=='education') $(this.el[attr]).select2('val','QT'); if(attr=='number'){ $("#id-ignore-number").prop('checked',true); $("#number").hide(); } }, this)); this.clearErrors(['number']); this.clearTip(); $(this.el).parsley('destroy'); },
initEvents: function () { this.helper.addDOMEvent(this.main, 'click', u.bind(this.layer.toggle, this.layer)); },
setPage: function(page) { _.each(['pk', 'name' , 'judge', 'place' ,'type', 'education', 'examplace','number','workdesc','jobdesc', 'condition'], _.bind(function(attr) { if(attr=='judge') { this.el[attr].checked = page[attr]; } else if(attr=='place'||attr=='type'||attr=='education'||attr=='examplace'){ $(this.el[attr]).select2('val',page[attr]); } else if(attr=='number'){ this.el[attr].value = page[attr]; numbers = page[attr]; if(numbers != 0){ $("#id-ignore-number").prop('checked',false); $("#number").show(); } else { $("#id-ignore-number").prop('checked',true); $("#number").hide(); this.el[attr].value = null; $("#id_number").val(''); } } else{ this.el[attr].value = page[attr]; } }, this)); },
this._socketEmitter.once('open', function(event) { self._socketEmitter.removeAllListeners('error') self._socketEmitter.on('error', _.bind(self._onSocketError, self)) self._rhizomeEmitter.once(coreMessages.connectionStatusAddress, _.bind(self._doRhizomeConnection, self, done)) })
saveConfiguration: function(e) { e.preventDefault(); if (!this.workflowManagementView.valid()) { return; } var formData = helper.getFormData(this.workflowManagementView.$el); formData.steps_display_ordered = formData.hasOwnProperty('steps_display_ordered'); if (!this.model.get('name')) { this.model.set('name', helper.getNameByString(formData.label, 'workflow_')); } this.model.set('label', formData.label); this.model.set('steps_display_ordered', formData.steps_display_ordered); this.model.set('entity', formData.related_entity); this.model.set('start_step', formData.start_step); this.model.set('exclusive_active_groups', formData.exclusive_active_groups); this.model.set('exclusive_record_groups', formData.exclusive_record_groups); if (!this.validateWorkflow()) { return; } mediator.execute('showLoading'); this.model.save(null, { 'success': _.bind(function() { mediator.execute('hideLoading'); var redirectUrl = ''; var modelName = this.model.get('name'); var saveAndClose = this.workflowManagementView.submitActor && !$(this.workflowManagementView.submitActor).is('[data-action="save_and_stay"]'); if (saveAndClose) { redirectUrl = routing.generate('oro_workflow_definition_view', {name: modelName}); } else { redirectUrl = routing.generate('oro_workflow_definition_update', {name: modelName}); } mediator.once('page:afterChange', function() { messenger.notificationFlashMessage('success', __('Workflow saved.')); messenger.notificationFlashMessage( 'warning', __( 'oro.workflow.translation_rebuild_required', {path: routing.generate('oro_translation_translation_index')} ) ); }); mediator.execute('redirectTo', {url: redirectUrl}, {redirect: true}); }, this), 'error': function(model, response) { mediator.execute('hideLoading'); var jsonResponse = response.responseJSON || {}; if (tools.debug && !_.isUndefined(console) && !_.isUndefined(jsonResponse.error)) { console.error(jsonResponse.error); } messenger.notificationFlashMessage('error', __('Could not save workflow.')); } }); },
_.each(_.functions(adapter), function (methodName) { adapterMethods[methodName] = _.bind(adapter[methodName], adapter, definition.identity); });
meme: function(from, to, command) { // try to generate meme from last captured text var meme = _getRecentMeme(from); if (meme && !meme.generated) { _generateImage(meme.generatorId, meme.imageId, meme.textTop, meme.textBottom, _.bind(function(url) { this.noddy.say(to, url); // set meme generated flag lastGoodMeme.generated = url; }, this)); } },
var args = Object.values(process.processMeta)[0].required_args; return args.map((value) => { return gaiaProcessArgsWidgetTemplate({ value: value }); }).join(''); }, getSourceNameFromModel: function (model) { return (((model.get('meta') || {}).minerva || {}).source || {}).layer_source; }, render() { this.layers = _.chain(this.collection.toArray()) .filter(this.getSourceNameFromModel) .groupBy(this.getSourceNameFromModel) .value(); if (!this.modalOpened) { this.modalOpened = true; var modal = this.$el.html(gaiaProcessWidgetTemplate(this)).girderModal(this).on('ready.girder.modal', _.bind(function () { }, this)); modal.trigger($.Event('ready.girder.modal', { relatedTarget: modal })); } else { this.$el.html(gaiaProcessWidgetTemplate(this)); } return this; } }); export default GaiaProcessWidget;
onSuccessCallback: function(response){ this.trigger("driverUpload", response); this.hide(); dialogs.systemConfirm.show(i18n["resource.dataSource.jdbc.upload.driverUploadSuccess"]); _.defer(_.bind(this.remove, this)); },