o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1321397842.7566981m¾: @value{ I" length:EFi.I" digest; F"%a2384a9c3cce06058f51eb7236f99f60I" source; FI". window.ListView = (function() { function ListView(list, element_id, template_id) { var view; this.list = list; this.el = $("#" + element_id); this.template = Handlebars.compile($("#" + template_id).html()); if (this.list) this.render(); view = this; this.list.tracker_elem.change(function() { return view.render(); }); } ListView.prototype.render = function() { var view; view = this; view.el.empty(); return $.each(this.list.getList(), function(index, item) { return view.el.append($(view.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 map_view; this.list = list; this.center_point = center_point; this.render(); map_view = this; this.list.tracker_elem.change(function() { return map_view.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"%f9723d504390ddeb03d6458c1d746ac8