perpage: 20,
sort: 'relevance',
filter: null,
- query:null,
+ query:'',
recid:null
},
state: {},
+// Wrapper for jQuery
+(function ($) {
+
// So we can use jQuery BBQ with Drupal 6 and its 1.2.6 jQuery
if (!$.isArray) $.isArray = function(obj) {
return Object.prototype.toString.call(obj) === "[object Array]";
mkdru.pz2Record = function (data) {
clearTimeout(mkdru.pz2.showTimer);
$('.mkdru-results').hide();
- $('.mkdru-detail').html(Drupal.theme('mkdruDetail', data));
- $('.mkdru-detail-back').bind('click', function () {$.bbq.removeState('recid');});
+ $('.mkdru-detail').html(Drupal.theme('mkdruDetail', data,
+ mkdru.hashAddDelOne(null, null, 'recid')));
$('.mkdru-detail').show();
clearTimeout(mkdru.pz2.recordTimer);
};
}
// Other internal link
else {
- // need to run search again to limit targets
+ // may need to run search again to limit targets
for (key in mkdru.state) {
if (key.substring(0,5) === 'limit') {
mkdru.search();
if (typeof(Drupal.settings.mkdru.query) !== "undefined") {
mkdru.state.query = Drupal.settings.mkdru.query
}
+
//not running against SP? init, otherwise authenticate
if (mkdru.useSessions) {
mkdru.pz2.init();
);
authReq.get(params,
function (data) {
- var s = data.getElementsByTagName('status');
+ var s = data.getElementsByTagName('status');
if (s.length && Element_getTextContent(s[0]) == "OK") {
mkdru.realm = data.getElementsByTagName('realm');
mkdru.pz2Init();
}
);
}
-
- //i'm not sure how this can work, does it assume the results set is active?
- //what if no search has been executed?
- //if (mkdru.state.recid) {
- // mkdru.pz2.record(mkdru.state.recid);
- //}
- //'mkdru.onInit/ deals with the following properly
- /// -- waiting for Pz2/SP to init first
- //else if (mkdru.state.query) {
- // mkdru.search();
- //}
});
+})(jQuery);
\ No newline at end of file