o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1322611695.2631302× : @value{ I" length:EFiI" digest; F"%37ec7b091203d8764dfc3dedd08bbe63I" source; FI" window.ListView = (function() { function ListView(list, element_id, template_id) { var _this = this; this.list = list; this.el = $("#" + element_id); this.template = Handlebars.compile($("#" + template_id).html()); if (this.list) this.render(); this.list.tracker_elem.change(function() { return _this.render(); }); } ListView.prototype.render = function() { var _this = this; this.el.empty(); return $.each(this.list.getList(), function(index, item) { return _this.el.append($(_this.template(item))); }); }; return ListView; })(); (function() { var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; window.LabListView = (function() { __extends(LabListView, ListView); function LabListView(list) { this.list = list; LabListView.__super__.constructor.call(this, this.list, 'lab_list', 'lab_item_template'); } return LabListView; })(); window.MapView = (function() { MapView.prototype.el = $('#map_canvas'); MapView.prototype.center_marker = null; MapView.prototype.map = null; MapView.prototype.markerBounds = new google.maps.LatLngBounds(); MapView.prototype.markerBoundsZoomOut = 0.1; function MapView(list, center_point) { var _this = this; this.list = list; this.center_point = center_point; this.render(); this.list.tracker_elem.change(function() { return _this.render(); }); } MapView.prototype.options = { mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; MapView.prototype.prepareMap = function() { if (!document.getElementById("map_canvas")) return; if (!this.map) { return this.map = new google.maps.Map(document.getElementById("map_canvas"), this.options); } }; MapView.prototype.createCenterMarker = function() { var point; if (this.center_point) { point = new google.maps.LatLng(this.center_point.lat, this.center_point.lng); this.center_marker = new google.maps.Marker({ position: point, map: this.map, title: this.center_point.title, icon: "/assets/medivo/arrow.png" }); } if (this.markerBounds && this.center_marker) { return this.markerBounds.extend(this.center_marker.position); } }; MapView.prototype.setMarkers = function(map, markerBounds) { return $.each(this.list.getList(), function(index, model) { return model.setMarker(map, markerBounds); }); }; MapView.prototype.clear = function() { this.list.clearMarkers(); if (this.center_marker) { this.center_marker.setMap(null); this.center_marker = null; } return this.markerBounds = new google.maps.LatLngBounds(); }; MapView.prototype.render = function() { var extendPoint; if (!this.list) return; this.clear(); this.prepareMap(); if (!this.map) return; this.createCenterMarker(); this.setMarkers(this.map, this.markerBounds); if (this.markerBounds.getNorthEast().equals(this.markerBounds.getSouthWest())) { extendPoint = new google.maps.LatLng(this.markerBounds.getNorthEast().lat() + this.markerBoundsZoomOut, this.markerBounds.getNorthEast().lng() + this.markerBoundsZoomOut); this.markerBounds.extend(extendPoint); } return this.map.fitBounds(this.markerBounds); }; return MapView; })(); }).call(this); ; FI" _version; F"%c81069a38bcabb32bceea00dba2121f1