Mini Kabibi Habibi

Current Path : C:/Program Files/McAfee/WebAdvisor/MFW/packages/webadvisor/
Upload File :
Current File : C:/Program Files/McAfee/WebAdvisor/MFW/packages/webadvisor/wa-ch-store-overlay-ui.js

/* Accept Extension UI */
(function (wa, $) {
  var ui = wa.UI = wa.UI || {},
      _window = wa.Core.Window,
      _external = wa.Utils.External,
      _instrument = wa.Utils.Instrument;

  ui.accept_extension = function () {
    var $el = {
      contentText1: $("#content__text-1"),
      contentText2: $("#content__text-2"),
      closeIcon: $("#close-icon"),
    },

    show = function () {
      init();

      _window.show();

      //Send Telemetry 3.0 for dialog balloon
      var browser_code = _instrument.getBrowserTypeCode();
      var screen_flow = browser_code == 'FF' ? 'firefox' : 'introduction';
      var hit_screen_id = browser_code == 'FF' ? '300.1.2.1-windows-onboarding-firefox-webpage' : '300.1.1.1-windows-onboarding-introduction-coachmark';

      var analyticsEvent = {
          _event_name: "wa_onboarding_balloon_impression",
          hit_label_8: screen_flow,
          hit_label_18: "Onboarding",
          hit_label_19: "Impression",
          hit_label_20: browser_code,
          hit_label_21: "WAOverlayOnboardingOpenExtensionPage",
          hit_screen: hit_screen_id
      }
      _instrument.sendAnalyticsEvent(analyticsEvent);
    },

    init = function () {
      _window.setHeight("200");

      // Update balloon content text
      var lang = wa.Utils.Lang(wa.Utils.Lang.ResType.OVERLAY).get;
      var descLocaleId = "CHROME_STORE_COACHMARK_DESC_1";
      var desc2LocaleId = "CHROME_STORE_COACHMARK_DESC_2";

      $el.contentText1.html(lang(descLocaleId));
      $el.contentText2.html(lang(desc2LocaleId));

      // Set the focus on the balloon
      document.body.focus();
    };

    // Close balloon when click anywhere in the page.
    window.addEventListener('blur', function () {
      _window.close();
    }, false);

    // Close Icon click handler
    $("#close-icon").click(function () {

      //Send Telemetry 3.0 for dialog balloon
      var browser_code = _instrument.getBrowserTypeCode();
      var screen_flow = browser_code == 'FF' ? 'firefox' : 'introduction';
      var hit_screen_id = browser_code == 'FF' ? '300.1.2.1-windows-onboarding-firefox-webpage' : '300.1.1.1-windows-onboarding-introduction-coachmark';

      var closeAnalyticsEvent = {
          _event_name: "wa_onboarding_balloon_interaction",
          hit_label_8: screen_flow,
          hit_label_18: "Onboarding",
          hit_label_19: "CloseClicked",
          hit_label_20: browser_code,
          hit_label_21: "WAOverlayOnboardingOpenExtensionPage",
          hit_screen: hit_screen_id
      }
      _instrument.sendAnalyticsEvent(closeAnalyticsEvent);

    _window.close();
    });

    return {
        show: show
    }
  };

}(window.WebAdvisor = window.WebAdvisor || {}, jQuery));

$(function () {
  var balloon = new WebAdvisor.UI.accept_extension();
  balloon.show();
});
//22790127A8E8F09684B8B7900A8F8AFF77351728356332838379579DB2C00BDA9B7E2A0DA1B3E4CBC72E055EB670450F8703A5745C595B52AAB611986703031D++