1(function( $ ) { 2 'use strict'; 3 4 /** 5 * All of the code for your public-facing JavaScript source 6 * should reside in this file. 7 * 8 * Note: It has been assumed you will write jQuery code here, so the 9 * $ function reference has been prepared for usage within the scope 10 * of this function. 11 * 12 * This enables you to define handlers, for when the DOM is ready: 13 * 14 * $(function() { 15 * 16 * }); 17 * 18 * When the window is loaded: 19 * 20 * $( window ).load(function() { 21 * 22 * }); 23 * 24 * ...and/or other possibilities. 25 * 26 * Ideally, it is not considered best practise to attach more than a 27 * single DOM-ready or window-load handler for a particular page. 28 * Although scripts in the WordPress core, Plugins and Themes may be 29 * practising this, we should strive to set a better example in our own work. 30 */ 31 $(function() { 32 var mobileSocialLinks = '<span class="mobile social-links">'; 33 mobileSocialLinks += '<a href="https://x.com/muoversiatorino" target="_blank" rel="noopener"><img src="https://www.muoversiatorino.it/wp-content/plugins/mato-customize/public/images/x.svg" width="30" height="30"></a>'; 34 mobileSocialLinks += '<a href="https://www.instagram.com/muoversiatorino" target="_blank" rel="noopener"><img src="https://www.muoversiatorino.it/wp-content/plugins/mato-customize/public/images/instagram-tile.svg" width="30" height="30"></a></span>'; 35 // mobileSocialLinks += '<a href="https://t.me/matocantieri" target="_blank" rel="noopener"><img src="https://www.muoversiatorino.it/wp-content/plugins/mato-customize/public/images/telegram.svg" width="30" height="30"></a></span>'; 36 const bodyClass = document.body.className; 37 if (!document.body.classList.contains('page-template-template-app')) {// i loghi vengono messi sempre tranne nel caso ti template-app 38 jQuery(mobileSocialLinks).insertAfter('.navbar-header .logo'); 39 } 40 jQuery('#cerca-fermata').submit(function (e) { 41 e.preventDefault(); 42 var fermata = jQuery('#numero-fermata').val(); 43 jQuery.ajax("https://plan.muoversiatorino.it/otp/routers/mato/index/stops/gtt:" + fermata) 44 .done(function () { 45 window.location.href = "https://mato.muoversiatorino.it/stops/gtt:" + fermata; 46 }) 47 .fail(function (jqXHR, textStatus) { 48 swal( 49 dictionary.stop_not_found_title, 50 dictionary.stop_not_found_description, 51 'error' 52 ) 53 }); 54 }); 55 jQuery('#cerca-linea').submit(function (e) { 56 e.preventDefault(); 57 var linea = jQuery('#numero-linea').val(); 58 if (linea.indexOf(' /') > -1) { 59 var index = linea.indexOf(' /'); 60 linea = linea.substring(0, index) + 'B'; 61 } else if (linea.indexOf('/') > -1) { 62 var index = linea.indexOf('/'); 63 linea = linea.substring(0, index) + 'B'; 64 } 65 jQuery.ajax("https://plan.muoversiatorino.it/otp/routers/mato/index/routes/gtt:" + linea + "U") 66 .done(function () { 67 window.location.href = "https://mato.muoversiatorino.it/route/gtt:" + linea + "U"; 68 }) 69 .fail(function (jqXHR, textStatus) { 70 swal( 71 dictionary.line_not_found_title, 72 dictionary.line_not_found_description, 73 'error' 74 ) 75 }); 76 }); 77 jQuery("#getDirections").click(function () { 78 if (jQuery("#from-coordinates").val() && jQuery("#to-coordinates").val()) { 79 var e = Math.round(new Date(jQuery("select.date").val() + "T" + jQuery("#timeEntry").val() + ":00+01:00").getTime() / 1e3); 80 e = "false" == jQuery("select.arrive").val() ? "" : "&arriveBy=false" , "" != jQuery("#from").val() && "" != jQuery("#to").val() && "" != jQuery("#from-coordinates").val() && "" != jQuery("#to-coordinates").val() ? window.open("https://mato.muoversiatorino.it/plan/" + encodeURIComponent(jQuery("#from").val() + "::" + jQuery("#from-coordinates").val()) + "/" + encodeURIComponent(jQuery("#to").val() + "::" + jQuery("#to-coordinates").val()) + "?modes=BUS%2CTRAM%2CRAIL%2CSUBWAY%2CWALK" + e, "_blank") : swal( 81 dictionary.missing_information_title, 82 dictionary.missing_information_description, 83 'error' 84 ) 85 } else { 86 window.open("https://mato.muoversiatorino.it/nearyou", "_blank"); 87 } 88 }); 89 jQuery('#tab-container').easytabs({updateHash: false}); 90 }); 91 92})( jQuery );
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.