diff --git a/js/fulltextsearch.v1.navigation.js b/js/fulltextsearch.v1.navigation.js index 39790d2..8c7ebe1 100644 --- a/js/fulltextsearch.v1.navigation.js +++ b/js/fulltextsearch.v1.navigation.js @@ -211,6 +211,9 @@ var nav = { fillDivResult: function (divResult, entry) { divResult.find('#title').text(entry.title); // divResult.find('#score').text(entry.score); + if (entry.info.source !== '') { + divResult.find('#source').text(entry.info.source); + } nav.fillDivResultExcepts(divResult, entry); @@ -303,7 +306,7 @@ var nav = { } var tmpl = divTemplate.html(); - tmpl = tmpl.replace(/%%id%%/g, escapeHTML(document.id)); +// tmpl = tmpl.replace(/%%id%%/g, escapeHTML(document.id)); var div = $('
', {class: 'result_template'}); div.html(tmpl).fadeTo(0); @@ -314,9 +317,13 @@ var nav = { generateDivResult: function (entry, divResultContent) { var divResult = $('
', {class: 'result_entry'}); + + console.log('!!! ' + JSON.stringify(entry.info)); divResult.hide(); divResult.attr('data-id', entry.id); divResult.attr('data-link', entry.link); + divResult.attr('data-source', entry.source); + divResult.attr('data-info', JSON.stringify(entry.info)); divResult.attr('data-result', JSON.stringify(entry)); divResult.append(divResultContent); diff --git a/lib/Model/IndexDocument.php b/lib/Model/IndexDocument.php index 4716364..0d2bb4c 100644 --- a/lib/Model/IndexDocument.php +++ b/lib/Model/IndexDocument.php @@ -490,6 +490,7 @@ class IndexDocument implements \JsonSerializable { 'title' => $this->getTitle(), 'link' => $this->getLink(), 'source' => $this->getSource(), + 'info' => $this->getInfoAll(), 'tags' => $this->getTags(), 'more' => $this->getMore(), 'excerpts' => $this->getExcerpts(), diff --git a/templates/navigate.php b/templates/navigate.php index 419468d..3df12e9 100644 --- a/templates/navigate.php +++ b/templates/navigate.php @@ -62,12 +62,12 @@ Util::addStyle(Application::APP_NAME, 'navigate');