From 356e95677e372c244a2b5e92d3209b214cda739e Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Tue, 8 Mar 2011 12:06:20 +0100 Subject: [PATCH] Hardcode the Ding1 theme Since enabling the the theme externally breaks the site-layout, for some reason --- mkdru-results.tpl.php | 4 +++- mkdru.client.js | 2 +- mkdru.css | 7 +++++- mkdru.theme.js | 64 +++++++++++++++++++++++++++++++++++++++---------- 4 files changed, 61 insertions(+), 16 deletions(-) diff --git a/mkdru-results.tpl.php b/mkdru-results.tpl.php index 1dcfc53..1f72b89 100644 --- a/mkdru-results.tpl.php +++ b/mkdru-results.tpl.php @@ -1,7 +1,9 @@
+
+
-
\ No newline at end of file + diff --git a/mkdru.client.js b/mkdru.client.js index 5638dd1..fde7675 100644 --- a/mkdru.client.js +++ b/mkdru.client.js @@ -8,7 +8,7 @@ var mkdru = { totalRec: 0, pagerRange: 6, pazpar2Path: Drupal.settings.mkdru.pz2_path, - facetContainerSelector: Drupal.settings.mkdru.facetContainerSelector, + facetContainerSelector: '#mkdru-raw-facet-container', // Facets facets: { source: { diff --git a/mkdru.css b/mkdru.css index 7efeb50..772b332 100644 --- a/mkdru.css +++ b/mkdru.css @@ -1,7 +1,12 @@ -a.cross { +a.cross:hover { text-decoration: line-through; } +.mkdru-facets-table { + table-layout: fixed; + width: 700px; +} + .node-mkdru div { margin: 1em 0em; } diff --git a/mkdru.theme.js b/mkdru.theme.js index 034b403..4b0638f 100644 --- a/mkdru.theme.js +++ b/mkdru.theme.js @@ -1,18 +1,38 @@ Drupal.theme.prototype.mkdruResult = function(hit, num, detailLink) { + var link = choose_url(hit); + if (!link) link = choose_url(hit['location'][0]); var html = ""; - html += '
  • ' - + '' + num + '. ' - + '' - + hit["md-title"] + ' '; - if (hit["md-title-remainder"] !== undefined) { - html += '' - + hit["md-title-remainder"] + ' '; + html += '
  • ' + + '

    '; + if (link) html += ''; + html += hit["md-title"]; + if (link) html += ''; + html += '

    '; + html += '
    ' + + '

    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '; + if (hit["md-author"]) { + html += '
    ' + + '' + + hit['md-author']+''; + if (hit['md-date']) { + html += ' ('+hit['md-date']+')'; + } + html += '

    '; } - if (hit["md-title-responsibility"] !== undefined) { - html += '' - + hit["md-title-responsibility"] - + ''; + html += "
    "; + if (hit["md-description"]) { + // limit description to 400 characters + html += hit["md-description"][0].substr(0, 400); } + html += '
    ' + html += '
    ' + html += '
    ' html += '
  • '; return html; }; @@ -141,6 +161,24 @@ Drupal.theme.prototype.mkdruFacet = function (terms, facet, max, selections) { return html; }; -Drupal.theme.prototype.mkdruFacetContainer = function (facetCfg) { - return ""; +Drupal.theme.prototype.mkdruFacetContainer = function (facetsCfg) { + var fs = []; + for (var fname in facetsCfg) { + facetsCfg[fname].originalKey = fname; + fs.push(facetsCfg[fname]); + } + fs.sort(function (a,b) { return a.orderWeight - b.orderWeight }); + var html = '
    '; + for (var i=0; i'; + html += '
    '; + html += '
    '; + html += '
    '; + html += '' + } + html += '
    '; + return html; }; -- 1.7.10.4