semantic-ui-sass 1.12.3.0 → 2.0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/assets/javascripts/semantic-ui.js +1 -0
  4. data/app/assets/javascripts/semantic-ui/accordion.js +67 -53
  5. data/app/assets/javascripts/semantic-ui/api.js +395 -189
  6. data/app/assets/javascripts/semantic-ui/checkbox.js +322 -114
  7. data/app/assets/javascripts/semantic-ui/colorize.js +4 -2
  8. data/app/assets/javascripts/semantic-ui/dimmer.js +74 -50
  9. data/app/assets/javascripts/semantic-ui/dropdown.js +2046 -584
  10. data/app/assets/javascripts/semantic-ui/embed.js +662 -0
  11. data/app/assets/javascripts/semantic-ui/form.js +345 -163
  12. data/app/assets/javascripts/semantic-ui/modal.js +119 -90
  13. data/app/assets/javascripts/semantic-ui/nag.js +8 -9
  14. data/app/assets/javascripts/semantic-ui/popup.js +390 -228
  15. data/app/assets/javascripts/semantic-ui/progress.js +112 -103
  16. data/app/assets/javascripts/semantic-ui/rating.js +79 -55
  17. data/app/assets/javascripts/semantic-ui/search.js +305 -123
  18. data/app/assets/javascripts/semantic-ui/shape.js +94 -48
  19. data/app/assets/javascripts/semantic-ui/sidebar.js +84 -151
  20. data/app/assets/javascripts/semantic-ui/site.js +5 -5
  21. data/app/assets/javascripts/semantic-ui/state.js +4 -4
  22. data/app/assets/javascripts/semantic-ui/sticky.js +108 -35
  23. data/app/assets/javascripts/semantic-ui/tab.js +220 -125
  24. data/app/assets/javascripts/semantic-ui/transition.js +205 -171
  25. data/app/assets/javascripts/semantic-ui/visibility.js +220 -100
  26. data/app/assets/javascripts/semantic-ui/visit.js +6 -4
  27. data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +17 -16
  28. data/app/assets/stylesheets/semantic-ui/collections/_form.scss +223 -121
  29. data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +462 -448
  30. data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +949 -665
  31. data/app/assets/stylesheets/semantic-ui/collections/_message.scss +134 -92
  32. data/app/assets/stylesheets/semantic-ui/collections/_table.scss +270 -208
  33. data/app/assets/stylesheets/semantic-ui/elements/_all.scss +1 -0
  34. data/app/assets/stylesheets/semantic-ui/elements/_button.scss +1357 -521
  35. data/app/assets/stylesheets/semantic-ui/elements/_container.scss +125 -0
  36. data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +51 -31
  37. data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +3 -3
  38. data/app/assets/stylesheets/semantic-ui/elements/_header.scss +270 -144
  39. data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +241 -110
  40. data/app/assets/stylesheets/semantic-ui/elements/_image.scss +30 -16
  41. data/app/assets/stylesheets/semantic-ui/elements/_input.scss +88 -53
  42. data/app/assets/stylesheets/semantic-ui/elements/_label.scss +432 -281
  43. data/app/assets/stylesheets/semantic-ui/elements/_list.scss +172 -128
  44. data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +16 -14
  45. data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +15 -7
  46. data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +32 -13
  47. data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +329 -212
  48. data/app/assets/stylesheets/semantic-ui/elements/_step.scss +291 -99
  49. data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +2 -2
  50. data/app/assets/stylesheets/semantic-ui/globals/_site.scss +19 -18
  51. data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +17 -18
  52. data/app/assets/stylesheets/semantic-ui/modules/_all.scss +1 -0
  53. data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +265 -161
  54. data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +29 -15
  55. data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +441 -156
  56. data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +168 -0
  57. data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +163 -85
  58. data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +8 -8
  59. data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +88 -23
  60. data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +185 -129
  61. data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +75 -60
  62. data/app/assets/stylesheets/semantic-ui/modules/_search.scss +99 -52
  63. data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +11 -11
  64. data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +16 -12
  65. data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +4 -4
  66. data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +3 -3
  67. data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +31 -39
  68. data/app/assets/stylesheets/semantic-ui/views/_ad.scss +3 -3
  69. data/app/assets/stylesheets/semantic-ui/views/_all.scss +1 -0
  70. data/app/assets/stylesheets/semantic-ui/views/_card.scss +204 -162
  71. data/app/assets/stylesheets/semantic-ui/views/_comment.scss +6 -6
  72. data/app/assets/stylesheets/semantic-ui/views/_feed.scss +51 -26
  73. data/app/assets/stylesheets/semantic-ui/views/_item.scss +62 -36
  74. data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +265 -90
  75. data/lib/semantic/ui/sass/version.rb +2 -2
  76. data/semantic-ui-sass.gemspec +2 -2
  77. metadata +9 -6
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * # Semantic UI 1.12.3 - Progress
2
+ * # Semantic UI - Progress
3
3
  * http://github.com/semantic-org/semantic-ui/
4
4
  *
5
5
  *
6
- * Copyright 2014 Contributors
6
+ * Copyright 2015 Contributors
7
7
  * Released under the MIT license
8
8
  * http://opensource.org/licenses/MIT
9
9
  *
@@ -63,11 +63,12 @@ $.fn.progress = function(parameters) {
63
63
  initialize: function() {
64
64
  module.debug('Initializing progress bar', settings);
65
65
 
66
- transitionEnd = module.get.transitionEnd();
66
+ module.set.duration();
67
+ module.set.transitionEvent();
67
68
 
68
69
  module.read.metadata();
69
- module.set.duration();
70
- module.set.initials();
70
+ module.read.settings();
71
+
71
72
  module.instantiate();
72
73
  },
73
74
 
@@ -98,92 +99,116 @@ $.fn.progress = function(parameters) {
98
99
 
99
100
  read: {
100
101
  metadata: function() {
101
- if( $module.data(metadata.percent) ) {
102
- module.verbose('Current percent value set from metadata');
103
- module.percent = $module.data(metadata.percent);
102
+ var
103
+ data = {
104
+ percent : $module.data(metadata.percent),
105
+ total : $module.data(metadata.total),
106
+ value : $module.data(metadata.value)
107
+ }
108
+ ;
109
+ if(data.percent) {
110
+ module.debug('Current percent value set from metadata', data.percent);
111
+ module.set.percent(data.percent);
104
112
  }
105
- if( $module.data(metadata.total) ) {
106
- module.verbose('Total value set from metadata');
107
- module.total = $module.data(metadata.total);
113
+ if(data.total) {
114
+ module.debug('Total value set from metadata', data.total);
115
+ module.set.total(data.total);
108
116
  }
109
- if( $module.data(metadata.value) ) {
110
- module.verbose('Current value set from metadata');
111
- module.value = $module.data(metadata.value);
117
+ if(data.value) {
118
+ module.debug('Current value set from metadata', data.value);
119
+ module.set.value(data.value);
120
+ module.set.progress(data.value);
112
121
  }
113
122
  },
114
- currentValue: function() {
115
- return (module.value !== undefined)
116
- ? module.value
117
- : false
118
- ;
123
+ settings: function() {
124
+ if(settings.total !== false) {
125
+ module.debug('Current total set in settings', settings.total);
126
+ module.set.total(settings.total);
127
+ }
128
+ if(settings.value !== false) {
129
+ module.debug('Current value set in settings', settings.value);
130
+ module.set.value(settings.value);
131
+ module.set.progress(module.value);
132
+ }
133
+ if(settings.percent !== false) {
134
+ module.debug('Current percent set in settings', settings.percent);
135
+ module.set.percent(settings.percent);
136
+ }
119
137
  }
120
138
  },
121
139
 
122
140
  increment: function(incrementValue) {
123
141
  var
124
- total = module.total || false,
125
- edgeValue,
142
+ maxValue,
126
143
  startValue,
127
144
  newValue
128
145
  ;
129
- if(total) {
130
- startValue = module.value || 0;
146
+ if( module.has.total() ) {
147
+ startValue = module.get.value();
131
148
  incrementValue = incrementValue || 1;
149
+
132
150
  newValue = startValue + incrementValue;
133
- edgeValue = module.total;
134
- module.debug('Incrementing value by', incrementValue, startValue, edgeValue);
135
- if(newValue > edgeValue ) {
136
- module.debug('Value cannot increment above total', edgeValue);
137
- newValue = edgeValue;
151
+ maxValue = module.get.total();
152
+
153
+ module.debug('Incrementing value', startValue, newValue, maxValue);
154
+ if(newValue > maxValue ) {
155
+ module.debug('Value cannot increment above total', maxValue);
156
+ newValue = maxValue;
138
157
  }
139
- module.set.progress(newValue);
140
158
  }
141
159
  else {
142
- startValue = module.percent || 0;
160
+ startValue = module.get.percent();
143
161
  incrementValue = incrementValue || module.get.randomValue();
162
+
144
163
  newValue = startValue + incrementValue;
145
- edgeValue = 100;
146
- module.debug('Incrementing percentage by', incrementValue, startValue);
147
- if(newValue > edgeValue ) {
164
+ maxValue = 100;
165
+
166
+ module.debug('Incrementing percentage by', startValue, newValue);
167
+ if(newValue > maxValue ) {
148
168
  module.debug('Value cannot increment above 100 percent');
149
- newValue = edgeValue;
169
+ newValue = maxValue;
150
170
  }
151
- module.set.progress(newValue);
152
171
  }
172
+ module.set.progress(newValue);
153
173
  },
154
174
  decrement: function(decrementValue) {
155
175
  var
156
- total = module.total || false,
157
- edgeValue = 0,
176
+ total = module.get.total(),
158
177
  startValue,
159
178
  newValue
160
179
  ;
161
180
  if(total) {
162
- startValue = module.value || 0;
181
+ startValue = module.get.value();
163
182
  decrementValue = decrementValue || 1;
164
183
  newValue = startValue - decrementValue;
165
184
  module.debug('Decrementing value by', decrementValue, startValue);
166
185
  }
167
186
  else {
168
- startValue = module.percent || 0;
187
+ startValue = module.get.percent();
169
188
  decrementValue = decrementValue || module.get.randomValue();
170
189
  newValue = startValue - decrementValue;
171
190
  module.debug('Decrementing percentage by', decrementValue, startValue);
172
191
  }
173
192
 
174
- if(newValue < edgeValue) {
193
+ if(newValue < 0) {
175
194
  module.debug('Value cannot decrement below 0');
176
195
  newValue = 0;
177
196
  }
178
197
  module.set.progress(newValue);
179
198
  },
180
199
 
200
+ has: {
201
+ total: function() {
202
+ return (module.get.total() !== false);
203
+ }
204
+ },
205
+
181
206
  get: {
182
207
  text: function(templateText) {
183
208
  var
184
209
  value = module.value || 0,
185
210
  total = module.total || 0,
186
- percent = (module.is.visible() && animating)
211
+ percent = (animating)
187
212
  ? module.get.displayPercent()
188
213
  : module.percent || 0,
189
214
  left = (module.total > 0)
@@ -200,11 +225,22 @@ $.fn.progress = function(parameters) {
200
225
  module.debug('Adding variables to progress bar text', templateText);
201
226
  return templateText;
202
227
  },
228
+
229
+
203
230
  randomValue: function() {
204
231
  module.debug('Generating random increment percentage');
205
232
  return Math.floor((Math.random() * settings.random.max) + settings.random.min);
206
233
  },
207
234
 
235
+ numericValue: function(value) {
236
+ return (typeof value === 'string')
237
+ ? (value.replace(/[^\d.]/g, '') !== '')
238
+ ? +(value.replace(/[^\d.]/g, ''))
239
+ : false
240
+ : value
241
+ ;
242
+ },
243
+
208
244
  transitionEnd: function() {
209
245
  var
210
246
  element = document.createElement('element'),
@@ -233,17 +269,17 @@ $.fn.progress = function(parameters) {
233
269
  ? (barWidth / totalWidth * 100)
234
270
  : module.percent
235
271
  ;
236
- if(settings.precision === 0) {
237
- return Math.round(displayPercent);
238
- }
239
- return Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision);
272
+ return (settings.precision > 0)
273
+ ? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision)
274
+ : Math.round(displayPercent)
275
+ ;
240
276
  },
241
277
 
242
278
  percent: function() {
243
279
  return module.percent || 0;
244
280
  },
245
281
  value: function() {
246
- return module.value || false;
282
+ return module.value || 0;
247
283
  },
248
284
  total: function() {
249
285
  return module.total || false;
@@ -319,66 +355,37 @@ $.fn.progress = function(parameters) {
319
355
  module.verbose('Setting progress bar transition duration', duration);
320
356
  $bar
321
357
  .css({
322
- '-webkit-transition-duration': duration,
323
- '-moz-transition-duration': duration,
324
- '-ms-transition-duration': duration,
325
- '-o-transition-duration': duration,
326
358
  'transition-duration': duration
327
359
  })
328
360
  ;
329
361
  },
330
- initials: function() {
331
- if(settings.total !== false) {
332
- module.verbose('Current total set in settings', settings.total);
333
- module.total = settings.total;
334
- }
335
- if(settings.value !== false) {
336
- module.verbose('Current value set in settings', settings.value);
337
- module.value = settings.value;
338
- }
339
- if(settings.percent !== false) {
340
- module.verbose('Current percent set in settings', settings.percent);
341
- module.percent = settings.percent;
342
- }
343
- if(module.percent !== undefined) {
344
- module.set.percent(module.percent);
345
- }
346
- else if(module.value !== undefined) {
347
- module.set.progress(module.value);
348
- }
349
- },
350
362
  percent: function(percent) {
351
363
  percent = (typeof percent == 'string')
352
364
  ? +(percent.replace('%', ''))
353
365
  : percent
354
366
  ;
355
- if(percent > 0 && percent < 1) {
356
- module.verbose('Module percentage passed as decimal, converting');
357
- percent = percent * 100;
358
- }
359
- // round percentage
360
- if(settings.precision === 0) {
361
- percent = Math.round(percent);
362
- }
363
- else {
364
- percent = Math.round(percent * (10 * settings.precision)) / (10 * settings.precision);
365
- }
367
+ // round display percentage
368
+ percent = (settings.precision > 0)
369
+ ? Math.round(percent * (10 * settings.precision)) / (10 * settings.precision)
370
+ : Math.round(percent)
371
+ ;
366
372
  module.percent = percent;
367
- if(module.total) {
368
- module.value = Math.round( (percent / 100) * module.total * (10 * settings.precision)) / (10 * settings.precision);
369
- }
370
- else if(settings.limitValues) {
371
- module.value = (module.value > 100)
372
- ? 100
373
- : (module.value < 0)
374
- ? 0
375
- : module.value
373
+ if( !module.has.total() ) {
374
+ module.value = (settings.precision > 0)
375
+ ? Math.round( (percent / 100) * module.total * (10 * settings.precision)) / (10 * settings.precision)
376
+ : Math.round( (percent / 100) * module.total * 10) / 10
376
377
  ;
378
+ if(settings.limitValues) {
379
+ module.value = (module.value > 100)
380
+ ? 100
381
+ : (module.value < 0)
382
+ ? 0
383
+ : module.value
384
+ ;
385
+ }
377
386
  }
378
387
  module.set.barWidth(percent);
379
- if( module.is.visible() ) {
380
- module.set.labelInterval();
381
- }
388
+ module.set.labelInterval();
382
389
  module.set.labels();
383
390
  settings.onChange.call(element, percent, module.value, module.total);
384
391
  },
@@ -500,23 +507,25 @@ $.fn.progress = function(parameters) {
500
507
  }
501
508
  settings.onError.call(element, module.value, module.total);
502
509
  },
510
+ transitionEvent: function() {
511
+ transitionEnd = module.get.transitionEnd();
512
+ },
503
513
  total: function(totalValue) {
504
514
  module.total = totalValue;
505
515
  },
516
+ value: function(value) {
517
+ module.value = value;
518
+ },
506
519
  progress: function(value) {
507
520
  var
508
- numericValue = (typeof value === 'string')
509
- ? (value.replace(/[^\d.]/g, '') !== '')
510
- ? +(value.replace(/[^\d.]/g, ''))
511
- : false
512
- : value,
521
+ numericValue = module.get.numericValue(value),
513
522
  percentComplete
514
523
  ;
515
524
  if(numericValue === false) {
516
525
  module.error(error.nonNumeric, value);
517
526
  }
518
- if(module.total) {
519
- module.value = numericValue;
527
+ if( module.has.total() ) {
528
+ module.set.value(numericValue);
520
529
  percentComplete = (numericValue / module.total) * 100;
521
530
  module.debug('Calculating percent complete from total', percentComplete);
522
531
  module.set.percent( percentComplete );
@@ -598,7 +607,7 @@ $.fn.progress = function(parameters) {
598
607
  });
599
608
  }
600
609
  clearTimeout(module.performance.timer);
601
- module.performance.timer = setTimeout(module.performance.display, 100);
610
+ module.performance.timer = setTimeout(module.performance.display, 500);
602
611
  },
603
612
  display: function() {
604
613
  var
@@ -712,7 +721,7 @@ $.fn.progress.settings = {
712
721
  namespace : 'progress',
713
722
 
714
723
  debug : false,
715
- verbose : true,
724
+ verbose : false,
716
725
  performance : true,
717
726
 
718
727
  random : {
@@ -727,7 +736,7 @@ $.fn.progress.settings = {
727
736
  limitValues : true,
728
737
 
729
738
  label : 'percent',
730
- precision : 1,
739
+ precision : 0,
731
740
  framerate : (1000 / 30), /// 30 fps
732
741
 
733
742
  percent : false,
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * # Semantic UI 1.12.3 - Rating
2
+ * # Semantic UI - Rating
3
3
  * http://github.com/semantic-org/semantic-ui/
4
4
  *
5
5
  *
6
- * Copyright 2014 Contributors
6
+ * Copyright 2015 Contributors
7
7
  * Released under the MIT license
8
8
  * http://opensource.org/licenses/MIT
9
9
  *
@@ -66,14 +66,7 @@ $.fn.rating = function(parameters) {
66
66
  else {
67
67
  module.disable();
68
68
  }
69
- if(settings.initialRating) {
70
- module.debug('Setting initial rating');
71
- module.setRating(settings.initialRating);
72
- }
73
- if( $module.data(metadata.rating) ) {
74
- module.debug('Rating found in metadata');
75
- module.setRating( $module.data(metadata.rating) );
76
- }
69
+ module.set.rating( module.get.initialRating() );
77
70
  module.instantiate();
78
71
  },
79
72
 
@@ -87,12 +80,10 @@ $.fn.rating = function(parameters) {
87
80
 
88
81
  destroy: function() {
89
82
  module.verbose('Destroying previous instance', instance);
83
+ module.remove.events();
90
84
  $module
91
85
  .removeData(moduleNamespace)
92
86
  ;
93
- $icon
94
- .off(eventNamespace)
95
- ;
96
87
  },
97
88
 
98
89
  refresh: function() {
@@ -102,11 +93,12 @@ $.fn.rating = function(parameters) {
102
93
  setup: {
103
94
  layout: function() {
104
95
  var
105
- maxRating = $module.data(metadata.maxRating) || settings.maxRating
96
+ maxRating = module.get.maxRating(),
97
+ html = $.fn.rating.settings.templates.icon(maxRating)
106
98
  ;
107
99
  module.debug('Generating icon html dynamically');
108
100
  $module
109
- .html($.fn.rating.settings.templates.icon(maxRating))
101
+ .html(html)
110
102
  ;
111
103
  module.refresh();
112
104
  }
@@ -141,7 +133,7 @@ $.fn.rating = function(parameters) {
141
133
  click: function() {
142
134
  var
143
135
  $activeIcon = $(this),
144
- currentRating = module.getRating(),
136
+ currentRating = module.get.rating(),
145
137
  rating = $icon.index($activeIcon) + 1,
146
138
  canClear = (settings.clearable == 'auto')
147
139
  ? ($icon.length === 1)
@@ -151,31 +143,39 @@ $.fn.rating = function(parameters) {
151
143
  module.clearRating();
152
144
  }
153
145
  else {
154
- module.setRating( rating );
146
+ module.set.rating( rating );
155
147
  }
156
148
  }
157
149
  },
158
150
 
159
151
  clearRating: function() {
160
152
  module.debug('Clearing current rating');
161
- module.setRating(0);
153
+ module.set.rating(0);
162
154
  },
163
155
 
164
- getRating: function() {
165
- var
166
- currentRating = $icon.filter('.' + className.active).length
167
- ;
168
- module.verbose('Current rating retrieved', currentRating);
169
- return currentRating;
156
+ bind: {
157
+ events: function() {
158
+ module.verbose('Binding events');
159
+ $module
160
+ .on('mouseenter' + eventNamespace, selector.icon, module.event.mouseenter)
161
+ .on('mouseleave' + eventNamespace, selector.icon, module.event.mouseleave)
162
+ .on('click' + eventNamespace, selector.icon, module.event.click)
163
+ ;
164
+ }
165
+ },
166
+
167
+ remove: {
168
+ events: function() {
169
+ module.verbose('Removing events');
170
+ $module
171
+ .off(eventNamespace)
172
+ ;
173
+ }
170
174
  },
171
175
 
172
176
  enable: function() {
173
177
  module.debug('Setting rating to interactive mode');
174
- $icon
175
- .on('mouseenter' + eventNamespace, module.event.mouseenter)
176
- .on('mouseleave' + eventNamespace, module.event.mouseleave)
177
- .on('click' + eventNamespace, module.event.click)
178
- ;
178
+ module.bind.events();
179
179
  $module
180
180
  .removeClass(className.disabled)
181
181
  ;
@@ -183,37 +183,61 @@ $.fn.rating = function(parameters) {
183
183
 
184
184
  disable: function() {
185
185
  module.debug('Setting rating to read-only mode');
186
- $icon
187
- .off(eventNamespace)
188
- ;
186
+ module.remove.events();
189
187
  $module
190
188
  .addClass(className.disabled)
191
189
  ;
192
190
  },
193
191
 
194
- setRating: function(rating) {
195
- var
196
- ratingIndex = (rating - 1 >= 0)
197
- ? (rating - 1)
198
- : 0,
199
- $activeIcon = $icon.eq(ratingIndex)
200
- ;
201
- $module
202
- .removeClass(className.selected)
203
- ;
204
- $icon
205
- .removeClass(className.selected)
206
- .removeClass(className.active)
207
- ;
208
- if(rating > 0) {
209
- module.verbose('Setting current rating to', rating);
210
- $activeIcon
211
- .prevAll()
212
- .andSelf()
213
- .addClass(className.active)
192
+ get: {
193
+ initialRating: function() {
194
+ if($module.data(metadata.rating) !== undefined) {
195
+ $module.removeData(metadata.rating);
196
+ return $module.data(metadata.rating);
197
+ }
198
+ return settings.initialRating;
199
+ },
200
+ maxRating: function() {
201
+ if($module.data(metadata.maxRating) !== undefined) {
202
+ $module.removeData(metadata.maxRating);
203
+ return $module.data(metadata.maxRating);
204
+ }
205
+ return settings.maxRating;
206
+ },
207
+ rating: function() {
208
+ var
209
+ currentRating = $icon.filter('.' + className.active).length
210
+ ;
211
+ module.verbose('Current rating retrieved', currentRating);
212
+ return currentRating;
213
+ }
214
+ },
215
+
216
+ set: {
217
+ rating: function(rating) {
218
+ var
219
+ ratingIndex = (rating - 1 >= 0)
220
+ ? (rating - 1)
221
+ : 0,
222
+ $activeIcon = $icon.eq(ratingIndex)
223
+ ;
224
+ $module
225
+ .removeClass(className.selected)
226
+ ;
227
+ $icon
228
+ .removeClass(className.selected)
229
+ .removeClass(className.active)
214
230
  ;
231
+ if(rating > 0) {
232
+ module.verbose('Setting current rating to', rating);
233
+ $activeIcon
234
+ .prevAll()
235
+ .andSelf()
236
+ .addClass(className.active)
237
+ ;
238
+ }
239
+ settings.onRate.call(element, rating);
215
240
  }
216
- settings.onRate.call(element, rating);
217
241
  },
218
242
 
219
243
  setting: function(name, value) {
@@ -285,7 +309,7 @@ $.fn.rating = function(parameters) {
285
309
  });
286
310
  }
287
311
  clearTimeout(module.performance.timer);
288
- module.performance.timer = setTimeout(module.performance.display, 100);
312
+ module.performance.timer = setTimeout(module.performance.display, 500);
289
313
  },
290
314
  display: function() {
291
315
  var
@@ -400,7 +424,7 @@ $.fn.rating.settings = {
400
424
  namespace : 'rating',
401
425
 
402
426
  debug : false,
403
- verbose : true,
427
+ verbose : false,
404
428
  performance : true,
405
429
 
406
430
  initialRating : 0,