2016-09-11 23:26:00 +00:00
|
|
|
doctype html
|
|
|
|
html
|
|
|
|
head
|
|
|
|
meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"
|
|
|
|
meta charset="utf-8"
|
|
|
|
meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"
|
|
|
|
|
2016-09-23 21:51:01 +00:00
|
|
|
link href="/favicon.png" rel="icon" type="image/png"
|
|
|
|
link href="/favicon.ico" rel="icon"
|
|
|
|
|
2016-09-11 23:26:00 +00:00
|
|
|
title = current_page.data.title || "InSpec"
|
|
|
|
|
2016-09-23 13:26:22 +00:00
|
|
|
link rel='stylesheet' type='text/css' href='css/inspec_tutorial.css'
|
2016-09-11 23:26:00 +00:00
|
|
|
|
|
|
|
== stylesheet_link_tag :site
|
|
|
|
|
|
|
|
body class="#{page_classes}"
|
2016-09-30 16:37:43 +00:00
|
|
|
= partial "layouts/global-message"
|
|
|
|
|
2016-09-21 00:11:41 +00:00
|
|
|
.container
|
|
|
|
= partial "layouts/nav"
|
2016-09-11 23:26:00 +00:00
|
|
|
|
2016-09-21 00:11:41 +00:00
|
|
|
main#main-content
|
|
|
|
== yield
|
|
|
|
|
|
|
|
= partial "layouts/footer"
|
2016-09-19 18:04:51 +00:00
|
|
|
|
2017-01-18 04:59:40 +00:00
|
|
|
script src='https://s3.amazonaws.com/menumaker/menumaker.min.js'
|
2018-02-17 15:44:42 +00:00
|
|
|
script src='https://buttons.github.io/buttons.js'
|
2016-09-23 13:26:22 +00:00
|
|
|
script src='scripts/inspec_tutorial.js'
|
|
|
|
script src='dist/inspec_tutorial.js'
|
2018-02-17 15:44:42 +00:00
|
|
|
script src='javascripts/vendor/jquery.min.js'
|
2016-09-23 13:26:22 +00:00
|
|
|
div inspec-tutorial="true" class="inspec-tutorial" hidden="true"
|
|
|
|
= "Loading"
|
|
|
|
|
2016-09-19 18:04:51 +00:00
|
|
|
== javascript_include_tag "all"
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-09 05:29:00 +00:00
|
|
|
javascript:
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-10 23:34:12 +00:00
|
|
|
//initiate sticky sidebar from jquery.sticky.js
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-02-24 04:46:54 +00:00
|
|
|
if (window.innerWidth > 640) { //don't fix on mobile
|
|
|
|
$('#sidebar').stick_in_parent();
|
|
|
|
}
|
2017-10-26 20:37:38 +00:00
|
|
|
|
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
javascript:
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
function initSliders() {
|
|
|
|
var prev = -1;
|
|
|
|
$('.slider .selectors a').click(function(e) {
|
|
|
|
e.stopPropagation()
|
|
|
|
var idx = $(this).index();
|
|
|
|
if(prev == idx) return;
|
|
|
|
prev = idx;
|
|
|
|
|
|
|
|
$('.slider .selectors a').removeClass('selected')
|
|
|
|
$(this).addClass('selected')
|
|
|
|
|
|
|
|
$('.slider .view.slide-in').removeClass('slide-in').addClass('slide-out')
|
|
|
|
var el = $('.slider .view')[idx]
|
|
|
|
if(el == null) {
|
|
|
|
console.log("No element for slider index "+idx)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
$(el).removeClass('slide-out').removeClass('hidden').addClass('slide-in')
|
|
|
|
})
|
|
|
|
|
|
|
|
$('.slider .view').addClass('hidden')
|
|
|
|
var links = $('.slider .selectors a')
|
|
|
|
if(links[0]!= null) links[0].click()
|
2017-01-09 23:26:16 +00:00
|
|
|
}
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
//run code colors
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
initSliders()
|
|
|
|
$('pre code').each(function(i, block) {
|
|
|
|
hljs.highlightBlock(block);
|
|
|
|
});
|
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
//copy to clipboard
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
function copyToClipboard(element) {
|
|
|
|
var $temp = $("<input>");
|
|
|
|
$("body").append($temp);
|
|
|
|
$temp.val($(element).text()).select();
|
|
|
|
document.execCommand("copy");
|
|
|
|
$temp.remove();
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#copy').hover(function() {
|
|
|
|
$('#install').toggleClass("text-focus");
|
2017-01-23 02:50:12 +00:00
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
$('#copy').click(function() {
|
|
|
|
$(this).removeClass("fa-copy");
|
|
|
|
$(this).addClass("fa-check");
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
setTimeout(() => {
|
|
|
|
$(this).removeClass('fa-check').addClass('fa-copy');
|
|
|
|
}, 1500);
|
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
// homepage content slider
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
$(function() {
|
|
|
|
$("#expand").hide();
|
|
|
|
$("#expandBtn").html("Show all new features");
|
2017-01-09 23:26:16 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
$('#expandBtn').click(function() {
|
|
|
|
$('#expand').slideToggle("fast");
|
|
|
|
$(this).html($(this).html() == 'Collapse new features' ? 'Show all new features' : 'Collapse new features');
|
|
|
|
});
|
|
|
|
});
|
2017-01-06 08:06:40 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
// scroll spy animations
|
|
|
|
|
|
|
|
var $slide_left = $('.slide-left');
|
|
|
|
var $slide_right = $('.slide-right');
|
|
|
|
var $slide_up = $('.slide-up');
|
|
|
|
var $slide_up_slow = $('.slide-up-slow');
|
|
|
|
var $window = $(window);
|
|
|
|
|
|
|
|
function check_if_in_view() {
|
|
|
|
var window_height = $window.height();
|
|
|
|
var window_top_position = $window.scrollTop();
|
|
|
|
var window_bottom_position = (window_top_position + window_height);
|
|
|
|
|
|
|
|
$.each($slide_left, function() {
|
|
|
|
var $element = $(this);
|
|
|
|
var element_height = $element.outerHeight();
|
|
|
|
var element_top_position = $element.offset().top;
|
|
|
|
var element_bottom_position = (element_top_position + element_height);
|
|
|
|
|
|
|
|
//check to see if this current container is within viewport
|
|
|
|
if ((element_bottom_position >= window_top_position) &&
|
|
|
|
(element_top_position <= window_bottom_position)) {
|
|
|
|
$element.addClass('in-view');
|
|
|
|
} else {
|
|
|
|
$element.removeClass('in-view');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.each($slide_right, function() {
|
|
|
|
var $element = $(this);
|
|
|
|
var element_height = $element.outerHeight();
|
|
|
|
var element_top_position = $element.offset().top;
|
|
|
|
var element_bottom_position = (element_top_position + element_height);
|
|
|
|
|
|
|
|
//check to see if this current container is within viewport
|
|
|
|
if ((element_bottom_position >= window_top_position) &&
|
|
|
|
(element_top_position <= window_bottom_position)) {
|
|
|
|
$element.addClass('in-view');
|
|
|
|
} else {
|
|
|
|
$element.removeClass('in-view');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.each($slide_up, function() {
|
|
|
|
var $element = $(this);
|
|
|
|
var element_height = $element.outerHeight();
|
|
|
|
var element_top_position = $element.offset().top;
|
|
|
|
var element_bottom_position = (element_top_position + element_height);
|
|
|
|
|
|
|
|
//check to see if this current container is within viewport
|
|
|
|
if ((element_bottom_position >= window_top_position) &&
|
|
|
|
(element_top_position <= window_bottom_position)) {
|
|
|
|
$element.addClass('in-view');
|
|
|
|
} else {
|
|
|
|
$element.removeClass('in-view');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.each($slide_up_slow, function() {
|
|
|
|
var $element = $(this);
|
|
|
|
var element_height = $element.outerHeight();
|
|
|
|
var element_top_position = $element.offset().top;
|
|
|
|
var element_bottom_position = (element_top_position + element_height);
|
|
|
|
|
|
|
|
//check to see if this current container is within viewport
|
|
|
|
if ((element_bottom_position >= window_top_position) &&
|
|
|
|
(element_top_position <= window_bottom_position)) {
|
|
|
|
$element.addClass('in-view');
|
|
|
|
} else {
|
|
|
|
$element.removeClass('in-view');
|
|
|
|
}
|
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
}
|
2018-02-17 15:44:42 +00:00
|
|
|
|
|
|
|
$window.on('scroll resize', check_if_in_view);
|
|
|
|
$window.trigger('scroll');
|
|
|
|
|
|
|
|
//scroll to top
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
|
|
|
$(window).scroll(function(){
|
|
|
|
if ($(this).scrollTop() > 100) {
|
|
|
|
$('.scrollToTop').fadeIn();
|
|
|
|
} else {
|
|
|
|
$('.scrollToTop').fadeOut();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.scrollToTop').click(function(){
|
|
|
|
$('html, body').animate({scrollTop : 0},800);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2017-01-20 09:15:38 +00:00
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2018-02-17 15:44:42 +00:00
|
|
|
//scrolling code box
|
|
|
|
|
|
|
|
var div = $('#scrolled');
|
|
|
|
setInterval(function(){
|
|
|
|
var pos = div.scrollTop();
|
|
|
|
div.scrollTop(pos + 2);
|
|
|
|
}, 200);
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-07 04:53:01 +00:00
|
|
|
//Animating progress bar for header
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
$(document).ready(function(){
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
var getMax = function(){
|
|
|
|
return $(document).height() - $(window).height();
|
|
|
|
}
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
var getValue = function(){
|
|
|
|
return $(window).scrollTop();
|
|
|
|
}
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
if('max' in document.createElement('progress')){
|
|
|
|
// Browser supports progress element
|
|
|
|
var progressBar = $('progress');
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
// Set the Max attr for the first time
|
|
|
|
progressBar.attr({ max: getMax() });
|
|
|
|
|
|
|
|
$(document).on('scroll', function(){
|
|
|
|
// On scroll only Value attr needs to be calculated
|
|
|
|
progressBar.attr({ value: getValue() });
|
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
$(window).resize(function(){
|
|
|
|
// On resize, both Max/Value attr needs to be calculated
|
|
|
|
progressBar.attr({ max: getMax(), value: getValue() });
|
2017-10-26 20:37:38 +00:00
|
|
|
});
|
2017-01-06 21:21:45 +00:00
|
|
|
}
|
|
|
|
else {
|
2017-10-26 20:37:38 +00:00
|
|
|
var progressBar = $('.progress-bar'),
|
|
|
|
max = getMax(),
|
2017-01-06 21:21:45 +00:00
|
|
|
value, width;
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
var getWidth = function(){
|
|
|
|
// Calculate width in percentage
|
2017-10-26 20:37:38 +00:00
|
|
|
value = getValue();
|
2017-01-06 21:21:45 +00:00
|
|
|
width = (value/max) * 100;
|
|
|
|
width = width + '%';
|
|
|
|
return width;
|
|
|
|
}
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
var setWidth = function(){
|
|
|
|
progressBar.css({ width: getWidth() });
|
|
|
|
}
|
2017-10-26 20:37:38 +00:00
|
|
|
|
2017-01-06 21:21:45 +00:00
|
|
|
$(document).on('scroll', setWidth);
|
|
|
|
$(window).on('resize', function(){
|
|
|
|
// Need to reset the Max attr
|
|
|
|
max = getMax();
|
|
|
|
setWidth();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
|
|
|
|
2016-09-19 18:04:51 +00:00
|
|
|
javascript:
|
2017-01-09 23:26:16 +00:00
|
|
|
|
2016-09-19 18:04:51 +00:00
|
|
|
$(document).foundation();
|
2016-09-23 13:26:22 +00:00
|
|
|
$('.try-demo').click(function(event){
|
|
|
|
event.stopPropagation();
|
|
|
|
$('.inspec-tutorial').show()
|
2016-09-26 12:32:27 +00:00
|
|
|
window.dispatchEvent(new Event('resizeTerminal'));
|
2016-09-23 13:26:22 +00:00
|
|
|
$('.quit-inspec-tutorial').click(function(event){
|
|
|
|
event.stopPropagation();
|
|
|
|
$('.inspec-tutorial').hide()
|
|
|
|
})
|
|
|
|
});
|
2017-10-26 20:37:38 +00:00
|
|
|
|
|
|
|
== javascript_include_tag "segment"
|