PageSourceSearch

http://villedecorps.fr/include/main.js

js villedecorps.fr collected 2026-10-02 08:15:33 UTC 10,215 bytes, 227 lines download raw bytes

1var link_this='';
2var link_this_data='';
3var link_previous='';
4var link_previous_data='';
5var popup=false; var popup2=false; var popup3=false;
6var reloadthispage=0;
7
8(function($) {
9    $.fn.hideText = function() {
10        this.html(function() {
11            var $this = $(this);
12            $this.attr('data-oldtext', $this.html());
13            return ' ';
14        });
15        return this;
16    };
17    $.fn.showText = function() {
18        this.html(function() {
19            var $this = $(this);
20            return $this.attr('data-oldtext') || $this.html();
21        });
22        return this;
23    };
24})(jQuery);
25
26
27function news(){
28	//$('#portal_news_js').html($("#portal_news_list li:random").text());
29	$('#portal_news_js').html($("#portal_news_list li:order").text());
30	$('#portal_news_js').fadeIn(2000, function(){
31		$('#portal_news_js').fadeOut(5000, function(){
32			news();
33		});
34	});
35}
36jQuery.newsPos = 0;
37jQuery.extend(jQuery.expr[":"],
38{
39    random: function(a, i, m, r) { if (i == 0) { jQuery.newsPos = Math.floor(Math.random() * r.length); }; return i == jQuery.newsPos; }
40    , order: function(a, i, m, r) { if (i == 0) { jQuery.newsPos++; if (jQuery.newsPos == r.length + 1) jQuery.newsPos = 1; }; return i == jQuery.newsPos - 1;  }
41});
42
43
44$(document).ready(function(){
45	$.ajaxSetup({type:'GET',data:'',success:function(msg){jParse(msg);}});
46	$(document).keyup(function(e){if(e.keyCode==27){closepopup();}});
47	$('#mainmenu').find('a').addClass('navbarlink');
48	$('#contextmenu').find('a').addClass('navbarlink');
49	
50	$('a.js').click(function(){fade=true;$(this).css("visibility","hidden").css({opacity:0});$("#loadingbar").fadeIn(250);address(this.href);$.ajax({url:link_this,data:link_this_data,context:this,complete:function(){$(this).css("visibility","visible").animate({opacity:1});}});return false;});
51	$('a.js_nofade').click(function(){fade=false;$(this).css("visibility","hidden").css({opacity:0});$("#loadingbar").fadeIn(250);address(this.href);$.ajax({url:link_this,data:link_this_data,context:this,complete:function(){$(this).css("visibility","visible").animate({opacity:1});}});return false;});
52	$('.popupexit').click(function(){closepopup();return false;});$('.popup2exit').click(function(){closepopup2();return false;});$('.popup3exit').click(function(){closepopup3();return false;});
53	if(reloadthispage == 1){address(''+window.location+'');$.ajax({url:link_this,data:link_this_data});}
54	
55	//alert(reloadthispage);	
56	$('#search-input').focus(function(){if (this.value === "Rechercher") this.value = "";});
57	$('#search-input').blur(function(){if (this.value === "") this.value = "Rechercher";});
58	
59	$('#search_input_old_articles').focus(function(){if (this.value === "Rechercher dans les anciens articles") this.value = "";});
60	$('#search_input_old_articles').blur(function(){if (this.value === "") this.value = "Rechercher dans les anciens articles";});
61	news();
62	
63	$('#models').hide();
64	$('#logo').mouseover(function(){$('#models').fadeIn(500);return false;});
65	
66	//$('#meteo').weatherfeed(['FRXX0055']);
67	$(function(){
68		var shuffle = function(){ return 1; };
69		var clocks = [];
70		for (var skin in CoolClock.config.skins) {
71			if (skin != 'chunkySwissOnBlack') {
72				clocks.push('<div style="float:left;" class="clock"><canvas class="CoolClock:'+skin+'"                ></canvas></div>');
73			}
74		}
75		// shuffle three times for luck
76		$('#demo').append(clocks.join('\n'));
77		CoolClock.findAndCreateClocks();
78	});
79	
80	
81	var login_keya = 0;
82	var login_keyb = 0;
83	$(document).keydown(function(e){		
84		switch(e.keyCode) {
85			case 65 : case 83 : case 67: login_keya++; break;
86			case 86 : case 77 : case 69: login_keyb++; break;
87			default: login_keya = login_keyb = 0; break;
88		}
89		
90		if (login_keya === 3 || login_keyb === 3) {
91			login_keya = login_keyb = 0;
92			e.preventDefault(); $.ajax({type:'GET',url:'login.php'});
93		}
94		
95	});
96	$(document).keyup(function(e){
97		login_keya = login_keyb = 0;
98	});
99});
100
101function portalscoller(prev) {
102	var current_image = $('#portal_gallery li.selected').length ? $('#portal_gallery li.selected') : $('#portal_gallery li:first');
103	if (prev) {var next_image = (current_image.prev().length) ? current_image.prev() : $('#portal_gallery li:last');}
104	else {var next_image = (current_image.next().length) ? current_image.next() : $('#portal_gallery li:first');}
105	$('#portal_gallery li').removeClass('selected');
106	next_image.addClass('selected');
107	$('#mask_portal_gallery').scrollTo(next_image, 800);
108}
109
110function addslashes(str)
111{
112	return (str+'').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
113}
114
115
116var fade = true;
117var ckeditor_instance = ckeditor_instance2 = ckeditor_instance3 = '';
118function jParse(msg)
119{
120	ajax_timeout=false;
121	$('#loadingbar').hide();
122	$('*.error').html('');
123	
124	var vars=eval('('+msg+')');
125	for(var i in vars)
126	{
127		if(vars[i].target=='debug'){
128			$('#debug').hide();
129			debug(vars[i].content);
130			$('#debug').fadeIn(250);
131		}
132		else if(vars[i].target=='phpdebug')phpdebug(vars[i].content);
133		else
134		{
135			switch(vars[i].target)
136			{
137				case 'popupleft': case 'popup2left': case 'popup3left': break;
138				case 'popupwidth': $("#popup").css({width:vars[i].content+'px',left:-vars[i].content/2
138+'px',top:$(document).scrollTop()}); break;
139				case 'popup2width': $("#popup2").css({width:vars[i].content+'px',left:-vars[i].content/2+'px',top:$(document).scrollTop()}); break;
140				case 'popup3width': $("#popup3").css({width:vars[i].content+'px',left:-vars[i].content/2+'px',top:$(document).scrollTop()}); break;
141				case 'popupcontextmenu':if(!popup)popup=true;$('#'+vars[i].target).html(vars[i].content);break;
142				case 'popup2contextmenu':if(!popup2)popup2=true;$('#'+vars[i].target).html(vars[i].content);break;
143				case 'popup3contextmenu':if(!popup3)popup3=true;$('#'+vars[i].target).html(vars[i].content);break;
144				case 'popupcontent':if(!popup)popup=true;$('#'+vars[i].target).html(vars[i].content);break;
145				case 'popup2content':if(!popup2)popup2=true;$('#'+vars[i].target).html(vars[i].content);break;
146				case 'popup3content':if(!popup3)popup3=true;$('#'+vars[i].target).html(vars[i].content);break;
147				case 'closepopup': closepopup();break;
148				case 'closepopup2':closepopup2();break;
149				case 'closepopup3':closepopup3();break;
150				
151				case 'successbox':
152						$('#successbox').html(vars[i].content);
153						$('#successbox').fadeIn(500).delay(2000).fadeOut(500);
154					break;
155				case 'pagename':
156					if ($('#'+vars[i].content).hasClass('navbarlink') || $('#'+vars[i].content).hasClass('contextmenu'))
157					{
158						$('.thisbutton').removeClass('thisbutton');
159						$('#'+vars[i].content).addClass('thisbutton');
160					}
161					break;
162				
163				case 'nextpage':
164					window.location = vars[i].content;
165					break;
166				
167				default:
168					if($('#'+vars[i].target).length != 0)$('#'+vars[i].target).html(vars[i].content);
169					//else debugadd(vars[i].target+' n\'existe pas!');
170					break;
171			}
172			if(fade){if(vars[i].target!='contextmenu'){$("#"+vars[i].target).css({ opacity: 0 }).animate({opacity:1}, 500);}}
173			$('#'+vars[i].target+' a.js').click(function(){fade=true;$(this).css("visibility","hidden").css({opacity:0});$("#loadingbar").fadeIn(250);address(this.href);$.ajax({url:link_this,data:link_this_data,context:this,complete:function(){$(this).css("visibility","visible").animate({opacity:1});}});return false;});
174			$('#'+vars[i].target+' a.js_nofade').click(function(){fade=false;$(this).css("visibility","hidden").css({opacity:0});$("#loadingbar").fadeIn(250);address(this.href);$.ajax({url:link_this,data:link_this_data,context:this,complete:function(){$(this).css("visibility","visible").animate({opacity:1});}});return false;});
175			
176			$('#'+vars[i].target+' .popupexit').click(function(){closepopup();return false;});
177			$('#'+vars[i].target+' .popup2exit').click(function(){closepopup2();return false;});
178			$('#'+vars[i].target+' .popup3exit').click(function(){closepopup3();return false;});
179			
180			$('#'+vars[i].target+' form').not('.file_upload').unbind("submit").submit(function(){fade=true;address($(this).attr('action')+'?'+$(this).serialize());$.ajax({type:'POST',url:link_this,data:link_this_data});return false;});
181			
182			$('#contextmenu').find('a').addClass('navbarlink');
183		}
184	}
185	if(popup){ckeditor_instance = $('textarea.ckeditor').ckeditor();$('#popupcontentmask').fadeTo(250,0.8);$("#popup").fadeIn(250);popup=false;}
186	if(popup2){ckeditor_instance2 = $('textarea.ckeditor2').ckeditor();$("#popup2").fadeIn(250);popup2=false;}
187	if(popup3){ckeditor_instance3 = $('textarea.ckeditor3').ckeditor();$("#popup3").fadeIn(250);popup3=false;}
188	$("#loadingbar").fadeOut(250);
189	fade=true;
190}
191function winLoading(){if (ajax_timeout==true) $("#ciQueryAjaxBox").html('<div style="text-align:center;margin-top:40px;"><img src="{imagesfolder}/chargement.gif" /><br /><span style="color:#297308;font-weight:bold">Chargement en cours</span</div>');}
192
193
194var ajax_timeout;
195function loading(){if (ajax_timeout==true) $("#loadingbar").show();}
196
197function closepopup(){if ($('textarea.ckeditor').length != 0) {ckeditor_instance.ckeditorGet().destroy();};popup=false;$("#popupcontentmask").fadeOut(250);$("#popup").fadeOut(250);}
198function closepopup2(){if ($('textarea.ckeditor2').length != 0) {ckeditor_instance2.ckeditorGet().destroy();}popup2=false;$("#popup2").fadeOut(250);}
199function closepopup3(){if ($('textarea.ckeditor3').length != 0) {ckeditor_instance3.ckeditorGet().destroy();}popup3=false;$("#popup3").fadeOut(250);}
200
201function address(source)
202{
203	ajax_timeout=true;setTimeout(loading,250);
204	if(source!='')link=source.split('?');	
205	link_previous=link_this;
206	link_previous_data=link_this_data;
207	
208	link_this=link[0];
209	link_this_data=(link[1])?link[1]+'&js=1':'js=1';
210}
211
212function debug(text){$('#debug').html(text);}
213function debugadd(text){$('#debug').append('<p style="padding:5px 2px;margin-bottom:10px;border-bottom:1px solid #000;">'+text+'<p>');}
214function phpdebug(text){$('#debug').append(text);}
215
216/**stylesheet modifier*/
217(function($){
218   $.getCSS = function( url, media ){
219      $(document.createElement('link') ).attr({
220          href: url,
221          media: media || 'screen',
222          type: 'text/css',
223          rel: 'stylesheet'
224      }).appendTo('head');
225   }
226})(jQuery);
227//jQuery.getCSS("echo/css/style.css");

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.