less-rails-semantic_ui 2.1.8.2 → 2.2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +15 -0
  3. data/assets/fonts/semantic_ui/themes/default/assets/fonts/icons.eot +0 -0
  4. data/assets/fonts/semantic_ui/themes/default/assets/fonts/icons.svg +146 -26
  5. data/assets/fonts/semantic_ui/themes/default/assets/fonts/icons.ttf +0 -0
  6. data/assets/fonts/semantic_ui/themes/default/assets/fonts/icons.woff +0 -0
  7. data/assets/fonts/semantic_ui/themes/default/assets/fonts/icons.woff2 +0 -0
  8. data/assets/javascripts/semantic_ui/definitions/behaviors/api.js +41 -16
  9. data/assets/javascripts/semantic_ui/definitions/behaviors/colorize.js +233 -227
  10. data/assets/javascripts/semantic_ui/definitions/behaviors/form.js +58 -23
  11. data/assets/javascripts/semantic_ui/definitions/behaviors/state.js +20 -7
  12. data/assets/javascripts/semantic_ui/definitions/behaviors/visibility.js +89 -22
  13. data/assets/javascripts/semantic_ui/definitions/behaviors/visit.js +13 -5
  14. data/assets/javascripts/semantic_ui/definitions/globals/site.js +2 -2
  15. data/assets/javascripts/semantic_ui/definitions/modules/accordion.js +20 -6
  16. data/assets/javascripts/semantic_ui/definitions/modules/checkbox.js +31 -9
  17. data/assets/javascripts/semantic_ui/definitions/modules/dimmer.js +27 -9
  18. data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +482 -207
  19. data/assets/javascripts/semantic_ui/definitions/modules/embed.js +50 -13
  20. data/assets/javascripts/semantic_ui/definitions/modules/modal.js +28 -13
  21. data/assets/javascripts/semantic_ui/definitions/modules/nag.js +28 -7
  22. data/assets/javascripts/semantic_ui/definitions/modules/popup.js +136 -76
  23. data/assets/javascripts/semantic_ui/definitions/modules/progress.js +177 -62
  24. data/assets/javascripts/semantic_ui/definitions/modules/rating.js +41 -8
  25. data/assets/javascripts/semantic_ui/definitions/modules/search.js +109 -56
  26. data/assets/javascripts/semantic_ui/definitions/modules/shape.js +52 -19
  27. data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +21 -7
  28. data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +48 -19
  29. data/assets/javascripts/semantic_ui/definitions/modules/tab.js +57 -27
  30. data/assets/javascripts/semantic_ui/definitions/modules/transition.js +24 -8
  31. data/assets/stylesheets/semantic_ui/definitions/collections/breadcrumb.less +1 -2
  32. data/assets/stylesheets/semantic_ui/definitions/collections/form.less +42 -36
  33. data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +12 -5
  34. data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +50 -6
  35. data/assets/stylesheets/semantic_ui/definitions/collections/message.less +20 -1
  36. data/assets/stylesheets/semantic_ui/definitions/collections/table.less +16 -3
  37. data/assets/stylesheets/semantic_ui/definitions/elements/button.less +184 -40
  38. data/assets/stylesheets/semantic_ui/definitions/elements/container.less +1 -2
  39. data/assets/stylesheets/semantic_ui/definitions/elements/divider.less +1 -3
  40. data/assets/stylesheets/semantic_ui/definitions/elements/flag.less +1 -2
  41. data/assets/stylesheets/semantic_ui/definitions/elements/header.less +2 -2
  42. data/assets/stylesheets/semantic_ui/definitions/elements/icon.less +1 -2
  43. data/assets/stylesheets/semantic_ui/definitions/elements/image.less +6 -1
  44. data/assets/stylesheets/semantic_ui/definitions/elements/input.less +14 -14
  45. data/assets/stylesheets/semantic_ui/definitions/elements/label.less +3 -3
  46. data/assets/stylesheets/semantic_ui/definitions/elements/list.less +29 -16
  47. data/assets/stylesheets/semantic_ui/definitions/elements/loader.less +72 -9
  48. data/assets/stylesheets/semantic_ui/definitions/elements/rail.less +21 -2
  49. data/assets/stylesheets/semantic_ui/definitions/elements/reveal.less +2 -3
  50. data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +44 -3
  51. data/assets/stylesheets/semantic_ui/definitions/elements/step.less +28 -8
  52. data/assets/stylesheets/semantic_ui/definitions/globals/reset.less +1 -2
  53. data/assets/stylesheets/semantic_ui/definitions/globals/site.less +0 -1
  54. data/assets/stylesheets/semantic_ui/definitions/modules/accordion.less +0 -1
  55. data/assets/stylesheets/semantic_ui/definitions/modules/checkbox.less +9 -10
  56. data/assets/stylesheets/semantic_ui/definitions/modules/dimmer.less +1 -2
  57. data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +39 -21
  58. data/assets/stylesheets/semantic_ui/definitions/modules/embed.less +0 -1
  59. data/assets/stylesheets/semantic_ui/definitions/modules/modal.less +0 -1
  60. data/assets/stylesheets/semantic_ui/definitions/modules/nag.less +1 -2
  61. data/assets/stylesheets/semantic_ui/definitions/modules/popup.less +344 -2
  62. data/assets/stylesheets/semantic_ui/definitions/modules/progress.less +0 -1
  63. data/assets/stylesheets/semantic_ui/definitions/modules/rating.less +0 -1
  64. data/assets/stylesheets/semantic_ui/definitions/modules/search.less +1 -1
  65. data/assets/stylesheets/semantic_ui/definitions/modules/shape.less +1 -2
  66. data/assets/stylesheets/semantic_ui/definitions/modules/sidebar.less +1 -2
  67. data/assets/stylesheets/semantic_ui/definitions/modules/sticky.less +1 -2
  68. data/assets/stylesheets/semantic_ui/definitions/modules/tab.less +1 -2
  69. data/assets/stylesheets/semantic_ui/definitions/modules/transition.less +1 -2
  70. data/assets/stylesheets/semantic_ui/definitions/views/card.less +20 -2
  71. data/assets/stylesheets/semantic_ui/definitions/views/comment.less +1 -2
  72. data/assets/stylesheets/semantic_ui/definitions/views/feed.less +0 -1
  73. data/assets/stylesheets/semantic_ui/definitions/views/item.less +1 -2
  74. data/assets/stylesheets/semantic_ui/definitions/views/statistic.less +18 -19
  75. data/assets/stylesheets/semantic_ui/themes/basic/globals/reset.overrides +1 -1
  76. data/assets/stylesheets/semantic_ui/themes/default/collections/form.variables +4 -5
  77. data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +13 -0
  78. data/assets/stylesheets/semantic_ui/themes/default/collections/message.variables +47 -1
  79. data/assets/stylesheets/semantic_ui/themes/default/collections/table.variables +7 -2
  80. data/assets/stylesheets/semantic_ui/themes/default/elements/button.variables +14 -0
  81. data/assets/stylesheets/semantic_ui/themes/default/elements/icon.overrides +263 -76
  82. data/assets/stylesheets/semantic_ui/themes/default/elements/icon.variables +3 -1
  83. data/assets/stylesheets/semantic_ui/themes/default/elements/input.variables +2 -4
  84. data/assets/stylesheets/semantic_ui/themes/default/elements/list.variables +2 -1
  85. data/assets/stylesheets/semantic_ui/themes/default/elements/loader.variables +17 -5
  86. data/assets/stylesheets/semantic_ui/themes/default/elements/rail.variables +2 -2
  87. data/assets/stylesheets/semantic_ui/themes/default/elements/step.variables +1 -1
  88. data/assets/stylesheets/semantic_ui/themes/default/globals/reset.overrides +1 -6
  89. data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +170 -46
  90. data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +15 -12
  91. data/assets/stylesheets/semantic_ui/themes/default/modules/popup.variables +41 -3
  92. data/assets/stylesheets/semantic_ui/themes/default/modules/rating.overrides +2 -2
  93. data/assets/stylesheets/semantic_ui/themes/default/modules/sticky.variables +1 -1
  94. data/assets/stylesheets/semantic_ui/themes/default/views/card.variables +11 -0
  95. data/assets/stylesheets/semantic_ui/themes/material/collections/menu.variables +1 -1
  96. data/lib/less/rails/semantic_ui/version.rb +1 -1
  97. metadata +4 -3
@@ -3,16 +3,22 @@
3
3
  * http://github.com/semantic-org/semantic-ui/
4
4
  *
5
5
  *
6
- * Copyright 2015 Contributors
7
6
  * Released under the MIT license
8
7
  * http://opensource.org/licenses/MIT
9
8
  *
10
9
  */
11
10
 
12
- ;(function ( $, window, document, undefined ) {
11
+ ;(function ($, window, document, undefined) {
13
12
 
14
13
  "use strict";
15
14
 
15
+ window = (typeof window != 'undefined' && window.Math == Math)
16
+ ? window
17
+ : (typeof self != 'undefined' && self.Math == Math)
18
+ ? self
19
+ : Function('return this')()
20
+ ;
21
+
16
22
  $.fn.form = function(parameters) {
17
23
  var
18
24
  $allModules = $(this),
@@ -74,6 +80,9 @@ $.fn.form = function(parameters) {
74
80
  module.invoke(query);
75
81
  }
76
82
  else {
83
+ if(instance !== undefined) {
84
+ instance.invoke('destroy');
85
+ }
77
86
  module.verbose('Initializing form validation', $module, settings);
78
87
  module.bindEvents();
79
88
  module.set.defaults();
@@ -228,6 +237,20 @@ $.fn.form = function(parameters) {
228
237
  bracketedRule: function(rule) {
229
238
  return (rule.type && rule.type.match(settings.regExp.bracket));
230
239
  },
240
+ empty: function($field) {
241
+ if(!$field || $field.length === 0) {
242
+ return true;
243
+ }
244
+ else if($field.is('input[type="checkbox"]')) {
245
+ return !$field.is(':checked');
246
+ }
247
+ else {
248
+ return module.is.blank($field);
249
+ }
250
+ },
251
+ blank: function($field) {
252
+ return $.trim($field.val()) === '';
253
+ },
231
254
  valid: function() {
232
255
  var
233
256
  allValid = true
@@ -261,9 +284,12 @@ $.fn.form = function(parameters) {
261
284
  field: {
262
285
  keydown: function(event) {
263
286
  var
264
- $field = $(this),
265
- key = event.which,
266
- keyCode = {
287
+ $field = $(this),
288
+ key = event.which,
289
+ isInput = $field.is(selector.input),
290
+ isCheckbox = $field.is(selector.checkbox),
291
+ isInDropdown = ($field.closest(selector.uiDropdown).length > 0),
292
+ keyCode = {
267
293
  enter : 13,
268
294
  escape : 27
269
295
  }
@@ -274,7 +300,7 @@ $.fn.form = function(parameters) {
274
300
  .blur()
275
301
  ;
276
302
  }
277
- if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) && $field.not(selector.checkbox).length > 0 ) {
303
+ if(!event.ctrlKey && key == keyCode.enter && isInput && !isInDropdown && !isCheckbox) {
278
304
  if(!keyHeldDown) {
279
305
  $field
280
306
  .one('keyup' + eventNamespace, module.event.field.keyup)
@@ -296,7 +322,9 @@ $.fn.form = function(parameters) {
296
322
  ;
297
323
  if( $fieldGroup.hasClass(className.error) ) {
298
324
  module.debug('Revalidating field', $field, validationRules);
299
- module.validate.form.call(module, event, true);
325
+ if(validationRules) {
326
+ module.validate.field( validationRules );
327
+ }
300
328
  }
301
329
  else if(settings.on == 'blur' || settings.on == 'change') {
302
330
  if(validationRules) {
@@ -307,13 +335,14 @@ $.fn.form = function(parameters) {
307
335
  change: function(event) {
308
336
  var
309
337
  $field = $(this),
310
- $fieldGroup = $field.closest($group)
338
+ $fieldGroup = $field.closest($group),
339
+ validationRules = module.get.validation($field)
311
340
  ;
312
341
  if(settings.on == 'change' || ( $fieldGroup.hasClass(className.error) && settings.revalidate) ) {
313
342
  clearTimeout(module.timer);
314
343
  module.timer = setTimeout(function() {
315
344
  module.debug('Revalidating field', $field, module.get.validation($field));
316
- module.validate.form.call(module, event, true);
345
+ module.validate.field( validationRules );
317
346
  }, settings.delay);
318
347
  }
319
348
  }
@@ -369,7 +398,7 @@ $.fn.form = function(parameters) {
369
398
  }
370
399
  if(requiresName) {
371
400
  $label = $field.closest(selector.group).find('label').eq(0);
372
- name = ($label.size() == 1)
401
+ name = ($label.length == 1)
373
402
  ? $label.text()
374
403
  : $field.prop('placeholder') || settings.text.unspecifiedField
375
404
  ;
@@ -788,8 +817,11 @@ $.fn.form = function(parameters) {
788
817
  // takes a validation object and returns whether field passes validation
789
818
  field: function(field, fieldName) {
790
819
  var
791
- identifier = field.identifier || fieldName,
792
- $field = module.get.field(identifier),
820
+ identifier = field.identifier || fieldName,
821
+ $field = module.get.field(identifier),
822
+ $dependsField = (field.depends)
823
+ ? module.get.field(field.depends)
824
+ : false,
793
825
  fieldValid = true,
794
826
  fieldErrors = []
795
827
  ;
@@ -801,8 +833,12 @@ $.fn.form = function(parameters) {
801
833
  module.debug('Field is disabled. Skipping', identifier);
802
834
  fieldValid = true;
803
835
  }
804
- else if(field.optional && $.trim($field.val()) === ''){
805
- module.debug('Field is optional and empty. Skipping', identifier);
836
+ else if(field.optional && module.is.blank($field)){
837
+ module.debug('Field is optional and blank. Skipping', identifier);
838
+ fieldValid = true;
839
+ }
840
+ else if(field.depends && module.is.empty($dependsField)) {
841
+ module.debug('Field depends on another value that is not present or empty. Skipping', $dependsField);
806
842
  fieldValid = true;
807
843
  }
808
844
  else if(field.rules !== undefined) {
@@ -874,7 +910,7 @@ $.fn.form = function(parameters) {
874
910
  }
875
911
  },
876
912
  debug: function() {
877
- if(settings.debug) {
913
+ if(!settings.silent && settings.debug) {
878
914
  if(settings.performance) {
879
915
  module.performance.log(arguments);
880
916
  }
@@ -885,7 +921,7 @@ $.fn.form = function(parameters) {
885
921
  }
886
922
  },
887
923
  verbose: function() {
888
- if(settings.verbose && settings.debug) {
924
+ if(!settings.silent && settings.verbose && settings.debug) {
889
925
  if(settings.performance) {
890
926
  module.performance.log(arguments);
891
927
  }
@@ -896,8 +932,10 @@ $.fn.form = function(parameters) {
896
932
  }
897
933
  },
898
934
  error: function() {
899
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
900
- module.error.apply(console, arguments);
935
+ if(!settings.silent) {
936
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
937
+ module.error.apply(console, arguments);
938
+ }
901
939
  },
902
940
  performance: {
903
941
  log: function(message) {
@@ -1051,7 +1089,7 @@ $.fn.form.settings = {
1051
1089
  regExp: {
1052
1090
  bracket : /\[(.*)\]/i,
1053
1091
  decimal : /^\d*(\.)\d+/,
1054
- email : "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",
1092
+ email : /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
1055
1093
  escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
1056
1094
  flags : /^\/(.*)\/(.*)?/,
1057
1095
  integer : /^\-?\d+$/,
@@ -1159,10 +1197,7 @@ $.fn.form.settings = {
1159
1197
 
1160
1198
  // is most likely an email
1161
1199
  email: function(value){
1162
- var
1163
- emailRegExp = new RegExp($.fn.form.settings.regExp.email, 'i')
1164
- ;
1165
- return emailRegExp.test(value);
1200
+ return $.fn.form.settings.regExp.email.test(value);
1166
1201
  },
1167
1202
 
1168
1203
  // value is most likely url
@@ -3,16 +3,22 @@
3
3
  * http://github.com/semantic-org/semantic-ui/
4
4
  *
5
5
  *
6
- * Copyright 2015 Contributors
7
6
  * Released under the MIT license
8
7
  * http://opensource.org/licenses/MIT
9
8
  *
10
9
  */
11
10
 
12
- ;(function ( $, window, document, undefined ) {
11
+ ;(function ($, window, document, undefined) {
13
12
 
14
13
  "use strict";
15
14
 
15
+ window = (typeof window != 'undefined' && window.Math == Math)
16
+ ? window
17
+ : (typeof self != 'undefined' && self.Math == Math)
18
+ ? self
19
+ : Function('return this')()
20
+ ;
21
+
16
22
  $.fn.state = function(parameters) {
17
23
  var
18
24
  $allModules = $(this),
@@ -409,7 +415,12 @@ $.fn.state = function(parameters) {
409
415
  $.extend(true, settings, name);
410
416
  }
411
417
  else if(value !== undefined) {
412
- settings[name] = value;
418
+ if($.isPlainObject(settings[name])) {
419
+ $.extend(true, settings[name], value);
420
+ }
421
+ else {
422
+ settings[name] = value;
423
+ }
413
424
  }
414
425
  else {
415
426
  return settings[name];
@@ -427,7 +438,7 @@ $.fn.state = function(parameters) {
427
438
  }
428
439
  },
429
440
  debug: function() {
430
- if(settings.debug) {
441
+ if(!settings.silent && settings.debug) {
431
442
  if(settings.performance) {
432
443
  module.performance.log(arguments);
433
444
  }
@@ -438,7 +449,7 @@ $.fn.state = function(parameters) {
438
449
  }
439
450
  },
440
451
  verbose: function() {
441
- if(settings.verbose && settings.debug) {
452
+ if(!settings.silent && settings.verbose && settings.debug) {
442
453
  if(settings.performance) {
443
454
  module.performance.log(arguments);
444
455
  }
@@ -449,8 +460,10 @@ $.fn.state = function(parameters) {
449
460
  }
450
461
  },
451
462
  error: function() {
452
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
453
- module.error.apply(console, arguments);
463
+ if(!settings.silent) {
464
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
465
+ module.error.apply(console, arguments);
466
+ }
454
467
  },
455
468
  performance: {
456
469
  log: function(message) {
@@ -3,16 +3,22 @@
3
3
  * http://github.com/semantic-org/semantic-ui/
4
4
  *
5
5
  *
6
- * Copyright 2015 Contributors
7
6
  * Released under the MIT license
8
7
  * http://opensource.org/licenses/MIT
9
8
  *
10
9
  */
11
10
 
12
- ;(function ( $, window, document, undefined ) {
11
+ ;(function ($, window, document, undefined) {
13
12
 
14
13
  "use strict";
15
14
 
15
+ window = (typeof window != 'undefined' && window.Math == Math)
16
+ ? window
17
+ : (typeof self != 'undefined' && self.Math == Math)
18
+ ? self
19
+ : Function('return this')()
20
+ ;
21
+
16
22
  $.fn.visibility = function(parameters) {
17
23
  var
18
24
  $allModules = $(this),
@@ -24,7 +30,10 @@ $.fn.visibility = function(parameters) {
24
30
  query = arguments[0],
25
31
  methodInvoked = (typeof query == 'string'),
26
32
  queryArguments = [].slice.call(arguments, 1),
27
- returnedValue
33
+ returnedValue,
34
+
35
+ moduleCount = $allModules.length,
36
+ loadedCount = 0
28
37
  ;
29
38
 
30
39
  $allModules
@@ -61,6 +70,7 @@ $.fn.visibility = function(parameters) {
61
70
  element = this,
62
71
  disabled = false,
63
72
 
73
+ contextObserver,
64
74
  observer,
65
75
  module
66
76
  ;
@@ -111,13 +121,21 @@ $.fn.visibility = function(parameters) {
111
121
  if(observer) {
112
122
  observer.disconnect();
113
123
  }
124
+ if(contextObserver) {
125
+ contextObserver.disconnect();
126
+ }
114
127
  $window
115
128
  .off('load' + eventNamespace, module.event.load)
116
129
  .off('resize' + eventNamespace, module.event.resize)
117
130
  ;
118
131
  $context
132
+ .off('scroll' + eventNamespace, module.event.scroll)
119
133
  .off('scrollchange' + eventNamespace, module.event.scrollchange)
120
134
  ;
135
+ if(settings.type == 'fixed') {
136
+ module.resetFixed();
137
+ module.remove.placeholder();
138
+ }
121
139
  $module
122
140
  .off(eventNamespace)
123
141
  .removeData(moduleNamespace)
@@ -126,12 +144,11 @@ $.fn.visibility = function(parameters) {
126
144
 
127
145
  observeChanges: function() {
128
146
  if('MutationObserver' in window) {
129
- observer = new MutationObserver(function(mutations) {
130
- module.verbose('DOM tree modified, updating visibility calculations');
131
- module.timer = setTimeout(function() {
132
- module.verbose('DOM tree modified, updating sticky menu');
133
- module.refresh();
134
- }, 100);
147
+ contextObserver = new MutationObserver(module.event.contextChanged);
148
+ observer = new MutationObserver(module.event.changed);
149
+ contextObserver.observe(document, {
150
+ childList : true,
151
+ subtree : true
135
152
  });
136
153
  observer.observe(element, {
137
154
  childList : true,
@@ -162,6 +179,25 @@ $.fn.visibility = function(parameters) {
162
179
  },
163
180
 
164
181
  event: {
182
+ changed: function(mutations) {
183
+ module.verbose('DOM tree modified, updating visibility calculations');
184
+ module.timer = setTimeout(function() {
185
+ module.verbose('DOM tree modified, updating sticky menu');
186
+ module.refresh();
187
+ }, 100);
188
+ },
189
+ contextChanged: function(mutations) {
190
+ [].forEach.call(mutations, function(mutation) {
191
+ if(mutation.removedNodes) {
192
+ [].forEach.call(mutation.removedNodes, function(node) {
193
+ if(node == element || $(node).find(element).length > 0) {
194
+ module.debug('Element removed from DOM, tearing down events');
195
+ module.destroy();
196
+ }
197
+ });
198
+ }
199
+ });
200
+ },
165
201
  resize: function() {
166
202
  module.debug('Window resized');
167
203
  if(settings.refreshOnResize) {
@@ -261,7 +297,13 @@ $.fn.visibility = function(parameters) {
261
297
  settings.onOnScreen = function() {
262
298
  module.debug('Image on screen', element);
263
299
  module.precache(src, function() {
264
- module.set.image(src);
300
+ module.set.image(src, function() {
301
+ loadedCount++;
302
+ if(loadedCount == moduleCount) {
303
+ settings.onAllLoaded.call(this);
304
+ }
305
+ settings.onLoad.call(this);
306
+ });
265
307
  });
266
308
  };
267
309
  }
@@ -335,20 +377,21 @@ $.fn.visibility = function(parameters) {
335
377
  position : 'fixed',
336
378
  top : settings.offset + 'px',
337
379
  left : 'auto',
338
- zIndex : '1'
380
+ zIndex : settings.zIndex
339
381
  })
340
382
  ;
383
+ settings.onFixed.call(element);
341
384
  },
342
- image: function(src) {
385
+ image: function(src, callback) {
343
386
  $module
344
387
  .attr('src', src)
345
388
  ;
346
389
  if(settings.transition) {
347
390
  if( $.fn.transition !== undefined ) {
348
- $module.transition(settings.transition, settings.duration);
391
+ $module.transition(settings.transition, settings.duration, callback);
349
392
  }
350
393
  else {
351
- $module.fadeIn(settings.duration);
394
+ $module.fadeIn(settings.duration, callback);
352
395
  }
353
396
  }
354
397
  else {
@@ -381,8 +424,7 @@ $.fn.visibility = function(parameters) {
381
424
  refresh: function() {
382
425
  module.debug('Refreshing constants (width/height)');
383
426
  if(settings.type == 'fixed') {
384
- module.remove.fixed();
385
- module.remove.occurred();
427
+ module.resetFixed();
386
428
  }
387
429
  module.reset();
388
430
  module.save.position();
@@ -392,8 +434,13 @@ $.fn.visibility = function(parameters) {
392
434
  settings.onRefresh.call(element);
393
435
  },
394
436
 
437
+ resetFixed: function () {
438
+ module.remove.fixed();
439
+ module.remove.occurred();
440
+ },
441
+
395
442
  reset: function() {
396
- module.verbose('Reseting all cached values');
443
+ module.verbose('Resetting all cached values');
397
444
  if( $.isPlainObject(module.cache) ) {
398
445
  module.cache.screen = {};
399
446
  module.cache.element = {};
@@ -756,6 +803,13 @@ $.fn.visibility = function(parameters) {
756
803
  zIndex : ''
757
804
  })
758
805
  ;
806
+ settings.onUnfixed.call(element);
807
+ },
808
+ placeholder: function() {
809
+ module.debug('Removing placeholder content');
810
+ if($placeholder) {
811
+ $placeholder.remove();
812
+ }
759
813
  },
760
814
  occurred: function(callback) {
761
815
  if(callback) {
@@ -970,7 +1024,7 @@ $.fn.visibility = function(parameters) {
970
1024
  }
971
1025
  },
972
1026
  debug: function() {
973
- if(settings.debug) {
1027
+ if(!settings.silent && settings.debug) {
974
1028
  if(settings.performance) {
975
1029
  module.performance.log(arguments);
976
1030
  }
@@ -981,7 +1035,7 @@ $.fn.visibility = function(parameters) {
981
1035
  }
982
1036
  },
983
1037
  verbose: function() {
984
- if(settings.verbose && settings.debug) {
1038
+ if(!settings.silent && settings.verbose && settings.debug) {
985
1039
  if(settings.performance) {
986
1040
  module.performance.log(arguments);
987
1041
  }
@@ -992,8 +1046,10 @@ $.fn.visibility = function(parameters) {
992
1046
  }
993
1047
  },
994
1048
  error: function() {
995
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
996
- module.error.apply(console, arguments);
1049
+ if(!settings.silent) {
1050
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
1051
+ module.error.apply(console, arguments);
1052
+ }
997
1053
  },
998
1054
  performance: {
999
1055
  log: function(message) {
@@ -1170,6 +1226,9 @@ $.fn.visibility.settings = {
1170
1226
  // special visibility type (image, fixed)
1171
1227
  type : false,
1172
1228
 
1229
+ // z-index to use with visibility 'fixed'
1230
+ zIndex : '10',
1231
+
1173
1232
  // image only animation settings
1174
1233
  transition : 'fade in',
1175
1234
  duration : 1000,
@@ -1193,6 +1252,14 @@ $.fn.visibility.settings = {
1193
1252
  onTopPassedReverse : false,
1194
1253
  onBottomPassedReverse : false,
1195
1254
 
1255
+ // special callbacks for image
1256
+ onLoad : function() {},
1257
+ onAllLoaded : function() {},
1258
+
1259
+ // special callbacks for fixed position
1260
+ onFixed : function() {},
1261
+ onUnfixed : function() {},
1262
+
1196
1263
  // utility callbacks
1197
1264
  onUpdate : false, // disabled by default for performance
1198
1265
  onRefresh : function(){},
@@ -1213,4 +1280,4 @@ $.fn.visibility.settings = {
1213
1280
 
1214
1281
  };
1215
1282
 
1216
- })( jQuery, window, document );
1283
+ })( jQuery, window, document );