var $ = jQuery = require("jquery"); require("../node_modules/bootstrap-sass/assets/javascripts/bootstrap/affix.js"); require("../node_modules/bootstrap-sass/assets/javascripts/bootstrap/scrollspy.js"); /** * only use for documentation page. The demo page (containing YASQE and YASR) might show some issues when adding these scroll tricks to hrefs */ if (location.pathname.indexOf('doc') >= 0) { $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 400); return false; } } }); }); } $(document).ready(function() { //get the latest hosted version if ($("#cdnDownload").length > 0) { var name = "yasqe"; //only draw when we've got some place to print this info (might not be on all pages where we include this js file) $.get("http://api.jsdelivr.com/v1/jsdelivr/libraries?name=" + name + "&fields=lastversion", function(data) { if (data.length > 0) { var version = data[0].lastversion; $("#" + name + "Css").text(""); $("#" + name + "JsBundled").text("