diff --git a/pn-site/js/init.js b/pn-site/js/init.js index 1496a7de..b9ced1b9 100644 --- a/pn-site/js/init.js +++ b/pn-site/js/init.js @@ -1,4 +1,5 @@ function init() { + initjQueryMigrate(); jQuery("div#hd h1").on('click', () => { window.location = "/" }); jQuery("li.dialog").each(function(i) { jQuery(this).after("
  • " + this.title + "
  • "); @@ -74,6 +75,16 @@ function init() { getCampaign(); } +function initjQueryMigrate() { + jQuery.migrateMute = true; + jQuery.migrateTrace = false; + jQuery.migrateWarnings.push = (message) => { + const stacktrace = new Error().stack; + const cleanedStacktrace = stacktrace.replace(/^.*at jQuery\.migrateWarnings\.push.*$/gm, ''); + _paq.push(['trackEvent', 'warning.jqmigrate', message + '\n' + cleanedStacktrace]); + }; +} + function getPath() { var result = window.location.href.substring(window.location.href.indexOf(window.location.pathname)); if (window.location.search.length > 0) {