PageSourceSearch

https://comic.systems/xyz/js/scripts.js?v=20260924220214

js comic.systems collected 2026-09-24 20:02:30 UTC 9,132 bytes, 330 lines download raw bytes

1// custom css expression for a case-insensitive contains()
2jQuery.expr[':'].Contains = function(a,i,m){
3  return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
4};
5
6/*
7document.querySelector("#reloadSW").addEventListener("click", () => {
8	navigator.serviceWorker
9	.getRegistration()
10	.then(registration => {
11		registration.waiting
12		.postMessage("skipWaiting");
13	});
14});
15
16let newWorker;
17
18// The click event on the notification
19document.getElementById('reloadSW').addEventListener('click', function(){
20	newWorker.postMessage({ action: 'skipWaiting' });
21});
22*/
23
24// aller vers une partie de la page
25var leScroll = false;
26$(".goto").click(function(e) {
27	// e.preventDefault();
28	if(!leScroll) {
29		leScroll	= true;
30		var slideTo = $(this).attr("href");
31		// $(window).scrollTop($(slideTo).offset().top);
32		$("html, body").animate({ scrollTop: $(slideTo).offset().top - 60 }, 250);
33		leScroll	= false;
34	}
35});
36
37if ('serviceWorker' in navigator) {
38	// Register the service worker
39	navigator.serviceWorker.register('https://comic.systems/sw.js').then(reg => {
40	  reg.addEventListener('updatefound', () => {
41
42		// An updated service worker has appeared in reg.installing!
43		newWorker = reg.installing;
44
45		newWorker.addEventListener('statechange', () => {
46
47		  // Has service worker state changed?
48		  switch (newWorker.state) {
49			case 'installed':
50
51	// There is a new service worker available, show the notification
52			  if (navigator.serviceWorker.controller) {
53				let notification = document.getElementById('notification ');
54	notification .className = 'show';
55			  }
56
57			  break;
58		  }
59		});
60	  });
61	});
62
63}
64
65$(".google-menu-ouvrir").click(function(){
66	var ouvrir = $(this).attr("ouvrir");
67	$("."+ouvrir).toggleClass("ouvert");
68});
69$(document).mouseup(function (e) {
70	var container = $(".google-menu");
71	// ni le menu ni ce qui son contenu
72	// if (!container.is(e.target) && container.has(e.target).length === 0) {
73	// ni le menu, mais son contenu oui
74	if (!container.is(e.target) || container.is(e.target)) {
75		container.removeClass("ouvert");
76	}
77});
78$(document).keyup(function(e) {
79	if (e.keyCode == 27) {
80		$(".google-menu.ouvert").removeClass("ouvert");
81		return true;
82	}
83});
84
85$(document).ajaxComplete(function(){
86	$('a[href="#"]').on('click', function(e) {
87		e.preventDefault();
88	});
89	$("a[href!=''][href]:not([target='_blank']):not(.goto)").on("click", function() {
90		$("header").addClass("ouverture");
91	});
92});
93
94$("header .menu").on("click", function(){
95	$(this).toggleClass("actif");
96	$("menu").toggleClass("actif");
97	$("page").toggleClass("nomenu");
98});
99
100// $("header .recherche .loupe").on("click", function(){
101	// $(this).toggleClass("actif");
102	// $("header .recherche").toggleClass("actif");
103	// $("header .titre").toggleClass("inactif");
104	// $("header .recherche .filtre").focus();
105// });
106
107// administration
108$(".xyz").on("click", function(){
109	$(".fab-menu").toggleClass("active");
110});
111
112// floating action menu (administration)
113var overlay = $(".fab-overlay"),
114        fab = $(".fab.actu, .bouton.creerActu"),
115     fermer = $(".fab-close"),
116     submit = $(".fab-creer");
117
118//fab click
119fab.on('click', openFAB);
120overlay.on('click', closeFAB);
121fermer.on('click', closeFAB);
122
123function openFAB() {
124	fab.addClass("active");
125	overlay.addClass("dark");
126}
127function closeFAB(event){
128	if (event) {
129		event.preventDefault();
130		event.stopImmediatePropagation();
131	}
132	fab.removeClass("active");
133	overlay.removeClass("dark");
134}
135$("#queryCreer").change(function() {
136	var catArticle	= $(this).val();
137	var dataString	= 'catArticle='+ catArticle;
138
139	$.ajax({
140		type: "POST",
141		url: "https://xyz.comic.systems/actions/fab-articles-creer",
142		data: dataString,
143		cache: false,
144		success: function(html){
145			$("#urlCreer").html(html);
146		} 
147	});
148});
149$("#creerArticle").change(function() {
150	var catArticle	= $(this).val();
151	var dataString	= 'catArticle='+ catArticle;
152
153	$.ajax({
154		type: "POST",
155		url: "https://xyz.comic.systems/actions/fab-articles-creer",
156		data: dataString,
157		cache: false,
158		success: function(html){
159			$("#urlCreer").html(html);
160		} 
161	});
162});
163
164$("a:not([target='_blank'])").on("click", function() {
165	$("header").addClass("ouverture");
166});
167
168$(".ouvrir,.ouvrirTxt,.ouvrirBloc,.fermer,.fermerTxt,.fermerBloc,.login,.derouler,.plier,.deplier,.reveler").on("click", function() {
169	var $this = $(this);
170	$("." + $this.attr("ouvrir")).slideToggle("slow");
171});
172
173$(".ouvrir, .fermer").click(function(){
174	var $this = $(this);
175	$this.toggleClass("ouvrir fermer");
176});
177$(".ouvrirTxt, .fermerTxt").click(function(){
178	var $this = $(this);
179	$this.toggleClass("ouvrirTxt fermerTxt");
180
181	/* pour changer le texte du bouton */
182	var isEnabled = $this.hasClass("ouvrirTxt");
183	if(isEnabled){
184		$this.text("Montrer");
185	}else{
186		$this.text("Cacher");
187	}
188});
189
190var cookieAccept = localStorage.getItem("cookieAccept");
191if(cookieAccept!=="oui"){
192	$(".snackbar.cookies").addClass("active");
193	function gtag() { dataLayer.push(arguments); }
194	gtag('consent', 'default', {
195		'ad_user_data': 'denied',
196		'ad_personalization': 'denied',
197		'ad_storage': 'denied',
198		'analytics_storage': 'denied',
199		'wait_for_update': 500,
200	});
201}else{
202	console.log("Cookies acceptés");
203	function gtag() { dataLayer.push(arguments); }
204    gtag('consent', 'update', {
205		ad_user_data: 'granted',
206		ad_personalization: 'granted',
207		ad_storage: 'granted',
208		analytics_storage: 'granted'
209    });
210}
211$(".snackbar.cookies .snackbar-action").click(function(){
212	$(".snackbar.cookies").removeClass("active");
213	localStorage.setItem("cookieAccept", "oui");
214    function gtag() { dataLayer.push(arguments); }
215
216    gtag('consent', 'update', {
217		ad_user_data: 'granted',
218		ad_personalization: 'granted',
219		ad_storage: 'granted',
220		analytics_storage: 'granted'
221    });
222	var gtagScript = document.createElement('script');
223	gtagScript.async = true;
224	gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=UA-40585568-1';
225
226	var firstScript = document.getElementsByTagName('script')[0];
227	firstScript.parentNode.insertBefore(gtagScript,firstScript);
228});
229
230/*
231$(document).ready(function(){
232	if ( $(".popupScreen").hasClass("active") ) {
233		$("body").addClass("poped");
234	}
235});
236*/
237
238/* Chrome */
239const divResult = document.getElementById('result');
240const divInstall = document.getElementById('installContainer');
241const butInstall = document.getElementById('butInstall');
242const butShare = document.getElementById('butShare');
243
244window.addEventListener('beforeinstallprompt', (event) => {
245	console.log('👍', 'beforeinstallprompt', event);
246	// Stash the event so it can be triggered later.
247	window.deferredPrompt = event;
248	// Remove the 'hidden' class from the install button container
249	// butInstall.removeAttribute('disabled');
250});
251
252/*
253butInstall.addEventListener('click', () => {
254	console.log('👍', 'butInstall-clicked');
255	const promptEvent = window.deferredPrompt
256	if (!promptEvent) {
257		// The deferred prompt isn't available.
258		return;
259	}
260	// Show the install prompt.
261	promptEvent.prompt();
262	// Log the result
263	promptEvent.userChoice.then((result) => {
264		console.log('👍', 'userChoice', result);
265		// Reset the deferred prompt variable, since 
266		// prompt() can only be called once.
267		window.deferredPrompt = null;
268		// Hide the install button.
269		butInstall.setAttribute('disabled', true);
270	});
271});
272*/
273
274window.addEventListener('appinstalled', (event) => {
275	console.log('👍', 'appinstalled', event);
276});
277
278/*
279if ('share' in navigator) {
280	console.log('👍', 'navigator.share is supported');
281	butShare.removeAttribute('disabled');
282	butShare.addEventListener('click', (e) => {
283		console.log('👍', 'butShare-clicked', e);
284		e.preventDefault();
285		const shareOpts = {
286			title: 'Jabberwocky',
287			text: 'Check out this great poem about a Jabberwocky.',
288			url: 'https://en.wikipedia.org/wiki/Jabberwocky',
289		};
290		navigator.share(shareOpts)
291				.then((e) => {
292					const msg = 'navigator.share succeeded.';
293					divResult.textContent = msg;
294					console.log('👍', msg, e);
295				})
296				.catch((err) => {
297					const msg = 'navigator.share failed';
298					divResult.textContent = `${msg}\n${JSON.stringify(err)}`;
299					console.error('👎', msg, err);
300				});
301	});
302} else	{
303	console.warn('👎', 'navigator.share is not supported');
304	const divNotSup = document.getElementById('shareNotSupported');
305	divNotSup.classList.toggle('hidden', false);
306	// divResult.classList.toggle('hidden', true);
307}
308*/
309	
310
311/* Only register a service worker if it's supported */
312if ('serviceWorker' in navigator) {
313	console.log('👍', 'navigator.serviceWorker is supported');
314	navigator.serviceWorker.register('https://comic.systems/sw.js');
315}
316
317/**
318 * Warn the page must be served over HTTPS
319 * The `beforeinstallprompt` event won't fire if the page is served over HTTP.
320 * Installability requires a service worker with a fetch event handler, and
321 * if the page isn't served over HTTPS, the service worker won't load.
322 
323if (window.location.protocol === 'http:') {
324	const requireHTTPS = document.getElementById('requireHTTPS');
325	const link = requireHTTPS.querySelector('a');
326	link.href = window.location.href.replace('http://', 'https://');
327	requireHTTPS.classList.remove('hidden');
328}
329
330*/

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.