less-rails-semantic_ui 2.0.7.0 → 2.1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/fonts/semantic_ui/themes/github/assets/fonts/octicons-local.ttf +0 -0
- data/assets/fonts/semantic_ui/themes/github/assets/fonts/octicons.svg +200 -0
- data/assets/fonts/semantic_ui/themes/github/assets/fonts/octicons.ttf +0 -0
- data/assets/fonts/semantic_ui/themes/github/assets/fonts/octicons.woff +0 -0
- data/assets/javascripts/semantic_ui/definitions/behaviors/api.js +26 -8
- data/assets/javascripts/semantic_ui/definitions/behaviors/form.js +281 -74
- data/assets/javascripts/semantic_ui/definitions/globals/site.js +2 -2
- data/assets/javascripts/semantic_ui/definitions/modules/accordion.js +17 -13
- data/assets/javascripts/semantic_ui/definitions/modules/checkbox.js +124 -48
- data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +202 -112
- data/assets/javascripts/semantic_ui/definitions/modules/embed.js +1 -4
- data/assets/javascripts/semantic_ui/definitions/modules/modal.js +13 -13
- data/assets/javascripts/semantic_ui/definitions/modules/nag.js +11 -1
- data/assets/javascripts/semantic_ui/definitions/modules/popup.js +23 -10
- data/assets/javascripts/semantic_ui/definitions/modules/search.js +84 -55
- data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +34 -32
- data/assets/javascripts/semantic_ui/definitions/modules/tab.js +10 -9
- data/assets/javascripts/semantic_ui/definitions/modules/transition.js +5 -5
- data/assets/stylesheets/semantic_ui/definitions/collections/breadcrumb.less +1 -1
- data/assets/stylesheets/semantic_ui/definitions/collections/form.less +90 -25
- data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +146 -23
- data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +138 -64
- data/assets/stylesheets/semantic_ui/definitions/collections/message.less +6 -6
- data/assets/stylesheets/semantic_ui/definitions/collections/table.less +19 -0
- data/assets/stylesheets/semantic_ui/definitions/elements/button.less +109 -31
- data/assets/stylesheets/semantic_ui/definitions/elements/container.less +25 -1
- data/assets/stylesheets/semantic_ui/definitions/elements/divider.less +4 -3
- data/assets/stylesheets/semantic_ui/definitions/elements/header.less +0 -2
- data/assets/stylesheets/semantic_ui/definitions/elements/icon.less +22 -3
- data/assets/stylesheets/semantic_ui/definitions/elements/input.less +59 -28
- data/assets/stylesheets/semantic_ui/definitions/elements/label.less +353 -235
- data/assets/stylesheets/semantic_ui/definitions/elements/list.less +16 -1
- data/assets/stylesheets/semantic_ui/definitions/elements/reveal.less +4 -11
- data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +2 -1
- data/assets/stylesheets/semantic_ui/definitions/elements/step.less +9 -5
- data/assets/stylesheets/semantic_ui/definitions/globals/site.less +3 -0
- data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +19 -1
- data/assets/stylesheets/semantic_ui/definitions/views/item.less +2 -2
- data/assets/stylesheets/semantic_ui/theme.less +10 -4
- data/assets/stylesheets/semantic_ui/themes/amazon/globals/site.variables +43 -0
- data/assets/stylesheets/semantic_ui/themes/bookish/elements/header.variables +5 -5
- data/assets/stylesheets/semantic_ui/themes/chubby/elements/header.variables +5 -5
- data/assets/stylesheets/semantic_ui/themes/default/collections/breadcrumb.variables +1 -1
- data/assets/stylesheets/semantic_ui/themes/default/collections/form.variables +15 -5
- data/assets/stylesheets/semantic_ui/themes/default/collections/grid.variables +5 -0
- data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +29 -14
- data/assets/stylesheets/semantic_ui/themes/default/elements/button.variables +14 -4
- data/assets/stylesheets/semantic_ui/themes/default/elements/container.variables +14 -1
- data/assets/stylesheets/semantic_ui/themes/default/elements/icon.overrides +0 -12
- data/assets/stylesheets/semantic_ui/themes/default/elements/input.variables +5 -6
- data/assets/stylesheets/semantic_ui/themes/default/elements/label.variables +30 -6
- data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +11 -2
- data/assets/stylesheets/semantic_ui/themes/default/modules/checkbox.variables +4 -4
- data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +13 -7
- data/assets/stylesheets/semantic_ui/themes/default/modules/popup.variables +1 -1
- data/assets/stylesheets/semantic_ui/themes/github/collections/breadcrumb.variables +11 -0
- data/assets/stylesheets/semantic_ui/themes/github/collections/grid.variables +2 -0
- data/assets/stylesheets/semantic_ui/themes/github/collections/table.variables +8 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/header.variables +9 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/icon.overrides +208 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/icon.variables +13 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/image.variables +5 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/input.overrides +32 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/input.variables +16 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/label.overrides +9 -0
- data/assets/stylesheets/semantic_ui/themes/github/elements/label.variables +4 -0
- data/assets/stylesheets/semantic_ui/themes/github/globals/site.variables +47 -0
- data/assets/stylesheets/semantic_ui/themes/github/modules/dropdown.overrides +53 -0
- data/assets/stylesheets/semantic_ui/themes/github/modules/dropdown.variables +35 -0
- data/assets/stylesheets/semantic_ui/themes/github/modules/popup.variables +12 -0
- data/assets/stylesheets/semantic_ui/themes/material/elements/button.overrides +0 -8
- data/assets/stylesheets/semantic_ui/themes/material/elements/button.variables +4 -2
- data/assets/stylesheets/semantic_ui/themes/twitter/elements/button.variables +1 -2
- data/lib/less/rails/semantic_ui/version.rb +1 -1
- metadata +22 -2
@@ -97,7 +97,6 @@ $.fn.embed = function(parameters) {
|
|
97
97
|
events: function() {
|
98
98
|
if( module.has.placeholder() ) {
|
99
99
|
module.debug('Adding placeholder events');
|
100
|
-
console.log($module, selector.placeholder);
|
101
100
|
$module
|
102
101
|
.on('click' + eventNamespace, selector.placeholder, module.createAndShow)
|
103
102
|
.on('click' + eventNamespace, selector.icon, module.createAndShow)
|
@@ -132,7 +131,6 @@ $.fn.embed = function(parameters) {
|
|
132
131
|
createEmbed: function(url) {
|
133
132
|
module.refresh();
|
134
133
|
url = url || module.get.url();
|
135
|
-
console.log(url);
|
136
134
|
$embed = $('<div/>')
|
137
135
|
.addClass(className.embed)
|
138
136
|
.html( module.generate.embed(url) )
|
@@ -143,7 +141,6 @@ $.fn.embed = function(parameters) {
|
|
143
141
|
},
|
144
142
|
|
145
143
|
createAndShow: function() {
|
146
|
-
console.log('cands');
|
147
144
|
module.createEmbed();
|
148
145
|
module.show();
|
149
146
|
},
|
@@ -630,7 +627,7 @@ $.fn.embed.settings = {
|
|
630
627
|
templates: {
|
631
628
|
iframe : function(url, parameters) {
|
632
629
|
return ''
|
633
|
-
+ '<iframe src="' + url + '
|
630
|
+
+ '<iframe src="' + url + '?' + parameters + '"'
|
634
631
|
+ ' width="100%" height="100%"'
|
635
632
|
+ ' frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'
|
636
633
|
;
|
@@ -341,7 +341,9 @@ $.fn.modal = function(parameters) {
|
|
341
341
|
module.add.keyboardShortcuts();
|
342
342
|
module.save.focus();
|
343
343
|
module.set.active();
|
344
|
-
|
344
|
+
if(settings.autofocus) {
|
345
|
+
module.set.autofocus();
|
346
|
+
}
|
345
347
|
callback();
|
346
348
|
}
|
347
349
|
})
|
@@ -562,17 +564,15 @@ $.fn.modal = function(parameters) {
|
|
562
564
|
|
563
565
|
set: {
|
564
566
|
autofocus: function() {
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
$input.focus();
|
575
|
-
}
|
567
|
+
var
|
568
|
+
$inputs = $module.find(':input').filter(':visible'),
|
569
|
+
$autofocus = $inputs.filter('[autofocus]'),
|
570
|
+
$input = ($autofocus.length > 0)
|
571
|
+
? $autofocus.first()
|
572
|
+
: $inputs.first()
|
573
|
+
;
|
574
|
+
if($input.length > 0) {
|
575
|
+
$input.focus();
|
576
576
|
}
|
577
577
|
},
|
578
578
|
clickaway: function() {
|
@@ -866,7 +866,7 @@ $.fn.modal.settings = {
|
|
866
866
|
onDeny : function(){ return true; },
|
867
867
|
|
868
868
|
selector : {
|
869
|
-
close : '.close',
|
869
|
+
close : '> .close',
|
870
870
|
approve : '.actions .positive, .actions .approve, .actions .ok',
|
871
871
|
deny : '.actions .negative, .actions .deny, .actions .cancel',
|
872
872
|
modal : '.ui.modal'
|
@@ -194,6 +194,10 @@ $.fn.nag = function(parameters) {
|
|
194
194
|
window.localStorage.setItem(key, value);
|
195
195
|
module.debug('Value stored using local storage', key, value);
|
196
196
|
}
|
197
|
+
else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) {
|
198
|
+
window.sessionStorage.setItem(key, value);
|
199
|
+
module.debug('Value stored using session storage', key, value);
|
200
|
+
}
|
197
201
|
else if($.cookie !== undefined) {
|
198
202
|
$.cookie(key, value, options);
|
199
203
|
module.debug('Value stored using cookie', key, value, options);
|
@@ -210,6 +214,9 @@ $.fn.nag = function(parameters) {
|
|
210
214
|
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
211
215
|
storedValue = window.localStorage.getItem(key);
|
212
216
|
}
|
217
|
+
else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) {
|
218
|
+
storedValue = window.sessionStorage.getItem(key);
|
219
|
+
}
|
213
220
|
// get by cookie
|
214
221
|
else if($.cookie !== undefined) {
|
215
222
|
storedValue = $.cookie(key);
|
@@ -226,9 +233,12 @@ $.fn.nag = function(parameters) {
|
|
226
233
|
var
|
227
234
|
options = module.get.storageOptions()
|
228
235
|
;
|
229
|
-
if(settings.storageMethod == '
|
236
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
230
237
|
window.localStorage.removeItem(key);
|
231
238
|
}
|
239
|
+
else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) {
|
240
|
+
window.sessionStorage.removeItem(key);
|
241
|
+
}
|
232
242
|
// store by cookie
|
233
243
|
else if($.cookie !== undefined) {
|
234
244
|
$.removeCookie(key, options);
|
@@ -96,7 +96,7 @@ $.fn.popup = function(parameters) {
|
|
96
96
|
}
|
97
97
|
else {
|
98
98
|
if(settings.inline) {
|
99
|
-
$popup = $target.
|
99
|
+
$popup = $target.nextAll(selector.popup).eq(0);
|
100
100
|
settings.popup = $popup;
|
101
101
|
}
|
102
102
|
}
|
@@ -124,6 +124,9 @@ $.fn.popup = function(parameters) {
|
|
124
124
|
module.debug('Setting page as offset parent');
|
125
125
|
$offsetParent = $body;
|
126
126
|
}
|
127
|
+
if( module.get.variation() ) {
|
128
|
+
module.set.variation();
|
129
|
+
}
|
127
130
|
},
|
128
131
|
|
129
132
|
reposition: function() {
|
@@ -194,7 +197,6 @@ $.fn.popup = function(parameters) {
|
|
194
197
|
create: function() {
|
195
198
|
var
|
196
199
|
html = module.get.html(),
|
197
|
-
variation = module.get.variation(),
|
198
200
|
title = module.get.title(),
|
199
201
|
content = module.get.content()
|
200
202
|
;
|
@@ -209,15 +211,9 @@ $.fn.popup = function(parameters) {
|
|
209
211
|
}
|
210
212
|
$popup = $('<div/>')
|
211
213
|
.addClass(className.popup)
|
212
|
-
.addClass(variation)
|
213
214
|
.data(metadata.activator, $module)
|
214
215
|
.html(html)
|
215
216
|
;
|
216
|
-
if(variation) {
|
217
|
-
$popup
|
218
|
-
.addClass(variation)
|
219
|
-
;
|
220
|
-
}
|
221
217
|
if(settings.inline) {
|
222
218
|
module.verbose('Inserting popup element inline', $popup);
|
223
219
|
$popup
|
@@ -231,6 +227,8 @@ $.fn.popup = function(parameters) {
|
|
231
227
|
;
|
232
228
|
}
|
233
229
|
module.refresh();
|
230
|
+
module.set.variation();
|
231
|
+
|
234
232
|
if(settings.hoverable) {
|
235
233
|
module.bind.popup();
|
236
234
|
}
|
@@ -344,12 +342,12 @@ $.fn.popup = function(parameters) {
|
|
344
342
|
},
|
345
343
|
|
346
344
|
removePopup: function() {
|
347
|
-
module.debug('Removing popup', $popup);
|
348
345
|
if( module.has.popup() && !settings.popup) {
|
346
|
+
module.debug('Removing popup', $popup);
|
349
347
|
$popup.remove();
|
350
348
|
$popup = undefined;
|
349
|
+
settings.onRemove.call($popup, element);
|
351
350
|
}
|
352
|
-
settings.onRemove.call($popup, element);
|
353
351
|
},
|
354
352
|
|
355
353
|
save: {
|
@@ -853,6 +851,14 @@ $.fn.popup = function(parameters) {
|
|
853
851
|
$popup.css('width', calculations.container.width);
|
854
852
|
},
|
855
853
|
|
854
|
+
variation: function(variation) {
|
855
|
+
variation = variation || module.get.variation();
|
856
|
+
if(variation && module.has.popup() ) {
|
857
|
+
module.verbose('Adding variation to popup', variation);
|
858
|
+
$popup.addClass(variation);
|
859
|
+
}
|
860
|
+
},
|
861
|
+
|
856
862
|
visible: function() {
|
857
863
|
$module.addClass(className.visible);
|
858
864
|
}
|
@@ -862,6 +868,13 @@ $.fn.popup = function(parameters) {
|
|
862
868
|
loading: function() {
|
863
869
|
$popup.removeClass(className.loading);
|
864
870
|
},
|
871
|
+
variation: function(variation) {
|
872
|
+
variation = variation || module.get.variation();
|
873
|
+
if(variation) {
|
874
|
+
module.verbose('Removing variation', variation);
|
875
|
+
$popup.removeClass(variation);
|
876
|
+
}
|
877
|
+
},
|
865
878
|
visible: function() {
|
866
879
|
$module.removeClass(className.visible);
|
867
880
|
},
|
@@ -36,6 +36,7 @@ $.fn.search = function(parameters) {
|
|
36
36
|
className = settings.className,
|
37
37
|
metadata = settings.metadata,
|
38
38
|
regExp = settings.regExp,
|
39
|
+
fields = settings.fields,
|
39
40
|
selector = settings.selector,
|
40
41
|
error = settings.error,
|
41
42
|
namespace = settings.namespace,
|
@@ -126,7 +127,9 @@ $.fn.search = function(parameters) {
|
|
126
127
|
module.set.focus();
|
127
128
|
if( module.has.minimumCharacters() ) {
|
128
129
|
module.query();
|
129
|
-
module.
|
130
|
+
if( module.can.show() ) {
|
131
|
+
module.showResults();
|
132
|
+
}
|
130
133
|
}
|
131
134
|
},
|
132
135
|
blur: function(event) {
|
@@ -288,6 +291,9 @@ $.fn.search = function(parameters) {
|
|
288
291
|
useAPI: function() {
|
289
292
|
return $.fn.api !== undefined;
|
290
293
|
},
|
294
|
+
show: function() {
|
295
|
+
return module.is.focused() && !module.is.visible() && !module.is.empty();
|
296
|
+
},
|
291
297
|
transition: function() {
|
292
298
|
return settings.transition && $.fn.transition !== undefined && $module.transition('is supported');
|
293
299
|
}
|
@@ -344,7 +350,7 @@ $.fn.search = function(parameters) {
|
|
344
350
|
$.each(results, function(index, category) {
|
345
351
|
if($.isArray(category.results)) {
|
346
352
|
result = module.search.object(value, category.results, lookupFields)[0];
|
347
|
-
//
|
353
|
+
// don't continue searching if a result is found
|
348
354
|
if(result) {
|
349
355
|
return false;
|
350
356
|
}
|
@@ -566,14 +572,14 @@ $.fn.search = function(parameters) {
|
|
566
572
|
;
|
567
573
|
module.verbose('Parsing server response', response);
|
568
574
|
if(response !== undefined) {
|
569
|
-
if(searchTerm !== undefined && response.results !== undefined) {
|
575
|
+
if(searchTerm !== undefined && response[fields.results] !== undefined) {
|
570
576
|
module.addResults(searchHTML);
|
571
|
-
module.inject.id(response.results);
|
577
|
+
module.inject.id(response[fields.results]);
|
572
578
|
module.write.cache(searchTerm, {
|
573
579
|
html : searchHTML,
|
574
|
-
results : response.results
|
580
|
+
results : response[fields.results]
|
575
581
|
});
|
576
|
-
module.save.results(response.results);
|
582
|
+
module.save.results(response[fields.results]);
|
577
583
|
}
|
578
584
|
}
|
579
585
|
}
|
@@ -752,11 +758,13 @@ $.fn.search = function(parameters) {
|
|
752
758
|
$results
|
753
759
|
.html(html)
|
754
760
|
;
|
755
|
-
module.
|
761
|
+
if( module.can.show() ) {
|
762
|
+
module.showResults();
|
763
|
+
}
|
756
764
|
},
|
757
765
|
|
758
766
|
showResults: function() {
|
759
|
-
if(
|
767
|
+
if(!module.is.visible()) {
|
760
768
|
if( module.can.transition() ) {
|
761
769
|
module.debug('Showing results with css animations');
|
762
770
|
$results
|
@@ -808,8 +816,8 @@ $.fn.search = function(parameters) {
|
|
808
816
|
module.debug('Generating html from response', response);
|
809
817
|
var
|
810
818
|
template = settings.templates[settings.type],
|
811
|
-
isProperObject = ($.isPlainObject(response.results) && !$.isEmptyObject(response.results)),
|
812
|
-
isProperArray = ($.isArray(response.results) && response.results.length > 0),
|
819
|
+
isProperObject = ($.isPlainObject(response[fields.results]) && !$.isEmptyObject(response[fields.results])),
|
820
|
+
isProperArray = ($.isArray(response[fields.results]) && response[fields.results].length > 0),
|
813
821
|
html = ''
|
814
822
|
;
|
815
823
|
if(isProperObject || isProperArray ) {
|
@@ -820,11 +828,11 @@ $.fn.search = function(parameters) {
|
|
820
828
|
}
|
821
829
|
}
|
822
830
|
else {
|
823
|
-
response.results = response.results.slice(0, settings.maxResults);
|
831
|
+
response[fields.results] = response[fields.results].slice(0, settings.maxResults);
|
824
832
|
}
|
825
833
|
}
|
826
834
|
if($.isFunction(template)) {
|
827
|
-
html = template(response);
|
835
|
+
html = template(response, fields);
|
828
836
|
}
|
829
837
|
else {
|
830
838
|
module.error(error.noTemplate, false);
|
@@ -1049,6 +1057,9 @@ $.fn.search.settings = {
|
|
1049
1057
|
],
|
1050
1058
|
// fields to search
|
1051
1059
|
|
1060
|
+
displayField : '',
|
1061
|
+
// field to display in standard results template
|
1062
|
+
|
1052
1063
|
searchFullText : true,
|
1053
1064
|
// whether to include fuzzy results in local search
|
1054
1065
|
|
@@ -1076,7 +1087,7 @@ $.fn.search.settings = {
|
|
1076
1087
|
onSelect : false,
|
1077
1088
|
onResultsAdd : false,
|
1078
1089
|
|
1079
|
-
onSearchQuery : function(){},
|
1090
|
+
onSearchQuery : function(query){},
|
1080
1091
|
onResults : function(response){},
|
1081
1092
|
|
1082
1093
|
onResultsOpen : function(){},
|
@@ -1113,6 +1124,21 @@ $.fn.search.settings = {
|
|
1113
1124
|
beginsWith : '(?:\s|^)'
|
1114
1125
|
},
|
1115
1126
|
|
1127
|
+
// maps api response attributes to internal representation
|
1128
|
+
fields: {
|
1129
|
+
categories : 'results', // array of categories (category view)
|
1130
|
+
categoryName : 'name', // name of category (category view)
|
1131
|
+
categoryResults : 'results', // array of results (category view)
|
1132
|
+
description : 'description', // result description
|
1133
|
+
image : 'image', // result image
|
1134
|
+
price : 'price', // result price
|
1135
|
+
results : 'results', // array of results (standard)
|
1136
|
+
title : 'title', // result title
|
1137
|
+
action : 'action', // "view more" object name
|
1138
|
+
actionText : 'text', // "view more" text
|
1139
|
+
actionURL : 'url' // "view more" url
|
1140
|
+
},
|
1141
|
+
|
1116
1142
|
selector : {
|
1117
1143
|
prompt : '.prompt',
|
1118
1144
|
searchButton : '.search.button',
|
@@ -1166,95 +1192,98 @@ $.fn.search.settings = {
|
|
1166
1192
|
}
|
1167
1193
|
return html;
|
1168
1194
|
},
|
1169
|
-
category: function(response) {
|
1195
|
+
category: function(response, fields) {
|
1170
1196
|
var
|
1171
1197
|
html = '',
|
1172
1198
|
escape = $.fn.search.settings.templates.escape
|
1173
1199
|
;
|
1174
|
-
if(response.
|
1200
|
+
if(response[fields.categoryResults] !== undefined) {
|
1201
|
+
|
1175
1202
|
// each category
|
1176
|
-
$.each(response.
|
1177
|
-
if(category.results !== undefined && category.results.length > 0) {
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1203
|
+
$.each(response[fields.categoryResults], function(index, category) {
|
1204
|
+
if(category[fields.results] !== undefined && category.results.length > 0) {
|
1205
|
+
|
1206
|
+
html += '<div class="category">';
|
1207
|
+
|
1208
|
+
if(category[fields.categoryName] !== undefined) {
|
1209
|
+
html += '<div class="name">' + category[fields.categoryName] + '</div>';
|
1210
|
+
}
|
1211
|
+
|
1182
1212
|
// each item inside category
|
1183
1213
|
$.each(category.results, function(index, result) {
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1214
|
+
if(response[fields.url]) {
|
1215
|
+
html += '<a class="result" href="' + response[fields.url] + '">';
|
1216
|
+
}
|
1217
|
+
else {
|
1218
|
+
html += '<a class="result">';
|
1187
1219
|
}
|
1188
|
-
if(result.image !== undefined) {
|
1189
|
-
result.image = escape(result.image);
|
1220
|
+
if(result[fields.image] !== undefined) {
|
1190
1221
|
html += ''
|
1191
1222
|
+ '<div class="image">'
|
1192
|
-
+ ' <img src="' + result.image + '"
|
1223
|
+
+ ' <img src="' + result[fields.image] + '">'
|
1193
1224
|
+ '</div>'
|
1194
1225
|
;
|
1195
1226
|
}
|
1196
1227
|
html += '<div class="content">';
|
1197
|
-
if(result.price !== undefined) {
|
1198
|
-
|
1199
|
-
html += '<div class="price">' + result.price + '</div>';
|
1228
|
+
if(result[fields.price] !== undefined) {
|
1229
|
+
html += '<div class="price">' + result[fields.price] + '</div>';
|
1200
1230
|
}
|
1201
|
-
if(result.title !== undefined) {
|
1202
|
-
|
1203
|
-
html += '<div class="title">' + result.title + '</div>';
|
1231
|
+
if(result[fields.title] !== undefined) {
|
1232
|
+
html += '<div class="title">' + result[fields.title] + '</div>';
|
1204
1233
|
}
|
1205
|
-
if(result.description !== undefined) {
|
1206
|
-
html += '<div class="description">' + result.description + '</div>';
|
1234
|
+
if(result[fields.description] !== undefined) {
|
1235
|
+
html += '<div class="description">' + result[fields.description] + '</div>';
|
1207
1236
|
}
|
1208
1237
|
html += ''
|
1209
1238
|
+ '</div>'
|
1210
|
-
+ '</div>'
|
1211
1239
|
;
|
1240
|
+
html += '</a>';
|
1212
1241
|
});
|
1213
1242
|
html += ''
|
1214
1243
|
+ '</div>'
|
1215
1244
|
;
|
1216
1245
|
}
|
1217
1246
|
});
|
1218
|
-
if(response.action) {
|
1247
|
+
if(response[fields.action]) {
|
1219
1248
|
html += ''
|
1220
|
-
+ '<a href="' + response.action.
|
1221
|
-
+ response.action.
|
1249
|
+
+ '<a href="' + response[fields.action][fields.actionURL] + '" class="action">'
|
1250
|
+
+ response[fields.action][fields.actionText]
|
1222
1251
|
+ '</a>';
|
1223
1252
|
}
|
1224
1253
|
return html;
|
1225
1254
|
}
|
1226
1255
|
return false;
|
1227
1256
|
},
|
1228
|
-
standard: function(response) {
|
1257
|
+
standard: function(response, fields) {
|
1229
1258
|
var
|
1230
1259
|
html = ''
|
1231
1260
|
;
|
1232
|
-
if(response.results !== undefined) {
|
1261
|
+
if(response[fields.results] !== undefined) {
|
1233
1262
|
|
1234
1263
|
// each result
|
1235
|
-
$.each(response.results, function(index, result) {
|
1236
|
-
if(
|
1237
|
-
html += '<a class="result" href="' +
|
1264
|
+
$.each(response[fields.results], function(index, result) {
|
1265
|
+
if(response[fields.url]) {
|
1266
|
+
html += '<a class="result" href="' + response[fields.url] + '">';
|
1238
1267
|
}
|
1239
1268
|
else {
|
1240
1269
|
html += '<a class="result">';
|
1241
1270
|
}
|
1242
|
-
if(result.image !== undefined) {
|
1271
|
+
if(result[fields.image] !== undefined) {
|
1243
1272
|
html += ''
|
1244
1273
|
+ '<div class="image">'
|
1245
|
-
+ ' <img src="' + result.image + '">'
|
1274
|
+
+ ' <img src="' + result[fields.image] + '">'
|
1246
1275
|
+ '</div>'
|
1247
1276
|
;
|
1248
1277
|
}
|
1249
1278
|
html += '<div class="content">';
|
1250
|
-
if(result.price !== undefined) {
|
1251
|
-
html += '<div class="price">' + result.price + '</div>';
|
1279
|
+
if(result[fields.price] !== undefined) {
|
1280
|
+
html += '<div class="price">' + result[fields.price] + '</div>';
|
1252
1281
|
}
|
1253
|
-
if(result.title !== undefined) {
|
1254
|
-
html += '<div class="title">' + result.title + '</div>';
|
1282
|
+
if(result[fields.title] !== undefined) {
|
1283
|
+
html += '<div class="title">' + result[fields.title] + '</div>';
|
1255
1284
|
}
|
1256
|
-
if(result.description !== undefined) {
|
1257
|
-
html += '<div class="description">' + result.description + '</div>';
|
1285
|
+
if(result[fields.description] !== undefined) {
|
1286
|
+
html += '<div class="description">' + result[fields.description] + '</div>';
|
1258
1287
|
}
|
1259
1288
|
html += ''
|
1260
1289
|
+ '</div>'
|
@@ -1262,10 +1291,10 @@ $.fn.search.settings = {
|
|
1262
1291
|
html += '</a>';
|
1263
1292
|
});
|
1264
1293
|
|
1265
|
-
if(response.action) {
|
1294
|
+
if(response[fields.action]) {
|
1266
1295
|
html += ''
|
1267
|
-
+ '<a href="' + response.action.
|
1268
|
-
+ response.action.
|
1296
|
+
+ '<a href="' + response[fields.action][fields.actionURL] + '" class="action">'
|
1297
|
+
+ response[fields.action][fields.actionText]
|
1269
1298
|
+ '</a>';
|
1270
1299
|
}
|
1271
1300
|
return html;
|