PageSourceSearch

https://mebel-3d.ru/modules/mod_news_pro_gk4/interface/scripts/engine.js

js mebel-3d.ru collected 2026-09-25 18:41:04 UTC 5,711 bytes, 155 lines download raw bytes

1/**
2* Main script file
3* @package News Show Pro GK4
4* @Copyright (C) 2009-2012 Gavick.com
5* @ All rights reserved
6* @ Joomla! is Free Software
7* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
8* @version $Revision: GK4 1.4 $
9**/
10window.addEvent("load", function(){	
11	$$('.nspMain').each(function(module){	
12		if(!module.hasClass('activated')) {
13			module.addClass('activated');	
14			var $G = $Gavick[module.getProperty('id')];
15			var arts_actual = 0;
16			var list_actual = 0;
17			var arts_block_width = 0;
18			var links_block_width = 0;
19			var arts = module.getElements('.nspArt');
20			var links = (module.getElement('.nspLinkScroll1')) ? module.getElement('.nspLinkScroll1').getElements('li') : [];
21			var nspArtWidth = module.getElement('.nspArt') ? arts[0].getStyle('width') : null;
22			var arts_per_page = $G['news_column'] * $G['news_rows'];
23			var pages_amount = Math.ceil(arts.length / arts_per_page);
24			var links_pages_amount = Math.ceil(Math.ceil(links.length / $G['links_amount']) / $G['links_columns_amount']);
25			var hover_anim = module.hasClass('hover');
26			var animation = true;
27			var art_scroller;
28			var link_scroller;
29			var direction = module.getProperty('data-direction') == 'rtl' ? 'margin-right' : 'margin-left';
30			
31			var modInterface = { 
32				top: module.getElement('.nspTopInterface'), 
33				bottom: module.getElement('.nspBotInterface')
34			};
35			// arts
36			if(arts.length > 0){
37				arts_block_width = 100;
38				
39				art_scroller = new Fx.Tween(
40					module.getElement('.nspArtScroll2'), 
41					{
42						duration:$G['animation_speed'], 
43						wait:false, 
44						property: direction, 
45						unit: '%',
46						transition: $G['animation_function']
47					}
48				);
49			}
50			
51			// links
52			if(links.length > 0){
53				links_block_width = 100;
54				
55				link_scroller = new Fx.Tween(
56					module.getElement('.nspLinkScroll2'), 
57					{
58						duration:$G['animation_speed'], 
59						wait:false, 
60						property: direction,
61						unit: '%',
62						transition: $G['animation_function']
63					}
64				);
65			}
66			
67			// top interface
68			nsp_art_list(0, module, modInterface.top, pages_amount);
69			nsp_art_list(0, module, modInterface.bottom, links_pages_amount);
70			if(modInterface.top && modInterface.top.getElement('.nspPagination')){
71				modInterface.top.getElement('.nspPagination').getElements('li').each(function(item,i){
72					item.addEvent(hover_anim ? 'mouseenter' : 'click', function(){
73						art_scroller.start(-1 * i * arts_block_width);
74						arts_actual = i;
75						
76						nsp_art_list(i, module, modInterface.top, pages_amount);
77						animation = false;
78						(function(){animation = true;}).delay($G['animation_interval'] * 0.8);
79					});	
80				});
81			}
82			if(modInterface.top && modInterface.top.getElement('.nspPrev')){
83				modInterface.top.getElement('.nspPrev').addEvent("click", function(){
84					if(arts_actual == 0) arts_actual = pages_amount - 1;
85					else arts_actual--;
86					art_scroller.start(-1 * arts_actual * arts_block_width);
87					nsp_art_list(arts_actual, module, modInterface.top, pages_amount);
88					animation = false;
89					(function(){animation = true;}).delay($G['animation_interval'] * 0.8);
90				});
91				modInterface.top.getElement('.nspNext').addEvent("click", function(){
92					if(arts_actual == pages_amount - 1) arts_actual = 0;
93					else arts_actual++;
94					art_scroller.start(-1 * arts_actual * arts_block_width);
95					nsp_art_list(arts_actual, module, modInterface.top, pages_amount);
96					animation = false;
97					(function(){animation = true;}).delay($G['animation_interval'] * 0.8);
98				});
99			}
100			// bottom interface
101			if(modInterface.bottom && modInterface.bottom.getElement('.nspPagination')){
102				modInterface.bottom.getElement('.nspPagination').getElements('li').each(function(item,i){
103					item.addEvent(hover_anim ? 'mouseenter' : 'click', function(){
104						link_scroller.start(-1 * i * links_block_width);
105						list_actual = i;
106						
107						nsp_art_list(i, module, modInterface.bottom, links_pages_amount);
108					});	
109				});
110			}
111			if(modInterface.bottom && modInterface.bottom.getElement('.nspPrev')){
112				modInterface.bottom.getElement('.nspPrev').addEvent("click", function(){
113					if(list_actual == 0) list_actual = links_pages_amount - 1;
114					else list_actual--;
115					
116					link_scroller.start(-1 * list_actual * links_block_width);
117										
118					nsp_art_list(list_actual, module, modInterface.bottom, links_pages_amount);
119				});
120				
121				modInterface.bottom.getElement('.nspNext').addEvent("click", function(){
122					if(list_actual == links_pages_amount - 1) list_actual = 0;
123					else list_actual++;
124					link_scroller.start(-1 * list_actual * links_block_width);
125					
126					nsp_art_list(list_actual, module, modInterface.bottom, links_pages_amount);
127				});
128			}
129			if(module.hasClass('autoanim')){
130				(function(){
131					if(modInterface.top && modInterface.top.getElement('.nspNext')){
132						if(animation) modInterface.top.getElement('.nspNext').fireEvent("click");
133					}else{
134						if(arts_actual == pages_amount - 1) arts_actual = 0;
135						else arts_actual++;
136						
137						art_scroller.start(-1 * arts_actual * arts_block_width);
138						
139						nsp_art_list(arts_actual, module, modInterface.top, pages_amount);
140					}
141				}).periodical($G['animation_interval']);
142			}
143		}
144	});
145	function nsp_art_list(i, module, position, num){
146		if(position && position.getElement('.nspPagination')){
147			var pagination = position.getElement('.nspPagination');
148			pagination.getElements('li').setProperty('class', '');
149			pagination.getElements('li')[i].setProperty('class', 'active');
150		}
151		if(position && position.getElement('.nspCounter')){
152			position.getElement('.nspCounter').getElement('span').innerHTML =  (i+1) + ' / ' + num;
153		}
154	}
155});

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.