"start": $.now(),
"last": $.now()
};
+ var m_paz; // will be initialised below
// if (console && console.log) // disabled, will fail in IE8
// create a parameters array and pass it to the pz2's constructor
// then register the form submit event with the pz2.search function
// autoInit is set to true on default
- if (!mkws.paz) {
- mkws.paz = new pz2({ "onshow": my_onshow,
- "windowid": teamName,
- "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way
- "pazpar2path": mkws_config.pazpar2_url,
- "oninit": my_oninit,
- "onstat": my_onstat,
- "onterm": my_onterm,
- "termlist": "xtargets,subject,author",
- "onbytarget": my_onbytarget,
- "usesessions" : mkws_config.use_service_proxy ? false : true,
- "showResponseType": '', // or "json" (for debugging?)
- "onrecord": my_onrecord });
- }
+ m_paz = new pz2({ "onshow": my_onshow,
+ "windowid": teamName,
+ "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way
+ "pazpar2path": mkws_config.pazpar2_url,
+ "oninit": my_oninit,
+ "onstat": my_onstat,
+ "onterm": my_onterm,
+ "termlist": "xtargets,subject,author",
+ "onbytarget": my_onbytarget,
+ "usesessions" : mkws_config.use_service_proxy ? false : true,
+ "showResponseType": '', // or "json" (for debugging?)
+ "onrecord": my_onrecord });
if (!isNaN(parseInt(mkws_config.perpage_default))) {
m_recPerPage = parseInt(mkws_config.perpage_default);
//
function my_oninit(teamName) {
debug("init for " + teamName);
- mkws.paz.stat();
- mkws.paz.bytarget();
+ m_paz.stat();
+ m_paz.bytarget();
}
function my_onrecord(data, teamName) {
debug("record for " + teamName);
// FIXME: record is async!!
- clearTimeout(mkws.paz.recordTimer);
+ clearTimeout(m_paz.recordTimer);
// in case on_show was faster to redraw element
var detRecordDiv = document.getElementById('mkwsDet_'+data.recid);
if (detRecordDiv) return;
if (!m_submitted) return false;
resetPage();
loadSelect();
- mkws.paz.show(0, m_recPerPage, m_sort);
+ m_paz.show(0, m_recPerPage, m_sort);
return false;
}
}
debug("triggerSearch(" + m_query + "): filters = " + $.toJSON(m_filters) + ", pp2filter = " + pp2filter + ", params = " + $.toJSON(params));
- mkws.paz.search(m_query, m_recPerPage, m_sort, pp2filter, undefined, params);
+ m_paz.search(m_query, m_recPerPage, m_sort, pp2filter, undefined, params);
}
mkws.showPage = function (pageNum)
{
m_curPage = pageNum;
- mkws.paz.showPage(m_curPage - 1);
+ m_paz.showPage(m_curPage - 1);
}
// simple paging functions
mkws.pagerNext = function () {
if (m_totalRec - m_recPerPage*m_curPage > 0) {
- mkws.paz.showNext();
+ m_paz.showNext();
m_curPage++;
}
}
mkws.pagerPrev = function () {
- if (mkws.paz.showPrev() != false)
+ if (m_paz.showPrev() != false)
m_curPage--;
}
return;
}
// request the record
- mkws.paz.record(recId);
+ m_paz.record(recId);
}
}
- function run_auto_searches() {
+ mkws.run_auto_searches = function() {
debug("running auto searches");
$('[id^="mkwsRecords"]').each(function () {
mkws_config.pazpar2_url);
} else {
// raw pp2
- run_auto_searches();
+ mkws.run_auto_searches();
}
});
debug("Service proxy auth successfully done");
mkws.authenticated = true;
- run_auto_searches();
+ mkws.run_auto_searches();
});
}
})(jQuery);