PageSourceSearch

https://cogito2012.github.io/js/pc.js

js cogito2012.github.io collected 2026-10-03 08:49:02 UTC 1,927 bytes, 100 lines download raw bytes

1define([], function(){
2
3	var Tips = (function(){
4
5		var $tipBox = $(".tips-box");
6
7		return {
8			show: function(){
9				$tipBox.removeClass("hide");
10			},
11			hide: function(){
12				$tipBox.addClass("hide");
13			},
14			init: function(){
15				
16			}
17		}
18	})();
19
20	var resetTags = function(){
21		var tags = $(".tagcloud a");
22		tags.css({"font-size": "12px"});
23		for(var i=0,len=tags.length; i<len; i++){
24			var num = tags.eq(i).html().length % 5 +1;
25			tags[i].className = "";
26			tags.eq(i).addClass("color"+num);
27		}
28	}
29
30	var slide = function(idx){
31		var $wrap = $(".switch-wrap");
32		$wrap.css({
33			"transform": "translate(-"+idx*100+"%, 0 )"
34		});
35		$(".icon-wrap").addClass("hide");
36		$(".icon-wrap").eq(idx).removeClass("hide");
37	}
38
39	var bind = function(){
40		var switchBtn = $("#myonoffswitch");
41		var tagcloud = $(".second-part");
42		var navDiv = $(".first-part");
43		switchBtn.click(function(){
44			if(switchBtn.hasClass("clicked")){
45				switchBtn.removeClass("clicked");
46				tagcloud.removeClass("turn-left");
47				navDiv.removeClass("turn-left");
48			}else{
49				switchBtn.addClass("clicked");
50				tagcloud.addClass("turn-left");
51				navDiv.addClass("turn-left");
52				resetTags();
53			}
54		});
55
56		var timeout;
57		var isEnterBtn = false;
58		var isEnterTips = false;
59
60		$(".icon").bind("mouseenter", function(){
61			isEnterBtn = true;
62			Tips.show();
63		}).bind("mouseleave", function(){
64			isEnterBtn = false;
65			setTimeout(function(){
66				if(!isEnterTips){
67					Tips.hide();
68				}
69			}, 100);
70		});
71
72		$(".tips-box").bind("mouseenter", function(){
73			isEnterTips = true;
74			Tips.show();
75		}).bind("mouseleave", function(){
76			isEnterTips = false;
77			setTimeout(function(){
78				if(!isEnterBtn){
79					Tips.hide();
80				}
81			}, 100);
82		});
83
84		$(".tips-inner li").bind("click", function(){
85			var idx = $(this).index();
86			slide(idx);
87			Tips.hide();
88		});
89	}
90
91	
92
93	return {
94		init: function(){
95			resetTags();
96			bind();
97			Tips.init();
98		}
99	}
100});

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.