diff --git a/assets/script/dynamicscrollspy.min.js b/assets/script/dynamicscrollspy.min.js new file mode 100644 index 0000000..a3d976a --- /dev/null +++ b/assets/script/dynamicscrollspy.min.js @@ -0,0 +1,5 @@ +/** +* AutoScrollspy v 0.2.0 +* https://github.com/psalmody/dynamic-scrollspy +*/ +!function($){$.fn.DynamicScrollspy=function(opts){function encodeHTML(value){return $("
").text(value).html()}function selectAllH(){for(var st=[],i=self.options.tH;i<=self.options.bH;i++)st.push("H"+i);return $(st.join(",")).not(self.options.exclude)}function randID(){function rand(){r=Math.floor(900*Math.random())+100}var r;for(rand();self.rands.indexOf(r)>=0;)rand();return self.rands.push(r),r}function genIDs(){selectAllH().prop("id",function(){return""===$(this).prop("id")?$(this).prop("tagName")+randID():$(this).prop("id")})}function checkIDs(){var missing=0;if(selectAllH().each(function(){if(""===$(this).prop("id"))missing++;else if($('[id="'+$(this).prop("id")+'"]').length>1)throw new Error("DynamicScrollspy: Error! Duplicate id "+$(this).prop("id"))}),missing>0){var msg="DynamicScrollspy: Not all headers have ids and genIDs: false.";throw new Error(msg)}return missing}function showTesting(){selectAllH().append(function(){return" ("+$(this).prop("tagName")+", "+$(this).prop("id")+")"})}function makeTree(){var tree=self.tree;return $("H"+self.options.tH).not(self.options.exclude).each(function(){tree[$(this).prop("id")]={dstext:encodeHTML($(this).text()),jqel:$(this)}}),self.options.tH+1<=self.options.bH&&itCreateTree(tree),tree}function itCreateTree(what){for(var k in what)if(""!==k&&"dstext"!=k&&"jqel"!=k){var lvl=Number($("#"+k).prop("tagName").replace("H",""));if(lvl>=self.options.bH)return!1;$("#"+k).nextUntil("H"+lvl).filter("H"+(lvl+1)).not(self.options.exclude).each(function(){what[k][$(this).prop("id")]={dstext:encodeHTML($(this).text()),jqel:$(this)}}),lvlTbh, idk what other project to put here, we'll have to figure it our later
diff --git a/views/pages/projects/project_template.ejs b/views/pages/projects/project_template.ejs index 632af3f..46137b3 100644 --- a/views/pages/projects/project_template.ejs +++ b/views/pages/projects/project_template.ejs @@ -15,10 +15,10 @@