PageSourceSearch

https://www.steveferris.com/js/menu.js

js steveferris.com collected 2026-09-27 04:29:30 UTC 1,523 bytes, 35 lines download raw bytes

1	//Collapse / toggle folders in the menu
2    // Hide the sub menu items first
3    $("div#menu > ol > li.folder").next("ol").hide();
4
5    // On click
6    $('div#menu > ol > li.folder').click(function() {
7        if($(this).next('ol')) {
8            $('ol', $(this).next("ol").slideToggle(300));
9            return false;
10        } else {
11            return true;
12        }
13    });
14    
15    
16    //This function will add the class "selected" to any links (even relative) that point to the current page.
17    $(function(){
18	    
19
20	       $("div#menu").find("a").each(function(){
21		       		//Match based on: #1 - if the url of the menu link is the same as the current URL
22		       		  //#2 - if the text of the menu link is the same as the ID of a hidden div (inserted when viewing an image)
23		       		  //#3 - if the current menu link has 'blog' class and the url contains the word '/blog/'
24	               if ($(this).attr("href") == window.location.pathname || (typeof $(this).attr("id") != 'undefined' && $(this).attr("id") == $(".gallery_name").attr("id")) || ($(this).attr("class") == "blog" && window.location.pathname.indexOf("/blog/") != -1)){
25	                       $(this).addClass("selected");
26	                       //If the href is inside a folder, then show it!
27	                       if ($(this).parent().parent().prev().attr("class") == "folder"){
28		                       $(this).parent().parent().show();
29	                       }
30	               }
31	       });
32
33	});
34	
35	

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.