PageSourceSearch

https://ccb-armor.org/plugins/auto/medias_responsive_mod/v1.40.0/squelettes/javascript/medias_responsive.js

js ccb-armor.org collected 2026-10-04 15:18:14 UTC 1,864 bytes, 58 lines download raw bytes

1
2function calculer_spip_documents() {
3
4	$(".spip_documents").each(function() {
5		var t = $(this);
6		
7		var width = parseInt(t.attr("data-w"));
8		var parent = parseInt(t.parent().innerWidth());
9			
10		if (width > parent) t.width("auto");
11		else t.width(width);
12			
13		if ( t.hasClass("spip_documents_right") || t.hasClass("spip_documents_left") ) {	
14			var l = width;
15			l = l + parseInt(t.css("marginRight"));
16			l = l + parseInt(t.css("marginLeft"));
17			
18			if (l > 0.6*parent) t.addClass("spip_documents_center_forcer").css("width", "auto");
19			else t.removeClass("spip_documents_center_forcer").css("width", width+"px");
20			
21			console.log(t);
22			console.log(width + " / " + l + " / " + parseInt(t.css("marginRight")) + " / " + parseInt(t.css("marginLeft")) ) ;
23
24		}
25	});
26}
27
28
29var medias_resp_a_observer = $(".spip_documents.kenburns, .spip_documents_flip");
30if('IntersectionObserver' in window){
31    var medias_resp_obs = new IntersectionObserver(medias_resp_observerCallback);
32
33    function medias_resp_observerCallback(entries, observer) {
34        entries.forEach(entry => {
35            if (entry.isIntersecting) {
36				if (entry.target.classList.contains('spip_documents_flip')) {
37					entry.target.classList.add("spip_documents_flip_actif");
38				}
39				if (entry.target.classList.contains('kenburns')) {
40					entry.target.classList.add("kenburns_actif");
41				}
42
43            }
44        });
45    };
46    medias_resp_a_observer.each(function(){
47        medias_resp_obs.observe(this);
48    });
49    
50} else { /* Si pas de insersectionObserver pour ce navigateur */
51	medias_resp_a_observer.each(function(){
52		if($(this).hasClass("spip_documents_flip")) $(this).addClass("spip_documents_flip_actif");
53		if($(this).hasClass("kenburns")) $(this).addClass("kenburns_actif");
54	});
55}
56
57$(document).ready(calculer_spip_documents);
58$(window).smartresize(calculer_spip_documents);

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.