o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1319712280.4457312†Ü: @value{I" class:EFI"BundledAsset; FI"id; F"%22bdad7891cad6373f7b7437f204449fI"logical_path; FI"medivo/views.js; FI" pathname; FI"b/Users/danielsudol/projects/medivo/medivo_resource/app/assets/javascripts/medivo/views.coffee; FI"content_type; FI"application/javascript; FI" mtime; FI"2011-10-27T11:44:40+01:00; FI" body; FI"ä (function() { window.LabListView = (function() { function LabListView(lab_list) { var view; this.lab_list = lab_list; this.el = $('#lab_list'); this.template = null; if (this.lab_list) { this.render(); } view = this; LabList.tracker_elem.change(function() { return view.render(); }); } LabListView.prototype.render = function() { var view; if (!this.template) { this.template = Handlebars.compile($('#lab_item_template').html()); } view = this; view.el.empty(); return $.each(this.lab_list.getLabs(), function(index, lab) { return view.el.append($(view.template(lab))); }); }; return LabListView; })(); window.MapView = (function() { function MapView(collection, center_point) { var view; this.collection = collection; this.center_point = center_point; this.render(); view = this; LabList.tracker_elem.change(function() { return view.render(); }); } MapView.prototype.el = $('#map_canvas'); MapView.prototype.center_marker = null; MapView.prototype.view = null; MapView.prototype.markerBounds = new google.maps.LatLngBounds(); MapView.prototype.markerBoundsZoomOut = 0.1; MapView.prototype.options = { mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; MapView.prototype.prepareMap = function() { if (!this.view) { return this.view = 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.view, 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.collection.getLabs(), function(index, model) { return model.setMarker(map, markerBounds); }); }; MapView.prototype.clear = function() { this.collection.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.collection) { return; } this.clear(); this.prepareMap(); this.createCenterMarker(); this.setMarkers(this.view, 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.view.fitBounds(this.markerBounds); }; return MapView; })(); }).call(this); ; TI"asset_paths; F[I"b/Users/danielsudol/projects/medivo/medivo_resource/app/assets/javascripts/medivo/views.coffee; FI"dependency_paths; F[{I" path; FI"b/Users/danielsudol/projects/medivo/medivo_resource/app/assets/javascripts/medivo/views.coffee; FI" mtime; FIu: Time j瀀²: @_zoneI"BST; T: offsetiI"hexdigest; F"%5f3f9f7caa73674ed14e10e67eace775I" _version; F"%46dde6621c301f4928e3b34efee9e3b5