PageSourceSearch

https://www.nery.fr/wp-content/plugins/novacity-co-marquage-service-public/assets/js/comarquage.js?ver=0.5.1.2

js nery.fr collected 2026-10-02 23:45:30 UTC 3,375 bytes, 119 lines download raw bytes

1/* Kienso - jQuery for co-marquage */
2
3jQuery(function($) {
4
5	$( document ).ready( function () {
6
7		var initGMaps = function ( el ) {
8			el.each( function () {
9
10				var $this = $( this );
11				// Google exists
12				if ( typeof google != 'undefined' && google.maps != 'undefined' ) {
13					
14					var org_mark = {
15						lat: parseFloat( $this.attr('data-gmaps-lat') ),
16						lng: parseFloat( $this.attr('data-gmaps-lon') )
17					};
18
19					var map = new google.maps.Map( document.getElementById( $this.attr( 'id' ) ), {
20						zoom: parseInt( $this.attr('data-gmaps-zoom') ) + 8,
21						center: org_mark
22					} );
23
24					var marker = new google.maps.Marker( {
25						position: org_mark,
26						map: map
27					} );
28
29				// If osm exists
30				} else if ( $.isFunction( $.fn.osm ) ) {
31
32					var options = {};
33					options.setMaxZoom = 5;
34					options.maxZoom = 5;
35					
36					// Set markers
37					options.markers = [{
38						lat: parseFloat( $this.attr('data-gmaps-lat') ),
39						lng: parseFloat( $this.attr('data-gmaps-lon') ),
40					}];
41
42					// Set OSM Maps
43					$this.osm( options )
44
45				}
46			} );
47		}
48
49
50		/* TABS */
51		$('#comarquage [data-action="tab"]').click(function(event) {
52
53			// Change tab
54			$(this).closest('.tabs').find('> .nav-tabs > li').removeClass('active');
55			$(this).addClass('active');
56
57			// Change content
58			$(this).closest('.tabs').find('> .tab-content > .tab-pane').removeClass('active');
59			var target = $(this).data('target');
60			$(target).addClass('active');
61
62			initGMaps($(target).find('.co-org-maps'));
63		});
64
65		/* SLIDES / COLLAPSE */
66		$('#comarquage [data-action="slide"]').click(function(event) {
67			$(this).toggleClass('active');
68			var target = $(this).data('target');
69			$(target).slideToggle('200');
70		});
71
72		$('#comarquage [data-action="slideall-up"]').click(function(event) {
73			var target = $(this).data('target');
74			$(target + ' .co-btn-slide').removeClass('active');
75			$(target + ' .fiche-item-content').slideUp('200');
76
77			$(target + ' .co-btn[data-action="slide"]').removeClass('active');
78			$(target + ' .co-collapse').addClass('co-hide').slideUp('200');
79		});
80
81		$('#comarquage [data-action="slideall-down"]').click(function(event) {
82			var target = $(this).data('target');
83			$(target + ' .co-btn-slide').addClass('active');
84			$(target + ' .fiche-item-content').slideDown('200');
85
86			$(target + ' .co-btn[data-action="slide"]').addClass('active');
87			$(target + ' .co-collapse').removeClass('co-hide').slideDown('200');
88
89			initGMaps($(this).closest('#comarquage').find('.co-org-maps'));
90		});
91
92		$('#comarquage [data-action="slide-bloccas-radio"]').click(function(event) {
93			var $el = $(this),
94				$thisChoice = $el.closest('.choice-tree-choice'),
95				$thisChoiceList = $el.closest('.choice-tree-choice-list');
96
97			$thisChoice.toggleClass('choice-active');
98			$thisChoiceList.children('.choice-tree-choice').not($thisChoice).toggleClass('choice-hide');
99
100			$el.toggleClass('active');
101			var target = $el.data('target');
102			$(target).slideToggle('200');
103
104			//choice-tree-choice
105			initGMaps($(this).closest('.choice-tree-choice').find('.co-org-maps'));
106		});
107
108		/* Organismes */
109		$('#comarquage [data-action="slide-org"]').click(function(event) {
110			$(this).toggleClass('active');
111			var target = $(this).data('target');
112			$(target).slideToggle('200');
113
114			initGMaps($(this).closest('.fiche-item').find('.co-org-maps'));
115		});
116
117	});
118
119});

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.