semantic-ui-sass 1.7.0.0 → 1.7.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/assets/javascripts/semantic-ui/accordion.js +100 -47
  4. data/app/assets/javascripts/semantic-ui/api.js +9 -9
  5. data/app/assets/javascripts/semantic-ui/checkbox.js +14 -13
  6. data/app/assets/javascripts/semantic-ui/dimmer.js +9 -9
  7. data/app/assets/javascripts/semantic-ui/dropdown.js +98 -58
  8. data/app/assets/javascripts/semantic-ui/form.js +23 -23
  9. data/app/assets/javascripts/semantic-ui/modal.js +14 -14
  10. data/app/assets/javascripts/semantic-ui/popup.js +91 -40
  11. data/app/assets/javascripts/semantic-ui/progress.js +12 -6
  12. data/app/assets/javascripts/semantic-ui/rating.js +6 -6
  13. data/app/assets/javascripts/semantic-ui/search.js +217 -206
  14. data/app/assets/javascripts/semantic-ui/shape.js +8 -8
  15. data/app/assets/javascripts/semantic-ui/sidebar.js +116 -93
  16. data/app/assets/javascripts/semantic-ui/site.js +2 -2
  17. data/app/assets/javascripts/semantic-ui/state.js +6 -6
  18. data/app/assets/javascripts/semantic-ui/sticky.js +11 -11
  19. data/app/assets/javascripts/semantic-ui/tab.js +12 -12
  20. data/app/assets/javascripts/semantic-ui/transition.js +9 -9
  21. data/app/assets/javascripts/semantic-ui/video.js +4 -4
  22. data/app/assets/javascripts/semantic-ui/visibility.js +3 -3
  23. data/app/assets/javascripts/semantic-ui/visit.js +7 -7
  24. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
  25. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +1 -1
  26. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +118 -14
  27. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +23 -9
  28. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +4 -4
  29. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +1 -1
  30. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +127 -126
  31. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +1 -1
  32. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1 -2
  33. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +1 -1
  34. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +2 -2
  35. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
  36. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +1 -1
  37. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +5 -5
  38. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +4 -3
  39. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +1 -1
  40. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +1 -1
  41. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +13 -1
  42. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +1 -7
  43. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +36 -35
  44. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +1 -1
  45. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +23 -4
  46. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +3 -3
  47. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +1 -1
  48. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +1 -1
  49. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +115 -29
  50. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +1 -1
  51. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +1 -1
  52. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +1 -6
  53. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +13 -1
  54. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +1 -1
  55. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +1 -1
  56. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -1
  57. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +134 -16
  58. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +1 -1
  59. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +1 -1
  60. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
  61. data/app/assets/stylesheets/semantic-ui/modules/_video.scss +1 -1
  62. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +13 -1
  63. data/app/assets/stylesheets/semantic-ui/views/_card.scss +1 -1
  64. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +1 -1
  65. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +1 -1
  66. data/app/assets/stylesheets/semantic-ui/views/_item.scss +1 -1
  67. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +1 -1
  68. data/lib/semantic/ui/sass/version.rb +2 -2
  69. metadata +2 -2
@@ -56,7 +56,7 @@ $.fn.rating = function(parameters) {
56
56
  initialize: function() {
57
57
  module.verbose('Initializing rating module', settings);
58
58
 
59
- if($icon.size() === 0) {
59
+ if($icon.length === 0) {
60
60
  module.setup.layout();
61
61
  }
62
62
 
@@ -144,7 +144,7 @@ $.fn.rating = function(parameters) {
144
144
  currentRating = module.getRating(),
145
145
  rating = $icon.index($activeIcon) + 1,
146
146
  canClear = (settings.clearable == 'auto')
147
- ? ($icon.size() === 1)
147
+ ? ($icon.length === 1)
148
148
  : settings.clearable
149
149
  ;
150
150
  if(canClear && currentRating == rating) {
@@ -163,7 +163,7 @@ $.fn.rating = function(parameters) {
163
163
 
164
164
  getRating: function() {
165
165
  var
166
- currentRating = $icon.filter('.' + className.active).size()
166
+ currentRating = $icon.filter('.' + className.active).length
167
167
  ;
168
168
  module.verbose('Current rating retrieved', currentRating);
169
169
  return currentRating;
@@ -213,7 +213,7 @@ $.fn.rating = function(parameters) {
213
213
  .addClass(className.active)
214
214
  ;
215
215
  }
216
- $.proxy(settings.onRate, element)(rating);
216
+ settings.onRate.call(element, rating);
217
217
  },
218
218
 
219
219
  setting: function(name, value) {
@@ -301,8 +301,8 @@ $.fn.rating = function(parameters) {
301
301
  if(moduleSelector) {
302
302
  title += ' \'' + moduleSelector + '\'';
303
303
  }
304
- if($allModules.size() > 1) {
305
- title += ' ' + '(' + $allModules.size() + ')';
304
+ if($allModules.length > 1) {
305
+ title += ' ' + '(' + $allModules.length + ')';
306
306
  }
307
307
  if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
308
308
  console.groupCollapsed(title);
@@ -65,7 +65,7 @@ $.fn.search = function(parameters) {
65
65
  ;
66
66
  if(settings.automatic) {
67
67
  $prompt
68
- .on(inputEvent + eventNamespace, module.search.throttle)
68
+ .on(inputEvent + eventNamespace, module.throttle)
69
69
  ;
70
70
  }
71
71
  $prompt
@@ -74,12 +74,12 @@ $.fn.search = function(parameters) {
74
74
  .on('keydown' + eventNamespace, module.handleKeyboard)
75
75
  ;
76
76
  $searchButton
77
- .on('click' + eventNamespace, module.search.query)
77
+ .on('click' + eventNamespace, module.query)
78
78
  ;
79
79
  $results
80
- .on('mousedown' + eventNamespace, module.event.mousedown)
81
- .on('mouseup' + eventNamespace, module.event.mouseup)
82
- .on('click' + eventNamespace, selector.result, module.results.select)
80
+ .on('mousedown' + eventNamespace, module.event.result.mousedown)
81
+ .on('mouseup' + eventNamespace, module.event.result.mouseup)
82
+ .on('click' + eventNamespace, selector.result, module.event.result.click)
83
83
  ;
84
84
  module.instantiate();
85
85
  },
@@ -111,24 +111,57 @@ $.fn.search = function(parameters) {
111
111
  .addClass(className.focus)
112
112
  ;
113
113
  clearTimeout(module.timer);
114
- module.search.throttle();
115
- if(module.has.minimum()) {
116
- module.results.show();
114
+ module.throttle();
115
+ if( module.has.minimumCharacters() ) {
116
+ module.showResults();
117
117
  }
118
118
  },
119
- mousedown: function() {
120
- module.resultsClicked = true;
121
- },
122
- mouseup: function() {
123
- module.resultsClicked = false;
124
- },
125
119
  blur: function(event) {
126
- module.search.cancel();
120
+ module.cancel();
127
121
  $module
128
122
  .removeClass(className.focus)
129
123
  ;
130
124
  if(!module.resultsClicked) {
131
- module.timer = setTimeout(module.results.hide, settings.hideDelay);
125
+ module.timer = setTimeout(module.hideResults, settings.hideDelay);
126
+ }
127
+ },
128
+ result: {
129
+ mousedown: function() {
130
+ module.resultsClicked = true;
131
+ },
132
+ mouseup: function() {
133
+ module.resultsClicked = false;
134
+ },
135
+ click: function(event) {
136
+ module.debug('Search result selected');
137
+ var
138
+ $result = $(this),
139
+ $title = $result.find('.title'),
140
+ title = $title.html()
141
+ ;
142
+ if(settings.onSelect == 'default' || settings.onSelect.call(this, event) == 'default') {
143
+ var
144
+ $link = $result.find('a[href]').eq(0),
145
+ $title = $result.find(selector.title).eq(0),
146
+ href = $link.attr('href') || false,
147
+ target = $link.attr('target') || false,
148
+ name = ($title.length > 0)
149
+ ? $title.text()
150
+ : false
151
+ ;
152
+ module.hideResults();
153
+ if(name) {
154
+ $prompt.val(name);
155
+ }
156
+ if(href) {
157
+ if(target == '_blank' || event.ctrlKey) {
158
+ window.open(href);
159
+ }
160
+ else {
161
+ window.location.href = (href);
162
+ }
163
+ }
164
+ }
132
165
  }
133
166
  }
134
167
  },
@@ -147,7 +180,7 @@ $.fn.search = function(parameters) {
147
180
  },
148
181
  activeClass = className.active,
149
182
  currentIndex = $result.index( $result.filter('.' + activeClass) ),
150
- resultSize = $result.size(),
183
+ resultSize = $result.length,
151
184
  newIndex
152
185
  ;
153
186
  // search shortcuts
@@ -158,11 +191,11 @@ $.fn.search = function(parameters) {
158
191
  ;
159
192
  }
160
193
  // result shortcuts
161
- if($results.filter(':visible').size() > 0) {
194
+ if($results.filter(':visible').length > 0) {
162
195
  if(keyCode == keys.enter) {
163
196
  module.verbose('Enter key pressed, selecting active result');
164
- if( $result.filter('.' + activeClass).size() > 0 ) {
165
- $.proxy(module.results.select, $result.filter('.' + activeClass) )(event);
197
+ if( $result.filter('.' + activeClass).length > 0 ) {
198
+ module.event.result.click.call($result.filter('.' + activeClass), event);
166
199
  event.preventDefault();
167
200
  return false;
168
201
  }
@@ -208,7 +241,7 @@ $.fn.search = function(parameters) {
208
241
  // query shortcuts
209
242
  if(keyCode == keys.enter) {
210
243
  module.verbose('Enter key pressed, executing query');
211
- module.search.query();
244
+ module.query();
212
245
  $searchButton
213
246
  .addClass(className.down)
214
247
  ;
@@ -222,64 +255,39 @@ $.fn.search = function(parameters) {
222
255
  }
223
256
  }
224
257
  },
225
- has: {
226
- minimum: function() {
227
- var
228
- searchTerm = $prompt.val(),
229
- numCharacters = searchTerm.length
230
- ;
231
- return (numCharacters >= settings.minCharacters);
258
+
259
+ query: function() {
260
+ var
261
+ searchTerm = $prompt.val(),
262
+ cachedHTML = module.read.cache(searchTerm)
263
+ ;
264
+ if(cachedHTML) {
265
+ module.debug('Reading result for ' + searchTerm + ' from cache');
266
+ module.addResults(cachedHTML);
232
267
  }
233
- },
234
- search: {
235
- cancel: function() {
236
- var
237
- xhr = $module.data('xhr') || false
238
- ;
239
- if( xhr && xhr.state() != 'resolved') {
240
- module.debug('Cancelling last search');
241
- xhr.abort();
268
+ else {
269
+ module.debug('Querying for ' + searchTerm);
270
+ if($.isPlainObject(settings.source) || $.isArray(settings.source)) {
271
+ module.search.local(searchTerm);
242
272
  }
243
- },
244
- throttle: function() {
245
- clearTimeout(module.timer);
246
- if(module.has.minimum()) {
247
- module.timer = setTimeout(module.search.query, settings.searchDelay);
273
+ else if(settings.apiSettings) {
274
+ module.search.remote(searchTerm);
248
275
  }
249
- else {
250
- module.results.hide();
251
- }
252
- },
253
- query: function() {
254
- var
255
- searchTerm = $prompt.val(),
256
- cachedHTML = module.search.cache.read(searchTerm)
257
- ;
258
- if(cachedHTML) {
259
- module.debug("Reading result for '" + searchTerm + "' from cache");
260
- module.results.add(cachedHTML);
276
+ else if($.fn.api !== undefined && $.api.settings.api.search !== undefined) {
277
+ module.debug('Searching with default search API endpoint');
278
+ settings.apiSettings = {
279
+ action: 'search'
280
+ };
281
+ module.search.remote(searchTerm);
261
282
  }
262
283
  else {
263
- module.debug("Querying for '" + searchTerm + "'");
264
- if($.isPlainObject(settings.source) || $.isArray(settings.source)) {
265
- module.search.local(searchTerm);
266
- }
267
- else if(settings.apiSettings) {
268
- module.search.remote(searchTerm);
269
- }
270
- else if($.fn.api !== undefined && $.api.settings.api.search !== undefined) {
271
- module.debug('Searching with default search API endpoint');
272
- settings.apiSettings = {
273
- action: 'search'
274
- };
275
- module.search.remote(searchTerm);
276
- }
277
- else {
278
- module.error(error.source);
279
- }
280
- $.proxy(settings.onSearchQuery, $module)(searchTerm);
284
+ module.error(error.source);
281
285
  }
282
- },
286
+ settings.onSearchQuery.call(element, searchTerm);
287
+ }
288
+ },
289
+
290
+ search: {
283
291
  local: function(searchTerm) {
284
292
  var
285
293
  results = [],
@@ -305,20 +313,20 @@ $.fn.search = function(parameters) {
305
313
  if( content[field].match(searchRegExp) ) {
306
314
  results.push(content);
307
315
  }
308
- else if( settings.searchFullText && content[field].match(content[field]) ) {
316
+ else if( settings.searchFullText && content[field].match(fullTextRegExp) ) {
309
317
  fullTextResults.push(content);
310
318
  }
311
319
  }
312
320
  });
313
321
  });
314
- searchHTML = module.results.generate({
322
+ searchHTML = module.generateResults({
315
323
  results: $.merge(results, fullTextResults)
316
324
  });
317
325
  $module
318
326
  .removeClass(className.loading)
319
327
  ;
320
- module.search.cache.write(searchTerm, searchHTML);
321
- module.results.add(searchHTML);
328
+ module.write.cache(searchTerm, searchHTML);
329
+ module.addResults(searchHTML);
322
330
  },
323
331
  remote: function(searchTerm) {
324
332
  var
@@ -328,160 +336,163 @@ $.fn.search = function(parameters) {
328
336
  query: searchTerm
329
337
  },
330
338
  onSuccess : function(response) {
331
- searchHTML = module.results.generate(response);
332
- module.search.cache.write(searchTerm, searchHTML);
333
- module.results.add(searchHTML);
339
+ searchHTML = module.generateResults(response);
340
+ module.write.cache(searchTerm, searchHTML);
341
+ module.addResults(searchHTML);
334
342
  },
335
343
  onFailure : module.error
336
344
  },
337
345
  searchHTML
338
346
  ;
339
- module.search.cancel();
347
+ module.cancel();
340
348
  module.debug('Executing search');
341
349
  $.extend(true, apiSettings, settings.apiSettings);
342
350
  $.api(apiSettings);
343
- },
351
+ }
344
352
 
345
- cache: {
346
- read: function(name) {
347
- var
348
- cache = $module.data('cache')
349
- ;
350
- return (settings.cache && (typeof cache == 'object') && (cache[name] !== undefined) )
351
- ? cache[name]
352
- : false
353
- ;
354
- },
355
- write: function(name, value) {
356
- var
357
- cache = ($module.data('cache') !== undefined)
358
- ? $module.data('cache')
359
- : {}
360
- ;
361
- cache[name] = value;
362
- $module
363
- .data('cache', cache)
364
- ;
365
- }
353
+ },
354
+
355
+ throttle: function() {
356
+ clearTimeout(module.timer);
357
+ if(module.has.minimumCharacters()) {
358
+ module.timer = setTimeout(module.query, settings.searchDelay);
359
+ }
360
+ else {
361
+ module.hideResults();
366
362
  }
367
363
  },
368
364
 
369
- results: {
370
- generate: function(response) {
371
- module.debug('Generating html from response', response);
365
+ cancel: function() {
366
+ var
367
+ xhr = $module.data('xhr') || false
368
+ ;
369
+ if( xhr && xhr.state() != 'resolved') {
370
+ module.debug('Cancelling last search');
371
+ xhr.abort();
372
+ }
373
+ },
374
+
375
+ has: {
376
+ minimumCharacters: function() {
372
377
  var
373
- template = settings.templates[settings.type],
374
- html = ''
378
+ searchTerm = $prompt.val(),
379
+ numCharacters = searchTerm.length
375
380
  ;
376
- if(($.isPlainObject(response.results) && !$.isEmptyObject(response.results)) || ($.isArray(response.results) && response.results.length > 0) ) {
377
- if(settings.maxResults > 0) {
378
- response.results = $.isArray(response.results)
379
- ? response.results.slice(0, settings.maxResults)
380
- : response.results
381
- ;
382
- }
383
- if($.isFunction(template)) {
384
- html = template(response);
385
- }
386
- else {
387
- module.error(error.noTemplate, false);
388
- }
381
+ return (numCharacters >= settings.minCharacters);
382
+ }
383
+ },
384
+
385
+ read: {
386
+ cache: function(name) {
387
+ var
388
+ cache = $module.data('cache')
389
+ ;
390
+ return (settings.cache && (typeof cache == 'object') && (cache[name] !== undefined) )
391
+ ? cache[name]
392
+ : false
393
+ ;
394
+ }
395
+ },
396
+
397
+ write: {
398
+ cache: function(name, value) {
399
+ var
400
+ cache = ($module.data('cache') !== undefined)
401
+ ? $module.data('cache')
402
+ : {}
403
+ ;
404
+ cache[name] = value;
405
+ $module
406
+ .data('cache', cache)
407
+ ;
408
+ }
409
+ },
410
+
411
+ addResults: function(html) {
412
+ if(settings.onResultsAdd == 'default' || settings.onResultsAdd.call($results, html) == 'default') {
413
+ $results
414
+ .html(html)
415
+ ;
416
+ }
417
+ module.showResults();
418
+ },
419
+
420
+ showResults: function() {
421
+ if( ($results.filter(':visible').length === 0) && ($prompt.filter(':focus').length > 0) && $results.html() !== '') {
422
+ if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported') && !$results.transition('is inward')) {
423
+ module.debug('Showing results with css animations');
424
+ $results
425
+ .transition({
426
+ animation : settings.transition + ' in',
427
+ duration : settings.duration,
428
+ queue : true
429
+ })
430
+ ;
389
431
  }
390
432
  else {
391
- html = module.message(error.noResults, 'empty');
392
- }
393
- $.proxy(settings.onResults, $module)(response);
394
- return html;
395
- },
396
- add: function(html) {
397
- if(settings.onResultsAdd == 'default' || $.proxy(settings.onResultsAdd, $results)(html) == 'default') {
433
+ module.debug('Showing results with javascript');
398
434
  $results
399
- .html(html)
435
+ .stop()
436
+ .fadeIn(settings.duration, settings.easing)
400
437
  ;
401
438
  }
402
- module.results.show();
403
- },
404
- show: function() {
405
- if( ($results.filter(':visible').size() === 0) && ($prompt.filter(':focus').size() > 0) && $results.html() !== '') {
406
- if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported') && !$results.transition('is inward')) {
407
- module.debug('Showing results with css animations');
408
- $results
409
- .transition({
410
- animation : settings.transition + ' in',
411
- duration : settings.duration,
412
- queue : true
413
- })
414
- ;
415
- }
416
- else {
417
- module.debug('Showing results with javascript');
418
- $results
419
- .stop()
420
- .fadeIn(settings.duration, settings.easing)
421
- ;
422
- }
423
- $.proxy(settings.onResultsOpen, $results)();
439
+ settings.onResultsOpen.call($results);
440
+ }
441
+ },
442
+ hideResults: function() {
443
+ if($results.filter(':visible').length > 0) {
444
+ if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported') && !$results.transition('is outward')) {
445
+ module.debug('Hiding results with css animations');
446
+ $results
447
+ .transition({
448
+ animation : settings.transition + ' out',
449
+ duration : settings.duration,
450
+ queue : true
451
+ })
452
+ ;
424
453
  }
425
- },
426
- hide: function() {
427
- if($results.filter(':visible').size() > 0) {
428
- if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported') && !$results.transition('is outward')) {
429
- module.debug('Hiding results with css animations');
430
- $results
431
- .transition({
432
- animation : settings.transition + ' out',
433
- duration : settings.duration,
434
- queue : true
435
- })
436
- ;
437
- }
438
- else {
439
- module.debug('Hiding results with javascript');
440
- $results
441
- .stop()
442
- .fadeIn(settings.duration, settings.easing)
443
- ;
444
- }
445
- $.proxy(settings.onResultsClose, $results)();
454
+ else {
455
+ module.debug('Hiding results with javascript');
456
+ $results
457
+ .stop()
458
+ .fadeIn(settings.duration, settings.easing)
459
+ ;
446
460
  }
447
- },
448
- select: function(event) {
449
- module.debug('Search result selected');
450
- var
451
- $result = $(this),
452
- $title = $result.find('.title'),
453
- title = $title.html()
454
- ;
455
- if(settings.onSelect == 'default' || $.proxy(settings.onSelect, this)(event) == 'default') {
456
- var
457
- $link = $result.find('a[href]').eq(0),
458
- $title = $result.find(selector.title).eq(0),
459
- href = $link.attr('href') || false,
460
- target = $link.attr('target') || false,
461
- name = ($title.size() > 0)
462
- ? $title.text()
463
- : false
461
+ settings.onResultsClose.call($results);
462
+ }
463
+ },
464
+
465
+ generateResults: function(response) {
466
+ module.debug('Generating html from response', response);
467
+ var
468
+ template = settings.templates[settings.type],
469
+ html = ''
470
+ ;
471
+ if(($.isPlainObject(response.results) && !$.isEmptyObject(response.results)) || ($.isArray(response.results) && response.results.length > 0) ) {
472
+ if(settings.maxResults > 0) {
473
+ response.results = $.isArray(response.results)
474
+ ? response.results.slice(0, settings.maxResults)
475
+ : response.results
464
476
  ;
465
- module.results.hide();
466
- if(name) {
467
- $prompt.val(name);
468
- }
469
- if(href) {
470
- if(target == '_blank' || event.ctrlKey) {
471
- window.open(href);
472
- }
473
- else {
474
- window.location.href = (href);
475
- }
476
- }
477
477
  }
478
+ if($.isFunction(template)) {
479
+ html = template(response);
480
+ }
481
+ else {
482
+ module.error(error.noTemplate, false);
483
+ }
484
+ }
485
+ else {
486
+ html = module.displayMessage(error.noResults, 'empty');
478
487
  }
488
+ settings.onResults.call(element, response);
489
+ return html;
479
490
  },
480
491
 
481
- // displays mesage visibly in search results
482
- message: function(text, type) {
492
+ displayMessage: function(text, type) {
483
493
  type = type || 'standard';
484
- module.results.add( settings.templates.message(text, type) );
494
+ module.debug('Displaying message', text, type);
495
+ module.addResults( settings.templates.message(text, type) );
485
496
  return settings.templates.message(text, type);
486
497
  },
487
498
 
@@ -569,8 +580,8 @@ $.fn.search = function(parameters) {
569
580
  if(moduleSelector) {
570
581
  title += ' \'' + moduleSelector + '\'';
571
582
  }
572
- if($allModules.size() > 1) {
573
- title += ' ' + '(' + $allModules.size() + ')';
583
+ if($allModules.length > 1) {
584
+ title += ' ' + '(' + $allModules.length + ')';
574
585
  }
575
586
  if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
576
587
  console.groupCollapsed(title);