diff options
-rw-r--r-- | css/fulltextsearch.css | 50 | ||||
-rw-r--r-- | js/fulltextsearch.v1.navigation.js | 12 | ||||
-rw-r--r-- | js/fulltextsearch.v1.searchbox.js | 2 | ||||
-rw-r--r-- | js/fulltextsearch.v1.settings.js | 49 |
4 files changed, 85 insertions, 28 deletions
diff --git a/css/fulltextsearch.css b/css/fulltextsearch.css index b73add2..8fbf5b4 100644 --- a/css/fulltextsearch.css +++ b/css/fulltextsearch.css @@ -137,7 +137,7 @@ input.options_small { } /*.result_entry_default #info {*/ - /*font-weight: bold;*/ +/*font-weight: bold;*/ /*}*/ .next_search_div { @@ -175,12 +175,48 @@ input.options_small { font-size: 11px; } -/*.icon-fulltextsearch, .icon-close-fulltextsearch {*/ -/*position: absolute;*/ -/*right: 10px;*/ -/*top: 10px;*/ -/*cursor: pointer;*/ -/*}*/ +.result_entry { + height: 50px; + position: relative; + border-bottom: solid 1px #efefef; +} + +.result_title { + color: #000; +} + +.result_extract { + font-size: 11px; + color: #999; + margin-top: -5px; + margin-bottom: -5px; + margin-left: 5px; +} + +.result_div_checkbox { + left: 0px; + width: 50px; +} + +.result_div { + position: absolute; + top: 50%; + transform: translateY(-50%); +} + +.result_div_checkbox { + left: 0px; + width: 50px; +} + +.result_div_content { + left: 50px; +} + +.result_div_right { + right: 20px; + color: #9a9a9a; +} .icon-more-fulltextsearch { position: absolute; diff --git a/js/fulltextsearch.v1.navigation.js b/js/fulltextsearch.v1.navigation.js index 5f441a2..d0d9121 100644 --- a/js/fulltextsearch.v1.navigation.js +++ b/js/fulltextsearch.v1.navigation.js @@ -212,10 +212,6 @@ var nav = { divEntry.find('#title').text(entry.title); divEntry.find('#info').text(''); - // if (entry.info.source !== '') { - // divEntry.find('#source').text(entry.info.source); - // } - if (settings.options.show_hash === '1') { divEntry.find('#info').text(entry.hash); } @@ -224,7 +220,7 @@ var nav = { if (entry.link !== '') { divEntry.off('click').on('click', function (event) { - if (nav.onEntrySelect($(this), event)) { + if (nav.onEntrySelected($(this), event)) { return; } @@ -262,9 +258,9 @@ var nav = { }, - onEntrySelect: function (divEntry, event) { - return !!(settings.parentHasMethod('onEntrySelect') && - settings.parent.onEntrySelect(divEntry, event)); + onEntrySelected: function (divEntry, event) { + return !!(settings.parentHasMethod('onEntrySelected') && + settings.parent.onEntrySelected(divEntry, event)); }, diff --git a/js/fulltextsearch.v1.searchbox.js b/js/fulltextsearch.v1.searchbox.js index a045754..8022b4c 100644 --- a/js/fulltextsearch.v1.searchbox.js +++ b/js/fulltextsearch.v1.searchbox.js @@ -55,7 +55,6 @@ var searchbox = { search_form.remove(); } - var divHeaderRight = $('DIV.header-right'); var divFullTextSearch = $('<div>', {id: 'fulltextsearch'}); divHeaderRight.prepend(divFullTextSearch); @@ -192,6 +191,7 @@ var searchbox = { } }, + onOptionsLoaded: function (result) { if (!result[settings.searchProviderId]) { return; diff --git a/js/fulltextsearch.v1.settings.js b/js/fulltextsearch.v1.settings.js index cd669c9..04a7b29 100644 --- a/js/fulltextsearch.v1.settings.js +++ b/js/fulltextsearch.v1.settings.js @@ -45,24 +45,49 @@ var settings = { options: [], /** - * generate the default template to dsplay search result entries + * generate the default template to display search result entries */ generateDefaultTemplate: function () { - var divLeft = $('<div>', {class: 'result_entry_left'}); - divLeft.append($('<div>', {id: 'title'})); - divLeft.append($('<div>', {id: 'line1'})); - divLeft.append($('<div>', {id: 'line2'})); + var resultContent = $('<div>', {class: 'result_content'}); + resultContent.append($('<div>', { + id: 'title', + class: 'result_title' + })); + resultContent.append($('<div>', { + id: 'extract', + class: 'result_extract' + })); - var divRight = $('<div>', {class: 'result_entry_right'}); - //divRight.append($('<div>', {id: 'score'})); + var resultEntry = $('<div>', {class: 'result_entry'}); + resultEntry.append($('<div>', {class: 'result_div_checkbox'})); - var div = $('<div>', {class: 'result_entry_default'}); - div.append(divLeft); - div.append(divRight); + resultEntry.append($('<div>', {class: 'result_div result_div_content'}).append(resultContent)); - return $('<div>').append(div); - }, + var resultRight = $('<div>', {class: 'result_div result_div_right'}); + resultRight.append($('<div>', {id: 'source'})); + resultRight.append($('<div>', {id: 'info'})); + resultEntry.append(resultRight); + + return $('<div>').append(resultEntry); + }, + + + + // var divLeft = $('<div>', {class: 'result_entry_left'}); + // divLeft.append($('<div>', {id: 'title'})); + // divLeft.append($('<div>', {id: 'line1'})); + // divLeft.append($('<div>', {id: 'line2'})); + // + // var divRight = $('<div>', {class: 'result_entry_right'}); + // //divRight.append($('<div>', {id: 'score'})); + // + // var div = $('<div>', {class: 'result_entry_default'}); + // div.append(divLeft); + // div.append(divRight); + // + // return $('<div>').append(div); + // }, // // /** |