From a9f0e94f378ea8cb91277178360a0c93bc11e22e Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Wed, 24 Mar 2021 15:34:58 -0700 Subject: [PATCH] fix google analytics and remove dead code from old jekyll site (#144) --- docs/assets/js/analytics.js | 13 +++++--- docs/assets/js/main.js | 63 ------------------------------------ docs/assets/js/plugins.js | 16 --------- docs/include/scripts.html | 33 ------------------- docs/windmill_dark/base.html | 1 + 5 files changed, 10 insertions(+), 116 deletions(-) delete mode 100644 docs/include/scripts.html diff --git a/docs/assets/js/analytics.js b/docs/assets/js/analytics.js index 39af809e..2a0ac416 100644 --- a/docs/assets/js/analytics.js +++ b/docs/assets/js/analytics.js @@ -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'); } } diff --git a/docs/assets/js/main.js b/docs/assets/js/main.js index 8921ea64..6c9ee9df 100644 --- a/docs/assets/js/main.js +++ b/docs/assets/js/main.js @@ -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"); diff --git a/docs/assets/js/plugins.js b/docs/assets/js/plugins.js index 9cd91c9c..3c3a6b8a 100644 --- a/docs/assets/js/plugins.js +++ b/docs/assets/js/plugins.js @@ -6,19 +6,3 @@ * Licensed MIT © Zeno Rocha */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;nn)return!1;if(r===n)return e===t;e:for(var i=0,o=0;i=0}},u={put:function(n){return e(n)?t(n):function(e){return Boolean(e)&&"[object Array]"===Object.prototype.toString.call(e)}(n)?function(n){for(var r=[],i=0,o=n.length;i0})(e)&&function(e){var t=e.length;if(0===t)return r(a.noResultsText);for(var n=0;n{title}',templateMiddleware:function(){},noResultsText:"No results found",limit:10,fuzzy:!1,exclude:[]},l=["searchInput","resultsContainer","json"],f=function p(e){if(!function(e){return!!e&&"undefined"!=typeof e.required&&e.required instanceof Array}(e))throw new Error("-- OptionsValidator: required options missing");if(!(this instanceof p))return new p(e);var t=e.required;this.getRequiredOptions=function(){return t},this.validate=function(e){var n=[];return t.forEach(function(t){"undefined"==typeof e[t]&&n.push(t)}),n}}({required:l});e.SimpleJekyllSearch=function(e){return f.validate(e).length>0&&o("You must specify the following required options: "+l),a=s.merge(a,e),c.setOptions({template:a.searchResultTemplate,middleware:a.templateMiddleware}),u.setOptions({fuzzy:a.fuzzy,limit:a.limit}),s.isJSON(a.json)?t(a.json):function(e){n.load(e,function(n,r){n&&o("failed to get JSON ("+e+")"),t(r)})}(a.json),{search:i}},e.SimpleJekyllSearch.init=e.SimpleJekyllSearch,"function"==typeof e.SimpleJekyllSearchInit&&e.SimpleJekyllSearchInit.call(this,e.SimpleJekyllSearch)}(window)}(); - - -/*! -Waypoints - 4.0.1 -Copyright © 2011-2016 Caleb Troughton -Licensed under the MIT license. -https://github.com/imakewebthings/waypoints/blob/master/licenses.txt -*/ -!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,n.windowContext||(n.windowContext=!0,n.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s];if(null!==a.triggerPoint){var l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=Math.floor(y+l-f),h=w=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); \ No newline at end of file diff --git a/docs/include/scripts.html b/docs/include/scripts.html deleted file mode 100644 index ac8bc90a..00000000 --- a/docs/include/scripts.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - -{% if page.section == "case-studies" or page.section == "learn" %} - - - - - -{% endif %} - - - - - - - diff --git a/docs/windmill_dark/base.html b/docs/windmill_dark/base.html index ae8a766d..63b98ad3 100644 --- a/docs/windmill_dark/base.html +++ b/docs/windmill_dark/base.html @@ -40,6 +40,7 @@ + {% if is_top %} {% endif %}