PageSourceSearch

https://hizb-ut-tahrir.info/ar/components/com_k2/js/k2.js?v2.6.9&sitepath=/ar/

js hizb-ut-tahrir.info collected 2026-10-02 05:30:17 UTC 8,080 bytes, 262 lines download raw bytes

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

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.