PageSourceSearch

http://kmaharjan.com.np/wp-content/themes/graphene/js/graphene.js?ver=5.1.19

js kmaharjan.com.np collected 2026-10-08 19:47:11 UTC 8,446 bytes, 212 lines download raw bytes

1jQuery(document).ready(function($) {
2	
3	/* Comments */
4	if ( grapheneJS.shouldShowComments ) {
5		$('li.comment .comment-permalink').hide();
6		$('.comment-wrap').hover( function(){ $('.comment-permalink', this).fadeIn(200); }, function(){ $('.comment-permalink:eq(0)', this).fadeOut(200); });
7		$('.comment-form-jump a').click(function(){ $('html,body').animate({scrollTop: $("#respond").offset().top - 200},'slow'); return false;});
8		// Tabbed comments
9		$("div#comments h4.comments a").click(function(){
10			$("div#comments .comments").addClass( 'current' );
11			$("div#comments .pings").removeClass( 'current' );
12			$("div#comments #pings_list").hide();
13			$("div#comments .comments-list-wrapper").fadeIn(300);
14			return false;
15		});
16		$("div#comments h4.pings a").click(function(){
17			$("div#comments .pings").addClass( 'current' );
18			$("div#comments .comments").removeClass( 'current' );
19			$("div#comments .comments-list-wrapper").hide();
20			$("div#comments #pings_list").fadeIn(300);
21			return false;
22		});
23	}
24	
25	
26	/* Graphene Slider */
27	if ( ! grapheneJS.sliderDisable ) {
28		grapheneJS.sliderTransSpeed = parseInt(grapheneJS.sliderTransSpeed);
29		grapheneJS.sliderInterval = parseInt(grapheneJS.sliderInterval);
30		if ( grapheneJS.sliderAnimation == 'horizontal-slide' ) {
31			$("#slider_root")
32				.scrollable({
33					circular: true,
34					clickable: false,
35					speed: grapheneJS.sliderTransSpeed
36				})
37				.navigator({	  
38					navi: '.slider_nav',
39					naviItem: 'a',
40					activeClass: 'active'                                                               
41				})
42				.autoscroll({
43					interval: grapheneJS.sliderInterval,
44					steps: 1, 
45					api: 'true'
46				});
47			$.graphene_slider = $("#slider_root").data("scrollable");
48			
49		} else {
50			if ( grapheneJS.sliderAnimation == 'vertical-slide' ) 	grapheneSliderEffect = 'slide';
51			else if ( grapheneJS.sliderAnimation == 'fade' )		grapheneSliderEffect = 'fade';
52			else if ( grapheneJS.sliderAnimation == 'none' )		grapheneSliderEffect = 'default';
53			
54			$( ".slider_nav" )
55					.jtTabs( ".slider_items > .slider_post", {
56						effect: grapheneSliderEffect,
57						fadeOutSpeed: grapheneJS.sliderTransSpeed,
58						fadeInSpeed: grapheneJS.sliderTransSpeed,
59						rotate: true,
60						current: 'active'
61					})
62					.slideshow({
63						autoplay: true,
64						clickable: false,
65						interval: grapheneJS.sliderInterval,
66						api: true
67					});
68			$.graphene_slider = $(".slider_nav").data("tabs");
69		}
70		// Preload slider background images
71		if ( grapheneJS.sliderDisplay == 'bgimage-excerpt' ) {
72			$('.slider_items .slider_post').each(function(){
73				var src = $(this).css('background-image').replace('url(', '').replace(')','');
74				if ( src.indexOf('http') == 0 ){
75					(new Image()).src = this;
76				}
77				src = null;
78			});
79		}
80	}
81				
82	
83	/* Infinite scroll for posts */
84	if ( grapheneJS.infScroll && ! grapheneJS.isSingular ) {
85		
86		window.grapheneInfScrollItemsLeft = grapheneJS.totalPosts - grapheneJS.postsPerPage;
87		var infScrollOptions = {
88					navSelector : ".post-nav",
89					nextSelector: ".post-nav .previous a",
90					itemSelector: ".entries-wrapper .hentry",
91					loading		: {
92										msgText		: grapheneGetInfScrollMessage('post',grapheneJS.postsPerPage,window.grapheneInfScrollItemsLeft),
93										finishedMsg	: grapheneJS.infScrollFinishedText,
94										img			: grapheneJS.templateUrl + '/images/inf-scroll-loader.gif',
95										speed		: 400
96									}
97			};
98		if ( grapheneJS.isPageNavi ) infScrollOptions.nextSelector = '.post-nav .nextpostslink';
99		if ( grapheneJS.infScrollClick ) infScrollOptions.animate = true;
100		else infScrollOptions.bufferPx = 400;
101		
102		$('.entries-wrapper').infinitescroll(infScrollOptions, function(newElems){
103			window.grapheneInfScrollItemsLeft -= parseInt(newElems.length);
104			if ( window.grapheneInfScrollItemsLeft == 0 ) {
105				if ( grapheneJS.infScrollClick ) {
106					$('.fetch-more').html(grapheneJS.infScrollFinishedText).addClass('fetch-more-disabled').removeAttr('href');
107				} else {
108					setTimeout(function(){
109						$('#infscr-loading').remove();
110						$('.entries-wrapper').append('<p id="infscr-loading-finished">' + grapheneJS.infScrollFinishedText + '</p>');
111					},400);
112				}
113				$('.entries-wrapper').infinitescroll('destroy');
114			} else {
115				setTimeout(function(){$('#infscr-loading div').html(grapheneGetInfScrollMessage('post',grapheneJS.postsPerPage,window.grapheneInfScrollItemsLeft))},400);
116			}
117		});
118		$('.post-nav').css('display','none');
119		
120		if ( grapheneJS.infScrollClick ) {
121			$('.entries-wrapper').infinitescroll('pause');
122			$('.fetch-more').click(function(e){
123				e.preventDefault();
124				$('.entries-wrapper').infinitescroll('retrieve');
125			});
126		}
127		
128	}
129	
130	
131	/* Infinite scroll for comments */
132	if ( grapheneJS.infScrollComments && grapheneJS.isSingular ) {
133		window.grapheneInfScrollCommentsLeft = grapheneJS.totalComments - grapheneJS.commentsPerPage;
134		var infScrollCommentsOptions = {
135				navSelector : ".comment-nav",
136				nextSelector: ".comment-nav .next",
137				itemSelector: "#comments_list > .comment",
138				loading		: {
139								msgText		: grapheneGetInfScrollMessage('comment',grapheneJS.commentsPerPage,window.grapheneInfScrollCommentsLeft),
140								finishedMsg	: grapheneJS.infScrollCommentsFinishedMsg,
141								img			: grapheneJS.templateUrl + '/images/inf-scroll-loader.gif',
142								speed		: 400
143							},
144				animate		: true,
145			};
146		if ( grapheneJS.commentsOrder == 'newest' ) {
147			infScrollCommentsOptions.direction = 'reverse';
148			infScrollCommentsOptions.nextSelector = ".comment-nav .prev";
149			
150			var currentPage = parseInt( $(infScrollCommentsOptions.navSelector+' .current').html() );
151			infScrollCommentsOptions.state = { currPage: currentPage };
152			
153			if ($(infScrollCommentsOptions.nextSelector).length > 0) {
154				var nextURI = $(infScrollCommentsOptions.nextSelector).attr('href');
155				var nextIndex = (currentPage-1).toString();
156				
157				var suffix = nextURI.slice(-(nextURI.length - nextURI.indexOf(nextIndex)-nextIndex.length));
158				var pathURI = nextURI.replace(nextIndex,'').replace(suffix,'');
159	
160				infScrollCommentsOptions.pathParse = function(path,nextPage){
161														path = [pathURI,suffix];
162														return path;
163													};
164			}
165		}
166		$('#comments_list').infinitescroll(infScrollCommentsOptions,
167			function(newElems){
168				window.grapheneInfScrollCommentsLeft -= parseInt(newElems.length);
169				if ( window.grapheneInfScrollCommentsLeft <= 0 ) {
170					$('.fetch-more').html(grapheneJS.infScrollCommentsFinishedMsg).addClass('fetch-more-disabled').removeAttr('href');
171						setTimeout(function(){
172							$('#infscr-loading').remove();
173							$('.entries-wrapper').append('<p id="infscr-loading-finished">' + grapheneJS.infScrollCommentsFinishedMsg + '</p>');
174						},400);
175					$('#comments_list').infinitescroll('destroy');
176				} else {
177					setTimeout(function(){$('#infscr-loading div').html(grapheneGetInfScrollMessage('comment',grapheneJS.commentsPerPage,window.grapheneInfScrollCommentsLeft))},400);
178				}
179			}
180		);
181		$('.comment-nav').css('display','none');
182		
183		$('#comments_list').infinitescroll('pause');
184		$('.fetch-more').click(function(e){
185			e.preventDefault();
186			$('#comments_list').infinitescroll('retrieve');
187		});
188	}
189});
190
191function grapheneGetInfScrollMessage(type,itemsPerLoad,itemsLeft){
192	type = typeof type !== 'undefined' ? type : 'post';
193	
194	if (itemsLeft < itemsPerLoad) itemsPerLoad = itemsLeft;
195	var message = '';
196	
197	if ( type == 'post' ) {
198		if (itemsLeft > 1)
199			message = grapheneJS.infScrollMsgTextPlural.replace('window.grapheneInfScrollItemsPerPage',itemsPerLoad).replace('window.grapheneInfScrollItemsLeft',itemsLeft);
200		else
201			message = grapheneJS.infScrollMsgText.replace('window.grapheneInfScrollItemsPerPage',itemsPerLoad).replace('window.grapheneInfScrollItemsLeft',itemsLeft);
202	}
203	
204	if ( type == 'comment' ) {
205		if (itemsLeft > 1)
206			message = grapheneJS.infScrollCommentsMsgPlural.replace('window.grapheneInfScrollCommentsPerPage',itemsPerLoad).replace('window.grapheneInfScrollCommentsLeft',itemsLeft);
207		else
208			message = grapheneJS.infScrollCommentsMsg.replace('window.grapheneInfScrollCommentsPerPage',itemsPerLoad).replace('window.grapheneInfScrollCommentsLeft',itemsLeft);
209	}
210	
211	return message;
212}

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.