again: so we have el-> elmt and els -> elts
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 16 Sep 2013 13:13:08 +0000 (15:13 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 16 Sep 2013 13:13:08 +0000 (15:13 +0200)
manifold/js/plugin.js
plugins/active_filters/static/js/active_filters.js
plugins/googlemaps/static/js/googlemaps.js
plugins/hazelnut/static/js/hazelnut.js
plugins/query_editor/static/js/query_editor.js
plugins/resources_selected/static/js/resources_selected.js
plugins/updater/static/js/updater.js

index 5b8eff6..f392961 100644 (file)
@@ -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);
     },
 
 });
index 81b1459..e9548be 100644 (file)
@@ -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();
 
         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();
             }
         },
 
 
         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();
         },
 
index 2a4df3d..83c5fa9 100644 (file)
@@ -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) {
index 13bc5d8..748a0a5 100644 (file)
@@ -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 */
index 3fb1e4e..1e15a01 100644 (file)
             nCloneTh.innerHTML = '<b>Info</b>';
             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"
                 }
             });
 
-            this.el('table_wrapper').css({
+            this.elmt('table_wrapper').css({
                 'padding-top'   : '0em',
                 'padding-bottom': '0em'
             });
 
         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)
             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);
index 56a49af..fb498c2 100644 (file)
@@ -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,
              });
             
             // 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()
index d14d5d8..7ff9b8a 100644 (file)
@@ -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 ****************************/