How to use monster - 10 common examples

To help you get started, we’ve selected a few monster examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 2600hz / monster-ui / src / apps / common / submodules / numberFeaturesMenu / numberFeaturesMenu.js View on Github external
template.find('.failover-number').on('click', function() {
				// We add this at the moment of the event because in some cases, we bind the events before it's adding to a parent,
				// which means the account-section might not be loaded yet if we bound it before the event happened.
				if ($(this).parents('.account-section').length) {
					args.accountId = template.parents('.account-section').data('id');
				}

				monster.pub('common.failover.renderPopup', args);
			});
github 2600hz / monster-ui / src / apps / myaccount / app.js View on Github external
callback: function() {
					if (toggle) {
						/* when all the badges have been updated, display my account */
						if (!--countBadges) {
							monster.pub('core.showAppName', 'myaccount');
							self.toggle({
								callback: callback
							});
						}
					}
				}
			});
github 2600hz / monster-ui / apps / voip / app.js View on Github external
parent.find('.category#numbers').on('click', function() {
				monster.pub('voip.numbers.render', container);
			});
github 2600hz / monster-ui / src / apps / myaccount / submodules / errorTracker / errorTracker.js View on Github external
_errorTrackerRenderContent: function(args) {
			var self = this,
				dataTemplate = self.errorTrackerFormatData(monster.logs.error),
				listErrorTemplates = $(self.getTemplate({
					name: 'layout',
					data: dataTemplate,
					submodule: 'errorTracker'
				}));

			self.errorTrackerBindEvents(listErrorTemplates);

			monster.pub('myaccount.renderSubmodule', listErrorTemplates);

			args.callback && args.callback(listErrorTemplates);
		},
github 2600hz / monster-ui / src / apps / myaccount / submodules / user / user.js View on Github external
}, function(err, results) {
				var formattedData = self.userLayoutFormatData(results),
					userTemplate = $(self.getTemplate({
						name: 'layout',
						data: formattedData,
						submodule: 'user'
					}));

				self.userBindingEvents(userTemplate, results);

				monster.pub('myaccount.renderSubmodule', userTemplate);

				if (typeof args.callback === 'function') {
					args.callback(userTemplate);
				}
			});
		},
github 2600hz / monster-ui / src / apps / myaccount / submodules / balance / balance.js View on Github external
self.balanceDisplayGenericTable('per-minute-voip', balance, renderData.uiRestrictions.balance.show_credit, function() {
							monster.pub('myaccount.updateMenu', args);

							monster.pub('myaccount.renderSubmodule', balance);

							if (typeof argsCallback === 'function') {
								argsCallback(balance);
							}
						});
					}
github 2600hz / monster-ui / apps / myaccount / submodules / profile / profile.js View on Github external
self.profileFormatData(results, function(results) {
						var profile = $(monster.template(self, 'profile-layout', results));

						self.profileBindEvents(profile, results);

						monster.pub('myaccount.renderSubmodule', profile);

						if(args.uiTab) {
							profile.find('a[href="#'+args.uiTab+'"]').tab('show');
						}

						if(typeof args.callback === 'function') {
							args.callback(profile);
						}
					});
				}
github 2600hz / monster-ui / apps / voip / submodules / users / users.js View on Github external
self.usersListConferences(userId, function(conferences) {
							var listRequests = [];

							_.each(conferences, function(conference) {
								listRequests.push(function(subCallback) {
									self.usersDeleteConference(conference.id, function(data) {
										subCallback(null, data);
									});
								});
							});

							monster.parallel(listRequests, function(err, results) {
								callback && callback(results);
							});
						});
					},
github 2600hz / monster-ui / js / lib / monster.apps.js View on Github external
loadDependencies: function(app, globalCallback) {
			var self = this,
				listRequests = {},
				externalPath = app.appPath + '/external/',
				deps = app.externalScripts || [];

			if(deps.length > 0) {
				_.each(deps, function(name) {
					listRequests[name] = function(callback) {
						monster.getScript(externalPath + name + '.js', function() {
							callback(null, {});
						});
					}
				});

				monster.parallel(listRequests, function(err, results) {
					globalCallback && globalCallback();
				});
			}
			else {
				globalCallback && globalCallback();
			}
		},
github 2600hz / monster-ui / apps / voip / submodules / strategy / strategy.js View on Github external
if('pattern' in featureCode) {
							callflow.patterns = [ featureCode.pattern ];
						}
						else {
							callflow.numbers = [ featureCode.callflowNumber ];
						}

						listRequests.push(function(localCallback) {
							self.strategyCreateCallflow(callflow, function(data) {
								localCallback && localCallback(null, data);
							});
						});
					});

					monster.parallel(listRequests, function(err, results) {
						callback && callback();
					});
				}
			});
		},

monster

Flying Spaghetti Machine/Finite State Monster

MIT
Latest version published 11 years ago

Package Health Score

42 / 100
Full package analysis

Popular monster functions