that.name = function() { return m_teamName; }
var m_submitted = false;
var m_query; // initially undefined
- var m_sort; // will be set below
+ var m_sortOrder; // will be set below
var m_perpage; // will be set below
var m_filters = [];
var m_totalRec = 0;
debug("start running MKWS");
- m_sort = mkws_config.sort_default;
+ m_sortOrder = mkws_config.sort_default;
m_perpage = mkws_config.perpage_default;
debug("Create main pz2 object");
if (!m_submitted) return false;
resetPage();
loadSelect();
- m_paz.show(0, m_perpage, m_sort);
+ m_paz.show(0, m_perpage, m_sortOrder);
return false;
}
function loadSelect ()
{
var node = findnode('.mkwsSort');
- if (node.length && node.val() != m_sort) {
- debug("changing m_sort from " + m_sort + " to " + node.val());
- m_sort = node.val();
+ if (node.length && node.val() != m_sortOrder) {
+ debug("changing m_sortOrder from " + m_sortOrder + " to " + node.val());
+ m_sortOrder = node.val();
}
node = findnode('.mkwsPerpage');
if (node.length && node.val() != m_perpage) {
m_query = query;
}
if (sort) {
- m_sort = sort;
+ m_sortOrder = sort;
}
if (targets) {
m_filters.push({ id: targets, name: targets });
// We can use: params.torusquery = "udb=NAME"
// Note: that won't work when running against raw pazpar2
- m_paz.search(m_query, m_perpage, m_sort, pp2filter, undefined, params);
+ m_paz.search(m_query, m_perpage, m_sortOrder, pp2filter, undefined, params);
}
function mkwsHtmlSort() {
- debug("HTML sort, m_sort = '" + m_sort + "'");
+ debug("HTML sort, m_sortOrder = '" + m_sortOrder + "'");
var sort_html = '<select class="mkwsSort mkwsTeam_' + m_teamName + '">';
for(var i = 0; i < mkws_config.sort_options.length; i++) {
var val = opt.length == 1 ? opt[0] : opt[1];
sort_html += '<option value="' + key + '"';
- if (m_sort == key || m_sort == val) {
+ if (m_sortOrder == key || m_sortOrder == val) {
sort_html += ' selected="selected"';
}
sort_html += '>' + M(val) + '</option>';
function findnode(selector, teamName) {
teamName = teamName || m_teamName;
- selector = selector.split(',').map(function(s) {
+ selector = $.map(selector.split(','), function(s, i) {
return s + '.mkwsTeam_' + teamName;
}).join(',');