Browse Source

Several more fixes to formatting of standard response

pull/1243/head
jlukic 10 years ago
parent
commit
0f911e16d0
3 changed files with 20 additions and 15 deletions
  1. 17
      src/definitions/modules/search.js
  2. 5
      src/definitions/modules/search.less
  3. 13
      src/themes/default/modules/search.variables

17
src/definitions/modules/search.js

@ -296,7 +296,7 @@ $.fn.search = function(parameters) {
if( searchRegExp.test( content[field] ) ) { if( searchRegExp.test( content[field] ) ) {
results.push(content); results.push(content);
} }
else if( fullTextRegExp.test( content[field] ) ) {
else if( settings.searchFullText && fullTextRegExp.test( content[field] ) ) {
fullTextResults.push(content); fullTextResults.push(content);
} }
} }
@ -665,7 +665,7 @@ $.fn.search.settings = {
// api config // api config
apiSettings : false, apiSettings : false,
type : 'simple',
type : 'standard',
minCharacters : 1, minCharacters : 1,
source : false, source : false,
@ -673,10 +673,11 @@ $.fn.search.settings = {
'title', 'title',
'description' 'description'
], ],
searchFullText : true,
automatic : 'true', automatic : 'true',
hideDelay : 0, hideDelay : 0,
searchDelay : 300,
searchDelay : 200,
maxResults : 7, maxResults : 7,
cache : true, cache : true,
@ -694,7 +695,6 @@ $.fn.search.settings = {
onResultsOpen : function(){}, onResultsOpen : function(){},
onResultsClose : function(){}, onResultsClose : function(){},
className: { className: {
active : 'active', active : 'active',
down : 'down', down : 'down',
@ -824,7 +824,7 @@ $.fn.search.settings = {
} }
return false; return false;
}, },
simple: function(response) {
standard: function(response) {
var var
html = '' html = ''
; ;
@ -835,6 +835,9 @@ $.fn.search.settings = {
if(result.url) { if(result.url) {
html += '<a class="result" href="' + result.url + '">'; html += '<a class="result" href="' + result.url + '">';
} }
else {
html += '<a class="result">';
}
if(result.image !== undefined) { if(result.image !== undefined) {
html += '' html += ''
+ '<div class="image">' + '<div class="image">'
@ -855,9 +858,7 @@ $.fn.search.settings = {
html += '' html += ''
+ '</div>' + '</div>'
; ;
if(results.url) {
html += '</a>';
}
html += '</a>';
}); });
if(response.resultPage) { if(response.resultPage) {

5
src/definitions/modules/search.less

@ -87,9 +87,10 @@
---------------*/ ---------------*/
.ui.search > .results .result { .ui.search > .results .result {
font-family: @pageFont;
cursor: pointer; cursor: pointer;
display: block;
overflow: hidden; overflow: hidden;
font-family: @pageFont;
font-size: @resultFontSize; font-size: @resultFontSize;
padding: @resultVerticalPadding @resultHorizontalPadding; padding: @resultVerticalPadding @resultHorizontalPadding;
color: @resultTextColor; color: @resultTextColor;
@ -130,6 +131,7 @@
} }
.ui.search > .results .result .description { .ui.search > .results .result .description {
margin-top: @resultDescriptionDistance; margin-top: @resultDescriptionDistance;
font-size: @resultDescriptionFontSize;
color: @resultDescriptionColor; color: @resultDescriptionColor;
} }
.ui.search > .results .result .price { .ui.search > .results .result .price {
@ -300,6 +302,7 @@
.ui.search > .results .category > .name { .ui.search > .results .category > .name {
background: @categoryNameBackground; background: @categoryNameBackground;
font-family: @categoryNameFont; font-family: @categoryNameFont;
font-size: @categoryNameFontSize;
width: @categoryNameWidth; width: @categoryNameWidth;
float: @categoryNameFontSize; float: @categoryNameFontSize;
float: @categoryNameFloat; float: @categoryNameFloat;

13
src/themes/default/modules/search.variables

@ -28,7 +28,7 @@
@resultsBoxShadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.2); @resultsBoxShadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.2);
/* Result */ /* Result */
@resultFontSize: 0.9285em;
@resultFontSize: 1em;
@resultVerticalPadding: 0.5em; @resultVerticalPadding: 0.5em;
@resultHorizontalPadding: 1em; @resultHorizontalPadding: 1em;
@resultTextColor: @textColor; @resultTextColor: @textColor;
@ -45,11 +45,12 @@
/* Result Content */ /* Result Content */
@resultTitleFont: @headerFont; @resultTitleFont: @headerFont;
@resultTitleFontWeight: bold; @resultTitleFontWeight: bold;
@resultTitleFontSize: 1.1em;
@resultTitleFontSize: 1em;
@resultTitleColor: @darkTextColor; @resultTitleColor: @darkTextColor;
/* Description */ /* Description */
@resultDescriptionDistance: 0.25em;
@resultDescriptionFontSize: 0.9285em;
@resultDescriptionDistance: 0em;
@resultDescriptionColor: @lightTextColor; @resultDescriptionColor: @lightTextColor;
/* Price */ /* Price */
@ -59,11 +60,11 @@
/* Special Message */ /* Special Message */
@messageVerticalPadding: 1em; @messageVerticalPadding: 1em;
@messageHorizontalPadding: 1em; @messageHorizontalPadding: 1em;
@messageHeaderFontSize: 1.2em;
@messageHeaderFontSize: 1.1428em;
@messageHeaderFontWeight: bold; @messageHeaderFontWeight: bold;
@messageHeaderColor: @textColor; @messageHeaderColor: @textColor;
@messageDescriptionDistance: 0.25rem; @messageDescriptionDistance: 0.25rem;
@messageDescriptionFontSize: 1rem;
@messageDescriptionFontSize: 1em;
@messageDescriptionColor: @textColor; @messageDescriptionColor: @textColor;
/* All Results Link */ /* All Results Link */
@ -122,7 +123,7 @@
@categoryNameBackground: @darkWhite; @categoryNameBackground: @darkWhite;
@categoryNameFont: @pageFont; @categoryNameFont: @pageFont;
@categoryNameFontSize: 0.9em;
@categoryNameFontSize: 1em;
@categoryNameFloat: left; @categoryNameFloat: left;
@categoryNamePadding: 0.4em 1em; @categoryNamePadding: 0.4em 1em;
@categoryNameFontWeight: bold; @categoryNameFontWeight: bold;

Loading…
Cancel
Save