PageSourceSearch

https://www.radioradicale.it/sites/www.radioradicale.it/files/js/j…4tL4A5ENB8QFL2MCoxaWpgMQgDOh8knjGIKIdmOI.js

js radioradicale.it collected 2026-10-01 10:16:11 UTC 41,901 bytes, 1,265 lines download raw bytes

1(function ($) {
2
3Drupal.behaviors.radioradicale2016player = {
4    attach: function (context, settings) {	
5	
6	var isMobile = (flowplayer.support.iOS !== false) | (flowplayer.support.android !== false) ? true : false;
7	var isSafari = (flowplayer.support.browser.safari === true) ? true : false; 
8	
9	var ua = navigator.userAgent.toLowerCase();
10	var isOldWin = (ua.indexOf('windows nt 5.1')) > 0 | (ua.indexOf('windows nt 6.0')) > 0; //workaround XP e Vista	
11	var haveAutoplay = ((isMobile) | (isSafari) | isOldWin) ? false : true;
12	
13	flowplayer.conf = {
14	  key: settings.fp.key,
15		chromecast: true,
16		analytics: settings.fp.analytics,
17		mutedAutoplay: false,
18		autoplay: haveAutoplay
19	};
20	
21	if($('#btn-live-player').length){ 
22		
23		var onAirPlayerContainer = document.getElementById("btn-live-player");
24	
25		flowplayer(onAirPlayerContainer, {
26		
27		    splash: false,
28			live: true,
29			share: false,
30			speeds: [],
31			onlyAudio: true,
32			autoplay: false,
33			playlist: [{
34				sources: [
35			        {type: "audio/mpeg", src: settings.live_audio_url},
36			      ]
37			    }
38			], 
39		}).on("ready", function (e, api, video) {		    
40		 
41		}).on('error', function(e, api, error){
42			gtag('event', 'errore_stream', {url: settings.live_audio_url, errorCode: error.code});
43			if (error.code === 4) { // Video file not found
44		      // reset state
45		      api.error = api.loading = false;
46		      $(".fp-message", document).css({opacity: 0});
47		      $(document).removeClass("is-error");
48		  	}
49		}).on('pause', function(e, api){
50				$('#buffermp3').hide();
51				$('#pausemp3').hide();
52				$('#playmp3').css('display', 'inline-block');
53		}).on('resume', function(e, api){
54			$('#buffermp3').hide();
55			$('#playmp3').hide();
56			$('#pausemp3').css('display', 'inline-block');
57		    //pausa del player della scheda audio/video 
58			
59		    var div_player_live = settings.RRplayer.div_id;
60		    var player_state = null;
61		    if($('#' + div_player_live).length){
62			    player_state = player_getState(div_player_live);
63			   if (player_state == 'playing') {
64				   player_pausa(div_player_live); 
65			   }  
66		    }
67		    if($('#live-page-player').length){
68			    //pausa del player della pagina Diretta 
69			    player_state = player_getState('live-page-player');
70			   if (player_state == 'playing') {
71				   player_stop('live-page-player');
72			   }  
73		    }
74		    if($('#player-riascolta').length){
75			    //pausa del player della pagina Riascolta 
76			    player_state = player_getState('player-riascolta');
77			   if (player_state == 'playing') {
78				   player_pausa('player-riascolta');
79			   }  
80		  	}
81		  	if($('#tv-page-player').length){
82			    // pausa del player della pagina TV 
83			    player_state = player_getState('tv-page-player');
84			   if (player_state == 'playing') {
85				   player_pausa('tv-page-player');
86			   }  
87		  	}
88		  	
89		}); 
90		
91		/*  Script eventi del blocco/bottone con il player live mp3 */
92	    $('#player_control', context).click( function(e) { 
93	      e.preventDefault();
94	      flowplayer(onAirPlayerContainer).toggle();
95	  	});
96	}
97	
98	//SETUP OTHER PLAYERS 
99	
100	var setupPlayers = function() {
101	
102		if($('#live-page-player').length){ 
103			
104			var liveContainer = document.getElementById("live-page-player");
105	 
106			flowplayer(liveContainer, {
107				
108				aspectRatio: "16:9",
109			    splash: false,
110				live: true,
111				share: false,
112				coverImage: settings.img_audio,
113				playlist: [{
114				
115					sources: [
116				        {type: "audio/mpeg", src: settings.live_audio_url},
117				      ], audio: true,
118				      coverImage: settings.img_audio,
119				    },{
120				    sources: [
121				        {type: "audio/mpeg", src:settings.live_audio_camera_url},
122				      ], audio: true,
123				      coverImage: settings.img_audio,
124				    },{
125				    sources: [
126				        {type: "audio/mpeg", src: settings.live_audio_senato_url}, 
127				      ], audio: true,
128				      coverImage: settings.img_audio,
129				    },{
130				    sources: [
131				        {type: "application/x-mpegurl", src: settings.url_tv + '/playlist.m3u8'},
132				      ]
133				    },{
134				    sources: [
135				       {type: "application/x-mpegurl", src: settings.url_camera + '/playlist.m3u8'}, 
136				      ]
137				    },{
138				    sources: [
139				       {type: "application/x-mpegurl", src: settings.url_senato + '/playlist.m3u8'}, 
140				      ]
141					},{
142					sources: [
143				        {type: "audio/mpeg", src:settings.live_audio_rrnews_url},
144				      ], audio: true,
145				      coverImage: settings.img_audio,
146				    }
147				], 
148	
149			}).on('error', function(e, api, error){
150				console.log(e);
151
152				if (error.code === 4) { // Video file not found
153			      // reset state
154			      api.error = api.loading = false;
155			      $(".fp-message", document).css({opacity: 0});
156			      $(document).removeClass("is-error");
157				  $(".fp-message:first", document).remove();
158				  api.message("Si è verificato un problema tecnico, riprova tra poco, grazie", 5000);
159			  };
160			  gtag('event', 'errore_stream', {url: window.location.href, errorCode: error.code});
161			  
162			}).on('resume', function(){
163			  	ferma_player_orainonda();
164		   	}).on('ready', function(evt){
165				
166				var currentItem = player_getPlaylistIndex('live-page-player');
167				switch (currentItem) {
168					case 0:
169						$('#canale-radio-live').trigger('click');
170					break;
171					case 1:
172						$('#canale-camera-live').trigger('click');
173					break;
174					case 2:
175						$('#canale-senato-live').trigger('click');
176					break;
177					case 3:
178						$('#dirette-canale-tv').trigger('click');
179					break;
180					case 4:
181						$('#dirette-canale-camera').trigger('click');
182					break;
183					case 5:
184						$('#dirette-canale-senato').trigger('click');
185					break;
186				}
187	
188			});
189		
190		}	
191		
192		if($('#tv-page-player').length){ 
193			
194			var playerContainer;
195			var tvplayer  = document.getElementById("tv-page-player"),
196			playerContainer,
197			customErrors = flowplayer.defaults.errors.slice(0),
198			customError = "<h2>Il contenuto non è attualmente disponibile</h2>"
199	                  + "<p>Riprova tra poco </p>";
200	        customErrors[2] = customError;
201			customErrors[4] = customError;
202			
203			flowplayer(function (api, root) {
204			  var fsbutton = root.querySelector(".fp-fullscreen");
205			  // append fullscreen button after HD menu is added on ready
206			  api.on("ready", function () {
207			    root.querySelector(".fp-controls").appendChild(fsbutton);
208			  });
209			});
210	 
211			playerContainer = flowplayer(tvplayer, {
212				error: customErrors,
213				aspectRatio: "16:9",
214			    splash: false,
215				live: true,
216				share: false,
217				speeds: [],
218				poster: settings.img_tv,
219				playlist: [{
220					sources: [
221				        {type: "application/x-mpegurl", src: settings.url_tv + '/playlist.m3u8'},
222				      ]
223				    }
224				], 
225				hlsjs: {
226			        xhrSetup: function (xhr, url) {
227			          var isPlaylist = url.lastIndexOf(".m3u8") === url.length - 5;
228			
229			          xhr.addEventListener("error", function () {
230			            if (isPlaylist) {
231			              // intentionally throw Network error
232			             playerContainer.trigger("error", [playerContainer, {code: 2}]);
233			            }
234			          });
235			          xhr.addEventListener("readystatechange", function (e) {
236			            var xstatus = e.currentTarget.status;
237			            if (isPlaylist && xhr.readyState === 4 && xstatus >= 400 && xstatus < 499) {
238			              // intentionally throw Video file not found error
239			               playerContainer.trigger("error", [playerContainer, {code: 4, status: xstatus}]);
240			            }
241			          });
242			        }
243		      	},
244	
245			}).on('error', function(e, api, error){
246					gtag('event', 'errore_stream', {url: window.location.href, errorStatus: error.status});
247					$('.fp-ui .fp-message').empty().remove();
248					api.message("Canale attualmente non disponibile");
249			}).on('resume', function(){
250			  	ferma_player_orainonda();
251		   	}).on('ready', function(){
252			   //rimuovo messaggi di errore in caso di riconnessione
253			   $('.fp-ui .fp-message').empty().remove();
254		   	});
255		}
256		
257		if($('#servizio-page-player').length){ 
258			var servizioPlayer = document.getElementById("servizio-page-player");
259	 
260			flowplayer(servizioPlayer, {
261				
262				aspectRatio: "16:9",
263			    splash: false,
264				live: true,
265				share: false,
266				speeds: [],
267				poster: settings.img,
268				playlist: [{
269					sources: [
270				        {type: "application/x-mpegurl", src: settings.path_stream},
271				      ]
272				    }
273				], 
274	
275			}).on('error', function(evt){
276				console.log(evt);
277			}).on('resume', function(){
278			  	ferma_player_orainonda();
279		   	});	
280	
281		}
282		
283		if($('#diretta_camera').length){ 
284			
285			var diretta_camera = document.getElementById("diretta_camera");
286	 
287			flowplayer(diretta_camera, {
288				
289				aspectRatio: "4:3",
290			    splash: false,
291				live: true,
292				share: false,
293				speeds: [],
294				coverImage: settings.url_img,
295				autoplay: false,
296				playlist: [{
297					sources: [
298				        {type: "application/x-mpegurl", src: settings.url_camera + '/playlist.m3u8'},
299				      ]
300				    }
301				], 
302	
303			}).on('error', function(evt){
304				console.log(evt);
305			});		
306		}
307		
308		if($('#diretta_senato').length){ 
309			
310			var diretta_senato = document.getElementById("diretta_senato");
311	 
312			flowplayer(diretta_senato, {
313				
314				aspectRatio: "4:3",
315			    splash: false,
316				live: true,
317				share: false,
318				speeds: [],
319				coverImage: settings.url_img,
320				autoplay: false,
321				playlist: [{
322					sources: [
323				        {type: "application/x-mpegurl", src: settings.url_senato + '/playlist.m3u8'},
324				      ]
325				    }
326				], 
327	
328			}).on('error', function(evt){
329				console.log(evt);
330			});
331			
332		}
333		
334		
335	
336	};
337	
338	/* start FUNCTION API JS FLOWPLAYER 7 */ 
339	
340	// salta al secondo desiderato del file in esecuzione
341	var player_seek = function (playerid, secToSeek) {
342		var container = document.getElementById(playerid);
343		flowplayer(container).seek(secToSeek);	
344	};
345	
346	//avvia il player
347	var player_play = function(playerid) {
348		var container = document.getElementById(playerid);
349		flowplayer(container).play();
350	};
351	
352	//mette in pausa il player
353	var player_pausa = function(playerid) {
354		var container = document.getElementById(playerid);
355		flowplayer(container).pause();
356	};
357	
358	//mette in stop il player
359	var player_stop = function(playerid) {
360		var container = document.getElementById(playerid);
361		flowplayer(container).stop();
362	};
363	
364	//ritorna lo stato del player (pause, playing...)
365	var player_getState = function(playerid) {
366		var container = document.getElementById(playerid);
367		var api = flowplayer(container);
368		if (typeof api != 'undefined') {
369			var stato = api.paused ? 'paused' : 'playing';
370		} else {
371			var stato = 'paused'; 
372		}
373		
374		return stato; 
375	};
376	
377	// ritorna l'indice del file in riproduzione 
378	var player_getPlaylistIndex = function(playerid) {
379		var container = document.getElementById(playerid);
380		var playlistNow = flowplayer(container).video.index;
381		return (playlistNow);
382	};
383	
384	
385	//ritorna la posizione (in secondi) della riproduzione in corso 
386	var player_getPosition = function(playerid) {
387		var container = document.getElementById(playerid);
388		var sec = flowplayer(container).video.time;
389		return sec;
390	};
391	
392	// avvia la riproduzione dall'inizio del media relativo all'indice nella playlist (indexPl)
393	var player_goto_playlistItem = function (playerid, indexPl) {
394		var tmp_playlist = player_getPlaylistIndex(playerid); 
395		if ( tmp_playlist != indexPl) {
396			var container = document.getElementById(playerid);
397			flowplayer(container).play(indexPl);
398		}
399	};
400	
401	//avvia riproduzione del file con id playlist e indicazione del secondo esatto (offset manuale)
402	var player_setPlaylist_seek = function (playerid, playlistId, secToSeek) {
403
404		if (player_getPlaylistIndex(playerid) == playlistId) {
405			// playlist già in riproduzione
406				player_seek(playerid, secToSeek);
407		} else {
408			//player_goto_playlistItem(playerid, playlistId);
409			var container = document.getElementById(playerid);
410			flowplayer(container).play(playlistId).one("resume", function (e, api) {
411					player_seek(playerid, secToSeek); 
412	        });
413		}
414	};
415	
416	//avvia riproduzione del file con id intervento riferito alla lista interventi (jumptable) tenendo conto dell'offset
417	var playerSetPosition = function (playerid, jumptable, id) {
418	    if (jumptable[id]) {
419			  player_setPlaylist_seek(playerid, jumptable[id].file, jumptable[id].offset);
420	    }
421	};
422	
423	// fermo il player quando raggiunge la posizione indicata
424	var player_stopOnTime = function(playerid, playlistID, secToStop){
425		var container = document.getElementById(playerid);
426		flowplayer(container).on('progress', function(event){
427			var playlistNow = player_getPlaylistIndex(playerid); 
428			//controllo che playlist in riproduzione sia quella del parametro
429			if (playlistNow == playlistID) { 
430				//fermo player 
431				if (flowplayer(container).video.time > secToStop) { 
432					player_pausa(playerid);
433					flowplayer(container).off('progress');
434				} 
435			}
436		});
437	};
438	
439	//avvia il file sottotitolo dell'indice indicato
440	var player_setCurrentCaptions = function(playerid, index_file) {
441		var container = document.getElementById(playerid);
442		flowplayer(container).loadSubtitles(index_file);
443	};
444	
445	var tag;
446	var normale;
447	
448    var isAndroid = function() {
449		var userAgent = navigator.userAgent || navigator.vendor || window.opera;
450		if( userAgent.match( /Android/i ) ) { return true; }
451		else {return false; }
452	};
453	
454	var showFileNumber = function(playerid, playlistObj) {
455		var playlistArray = playlistObj;
456		var container = document.getElementById(playerid);
457		var playlistIndex = flowplayer(container).video.index + 1;
458		var nFile = playlistArray.length;
459		var textHtml = 'FILE ' + playlistIndex + '/' + nFile;
460		if (nFile > 1 && typeof textHtml != "undefined") {
461			$('#infoFile').html(textHtml);
462			$('#infoFile').show();
463		} else {
464			$('#infoFile').hide();
465		}
466	};
467	
468	var ferma_player_orainonda = function() {
469		var player_state = player_getState('btn-live-player'); 
470		if (player_state == 'playing') {
471	  		player_stop('btn-live-player');
472		}
473	};
474	  	
475	
476	/* 
477	
478	//riconnessione in caso di errore del flusso streaming @todo quando sarà possibile identificare l'errore
479	if($('#servizio-page-player').length){ 
480		jwplayer('servizio-page-player').on('error', function() {
481			setTimeout(function() {
482				window.location = window.location.href;
483			}, 60000);
484		});
485	}
486	
487	*/
488	
489	window.setupPlayers = setupPlayers;
490	window.showFileNumber = showFileNumber;
491	window.isAndroid = isAndroid;
492	window.player_setCurrentCaptions = player_setCurrentCaptions;
493	window.player_stopOnTime  = player_stopOnTime;
494	window.player_setPlaylist_seek = player_setPlaylist_seek;
495	window.playerSetPosition = playerSetPosition;
496	window.player_goto_playlistItem  = player_goto_playlistItem;
497	window.player_getPosition = player_getPosition;
498	window.player_getPlaylistIndex = player_getPlaylistIndex;
499	window.player_getState = player_getState;
500	window.player_stop = player_stop;
501	window.player_pausa = player_pausa;
502	window.player_play = player_play;
503	window.player_seek = player_seek;
504	window.ferma_player_orainonda = ferma_player_orainonda;
505	
506
507
508
509}};		
510
511})(jQuery);;
512(function ($) { 
513
514	var playerFunctions = function() {
515		setupPlayers();
516		if($('.node-type-registrazione').length){ 
517			setupSchedaPlayer();
518		}
519	}
520	
521  Drupal.behaviors.radioradicale2016 = {
522    attach: function (context, settings) {
523	    
524	// test un solo evento onload per fare setup dei players
525	
526	//var safari   = navigator.userAgent.indexOf("Safari") > -1;
527	var isSafari = (flowplayer.support.browser.safari === true) ? true : false; 
528	
529	if (isSafari) {
530		window.onload = playerFunctions(); // funziona su Safari 
531	} else {
532		window.onload = playerFunctions; // non funziona su Safari  
533	}
534	// window.onload = playerFunctions; // non compare errore split, ma non funziona su Safari  
535	
536	
537		
538 	/* DIRETTE Gestione eventi del player e dei bottoni nella pagina della diretta */
539	
540	// ORAINONDA 
541	if($('.page-dirette', context).length){ 
542		var timeOutId = 0;
543		var ajaxInonda = function () {
544		        $.ajax({
545			        dataType: "json",
546		            url: '/api/onair.json',	        	
547		        }).fail( function() {
548					$("span#inonda-radio").html("Programmazione al momento non disponibile");
549					clearTimeout(timeOutId);
550					timeOutId = setTimeout(ajaxInonda, 60000);
551	    		}).done(function(data, textStatus, jqXHR) {  		
552		               $("span#inonda-radio").html(data[0].RRAA_TITOLO);
553		               var v_maxage = jqXHR.getResponseHeader('Cache-Control').match(/max-age=(\d{2,8})/i);
554		               var cache_time;
555					   if(typeof v_maxage != "undefined" && v_maxage != null && v_maxage.length > 0) { 
556						   cache_time =  ((!!v_maxage[1]) && !isNaN(v_maxage[1])) ? v_maxage[1]*1000 : 60000;
557						} else cache_time = 60000;
558					   clearTimeout(timeOutId);
559					   timeOutId = setTimeout(ajaxInonda, cache_time);				    
560	            });     
561		};
562		
563	}
564	
565	/* FREQUENZE - Interazione con il box cerca frequenze della pagina /come-ascoltarci */
566	var json_data_freq = null;
567	$("input#cercafrequenza", context).on("click", function(){
568    	if (!json_data_freq) {
569			 $.getJSON('/api/freq.json', function(data){ 
570				    	json_data_freq = data;
571		     });
572		} 
573	});
574	  
575	$('#cercafrequenza', context).keyup(function() { 
576		if (!json_data_freq) {
577			 $.getJSON('/api/freq.json', function(data){ 
578				    	json_data_freq = data;
579		     });
580		} 
581		var searchTerm = $(this).val(); 
582	    if (searchTerm.length > 0) {
583		    var myExp = new RegExp("^" +searchTerm, "i");  
584		    var output = "<ul id='risultati'>";
585			$.each(json_data_freq, function(key, val){
586				if(val.comune.search(myExp) != -1){
587					output += '<li>';
588					output += '<div class="comune">' +val.comune+ '</div>';
589					output += '<div class="frequenza">' +val.frequenza+ '</div>';
590					output += '</li>';
591				}
592			}); 
593	        output += "</ul>";
594			$('#update').html(output); 	
595		}
596	    else $('#update').empty();
597	  });
598	  
599  	//svuoto div quando utente clicca X per pulire testo, workaround con timeout 
600  	$("#cercafrequenza", context).bind("mouseup", function(e){
601	  var $input = $(this),
602	      oldValue = $input.val();
603	  if (oldValue == "") return;
604	  setTimeout(function(){
605	    var newValue = $input.val();
606	    if (newValue == ""){
607	      $('#update').empty();
608	    }
609	  }, 1);
610	});
611	function cambiaCanale(index) {
612		player_goto_playlistItem('live-page-player', index);
613		$('[id^="inonda"]').hide();
614		$('#block-rrblocks-diretta-player').find('*').removeClass('attivo');
615	}
616	$('#canale-radio-live', context).click( function(e) {
617      e.preventDefault();
618	  cambiaCanale(0);
619	  ajaxInonda();
620	  $('#inonda-radio').show();
621	  $(this).addClass("attivo"); 
622  	});
623    $('#canale-camera-live').click( function(e) {
624      e.preventDefault();
625      cambiaCanale(1);
626	  if (timeOutId >= 0) {clearTimeout(timeOutId);}
627	  $('#inonda-camera').show();
628	  $(this).addClass("attivo");
629  	});
630  	$('#canale-senato-live').click( function(e) {
631      e.preventDefault();   
632      cambiaCanale(2);
633	   if (timeOutId >= 0) {clearTimeout(timeOutId);}
634	   $('#inonda-senato').show();
635	   $(this).addClass("attivo");
636  	});
637  	$('#dirette-canale-tv').click( function(e) {
638      e.preventDefault(); 
639	  cambiaCanale(3);
640	   if (timeOutId >= 0) {clearTimeout(timeOutId);}
641	   $('#inonda-tv-radio').show();
642	   $(this).addClass("attivo");
643  	});
644  	$('#dirette-canale-camera').click( function(e) {
645      e.preventDefault();   
646	   cambiaCanale(4);
647	   if (timeOutId >= 0) {clearTimeout(timeOutId);}
648	   $('#inonda-tv-camera').show();
649	   $(this).addClass("attivo");
650  	});
651  	  	$('#dirette-canale-senato').click( function(e) {
652      e.preventDefault();   
653	   cambiaCanale(5);
654	   if (timeOutId >= 0) {clearTimeout(timeOutId);}
655	   $('#inonda-tv-senato').show();
656	   $(this).addClass("attivo");
657  	});  	
658	function redirect(uri) {
659		if( (navigator.userAgent.indexOf('Android') != -1) ) 
660			document.location=uri;      
661		else
662	    	window.location.replace(uri);
663	}
664  	
665  	/* Pagina Radio Radicale TV */
666  	$('#canale-tv', context).click( function(e) {
667    	e.preventDefault();
668    	redirect('/tv/diretta')
669      $('#canale-tv-camera').removeClass("attivo");
670	  $('#canale-tv-senato').removeClass("attivo");
671	  $(this).addClass("attivo");
672  	});
673    $('#canale-tv-camera', context).click( function(e) {
674    e.preventDefault();   
675	redirect("/tv/camera-diretta");
676
677	   $('#canale-tv').removeClass("attivo");
678	   $('#canale-tv-senato').removeClass("attivo");
679	   $(this).addClass("attivo");
680  	});
681  	$('#canale-tv-senato', context).click( function(e) {
682      e.preventDefault();   
683	   redirect("/tv/senato-diretta");
684  
685	   $('#canale-tv').removeClass("attivo");
686	   $('#canale-tv-camera').removeClass("attivo");
687	   $(this).addClass("attivo");
688  	});
689  	// apre pagina /stampa
690		$('#icn-print', context).click(function(e) {
691			e.preventDefault();
692	        e.stopPropagation();
693	        if ($('.page-node-audio', context).length === 0) {
694		        //se NON è pagina /audio posso utilizzare eventi analytics
695				gtag('event', 'azione_scheda', {url: settings.RRscheda.canonical, azione: 'Click stampa'});
696			}
697	        window.open(settings.RRscheda.canonical+'/stampa', '_blank');
698		});
699  	// se NON è pagina /audio posso utilizzare eventi analytics
700  	if ($('.page-node-audio', context).length === 0) {
701		// evento analytics / download in riascolta
702		$('.condividi-intervento', context).on('click', function() {
703			if (settings.RRscheda.canonical) {
704				gtag('event', 'azione_scheda', {url: settings.RRscheda.canonical, azione: 'Share box intervento'});
705			}
706		});
707		// evento analytics / apre box trascrizioni
708		$('#quicktabs-tab-blocco_interventi-1', context).on('click', function() {
709			if (settings.RRscheda.canonical) {
710				gtag('event', 'azione_scheda', {url: settings.RRscheda.canonical, azione: 'Box intervento'});
711			}
712		});
713		// evento analytics / download nelle schede
714		$('.file-download', context).on('click', function() {
715			var a_href= $(this).find('li a').attr('href');
716			if (a_href) {
717				gtag('event', 'azione_scheda', {url: a_href, azione: 'Download di file / scheda'});
718			}
719		});
720		// evento analytics / box condivisione
721		$('#apriBoxCondividi', context).on('click', function() {
722			if (settings.RRscheda.canonical) {
723				gtag('event', 'azione_scheda', {url: settings.RRscheda.canonical, azione: 'Share box'});
724			}
725		});
726		// evento analytics / click icona 'solo audio'
727		$('#icn-headphones', context).on('click', function() {
728			if (settings.RRscheda.canonical) {
729				gtag('event', 'azione_scheda', {url: settings.RRscheda.canonical, azione: 'Solo audio'});
730			}
731		});
732		// evento analytics / click icona 'solo video'
733		$('.social-share-btn', context).on('click', function() {
734			if (settings.RRscheda.canonical) {
735				gtag('event', 'azione_scheda', {url: settings.RRscheda.canonical, azione: 'Social button'});
736			}
737		});
738	}
739	
740	// evento analytics / download in riascolta
741	$('.riascolta-dwn', context).on('click', function() {
742		var a_href= $('.riascolta-dwn').attr('href');
743		if (a_href) {
744			gtag('event', 'azione_riascolta', {url: a_href, azione: 'Download di file / riascolta'});
745		}
746	});
747	//evento analytics per i click sugli eventi 'colorbox'
748	// async tracker
749	$(document).bind("cbox_complete", function(){
750	    var href = $.colorbox.element().attr("href");
751	    if (href) {
752			gtag('event', 'azione_sito', {url: href, azione: 'Colorbox'});
753		}
754	});
755
756	//Pagina servizio 
757	$("#checkkWowza", context).click(function(){
758		$("#form-icecast").hide();
759		$("#form-wowza").show();
760	});
761	$("#checkIcecast", context).click(function(){
762		$("#form-icecast").show();
763		$("#form-wowza").hide();
764	});
765	
766	// rende full width il widget twitter mostrato nella pagine camera e senato
767	$(window).on('load', function () {
768		if($('.section-tv').length){ 
769		
770			$('iframe[id^=twitter-widget-]').each(function () {
771			 	var head = $(this).contents().find('head');
772				if (head.length) {
773					head.append('<style>.timeline { max-width: 100% !important; width: 100% !important; } .timeline .stream { max-width: none !important; width: 100% !important; }</style>');
774				}
775				$('#twitter-widget-0').append($('<div class=timeline>'));
776		
777			})
778		}
779	});
780}};
781})(jQuery);
782;
783(function ($) {
784
785  /**
786   *  Gestione dei parametri passati nel fragment.
787   *  Riconosce (oggetto dictionary) le variabili:
788   *  d: data YYYY-MM-DD;
789   *  f: playlist_fine (indice nella playlist del media dove termina la condivisione);
790   *  i: intervento (nid dell'intervento);
791   *  o: ora hh:mm;
792   *  p: playlist_inizio (indice nella playlist del media dove inizia la condivisione);
793   *  s: secondo_inizio (secondo di inizio di una condivisione);
794   *  t: secondo_fine (secondo dove termina il taglio di una condivisione);
795   */
796  var radioparams = function (parm) {
797    var dictionary = {
798      'd':'data',
799      'f':'playlist_fine',
800      'i':'intervento',
801      'o':'ora',
802      'p':'playlist_inizio',
803      's':'secondo_inizio',
804      't':'secondo_fine'
805    };
806    var hashParams = {};
807    var e,
808        check,
809        varname,
810        a = /\+/g,  // Regex for replacing addition symbol with a space
811        r = /([^&;=]+)=?([^&;]*)/g,
812        d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
813        //q = window.location.hash.substring(1);
814        q = window.location.search.substring(1);
815
816    while (e = r.exec(q)) {
817      varname = d(e[1]);
818      if (dictionary[varname]) {
819        check = d(e[2]);
820        if ((Math.floor(check) == check && check > -1 && $.isNumeric(check)) || // è un intero positivo o nullo
821            /^(19[5-9][0-9]|20[0-9][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/.test(check) || // è una data YYYY/MM/DD
822            /^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$/.test(check)) { // è un'ora hh:mm
823          
824          hashParams[dictionary[varname]] = check;
825        }
826      }
827    }
828    if (parm === null) {
829      return hashParams;
830    }
831    else if (hashParams[parm]) {
832      return hashParams[parm];
833    }
834  };
835  
836  // Assegna la funzione appena definita alla finestra del browser,
837  // per renderla utilizzabile da tutti gli script del sito.
838  window.radioparams = radioparams;
839  
840  var divIDRiascolta = "player-riascolta";
841  
842  function setupRiascoltaPlayer(m3u8){
843	    $('#' + divIDRiascolta).removeClass('empty');
844	                
845        riascoltaPlayer = document.getElementById(divIDRiascolta);
846
847		flowplayer(riascoltaPlayer, {
848			audioOnly: true,
849			audio: true, 
850			speeds: [1.0, 1.25, 1.5],
851		    splash: false,
852			live: false,
853			share: false,
854			playlist: [{
855				sources: [
856			        {type: "application/x-mpegurl", src: m3u8},
857			      ]
858			    }
859			], 
860
861		}).on('error', function(evt){
862			console.log(evt);
863		}).on('resume', function(){
864			ferma_player_orainonda();
865		});
866  }
867  
868    function loadRiascoltaPlayer(m3u8){
869	                
870        riascoltaPlayer = document.getElementById("player-riascolta");
871
872		flowplayer(riascoltaPlayer).load({sources: [{type: "application/x-mpegurl", src: m3u8}]});
873  }
874  
875  
876  /**
877   * Questo codice è stato modficato per agire solo sulla barra rossa originale
878   * (quella fornita dal modulo rrblocks). Si può togliere dopo aver sostituito
879   * la barra con quella nuova, ma attenzione al frammento indicato più sotto.
880   */
881  Drupal.behaviors.radioradicale2016BarraMenu = {
882    attach: function (context, settings) {
883      if(!Modernizr.touch){
884	  //per touch (tablet, smartph) evitiamo il menù dropdown
885      /* Animazione barra menu */
886      $('.tasto-home', context).on('mouseenter', function() {
887        $(this).addClass('active');
888      });
889      $('.tasto-home', context).on('mouseleave', function() {
890        $(this).removeClass('active');
891      });
892      $('#barra_radio .barra_radio-tabs li', context).on('mouseenter', function() {
893        $(this).siblings().removeClass('active');
894        $(this).addClass('active');
895        var index = $(this).index();
896        var timeout = setTimeout(function() {
897          $('#barra_radio .dropdown').addClass('dropdown-hide');
898          $('#barra_radio #dropdown-barra_radio-'+index).removeClass('dropdown-hide');
899          $('#barra_radio #dropdown-container-barra_radio').show('fast');
900        }, 500);
901        $('#block-rrblocks-barra-radio').on('mouseleave', function() {
902          clearTimeout(timeout);
903        });
904      });
905      
906      $('#block-rrblocks-barra-radio', context).on('mouseleave', function() {
907        var timeout = setTimeout(function() {
908          $('#barra_radio #dropdown-container-barra_radio').hide('slow');
909          $('#barra_radio .barra_radio-tabs li').removeClass('active');
910        }, 500);
911        $('#block-rrblocks-barra-radio').on('mouseenter', function() {
912          clearTimeout(timeout);
913        });
914      });
915	}
916     // QUANTO SEGUE DEVE RESTARE.
917     // Scroll-box: blocca la topbar allo scroll in fixed
918      if (context == document) {
919        new Scroll_box($('#fixed-header,#search-bar'));
920      }
921      
922    }  
923  };
924  
925  /**
926   * Features presenti nelle varie pagine del sito.
927   */
928    Drupal.behaviors.radioradicale2016CommonBehaviors = {
929      attach: function (context, settings) {
930        // Scroll to top
931        $('.tornasu', context).click(function () {
932          $('body,html').animate({
933              scrollTop: 0
934            }, 800);
935          return false;
936        });
937        
938        // Testo a scomparsa
939        $('.leggitutto', context).click(function (event) {
940          $(this).siblings('.more').toggle();
941          $(this).siblings('.trunk').toggle();
942          $(this).toggleClass('aperto');
943        });
944        
945        $('.leggisommario', context).click(function (event){
946	        $('#sommario_all').show();
947	        $('.riducisommario').show();
948	        $('.leggisommario').hide();
949	        $('#sommario_trunk').hide();
950	        $('#sommario_all').addClass('sommario-inline');
951        });
952        $('.riducisommario', context).click(function (event){
953	       	$('#sommario_all').hide();
954	        $('.riducisommario').hide();
955	        $('.leggisommario').show();
956	        $('#sommario_trunk').show();
957	        $('#sommario_all').removeClass('sommario-inline');
958        });
959      }
960    };
961  
962  
963  Drupal.behaviors.radioradicale2016sommario = {
964    attach: function (context, settings) {
965		if($('#autosommario-text').length){ 
966			var container = $('#autosommario-text');
967		    if (document.getElementById("autosommario-text").scrollHeight > container.innerHeight()) {
968			    container.addClass('reduced');
969				$('.piu-sommario').removeClass('hide');
970		    }
971		}
972      $('.piu-sommario').click(function() {
973        $(this).addClass('hide');
974        $('.meno-sommario').removeClass('hide');
975        container.removeClass('reduced');
976        container.addClass('expanded');
977      });
978      
979      $('.meno-sommario').click(function() {
980        $(this).addClass('hide');
981        $('.piu-sommario').removeClass('hide');
982        container.addClass('reduced');
983        container.removeClass('expanded');
984      });
985    }
986  };
987  
988  Drupal.behaviors.radioradicale2016argomenti = {
989	attach: function (context, settings) {
990	if($('#field-argomento').length){ 
991	  var container = $('#field-argomento');
992	  if (document.getElementById("field-argomento").scrollHeight > container.innerHeight()) {
993		$('.piu-argomenti').removeClass('hide');
994	  }
995	}
996	  
997	  $('.piu-argomenti').click(function() {
998	    $(this).addClass('hide');
999	    $('.meno-argomenti').removeClass('hide');
1000	    container.addClass('expanded');
1001	  });
1002	  
1003	  $('.meno-argomenti').click(function() {
1004	    $(this).addClass('hide');
1005	    $('.piu-argomenti').removeClass('hide');
1006	      container.removeClass('expanded');
1007	    });
1008	  }
1009  };
1010  
1011  
1012  /**
1013   * Comportamento della barra filtri della griglia in home page.
1014   */
1015  Drupal.behaviors.radioradicale2016FiltriHome = {
1016    attach: function (context, settings) {
1017      // Filtri animati
1018      if (context == document) {
1019        new An_menu({menu_container:$('.rotatore .slr_filter ul'),menu_box:$('.filter_label'),active_menu_class:'srl_active',easing:'swing',trigger_event:'mousedown'});
1020      }
1021    }
1022  };
1023  
1024  /**
1025   *  Effetti hover sulla griglia del rotatore
1026   *  e sui link alle rubriche fisse.
1027   */
1028  Drupal.behaviors.radioradicale2016Griglia = {
1029    attach: function (context, settings) {
1030      $('.slr_item, .rot_item', context).hover(function () {
1031        $(this).toggleClass('over');
1032      });
1033      $('.rubrichefisse .link', context).hover(function() {
1034        $(this).toggleClass('over');
1035      });
1036    }
1037  };
1038  
1039  // @todo Questo behavior e Drupal.behaviors.radioradicale2014Ascolta potrebbero essere riscritti unificandoli.
1040  Drupal.behaviors.radioradicale2016Riascolta = {
1041    attach: function (context, settings) {
1042      if (typeof($.datepicker) != 'undefined') {
1043        var today = $.datepicker.formatDate('yy-mm-dd', new Date());
1044        // click su una trasmissione del blocco palinsesto sulla pagina del palinsesto di oggi.
1045        if (typeof(settings.RRPalinsesto) != 'undefined' &&  typeof(settings.RRPalinsesto.datapage) != 'undefined' && settings.RRPalinsesto.datapage == today) {
1046          $('.page-riascolta #block-rrblocks-barra-radio li.riascolta', context).on('click', function(e) {
1047    	      e.preventDefault();
1048            var id = $(this).attr('id');
1049		  
1050            if (id.length > 0) {
1051              var path = today.substr(0,4)+'/'+today.replace(/-/g,'')+'_'+$(this).attr('id')+'.m4a';
1052              var url_m3u8 = '//video.radioradicale.it/store-4/_definst_/'+path+'/playlist.m3u8';
1053              
1054              if ($('#player-riascolta').hasClass('empty')) {
1055			            setupRiascoltaPlayer(url_m3u8);
1056              }
1057              else {
1058                loadRiascoltaPlayer(url_m3u8);
1059              }
1060              var infoinonda = $(this).text();
1061              $('div#dati-riascolta').html(infoinonda);
1062              $('div#dati-riascolta').show();
1063              $(window).scrollTop(0);
1064              $('#dropdown-container-barra_radio').hide('fast');
1065            }
1066          });
1067        }
1068      }
1069    }
1070  };
1071
1072  Drupal.behaviors.radioradicale2016Ascolta = {
1073      attach: function (context, settings) {
1074        var prefix;
1075        // click su trasmissione.
1076        $('table.riascolta .ascolta').on('click', function(e) {
1077          e.preventDefault();
1078          var id = $(this).attr('id');
1079          
1080	
1081          if (id.length > 0) {
1082            prefix = settings.RRPalinsesto.datapage.replace(/-/g,'')+'_';
1083            
1084            var path = settings.RRPalinsesto.datapage.substr(0,4)+'/'+prefix+$(this).attr('id')+'.m4a';
1085            var url_m3u8 = '//video.radioradicale.it/store-4/_definst_/'+path+'/playlist.m3u8';
1086
1087			if ($('#player-riascolta').hasClass('empty')) {
1088			            setupRiascoltaPlayer(url_m3u8);
1089            }
1090            else {
1091                loadRiascoltaPlayer(url_m3u8);
1092            }
1093           
1094            var infoinonda = $(this).text();
1095            $('div#dati-riascolta').html(infoinonda);
1096            $('div#dati-riascolta').show();
1097			      $(window).scrollTop(0);
1098          }
1099        });
1100        
1101          // simula il click se presente #hh.mm.ss nella url.
1102          var fragment = window.location.hash.substring(1);
1103          if (fragment.length == 10){
1104            var r = /([o=]+)=?([0-9][0-9]\.[0-9][0-9]\.[0-9][0-9])/g;
1105            var pos = r.exec(fragment);
1106            if (pos[2] !== undefined) {
1107              var arr = pos[2].split('.');
1108              var idstring = arr[0] + "\\." + arr[1] + "\\." + arr[2];
1109              $('#' + idstring+'.ascolta').click();
1110            }
1111          }
1112           
1113      }
1114    };
1115  
1116  Drupal.behaviors.radioradicale2016TrascrizioneCompleta = {
1117      attach: function (context, settings) {
1118        $('.show-transcription', context).on('click', function(e) {
1119          $(this).addClass('hide');
1120          $('.hide-transcription, .full-transcription', context).removeClass('hide');
1121        });
1122      $('.hide-transcription', context).on('click', function(e) {
1123        $(this).addClass('hide');
1124        $('.full-transcription', context).addClass('hide');
1125        $('.show-transcription', context).removeClass('hide');
1126      });
1127      }
1128  };
1129  
1130  
1131  /* Funzioni incluse */
1132  
1133  /*
1134   * Scroll_box
1135   * Version: 1.0 (18/02/2012)
1136   * da Websushi
1137   */
1138  function Scroll_box(boxes,params)
1139  {
1140      if(!params)
1141          params = {};
1142      this.boxes_data = [];
1143      this.fixed_class = params['fixed_class']?params['fixed_class']:'scroll-box-fixed';
1144
1145      // Controlla se pagina con toolbar
1146      if ($('.toolbar').length > 0) {
1147        this.tot_fixed_height = 65;
1148      }
1149      else {
1150        this.tot_fixed_height = 0;
1151      }
1152      this.last_fixed_height = 0;
1153
1154      var Instance = this;
1155      boxes.each( function(index,box)
1156                  {
1157                      box = $(box);
1158                      Instance.boxes_data[index] = {position:box.css('position'),top:box.css('top'),top_offset:box.offset().top};
1159                  });
1160
1161      $(window).bind( 'scroll',
1162                      function()
1163                      {
1164                          for(var i in Instance.boxes_data)
1165                          {
1166                              var box = $(boxes[i]);
1167                              if(($(window).scrollTop()+Instance.tot_fixed_height>Instance.boxes_data[i].top_offset) && !box.hasClass(Instance.fixed_class))
1168                              {
1169                                  box.addClass(Instance.fixed_class);
1170                                  box.css({position:'fixed',top:Instance.tot_fixed_height});
1171                                  Instance.set_tot_fixed_height();
1172                              }
1173
1174                              if(($(window).scrollTop()+Instance.last_fixed_height<=Instance.boxes_data[i].top_offset) && box.hasClass(Instance.fixed_class))
1175                              {
1176                                  box.css({position:Instance.boxes_data[i].position,top:Instance.boxes_data[i].top});
1177                                  box.removeClass(Instance.fixed_class);
1178                                  Instance.set_tot_fixed_height();
1179                              }
1180                          }
1181                      });
1182      this.set_tot_fixed_height =  function()
1183                                  {
1184                                    var top_value;
1185                                    // Controlla se la toolbar è presente
1186                                    if ($('.toolbar').length > 0) {
1187                                      top_value = 65;
1188                                    }
1189                                    else {
1190                                      top_value = 0;
1191                                   } 
1192
1193                                      var last_value = 0;
1194                                      var fixed_elements = $('.'+Instance.fixed_class);
1195                                      fixed_elements.each(function(index,element)
1196                                                          {
1197                                                              last_value = $(fixed_elements).height();
1198                                                              top_value += last_value;
1199                                                          });
1200                                      Instance.tot_fixed_height = top_value;
1201                                      Instance.last_fixed_height = top_value-last_value;
1202                                  };
1203  }
1204  
1205  /*
1206   * An Menu
1207   * Version: 1.0 (18/02/2012)
1208   *
1209   */
1210  function An_menu(params) {
1211      var Instance = this;
1212      this.trigger_event = params.trigger_event ? params.trigger_event : 'click';
1213    this.menu_container = params.menu_container;
1214    this.menu_box = params.menu_box ? params.menu_box : false;
1215    this.active_menu_class = params.active_menu_class ? params.active_menu_class : 'active';
1216    this.enabled = true;
1217    this.menu_speed = 200;
1218    this.easing = params.easing ? params.easing : 'swing';
1219
1220      this.menu_container.children(':not(.open_url)').first().addClass(this.active_menu_class);
1221      this.menu_container.children(':not(.open_url)').bind(this.trigger_event, function () {
1222        
1223        // link dell'elenco completo
1224        var dictionary = {
1225          'quicktabs-tab-rotatore-0':'archivio',
1226          'quicktabs-tab-rotatore-1':'archivio?raggruppamenti_radio=1',
1227          'quicktabs-tab-rotatore-2':'archivio?raggruppamenti_radio=2',
1228          'quicktabs-tab-rotatore-3':'rubriche',
1229          'quicktabs-tab-rotatore-4':'archivio?raggruppamenti_radio=4',
1230          'quicktabs-tab-rotatore-5':'archivio?raggruppamenti_radio=5',
1231          'quicktabs-tab-rotatore-6':'processi',
1232          'quicktabs-tab-rotatore-7':'archivio?raggruppamenti_radio=7',
1233 //         'quicktabs-tab-rotatore-8':'archivio?raggruppamenti_radio=8',
1234        };
1235        var link = $(this).children('a').first();
1236        if (dictionary[link[0].id] !== undefined) {
1237          $('.s-segue').attr('href', dictionary[$(this).children('a')[0].id]);
1238        }
1239        var rt = Instance.select_menu_item($(this));
1240        link.trigger('click');
1241        return rt;
1242      });
1243
1244      this.select_menu_item = function (menu_item) { 
1245        var Instance = this;
1246        var current_selected_item = this.menu_container.children(':not(.open_url).'+this.active_menu_class);
1247        if(menu_item[0]!=current_selected_item[0]) {
1248          menu_item.parent().children(':not(.open_url)').removeClass(this.active_menu_class);
1249          var index = menu_item.parent().children(':not(.open_url)').index(menu_item);
1250          //this.menu_container.trigger('an_menu_item_clicked',[index,menu_item]);
1251          if (this.menu_box) {
1252            this.menu_box.animate(  {top:index * menu_item.outerHeight()},
1253              this.menu_speed,
1254              this.easing,
1255                function() {
1256                  menu_item.addClass(Instance.active_menu_class);
1257                  //Instance.menu_container.trigger('an_menu_item_selected',[index,menu_item]);
1258            });
1259          }
1260        }
1261      };
1262   }
1263 
1264})(jQuery);
1265;

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.