JAVASCRIPT 26
App.js Guest on 29th July 2020 11:47:05 AM
  1. var EbtBrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version",this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(t){for(var e=0;e<t.length;e++){var r=t[e].string,n=t[e].prop;if(this.versionSearchString=t[e].versionSearch||t[e].identity,r){if(-1!=r.indexOf(t[e].subString))return t[e].identity}else if(n)return t[e].identity}},searchVersion:function(t){var e=t.indexOf(this.versionSearchString);if(-1!=e)return parseFloat(t.substring(e+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};EbtBrowserDetect.init(),("Chrome"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<25||"Explorer"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<9||"Firefox"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<28||"Safari"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<6||"Opera"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<15)&&$(".browser-not-supported").show();var EbtCore=function(){"use strict";function t(){var t=$("body").attr("data-pagename");e("GeneralDatalayer"),t||(e("Menu"),e("Footer"))}function e(t,e){var r=void 0!=e?e:"";return window[t].init(r)}function r(){$(document).ready(function(){t(),$("[data-require]").each(function(){e($(this).data("require"),$(this))})})}return{init:r}}();EbtCore.init();var GeneralDatalayer=function(){return{init:function(){function t(t){var e=$(t.currentTarget),r=e[0].dataset.rotuloanalytics,n=e[0].dataset.componente;dataLayer.push({event:"event",dimension22:"embratel:portal:"+Utils.bredcrumb(),eventAction:"modal:"+n+":fechou",page:r})}function e(t){var e=$(t.relatedTarget),r=$(e[0].attributes["data-gtm-event-label"]).val()?$(e[0].attributes["data-gtm-event-label"]).val():"sem-rotulo-definido",n=$(e[0].attributes["data-gtm-event-action"]).val()?$(e[0].attributes["data-gtm-event-action"]).val():"sem-rotulo-definido",i=$(e).parentsUntil("section").parent("section")[0],a=$(i).attr("data-require")?$(i).attr("data-require"):"sem-componente-disponivel",o=$(this);o.attr("data-componente",a),o.attr("data-rotuloAnalytics",r),o.find(".urlModal").attr("data-gtm-event-action",n),o.find(".urlModal").attr("data-gtm-event-label",r),dataLayer.push({event:"event",dimension22:"embratel:portal:"+Utils.bredcrumb(),eventAction:"modal:"+a+":abriu",page:r})}$(".modal-dialog a.urlModal").click(function(t){var e=$(this.attributes["data-gtm-event-label"]).val()?$(this.attributes["data-gtm-event-label"]).val():"sem-rotulo-encontrado",r=$(this.attributes["data-gtm-event-action"]).val()?$(this.attributes["data-gtm-event-action"]).val():"sem-componente-encontrado";dataLayer.push({event:"event",dimension22:"embratel:portal:"+Utils.bredcrumb(),eventAction:"modal:"+r+":clicou",page:e})}),function(){$(".modal").on("hidden.bs.modal",t),$(".modal").on("show.bs.modal",e)}()}}}(),Utils=function(){"use strict";function t(t,e,r){var n;return function(){var i=this,a=arguments,o=function(){n=null,r||t.apply(i,a)},s=r&&!n;clearTimeout(n),n=setTimeout(o,e),s&&t.apply(i,a)}}function e(t){if(t){t=t.replace(/^\s+|\s+$/g,""),t=t.toLowerCase();for(var e="ãà áäâẽèéëêìíïîõòóöôùúüûñç·_,;",r="aaaaaeeeeeiiiiooooouuuunc------",n=0,i=e.length;n<i;n++)t=t.replace(new RegExp(e.charAt(n),"g"),r.charAt(n));return t=t.replace(/\s+/g,"-").replace(/-+/g,"-")}}function r(t,e,r){e||(e=250);var n,i;return function(){var a=r||this,o=+new Date,s=arguments;n&&o<n+e?(clearTimeout(i),i=setTimeout(function(){n=o,t.apply(a,s)},e)):(n=o,t.apply(a,s))}}return{debounce:t,throttle:r,bredcrumb:function(){return document.getElementsByClassName("breadcrumb").length?window.location.pathname:"nao_disponivel"},slugSimple:e}}();var EbtBrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version",this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(t){for(var e=0;e<t.length;e++){var r=t[e].string,n=t[e].prop;if(this.versionSearchString=t[e].versionSearch||t[e].identity,r){if(-1!=r.indexOf(t[e].subString))return t[e].identity}else if(n)return t[e].identity}},searchVersion:function(t){var e=t.indexOf(this.versionSearchString);if(-1!=e)return parseFloat(t.substring(e+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};EbtBrowserDetect.init(),("Chrome"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<25||"Explorer"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<9||"Firefox"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<28||"Safari"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<6||"Opera"===EbtBrowserDetect.browser&&EbtBrowserDetect.version<15)&&$(".browser-not-supported").show();var EbtCore=function(){"use strict";function t(){var t=$("body").attr("data-pagename");e("GeneralDatalayer"),t||(e("Menu"),e("Footer"))}function e(t,e){var r=void 0!=e?e:"";return window[t].init(r)}function r(){$(document).ready(function(){t(),$("[data-require]").each(function(){e($(this).data("require"),$(this))})})}return{init:r}}();EbtCore.init();var GeneralDatalayer=function(){return{init:function(){function t(t){var e=$(t.currentTarget),r=e[0].dataset.rotuloanalytics,n=e[0].dataset.componente;dataLayer.push({event:"event",dimension22:"embratel:portal:"+Utils.bredcrumb(),eventAction:"modal:"+n+":fechou",page:r})}function e(t){var e=$(t.relatedTarget),r=$(e[0].attributes["data-gtm-event-label"]).val()?$(e[0].attributes["data-gtm-event-label"]).val():"sem-rotulo-definido",n=$(e[0].attributes["data-gtm-event-action"]).val()?$(e[0].attributes["data-gtm-event-action"]).val():"sem-rotulo-definido",i=$(e).parentsUntil("section").parent("section")[0],a=$(i).attr("data-require")?$(i).attr("data-require"):"sem-componente-disponivel",o=$(this);o.attr("data-componente",a),o.attr("data-rotuloAnalytics",r),o.find(".urlModal").attr("data-gtm-event-action",n),o.find(".urlModal").attr("data-gtm-event-label",r),dataLayer.push({event:"event",dimension22:"embratel:portal:"+Utils.bredcrumb(),eventAction:"modal:"+a+":abriu",page:r})}$(".modal-dialog a.urlModal").click(function(t){var e=$(this.attributes["data-gtm-event-label"]).val()?$(this.attributes["data-gtm-event-label"]).val():"sem-rotulo-encontrado",r=$(this.attributes["data-gtm-event-action"]).val()?$(this.attributes["data-gtm-event-action"]).val():"sem-componente-encontrado";dataLayer.push({event:"event",dimension22:"embratel:portal:"+Utils.bredcrumb(),eventAction:"modal:"+r+":clicou",page:e})}),function(){$(".modal").on("hidden.bs.modal",t),$(".modal").on("show.bs.modal",e)}()}}}(),Utils=function(){"use strict";function t(t,e,r){var n;return function(){var i=this,a=arguments,o=function(){n=null,r||t.apply(i,a)},s=r&&!n;clearTimeout(n),n=setTimeout(o,e),s&&t.apply(i,a)}}function e(t){if(t){t=t.replace(/^\s+|\s+$/g,""),t=t.toLowerCase();for(var e="ãà áäâẽèéëêìíïîõòóöôùúüûñç·_,;",r="aaaaaeeeeeiiiiooooouuuunc------",n=0,i=e.length;n<i;n++)t=t.replace(new RegExp(e.charAt(n),"g"),r.charAt(n));return t=t.replace(/\s+/g,"-").replace(/-+/g,"-")}}function r(t,e,r){e||(e=250);var n,i;return function(){var a=r||this,o=+new Date,s=arguments;n&&o<n+e?(clearTimeout(i),i=setTimeout(function(){n=o,t.apply(a,s)},e)):(n=o,t.apply(a,s))}}return{debounce:t,throttle:r,bredcrumb:function(){return document.getElementsByClassName("breadcrumb").length?window.location.pathname:"nao_disponivel"},slugSimple:e}}();

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.