示例#1
0
文件: main.js 项目: ferjm/fireplace
 z.page.on('iframe-loaded', function() {
     // Triggered by apps-iframe-installer.
     apps.getInstalled().done(function() {
         z.page.trigger('mozapps_got_installed');
         buttons.mark_btns_as_installed();
     });
 });
示例#2
0
文件: main.js 项目: cvan/fireplace
        z.page.one(event_for_apps, function() {
            apps.getInstalled().done(function() {
                z.page.trigger('mozapps_got_installed');
                buttons.mark_btns_as_installed();
            });


            var manifest_url = settings.manifest_url;
            // Note: only the iframed app defines a manifestURL for now.
            if (manifest_url) {
                apps.checkForUpdate(manifest_url).done(function(result) {
                    if (result) {
                        z.body.on('click', '#marketplace-update-banner a.download-button', utils._pd(function() {
                            var $button = $(this);
                            // Deactivate "remember" on the dismiss button so that it'll
                            // show up for the next update if the user clicks on it now
                            // they chose to apply the update.
                            $button.closest('mkt-banner').get(0).dismiss = '';
                            $button.addClass('spin');
                            apps.applyUpdate(manifest_url).done(function() {
                                $('#marketplace-update-banner span').text(gettext(
                                    'The next time you start the Firefox Marketplace app, you’ll see the updated version!'));
                                $button.remove();
                            });
                        }));
                        $('#site-nav').after(nunjucks.env.render('marketplace-update.html'));
                    }
                });
            }
        });
示例#3
0
文件: main.js 项目: ferjm/fireplace
 document.addEventListener('visibilitychange', function() {
     if (!document.hidden) {
         // Refresh list of installed apps in case user uninstalled apps
         // and switched back.
         if (require('user').logged_in()) {
             require('consumer_info').fetch(true);
         }
         apps.getInstalled().done(buttons.mark_btns_as_uninstalled);
     }
 }, false);
示例#4
0
文件: main.js 项目: ferjm/fireplace
 z.page.one('loaded', function() {
     // Remove the splash screen.
     console.log('Hiding splash screen (' + ((performance.now() - start_time) / 1000).toFixed(6) + 's)');
     var splash = $('#splash-overlay').addClass('hide');
     z.body.removeClass('overlayed').addClass('loaded');
     apps.getInstalled().done(buttons.mark_btns_as_installed);
     setTimeout(function() {
         z.page.trigger('splash_removed');
     }, 1500);
 });