Пример #1
0
 }).then(() => {
   app.sendToGA('event', {
     eventCategory: 'HomePage Interactions',
     eventAction: 'button click',
     eventLabel: 'Retire'
   });
 });
Пример #2
0
 app.subscribeToBasket(app.me.user.id, () => {
   app.sendToGA('event', {
     eventCategory: 'HomePage Interactions',
     eventAction: 'button click',
     eventLabel: 'Install the Add-on',
     outboundURL: downloadUrl
   });
 });
Пример #3
0
  afterRender() {
    document.body.addEventListener('click', this.close.bind(this));
  },

  close(ev) {
    if (!ev.target.parentElement.classList.contains('settings-menu')) {
      this.query('.settings-menu').classList.add('no-display');
      this.query('.settings-button').classList.remove('active');
    }
  },

  toggleSettings(ev) {
    ev.stopPropagation();
    app.sendToGA('event', {
      eventCategory: 'Menu Interactions',
      eventAction: 'drop-down menu',
      eventLabel: 'Toggle Menu'
    });
    const setEl = this.query('.settings-menu');
    if (setEl.classList.contains('no-display')) {
      setEl.classList.remove('no-display');
      this.query('.settings-button').classList.add('active');
    } else {
      this.close();
    }
  },

  logout() {
    app.sendToGA('event', {
      eventCategory: 'Menu Interactions',
      eventAction: 'drop-down menu',
Пример #4
0
        eventCategory: 'ExperimentsDetailPage Interactions'
      }), '[data-hook="experiment-list"]');
    }

    if (this.model.completed) {
      this.renderSubview(new EolView({
        completedDate: new Date(this.model.completed).toLocaleDateString(),
        title: this.model.title
      }), '[data-hook="eol-message"]');
    }

    postInstallModal(this);

    app.sendToGA('pageview', {
      'dimension1': this.activeUser,
      'dimension4': this.model.enabled,
      'dimension5': this.model.title,
      'dimension6': this.model.installation_count
    });
    this.model.updateWhenLastSeen();
    return this;
  },

  beforeRender() {
    this.activeUser = app.me.hasAddon;
    this.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  },

  afterRender() {
    this.renderCollection(new CollectionExtended(this.model.details),
                          DetailView,
                          this.query('.details-list'));
Пример #5
0
  props: {
    'id': 'string',
    'title': 'string',
    'questions': 'object',
    'experiment': 'string',
    'surveyUrl': 'string'
  },

  events: {
    'click .submit': 'submit',
    'click .cancel': 'cancel'
  },

  cancel(e) {
    this.animateRemove();
    e.preventDefault();
    e.stopPropagation();
  },

  submit() {
    this.animateRemove();
    app.sendToGA('event', {
      eventCategory: 'ExperimentDetailsPage Interactions',
      eventAction: 'button click',
      eventLabel: 'exit survey disabled'
    });
    if (this.parentOnSubmit) this.parentOnSubmit();
  }
});
Пример #6
0
import app from 'ampersand-app';
import ExperimentListView from './experiment-list-view';
import PageView from './page-view';

import template from '../templates/experiment-list-page';

export default PageView.extend({
  pageTitle: 'Firefox Test Pilot',
  pageTitleL10nID: 'pageTitleExperimentListPage',
  template: template,

  render() {
    this.hasAddon = app.me.hasAddon;
    PageView.prototype.render.apply(this, arguments);
    this.renderSubview(new ExperimentListView({hasAddon: this.hasAddon}),
      '[data-hook="experiment-list"]');

    app.sendToGA('pageview', {
      'dimension1': this.hasAddon
    });
  },

  remove() {
    PageView.prototype.remove.apply(this, arguments);
  }
});
Пример #7
0
    },
    {
      type: 'toggle',
      hook: 'enabled-tab'
    }],
    'hasAddon': {
      type: 'booleanClass',
      hook: 'show-detail',
      name: 'has-addon'
    }
  },

  events: {
    'click [data-hook=show-detail].has-addon': 'openDetailPage'
  },

  initialize(opts) {
    this.hasAddon = !!opts.hasAddon;
  },

  openDetailPage(evt) {
    evt.preventDefault();
    app.sendToGA('event', {
      eventCategory: 'ExperimentsPage Interactions',
      eventAction: 'Open detail page',
      eventLabel: this.model.title
    });
    app.router.navigate('experiments/' + this.model.slug);
  }
});
Пример #8
0
        eventCategory: 'HomePage Interactions',
        eventAction: 'button click',
        eventLabel: 'Retire'
      });
    });
  },

  clearProgressMessage() {
    this.query('.loading-pill').classList.add('fade-out');
    setTimeout(() => {
      this.query('.loading-pill').classList.add('no-display');
      this.query('.copter').classList.remove('no-display');
      this.query('.copter').classList.add('fade-in');
      this.query('.modal').classList.remove('no-display');
      this.query('.modal').classList.add('fade-in');
    }, 500);
  },

  takeSurvey() {
    app.sendToGA('event', {
      eventCategory: 'RetirePage Interactions',
      eventAction: 'button click',
      eventLabel: 'take survey'
    });
  },

  // override page afterRender() to skip rendering header & footer
  afterRender() {}
});

Пример #9
0
    PageView.prototype.render.apply(this, arguments);

    if (!this.hasAddon) {
      this.renderSubview(new ExperimentListView({
        hasAddon: this.hasAddon,
        isFirefox: this.isFirefox
      }), '[data-hook="experiment-list"]');
    }

    const installedCount = (!this.hasAddon) ? null :
      Object.keys(app.me.installed || {}).length;
    const anyInstalled = (!this.hasAddon) ? null :
      (installedCount > 0);
    app.sendToGA('pageview', {
      'dimension1': this.hasAddon,
      'dimension2': anyInstalled,
      'dimension3': installedCount
    });
  },

  installClicked() {
    const downloadUrl = '/static/addon/addon.xpi';

    this.query('[data-hook=install]').classList.add('state-change');
    this.query('.default-btn-msg').classList.add('no-display');
    this.query('.progress-btn-msg').classList.remove('no-display');
    app.sendToGA('event', {
      eventCategory: 'HomePage Interactions',
      eventAction: 'button click',
      eventLabel: 'Install the Add-on',
      outboundURL: downloadUrl
Пример #10
0
    PageView.prototype.render.apply(this, arguments);

    if (!this.loggedIn) {
      this.renderSubview(new ExperimentListView({
        loggedIn: this.loggedIn,
        isFirefox: this.isFirefox
      }), '[data-hook="experiment-list"]');
    }

    const installedCount = (!this.loggedIn) ? null :
      (app.me.installed || []).length;
    const anyInstalled = (!this.loggedIn) ? null :
      (installedCount > 0);
    app.sendToGA('pageview', {
      'dimension1': this.loggedIn,
      'dimension2': anyInstalled,
      'dimension3': installedCount
    });
  },

  installClicked() {
    const isLoggedIn = !!app.me.user.id;
    const downloadUrl = isLoggedIn && app.me.user.addon.url;
    this.query('[data-hook=install]').classList.add('state-change');
    this.query('.default-btn-msg').classList.add('no-display');
    this.query('.progress-btn-msg').classList.remove('no-display');
    app.subscribeToBasket(app.me.user.id, () => {
      app.sendToGA('event', {
        eventCategory: 'HomePage Interactions',
        eventAction: 'button click',
        eventLabel: 'Install the Add-on',
Пример #11
0
import app from 'ampersand-app';
import ExperimentListView from './experiment-list-view';
import PageView from './page-view';

import template from '../templates/experiment-list-page';

export default PageView.extend({
  pageTitle: 'Firefox Test Pilot',
  pageTitleL10nID: 'pageTitleExperimentListPage',
  template: template,

  render() {
    this.loggedIn = !!app.me.user.id;
    PageView.prototype.render.apply(this, arguments);
    this.renderSubview(new ExperimentListView({loggedIn: this.loggedIn}),
      '[data-hook="experiment-list"]');

    app.sendToGA('pageview', {
      'dimension1': this.loggedIn
    });
  },

  remove() {
    PageView.prototype.remove.apply(this, arguments);
  }
});