fomantic-ui 2.9.0-beta.314 → 2.9.0-beta.316

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 (165) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +1 -1
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +1 -1
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +1 -1
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +1 -1
  41. package/dist/components/feed.css +1 -1
  42. package/dist/components/feed.min.css +1 -1
  43. package/dist/components/flag.css +1 -1
  44. package/dist/components/flag.min.css +1 -1
  45. package/dist/components/flyout.css +558 -0
  46. package/dist/components/flyout.js +1346 -0
  47. package/dist/components/flyout.min.css +9 -0
  48. package/dist/components/flyout.min.js +11 -0
  49. package/dist/components/form.css +1 -1
  50. package/dist/components/form.js +1 -1
  51. package/dist/components/form.min.css +1 -1
  52. package/dist/components/form.min.js +1 -1
  53. package/dist/components/grid.css +1 -1
  54. package/dist/components/grid.min.css +1 -1
  55. package/dist/components/header.css +1 -1
  56. package/dist/components/header.min.css +1 -1
  57. package/dist/components/icon.css +1 -1
  58. package/dist/components/icon.min.css +1 -1
  59. package/dist/components/image.css +1 -1
  60. package/dist/components/image.min.css +1 -1
  61. package/dist/components/input.css +1 -1
  62. package/dist/components/input.min.css +1 -1
  63. package/dist/components/item.css +1 -1
  64. package/dist/components/item.min.css +1 -1
  65. package/dist/components/label.css +1 -1
  66. package/dist/components/label.min.css +1 -1
  67. package/dist/components/list.css +1 -1
  68. package/dist/components/list.min.css +1 -1
  69. package/dist/components/loader.css +1 -1
  70. package/dist/components/loader.min.css +1 -1
  71. package/dist/components/message.css +1 -1
  72. package/dist/components/message.min.css +1 -1
  73. package/dist/components/modal.css +1 -1
  74. package/dist/components/modal.js +1 -1
  75. package/dist/components/modal.min.css +1 -1
  76. package/dist/components/modal.min.js +1 -1
  77. package/dist/components/nag.css +1 -1
  78. package/dist/components/nag.js +1 -1
  79. package/dist/components/nag.min.css +1 -1
  80. package/dist/components/nag.min.js +1 -1
  81. package/dist/components/placeholder.css +1 -1
  82. package/dist/components/placeholder.min.css +1 -1
  83. package/dist/components/popup.css +1 -1
  84. package/dist/components/popup.js +1 -1
  85. package/dist/components/popup.min.css +1 -1
  86. package/dist/components/popup.min.js +1 -1
  87. package/dist/components/progress.css +1 -1
  88. package/dist/components/progress.js +1 -1
  89. package/dist/components/progress.min.css +1 -1
  90. package/dist/components/progress.min.js +1 -1
  91. package/dist/components/rail.css +1 -1
  92. package/dist/components/rail.min.css +1 -1
  93. package/dist/components/rating.css +1 -1
  94. package/dist/components/rating.js +1 -1
  95. package/dist/components/rating.min.css +1 -1
  96. package/dist/components/rating.min.js +1 -1
  97. package/dist/components/reset.css +1 -1
  98. package/dist/components/reset.min.css +1 -1
  99. package/dist/components/reveal.css +1 -1
  100. package/dist/components/reveal.min.css +1 -1
  101. package/dist/components/search.css +1 -1
  102. package/dist/components/search.js +1 -1
  103. package/dist/components/search.min.css +1 -1
  104. package/dist/components/search.min.js +1 -1
  105. package/dist/components/segment.css +1 -1
  106. package/dist/components/segment.min.css +1 -1
  107. package/dist/components/shape.css +1 -1
  108. package/dist/components/shape.js +1 -1
  109. package/dist/components/shape.min.css +1 -1
  110. package/dist/components/shape.min.js +1 -1
  111. package/dist/components/sidebar.css +1 -1
  112. package/dist/components/sidebar.js +1 -3
  113. package/dist/components/sidebar.min.css +1 -1
  114. package/dist/components/sidebar.min.js +2 -2
  115. package/dist/components/site.css +1 -1
  116. package/dist/components/site.js +1 -1
  117. package/dist/components/site.min.css +1 -1
  118. package/dist/components/site.min.js +1 -1
  119. package/dist/components/slider.js +1 -1
  120. package/dist/components/slider.min.js +1 -1
  121. package/dist/components/state.js +1 -1
  122. package/dist/components/state.min.js +1 -1
  123. package/dist/components/statistic.css +1 -1
  124. package/dist/components/statistic.min.css +1 -1
  125. package/dist/components/step.css +1 -1
  126. package/dist/components/step.min.css +1 -1
  127. package/dist/components/sticky.css +1 -1
  128. package/dist/components/sticky.js +1 -1
  129. package/dist/components/sticky.min.css +1 -1
  130. package/dist/components/sticky.min.js +1 -1
  131. package/dist/components/tab.css +1 -1
  132. package/dist/components/tab.js +1 -1
  133. package/dist/components/tab.min.css +1 -1
  134. package/dist/components/tab.min.js +1 -1
  135. package/dist/components/table.css +1 -1
  136. package/dist/components/table.min.css +1 -1
  137. package/dist/components/text.css +1 -1
  138. package/dist/components/text.min.css +1 -1
  139. package/dist/components/toast.css +2 -1
  140. package/dist/components/toast.js +1 -1
  141. package/dist/components/toast.min.css +2 -2
  142. package/dist/components/toast.min.js +1 -1
  143. package/dist/components/transition.css +1 -1
  144. package/dist/components/transition.js +1 -1
  145. package/dist/components/transition.min.css +1 -1
  146. package/dist/components/transition.min.js +1 -1
  147. package/dist/components/visibility.js +1 -1
  148. package/dist/components/visibility.min.js +1 -1
  149. package/dist/semantic.css +658 -49
  150. package/dist/semantic.js +1372 -27
  151. package/dist/semantic.min.css +2 -2
  152. package/dist/semantic.min.js +2 -2
  153. package/package.json +1 -1
  154. package/src/definitions/modules/flyout.js +1346 -0
  155. package/src/definitions/modules/flyout.less +604 -0
  156. package/src/definitions/modules/sidebar.js +0 -2
  157. package/src/definitions/modules/toast.less +1 -0
  158. package/src/semantic.less +1 -0
  159. package/src/theme.config.example +1 -0
  160. package/src/themes/default/globals/variation.variables +10 -0
  161. package/src/themes/default/modules/flyout.overrides +3 -0
  162. package/src/themes/default/modules/flyout.variables +45 -0
  163. package/tasks/config/admin/release.js +1 -0
  164. package/tasks/config/defaults.js +1 -0
  165. package/tasks/config/project/install.js +1 -0
package/dist/semantic.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.9.0-beta.314+ac16a50
2
+ * # Fomantic UI - 2.9.0-beta.316+9a105a8
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * http://fomantic-ui.com/
5
5
  *
@@ -9,7 +9,7 @@
9
9
  *
10
10
  */
11
11
  /*!
12
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Site
12
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Site
13
13
  * http://github.com/fomantic/Fomantic-UI/
14
14
  *
15
15
  *
@@ -503,7 +503,7 @@ $.extend($.expr[ ":" ], {
503
503
  })( jQuery, window, document );
504
504
 
505
505
  /*!
506
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Form Validation
506
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Form Validation
507
507
  * http://github.com/fomantic/Fomantic-UI/
508
508
  *
509
509
  *
@@ -2579,7 +2579,7 @@ $.fn.form.settings = {
2579
2579
  })( jQuery, window, document );
2580
2580
 
2581
2581
  /*!
2582
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Accordion
2582
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Accordion
2583
2583
  * http://github.com/fomantic/Fomantic-UI/
2584
2584
  *
2585
2585
  *
@@ -3204,7 +3204,7 @@ $.extend( $.easing, {
3204
3204
 
3205
3205
 
3206
3206
  /*!
3207
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Calendar
3207
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Calendar
3208
3208
  * http://github.com/fomantic/Fomantic-UI/
3209
3209
  *
3210
3210
  *
@@ -5095,7 +5095,7 @@ $.fn.calendar.settings = {
5095
5095
  })(jQuery, window, document);
5096
5096
 
5097
5097
  /*!
5098
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Checkbox
5098
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Checkbox
5099
5099
  * http://github.com/fomantic/Fomantic-UI/
5100
5100
  *
5101
5101
  *
@@ -5979,7 +5979,7 @@ $.fn.checkbox.settings = {
5979
5979
  })( jQuery, window, document );
5980
5980
 
5981
5981
  /*!
5982
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Dimmer
5982
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Dimmer
5983
5983
  * http://github.com/fomantic/Fomantic-UI/
5984
5984
  *
5985
5985
  *
@@ -6745,7 +6745,7 @@ $.fn.dimmer.settings = {
6745
6745
  })( jQuery, window, document );
6746
6746
 
6747
6747
  /*!
6748
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Dropdown
6748
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Dropdown
6749
6749
  * http://github.com/fomantic/Fomantic-UI/
6750
6750
  *
6751
6751
  *
@@ -11101,7 +11101,7 @@ $.fn.dropdown.settings.templates = {
11101
11101
  })( jQuery, window, document );
11102
11102
 
11103
11103
  /*!
11104
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Embed
11104
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Embed
11105
11105
  * http://github.com/fomantic/Fomantic-UI/
11106
11106
  *
11107
11107
  *
@@ -11815,7 +11815,1354 @@ $.fn.embed.settings = {
11815
11815
  })( jQuery, window, document );
11816
11816
 
11817
11817
  /*!
11818
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Modal
11818
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Flyout
11819
+ * http://github.com/fomantic/Fomantic-UI/
11820
+ *
11821
+ *
11822
+ * Released under the MIT license
11823
+ * http://opensource.org/licenses/MIT
11824
+ *
11825
+ */
11826
+
11827
+ ;(function ($, window, document, undefined) {
11828
+
11829
+ 'use strict';
11830
+
11831
+ $.isFunction = $.isFunction || function(obj) {
11832
+ return typeof obj === "function" && typeof obj.nodeType !== "number";
11833
+ };
11834
+
11835
+ window = (typeof window != 'undefined' && window.Math == Math)
11836
+ ? window
11837
+ : (typeof self != 'undefined' && self.Math == Math)
11838
+ ? self
11839
+ : Function('return this')()
11840
+ ;
11841
+
11842
+ $.fn.flyout = function(parameters) {
11843
+ var
11844
+ $allModules = $(this),
11845
+ $window = $(window),
11846
+ $document = $(document),
11847
+ $html = $('html'),
11848
+ $head = $('head'),
11849
+ $body = $('body'),
11850
+
11851
+ moduleSelector = $allModules.selector || '',
11852
+
11853
+ time = new Date().getTime(),
11854
+ performance = [],
11855
+
11856
+ query = arguments[0],
11857
+ methodInvoked = (typeof query == 'string'),
11858
+ queryArguments = [].slice.call(arguments, 1),
11859
+
11860
+ requestAnimationFrame = window.requestAnimationFrame
11861
+ || window.mozRequestAnimationFrame
11862
+ || window.webkitRequestAnimationFrame
11863
+ || window.msRequestAnimationFrame
11864
+ || function(callback) { setTimeout(callback, 0); },
11865
+
11866
+ returnedValue
11867
+ ;
11868
+
11869
+ $allModules
11870
+ .each(function() {
11871
+ var
11872
+ settings = ( $.isPlainObject(parameters) )
11873
+ ? $.extend(true, {}, $.fn.flyout.settings, parameters)
11874
+ : $.extend({}, $.fn.flyout.settings),
11875
+
11876
+ selector = settings.selector,
11877
+ className = settings.className,
11878
+ namespace = settings.namespace,
11879
+ fields = settings.fields,
11880
+ regExp = settings.regExp,
11881
+ error = settings.error,
11882
+
11883
+ eventNamespace = '.' + namespace,
11884
+ moduleNamespace = 'module-' + namespace,
11885
+
11886
+ $module = $(this),
11887
+ $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $body,
11888
+ $close = $module.find(selector.close),
11889
+
11890
+ $flyouts = $module.children(selector.flyout),
11891
+ $pusher = $context.children(selector.pusher),
11892
+ $style,
11893
+
11894
+ element = this,
11895
+ instance = $module.hasClass(namespace) ? $module.data(moduleNamespace) : undefined,
11896
+
11897
+ ignoreRepeatedEvents = false,
11898
+ isBody = $context[0] === $body[0],
11899
+ initialBodyMargin = '',
11900
+ tempBodyMargin = '',
11901
+ hadScrollbar = false,
11902
+
11903
+ elementNamespace,
11904
+ id,
11905
+ currentScroll,
11906
+ transitionEvent,
11907
+
11908
+ module
11909
+ ;
11910
+
11911
+ module = {
11912
+
11913
+ initialize: function() {
11914
+ module.debug('Initializing flyout', parameters);
11915
+
11916
+ if(!$module.hasClass(namespace)) {
11917
+ module.create.flyout();
11918
+ if(!$.isFunction(settings.onHidden)) {
11919
+ settings.onHidden = function () {
11920
+ module.destroy();
11921
+ $module.remove();
11922
+ };
11923
+ }
11924
+ }
11925
+ $module.addClass(settings.class);
11926
+ if (settings.title !== '') {
11927
+ $module.find(selector.header).html(module.helpers.escape(settings.title, settings.preserveHTML)).addClass(settings.classTitle);
11928
+ }
11929
+ if (settings.content !== '') {
11930
+ $module.find(selector.content).html(module.helpers.escape(settings.content, settings.preserveHTML)).addClass(settings.classContent);
11931
+ }
11932
+ if(module.has.configActions()){
11933
+ var $actions = $module.find(selector.actions).addClass(settings.classActions);
11934
+ if ($actions.length === 0) {
11935
+ $actions = $('<div/>', {class: className.actions + ' ' + (settings.classActions || '')}).appendTo($module);
11936
+ } else {
11937
+ $actions.empty();
11938
+ }
11939
+ settings.actions.forEach(function (el) {
11940
+ var
11941
+ icon = el[fields.icon] ? '<i class="' + module.helpers.deQuote(el[fields.icon]) + ' icon"></i>' : '',
11942
+ text = module.helpers.escape(el[fields.text] || '', settings.preserveHTML),
11943
+ cls = module.helpers.deQuote(el[fields.class] || ''),
11944
+ click = el[fields.click] && $.isFunction(el[fields.click]) ? el[fields.click] : function () {}
11945
+ ;
11946
+ $actions.append($('<button/>', {
11947
+ html: icon + text,
11948
+ class: className.button + ' ' + cls,
11949
+ click: function () {
11950
+ if (click.call(element, $module) === false) {
11951
+ return;
11952
+ }
11953
+ module.hide();
11954
+ }
11955
+ }));
11956
+ });
11957
+ }
11958
+
11959
+ module.create.id();
11960
+
11961
+ transitionEvent = module.get.transitionEvent();
11962
+
11963
+ // avoids locking rendering if initialized in onReady
11964
+ if(settings.delaySetup) {
11965
+ requestAnimationFrame(module.setup.layout);
11966
+ }
11967
+ else {
11968
+ module.setup.layout();
11969
+ }
11970
+
11971
+ requestAnimationFrame(function() {
11972
+ module.setup.cache();
11973
+ });
11974
+
11975
+ if (module.get.direction() == 'left' || module.get.direction() == 'right') {
11976
+ module.setup.heights();
11977
+ module.bind.resize();
11978
+ }
11979
+ module.instantiate();
11980
+
11981
+ if(settings.autoShow){
11982
+ module.show();
11983
+ }
11984
+ },
11985
+
11986
+ instantiate: function() {
11987
+ module.verbose('Storing instance of module', module);
11988
+ instance = module;
11989
+ $module
11990
+ .data(moduleNamespace, instance)
11991
+ ;
11992
+ },
11993
+
11994
+ create: {
11995
+ flyout: function() {
11996
+ module.verbose('Programmaticaly create flyout', $context);
11997
+ $module = $('<div/>', {class: className.flyout});
11998
+ if (settings.closeIcon) {
11999
+ $close = $('<i/>', {class: className.close})
12000
+ $module.append($close);
12001
+ }
12002
+ if (settings.title !== '') {
12003
+ $('<div/>', {class: className.header}).appendTo($module);
12004
+ }
12005
+ if (settings.content !== '') {
12006
+ $('<div/>', {class: className.content}).appendTo($module);
12007
+ }
12008
+ if (module.has.configActions()) {
12009
+ $('<div/>', {class: className.actions}).appendTo($module);
12010
+ }
12011
+ $context.append($module);
12012
+ },
12013
+ id: function() {
12014
+ id = (Math.random().toString(16) + '000000000').substr(2,8);
12015
+ elementNamespace = '.' + id;
12016
+ module.verbose('Creating unique id for element', id);
12017
+ }
12018
+ },
12019
+
12020
+ destroy: function() {
12021
+ module.verbose('Destroying previous module for', $module);
12022
+ $module
12023
+ .off(eventNamespace)
12024
+ .removeData(moduleNamespace)
12025
+ ;
12026
+ if(module.is.ios()) {
12027
+ module.remove.ios();
12028
+ }
12029
+ // bound by uuid
12030
+ $context.off(elementNamespace);
12031
+ $window.off(elementNamespace);
12032
+ $document.off(elementNamespace);
12033
+ },
12034
+
12035
+ event: {
12036
+ resize: function() {
12037
+ module.setup.heights();
12038
+ },
12039
+ clickaway: function(event) {
12040
+ if(settings.closable){
12041
+ var
12042
+ clickedInPusher = ($pusher.find(event.target).length > 0 || $pusher.is(event.target)),
12043
+ clickedContext = ($context.is(event.target))
12044
+ ;
12045
+ if(clickedInPusher) {
12046
+ module.verbose('User clicked on dimmed page');
12047
+ module.hide();
12048
+ }
12049
+ if(clickedContext) {
12050
+ module.verbose('User clicked on dimmable context (scaled out page)');
12051
+ module.hide();
12052
+ }
12053
+ }
12054
+ },
12055
+ close: function(event) {
12056
+ module.hide();
12057
+ },
12058
+ approve: function(event) {
12059
+ if (ignoreRepeatedEvents || settings.onApprove.call(module.element, $(this)) === false) {
12060
+ module.verbose('Approve callback returned false cancelling close');
12061
+ return;
12062
+ }
12063
+ ignoreRepeatedEvents = true;
12064
+ module.hide(function() {
12065
+ ignoreRepeatedEvents = false;
12066
+ });
12067
+ },
12068
+ deny: function(event) {
12069
+ if (ignoreRepeatedEvents || settings.onDeny.call(module.element, $(this)) === false) {
12070
+ module.verbose('Deny callback returned false cancelling close');
12071
+ return;
12072
+ }
12073
+ ignoreRepeatedEvents = true;
12074
+ module.hide(function() {
12075
+ ignoreRepeatedEvents = false;
12076
+ });
12077
+ },
12078
+ touch: function(event) {
12079
+ //event.stopPropagation();
12080
+ },
12081
+ containScroll: function(event) {
12082
+ if(element.scrollTop <= 0) {
12083
+ element.scrollTop = 1;
12084
+ }
12085
+ if((element.scrollTop + element.offsetHeight) >= element.scrollHeight) {
12086
+ element.scrollTop = element.scrollHeight - element.offsetHeight - 1;
12087
+ }
12088
+ },
12089
+ scroll: function(event) {
12090
+ if( $(event.target).closest(selector.flyout).length === 0 ) {
12091
+ event.preventDefault();
12092
+ }
12093
+ }
12094
+ },
12095
+
12096
+ bind: {
12097
+ resize: function() {
12098
+ module.verbose('Adding resize event to window', $window);
12099
+ $window.on('resize' + elementNamespace, module.event.resize);
12100
+ },
12101
+ clickaway: function() {
12102
+ module.verbose('Adding clickaway events to context', $context);
12103
+ $context
12104
+ .on('click' + elementNamespace, module.event.clickaway)
12105
+ .on('touchend' + elementNamespace, module.event.clickaway)
12106
+ ;
12107
+
12108
+ $module.on('click' + elementNamespace, settings.selector.close, module.event.close);
12109
+ $module.on('click' + elementNamespace, settings.selector.approve, module.event.approve);
12110
+ $module.on('click' + elementNamespace, settings.selector.deny, module.event.deny);
12111
+ },
12112
+ scrollLock: function() {
12113
+ if(settings.scrollLock) {
12114
+ module.debug('Disabling page scroll');
12115
+ hadScrollbar = module.has.scrollbar();
12116
+ if(hadScrollbar) {
12117
+ module.save.bodyMargin();
12118
+ module.set.bodyMargin();
12119
+ }
12120
+ $context.addClass(className.locked);
12121
+ }
12122
+ module.verbose('Adding events to contain flyout scroll');
12123
+ $document
12124
+ .on('touchmove' + elementNamespace, module.event.touch)
12125
+ ;
12126
+ $module
12127
+ .on('scroll' + eventNamespace, module.event.containScroll)
12128
+ ;
12129
+ }
12130
+ },
12131
+ unbind: {
12132
+ clickaway: function() {
12133
+ module.verbose('Removing clickaway events from context', $context);
12134
+ $context.off(elementNamespace);
12135
+ },
12136
+ scrollLock: function() {
12137
+ module.verbose('Removing scroll lock from page');
12138
+ if(hadScrollbar) {
12139
+ module.restore.bodyMargin();
12140
+ }
12141
+ $context.removeClass(className.locked);
12142
+ $document.off(elementNamespace);
12143
+ $module.off('scroll' + eventNamespace);
12144
+ }
12145
+ },
12146
+
12147
+ add: {
12148
+ inlineCSS: function() {
12149
+ var
12150
+ width = module.cache.width || $module.outerWidth(),
12151
+ height = module.cache.height || $module.outerHeight(),
12152
+ isRTL = module.is.rtl(),
12153
+ direction = module.get.direction(),
12154
+ distance = {
12155
+ left : width,
12156
+ right : -width,
12157
+ top : height,
12158
+ bottom : -height
12159
+ },
12160
+ style
12161
+ ;
12162
+
12163
+ if(isRTL){
12164
+ module.verbose('RTL detected, flipping widths');
12165
+ distance.left = -width;
12166
+ distance.right = width;
12167
+ }
12168
+
12169
+ style = '<style>';
12170
+
12171
+ if(direction === 'left' || direction === 'right') {
12172
+ module.debug('Adding CSS rules for animation distance', width);
12173
+ style += ''
12174
+ + ' .ui.visible.' + direction + '.flyout ~ .fixed,'
12175
+ + ' .ui.visible.' + direction + '.flyout ~ .pusher {'
12176
+ + ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
12177
+ + ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
12178
+ + ' }'
12179
+ ;
12180
+ }
12181
+ else if(direction === 'top' || direction == 'bottom') {
12182
+ style += ''
12183
+ + ' .ui.visible.' + direction + '.flyout ~ .fixed,'
12184
+ + ' .ui.visible.' + direction + '.flyout ~ .pusher {'
12185
+ + ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
12186
+ + ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
12187
+ + ' }'
12188
+ ;
12189
+ }
12190
+
12191
+ /* IE is only browser not to create context with transforms */
12192
+ /* https://www.w3.org/Bugs/Public/show_bug.cgi?id=16328 */
12193
+ if( module.is.ie() ) {
12194
+ if(direction === 'left' || direction === 'right') {
12195
+ module.debug('Adding CSS rules for animation distance', width);
12196
+ style += ''
12197
+ + ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher:after {'
12198
+ + ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
12199
+ + ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
12200
+ + ' }'
12201
+ ;
12202
+ }
12203
+ else if(direction === 'top' || direction == 'bottom') {
12204
+ style += ''
12205
+ + ' body.pushable > .ui.visible.' + direction + '.flyout ~ .pusher:after {'
12206
+ + ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
12207
+ + ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
12208
+ + ' }'
12209
+ ;
12210
+ }
12211
+ /* opposite sides visible forces content overlay */
12212
+ style += ''
12213
+ + ' body.pushable > .ui.visible.left.flyout ~ .ui.visible.right.flyout ~ .pusher:after,'
12214
+ + ' body.pushable > .ui.visible.right.flyout ~ .ui.visible.left.flyout ~ .pusher:after {'
12215
+ + ' -webkit-transform: translate3d(0, 0, 0);'
12216
+ + ' transform: translate3d(0, 0, 0);'
12217
+ + ' }'
12218
+ ;
12219
+ }
12220
+ style += '</style>';
12221
+ $style = $(style)
12222
+ .appendTo($head)
12223
+ ;
12224
+ module.debug('Adding sizing css to head', $style);
12225
+ }
12226
+ },
12227
+
12228
+ refresh: function() {
12229
+ module.verbose('Refreshing selector cache');
12230
+ $context = [window,document].indexOf(settings.context) < 0 ? $(document).find(settings.context) : $(settings.context);
12231
+ $flyouts = $context.children(selector.flyout);
12232
+ $pusher = $context.children(selector.pusher);
12233
+ module.clear.cache();
12234
+ },
12235
+
12236
+ refreshFlyouts: function() {
12237
+ module.verbose('Refreshing other flyouts');
12238
+ $flyouts = $context.children(selector.flyout);
12239
+ },
12240
+
12241
+ repaint: function() {
12242
+ module.verbose('Forcing repaint event');
12243
+ element.style.display = 'none';
12244
+ element.scrollTop = element.scrollTop;
12245
+ element.style.display = '';
12246
+ },
12247
+
12248
+ setup: {
12249
+ cache: function() {
12250
+ module.cache = {
12251
+ width : $module.outerWidth(),
12252
+ height : $module.outerHeight()
12253
+ };
12254
+ },
12255
+ layout: function() {
12256
+ if( $context.children(selector.pusher).length === 0 ) {
12257
+ module.debug('Adding wrapper element for flyout');
12258
+ module.error(error.pusher);
12259
+ $pusher = $('<div class="pusher" />');
12260
+ $context
12261
+ .children()
12262
+ .not(selector.omitted)
12263
+ .not($flyouts)
12264
+ .wrapAll($pusher)
12265
+ ;
12266
+ module.refresh();
12267
+ }
12268
+ if($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
12269
+ module.debug('Moved flyout to correct parent element');
12270
+ module.error(error.movedFlyout, element);
12271
+ $module.detach().prependTo($context);
12272
+ module.refresh();
12273
+ }
12274
+ if( module.is.mobile() ) {
12275
+ $module.addClass(className.fullscreen);
12276
+ }
12277
+ module.clear.cache();
12278
+ module.set.pushable();
12279
+ module.set.direction();
12280
+ },
12281
+ heights: function() {
12282
+ module.debug('Setting up heights', $module);
12283
+ var
12284
+ $header = $module.children(selector.header),
12285
+ $content = $module.children(selector.content),
12286
+ $actions = $module.children(selector.actions)
12287
+ ;
12288
+ $content.css('min-height', ($context.height() - $header.outerHeight() - $actions.outerHeight()) + 'px');
12289
+ }
12290
+ },
12291
+
12292
+ attachEvents: function(selector, event) {
12293
+ var
12294
+ $toggle = $(selector)
12295
+ ;
12296
+ event = $.isFunction(module[event])
12297
+ ? module[event]
12298
+ : module.toggle
12299
+ ;
12300
+ if($toggle.length > 0) {
12301
+ module.debug('Attaching flyout events to element', selector, event);
12302
+ $toggle
12303
+ .on('click' + eventNamespace, event)
12304
+ ;
12305
+ }
12306
+ else {
12307
+ module.error(error.notFound, selector);
12308
+ }
12309
+ },
12310
+
12311
+ show: function(callback) {
12312
+ callback = $.isFunction(callback)
12313
+ ? callback
12314
+ : function(){}
12315
+ ;
12316
+ if(module.is.hidden()) {
12317
+ module.refreshFlyouts();
12318
+ module.refresh();
12319
+ if(module.othersActive()) {
12320
+ module.debug('Other flyouts currently visible');
12321
+ if(settings.exclusive) {
12322
+ module.hideOthers();
12323
+ } else {
12324
+ ignoreRepeatedEvents = false;
12325
+ }
12326
+ }
12327
+ module.pushPage(function() {
12328
+ callback.call(element);
12329
+ settings.onShow.call(element);
12330
+ });
12331
+ settings.onChange.call(element);
12332
+ settings.onVisible.call(element);
12333
+ }
12334
+ else {
12335
+ module.debug('Flyout is already visible');
12336
+ }
12337
+ },
12338
+
12339
+ hide: function(callback) {
12340
+ callback = $.isFunction(callback)
12341
+ ? callback
12342
+ : function(){}
12343
+ ;
12344
+ if(settings.onHide.call(element, $(this)) === false) {
12345
+ module.verbose('Hide callback returned false cancelling hide');
12346
+ ignoreRepeatedEvents = false;
12347
+ return false;
12348
+ }
12349
+ if(module.is.visible() || module.is.animating()) {
12350
+ module.debug('Hiding flyout', callback);
12351
+ module.refreshFlyouts();
12352
+ module.pullPage(function() {
12353
+ callback.call(element);
12354
+ if($.isFunction(settings.onHidden)) {
12355
+ settings.onHidden.call(element);
12356
+ }
12357
+ });
12358
+ settings.onChange.call(element);
12359
+ }
12360
+ },
12361
+
12362
+ othersAnimating: function() {
12363
+ return ($flyouts.not($module).filter('.' + className.animating).length > 0);
12364
+ },
12365
+ othersVisible: function() {
12366
+ return ($flyouts.not($module).filter('.' + className.visible).length > 0);
12367
+ },
12368
+ othersActive: function() {
12369
+ return(module.othersVisible() || module.othersAnimating());
12370
+ },
12371
+
12372
+ hideOthers: function(callback) {
12373
+ var
12374
+ $otherFlyouts = $flyouts.not($module).filter('.' + className.visible),
12375
+ flyoutCount = $otherFlyouts.length,
12376
+ callbackCount = 0
12377
+ ;
12378
+ callback = callback || function(){};
12379
+ $otherFlyouts
12380
+ .flyout('hide', function() {
12381
+ callbackCount++;
12382
+ if(callbackCount == flyoutCount) {
12383
+ callback();
12384
+ }
12385
+ })
12386
+ ;
12387
+ },
12388
+
12389
+ toggle: function() {
12390
+ module.verbose('Determining toggled direction');
12391
+ if(module.is.hidden()) {
12392
+ module.show();
12393
+ }
12394
+ else {
12395
+ module.hide();
12396
+ }
12397
+ },
12398
+
12399
+ pushPage: function(callback) {
12400
+ var
12401
+ animate,
12402
+ dim,
12403
+ transitionEnd
12404
+ ;
12405
+ callback = $.isFunction(callback)
12406
+ ? callback
12407
+ : function(){}
12408
+ ;
12409
+ module.set.overlay();
12410
+ module.repaint();
12411
+ if(settings.returnScroll) {
12412
+ currentScroll = (isBody ? $window : $context).scrollTop();
12413
+ }
12414
+ module.bind.scrollLock();
12415
+ animate = function() {
12416
+ module.bind.clickaway();
12417
+ module.add.inlineCSS();
12418
+ module.set.animating();
12419
+ module.set.visible();
12420
+ };
12421
+ dim = function() {
12422
+ module.set.dimmed();
12423
+ };
12424
+ transitionEnd = function(event) {
12425
+ if( event.target == $module[0] ) {
12426
+ $module.off(transitionEvent + elementNamespace, transitionEnd);
12427
+ module.remove.animating();
12428
+ callback.call(element);
12429
+ }
12430
+ };
12431
+ $module.off(transitionEvent + elementNamespace);
12432
+ $module.on(transitionEvent + elementNamespace, transitionEnd);
12433
+ requestAnimationFrame(animate);
12434
+ if(settings.dimPage && !module.othersVisible()) {
12435
+ requestAnimationFrame(dim);
12436
+ }
12437
+ },
12438
+
12439
+ pullPage: function(callback) {
12440
+ var
12441
+ animate,
12442
+ transitionEnd
12443
+ ;
12444
+ callback = $.isFunction(callback)
12445
+ ? callback
12446
+ : function(){}
12447
+ ;
12448
+ module.verbose('Removing context push state', module.get.direction());
12449
+
12450
+ module.unbind.clickaway();
12451
+ if(!module.othersActive()) {
12452
+ module.unbind.scrollLock();
12453
+ }
12454
+
12455
+ animate = function() {
12456
+ module.set.overlay();
12457
+ module.set.animating();
12458
+ module.remove.visible();
12459
+
12460
+ };
12461
+ transitionEnd = function(event) {
12462
+ if( event.target == $module[0] ) {
12463
+ $module.off(transitionEvent + elementNamespace, transitionEnd);
12464
+ module.remove.animating();
12465
+ module.remove.overlay();
12466
+ module.remove.inlineCSS();
12467
+ if(settings.returnScroll) {
12468
+ module.scrollBack();
12469
+ }
12470
+ if (settings.dimPage && !module.othersVisible()) {
12471
+ $pusher.removeClass(className.dimmed);
12472
+ }
12473
+ callback.call(element);
12474
+ }
12475
+ };
12476
+ $module.off(transitionEvent + elementNamespace);
12477
+ $module.on(transitionEvent + elementNamespace, transitionEnd);
12478
+ requestAnimationFrame(animate);
12479
+ },
12480
+
12481
+ scrollToTop: function() {
12482
+ module.verbose('Scrolling to top of page to avoid animation issues');
12483
+ $module.scrollTop(0);
12484
+ (isBody ? $window : $context)[0].scrollTo(0, 0);
12485
+ },
12486
+
12487
+ scrollBack: function() {
12488
+ module.verbose('Scrolling back to original page position');
12489
+ (isBody ? $window : $context)[0].scrollTo(0, currentScroll);
12490
+ },
12491
+
12492
+ clear: {
12493
+ cache: function() {
12494
+ module.verbose('Clearing cached dimensions');
12495
+ module.cache = {};
12496
+ }
12497
+ },
12498
+
12499
+ set: {
12500
+ bodyMargin: function() {
12501
+ var position = module.can.leftBodyScrollbar() ? 'left':'right';
12502
+ $context.css((isBody ? 'margin-':'padding-')+position, tempBodyMargin + 'px');
12503
+ $context.find(selector.bodyFixed.replace('right',position)).each(function(){
12504
+ var el = $(this),
12505
+ attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
12506
+ ;
12507
+ el.css(attribute, 'calc(' + el.css(attribute) + ' + ' + tempBodyMargin + 'px)');
12508
+ });
12509
+ },
12510
+
12511
+ // ios only (scroll on html not document). This prevent auto-resize canvas/scroll in ios
12512
+ // (This is no longer necessary in latest iOS)
12513
+ ios: function() {
12514
+ $html.addClass(className.ios);
12515
+ },
12516
+
12517
+ // container
12518
+ pushed: function() {
12519
+ $context.addClass(className.pushed);
12520
+ },
12521
+ pushable: function() {
12522
+ $context.addClass(className.pushable);
12523
+ },
12524
+
12525
+ // pusher
12526
+ dimmed: function() {
12527
+ $pusher.addClass(className.dimmed);
12528
+ },
12529
+
12530
+ // flyout
12531
+ active: function() {
12532
+ $module.addClass(className.active);
12533
+ },
12534
+ animating: function() {
12535
+ $module.addClass(className.animating);
12536
+ },
12537
+ direction: function(direction) {
12538
+ direction = direction || module.get.direction();
12539
+ $module.addClass(className[direction]);
12540
+ },
12541
+ visible: function() {
12542
+ $module.addClass(className.visible);
12543
+ },
12544
+ overlay: function() {
12545
+ $module.addClass(className.overlay);
12546
+ }
12547
+ },
12548
+ remove: {
12549
+
12550
+ inlineCSS: function() {
12551
+ module.debug('Removing inline css styles', $style);
12552
+ if($style && $style.length > 0) {
12553
+ $style.remove();
12554
+ }
12555
+ },
12556
+
12557
+ // ios scroll on html not document
12558
+ ios: function() {
12559
+ $html.removeClass(className.ios);
12560
+ },
12561
+
12562
+ // context
12563
+ pushed: function() {
12564
+ $context.removeClass(className.pushed);
12565
+ },
12566
+ pushable: function() {
12567
+ $context.removeClass(className.pushable);
12568
+ },
12569
+
12570
+ // flyout
12571
+ active: function() {
12572
+ $module.removeClass(className.active);
12573
+ },
12574
+ animating: function() {
12575
+ $module.removeClass(className.animating);
12576
+ },
12577
+ direction: function(direction) {
12578
+ direction = direction || module.get.direction();
12579
+ $module.removeClass(className[direction]);
12580
+ },
12581
+ visible: function() {
12582
+ $module.removeClass(className.visible);
12583
+ },
12584
+ overlay: function() {
12585
+ $module.removeClass(className.overlay);
12586
+ }
12587
+ },
12588
+
12589
+ get: {
12590
+
12591
+ direction: function() {
12592
+ if($module.hasClass(className.top)) {
12593
+ return className.top;
12594
+ }
12595
+ else if($module.hasClass(className.right)) {
12596
+ return className.right;
12597
+ }
12598
+ else if($module.hasClass(className.bottom)) {
12599
+ return className.bottom;
12600
+ }
12601
+ return className.left;
12602
+ },
12603
+ transitionEvent: function() {
12604
+ var
12605
+ element = document.createElement('element'),
12606
+ transitions = {
12607
+ 'transition' :'transitionend',
12608
+ 'OTransition' :'oTransitionEnd',
12609
+ 'MozTransition' :'transitionend',
12610
+ 'WebkitTransition' :'webkitTransitionEnd'
12611
+ },
12612
+ transition
12613
+ ;
12614
+ for(transition in transitions){
12615
+ if( element.style[transition] !== undefined ){
12616
+ return transitions[transition];
12617
+ }
12618
+ }
12619
+ },
12620
+ settings: function() {
12621
+ return settings;
12622
+ }
12623
+ },
12624
+
12625
+ can: {
12626
+ leftBodyScrollbar: function () {
12627
+ if (module.cache.leftBodyScrollbar === undefined) {
12628
+ module.cache.leftBodyScrollbar = module.is.rtl() && ((module.is.iframe && !module.is.firefox()) || module.is.safari() || module.is.edge() || module.is.ie());
12629
+ }
12630
+ return module.cache.leftBodyScrollbar;
12631
+ }
12632
+ },
12633
+
12634
+ save: {
12635
+ bodyMargin: function() {
12636
+ initialBodyMargin = $context.css((isBody ? 'margin-':'padding-')+(module.can.leftBodyScrollbar() ? 'left':'right'));
12637
+ var bodyMarginRightPixel = parseInt(initialBodyMargin.replace(/[^\d.]/g, '')),
12638
+ bodyScrollbarWidth = isBody ? window.innerWidth - document.documentElement.clientWidth : $context[0].offsetWidth - $context[0].clientWidth;
12639
+ tempBodyMargin = bodyMarginRightPixel + bodyScrollbarWidth;
12640
+ }
12641
+ },
12642
+
12643
+ is: {
12644
+ safari: function() {
12645
+ if(module.cache.isSafari === undefined) {
12646
+ module.cache.isSafari = /constructor/i.test(window.HTMLElement) || !!window.ApplePaySession;
12647
+ }
12648
+ return module.cache.isSafari;
12649
+ },
12650
+ edge: function(){
12651
+ if(module.cache.isEdge === undefined) {
12652
+ module.cache.isEdge = !!window.setImmediate && !module.is.ie();
12653
+ }
12654
+ return module.cache.isEdge;
12655
+ },
12656
+ firefox: function(){
12657
+ if(module.cache.isFirefox === undefined) {
12658
+ module.cache.isFirefox = !!window.InstallTrigger;
12659
+ }
12660
+ return module.cache.isFirefox;
12661
+ },
12662
+ iframe: function() {
12663
+ return !(self === top);
12664
+ },
12665
+ ie: function() {
12666
+ if(module.cache.isIE === undefined) {
12667
+ var
12668
+ isIE11 = (!(window.ActiveXObject) && 'ActiveXObject' in window),
12669
+ isIE = ('ActiveXObject' in window)
12670
+ ;
12671
+ module.cache.isIE = (isIE11 || isIE);
12672
+ }
12673
+ return module.cache.isIE;
12674
+ },
12675
+ ios: function() {
12676
+ var
12677
+ userAgent = navigator.userAgent,
12678
+ isIOS = userAgent.match(regExp.ios),
12679
+ isMobileChrome = userAgent.match(regExp.mobileChrome)
12680
+ ;
12681
+ if(isIOS && !isMobileChrome) {
12682
+ module.verbose('Browser was found to be iOS', userAgent);
12683
+ return true;
12684
+ }
12685
+ else {
12686
+ return false;
12687
+ }
12688
+ },
12689
+ mobile: function() {
12690
+ var
12691
+ userAgent = navigator.userAgent,
12692
+ isMobile = userAgent.match(regExp.mobile)
12693
+ ;
12694
+ if(isMobile) {
12695
+ module.verbose('Browser was found to be mobile', userAgent);
12696
+ return true;
12697
+ }
12698
+ else {
12699
+ module.verbose('Browser is not mobile, using regular transition', userAgent);
12700
+ return false;
12701
+ }
12702
+ },
12703
+ hidden: function() {
12704
+ return !module.is.visible();
12705
+ },
12706
+ visible: function() {
12707
+ return $module.hasClass(className.visible);
12708
+ },
12709
+ animating: function() {
12710
+ return $context.hasClass(className.animating);
12711
+ },
12712
+ rtl: function () {
12713
+ if(module.cache.isRTL === undefined) {
12714
+ module.cache.isRTL = $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl' || $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl' || $context.attr('dir') === 'rtl' || $context.css('direction') === 'rtl';
12715
+ }
12716
+ return module.cache.isRTL;
12717
+ }
12718
+ },
12719
+
12720
+ has: {
12721
+ configActions: function () {
12722
+ return Array.isArray(settings.actions) && settings.actions.length > 0;
12723
+ },
12724
+ scrollbar: function() {
12725
+ return isBody || $context.css('overflow-y') !== 'hidden';
12726
+ }
12727
+ },
12728
+
12729
+ restore: {
12730
+ bodyMargin: function() {
12731
+ var position = module.can.leftBodyScrollbar() ? 'left':'right';
12732
+ $context.css((isBody ? 'margin-':'padding-')+position, initialBodyMargin);
12733
+ $context.find(selector.bodyFixed.replace('right',position)).each(function(){
12734
+ var el = $(this),
12735
+ attribute = el.css('position') === 'fixed' ? 'padding-'+position : position
12736
+ ;
12737
+ el.css(attribute, '');
12738
+ });
12739
+ }
12740
+ },
12741
+
12742
+ helpers: {
12743
+ deQuote: function(string) {
12744
+ return String(string).replace(/"/g,"");
12745
+ },
12746
+ escape: function(string, preserveHTML) {
12747
+ if (preserveHTML){
12748
+ return string;
12749
+ }
12750
+ var
12751
+ badChars = /[<>"'`]/g,
12752
+ shouldEscape = /[&<>"'`]/,
12753
+ escape = {
12754
+ "<": "&lt;",
12755
+ ">": "&gt;",
12756
+ '"': "&quot;",
12757
+ "'": "&#x27;",
12758
+ "`": "&#x60;"
12759
+ },
12760
+ escapedChar = function(chr) {
12761
+ return escape[chr];
12762
+ }
12763
+ ;
12764
+ if(shouldEscape.test(string)) {
12765
+ string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&amp;");
12766
+ return string.replace(badChars, escapedChar);
12767
+ }
12768
+ return string;
12769
+ }
12770
+ },
12771
+
12772
+ setting: function(name, value) {
12773
+ module.debug('Changing setting', name, value);
12774
+ if( $.isPlainObject(name) ) {
12775
+ $.extend(true, settings, name);
12776
+ }
12777
+ else if(value !== undefined) {
12778
+ if($.isPlainObject(settings[name])) {
12779
+ $.extend(true, settings[name], value);
12780
+ }
12781
+ else {
12782
+ settings[name] = value;
12783
+ }
12784
+ }
12785
+ else {
12786
+ return settings[name];
12787
+ }
12788
+ },
12789
+ internal: function(name, value) {
12790
+ if( $.isPlainObject(name) ) {
12791
+ $.extend(true, module, name);
12792
+ }
12793
+ else if(value !== undefined) {
12794
+ module[name] = value;
12795
+ }
12796
+ else {
12797
+ return module[name];
12798
+ }
12799
+ },
12800
+ debug: function() {
12801
+ if(!settings.silent && settings.debug) {
12802
+ if(settings.performance) {
12803
+ module.performance.log(arguments);
12804
+ }
12805
+ else {
12806
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
12807
+ module.debug.apply(console, arguments);
12808
+ }
12809
+ }
12810
+ },
12811
+ verbose: function() {
12812
+ if(!settings.silent && settings.verbose && settings.debug) {
12813
+ if(settings.performance) {
12814
+ module.performance.log(arguments);
12815
+ }
12816
+ else {
12817
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
12818
+ module.verbose.apply(console, arguments);
12819
+ }
12820
+ }
12821
+ },
12822
+ error: function() {
12823
+ if(!settings.silent) {
12824
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
12825
+ module.error.apply(console, arguments);
12826
+ }
12827
+ },
12828
+ performance: {
12829
+ log: function(message) {
12830
+ var
12831
+ currentTime,
12832
+ executionTime,
12833
+ previousTime
12834
+ ;
12835
+ if(settings.performance) {
12836
+ currentTime = new Date().getTime();
12837
+ previousTime = time || currentTime;
12838
+ executionTime = currentTime - previousTime;
12839
+ time = currentTime;
12840
+ performance.push({
12841
+ 'Name' : message[0],
12842
+ 'Arguments' : [].slice.call(message, 1) || '',
12843
+ 'Element' : element,
12844
+ 'Execution Time' : executionTime
12845
+ });
12846
+ }
12847
+ clearTimeout(module.performance.timer);
12848
+ module.performance.timer = setTimeout(module.performance.display, 500);
12849
+ },
12850
+ display: function() {
12851
+ var
12852
+ title = settings.name + ':',
12853
+ totalTime = 0
12854
+ ;
12855
+ time = false;
12856
+ clearTimeout(module.performance.timer);
12857
+ $.each(performance, function(index, data) {
12858
+ totalTime += data['Execution Time'];
12859
+ });
12860
+ title += ' ' + totalTime + 'ms';
12861
+ if(moduleSelector) {
12862
+ title += ' \'' + moduleSelector + '\'';
12863
+ }
12864
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
12865
+ console.groupCollapsed(title);
12866
+ if(console.table) {
12867
+ console.table(performance);
12868
+ }
12869
+ else {
12870
+ $.each(performance, function(index, data) {
12871
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
12872
+ });
12873
+ }
12874
+ console.groupEnd();
12875
+ }
12876
+ performance = [];
12877
+ }
12878
+ },
12879
+ invoke: function(query, passedArguments, context) {
12880
+ var
12881
+ object = instance,
12882
+ maxDepth,
12883
+ found,
12884
+ response
12885
+ ;
12886
+ passedArguments = passedArguments || queryArguments;
12887
+ context = element || context;
12888
+ if(typeof query == 'string' && object !== undefined) {
12889
+ query = query.split(/[\. ]/);
12890
+ maxDepth = query.length - 1;
12891
+ $.each(query, function(depth, value) {
12892
+ var camelCaseValue = (depth != maxDepth)
12893
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
12894
+ : query
12895
+ ;
12896
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
12897
+ object = object[camelCaseValue];
12898
+ }
12899
+ else if( object[camelCaseValue] !== undefined ) {
12900
+ found = object[camelCaseValue];
12901
+ return false;
12902
+ }
12903
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
12904
+ object = object[value];
12905
+ }
12906
+ else if( object[value] !== undefined ) {
12907
+ found = object[value];
12908
+ return false;
12909
+ }
12910
+ else {
12911
+ module.error(error.method, query);
12912
+ return false;
12913
+ }
12914
+ });
12915
+ }
12916
+ if ( $.isFunction( found ) ) {
12917
+ response = found.apply(context, passedArguments);
12918
+ }
12919
+ else if(found !== undefined) {
12920
+ response = found;
12921
+ }
12922
+ if(Array.isArray(returnedValue)) {
12923
+ returnedValue.push(response);
12924
+ }
12925
+ else if(returnedValue !== undefined) {
12926
+ returnedValue = [returnedValue, response];
12927
+ }
12928
+ else if(response !== undefined) {
12929
+ returnedValue = response;
12930
+ }
12931
+ return found;
12932
+ }
12933
+ }
12934
+ ;
12935
+
12936
+ if(methodInvoked) {
12937
+ if(instance === undefined) {
12938
+ if ($.isFunction(settings.templates[query])) {
12939
+ settings.autoShow = true;
12940
+ settings.className.flyout = settings.className.template;
12941
+ settings = $.extend(true, {}, settings, settings.templates[query].apply(module ,queryArguments));
12942
+
12943
+ // reassign shortcuts
12944
+ className = settings.className;
12945
+ namespace = settings.namespace;
12946
+ fields = settings.fields;
12947
+ error = settings.error;
12948
+ }
12949
+ module.initialize();
12950
+ }
12951
+ if (!$.isFunction(settings.templates[query])) {
12952
+ module.invoke(query);
12953
+ }
12954
+ }
12955
+ else {
12956
+ if(instance !== undefined) {
12957
+ instance.invoke('destroy');
12958
+ }
12959
+ module.initialize();
12960
+ returnedValue = $module;
12961
+ }
12962
+ });
12963
+
12964
+ return (returnedValue !== undefined)
12965
+ ? returnedValue
12966
+ : this
12967
+ ;
12968
+ };
12969
+
12970
+ $.fn.flyout.settings = {
12971
+
12972
+ name : 'Flyout',
12973
+ namespace : 'flyout',
12974
+
12975
+ silent : false,
12976
+ debug : false,
12977
+ verbose : false,
12978
+ performance : true,
12979
+
12980
+ context : 'body',
12981
+ exclusive : false,
12982
+ closable : true,
12983
+ dimPage : true,
12984
+ scrollLock : false,
12985
+ returnScroll : false,
12986
+ delaySetup : false,
12987
+ autoShow : false,
12988
+
12989
+ //dynamic content
12990
+ title : '',
12991
+ content : '',
12992
+ class : '',
12993
+ classTitle : '',
12994
+ classContent : '',
12995
+ classActions : '',
12996
+ closeIcon : false,
12997
+ actions : false,
12998
+ preserveHTML : true,
12999
+
13000
+ fields : {
13001
+ class : 'class',
13002
+ text : 'text',
13003
+ icon : 'icon',
13004
+ click : 'click'
13005
+ },
13006
+
13007
+ onChange : function(){},
13008
+ onShow : function(){},
13009
+ onHide : function(){ return true; },
13010
+
13011
+ onHidden : false,
13012
+ onVisible : function(){},
13013
+
13014
+ onApprove : function(){},
13015
+ onDeny : function(){},
13016
+
13017
+ className : {
13018
+ flyout : 'ui flyout',
13019
+ close : 'close icon',
13020
+ header : 'ui header',
13021
+ content : 'content',
13022
+ actions : 'actions',
13023
+ active : 'active',
13024
+ animating : 'animating',
13025
+ dimmed : 'dimmed',
13026
+ ios : 'ios',
13027
+ locked : 'locked',
13028
+ pushable : 'pushable',
13029
+ pushed : 'pushed',
13030
+ right : 'right',
13031
+ top : 'top',
13032
+ left : 'left',
13033
+ bottom : 'bottom',
13034
+ visible : 'visible',
13035
+ overlay : 'overlay',
13036
+ fullscreen : 'fullscreen',
13037
+ template : 'ui flyout',
13038
+ button : 'ui button',
13039
+ ok : 'positive',
13040
+ cancel : 'negative',
13041
+ prompt : 'ui fluid input'
13042
+ },
13043
+
13044
+ selector: {
13045
+ bodyFixed: '> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close',
13046
+ fixed : '.fixed',
13047
+ omitted : 'script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed',
13048
+ pusher : '.pusher',
13049
+ flyout : '.ui.flyout',
13050
+ header : '.ui.header',
13051
+ content : '.content',
13052
+ actions : '.actions',
13053
+ close : '.close',
13054
+ approve : '.actions .positive, .actions .approve, .actions .ok',
13055
+ deny : '.actions .negative, .actions .deny, .actions .cancel'
13056
+ },
13057
+
13058
+ regExp: {
13059
+ ios : /(iPad|iPhone|iPod)/g,
13060
+ mobileChrome : /(CriOS)/g,
13061
+ mobile : /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g
13062
+ },
13063
+
13064
+ error : {
13065
+ method : 'The method you called is not defined.',
13066
+ pusher : 'Had to add pusher element. For optimal performance make sure body content is inside a pusher element',
13067
+ movedFlyout : 'Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag',
13068
+ notFound : 'There were no elements that matched the specified selector'
13069
+ },
13070
+
13071
+ text: {
13072
+ ok : 'Ok',
13073
+ cancel : 'Cancel'
13074
+ }
13075
+ };
13076
+
13077
+ $.fn.flyout.settings.templates = {
13078
+ getArguments: function(args) {
13079
+ var queryArguments = [].slice.call(args);
13080
+ if($.isPlainObject(queryArguments[0])){
13081
+ return $.extend({
13082
+ handler:function(){},
13083
+ content:'',
13084
+ title: ''
13085
+ }, queryArguments[0]);
13086
+ } else {
13087
+ if(!$.isFunction(queryArguments[queryArguments.length-1])) {
13088
+ queryArguments.push(function() {});
13089
+ }
13090
+ return {
13091
+ handler: queryArguments.pop(),
13092
+ content: queryArguments.pop() || '',
13093
+ title: queryArguments.pop() || ''
13094
+ };
13095
+ }
13096
+ },
13097
+ alert: function () {
13098
+ var
13099
+ settings = this.get.settings(),
13100
+ args = settings.templates.getArguments(arguments)
13101
+ ;
13102
+ return {
13103
+ title : args.title,
13104
+ content: args.content,
13105
+ actions: [{
13106
+ text : settings.text.ok,
13107
+ class: settings.className.ok,
13108
+ click: args.handler
13109
+ }]
13110
+ }
13111
+ },
13112
+ confirm: function () {
13113
+ var
13114
+ settings = this.get.settings(),
13115
+ args = settings.templates.getArguments(arguments)
13116
+ ;
13117
+ return {
13118
+ title : args.title,
13119
+ content: args.content,
13120
+ actions: [{
13121
+ text : settings.text.ok,
13122
+ class: settings.className.ok,
13123
+ click: function(){args.handler(true)}
13124
+ },{
13125
+ text: settings.text.cancel,
13126
+ class: settings.className.cancel,
13127
+ click: function(){args.handler(false)}
13128
+ }]
13129
+ }
13130
+ },
13131
+ prompt: function () {
13132
+ var
13133
+ $this = this,
13134
+ settings = this.get.settings(),
13135
+ args = settings.templates.getArguments(arguments),
13136
+ input = $($.parseHTML(args.content)).filter('.ui.input')
13137
+ ;
13138
+ if (input.length === 0) {
13139
+ args.content += '<p><div class="'+settings.className.prompt+'"><input placeholder="'+this.helpers.deQuote(args.placeholder || '')+'" type="text" value="'+this.helpers.deQuote(args.defaultValue || '')+'"></div></p>';
13140
+ }
13141
+ return {
13142
+ title : args.title,
13143
+ content: args.content,
13144
+ actions: [{
13145
+ text: settings.text.ok,
13146
+ class: settings.className.ok,
13147
+ click: function(){
13148
+ var settings = $this.get.settings(),
13149
+ inputField = $this.get.element().find(settings.selector.prompt)[0]
13150
+ ;
13151
+ args.handler($(inputField).val());
13152
+ }
13153
+ },{
13154
+ text: settings.text.cancel,
13155
+ class: settings.className.cancel,
13156
+ click: function(){args.handler(null)}
13157
+ }]
13158
+ }
13159
+ }
13160
+ };
13161
+
13162
+ })( jQuery, window, document );
13163
+
13164
+ /*!
13165
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Modal
11819
13166
  * http://github.com/fomantic/Fomantic-UI/
11820
13167
  *
11821
13168
  *
@@ -13371,7 +14718,7 @@ $.fn.modal.settings.templates = {
13371
14718
  })( jQuery, window, document );
13372
14719
 
13373
14720
  /*!
13374
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Nag
14721
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Nag
13375
14722
  * http://github.com/fomantic/Fomantic-UI/
13376
14723
  *
13377
14724
  *
@@ -13930,7 +15277,7 @@ $.extend( $.easing, {
13930
15277
  })( jQuery, window, document );
13931
15278
 
13932
15279
  /*!
13933
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Popup
15280
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Popup
13934
15281
  * http://github.com/fomantic/Fomantic-UI/
13935
15282
  *
13936
15283
  *
@@ -15466,7 +16813,7 @@ $.fn.popup.settings = {
15466
16813
  })( jQuery, window, document );
15467
16814
 
15468
16815
  /*!
15469
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Progress
16816
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Progress
15470
16817
  * http://github.com/fomantic/Fomantic-UI/
15471
16818
  *
15472
16819
  *
@@ -16503,7 +17850,7 @@ $.fn.progress.settings = {
16503
17850
  })( jQuery, window, document );
16504
17851
 
16505
17852
  /*!
16506
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Slider
17853
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Slider
16507
17854
  * http://github.com/fomantic/Fomantic-UI/
16508
17855
  *
16509
17856
  *
@@ -17857,7 +19204,7 @@ $.fn.slider.settings = {
17857
19204
  })( jQuery, window, document );
17858
19205
 
17859
19206
  /*!
17860
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Rating
19207
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Rating
17861
19208
  * http://github.com/fomantic/Fomantic-UI/
17862
19209
  *
17863
19210
  *
@@ -18416,7 +19763,7 @@ $.fn.rating.settings = {
18416
19763
  })( jQuery, window, document );
18417
19764
 
18418
19765
  /*!
18419
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Search
19766
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Search
18420
19767
  * http://github.com/fomantic/Fomantic-UI/
18421
19768
  *
18422
19769
  *
@@ -20011,7 +21358,7 @@ $.extend($.easing, {
20011
21358
  })( jQuery, window, document );
20012
21359
 
20013
21360
  /*!
20014
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Shape
21361
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Shape
20015
21362
  * http://github.com/fomantic/Fomantic-UI/
20016
21363
  *
20017
21364
  *
@@ -20860,7 +22207,7 @@ $.fn.shape.settings = {
20860
22207
  })( jQuery, window, document );
20861
22208
 
20862
22209
  /*!
20863
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Sidebar
22210
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Sidebar
20864
22211
  * http://github.com/fomantic/Fomantic-UI/
20865
22212
  *
20866
22213
  *
@@ -21924,8 +23271,6 @@ $.fn.sidebar.settings = {
21924
23271
  returnScroll : false,
21925
23272
  delaySetup : false,
21926
23273
 
21927
- duration : 500,
21928
-
21929
23274
  onChange : function(){},
21930
23275
  onShow : function(){},
21931
23276
  onHide : function(){},
@@ -21976,7 +23321,7 @@ $.fn.sidebar.settings = {
21976
23321
  })( jQuery, window, document );
21977
23322
 
21978
23323
  /*!
21979
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Sticky
23324
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Sticky
21980
23325
  * http://github.com/fomantic/Fomantic-UI/
21981
23326
  *
21982
23327
  *
@@ -22927,7 +24272,7 @@ $.fn.sticky.settings = {
22927
24272
  })( jQuery, window, document );
22928
24273
 
22929
24274
  /*!
22930
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Tab
24275
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Tab
22931
24276
  * http://github.com/fomantic/Fomantic-UI/
22932
24277
  *
22933
24278
  *
@@ -23947,7 +25292,7 @@ $.fn.tab.settings = {
23947
25292
  })( jQuery, window, document );
23948
25293
 
23949
25294
  /*!
23950
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Toast
25295
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Toast
23951
25296
  * http://github.com/fomantic/Fomantic-UI/
23952
25297
  *
23953
25298
  *
@@ -24874,7 +26219,7 @@ $.extend( $.easing, {
24874
26219
  })( jQuery, window, document );
24875
26220
 
24876
26221
  /*!
24877
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Transition
26222
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Transition
24878
26223
  * http://github.com/fomantic/Fomantic-UI/
24879
26224
  *
24880
26225
  *
@@ -25989,7 +27334,7 @@ $.fn.transition.settings = {
25989
27334
  })( jQuery, window, document );
25990
27335
 
25991
27336
  /*!
25992
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - API
27337
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - API
25993
27338
  * http://github.com/fomantic/Fomantic-UI/
25994
27339
  *
25995
27340
  *
@@ -27226,7 +28571,7 @@ $.api.settings = {
27226
28571
  })( jQuery, window, document );
27227
28572
 
27228
28573
  /*!
27229
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - State
28574
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - State
27230
28575
  * http://github.com/fomantic/Fomantic-UI/
27231
28576
  *
27232
28577
  *
@@ -27938,7 +29283,7 @@ $.fn.state.settings = {
27938
29283
  })( jQuery, window, document );
27939
29284
 
27940
29285
  /*!
27941
- * # Fomantic-UI 2.9.0-beta.314+ac16a50 - Visibility
29286
+ * # Fomantic-UI 2.9.0-beta.316+9a105a8 - Visibility
27942
29287
  * http://github.com/fomantic/Fomantic-UI/
27943
29288
  *
27944
29289
  *