fix google analytics and remove dead code from old jekyll site (#144)
This commit is contained in:
Родитель
fc8b118bf3
Коммит
a9f0e94f37
|
@ -10,10 +10,15 @@ function enableTelemetry() {
|
|||
|
||||
// enable google analytics.
|
||||
window['ga-disable-UA-161403370-1'] = false;
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-161403370-1');
|
||||
|
||||
// see https://developers.google.com/analytics/devguides/collection/analyticsjs/
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-161403370-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,77 +1,14 @@
|
|||
jQuery(document).ready(function ($) {
|
||||
|
||||
// shrink nav onscroll - mobile first ux
|
||||
$(window).scroll(function () {
|
||||
if ($(document).scrollTop() > 20) {
|
||||
$('.navbar-default').addClass('shrink');
|
||||
} else {
|
||||
$('.navbar-default').removeClass('shrink');
|
||||
};
|
||||
if ($(document).scrollTop() > 320) {
|
||||
$('.brand-home').addClass('slide-out-top');
|
||||
} else {
|
||||
$('.brand-home').removeClass('slide-out-top');
|
||||
}
|
||||
});
|
||||
|
||||
//toggle sidenav arrows up or down
|
||||
$('.panel-collapse').on('show.bs.collapse', function () {
|
||||
$(this).siblings('.panel-heading').addClass('active');
|
||||
});
|
||||
|
||||
$('.panel-collapse').on('hide.bs.collapse', function () {
|
||||
$(this).siblings('.panel-heading').removeClass('active');
|
||||
});
|
||||
|
||||
//homepage slider
|
||||
$("#carousel_home").carousel({
|
||||
interval: 15000, // timeout between carousel slides in nmilliseconds
|
||||
pause: "hover"
|
||||
});
|
||||
|
||||
//copy to clipboard
|
||||
var clipboard = new ClipboardJS('code');
|
||||
$('code').tooltip({
|
||||
trigger: 'click'
|
||||
});
|
||||
|
||||
|
||||
//trigger waypoint animations
|
||||
|
||||
$('#home_figure_1').waypoint(function () {
|
||||
$('#home_figure_1').addClass('slide-in-left');
|
||||
}, {
|
||||
offset: '70%'
|
||||
});
|
||||
$('#home_text_1').waypoint(function () {
|
||||
$('#home_text_1').addClass('slide-in-right');
|
||||
}, {
|
||||
offset: '70%'
|
||||
});
|
||||
$('#home_figure_2a').waypoint(function () {
|
||||
$('#home_figure_2a').addClass('slide-in-right');
|
||||
}, {
|
||||
offset: '70%'
|
||||
});
|
||||
$('#home_figure_2b').waypoint(function () {
|
||||
$('#home_figure_2b').addClass('slide-in-right');
|
||||
}, {
|
||||
offset: '70%'
|
||||
});
|
||||
$('#home_text_2').waypoint(function () {
|
||||
$('#home_text_2').addClass('slide-in-left');
|
||||
}, {
|
||||
offset: '70%'
|
||||
});
|
||||
|
||||
// make external links that start with http, and don't go to our own site, open in a new tab
|
||||
$('a[href^="http"]').not('a[href*="microsoft.github.io"]').not('a[href*="127.0.0.1"]').attr('target', '_blank');
|
||||
|
||||
//keep mobile menu from re-rendering on top of carousel
|
||||
$('#navbar').on('shown.bs.collapse', function () {
|
||||
$('#carousel_home').carousel('pause');
|
||||
})
|
||||
|
||||
var year = (new Date()).getFullYear();
|
||||
$("#copyright").append("© " + year + " Microsoft");
|
||||
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,33 +0,0 @@
|
|||
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.4.1/bootstrap.min.js" crossorigin="anonymous"></script>
|
||||
<script src="/coyote/assets/js/main.js"></script>
|
||||
<script src="/coyote/assets/js/plugins.js"></script>
|
||||
<script src="/coyote/assets/js/vendor/ie10-viewport-bug-workaround.js"></script>
|
||||
|
||||
{% if page.section == "case-studies" or page.section == "learn" %}
|
||||
<script src="/coyote/assets/js/navmenu.js"></script>
|
||||
<script src="/coyote/assets/js/progress_bar.js"></script>
|
||||
<script src="/coyote/assets/js/animate_trace.js"></script>
|
||||
<script src="/coyote/assets/js/trace_model.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('h1,h2,h3,h4,h5,h6').filter('[id]').each(function () {
|
||||
$(this).html('<a class="a-unstyled" href="#' + $(this).attr('id') + '">' + $(this).text() + '</a>');
|
||||
});
|
||||
|
||||
$('table').each(function () {
|
||||
$(this).addClass("table");
|
||||
$(this).addClass("table-bordered");
|
||||
$(this).addClass("table-striped");
|
||||
$(this).addClass("table-condensed");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-161403370-1"></script>
|
||||
|
||||
<!-- Microsoft wcp-consent library -->
|
||||
<script src="https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js"></script>
|
||||
<script src="/coyote/assets/js/analytics.js"></script>
|
|
@ -40,6 +40,7 @@
|
|||
<script src="{{ base_url }}js/jquery-3.2.1.min.js"></script>
|
||||
<script src="{{ base_url }}js/bootstrap-3.3.7.min.js"></script>
|
||||
<script src="{{ base_url }}js/highlight.pack.js"></script>
|
||||
<script src="https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js"></script>
|
||||
{% if is_top %}
|
||||
<script src="{{ base_url }}js/elasticlunr.min.js"></script>
|
||||
{% endif %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче