From d549b83164f10793e799da646e6704844607f190 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 17 Sep 2013 11:56:30 +0200 Subject: [PATCH] rename googlemaps into googlemap --- plugins/{googlemaps => googlemap}/__init__.py | 8 ++-- .../static/css/googlemap.css} | 0 .../static/googlemap.html} | 0 .../static/js/googlemap.js} | 48 +++++++++---------- portal/sliceview.py | 4 +- 5 files changed, 30 insertions(+), 30 deletions(-) rename plugins/{googlemaps => googlemap}/__init__.py (89%) rename plugins/{googlemaps/static/css/googlemaps.css => googlemap/static/css/googlemap.css} (100%) rename plugins/{googlemaps/static/googlemaps.html => googlemap/static/googlemap.html} (100%) rename plugins/{googlemaps/static/js/googlemaps.js => googlemap/static/js/googlemap.js} (88%) diff --git a/plugins/googlemaps/__init__.py b/plugins/googlemap/__init__.py similarity index 89% rename from plugins/googlemaps/__init__.py rename to plugins/googlemap/__init__.py index 38c6564c..bce84f54 100644 --- a/plugins/googlemaps/__init__.py +++ b/plugins/googlemap/__init__.py @@ -1,6 +1,6 @@ from unfold.plugin import Plugin -class GoogleMaps (Plugin): +class GoogleMap (Plugin): # set checkboxes if a final column with checkboxes is desired # pass columns as the initial set of columns @@ -16,7 +16,7 @@ class GoogleMaps (Plugin): self.zoom=zoom def template_file (self): - return "googlemaps.html" + return "googlemap.html" def template_env (self, request): env={} @@ -25,13 +25,13 @@ class GoogleMaps (Plugin): def requirements (self): reqs = { 'js_files' : [ "https://maps.googleapis.com/maps/api/js?sensor=false", - "/js/googlemaps.js", + "/js/googlemap.js", "/js/markerclusterer.js", "js/manifold.js", "js/manifold-query.js", "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", "js/unfold-helper.js", ], - 'css_files' : [ "css/googlemaps.css", + 'css_files' : [ "css/googlemap.css", ], } return reqs diff --git a/plugins/googlemaps/static/css/googlemaps.css b/plugins/googlemap/static/css/googlemap.css similarity index 100% rename from plugins/googlemaps/static/css/googlemaps.css rename to plugins/googlemap/static/css/googlemap.css diff --git a/plugins/googlemaps/static/googlemaps.html b/plugins/googlemap/static/googlemap.html similarity index 100% rename from plugins/googlemaps/static/googlemaps.html rename to plugins/googlemap/static/googlemap.html diff --git a/plugins/googlemaps/static/js/googlemaps.js b/plugins/googlemap/static/js/googlemap.js similarity index 88% rename from plugins/googlemaps/static/js/googlemaps.js rename to plugins/googlemap/static/js/googlemap.js index 83c5fa95..118cfa60 100644 --- a/plugins/googlemaps/static/js/googlemaps.js +++ b/plugins/googlemap/static/js/googlemap.js @@ -8,15 +8,15 @@ * - infowindow is not properly reopened when the maps does not have the focus */ -googlemaps_debug=true; -googlemaps_debug_detailed=false; +googlemap_debug=true; +googlemap_debug_detailed=false; (function($){ - var GoogleMaps = Plugin.extend({ + var GoogleMap = Plugin.extend({ init: function(options, element) { - if (googlemaps_debug) messages.debug("GoogleMaps.init"); + if (googlemap_debug) messages.debug("GoogleMap.init"); this._super(options, element); /* Member variables */ @@ -50,7 +50,7 @@ googlemaps_debug_detailed=false; /* PLUGIN EVENTS */ on_show: function(e) { - if (googlemaps_debug) messages.debug("on_show"); + if (googlemap_debug) messages.debug("on_show"); var self = e.data; google.maps.event.trigger(self.map, 'resize'); }, // on_show @@ -62,7 +62,7 @@ googlemaps_debug_detailed=false; /** */ initialize_map: function() { - if (googlemaps_debug) messages.debug("initialize_map"); + if (googlemap_debug) messages.debug("initialize_map"); this.markerCluster = null; this.coords = new Array(); @@ -75,13 +75,13 @@ googlemaps_debug_detailed=false; var domid = this.options.plugin_uuid + manifold.separator + 'map'; var el = document.getElementById(domid); - if (googlemaps_debug) messages.debug("gmap.initialize_map based on domid=" + domid + " el=" + el); + if (googlemap_debug) messages.debug("gmap.initialize_map based on domid=" + domid + " el=" + el); this.map = new google.maps.Map(el, myOptions); this.infowindow = new google.maps.InfoWindow(); }, // initialize_map set_checkbox: function(record, checked) { - if (googlemaps_debug_detailed) messages.debug ("set_checkbox"); + if (googlemap_debug_detailed) messages.debug ("set_checkbox"); /* Default: checked = true */ if (typeof checked === 'undefined') checked = true; @@ -113,7 +113,7 @@ googlemaps_debug_detailed=false; dict_info.in_set = checked; dict_info.marker.content = this.get_marker_content(dict_info.record, checked); - // Thierry - this code seems to cause the googlmap area to go all grayed out + // Thierry - this code seems to cause the googlemap area to go all grayed out // once all the quesries have come back // BEG turning off temporarily // // Update opened infowindow @@ -128,7 +128,7 @@ googlemaps_debug_detailed=false; }, checkbox: function(record, checked) { - if (googlemaps_debug_detailed) messages.debug ("checkbox"); + if (googlemap_debug_detailed) messages.debug ("checkbox"); if (typeof checked === 'undefined') checked = false; @@ -148,14 +148,14 @@ googlemaps_debug_detailed=false; }, get_marker_content: function(record, checked) { - if (googlemaps_debug_detailed) messages.debug ("get_marker_content"); + if (googlemap_debug_detailed) messages.debug ("get_marker_content"); return '

' + this.method + ': ' + get_value(record['resource_hrn']) + '
network: ' + get_value(record['network'])+'

' + this.checkbox(record, checked); }, /** */ new_record: function(record) { - if (googlemaps_debug_detailed) messages.debug ("new_record"); + if (googlemap_debug_detailed) messages.debug ("new_record"); // get the coordinates var latitude=get_value(record['latitude']); var longitude=get_value(record['longitude']); @@ -204,7 +204,7 @@ googlemaps_debug_detailed=false; }, // new_record addInfoWindow: function(marker, map) { - if (googlemaps_debug_detailed) messages.debug ("addInfoWindow"); + if (googlemap_debug_detailed) messages.debug ("addInfoWindow"); var self = this; google.maps.event.addListener(marker, 'click', function () { if(self.infowindow){ @@ -226,7 +226,7 @@ googlemaps_debug_detailed=false; /*************************** RECORD HANDLER ***************************/ on_new_record: function(record) { - if (googlemaps_debug_detailed) messages.debug("on_new_record"); + if (googlemap_debug_detailed) messages.debug("on_new_record"); if (this.received_all) // update checkbox for record this.set_checkbox(record); @@ -236,24 +236,24 @@ googlemaps_debug_detailed=false; }, on_clear_records: function(record) { - if (googlemaps_debug_detailed) messages.debug("on_clear_records"); + if (googlemap_debug_detailed) messages.debug("on_clear_records"); }, // Could be the default in parent on_query_in_progress: function() { - if (googlemaps_debug) messages.debug("on_query_in_progress"); + if (googlemap_debug) messages.debug("on_query_in_progress"); this.spin(); }, on_query_done: function() { - if (googlemaps_debug) messages.debug("on_query_done"); + if (googlemap_debug) messages.debug("on_query_done"); if (this.received_all) this.unspin(); this.received_set = true; }, on_field_state_changed: function(data) { - if (googlemaps_debug) messages.debug("on_field_state_changed"); + if (googlemap_debug) messages.debug("on_field_state_changed"); switch(data.request) { case FIELD_REQUEST_ADD: case FIELD_REQUEST_ADD_RESET: @@ -272,22 +272,22 @@ googlemaps_debug_detailed=false; // all on_all_new_record: function(record) { - if (googlemaps_debug_detailed) messages.debug("on_all_new_record"); + if (googlemap_debug_detailed) messages.debug("on_all_new_record"); this.new_record(record); }, on_all_clear_records: function() { - if (googlemaps_debug) messages.debug("on_all_clear_records"); + if (googlemap_debug) messages.debug("on_all_clear_records"); }, on_all_query_in_progress: function() { - if (googlemaps_debug) messages.debug("on_all_query_in_progress"); + if (googlemap_debug) messages.debug("on_all_query_in_progress"); // XXX parent this.spin(); }, on_all_query_done: function() { - if (googlemaps_debug) messages.debug("on_all_query_done"); + if (googlemap_debug) messages.debug("on_all_query_done"); // MarkerClusterer var markers = []; $.each(this.map_markers, function (k, v) { markers.push(v.marker); }); @@ -330,7 +330,7 @@ googlemaps_debug_detailed=false; /************************** PRIVATE METHODS ***************************/ _button_click: function(e) { - if (googlemaps_debug) messages.debug("_button_click"); + if (googlemap_debug) messages.debug("_button_click"); var self = e.data; var escaped_key = self.key_from_id($(this).parent().attr('id'), 'checkbox'); @@ -344,6 +344,6 @@ googlemaps_debug_detailed=false; }); - $.plugin('GoogleMaps', GoogleMaps); + $.plugin('GoogleMap', GoogleMap); })(jQuery); diff --git a/portal/sliceview.py b/portal/sliceview.py index fff03713..fbc43418 100644 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -13,7 +13,7 @@ from plugins.stack.stack import Stack from plugins.tabs.tabs import Tabs from plugins.hazelnut import Hazelnut from plugins.resources_selected import ResourcesSelected -from plugins.googlemaps import GoogleMaps +from plugins.googlemap import GoogleMap from plugins.senslabmap.senslabmap import SensLabMap from plugins.querycode.querycode import QueryCode from plugins.query_editor import QueryEditor @@ -131,7 +131,7 @@ class SliceView (LoginRequiredAutoLogoutView): }, ) - resources_as_map = GoogleMaps( + resources_as_map = GoogleMap( page = page, title = 'Geographic view', domid = 'gmap', -- 2.43.0