(mkdru.curPage - 1));
}
$('.mkdru-result-list').html(html);
+ $('.mkdru-result-title').bind('click', mkdru.requestDetail);
$('.mkdru-results').show();
};
};
mkdru.pz2Term = function (data) {
- var html = "";
- for (var i = 0; i < data.xtargets.length && i < mkdru.sourceMax; i++ ) {
- html += Drupal.theme('mkdruTerm', data.xtargets[i].name, data.xtargets[i].freq,
- 'mkdru-facet-source', data.xtargets[i].id);
- }
- $('.mkdru-facet-sources').html(html);
-
- html = "";
- for (var i = 0; i < data.subject.length && i < mkdru.subjectMax; i++ ) {
- html += Drupal.theme('mkdruTerm', data.subject[i].name, data.subject[i].freq,
- 'mkdru-facet-subject', data.subject[i].id);
- }
- $('.mkdru-facet-subjects').html(html);
-
- html = "";
- for (var i = 0; i < data.author.length && i < mkdru.authorMax; i++ ) {
- html += Drupal.theme('mkdruTerm', data.author[i].name, data.author[i].freq,
- 'mkdru-facet-author', data.author[i].id);
- }
- $('.mkdru-facet-authors').html(html);
-
- $('.mkdru-facet-source').bind('click', function (e) {
- mkdru.limitTarget(this.getAttribute('target_id'), this.firstChild.nodeValue);
- return false;
- });
-
- $('.mkdru-facet-subject').bind('click', function (e) {
- mkdru.limitQuery('su', this.firstChild.nodeValue);
- return false;
- });
-
- $('.mkdru-facet-author').bind('click', function (e) {
- mkdru.limitQuery('au', this.firstChild.nodeValue);
- return false;
- });
+ var html = "";
+ for (var i = 0; i < data.xtargets.length && i < mkdru.sourceMax; i++ ) {
+ html += Drupal.theme('mkdruTerm', data.xtargets[i].name, data.xtargets[i].freq,
+ 'mkdru-facet-source', data.xtargets[i].id);
+ }
+ $('.mkdru-facet-sources').html(html);
+
+ html = "";
+ for (var i = 0; i < data.subject.length && i < mkdru.subjectMax; i++ ) {
+ html += Drupal.theme('mkdruTerm', data.subject[i].name, data.subject[i].freq,
+ 'mkdru-facet-subject', data.subject[i].id);
+ }
+ $('.mkdru-facet-subjects').html(html);
+
+ html = "";
+ for (var i = 0; i < data.author.length && i < mkdru.authorMax; i++ ) {
+ html += Drupal.theme('mkdruTerm', data.author[i].name, data.author[i].freq,
+ 'mkdru-facet-author', data.author[i].id);
+ }
+ $('.mkdru-facet-authors').html(html);
+
+ $('.mkdru-facet-source').bind('click', function (e) {
+ mkdru.limitTarget(this.getAttribute('target_id'), this.firstChild.nodeValue);
+ return false;
+ });
+
+ $('.mkdru-facet-subject').bind('click', function (e) {
+ mkdru.limitQuery('su', this.firstChild.nodeValue);
+ return false;
+ });
+
+ $('.mkdru-facet-author').bind('click', function (e) {
+ mkdru.limitQuery('au', this.firstChild.nodeValue);
+ return false;
+ });
};
mkdru.pz2ByTarget = function (data) {
};
+mkdru.pz2Record = function (data) {
+ clearTimeout(mkdru.pz2.recordTimer);
+// $('.mkdru-results').hide();
+// mkdru.pz2.stop();
+// clearTimeout(mkdru.pz2.showTimer);
+ $('.mkdru-detail').html(Drupal.theme('mkdruDetail', data));
+ $('.mkdru-detail').bind('click', function () {$('.mkdru-detail').hide()});
+ $('.mkdru-detail').show();
+};
// UI functions:
mkdru.submitQuery = function () {
mkdru.submitQuery();
};
-mkdru.limitTarget = function (id, name) {
+mkdru.limitTarget = function (id, name) {
var navi = document.getElementById('mkdru-navi');
navi.innerHTML =
'Source: <a class="crossout" href="#" onclick="delimitTarget();return false;">'
mkdru.pz2.showPage(pageNum-1);
};
+mkdru.requestDetail = function (e) {
+ mkdru.pz2.record(e.target.parentNode.id.replace('rec_', ''));
+};
+
mkdru.nextPage = function () {
if (mkdru.totalRec - mkdru.recPerPage * mkdru.curPage > 0) {
mkdru.pz2.showNext();
Drupal.theme.prototype.mkdruResult = function(hit, num) {
var html = "";
- html += '<li class="mkdru-result" id="recdiv_' + hit.recid + '" >'
+ html += '<li class="mkdru-result" id="rec_' + hit.recid + '" >'
+ '<span>' + num + '. </span>'
- + '<a href="#" id="rec_' + hit.recid + '">'
+ + '<a href="#" class="mkdru-result-title">'
+ hit["md-title"] + '</a> ';
if (hit["md-title-remainder"] !== undefined) {
- html += '<span>' + hit["md-title-remainder"] + ' </span>';
+ html += '<span class="mkdru-result-title-remainder">'
+ + hit["md-title-remainder"] + ' </span>';
}
if (hit["md-title-responsibility"] !== undefined) {
- html += '<span><i>'
+ html += '<span class="mkdru-result-author"><i>'
+ hit["md-title-responsibility"]
+ '</i></span>';
}
html += '</li>';
- return (html);
+ return html;
+};
+
+Drupal.theme.prototype.mkdruDetail = function(data) {
+ var html = '<div class="html" id="det_'+data.recid+'"><table>';
+ if (data["md-title"] != undefined) {
+ html += '<tr><td><b>Title</b></td><td><b>:</b> '+data["md-title"];
+ if (data["md-title-remainder"] !== undefined) {
+ html += ' : <span>' + data["md-title-remainder"] + ' </span>';
+ }
+ if (data["md-title-responsibility"] !== undefined) {
+ html += ' <span><i>'+ data["md-title-responsibility"] +'</i></span>';
+ }
+ html += '</td></tr>';
+ }
+ if (data["md-date"] != undefined)
+ html += '<tr><td><b>Date</b></td><td><b>:</b> ' + data["md-date"] + '</td></tr>';
+ if (data["md-author"] != undefined)
+ html += '<tr><td><b>Author</b></td><td><b>:</b> ' + data["md-author"] + '</td></tr>';
+ if (data["md-electronic-url"] != undefined)
+ html += '<tr><td><b>URL</b></td><td><b>:</b> <a href="' + data["md-electronic-url"] + '" target="_blank">' + data["md-electronic-url"] + '</a>' + '</td></tr>';
+ if (data["location"][0]["md-subject"] != undefined)
+ html += '<tr><td><b>Subject</b></td><td><b>:</b> ' + data["location"][0]["md-subject"] + '</td></tr>';
+ if (data["location"][0]["@name"] != undefined)
+ html += '<tr><td><b>Location</b></td><td><b>:</b> ' + data["location"][0]["@name"] + " (" +data["location"][0]["@id"] + ")" + '</td></tr>';
+ html += '</table></div>';
+ return html;
};
Drupal.theme.prototype.mkdruPager = function (data, curPage, pages) {