From 397547bf0bd3b71158f74fb1607126a336105df3 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Mon, 7 Mar 2011 12:20:15 +0100 Subject: [PATCH] Converted to ding1 mkdru theme (dybamo subtheme) --- css/mkdruding1.css | 33 +++++++++++++++ css/mkdruding2.css | 33 --------------- mkdruding1.info | 6 +++ mkdruding1.js | 88 +++++++++++++++++++++++++++++++++++++++ mkdruding2.info | 27 ------------ mkdruding2.js | 88 --------------------------------------- template.php | 9 ++-- templates/mkdru-results.tpl.php | 2 + 8 files changed, 135 insertions(+), 151 deletions(-) create mode 100644 css/mkdruding1.css delete mode 100644 css/mkdruding2.css create mode 100644 mkdruding1.info create mode 100644 mkdruding1.js delete mode 100644 mkdruding2.info delete mode 100644 mkdruding2.js diff --git a/css/mkdruding1.css b/css/mkdruding1.css new file mode 100644 index 0000000..41ad8a5 --- /dev/null +++ b/css/mkdruding1.css @@ -0,0 +1,33 @@ +a.cross:hover { + text-decoration: line-through; +} + +.mkdru-result-description { + font-size: 0.8em; +} + +.mkdru-pager-container { + text-align: center; + background-color: #F6F6F2; + border-color: #F9F9F9; + padding: 3px 5px 3px 5px; +} + +.mkdru-pager-inner-container { + border-top: 1px solid #D6D6D6; + border-bottom: 1px solid #D6D6D6; + padding: 5px 0px 5px 0px; +} + +.mkdru-status-container { + background-color: #F6F6F2; + border-color: #F9F9F9; + padding: 3px 5px 3px 5px; +} + +.mkdru-status-inner-container { + border-top: 1px solid #D6D6D6; + border-bottom: 1px solid #D6D6D6; + padding: 5px 0px 5px 0px; +} + diff --git a/css/mkdruding2.css b/css/mkdruding2.css deleted file mode 100644 index 41ad8a5..0000000 --- a/css/mkdruding2.css +++ /dev/null @@ -1,33 +0,0 @@ -a.cross:hover { - text-decoration: line-through; -} - -.mkdru-result-description { - font-size: 0.8em; -} - -.mkdru-pager-container { - text-align: center; - background-color: #F6F6F2; - border-color: #F9F9F9; - padding: 3px 5px 3px 5px; -} - -.mkdru-pager-inner-container { - border-top: 1px solid #D6D6D6; - border-bottom: 1px solid #D6D6D6; - padding: 5px 0px 5px 0px; -} - -.mkdru-status-container { - background-color: #F6F6F2; - border-color: #F9F9F9; - padding: 3px 5px 3px 5px; -} - -.mkdru-status-inner-container { - border-top: 1px solid #D6D6D6; - border-bottom: 1px solid #D6D6D6; - padding: 5px 0px 5px 0px; -} - diff --git a/mkdruding1.info b/mkdruding1.info new file mode 100644 index 0000000..0104bbf --- /dev/null +++ b/mkdruding1.info @@ -0,0 +1,6 @@ +name = Ding1-like mkdru theme +description = Style metasearch results like the results from the data-well +core = 6.x +base theme = dynamo + +stylesheets[all][] = css/mkdruding1.css diff --git a/mkdruding1.js b/mkdruding1.js new file mode 100644 index 0000000..8321feb --- /dev/null +++ b/mkdruding1.js @@ -0,0 +1,88 @@ +Drupal.theme.mkdruResult = function(hit, num, detailLink) { + var link = choose_url(hit); + if (!link) link = choose_url(hit['location'][0]); + var html = ""; + 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 += '

    '; + } + html += "
    "; + if (hit["md-description"]) { + // limit description to 400 characters + html += hit["md-description"][0].substr(0, 400); + } + html += '
    ' + html += '
    ' + html += '
    ' + html += '
  • '; + return html; +}; + +Drupal.theme.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 = '

    Facet browser

    '; + for (var i=0; i'; + html += '
    '; + html += '
    '; + html += '
    '; + html += '' + } + html += '
    '; + return html; +}; + +Drupal.theme.mkdruFacet = function (terms, facet, max, selections) { + var html = ""; + for (var i = 0; i < terms.length && i < max; i++ ) { + var term = terms[i]; + html += '
    '; + } + if (terms.length == 0 && selections && selections.length) { + for (var i=0; i'+name+'
    (0)
    '; + } + } + } + return html; +}; diff --git a/mkdruding2.info b/mkdruding2.info deleted file mode 100644 index 7f603d3..0000000 --- a/mkdruding2.info +++ /dev/null @@ -1,27 +0,0 @@ -name = Ding2-like mkdru theme -description = Style metasearch results like the results from the data-well -core = 7.x -base theme = bartik - -stylesheets[all][] = css/mkdruding2.css - -regions[header] = Header -regions[help] = Help -regions[page_top] = Page top -regions[page_bottom] = Page bottom -regions[highlighted] = Highlighted - -regions[featured] = Featured -regions[content] = Content -regions[sidebar_first] = Sidebar first -regions[sidebar_second] = Sidebar second - -regions[triptych_first] = Triptych first -regions[triptych_middle] = Triptych middle -regions[triptych_last] = Triptych last - -regions[footer_firstcolumn] = Footer first column -regions[footer_secondcolumn] = Footer second column -regions[footer_thirdcolumn] = Footer third column -regions[footer_fourthcolumn] = Footer fourth column -regions[footer] = Footer diff --git a/mkdruding2.js b/mkdruding2.js deleted file mode 100644 index 8321feb..0000000 --- a/mkdruding2.js +++ /dev/null @@ -1,88 +0,0 @@ -Drupal.theme.mkdruResult = function(hit, num, detailLink) { - var link = choose_url(hit); - if (!link) link = choose_url(hit['location'][0]); - var html = ""; - 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 += '

    '; - } - html += "
    "; - if (hit["md-description"]) { - // limit description to 400 characters - html += hit["md-description"][0].substr(0, 400); - } - html += '
    ' - html += '
    ' - html += '
    ' - html += '
  • '; - return html; -}; - -Drupal.theme.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 = '

    Facet browser

    '; - for (var i=0; i'; - html += '
    '; - html += '
    '; - html += '
    '; - html += '' - } - html += '
    '; - return html; -}; - -Drupal.theme.mkdruFacet = function (terms, facet, max, selections) { - var html = ""; - for (var i = 0; i < terms.length && i < max; i++ ) { - var term = terms[i]; - html += '
    '; - } - if (terms.length == 0 && selections && selections.length) { - for (var i=0; i'+name+'
    (0)
    '; - } - } - } - return html; -}; diff --git a/template.php b/template.php index 465af5a..75c6b45 100644 --- a/template.php +++ b/template.php @@ -1,9 +1,12 @@ array('facetContainerSelector' => - '#block-ding-facetbrowser-facetbrowser')), 'setting'); + '#mkdru-raw-facet-container')), 'setting'); } diff --git a/templates/mkdru-results.tpl.php b/templates/mkdru-results.tpl.php index b3550de..240cee2 100644 --- a/templates/mkdru-results.tpl.php +++ b/templates/mkdru-results.tpl.php @@ -1,4 +1,6 @@
    +
    +
    -- 1.7.10.4