{"size": 941, "ext": "js", "max_stars_repo_path": "web/modules/custom/mt_cookieconsent/js/mt_cookieconsent.js", "max_stars_repo_name": "tambaslamin/hrportaldemo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/modules/custom/mt_cookieconsent/js/mt_cookieconsent.js", "max_issues_repo_name": "tambaslamin/hrportaldemo", "max_issues_repo_issues_event_min_datetime": "2020-05-01T00:26:02.000Z", "max_issues_repo_issues_event_max_datetime": "2020-05-17T00:34:34.000Z", "max_forks_repo_path": "web/modules/custom/mt_cookieconsent/js/mt_cookieconsent.js", "max_forks_repo_name": "click2tman/visitsalone", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 12, "max_forks_count": null, "avg_line_length": 26.8857142857, "max_line_length": 72, "alphanum_fraction": 0.5664187035}
/*
 * MTCookieConsent scripts
 *  Add any module related script here
 */

(function ($, Drupal, drupalSettings) {

  Drupal.behaviors.mt_cookieconsent = {
    attach: function (context, settings) {
      // can access setting from 'drupalSettings';
      var theme_select = drupalSettings.mt_cookieconsent.theme_select;
      var alert_message = drupalSettings.mt_cookieconsent.alert_message;
      var target_url = drupalSettings.mt_cookieconsent.target_url;

      window.addEventListener("load", function(){
        window.cookieconsent.initialise({
          "palette": {
            "popup": {
              "background": "#000"
            },
            "button": {
              "background": "#fff"
            }
          },
          "theme": theme_select,
          "content": {
            "message": alert_message,
            "href": target_url
          }
        });
      });
    }
  };
})(jQuery, Drupal, drupalSettings);
