1(function ($, APP, undefined) { 2 "use strict"; 3 /** 4 * ÐоÑÑÐ¾Ð»Ð»ÐµÑ ÑÑÑаниÑÑ ÐºÐ¾Ð½ÑакÑов ÑÑебнÑÑ ÑенÑÑов 5 */ 6 APP.Controls.Page.TrainingProgram = can.Control.extend( 7 { 8 init: function() { 9 this.element.find('.js-tabs').each(function() { 10 new APP.Controls.ToggleTabs(this); 11 }); 12 13 this.element.find('.js-map-pin').each(function() { 14 new APP.Controls.MapPin(this); 15 }); 16 17 this.element.find('.js-form-course').each(function() { 18 new APP.Controls.FormCourse(this); 19 }); 20 21 if (!Modernizr.touch || $('html').hasClass('bx-no-touch')) { 22 this.initScrollr(); 23 } 24 if (this.element.find("#map").closest(".js-tab").css("display") == "block"){ 25 this.initMap(); 26 } 27 }, 28 29 initMap: function() { 30 31 var mapKey = $('#map').data('key'); 32 var $baloon = $('#baloon'); 33 var centerX = $baloon.find(".js-map-pin").first().data('coordx'); 34 var centerY = $baloon.find(".js-map-pin").first().data('coordy'); 35 var myIcon = L.icon({ 36 iconUrl: '/local/images/map-pin.png', 37 iconAnchor: [22, 55], 38 popupAnchor: [10, 5] 39 }); 40 var options = { 41 attributionControl: false, 42 zoomControl: false, 43 scrollWheelZoom: false, 44 zoom: 15, 45 center: new L.LatLng(centerX, centerY), 46 minZoom: 2 47 48 }; 49 var map = L.map('map', options); 50 51 //иниÑиализиÑÑем конÑÑÐ¾Ð»Ñ ÐеоÐикÑеÑа 52 map.gmxControlsManager.init({ 53 gmxDrawing: null 54 }); 55 var blm = map.gmxBaseLayersManager; 56 blm.initDefaults({apiKey: mapKey}).then(function() { 57 blm.setActiveIDs(['hybrid', 'OSM']).setCurrentID('hybrid'); 58 }); 59 60 map.gmxControlsManager.get('hide').setActive(false); 61 62 63 var latlng = L.latLng(centerX, centerY); 64 var myMarker = L.marker(latlng, {icon: myIcon}).addTo(map); 65 66 this.obj = myMarker.bindPopup($baloon.html(), {}); 67 this.marker = myMarker; 68 this.element.find('.leaflet-marker-icon').click(); 69 }, 70 71 ".js-baloon-close click": function() { 72 this.marker.closePopup(); 73 }, 74 75 ".row-title click": function (el) { 76 var index = el.data('index'); 77 this.lessonActive(index); 78 }, 79 80 lessonActive: function (index) { 81 var $plans = this.element.find('.js-plan .row'); 82 var $desc = this.element.find('.js-description .row'); 83 84 $plans.removeClass("active"); 85 $desc.removeClass("active"); 86 87 $plans.eq(index).addClass("active"); 88 $desc.eq(index).addClass("active"); 89 90 $.scrollTo($desc.eq(index), { 91 duration: 800, 92 over: {top: -0.2} 93 }); 94 }, 95 96 '.js-order-course click': function(el, ev) { 97 $(el.attr('href')).find('select option[value="' + el.data('id') + '"]').attr('selected', 'selected').trigger("change"); 98 $.fancybox.open({ 99 fitToView: false, 100 scrolling: false, 101 padding: 0, 102 margin: 0, 103 href: el.attr('href'), 104 105 afterShow: function () { 106 var id = $(this).attr('href'); 107 $(id).find('input[type=text], textarea').first().focus(); 108 } 109 }); 110 }, 111 112 '.js-map click': function () { 113 if (this.element.find('#map').length) { 114 this.initMap();
115 } 116 }, 117 118 '.js-show-on-map click': function() { 119 this.element.find('.js-map').click(); 120 this.element.find('.leaflet-marker-icon').click(); 121 }, 122 123 initScrollr: function() { 124 skrollr.init({ 125 smoothScrolling: true, 126 smoothScrollingDuration: 500, 127 forceHeight: false 128 }); 129 } 130 } 131 ); 132 133})(jQuery, APP);
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.