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) {
/* TEMPLATE */
load_template: function(name, ctx) {
- return Mustache.render(this.el(name).html(), ctx);
+ return Mustache.render(this.elmt(name).html(), ctx);
},
});
* 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($){
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()
// 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;
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();
},
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');
// 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) {
/* 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');
};
// 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 */
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,
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);
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);
},
set_button_state: function(name, state)
{
- this.el(name).attr('disabled', state ? false : 'disabled');
+ this.elmt(name).attr('disabled', state ? false : 'disabled');
},
clear: function()
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)
disable_update_button: function()
{
- this.el('updater').attr('disabled', 'disabled');
+ this.elmt('updater').attr('disabled', 'disabled');
},
/*************************** QUERY HANDLER ****************************/