Example #1
0
	exports.main	=	function(options, callbacks)
	{
		// "enable" the app so anything that polls knows it's ok to do so
		enabled		=	true;
		var reason	=	options.loadReason;

		// init the main button/menu
		var is_install	=	(['upgrade', 'downgrade', 'enable', 'install'].indexOf(reason) > -1);
		menu	=	app_menu.Menu({
			id: 'turtl_button',
			label: 'Turtl',
			image: data.url('app/images/favicon.png'),
			tooltiptext: '',
			menu: false,
			is_install: is_install
		});
		windows.on('open', function(window) {
			setup_menu();
		});

		// initialize user panel
		user.init();

		// start invite system. looks for invite URLs in open tabs (and creates
		// a page mod to find invites as well) and tracks them
		invites.init(data_handler, background, personas, messages);

		// make sure no turtl tabs are open unless logged in
		poller.add_poller(monitor_app_tabs);

		// init/start the poller
		poller.set_enable_cb(function() { return enabled; });
		poller.poll(500);

		// set up the main menu options. use a timer here to fix some stupid
		// reace condition
		timer.setTimeout( setup_menu, 0 );

		// if this is an install, show the FIRST TIME USER??!?!?! CLIIIIICK HERE! msg
		if(reason == 'install')
		{
			start.open(menu.btn());
		}

		//TODO: removeme!
		timer.setTimeout( function() {
			/*
			do_login(
				'51dcae66735ca406dc000004',
				'pzErMDZ72Imcuf5BwspEXo93VmNbD8kAHvJMz+aXFq7x+Rv1OGj9ADIxydqpvGS80MKaBsBwXyQP1ti5n2G2/xDRuZ/c0PPzyu5F/AznnsA=:i62696666346332383139383732343962',
				'tvlrsWpXFODbjBCzL050GMVP7rfSRsXC/e6cN+bUuqw='
			);
			do_login(
				'51e0063c3dc42c0db8000007',
				'3O/PGOPe5e1f6HfZ1jHS3G6eviKRlO7kSQJ1uBi7V4BgBTfJ1x5u1CyN30Lg1QMZDhigyF+aiTxK1E79OcycDtU1hemfIXq4gwrUqouUMjU=:i616e6472657734633238313938373234',
				'E4sN1Q+MjaIuyx7UUMEnOdjeU3f8BJSG0ydXiqoJ+vA='
			);
			*/
		}, 1000);
	};
Example #2
0
 setTimeout(() => {
     this.loading.hide();
     User.init(data.data);
     this.toMain();
 }, 1000);