PageSourceSearch

https://xn--d1acodnbcsepw2g.xn--p1ai/templates/gk_news/js/gk.scripts.js

js xn--d1acodnbcsepw2g.xn--p1ai collected 2026-10-08 15:07:17 UTC 5,987 bytes, 199 lines download raw bytes

1/**
2 * jQuery Cookie plugin
3 *
4 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
5 * Dual licensed under the MIT and GPL licenses:
6 * http://www.opensource.org/licenses/mit-license.php
7 * http://www.gnu.org/licenses/gpl.html
8 *
9 */
10jQuery.noConflict();
11jQuery.cookie = function (key, value, options) {
12
13    // key and at least value given, set cookie...
14    if (arguments.length > 1 && String(value) !== "[object Object]") {
15        options = jQuery.extend({}, options);
16
17        if (value === null || value === undefined) {
18            options.expires = -1;
19        }
20
21        if (typeof options.expires === 'number') {
22            var days = options.expires, t = options.expires = new Date();
23            t.setDate(t.getDate() + days);
24        }
25
26        value = String(value);
27
28        return (document.cookie = [
29            encodeURIComponent(key), '=',
30            options.raw ? value : encodeURIComponent(value),
31            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
32            options.path ? '; path=' + options.path : '',
33            options.domain ? '; domain=' + options.domain : '',
34            options.secure ? '; secure' : ''
35        ].join(''));
36    }
37
38    // key and possibly options given, get cookie...
39    options = value || {};
40    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
41    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
42};
43
44/**
45 *
46 * Template scripts
47 *
48 **/
49
50jQuery(document).ready(function() {	
51	
52	// style area
53	if(jQuery('#gkStyleArea')){
54		jQuery('#gkStyleArea').find('a').each(function(i, element){
55			jQuery(element).click(function(e){
56	            e.preventDefault();
57	            e.stopPropagation();
58				changeStyle(i+1);
59			});
60		});
61		
62		jQuery('#gkBackgrounds').find('a').each(function(i, element){
63			element.addEvent('click',function(e){
64		        e.preventDefault();
65		        e.stopPropagation();
66				changeBg(i+1);
67			});
68		});
69	}
70	// font-size switcher
71	if(jQuery('#gkTools') && jQuery('#gkMainbody')) {
72		var current_fs = 100;
73		
74		jQuery('#gkMainbody').css('font-size', current_fs+"%");
75		
76		jQuery('#gkToolsInc').click(function(e){ 
77			e.stopPropagation();
78			e.preventDefault(); 
79			if(current_fs < 150) {  
80				jQuery('#gkMainbody').animate({ 'font-size': (current_fs + 10) + "%"}, 200); 
81				current_fs += 10; 
82			} 
83		});
84		jQuery('#gkToolsReset').click(function(e){ 
85			e.stopPropagation();
86			e.preventDefault(); 
87			jQuery('#gkMainbody').animate({ 'font-size' : "100%"}, 200); 
88			current_fs = 100; 
89		});
90		jQuery('#gkToolsDec').click(function(e){ 
91			e.stopPropagation();
92			e.preventDefault(); 
93			if(current_fs > 70) { 
94				jQuery('#gkMainbody').animate({ 'font-size': (current_fs - 10) + "%"}, 200); 
95				current_fs -= 10; 
96			} 
97		});
98	}
99	// login popup
100	if(jQuery('#gkPopupLogin')) {
101		var popup_overlay = jQuery('#gkPopupOverlay');
102		popup_overlay.css({'display': 'none', 'opacity' : 0});
103		
104		popup_overlay.fadeOut();
105		
106		jQuery('#gkPopupLogin').css({'display': 'block', 'opacity': 0, 'height' : 0});
107		var opened_popup = null;
108		var popup_login = null;
109		var popup_login_h = null;
110		var popup_login_fx = null;
111		
112		if(jQuery('#gkPopupLogin') && jQuery('#btnLogin')) {
113			popup_login = jQuery('#gkPopupLogin');
114			popup_login.css('display', 'block');
115			popup_login_h = popup_login.find('.gkPopupWrap').outerHeight();
116			 
117			jQuery('#gkLogin').click( function(e) {
118				e.preventDefault();
119				e.stopPropagation();
120				popup_overlay.css({'opacity' : 0.6});
121				popup_overlay.fadeIn('slow');
122				
123				popup_login.animate({'opacity':1, 'height': popup_login_h},200, 'swing');
124				opened_popup = 'login';
125				
126				(function() {
127					if(jQuery('#modlgn-username')) {
128						jQuery('#modlgn-username').focus();
129					}
130				}).delay(600);
131			});
132		}
133		
134		popup_overlay.click( function() {
135			if(opened_popup == 'login')	{
136				popup_overlay.fadeOut('slow');
137				popup_login.css({
138					'opacity' : 0,
139					'height' : 0
140				});
141			}
142		});
143	}
144});
145//
146jQuery(window).ready(function() {
147	// NSP header suffix
148	jQuery('.header').each(function(i, elm) {
149		if(elm.hasClass('box')) {
150			jQuery(elm).find('.nspArt').each(function(i, art) {
151				art = jQuery(art);
152				art.find('.nspImageWrapper').append(art.find('.nspHeader'));
153			});
154		}
155	});
156	// NSP nsphover suffix
157	jQuery('.nsphover').each(function(i,elm) {
158		if(elm.hasClass('box')) {
159			jQuery(elm).find('.nspArt').each(function(i, art) {
160				var overlay = jQuery('<div></div>');
161				overlay.attr('class', 'nspHoverOverlay');
162				//.appendTo(art);
163				var test = jQuery('<div></div>');
164				art = jQuery(art);
165				var info = art.find('.nspInfo1');
166				art.append(overlay);
167				overlay.append(art.find('.nspText'));
168				var copy = art.find('.nspHeader').clone();
169				overlay.prepend(copy);
170				
171				art.mouseenter(function() {
172					overlay.addClass('active');
173					if(info) {
174						info.addClass('active');
175					}
176				});
177				
178				art.mouseleave(function() {
179					overlay.removeClass('active');
180					if(info) {
181						info.removeClass('active');
182					}
183				});
184			});
185		}
186	});
187});
188
189
190// Function to change styles
191function changeStyle(style){
192	var file1 = $GK_TMPL_URL+'/css/style'+style+'.css';
193	var file2 = $GK_TMPL_URL+'/css/typography/typography.style'+style+'.css';
194	var file3 = $GK_TMPL_URL+'/css/typography/typography.iconset.style'+style+'.css';
195	jQuery('head').append('<link rel="stylesheet" href="'+file1+'" type="text/css" />');
196	jQuery('head').append('<link rel="stylesheet" href="'+file2+'" type="text/css" />');
197	jQuery('head').append('<link rel="stylesheet" href="'+file3+'" type="text/css" />');
198	jQuery.cookie('gk_news_j30_style', style, { expires: 365, path: '/' });
199}

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.