From 22dba9d34674e0cc1b285e678bbb7bc6482c58ca Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 16 Sep 2013 15:07:18 +0200 Subject: [PATCH] global helper functions need to have grep-able names, i.e. a little bit longer --- manifold/js/plugin.js | 2 +- plugins/active_filters/static/js/active_filters.js | 6 +++--- plugins/googlemaps/static/js/googlemaps.js | 4 ++-- plugins/hazelnut/static/js/hazelnut.js | 2 +- plugins/myplugin/static/js/myplugin.js | 2 +- plugins/query_editor/static/js/query_editor.js | 10 +++++----- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/manifold/js/plugin.js b/manifold/js/plugin.js index b9f74ac4..5b8eff66 100644 --- a/manifold/js/plugin.js +++ b/manifold/js/plugin.js @@ -142,7 +142,7 @@ var Plugin = Class.extend({ } }, - els: function(cls) { + elts: function(cls) { return $('.' + cls, this.el()); }, diff --git a/plugins/active_filters/static/js/active_filters.js b/plugins/active_filters/static/js/active_filters.js index 89ebef28..81b1459e 100644 --- a/plugins/active_filters/static/js/active_filters.js +++ b/plugins/active_filters/static/js/active_filters.js @@ -13,7 +13,7 @@ init: function(options, element) { this._super(options, element); - this.els('closeButton').click(function() { + this.elts('closeButton').click(function() { manifold.raise_event(options.query_uuid, FILTER_REMOVED, filter); }); @@ -60,7 +60,7 @@ check_and_hide_clear_button: function() { // Count the number of filter _inside_ the current plugin - var count = this.els('filterButton').length; + var count = this.elts('filterButton').length; if (count == 1) { // Including the template this.el('clearFilters').hide(); } @@ -85,7 +85,7 @@ // Add an event on click on the close button, call function removeFilter var self = this; - this.els('closeButton').last().click(function() { + this.elts('closeButton').last().click(function() { manifold.raise_event(self.options.query_uuid, FILTER_REMOVED, filter); }); diff --git a/plugins/googlemaps/static/js/googlemaps.js b/plugins/googlemaps/static/js/googlemaps.js index 2add9611..2a4df3d6 100644 --- a/plugins/googlemaps/static/js/googlemaps.js +++ b/plugins/googlemaps/static/js/googlemaps.js @@ -121,7 +121,7 @@ googlemaps_debug_detailed=false; // this.infowindow.close(); // this.infowindow.open(this.map, dict_info.marker); // this.infowindow.setContent(dict_info.marker.content); - // this.els('map-button').unbind('click').click(this, this._button_click); + // this.elts('map-button').unbind('click').click(this, this._button_click); // END turning off temporarily //var button = this.checkbox(record, checked); //this.el('checkbox', this.id_from_record(method, record)).html(button); @@ -214,7 +214,7 @@ googlemaps_debug_detailed=false; self.infowindow.open(map, marker); // onload of the infowindow on the map, bind a click on a button google.maps.event.addListener(self.infowindow, 'domready', function() { - self.els('map-button').unbind('click').click(self, self._button_click); + self.elts('map-button').unbind('click').click(self, self._button_click); // jQuery(".map-button").click({instance: instance_, infoWindow: object.infowindow}, button_click); }); }); diff --git a/plugins/hazelnut/static/js/hazelnut.js b/plugins/hazelnut/static/js/hazelnut.js index ca63e1e7..13bc5d8c 100644 --- a/plugins/hazelnut/static/js/hazelnut.js +++ b/plugins/hazelnut/static/js/hazelnut.js @@ -528,7 +528,7 @@ * Handle clicks on checkboxes: reassociate checkbox click every time * the table is redrawn */ - this.els('hazelnut-checkbox').unbind('click').click(this, this._check_click); + this.elts('hazelnut-checkbox').unbind('click').click(this, this._check_click); if (!this.table) return; diff --git a/plugins/myplugin/static/js/myplugin.js b/plugins/myplugin/static/js/myplugin.js index 18011150..da65c430 100644 --- a/plugins/myplugin/static/js/myplugin.js +++ b/plugins/myplugin/static/js/myplugin.js @@ -61,7 +61,7 @@ show_hide_button: function() { - // this.id, this.el, this.cl, this.els + // this.id, this.el, this.cl, this.elts // same output as a jquery selector with some guarantees }, diff --git a/plugins/query_editor/static/js/query_editor.js b/plugins/query_editor/static/js/query_editor.js index e065a657..3fb1e4ec 100644 --- a/plugins/query_editor/static/js/query_editor.js +++ b/plugins/query_editor/static/js/query_editor.js @@ -37,13 +37,13 @@ this.listen_query(options.query_uuid); - this.els('queryeditor-auto-filter').change(this.event_filter_added('=')); - this.els('queryeditor-filter').change(this.event_filter_added('=')); - this.els('queryeditor-filter-min').change(this.event_filter_added('>')); - this.els('queryeditor-filter-max').change(this.event_filter_added('<')); + this.elts('queryeditor-auto-filter').change(this.event_filter_added('=')); + this.elts('queryeditor-filter').change(this.event_filter_added('=')); + this.elts('queryeditor-filter-min').change(this.event_filter_added('>')); + this.elts('queryeditor-filter-max').change(this.event_filter_added('<')); var self = this; - this.els('queryeditor-check').click(function() { + this.elts('queryeditor-check').click(function() { manifold.raise_event(self.options.query_uuid, this.checked?FIELD_ADDED:FIELD_REMOVED, this.value); }); -- 2.43.0