From 80f12b8fb93ab7227bffad8c7aa22020fab007e5 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 16 Sep 2013 15:13:08 +0200 Subject: [PATCH] again: so we have el-> elmt and els -> elts --- manifold/js/plugin.js | 8 +++---- .../static/js/active_filters.js | 16 +++++++------- plugins/googlemaps/static/js/googlemaps.js | 4 ++-- plugins/hazelnut/static/js/hazelnut.js | 4 ++-- .../query_editor/static/js/query_editor.js | 22 +++++++++---------- .../static/js/resources_selected.js | 12 +++++----- plugins/updater/static/js/updater.js | 4 ++-- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/manifold/js/plugin.js b/manifold/js/plugin.js index 5b8eff66..f3929617 100644 --- a/manifold/js/plugin.js +++ b/manifold/js/plugin.js @@ -133,17 +133,17 @@ var Plugin = Class.extend({ return ret; }, - el: function() { + elmt: function() { if (arguments.length == 0) { return $('#' + this.id()); } else { // We make sure to search _inside_ the dom tag of the plugin - return $('#' + this.id.apply(this, arguments), this.el()); + return $('#' + this.id.apply(this, arguments), this.elmt()); } }, elts: function(cls) { - return $('.' + cls, this.el()); + return $('.' + cls, this.elmt()); }, id_from_filter: function(filter, use_value) { @@ -239,7 +239,7 @@ var Plugin = Class.extend({ /* TEMPLATE */ load_template: function(name, ctx) { - return Mustache.render(this.el(name).html(), ctx); + return Mustache.render(this.elmt(name).html(), ctx); }, }); diff --git a/plugins/active_filters/static/js/active_filters.js b/plugins/active_filters/static/js/active_filters.js index 81b1459e..e9548be9 100644 --- a/plugins/active_filters/static/js/active_filters.js +++ b/plugins/active_filters/static/js/active_filters.js @@ -4,7 +4,7 @@ * License: GPLv3 */ -// NOTE: We are not making use of element, but this.el() instead... +// NOTE: We are not making use of element, but this.elmt() instead... (function($){ @@ -17,7 +17,7 @@ manifold.raise_event(options.query_uuid, FILTER_REMOVED, filter); }); - this.el('clearFilters').click(function () { + this.elmt('clearFilters').click(function () { manifold.raise_event(options.query_uuid, CLEAR_FILTERS); }); this.check_and_hide_clear_button(); @@ -49,12 +49,12 @@ show_clear_button: function() { - this.el('clearFilters').show(); + this.elmt('clearFilters').show(); }, hide_clear_button: function() { - this.el('clearFilters').hide(); + this.elmt('clearFilters').hide(); }, check_and_hide_clear_button: function() @@ -62,7 +62,7 @@ // Count the number of filter _inside_ the current plugin var count = this.elts('filterButton').length; if (count == 1) { // Including the template - this.el('clearFilters').hide(); + this.elmt('clearFilters').hide(); } }, @@ -74,14 +74,14 @@ add_filter: function(filter) { - var template = this.el('template').html(); + var template = this.elmt('template').html(); var ctx = { id: this.id(this.id_from_filter(filter, false)), span: this.str_from_filter(filter) }; var output = Mustache.render(template, ctx); - this.el('myActiveFilters').append(output); + this.elmt('myActiveFilters').append(output); // Add an event on click on the close button, call function removeFilter var self = this; @@ -94,7 +94,7 @@ remove_filter: function(filter) { - this.el(this.id_from_filter(filter, false)).remove(); + this.elmt(this.id_from_filter(filter, false)).remove(); this.check_and_hide_clear_button(); }, diff --git a/plugins/googlemaps/static/js/googlemaps.js b/plugins/googlemaps/static/js/googlemaps.js index 2a4df3d6..83c5fa95 100644 --- a/plugins/googlemaps/static/js/googlemaps.js +++ b/plugins/googlemaps/static/js/googlemaps.js @@ -29,7 +29,7 @@ googlemaps_debug_detailed=false; this.map_markers = {} /* XXX Events XXX */ - this.el().on('show', this, this.on_show); + this.elmt().on('show', this, this.on_show); // TODO in destructor // $(window).unbind('Hazelnut'); @@ -124,7 +124,7 @@ googlemaps_debug_detailed=false; // 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); + //this.elmt('checkbox', this.id_from_record(method, record)).html(button); }, checkbox: function(record, checked) { diff --git a/plugins/hazelnut/static/js/hazelnut.js b/plugins/hazelnut/static/js/hazelnut.js index 13bc5d8c..748a0a5d 100644 --- a/plugins/hazelnut/static/js/hazelnut.js +++ b/plugins/hazelnut/static/js/hazelnut.js @@ -24,7 +24,7 @@ /* XXX Events XXX */ // this.$element.on('show.Datatables', this.on_show); - this.el().on('show', this, this.on_show); + this.elmt().on('show', this, this.on_show); // Unbind all events using namespacing // TODO in destructor // $(window).unbind('Hazelnut'); @@ -93,7 +93,7 @@ }; // the intention here is that options.datatables_options as coming from the python object take precedence // XXX DISABLED by jordan: was causing errors in datatables.js $.extend(actual_options, options.datatables_options ); - this.table = this.el('table').dataTable(actual_options); + this.table = this.elmt('table').dataTable(actual_options); /* Setup the SelectAll button in the dataTable header */ /* xxx not sure this is still working */ diff --git a/plugins/query_editor/static/js/query_editor.js b/plugins/query_editor/static/js/query_editor.js index 3fb1e4ec..1e15a018 100644 --- a/plugins/query_editor/static/js/query_editor.js +++ b/plugins/query_editor/static/js/query_editor.js @@ -56,17 +56,17 @@ nCloneTh.innerHTML = 'Info'; nCloneTd.className = "center"; nCloneTh.className = "center"; - this.el('table thead tr').each(function() { + this.elmt('table thead tr').each(function() { this.insertBefore(nCloneTh, this.childNodes[0]); }); - this.el('table tbody tr').each(function() { + this.elmt('table tbody tr').each(function() { this.insertBefore(nCloneTd.cloneNode( true ), this.childNodes[0]); }); */ // We are currently using a DataTable display, but another browsing component could be better //jQuery('#'+this.options.plugin_uuid+'-table').dataTable... - var metaTable = this.el('table').dataTable({ + var metaTable = this.elmt('table').dataTable({ bFilter : false, bPaginate : false, bInfo : false, @@ -84,7 +84,7 @@ var self = this; // Actions on the newly added fields - this.el('table tbody td span').on('click', function() { + this.elmt('table tbody td span').on('click', function() { var nTr = this.parentNode.parentNode; // use jQuery UI instead of images to keep a common UI // class="ui-icon treeclick ui-icon-triangle-1-s tree-minus" @@ -101,7 +101,7 @@ } }); - this.el('table_wrapper').css({ + this.elmt('table_wrapper').css({ 'padding-top' : '0em', 'padding-bottom': '0em' }); @@ -112,12 +112,12 @@ check_field: function(field) { - this.el('check', field).attr('checked', true); + this.elmt('check', field).attr('checked', true); }, uncheck_field: function(field) { - this.el('check', field).attr('checked', false); + this.elmt('check', field).attr('checked', false); }, update_filter_value: function(filter, removed) @@ -131,17 +131,17 @@ var id = this.id_from_field(key); if (op == '=') { - var element = this.el(id); + var element = this.elmt(id); } else { var suffix; if (op == '<') { - this.el(id, 'max').val(value); + this.elmt(id, 'max').val(value); } else if (op == '>') { - this.el(id, 'min').val(value); + this.elmt(id, 'min').val(value); } else { return; } - var element = this.el(id, suffix); + var element = this.elmt(id, suffix); } element.val(removed?null:value); diff --git a/plugins/resources_selected/static/js/resources_selected.js b/plugins/resources_selected/static/js/resources_selected.js index 56a49af6..fb498c2d 100644 --- a/plugins/resources_selected/static/js/resources_selected.js +++ b/plugins/resources_selected/static/js/resources_selected.js @@ -30,7 +30,7 @@ this._super(options, element); var self = this; - this.table = this.el('table').dataTable({ + this.table = this.elmt('table').dataTable({ //sPaginationType: 'full_numbers', // Use pagination sPaginationType: 'bootstrap', //bJQueryUI : true, @@ -48,10 +48,10 @@ }); // XXX This should not be done at init... - this.el('update').click(this, this.do_update); - this.el('refresh').click(this, this.do_refresh); - this.el('reset').click(this, this.do_reset); - this.el('clear_annotations').click(this, this.do_clear_annotations); + this.elmt('update').click(this, this.do_update); + this.elmt('refresh').click(this, this.do_refresh); + this.elmt('reset').click(this, this.do_reset); + this.elmt('clear_annotations').click(this, this.do_clear_annotations); this.listen_query(options.query_uuid); }, @@ -87,7 +87,7 @@ set_button_state: function(name, state) { - this.el(name).attr('disabled', state ? false : 'disabled'); + this.elmt(name).attr('disabled', state ? false : 'disabled'); }, clear: function() diff --git a/plugins/updater/static/js/updater.js b/plugins/updater/static/js/updater.js index d14d5d8b..7ff9b8af 100644 --- a/plugins/updater/static/js/updater.js +++ b/plugins/updater/static/js/updater.js @@ -25,7 +25,7 @@ arm_button: function() { - this.el('updater').click(this, this.submit_update_request); + this.elmt('updater').click(this, this.submit_update_request); }, submit_update_request: function (e) @@ -40,7 +40,7 @@ disable_update_button: function() { - this.el('updater').attr('disabled', 'disabled'); + this.elmt('updater').attr('disabled', 'disabled'); }, /*************************** QUERY HANDLER ****************************/ -- 2.43.0