PageSourceSearch

https://www.tomacine.com/components/com_k2/js/k2.js

js tomacine.com collected 2026-09-25 01:15:26 UTC 7,542 bytes, 231 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/**
11 * @version		$Id: k2.js 1492 2012-02-22 17:40:09Z [email protected] $
12 * @package		K2
13 * @author		JoomlaWorks http://www.joomlaworks.net
14 * @copyright	Copyright (c) 2006 - 2012 JoomlaWorks Ltd. All rights reserved.
15 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
16 */
17
18var $K2 = jQuery.noConflict();
19
20$K2(document).ready(function(){
21
22	// Comments
23	$K2('#comment-form').submit(function(event){
24		event.preventDefault();
25		$K2('#formLog').empty().addClass('formLogLoading');
26		$K2.ajax({
27			url: $K2('#comment-form').attr('action'),
28			type: 'post',
29			dataType: 'json',
30			data: $K2('#comment-form').serialize(),
31			success: function(response){
32				$K2('#formLog').removeClass('formLogLoading').html(response.message);
33				if(typeof(Recaptcha) != "undefined"){
34					Recaptcha.reload();
35				}
36				if (response.refresh) {
37					window.location.reload();
38				}
39			}
40		});
41	});
42	
43	$K2('.commentRemoveLink').click(function(event){
44		event.preventDefault();
45		var element = $K2(this);
46		$K2(element).parent().addClass('commentToolbarLoading');
47		$K2.ajax({
48			url: $K2(element).attr('href'),
49			type: 'post',
50			data: $K2('#comment-form input:last').serialize(),
51			success: function(response){
52				$K2(element).parent().removeClass('commentToolbarLoading');
53				if(response=='true'){
54					$K2(element).parent().parent().remove();
55				}
56			}
57		});
58	});
59	
60	$K2('.commentApproveLink').click(function(event){
61		event.preventDefault();
62		var element = $K2(this);
63		$K2(element).parent().addClass('commentToolbarLoading');
64		$K2.ajax({
65			url: $K2(element).attr('href'),
66			type: 'post',
67			data: $K2('#comment-form input:last').serialize(),
68			success: function(response){
69				$K2(element).parent().removeClass('commentToolbarLoading');
70				if(response=='true'){
71					$K2(element).parent().parent().removeClass('unpublishedComment');
72				}
73			}
74		});
75	});
76	
77	$K2('.k2ReportUserButton').click(function(event){
78		event.preventDefault();
79		if (confirm(K2Language[0])) {
80			var element = $K2(this);
81			$K2(element).parent().addClass('commentToolbarLoading');
82			$K2.ajax({
83				url: $K2(element).attr('href'),
84				type: 'GET',
85				success: function(response){
86					$K2(element).parent().removeClass('commentToolbarLoading');
87					alert(response);
88				}
89			});
90		}
91
92	});
93	
94	$K2('#k2ReportCommentForm').submit(function(event){
95		event.preventDefault();
96		$K2('#formLog').empty().addClass('formLogLoading');
97		$K2.ajax({
98			url: $K2('#k2ReportCommentForm').attr('action'),
99			type: 'post',
100			data: $K2('#k2ReportCommentForm').serialize(),
101			success: function(response){
102				$K2('#formLog').removeClass('formLogLoading').html(response);
103				if(typeof(Recaptcha) != "undefined"){
104					Recaptcha.reload();
105				}
106			}
107		});
108	});
109
110	// Text Resizer
111	$K2('#fontDecrease').click(function(event){
112		event.preventDefault();
113		$K2('.itemFullText').removeClass('largerFontSize');
114		$K2('.itemFullText').addClass('smallerFontSize');
115	});
116	$K2('#fontIncrease').click(function(event){
117		event.preventDefault();
118		$K2('.itemFullText').removeClass('smallerFontSize');
119		$K2('.itemFullText').addClass('largerFontSize');
120	});
121
122	// Smooth Scroll
123	$K2('.k2Anchor').click(function(event){
124		event.preventDefault();
125		var target = this.hash;
126		$K2('html, body').stop().animate({
127			scrollTop: $K2(target).offset().top
128		}, 500);
129	});
130
131	// Rating
132	$K2('.itemRatingForm a').click(function(event){
133		event.preventDefault();
134		var itemID = $K2(this).attr('rel');
135		var log = $K2('#itemRatingLog' + itemID).empty().addClass('formLogLoading');
136		var rating = $K2(this).html();
137		$K2.ajax({
138			url: K2SitePath+"index.php?option=com_k2&view=item&task=vote&format=raw&user_rating=" + rating + "&itemID=" + itemID,
139			type: 'get',
140			success: function(response){
141				log.removeClass('formLogLoading');
142				log.html(response);
143				$K2.ajax({
144					url: K2SitePath+"index.php?option=com_k2&view=item&task=getVotesPercentage&format=raw&itemID=" + itemID,
145					type: 'get',
146					success: function(percentage){
147						$K2('#itemCurrentRating' + itemID).css('width', percentage + "%");
148						setTimeout(function(){
149							$K2.ajax({
150								url: K2SitePath+"index.php?option=com_k2&view=item&task=getVotesNum&format=raw&itemID=" + itemID,
151								type: 'get',
152								success: function(response){
153									log.html(response);
154								}
155							});
156						}, 2000);
157					}
158				});
159			}
160		});
161	});
162
163	// Classic popup
164	$K2('.classicPopup').click(function(event){
165		event.preventDefault();
166		if($K2(this).attr('rel')){
167			var json = $K2(this).attr('rel');
168			json = json.replace(/'/g, '"');
169			var options = $K2.parseJSON(json);
170		} else {
171			var options = {x:900,y:600}; /* use some default values if not defined */
172		}
173		window.open($K2(this).attr('href'),'K2PopUpWindow','width='+options.x+',height='+options.y+',menubar=yes,resizable=yes');
174	});
175	
176	// Live search
177	$K2('div.k2LiveSearchBlock form input[name=searchword]').keyup(function(event){
178		var parentElement = $K2(this).parent().parent();
179		if($K2(this).val().length>3 && event.key!='enter'){
180			$K2(this).addClass('k2SearchLoading');
181			parentElement.find('.k2LiveSearchResults').css('display','none').empty();
182			parentElement.find('input[name=t]').val($K2.now());
183			parentElement.find('input[name=format]').val('raw');
184			var url = 'index.php?option=com_k2&view=itemlist&task=search&' + parentElement.find('form').serialize();
185			parentElement.find('input[name=format]').val('html');
186			$K2.ajax({
187				url: url,
188				type: 'get',
189				success: function(response){
190					parentElement.find('.k2LiveSearchResults').html(response);
191					parentElement.find('input[name=searchword]').removeClass('k2SearchLoading');
192					parentElement.find('.k2LiveSearchResults').css('display', 'block');
193				}
194			});
195		} else {
196			parentElement.find('.k2LiveSearchResults').css('display','none').empty();
197		}
198	});
199
200	// Calendar
201	$K2('a.calendarNavLink').live('click', function(event){
202		event.preventDefault();
203		var parentElement = $K2(this).parent().parent().parent().parent();
204		var url = $K2(this).attr('href');
205		parentElement.empty().addClass('k2CalendarLoader');
206		$K2.ajax({
207			url: url,
208			type: 'post',
209			success: function(response){
210				parentElement.html(response);
211				parentElement.removeClass('k2CalendarLoader');
212			}
213		});
214	});
215	
216	// Generic Element Scroller (use .k2Scroller in the container and .k2ScrollerElement for each contained element)
217	$K2('.k2Scroller').css('width',($K2('.k2Scroller').find('.k2ScrollerElement:first').outerWidth(true))*$K2('.k2Scroller').children('.k2ScrollerElement').length);
218
219});
220
221// Equal block heights for the "default" view
222$K2(window).load(function () {
223	var blocks = $K2('.subCategory, .k2EqualHeights');
224	var maxHeight = 0;
225	blocks.each(function(){
226		maxHeight = Math.max(maxHeight, parseInt($K2(this).css('height')));
227	});
228	blocks.css('height', maxHeight);
229});
230
231}

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.