PageSourceSearch

https://www.quebecurbain.qc.ca/wordpress/wp-content/themes/qu2/js/global.js

js quebecurbain.qc.ca collected 2026-10-02 12:16:27 UTC 4,885 bytes, 158 lines download raw bytes

1/* ****************************************************
2
3	@file:		   global.js
4	@description:  Comportements globaux
5	@author:       remi (ixmedia.com)
6	@updated:	   20090605
7
8***************************************************** */
9
10$(document).ready(function() {
11
12	/**********************************************************
13	 *
14	 * Animation de la sous-navigation
15	 *
16	 *********************************************************/
17
18	//console.debug($);
19
20
21	//$('#sousnav > .inner:not('+href+')').hide();
22
23	if ( $('#sousnav .inner').filter('.active').length != 0 ) {
24		var actif = $('#sousnav .inner').filter('.active');
25	} else {
26		var actif = $('#sousnav .inner').eq(0);
27	}
28	var actif_id = actif.attr('id');
29	$('#sousnav > .inner').not('#'+actif_id).hide();
30
31	var href = $('#sousnav .menu a[href=#'+actif_id+']').height(24).parent().addClass('actif');
32
33	var anim_sousnav = false;
34	$('#sousnav .menu a').click(function() {
35		sousnav_afficher(this);
36		return false;
37	});
38
39	function sousnav_afficher(e) {
40		if (anim_sousnav === false) {
41			anim_sousnav = true;
42			var href = $(e).attr('href');
43
44			$(e)
45			.parent()
46			.addClass('actif')
47			.find('a')
48			.animate({height: '24px'},{duration: 300})
49			.parent()
50			.siblings()
51			.filter('.actif')
52			.removeClass('actif')
53			.find('a')
54			.animate({height: '18px'},{duration: 300});
55
56			// on cache l'élément actif
57			$('#sousnav > .inner')
58			.filter(':visible')
59			.not( document.getElementById( href.replace(/#/,'')) )
60			.slideUp(300);
61
62			// on affiche le nouvel élément
63			$('#sousnav > .inner')
64			.filter( href )
65			.slideDown(300, function() {
66				anim_sousnav = false;
67			});
68		}
69	}
70
71	$('#blogroll > ul > li:last-child').addClass("dernier");
72
73	$('.actions-feeds .form .fermer').click(function() {
74		$(this).parent().slideUp(300);
75	});
76
77	$('div.commentaire a.denoncer').click(function() {
78		if ($(this).is('.inactif')) { return false; }
79		$(this).parents('.comment-content').find('.denoncer-form').slideToggle(300, function() {
80			if ($(this).is(':visible')) {
81				$(this).find('textarea').focus();
82			}
83		});
84
85		return false;
86	});
87	$('div.denoncer-form button').click(function() {
88		var $this = $(this);
89
90		if (!confirm('Êtes-vous certain de vouloir dénoncer ce commentaire?')) {
91			//$this.parents('div.comment-content').find('.denoncer-form').slideUp(300);
92			return false;
93		}
94
95		$.ajax({
96			url : $(this).parents('div.comment-content').find('a.denoncer').attr('href'),
97			type : 'POST',
98			data : {
99				'submit' : 'submit',
100				'comment' : $(this).prev().val()
101			},
102			success: function(data) {
103				var div = $this.parents('div.comment-content').find('.denoncer-form');
104				$this.parents('div.comment-content').find('a.denoncer').addClass('inactif').css('opacity', 0.5);
105				div.html(data);
106				setTimeout(function() {
107					div.slideUp(300);
108				}, 2000)
109			}
110		});
111		return false;
112	});
113	$('div.denoncer-form a').click(function() {
114		$(this).parent().parent().slideUp(300);
115	});
116
117	$('#archives select').change(function() {
118		window.location = $(this).val();
119	})
120
121});
122var docCookies = {
123  getItem: function (sKey) {
124    return unescape(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
125  },
126  setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
127    if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; }
128    var sExpires = "";
129    if (vEnd) {
130      switch (vEnd.constructor) {
131        case Number:
132          sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
133          break;
134        case String:
135          sExpires = "; expires=" + vEnd;
136          break;
137        case Date:
138          sExpires = "; expires=" + vEnd.toGMTString();
139          break;
140      }
141    }
142    document.cookie = escape(sKey) + "=" + escape(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
143    return true;
144  },
145  removeItem: function (sKey, sPath) {
146    if (!sKey || !this.hasItem(sKey)) { return false; }
147    document.cookie = escape(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sPath ? "; path=" + sPath : "");
148    return true;
149  },
150  hasItem: function (sKey) {
151    return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
152  },
153  keys: /* optional method: you can safely remove it! */ function () {
154    var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
155    for (var nIdx = 0; nIdx < aKeys.length; nIdx++) { aKeys[nIdx] = unescape(aKeys[nIdx]); }
156    return aKeys;
157  }
158};

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.