X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.client.js;h=03f950715247c326c3adba90f5581486f718a14b;hb=4599df0e52096cca58056571ac88b045527a9eb9;hp=dae3fa78cf4e47e48d22ad9b2cde30de589b64be;hpb=3f549fb4a29034f2c1aea81f0ec2a0c6b998601e;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.client.js b/mkdru.client.js index dae3fa7..03f9507 100644 --- a/mkdru.client.js +++ b/mkdru.client.js @@ -39,6 +39,9 @@ var mkdru = { +// 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]"; @@ -193,7 +196,7 @@ mkdru.hashChange = function () { else { // may need to run search again to limit targets for (key in mkdru.state) { - if (key.substring(0,5) === 'limit') { + if (key.substring(0,5) === 'limit' && mkdru.state[key]) { mkdru.search(); break; } @@ -326,6 +329,7 @@ $(document).ready(function () { 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(); @@ -349,7 +353,7 @@ $(document).ready(function () { ); 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(); @@ -360,15 +364,5 @@ $(document).ready(function () { } ); } - - //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