volt-semantic-ui 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/Gemfile +0 -0
  4. data/LICENSE.txt +0 -0
  5. data/README.md +0 -0
  6. data/Rakefile +0 -0
  7. data/app/semanticui/assets/css/semantic.min.css +3 -3
  8. data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.eot +0 -0
  9. data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.svg +0 -0
  10. data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.ttf +0 -0
  11. data/app/semanticui/assets/css/themes/basic/assets/fonts/icons.woff +0 -0
  12. data/app/semanticui/assets/css/themes/default/assets/fonts/icons.eot +0 -0
  13. data/app/semanticui/assets/css/themes/default/assets/fonts/icons.otf +0 -0
  14. data/app/semanticui/assets/css/themes/default/assets/fonts/icons.svg +526 -465
  15. data/app/semanticui/assets/css/themes/default/assets/fonts/icons.ttf +0 -0
  16. data/app/semanticui/assets/css/themes/default/assets/fonts/icons.woff +0 -0
  17. data/app/semanticui/assets/css/themes/default/assets/fonts/icons.woff2 +0 -0
  18. data/app/semanticui/assets/css/themes/default/assets/images/flags.png +0 -0
  19. data/app/semanticui/assets/js/components/accordion.css +256 -0
  20. data/app/semanticui/assets/js/components/accordion.js +578 -0
  21. data/app/semanticui/assets/js/components/accordion.min.css +10 -0
  22. data/app/semanticui/assets/js/components/accordion.min.js +11 -0
  23. data/app/semanticui/assets/js/components/ad.css +276 -0
  24. data/app/semanticui/assets/js/components/ad.min.css +10 -0
  25. data/app/semanticui/assets/js/components/api.js +871 -0
  26. data/app/semanticui/assets/js/components/api.min.js +11 -0
  27. data/app/semanticui/assets/js/components/breadcrumb.css +124 -0
  28. data/app/semanticui/assets/js/components/breadcrumb.min.css +10 -0
  29. data/app/semanticui/assets/js/components/button.css +2391 -0
  30. data/app/semanticui/assets/js/components/button.min.css +10 -0
  31. data/app/semanticui/assets/js/components/card.css +909 -0
  32. data/app/semanticui/assets/js/components/card.min.css +10 -0
  33. data/app/semanticui/assets/js/components/checkbox.css +513 -0
  34. data/app/semanticui/assets/js/components/checkbox.js +509 -0
  35. data/app/semanticui/assets/js/components/checkbox.min.css +10 -0
  36. data/app/semanticui/assets/js/components/checkbox.min.js +11 -0
  37. data/app/semanticui/assets/js/components/comment.css +259 -0
  38. data/app/semanticui/assets/js/components/comment.min.css +10 -0
  39. data/app/semanticui/assets/js/components/dimmer.css +186 -0
  40. data/app/semanticui/assets/js/components/dimmer.js +669 -0
  41. data/app/semanticui/assets/js/components/dimmer.min.css +10 -0
  42. data/app/semanticui/assets/js/components/dimmer.min.js +11 -0
  43. data/app/semanticui/assets/js/components/divider.css +241 -0
  44. data/app/semanticui/assets/js/components/divider.min.css +10 -0
  45. data/app/semanticui/assets/js/components/dropdown.css +1103 -0
  46. data/app/semanticui/assets/js/components/dropdown.js +1795 -0
  47. data/app/semanticui/assets/js/components/dropdown.min.css +10 -0
  48. data/app/semanticui/assets/js/components/dropdown.min.js +11 -0
  49. data/app/semanticui/assets/js/components/feed.css +276 -0
  50. data/app/semanticui/assets/js/components/feed.min.css +10 -0
  51. data/app/semanticui/assets/js/components/flag.css +1024 -0
  52. data/app/semanticui/assets/js/components/flag.min.css +10 -0
  53. data/app/semanticui/assets/js/components/form.css +891 -0
  54. data/app/semanticui/assets/js/components/form.js +1118 -0
  55. data/app/semanticui/assets/js/components/form.min.css +10 -0
  56. data/app/semanticui/assets/js/components/form.min.js +11 -0
  57. data/app/semanticui/assets/js/components/grid.css +1871 -0
  58. data/app/semanticui/assets/js/components/grid.min.css +10 -0
  59. data/app/semanticui/assets/js/components/header.css +596 -0
  60. data/app/semanticui/assets/js/components/header.min.css +10 -0
  61. data/app/semanticui/assets/js/components/icon.css +2467 -0
  62. data/app/semanticui/assets/js/components/icon.min.css +10 -0
  63. data/app/semanticui/assets/js/components/image.css +288 -0
  64. data/app/semanticui/assets/js/components/image.min.css +10 -0
  65. data/app/semanticui/assets/js/components/input.css +439 -0
  66. data/app/semanticui/assets/js/components/input.min.css +10 -0
  67. data/app/semanticui/assets/js/components/item.css +456 -0
  68. data/app/semanticui/assets/js/components/item.min.css +10 -0
  69. data/app/semanticui/assets/js/components/label.css +963 -0
  70. data/app/semanticui/assets/js/components/label.min.css +10 -0
  71. data/app/semanticui/assets/js/components/list.css +878 -0
  72. data/app/semanticui/assets/js/components/list.min.css +10 -0
  73. data/app/semanticui/assets/js/components/loader.css +284 -0
  74. data/app/semanticui/assets/js/components/loader.min.css +10 -0
  75. data/app/semanticui/assets/js/components/menu.css +1608 -0
  76. data/app/semanticui/assets/js/components/menu.min.css +10 -0
  77. data/app/semanticui/assets/js/components/message.css +421 -0
  78. data/app/semanticui/assets/js/components/message.min.css +10 -0
  79. data/app/semanticui/assets/js/components/modal.css +432 -0
  80. data/app/semanticui/assets/js/components/modal.js +860 -0
  81. data/app/semanticui/assets/js/components/modal.min.css +10 -0
  82. data/app/semanticui/assets/js/components/modal.min.js +11 -0
  83. data/app/semanticui/assets/js/components/nag.css +148 -0
  84. data/app/semanticui/assets/js/components/nag.js +477 -0
  85. data/app/semanticui/assets/js/components/nag.min.css +10 -0
  86. data/app/semanticui/assets/js/components/nag.min.js +11 -0
  87. data/app/semanticui/assets/js/components/popup.css +293 -0
  88. data/app/semanticui/assets/js/components/popup.js +1224 -0
  89. data/app/semanticui/assets/js/components/popup.min.css +10 -0
  90. data/app/semanticui/assets/js/components/popup.min.js +11 -0
  91. data/app/semanticui/assets/js/components/progress.css +461 -0
  92. data/app/semanticui/assets/js/components/progress.js +785 -0
  93. data/app/semanticui/assets/js/components/progress.min.css +10 -0
  94. data/app/semanticui/assets/js/components/progress.min.js +11 -0
  95. data/app/semanticui/assets/js/components/rail.css +124 -0
  96. data/app/semanticui/assets/js/components/rail.min.css +10 -0
  97. data/app/semanticui/assets/js/components/rating.css +251 -0
  98. data/app/semanticui/assets/js/components/rating.js +451 -0
  99. data/app/semanticui/assets/js/components/rating.min.css +10 -0
  100. data/app/semanticui/assets/js/components/rating.min.js +11 -0
  101. data/app/semanticui/assets/js/components/reset.css +429 -0
  102. data/app/semanticui/assets/js/components/reset.min.css +10 -0
  103. data/app/semanticui/assets/js/components/reveal.css +293 -0
  104. data/app/semanticui/assets/js/components/reveal.min.css +10 -0
  105. data/app/semanticui/assets/js/components/search.css +329 -0
  106. data/app/semanticui/assets/js/components/search.js +1096 -0
  107. data/app/semanticui/assets/js/components/search.min.css +10 -0
  108. data/app/semanticui/assets/js/components/search.min.js +11 -0
  109. data/app/semanticui/assets/js/components/segment.css +635 -0
  110. data/app/semanticui/assets/js/components/segment.min.css +10 -0
  111. data/app/semanticui/assets/js/components/shape.css +154 -0
  112. data/app/semanticui/assets/js/components/shape.js +830 -0
  113. data/app/semanticui/assets/js/components/shape.min.css +10 -0
  114. data/app/semanticui/assets/js/components/shape.min.js +11 -0
  115. data/app/semanticui/assets/js/components/sidebar.css +625 -0
  116. data/app/semanticui/assets/js/components/sidebar.js +1089 -0
  117. data/app/semanticui/assets/js/components/sidebar.min.css +10 -0
  118. data/app/semanticui/assets/js/components/sidebar.min.js +11 -0
  119. data/app/semanticui/assets/js/components/site.css +160 -0
  120. data/app/semanticui/assets/js/components/site.js +487 -0
  121. data/app/semanticui/assets/js/components/site.min.css +10 -0
  122. data/app/semanticui/assets/js/components/site.min.js +11 -0
  123. data/app/semanticui/assets/js/components/state.js +695 -0
  124. data/app/semanticui/assets/js/components/state.min.js +11 -0
  125. data/app/semanticui/assets/js/components/statistic.css +409 -0
  126. data/app/semanticui/assets/js/components/statistic.min.css +10 -0
  127. data/app/semanticui/assets/js/components/step.css +432 -0
  128. data/app/semanticui/assets/js/components/step.min.css +10 -0
  129. data/app/semanticui/assets/js/components/sticky.css +79 -0
  130. data/app/semanticui/assets/js/components/sticky.js +792 -0
  131. data/app/semanticui/assets/js/components/sticky.min.css +10 -0
  132. data/app/semanticui/assets/js/components/sticky.min.js +11 -0
  133. data/app/semanticui/assets/js/components/tab.css +92 -0
  134. data/app/semanticui/assets/js/components/tab.js +802 -0
  135. data/app/semanticui/assets/js/components/tab.min.css +10 -0
  136. data/app/semanticui/assets/js/components/tab.min.js +11 -0
  137. data/app/semanticui/assets/js/components/table.css +1000 -0
  138. data/app/semanticui/assets/js/components/table.min.css +10 -0
  139. data/app/semanticui/assets/js/components/transition.css +1990 -0
  140. data/app/semanticui/assets/js/components/transition.js +1038 -0
  141. data/app/semanticui/assets/js/components/transition.min.css +10 -0
  142. data/app/semanticui/assets/js/components/transition.min.js +11 -0
  143. data/app/semanticui/assets/js/components/video.css +125 -0
  144. data/app/semanticui/assets/js/components/video.js +540 -0
  145. data/app/semanticui/assets/js/components/video.min.css +10 -0
  146. data/app/semanticui/assets/js/components/video.min.js +11 -0
  147. data/app/semanticui/assets/js/components/visibility.js +1032 -0
  148. data/app/semanticui/assets/js/components/visibility.min.js +11 -0
  149. data/app/semanticui/assets/js/semantic.min.js +9 -9
  150. data/lib/volt/semanticui.rb +0 -0
  151. data/lib/volt/semanticui/version.rb +1 -1
  152. data/volt-semantic-ui-0.0.1.gem +0 -0
  153. data/volt-semanticui-0.0.1.gem +0 -0
  154. data/volt-semanticui.gemspec +0 -0
  155. metadata +141 -10
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * # Semantic UI 1.11.4 - Sticky
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2014 Contributors
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */.ui.sticky{position:static;-webkit-transition:width .2s ease,height .2s ease,top .2s ease,bottom .2s ease;transition:width .2s ease,height .2s ease,top .2s ease,bottom .2s ease;z-index:800}.ui.sticky.bound{position:absolute;left:auto;right:auto}.ui.sticky.fixed{position:fixed;left:auto;right:auto}.ui.sticky.bound.top,.ui.sticky.fixed.top{top:0;bottom:auto}.ui.sticky.bound.bottom,.ui.sticky.fixed.bottom{top:auto;bottom:0}.ui.native.sticky{position:-webkit-sticky;position:-moz-sticky;position:-ms-sticky;position:-o-sticky;position:sticky}
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * # Semantic UI 1.11.4 - Sticky
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2014 Contributorss
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+ !function(e,t,o,n){"use strict";e.fn.sticky=function(o){var i,s=e(this),c=s.selector||"",r=(new Date).getTime(),a=[],l=arguments[0],m="string"==typeof l,f=[].slice.call(arguments,1);return s.each(function(){var s,u,d,h=e.isPlainObject(o)?e.extend(!0,{},e.fn.sticky.settings,o):e.extend({},e.fn.sticky.settings),b=h.className,g=h.namespace,p=h.error,v="."+g,x="module-"+g,C=e(this),k=e(t),y=C.offsetParent(),S=e(h.scrollContext),T=(C.selector||"",C.data(x)),w=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)},P=this;d={initialize:function(){d.determineContext(),d.verbose("Initializing sticky",h,y),d.save.positions(),d.checkErrors(),d.bind.events(),h.observeChanges&&d.observeChanges(),d.instantiate()},instantiate:function(){d.verbose("Storing instance of module",d),T=d,C.data(x,d)},destroy:function(){d.verbose("Destroying previous module"),d.reset(),u&&u.disconnect(),k.off("resize"+v,d.event.resize),S.off("scroll"+v,d.event.scroll),C.removeData(x)},observeChanges:function(){var e=s[0];"MutationObserver"in t&&(u=new MutationObserver(function(){clearTimeout(d.timer),d.timer=setTimeout(function(){d.verbose("DOM tree modified, updating sticky menu"),d.refresh()},20)}),u.observe(P,{childList:!0,subtree:!0}),u.observe(e,{childList:!0,subtree:!0}),d.debug("Setting up mutation observer",u))},determineContext:function(){return s=h.context?e(h.context):y,0===s.length?void d.error(p.invalidContext,h.context,C):void 0},checkErrors:function(){return d.is.hidden()&&d.error(p.visible,C),d.cache.element.height>d.cache.context.height?(d.reset(),void d.error(p.elementSize,C)):void 0},bind:{events:function(){k.on("resize"+v,d.event.resize),S.on("scroll"+v,d.event.scroll)}},event:{resize:function(){w(function(){d.refresh(),d.stick()})},scroll:function(){w(function(){d.stick(),h.onScroll.call(P)})}},refresh:function(e){d.reset(),e&&(y=C.offsetParent()),d.save.positions(),d.stick(),h.onReposition.call(P)},supports:{sticky:function(){{var t=e("<div/>");t.get()}return t.addClass(b.supported),t.css("position").match("sticky")}},save:{scroll:function(e){d.lastScroll=e},positions:function(){var e={height:k.height()},t={margin:{top:parseInt(C.css("margin-top"),10),bottom:parseInt(C.css("margin-bottom"),10)},offset:C.offset(),width:C.outerWidth(),height:C.outerHeight()},o={offset:s.offset(),height:s.outerHeight(),bottomPadding:parseInt(s.css("padding-bottom"),10)};d.cache={fits:t.height<e.height,window:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:o.offset.top,height:o.height,bottomPadding:o.bottomPadding,bottom:o.offset.top+o.height-o.bottomPadding}},d.set.containerSize(),d.set.size(),d.stick(),d.debug("Caching element positions",d.cache)}},get:{direction:function(e){var t="down";return e=e||S.scrollTop(),d.lastScroll!==n&&(d.lastScroll<e?t="down":d.lastScroll>e&&(t="up")),t},scrollChange:function(e){return e=e||S.scrollTop(),d.lastScroll?e-d.lastScroll:0},currentElementScroll:function(){return d.is.top()?Math.abs(parseInt(C.css("top"),10))||0:Math.abs(parseInt(C.css("bottom"),10))||0},elementScroll:function(e){e=e||S.scrollTop();var t,o=d.cache.element,n=d.cache.window,i=d.get.scrollChange(e),s=o.height-n.height+h.offset,c=d.get.currentElementScroll(),r=c+i;return t=d.cache.fits||0>r?0:r>s?s:r}},remove:{offset:function(){C.css("margin-top","")}},set:{offset:function(){d.verbose("Setting offset on element",h.offset),C.css("margin-top",h.offset)},containerSize:function(){var e=y.get(0).tagName;"HTML"===e||"body"==e?y=C.offsetParent():(d.debug("Settings container size",d.cache.context.height),Math.abs(y.height()-d.cache.context.height)>5&&y.css({height:d.cache.context.height}))},scroll:function(e){d.debug("Setting scroll on element",e),d.is.top()&&C.css("bottom","").css("top",-e),d.is.bottom()&&C.css("top","").css("bottom",e)},size:function(){0!==d.cache.element.height&&0!==d.cache.element.width&&C.css({width:d.cache.element.width,height:d.cache.element.height})}},is:{top:function(){return C.hasClass(b.top)},bottom:function(){return C.hasClass(b.bottom)},initialPosition:function(){return!d.is.fixed()&&!d.is.bound()},hidden:function(){return!C.is(":visible")},bound:function(){return C.hasClass(b.bound)},fixed:function(){return C.hasClass(b.fixed)}},stick:function(){var e=d.cache,t=e.fits,o=e.element,n=e.window,i=e.context,s=d.is.bottom()&&h.pushing?h.bottomOffset:h.offset,c={top:S.scrollTop()+s,bottom:S.scrollTop()+s+n.height},r=(d.get.direction(c.top),d.get.elementScroll(c.top)),a=!t,l=0!==o.height;d.save.scroll(c.top),l&&(d.is.initialPosition()?c.top>=i.bottom?(console.log(c.top,i.bottom),d.debug("Element bottom of container"),d.bindBottom()):c.top>=o.top&&(d.debug("Element passed, fixing element to page"),d.fixTop()):d.is.fixed()?d.is.top()?c.top<o.top?(d.debug("Fixed element reached top of container"),d.setInitialPosition()):o.height+c.top-r>i.bottom?(d.debug("Fixed element reached bottom of container"),d.bindBottom()):a&&d.set.scroll(r):d.is.bottom()&&(c.bottom-o.height<o.top?(d.debug("Bottom fixed rail has reached top of container"),d.setInitialPosition()):c.bottom>i.bottom?(d.debug("Bottom fixed rail has reached bottom of container"),d.bindBottom()):a&&d.set.scroll(r)):d.is.bottom()&&(h.pushing?d.is.bound()&&c.bottom<i.bottom&&(d.debug("Fixing bottom attached element to bottom of browser."),d.fixBottom()):d.is.bound()&&c.top<i.bottom-o.height&&(d.debug("Fixing bottom attached element to top of browser."),d.fixTop())))},bindTop:function(){d.debug("Binding element to top of parent container"),d.remove.offset(),C.css("left","").css("top","").css("margin-bottom","").removeClass(b.fixed).removeClass(b.bottom).addClass(b.bound).addClass(b.top),h.onTop.call(P),h.onUnstick.call(P)},bindBottom:function(){d.debug("Binding element to bottom of parent container"),d.remove.offset(),C.css("left","").css("top","").css("margin-bottom",d.cache.context.bottomPadding).removeClass(b.fixed).removeClass(b.top).addClass(b.bound).addClass(b.bottom),h.onBottom.call(P),h.onUnstick.call(P)},setInitialPosition:function(){d.unfix(),d.unbind()},fixTop:function(){d.debug("Fixing element to top of page"),d.set.offset(),C.css("left",d.cache.element.left).css("bottom","").removeClass(b.bound).removeClass(b.bottom).addClass(b.fixed).addClass(b.top),h.onStick.call(P)},fixBottom:function(){d.debug("Sticking element to bottom of page"),d.set.offset(),C.css("left",d.cache.element.left).css("bottom","").removeClass(b.bound).removeClass(b.top).addClass(b.fixed).addClass(b.bottom),h.onStick.call(P)},unbind:function(){d.debug("Removing absolute position on element"),d.remove.offset(),C.removeClass(b.bound).removeClass(b.top).removeClass(b.bottom)},unfix:function(){d.debug("Removing fixed position on element"),d.remove.offset(),C.removeClass(b.fixed).removeClass(b.top).removeClass(b.bottom),h.onUnstick.call(P)},reset:function(){d.debug("Reseting elements position"),d.unbind(),d.unfix(),d.resetCSS()},resetCSS:function(){C.css({top:"",bottom:"",width:"",height:""}),y.css({height:""})},setting:function(t,o){if(e.isPlainObject(t))e.extend(!0,h,t);else{if(o===n)return h[t];h[t]=o}},internal:function(t,o){if(e.isPlainObject(t))e.extend(!0,d,t);else{if(o===n)return d[t];d[t]=o}},debug:function(){h.debug&&(h.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,h.name+":"),d.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),d.verbose.apply(console,arguments)))},error:function(){d.error=Function.prototype.bind.call(console.error,console,h.name+":"),d.error.apply(console,arguments)},performance:{log:function(e){var t,o,n;h.performance&&(t=(new Date).getTime(),n=r||t,o=t-n,r=t,a.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":o})),clearTimeout(d.performance.timer),d.performance.timer=setTimeout(d.performance.display,0)},display:function(){var t=h.name+":",o=0;r=!1,clearTimeout(d.performance.timer),e.each(a,function(e,t){o+=t["Execution Time"]}),t+=" "+o+"ms",c&&(t+=" '"+c+"'"),(console.group!==n||console.table!==n)&&a.length>0&&(console.groupCollapsed(t),console.table?console.table(a):e.each(a,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),a=[]}},invoke:function(t,o,s){var c,r,a,l=T;return o=o||f,s=P||s,"string"==typeof t&&l!==n&&(t=t.split(/[\. ]/),c=t.length-1,e.each(t,function(o,i){var s=o!=c?i+t[o+1].charAt(0).toUpperCase()+t[o+1].slice(1):t;if(e.isPlainObject(l[s])&&o!=c)l=l[s];else{if(l[s]!==n)return r=l[s],!1;if(!e.isPlainObject(l[i])||o==c)return l[i]!==n?(r=l[i],!1):!1;l=l[i]}})),e.isFunction(r)?a=r.apply(s,o):r!==n&&(a=r),e.isArray(i)?i.push(a):i!==n?i=[i,a]:a!==n&&(i=a),r}},m?(T===n&&d.initialize(),d.invoke(l)):(T!==n&&T.invoke("destroy"),d.initialize())}),i!==n?i:this},e.fn.sticky.settings={name:"Sticky",namespace:"sticky",debug:!1,verbose:!1,performance:!1,pushing:!1,context:!1,scrollContext:t,offset:0,bottomOffset:0,observeChanges:!0,onReposition:function(){},onScroll:function(){},onStick:function(){},onUnstick:function(){},onTop:function(){},onBottom:function(){},error:{container:"Sticky element must be inside a relative container",visible:"Element is hidden, you must call refresh after element becomes visible",method:"The method you called is not defined.",invalidContext:"Context specified does not exist",elementSize:"Sticky element is larger than its container, cannot create sticky."},className:{bound:"bound",fixed:"fixed",supported:"native",top:"top",bottom:"bottom"}}}(jQuery,window,document);
@@ -0,0 +1,92 @@
1
+ /*!
2
+ * # Semantic UI 1.11.4 - Tab
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2014 Contributors
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+
12
+
13
+ /*******************************
14
+ UI Tabs
15
+ *******************************/
16
+
17
+ .ui.tab {
18
+ display: none;
19
+ }
20
+
21
+
22
+ /*******************************
23
+ States
24
+ *******************************/
25
+
26
+
27
+ /*--------------------
28
+ Active
29
+ ---------------------*/
30
+
31
+ .ui.tab.active,
32
+ .ui.tab.open {
33
+ display: block;
34
+ }
35
+
36
+ /*--------------------
37
+ Loading
38
+ ---------------------*/
39
+
40
+ .ui.tab.loading {
41
+ position: relative;
42
+ overflow: hidden;
43
+ display: block;
44
+ min-height: 250px;
45
+ }
46
+ .ui.tab.loading * {
47
+ position: relative !important;
48
+ left: -10000px !important;
49
+ }
50
+ .ui.tab.loading:before,
51
+ .ui.tab.loading.segment:before {
52
+ position: absolute;
53
+ content: '';
54
+ top: 100px;
55
+ left: 50%;
56
+ margin: -1.25em 0em 0em -1.25em;
57
+ width: 2.5em;
58
+ height: 2.5em;
59
+ border-radius: 500rem;
60
+ border: 0.2em solid rgba(0, 0, 0, 0.1);
61
+ }
62
+ .ui.tab.loading:after,
63
+ .ui.tab.loading.segment:after {
64
+ position: absolute;
65
+ content: '';
66
+ top: 100px;
67
+ left: 50%;
68
+ margin: -1.25em 0em 0em -1.25em;
69
+ width: 2.5em;
70
+ height: 2.5em;
71
+ -webkit-animation: button-spin 0.6s linear;
72
+ animation: button-spin 0.6s linear;
73
+ -webkit-animation-iteration-count: infinite;
74
+ animation-iteration-count: infinite;
75
+ border-radius: 500rem;
76
+ border-color: #aaaaaa transparent transparent;
77
+ border-style: solid;
78
+ border-width: 0.2em;
79
+ box-shadow: 0px 0px 0px 1px transparent;
80
+ }
81
+
82
+
83
+ /*******************************
84
+ Tab Overrides
85
+ *******************************/
86
+
87
+
88
+
89
+ /*******************************
90
+ User Overrides
91
+ *******************************/
92
+
@@ -0,0 +1,802 @@
1
+ /*!
2
+ * # Semantic UI 1.11.4 - Tab
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2014 Contributorss
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+
12
+ ;(function ($, window, document, undefined) {
13
+
14
+ "use strict";
15
+
16
+ $.fn.tab = function(parameters) {
17
+
18
+ var
19
+ // use window context if none specified
20
+ $allModules = $.isFunction(this)
21
+ ? $(window)
22
+ : $(this),
23
+
24
+ settings = ( $.isPlainObject(parameters) )
25
+ ? $.extend(true, {}, $.fn.tab.settings, parameters)
26
+ : $.extend({}, $.fn.tab.settings),
27
+
28
+ moduleSelector = $allModules.selector || '',
29
+ time = new Date().getTime(),
30
+ performance = [],
31
+
32
+ query = arguments[0],
33
+ methodInvoked = (typeof query == 'string'),
34
+ queryArguments = [].slice.call(arguments, 1),
35
+
36
+ module,
37
+ returnedValue
38
+ ;
39
+
40
+ $allModules
41
+ .each(function() {
42
+ var
43
+
44
+ className = settings.className,
45
+ metadata = settings.metadata,
46
+ selector = settings.selector,
47
+ error = settings.error,
48
+
49
+ eventNamespace = '.' + settings.namespace,
50
+ moduleNamespace = 'module-' + settings.namespace,
51
+
52
+ $module = $(this),
53
+
54
+ cache = {},
55
+ firstLoad = true,
56
+ recursionDepth = 0,
57
+
58
+ $context,
59
+ $tabs,
60
+ activeTabPath,
61
+ parameterArray,
62
+ historyEvent,
63
+
64
+ element = this,
65
+ instance = $module.data(moduleNamespace)
66
+ ;
67
+
68
+ module = {
69
+
70
+ initialize: function() {
71
+ module.debug('Initializing tab menu item', $module);
72
+
73
+ module.determineTabs();
74
+ module.debug('Determining tabs', settings.context, $tabs);
75
+
76
+ // set up automatic routing
77
+ if(settings.auto) {
78
+ module.set.auto();
79
+ }
80
+
81
+ // attach events if navigation wasn't set to window
82
+ if( !$.isWindow( element ) ) {
83
+ module.debug('Attaching tab activation events to element', $module);
84
+ $module
85
+ .on('click' + eventNamespace, module.event.click)
86
+ ;
87
+ }
88
+ module.instantiate();
89
+ },
90
+
91
+ determineTabs: function() {
92
+ var
93
+ $reference
94
+ ;
95
+
96
+ // determine tab context
97
+ if(settings.context === 'parent') {
98
+ if($module.closest(selector.ui).length > 0) {
99
+ $reference = $module.closest(selector.ui);
100
+ module.verbose('Using closest UI element for determining parent', $reference);
101
+ }
102
+ else {
103
+ $reference = $module;
104
+ }
105
+ $context = $reference.parent();
106
+ module.verbose('Determined parent element for creating context', $context);
107
+ }
108
+ else if(settings.context) {
109
+ $context = $(settings.context);
110
+ module.verbose('Using selector for tab context', settings.context, $context);
111
+ }
112
+ else {
113
+ $context = $('body');
114
+ }
115
+
116
+ // find tabs
117
+ if(settings.childrenOnly) {
118
+ $tabs = $context.children(selector.tabs);
119
+ module.debug('Searching tab context children for tabs', $context, $tabs);
120
+ }
121
+ else {
122
+ $tabs = $context.find(selector.tabs);
123
+ module.debug('Searching tab context for tabs', $context, $tabs);
124
+ }
125
+ },
126
+
127
+ initializeHistory: function() {
128
+ if(settings.history) {
129
+ module.debug('Initializing page state');
130
+ if( $.address === undefined ) {
131
+ module.error(error.state);
132
+ return false;
133
+ }
134
+ else {
135
+ if(settings.historyType == 'state') {
136
+ module.debug('Using HTML5 to manage state');
137
+ if(settings.path !== false) {
138
+ $.address
139
+ .history(true)
140
+ .state(settings.path)
141
+ ;
142
+ }
143
+ else {
144
+ module.error(error.path);
145
+ return false;
146
+ }
147
+ }
148
+ $.address
149
+ .bind('change', module.event.history.change)
150
+ ;
151
+ }
152
+ }
153
+ },
154
+
155
+ instantiate: function () {
156
+ module.verbose('Storing instance of module', module);
157
+ instance = module;
158
+ $module
159
+ .data(moduleNamespace, module)
160
+ ;
161
+ },
162
+
163
+ destroy: function() {
164
+ module.debug('Destroying tabs', $module);
165
+ $module
166
+ .removeData(moduleNamespace)
167
+ .off(eventNamespace)
168
+ ;
169
+ },
170
+
171
+ event: {
172
+ click: function(event) {
173
+ var
174
+ tabPath = $(this).data(metadata.tab)
175
+ ;
176
+ if(tabPath !== undefined) {
177
+ if(settings.history) {
178
+ module.verbose('Updating page state', event);
179
+ $.address.value(tabPath);
180
+ }
181
+ else {
182
+ module.verbose('Changing tab', event);
183
+ module.changeTab(tabPath);
184
+ }
185
+ event.preventDefault();
186
+ }
187
+ else {
188
+ module.debug('No tab specified');
189
+ }
190
+ },
191
+ history: {
192
+ change: function(event) {
193
+ var
194
+ tabPath = event.pathNames.join('/') || module.get.initialPath(),
195
+ pageTitle = settings.templates.determineTitle(tabPath) || false
196
+ ;
197
+ module.performance.display();
198
+ module.debug('History change event', tabPath, event);
199
+ historyEvent = event;
200
+ if(tabPath !== undefined) {
201
+ module.changeTab(tabPath);
202
+ }
203
+ if(pageTitle) {
204
+ $.address.title(pageTitle);
205
+ }
206
+ }
207
+ }
208
+ },
209
+
210
+ refresh: function() {
211
+ if(activeTabPath) {
212
+ module.debug('Refreshing tab', activeTabPath);
213
+ module.changeTab(activeTabPath);
214
+ }
215
+ },
216
+
217
+ cache: {
218
+
219
+ read: function(cacheKey) {
220
+ return (cacheKey !== undefined)
221
+ ? cache[cacheKey]
222
+ : false
223
+ ;
224
+ },
225
+ add: function(cacheKey, content) {
226
+ cacheKey = cacheKey || activeTabPath;
227
+ module.debug('Adding cached content for', cacheKey);
228
+ cache[cacheKey] = content;
229
+ },
230
+ remove: function(cacheKey) {
231
+ cacheKey = cacheKey || activeTabPath;
232
+ module.debug('Removing cached content for', cacheKey);
233
+ delete cache[cacheKey];
234
+ }
235
+ },
236
+
237
+ set: {
238
+ auto: function() {
239
+ var
240
+ url = (typeof settings.path == 'string')
241
+ ? settings.path.replace(/\/$/, '') + '/{$tab}'
242
+ : '/{$tab}'
243
+ ;
244
+ module.verbose('Setting up automatic tab retrieval from server', url);
245
+ if($.isPlainObject(settings.apiSettings)) {
246
+ settings.apiSettings.url = url;
247
+ }
248
+ else {
249
+ settings.apiSettings = {
250
+ url: url
251
+ };
252
+ }
253
+ },
254
+ state: function(state) {
255
+ $.address.value(state);
256
+ }
257
+ },
258
+
259
+ changeTab: function(tabPath) {
260
+ var
261
+ pushStateAvailable = (window.history && window.history.pushState),
262
+ shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
263
+ remoteContent = (settings.auto || $.isPlainObject(settings.apiSettings) ),
264
+ // only get default path if not remote content
265
+ pathArray = (remoteContent && !shouldIgnoreLoad)
266
+ ? module.utilities.pathToArray(tabPath)
267
+ : module.get.defaultPathArray(tabPath)
268
+ ;
269
+ tabPath = module.utilities.arrayToPath(pathArray);
270
+ $.each(pathArray, function(index, tab) {
271
+ var
272
+ currentPathArray = pathArray.slice(0, index + 1),
273
+ currentPath = module.utilities.arrayToPath(currentPathArray),
274
+
275
+ isTab = module.is.tab(currentPath),
276
+ isLastIndex = (index + 1 == pathArray.length),
277
+
278
+ $tab = module.get.tabElement(currentPath),
279
+ $anchor,
280
+ nextPathArray,
281
+ nextPath,
282
+ isLastTab
283
+ ;
284
+ module.verbose('Looking for tab', tab);
285
+ if(isTab) {
286
+
287
+ module.verbose('Tab was found', tab);
288
+ // scope up
289
+ activeTabPath = currentPath;
290
+ parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
291
+
292
+ if(isLastIndex) {
293
+ isLastTab = true;
294
+ }
295
+ else {
296
+ nextPathArray = pathArray.slice(0, index + 2);
297
+ nextPath = module.utilities.arrayToPath(nextPathArray);
298
+ isLastTab = ( !module.is.tab(nextPath) );
299
+ if(isLastTab) {
300
+ module.verbose('Tab parameters found', nextPathArray);
301
+ }
302
+ }
303
+ if(isLastTab && remoteContent) {
304
+ if(!shouldIgnoreLoad) {
305
+ module.activate.navigation(currentPath);
306
+ module.content.fetch(currentPath, tabPath);
307
+ }
308
+ else {
309
+ module.debug('Ignoring remote content on first tab load', currentPath);
310
+ firstLoad = false;
311
+ module.cache.add(tabPath, $tab.html());
312
+ module.activate.all(currentPath);
313
+ settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
314
+ settings.onTabLoad.call($tab, currentPath, parameterArray, historyEvent);
315
+ }
316
+ return false;
317
+ }
318
+ else {
319
+ module.debug('Opened local tab', currentPath);
320
+ module.activate.all(currentPath);
321
+ if( !module.cache.read(currentPath) ) {
322
+ module.cache.add(currentPath, true);
323
+ module.debug('First time tab loaded calling tab init');
324
+ settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
325
+ }
326
+ settings.onTabLoad.call($tab, currentPath, parameterArray, historyEvent);
327
+ }
328
+ }
329
+ else if(tabPath.search('/') == -1 && tabPath !== '') {
330
+ // look for in page anchor
331
+ $anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'),
332
+ currentPath = $anchor.closest('[data-tab]').data('tab');
333
+ $tab = module.get.tabElement(currentPath);
334
+ // if anchor exists use parent tab
335
+ if($anchor && $anchor.length > 0 && currentPath) {
336
+ module.debug('No tab found, but deep anchor link present, opening parent tab');
337
+ module.activate.all(currentPath);
338
+ if( !module.cache.read(currentPath) ) {
339
+ module.cache.add(currentPath, true);
340
+ module.debug('First time tab loaded calling tab init');
341
+ settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
342
+ }
343
+ return false;
344
+ }
345
+ }
346
+ else {
347
+ module.error(error.missingTab, $module, $context, currentPath);
348
+ return false;
349
+ }
350
+ });
351
+ },
352
+
353
+ content: {
354
+
355
+ fetch: function(tabPath, fullTabPath) {
356
+ var
357
+ $tab = module.get.tabElement(tabPath),
358
+ apiSettings = {
359
+ dataType : 'html',
360
+ on : 'now',
361
+ onSuccess : function(response) {
362
+ module.cache.add(fullTabPath, response);
363
+ module.content.update(tabPath, response);
364
+ if(tabPath == activeTabPath) {
365
+ module.debug('Content loaded', tabPath);
366
+ module.activate.tab(tabPath);
367
+ }
368
+ else {
369
+ module.debug('Content loaded in background', tabPath);
370
+ }
371
+ settings.onTabInit.call($tab, tabPath, parameterArray, historyEvent);
372
+ settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
373
+ },
374
+ urlData: { tab: fullTabPath }
375
+ },
376
+ request = $tab.api('get request') || false,
377
+ existingRequest = ( request && request.state() === 'pending' ),
378
+ requestSettings,
379
+ cachedContent
380
+ ;
381
+
382
+ fullTabPath = fullTabPath || tabPath;
383
+ cachedContent = module.cache.read(fullTabPath);
384
+
385
+
386
+ module.activate.tab(tabPath);
387
+
388
+ if(settings.cache && cachedContent) {
389
+ module.debug('Showing existing content', fullTabPath);
390
+ module.content.update(tabPath, cachedContent);
391
+ settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
392
+ }
393
+ else if(existingRequest) {
394
+ module.debug('Content is already loading', fullTabPath);
395
+ $tab.addClass(className.loading);
396
+ }
397
+ else if($.api !== undefined) {
398
+ requestSettings = $.extend(true, {
399
+ headers: { 'X-Remote': true }
400
+ }, settings.apiSettings, apiSettings);
401
+ module.debug('Retrieving remote content', fullTabPath, requestSettings);
402
+ $tab.api( requestSettings );
403
+ }
404
+ else {
405
+ module.error(error.api);
406
+ }
407
+ },
408
+
409
+ update: function(tabPath, html) {
410
+ module.debug('Updating html for', tabPath);
411
+ var
412
+ $tab = module.get.tabElement(tabPath)
413
+ ;
414
+ $tab
415
+ .html(html)
416
+ ;
417
+ }
418
+ },
419
+
420
+ activate: {
421
+ all: function(tabPath) {
422
+ module.activate.tab(tabPath);
423
+ module.activate.navigation(tabPath);
424
+ },
425
+ tab: function(tabPath) {
426
+ var
427
+ $tab = module.get.tabElement(tabPath)
428
+ ;
429
+ module.verbose('Showing tab content for', $tab);
430
+ $tab
431
+ .addClass(className.active)
432
+ .siblings($tabs)
433
+ .removeClass(className.active + ' ' + className.loading)
434
+ ;
435
+ },
436
+ navigation: function(tabPath) {
437
+ var
438
+ $navigation = module.get.navElement(tabPath)
439
+ ;
440
+ module.verbose('Activating tab navigation for', $navigation, tabPath);
441
+ $navigation
442
+ .addClass(className.active)
443
+ .siblings($allModules)
444
+ .removeClass(className.active + ' ' + className.loading)
445
+ ;
446
+ }
447
+ },
448
+
449
+ deactivate: {
450
+ all: function() {
451
+ module.deactivate.navigation();
452
+ module.deactivate.tabs();
453
+ },
454
+ navigation: function() {
455
+ $allModules
456
+ .removeClass(className.active)
457
+ ;
458
+ },
459
+ tabs: function() {
460
+ $tabs
461
+ .removeClass(className.active + ' ' + className.loading)
462
+ ;
463
+ }
464
+ },
465
+
466
+ is: {
467
+ tab: function(tabName) {
468
+ return (tabName !== undefined)
469
+ ? ( module.get.tabElement(tabName).length > 0 )
470
+ : false
471
+ ;
472
+ }
473
+ },
474
+
475
+ get: {
476
+ initialPath: function() {
477
+ return $allModules.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
478
+ },
479
+ path: function() {
480
+ return $.address.value();
481
+ },
482
+ // adds default tabs to tab path
483
+ defaultPathArray: function(tabPath) {
484
+ return module.utilities.pathToArray( module.get.defaultPath(tabPath) );
485
+ },
486
+ defaultPath: function(tabPath) {
487
+ var
488
+ $defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + tabPath + '/"]').eq(0),
489
+ defaultTab = $defaultNav.data(metadata.tab) || false
490
+ ;
491
+ if( defaultTab ) {
492
+ module.debug('Found default tab', defaultTab);
493
+ if(recursionDepth < settings.maxDepth) {
494
+ recursionDepth++;
495
+ return module.get.defaultPath(defaultTab);
496
+ }
497
+ module.error(error.recursion);
498
+ }
499
+ else {
500
+ module.debug('No default tabs found for', tabPath, $tabs);
501
+ }
502
+ recursionDepth = 0;
503
+ return tabPath;
504
+ },
505
+ navElement: function(tabPath) {
506
+ tabPath = tabPath || activeTabPath;
507
+ return $allModules.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
508
+ },
509
+ tabElement: function(tabPath) {
510
+ var
511
+ $fullPathTab,
512
+ $simplePathTab,
513
+ tabPathArray,
514
+ lastTab
515
+ ;
516
+ tabPath = tabPath || activeTabPath;
517
+ tabPathArray = module.utilities.pathToArray(tabPath);
518
+ lastTab = module.utilities.last(tabPathArray);
519
+ $fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + lastTab + '"]');
520
+ $simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
521
+ return ($fullPathTab.length > 0)
522
+ ? $fullPathTab
523
+ : $simplePathTab
524
+ ;
525
+ },
526
+ tab: function() {
527
+ return activeTabPath;
528
+ }
529
+ },
530
+
531
+ utilities: {
532
+ filterArray: function(keepArray, removeArray) {
533
+ return $.grep(keepArray, function(keepValue) {
534
+ return ( $.inArray(keepValue, removeArray) == -1);
535
+ });
536
+ },
537
+ last: function(array) {
538
+ return $.isArray(array)
539
+ ? array[ array.length - 1]
540
+ : false
541
+ ;
542
+ },
543
+ pathToArray: function(pathName) {
544
+ if(pathName === undefined) {
545
+ pathName = activeTabPath;
546
+ }
547
+ return typeof pathName == 'string'
548
+ ? pathName.split('/')
549
+ : [pathName]
550
+ ;
551
+ },
552
+ arrayToPath: function(pathArray) {
553
+ return $.isArray(pathArray)
554
+ ? pathArray.join('/')
555
+ : false
556
+ ;
557
+ }
558
+ },
559
+
560
+ setting: function(name, value) {
561
+ module.debug('Changing setting', name, value);
562
+ if( $.isPlainObject(name) ) {
563
+ $.extend(true, settings, name);
564
+ }
565
+ else if(value !== undefined) {
566
+ settings[name] = value;
567
+ }
568
+ else {
569
+ return settings[name];
570
+ }
571
+ },
572
+ internal: function(name, value) {
573
+ if( $.isPlainObject(name) ) {
574
+ $.extend(true, module, name);
575
+ }
576
+ else if(value !== undefined) {
577
+ module[name] = value;
578
+ }
579
+ else {
580
+ return module[name];
581
+ }
582
+ },
583
+ debug: function() {
584
+ if(settings.debug) {
585
+ if(settings.performance) {
586
+ module.performance.log(arguments);
587
+ }
588
+ else {
589
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
590
+ module.debug.apply(console, arguments);
591
+ }
592
+ }
593
+ },
594
+ verbose: function() {
595
+ if(settings.verbose && settings.debug) {
596
+ if(settings.performance) {
597
+ module.performance.log(arguments);
598
+ }
599
+ else {
600
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
601
+ module.verbose.apply(console, arguments);
602
+ }
603
+ }
604
+ },
605
+ error: function() {
606
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
607
+ module.error.apply(console, arguments);
608
+ },
609
+ performance: {
610
+ log: function(message) {
611
+ var
612
+ currentTime,
613
+ executionTime,
614
+ previousTime
615
+ ;
616
+ if(settings.performance) {
617
+ currentTime = new Date().getTime();
618
+ previousTime = time || currentTime;
619
+ executionTime = currentTime - previousTime;
620
+ time = currentTime;
621
+ performance.push({
622
+ 'Name' : message[0],
623
+ 'Arguments' : [].slice.call(message, 1) || '',
624
+ 'Element' : element,
625
+ 'Execution Time' : executionTime
626
+ });
627
+ }
628
+ clearTimeout(module.performance.timer);
629
+ module.performance.timer = setTimeout(module.performance.display, 100);
630
+ },
631
+ display: function() {
632
+ var
633
+ title = settings.name + ':',
634
+ totalTime = 0
635
+ ;
636
+ time = false;
637
+ clearTimeout(module.performance.timer);
638
+ $.each(performance, function(index, data) {
639
+ totalTime += data['Execution Time'];
640
+ });
641
+ title += ' ' + totalTime + 'ms';
642
+ if(moduleSelector) {
643
+ title += ' \'' + moduleSelector + '\'';
644
+ }
645
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
646
+ console.groupCollapsed(title);
647
+ if(console.table) {
648
+ console.table(performance);
649
+ }
650
+ else {
651
+ $.each(performance, function(index, data) {
652
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
653
+ });
654
+ }
655
+ console.groupEnd();
656
+ }
657
+ performance = [];
658
+ }
659
+ },
660
+ invoke: function(query, passedArguments, context) {
661
+ var
662
+ object = instance,
663
+ maxDepth,
664
+ found,
665
+ response
666
+ ;
667
+ passedArguments = passedArguments || queryArguments;
668
+ context = element || context;
669
+ if(typeof query == 'string' && object !== undefined) {
670
+ query = query.split(/[\. ]/);
671
+ maxDepth = query.length - 1;
672
+ $.each(query, function(depth, value) {
673
+ var camelCaseValue = (depth != maxDepth)
674
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
675
+ : query
676
+ ;
677
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
678
+ object = object[camelCaseValue];
679
+ }
680
+ else if( object[camelCaseValue] !== undefined ) {
681
+ found = object[camelCaseValue];
682
+ return false;
683
+ }
684
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
685
+ object = object[value];
686
+ }
687
+ else if( object[value] !== undefined ) {
688
+ found = object[value];
689
+ return false;
690
+ }
691
+ else {
692
+ module.error(error.method, query);
693
+ return false;
694
+ }
695
+ });
696
+ }
697
+ if ( $.isFunction( found ) ) {
698
+ response = found.apply(context, passedArguments);
699
+ }
700
+ else if(found !== undefined) {
701
+ response = found;
702
+ }
703
+ if($.isArray(returnedValue)) {
704
+ returnedValue.push(response);
705
+ }
706
+ else if(returnedValue !== undefined) {
707
+ returnedValue = [returnedValue, response];
708
+ }
709
+ else if(response !== undefined) {
710
+ returnedValue = response;
711
+ }
712
+ return found;
713
+ }
714
+ };
715
+ if(methodInvoked) {
716
+ if(instance === undefined) {
717
+ module.initialize();
718
+ }
719
+ module.invoke(query);
720
+ }
721
+ else {
722
+ if(instance !== undefined) {
723
+ instance.invoke('destroy');
724
+ }
725
+ module.initialize();
726
+ }
727
+ })
728
+ ;
729
+ if(module && !methodInvoked) {
730
+ module.initializeHistory();
731
+ }
732
+ return (returnedValue !== undefined)
733
+ ? returnedValue
734
+ : this
735
+ ;
736
+
737
+ };
738
+
739
+ // shortcut for tabbed content with no defined navigation
740
+ $.tab = function() {
741
+ $(window).tab.apply(this, arguments);
742
+ };
743
+
744
+ $.fn.tab.settings = {
745
+
746
+ name : 'Tab',
747
+ namespace : 'tab',
748
+
749
+ debug : false,
750
+ verbose : true,
751
+ performance : true,
752
+
753
+ auto : false, // uses pjax style endpoints fetching content from same url with remote-content headers
754
+ history : false, // use browser history
755
+ historyType : 'hash', // #/ or html5 state
756
+ path : false, // base path of url
757
+
758
+ context : false, // specify a context that tabs must appear inside
759
+ childrenOnly : false, // use only tabs that are children of context
760
+ maxDepth : 25, // max depth a tab can be nested
761
+
762
+ alwaysRefresh : false, // load tab content new every tab click
763
+ cache : true, // cache the content requests to pull locally
764
+ ignoreFirstLoad : false, // don't load remote content on first load
765
+ apiSettings : false, // settings for api call
766
+
767
+ onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
768
+ onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
769
+
770
+ templates : {
771
+ determineTitle: function(tabArray) {} // returns page title for path
772
+ },
773
+
774
+ error: {
775
+ api : 'You attempted to load content without API module',
776
+ method : 'The method you called is not defined',
777
+ missingTab : 'Activated tab cannot be found for this context.',
778
+ noContent : 'The tab you specified is missing a content url.',
779
+ path : 'History enabled, but no path was specified',
780
+ recursion : 'Max recursive depth reached',
781
+ state : 'History requires Asual\'s Address library <https://github.com/asual/jquery-address>'
782
+ },
783
+
784
+ metadata : {
785
+ tab : 'tab',
786
+ loaded : 'loaded',
787
+ promise: 'promise'
788
+ },
789
+
790
+ className : {
791
+ loading : 'loading',
792
+ active : 'active'
793
+ },
794
+
795
+ selector : {
796
+ tabs : '.ui.tab',
797
+ ui : '.ui'
798
+ }
799
+
800
+ };
801
+
802
+ })( jQuery, window , document );