Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Misty Stanley-Jones committed Feb 11, 2017
1 parent 14cb526 commit a15a68f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
3 changes: 3 additions & 0 deletions _layouts/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@
}
</style>
<script type="text/javascript">
// Only load segment on the real site
if(window.location.href.indexOf("docs.docker.com") > -1) {
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0";
analytics.load("IWj9D0UpZHZdZUZX9jl98PcpBFWBnBMy");
analytics.page();
}}();
}
</script>
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,t,n){function r(n){if(!t[n]){var o=t[n]={exports:{}};e[n][0].call(o.exports,function(t){var o=e[n][1][t];return r(o||t)},o,o.exports)}return t[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,n){function r(e,t){return function(){o(e,[(new Date).getTime()].concat(a(arguments)),null,t)}}var o=e("handle"),i=e(2),a=e(3);"undefined"==typeof window.newrelic&&(newrelic=NREUM);var u=["setPageViewName","setCustomAttribute","finished","addToTrace","inlineHit"],c=["addPageAction"],f="api-";i(u,function(e,t){newrelic[t]=r(f+t,"api")}),i(c,function(e,t){newrelic[t]=r(f+t)}),t.exports=newrelic,newrelic.noticeError=function(e){"string"==typeof e&&(e=new Error(e)),o("err",[e,(new Date).getTime()])}},{}],2:[function(e,t,n){function r(e,t){var n=[],r="",i=0;for(r in e)o.call(e,r)&&(n[i]=t(r,e[r]),i+=1);return n}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],3:[function(e,t,n){function r(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,o=n-t||0,i=Array(0>o?0:o);++r<o;)i[r]=e[t+r];return i}t.exports=r},{}],ee:[function(e,t,n){function r(){}function o(e){function t(e){return e&&e instanceof r?e:e?u(e,a,i):i()}function n(n,r,o){e&&e(n,r,o);for(var i=t(o),a=l(n),u=a.length,c=0;u>c;c++)a[c].apply(i,r);var s=f[g[n]];return s&&s.push([m,n,r,i]),i}function p(e,t){w[e]=l(e).concat(t)}function l(e){return w[e]||[]}function d(e){return s[e]=s[e]||o(n)}function v(e,t){c(e,function(e,n){t=t||"feature",g[n]=t,t in f||(f[t]=[])})}var w={},g={},m={on:p,emit:n,get:d,listeners:l,context:t,buffer:v};return m}function i(){return new r}var a="nr@context",u=e("gos"),c=e(2),f={},s={},p=t.exports=o();p.backlog=f},{}],gos:[function(e,t,n){function r(e,t,n){if(o.call(e,t))return e[t];var r=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[t]=r,r}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],handle:[function(e,t,n){function r(e,t,n,r){o.buffer([e],r),o.emit(e,t,n)}var o=e("ee").get("handle");t.exports=r,r.ee=o},{}],id:[function(e,t,n){function r(e){var t=typeof e;return!e||"object"!==t&&"function"!==t?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr@id",a=e("gos");t.exports=r},{}],loader:[function(e,t,n){function r(){if(!w++){var e=v.info=NREUM.info,t=s.getElementsByTagName("script")[0];if(e&&e.licenseKey&&e.applicationID&&t){c(l,function(t,n){e[t]||(e[t]=n)});var n="https"===p.split(":")[0]||e.sslForHttp;v.proto=n?"https://":"http://",u("mark",["onload",a()],null,"api");var r=s.createElement("script");r.src=v.proto+e.agent,t.parentNode.insertBefore(r,t)}}}function o(){"complete"===s.readyState&&i()}function i(){u("mark",["domContent",a()],null,"api")}function a(){return(new Date).getTime()}var u=e("handle"),c=e(2),f=window,s=f.document;NREUM.o={ST:setTimeout,CT:clearTimeout,XHR:f.XMLHttpRequest,REQ:f.Request,EV:f.Event,PR:f.Promise,MO:f.MutationObserver},e(1);var p=""+location,l={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-943.min.js"},d=window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&!/CriOS/.test(navigator.userAgent),v=t.exports={offset:a(),origin:p,features:{},xhrWrappable:d};s.addEventListener?(s.addEventListener("DOMContentLoaded",i,!1),f.addEventListener("load",r,!1)):(s.attachEvent("onreadystatechange",o),f.attachEvent("onload",r)),u("mark",["firstbyte",a()],null,"api");var w=0},{}]},{},["loader"]);</script>
{% if site.GH_ENV == "gh_pages" %}<meta name="robots" content="noindex">{% endif %}
Expand Down
38 changes: 25 additions & 13 deletions js/my_first_tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ var tour = {
placement: "top",
xOffset: "center",
yOffset: "300px",
multipage: "true",
onNext: function() {
window.location = "/engine/swarm/admin_guide/";
},
onShow: function () {
// Hide the arrow on the first navigation bubble
$('.hopscotch-bubble-arrow-container').css('visibility', 'hidden');
},
multipage: "true",
onNext: function() {
window.location = "/engine/swarm/admin_guide/";
}
},
{
Expand Down Expand Up @@ -82,39 +82,51 @@ var tour = {
content: "Use the feedback links to edit the page, provide feedback, or find out how to get support.",
target: "feedback-links",
placement: "left",
arrowOffset: "center" },
arrowOffset: "center"
},
{
title: "In-page navigation",
content: "Use the in-page navigation links to jump to specific areas within the page you are viewing.<br />This is especially helpful on pages with a lot of content.",
target: "side-toc",
placement: "left",
yOffset: "100px",
arrowOffset: "center"
},
{
title: "The tour is complete!",
content: "Thanks for checking out the new navigation features. You will now be returned to where you started.",
target: "main-content",
placement: "top",
xOffset: "center",
yOffset: "300px",
onShow: function () {
// Hide the arrow on the first navigation bubble
$('.hopscotch-bubble-arrow-container').css('visibility', 'hidden');
}
}
],
showPrevButton: true,
scrollTopMargin: 200,
skipIfNoElement: false,
onEnd: function() {
// Return them back where they came from when the tour ends
if (hopscotch.getState() === null) {
window.location = document.referrer;
}
hopscotch.endTour(true);
window.location = document.referrer;
},
onClose: function() {
// Return them back where they came from if they end the tour early
if (hopscotch.getState() === "hello-hopscotch:9") {
window.location = document.referrer;
}
hopscotch.endTour(true);
window.location = document.referrer;
}
};

// Start tour if button is pressed
$("#start-tour").click(function(){
hopscotch.endTour(true);
hopscotch.startTour(tour);
});

// Resume tour if already in progress
if (hopscotch.getState() === "hello-hopscotch:9") {
hopscotch.startTour(tour);
if (hopscotch.getState() != null) {
hopscotch.startTour(tour, hopscotch.getState());
}

0 comments on commit a15a68f

Please sign in to comment.