ns-styleguide 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +7 -0
  2. data/style-guide/_style-guide.scss +4 -0
  3. data/style-guide/global/_base.scss +33 -0
  4. data/style-guide/global/_colors.scss +24 -0
  5. data/style-guide/global/_extendables.scss +16 -0
  6. data/style-guide/global/_functions.scss +5 -0
  7. data/style-guide/global/_mixins.scss +5 -0
  8. data/style-guide/global/_variables.scss +15 -0
  9. data/templates/project/assets/6.jpg +0 -0
  10. data/templates/project/assets/_nsfont/_comment.svg +8 -0
  11. data/templates/project/assets/_nsfont/_default-user.svg +12 -0
  12. data/templates/project/assets/_nsfont/_home.svg +12 -0
  13. data/templates/project/assets/_nsfont/_notify.svg +13 -0
  14. data/templates/project/assets/_nsfont/_pillbox.svg +27 -0
  15. data/templates/project/assets/_nsfont/_search.svg +12 -0
  16. data/templates/project/assets/_nsfont/bs-circulatory.svg +26 -0
  17. data/templates/project/assets/_nsfont/bs-digestive.svg +28 -0
  18. data/templates/project/assets/_nsfont/bs-endocrine.svg +33 -0
  19. data/templates/project/assets/_nsfont/bs-immune.svg +31 -0
  20. data/templates/project/assets/_nsfont/bs-muscular-skeletal.svg +119 -0
  21. data/templates/project/assets/_nsfont/bs-nervous.svg +31 -0
  22. data/templates/project/assets/_nsfont/bs-reprodutive.svg +29 -0
  23. data/templates/project/assets/_nsfont/bs-respiratory.svg +17 -0
  24. data/templates/project/assets/_nsfont/ls-athletic.svg +17 -0
  25. data/templates/project/assets/_nsfont/ls-diet.svg +21 -0
  26. data/templates/project/assets/_nsfont/ls-energyvitality.svg +14 -0
  27. data/templates/project/assets/_nsfont/ls-mentalacuity.svg +34 -0
  28. data/templates/project/assets/_nsfont/ls-sexual.svg +42 -0
  29. data/templates/project/assets/_nsfont/ls-weightcontrol.svg +17 -0
  30. data/templates/project/assets/_nsfont/nsa-check.svg +7 -0
  31. data/templates/project/assets/_nsfont/nsa-questionmark.svg +15 -0
  32. data/templates/project/assets/_nsfont/nsa-xmark.svg +10 -0
  33. data/templates/project/assets/_nsfont/st-botanical.svg +18 -0
  34. data/templates/project/assets/_nsfont/st-food.svg +24 -0
  35. data/templates/project/assets/_nsfont/st-mineral.svg +15 -0
  36. data/templates/project/assets/_nsfont/st-other.svg +9 -0
  37. data/templates/project/assets/_nsfont/st-vitamin.svg +25 -0
  38. data/templates/project/assets/_nsfont/vote-down.svg +10 -0
  39. data/templates/project/assets/_nsfont/vote-up.svg +10 -0
  40. data/templates/project/assets/_nsfont/yp-age.svg +22 -0
  41. data/templates/project/assets/_nsfont/yp-gender.svg +16 -0
  42. data/templates/project/assets/_nsfont/yp-preventiontherapy.svg +109 -0
  43. data/templates/project/assets/aloe-vera.jpg +0 -0
  44. data/templates/project/assets/alzheimers-brainpuzzle-512.jpg +0 -0
  45. data/templates/project/assets/blurred1.jpg +0 -0
  46. data/templates/project/assets/blurred5.jpg +0 -0
  47. data/templates/project/assets/blurred6.jpg +0 -0
  48. data/templates/project/assets/botanical.svg +18 -0
  49. data/templates/project/assets/capsule.jpg +0 -0
  50. data/templates/project/assets/clouds.jpg +0 -0
  51. data/templates/project/assets/clouds.png +0 -0
  52. data/templates/project/assets/factorfiction-s3d0b80354a.png +0 -0
  53. data/templates/project/assets/factorfiction/factorfiction.png +0 -0
  54. data/templates/project/assets/factorfiction/factorfiction.svg +420 -0
  55. data/templates/project/assets/fff.png +0 -0
  56. data/templates/project/assets/food.svg +24 -0
  57. data/templates/project/assets/foundation/orbit/bullets.jpg +0 -0
  58. data/templates/project/assets/foundation/orbit/left-arrow-small.png +0 -0
  59. data/templates/project/assets/foundation/orbit/left-arrow.png +0 -0
  60. data/templates/project/assets/foundation/orbit/loading.gif +0 -0
  61. data/templates/project/assets/foundation/orbit/mask-black.png +0 -0
  62. data/templates/project/assets/foundation/orbit/pause-black.png +0 -0
  63. data/templates/project/assets/foundation/orbit/right-arrow-small.png +0 -0
  64. data/templates/project/assets/foundation/orbit/right-arrow.png +0 -0
  65. data/templates/project/assets/foundation/orbit/rotator-black.png +0 -0
  66. data/templates/project/assets/foundation/orbit/timer-black.png +0 -0
  67. data/templates/project/assets/glyphicons-halflings-white.png +0 -0
  68. data/templates/project/assets/glyphicons-halflings.png +0 -0
  69. data/templates/project/assets/hero.jpg +0 -0
  70. data/templates/project/assets/hero2.jpg +0 -0
  71. data/templates/project/assets/hero3.jpg +0 -0
  72. data/templates/project/assets/ice.jpg +0 -0
  73. data/templates/project/assets/iceberg.jpg +0 -0
  74. data/templates/project/assets/landing.jpg +0 -0
  75. data/templates/project/assets/mineral.svg +15 -0
  76. data/templates/project/assets/moon.jpg +0 -0
  77. data/templates/project/assets/ns-logo.svg +177 -0
  78. data/templates/project/assets/nslogo-s56b550b473.png +0 -0
  79. data/templates/project/assets/nslogo/nslogo.png +0 -0
  80. data/templates/project/assets/nslogo/nslogo.svg +177 -0
  81. data/templates/project/assets/other.svg +9 -0
  82. data/templates/project/assets/pillbox-hover.svg +33 -0
  83. data/templates/project/assets/pillbox-image.png +0 -0
  84. data/templates/project/assets/pillbox-image.svg +7880 -0
  85. data/templates/project/assets/pillbox.svg +27 -0
  86. data/templates/project/assets/rocket.jpg +0 -0
  87. data/templates/project/assets/shuttle.jpeg +0 -0
  88. data/templates/project/assets/svg/community-clear.svg +82 -0
  89. data/templates/project/assets/svg/community.svg +64 -0
  90. data/templates/project/assets/svg/conditions.svg +18 -0
  91. data/templates/project/assets/svg/experts.svg +32 -0
  92. data/templates/project/assets/svg/fact-or-fiction.svg +420 -0
  93. data/templates/project/assets/svg/lifestyle.svg +22 -0
  94. data/templates/project/assets/svg/perspective.svg +22 -0
  95. data/templates/project/assets/svg/supplements.svg +19 -0
  96. data/templates/project/assets/svgicons-s95620826ea.png +0 -0
  97. data/templates/project/assets/svgicons/community.png +0 -0
  98. data/templates/project/assets/svgicons/community.svg +55 -0
  99. data/templates/project/assets/svgicons/conditions.png +0 -0
  100. data/templates/project/assets/svgicons/conditions.svg +16 -0
  101. data/templates/project/assets/svgicons/experts.png +0 -0
  102. data/templates/project/assets/svgicons/experts.svg +30 -0
  103. data/templates/project/assets/svgicons/lifestyle.png +0 -0
  104. data/templates/project/assets/svgicons/lifestyle.svg +20 -0
  105. data/templates/project/assets/svgicons/supplements.png +0 -0
  106. data/templates/project/assets/svgicons/supplements.svg +17 -0
  107. data/templates/project/assets/svgicons/your-perspective.png +0 -0
  108. data/templates/project/assets/svgicons/your-perspective.svg +20 -0
  109. data/templates/project/assets/users/kp.jpg +0 -0
  110. data/templates/project/assets/video_placeholder.jpg +0 -0
  111. data/templates/project/assets/vitamin.svg +25 -0
  112. data/templates/project/component.json +9 -0
  113. data/templates/project/libs/bootstrap-modal.js +374 -0
  114. data/templates/project/libs/bootstrap/README.md +106 -0
  115. data/templates/project/libs/bootstrap/application.js +156 -0
  116. data/templates/project/libs/bootstrap/bootstrap-affix.js +117 -0
  117. data/templates/project/libs/bootstrap/bootstrap-alert.js +99 -0
  118. data/templates/project/libs/bootstrap/bootstrap-button.js +105 -0
  119. data/templates/project/libs/bootstrap/bootstrap-carousel.js +207 -0
  120. data/templates/project/libs/bootstrap/bootstrap-collapse.js +167 -0
  121. data/templates/project/libs/bootstrap/bootstrap-dropdown.js +165 -0
  122. data/templates/project/libs/bootstrap/bootstrap-modal.js +251 -0
  123. data/templates/project/libs/bootstrap/bootstrap-popover.js +114 -0
  124. data/templates/project/libs/bootstrap/bootstrap-scrollspy.js +162 -0
  125. data/templates/project/libs/bootstrap/bootstrap-tab.js +144 -0
  126. data/templates/project/libs/bootstrap/bootstrap-tooltip.js +361 -0
  127. data/templates/project/libs/bootstrap/bootstrap-transition.js +60 -0
  128. data/templates/project/libs/bootstrap/bootstrap-typeahead.js +335 -0
  129. data/templates/project/libs/bootstrap/bootstrap.js +2280 -0
  130. data/templates/project/libs/bootstrap/bootstrap.min.js +6 -0
  131. data/templates/project/libs/bootstrap/holder/holder.js +401 -0
  132. data/templates/project/libs/bootstrap/html5shiv.js +8 -0
  133. data/templates/project/libs/bootstrap/jquery.js +5 -0
  134. data/templates/project/libs/bootstrap/respond/respond.min.js +6 -0
  135. data/templates/project/libs/equalheights.js +46 -0
  136. data/templates/project/libs/foundation/foundation.alerts.js +50 -0
  137. data/templates/project/libs/foundation/foundation.clearing.js +516 -0
  138. data/templates/project/libs/foundation/foundation.cookie.js +74 -0
  139. data/templates/project/libs/foundation/foundation.dropdown.js +175 -0
  140. data/templates/project/libs/foundation/foundation.forms.js +513 -0
  141. data/templates/project/libs/foundation/foundation.joyride.js +831 -0
  142. data/templates/project/libs/foundation/foundation.js +401 -0
  143. data/templates/project/libs/foundation/foundation.magellan.js +130 -0
  144. data/templates/project/libs/foundation/foundation.orbit.js +373 -0
  145. data/templates/project/libs/foundation/foundation.placeholder.js +159 -0
  146. data/templates/project/libs/foundation/foundation.reveal.js +277 -0
  147. data/templates/project/libs/foundation/foundation.section.js +407 -0
  148. data/templates/project/libs/foundation/foundation.tooltips.js +200 -0
  149. data/templates/project/libs/foundation/foundation.topbar.js +245 -0
  150. data/templates/project/libs/hello.coffee +1 -0
  151. data/templates/project/libs/helper.js +385 -0
  152. data/templates/project/libs/jquery.magnific-popup.js +1783 -0
  153. data/templates/project/libs/jquery.magnific-popup.min.js +4 -0
  154. data/templates/project/libs/jquery.mixitup.min.js +43 -0
  155. data/templates/project/libs/main.js +1 -0
  156. data/templates/project/libs/ns.js +128 -0
  157. data/templates/project/libs/select2-3.4.0/README.md +83 -0
  158. data/templates/project/libs/select2-3.4.0/component.json +8 -0
  159. data/templates/project/libs/select2-3.4.0/release.sh +69 -0
  160. data/templates/project/libs/select2-3.4.0/select2-spinner.gif +0 -0
  161. data/templates/project/libs/select2-3.4.0/select2.css +652 -0
  162. data/templates/project/libs/select2-3.4.0/select2.jquery.json +36 -0
  163. data/templates/project/libs/select2-3.4.0/select2.js +3054 -0
  164. data/templates/project/libs/select2-3.4.0/select2.min.js +22 -0
  165. data/templates/project/libs/select2-3.4.0/select2.png +0 -0
  166. data/templates/project/libs/select2-3.4.0/select2_locale_ca.js +17 -0
  167. data/templates/project/libs/select2-3.4.0/select2_locale_cs.js +49 -0
  168. data/templates/project/libs/select2-3.4.0/select2_locale_da.js +17 -0
  169. data/templates/project/libs/select2-3.4.0/select2_locale_de.js +15 -0
  170. data/templates/project/libs/select2-3.4.0/select2_locale_en.js.template +17 -0
  171. data/templates/project/libs/select2-3.4.0/select2_locale_es.js +15 -0
  172. data/templates/project/libs/select2-3.4.0/select2_locale_et.js +17 -0
  173. data/templates/project/libs/select2-3.4.0/select2_locale_eu.js +43 -0
  174. data/templates/project/libs/select2-3.4.0/select2_locale_fr.js +15 -0
  175. data/templates/project/libs/select2-3.4.0/select2_locale_gl.js +43 -0
  176. data/templates/project/libs/select2-3.4.0/select2_locale_he.js +17 -0
  177. data/templates/project/libs/select2-3.4.0/select2_locale_hr.js +42 -0
  178. data/templates/project/libs/select2-3.4.0/select2_locale_hu.js +15 -0
  179. data/templates/project/libs/select2-3.4.0/select2_locale_is.js +16 -0
  180. data/templates/project/libs/select2-3.4.0/select2_locale_it.js +15 -0
  181. data/templates/project/libs/select2-3.4.0/select2_locale_ja.js +15 -0
  182. data/templates/project/libs/select2-3.4.0/select2_locale_lt.js +29 -0
  183. data/templates/project/libs/select2-3.4.0/select2_locale_lv.js +16 -0
  184. data/templates/project/libs/select2-3.4.0/select2_locale_mk.js +17 -0
  185. data/templates/project/libs/select2-3.4.0/select2_locale_nl.js +15 -0
  186. data/templates/project/libs/select2-3.4.0/select2_locale_no.js +18 -0
  187. data/templates/project/libs/select2-3.4.0/select2_locale_pl.js +37 -0
  188. data/templates/project/libs/select2-3.4.0/select2_locale_pt-BR.js +15 -0
  189. data/templates/project/libs/select2-3.4.0/select2_locale_pt-PT.js +15 -0
  190. data/templates/project/libs/select2-3.4.0/select2_locale_ro.js +15 -0
  191. data/templates/project/libs/select2-3.4.0/select2_locale_ru.js +15 -0
  192. data/templates/project/libs/select2-3.4.0/select2_locale_sk.js +48 -0
  193. data/templates/project/libs/select2-3.4.0/select2_locale_sv.js +17 -0
  194. data/templates/project/libs/select2-3.4.0/select2_locale_tr.js +17 -0
  195. data/templates/project/libs/select2-3.4.0/select2_locale_ua.js +17 -0
  196. data/templates/project/libs/select2-3.4.0/select2_locale_vi.js +18 -0
  197. data/templates/project/libs/select2-3.4.0/select2_locale_zh-CN.js +14 -0
  198. data/templates/project/libs/select2-3.4.0/select2_locale_zh-TW.js +14 -0
  199. data/templates/project/libs/select2-3.4.0/select2x2.png +0 -0
  200. data/templates/project/libs/vendor/modernizr-2.6.2.min.js +4 -0
  201. data/templates/project/libs/vendor/zepto.js +1884 -0
  202. data/templates/project/libs/vendor/zepto.min.js +2 -0
  203. data/templates/project/manifest.rb +9 -0
  204. data/templates/project/style.scss.erb +2 -0
  205. metadata +288 -0
@@ -0,0 +1,106 @@
1
+ ## 2.0 BOOTSTRAP JS PHILOSOPHY
2
+ These are the high-level design rules which guide the development of Bootstrap's plugin apis.
3
+
4
+ ---
5
+
6
+ ### DATA-ATTRIBUTE API
7
+
8
+ We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript.
9
+
10
+ We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
11
+
12
+ $('body').off('.data-api')
13
+
14
+ To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
15
+
16
+ $('body').off('.alert.data-api')
17
+
18
+ ---
19
+
20
+ ### PROGRAMMATIC API
21
+
22
+ We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API.
23
+
24
+ All public APIs should be single, chainable methods, and return the collection acted upon.
25
+
26
+ $(".btn.danger").button("toggle").addClass("fat")
27
+
28
+ All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior:
29
+
30
+ $("#myModal").modal() // initialized with defaults
31
+ $("#myModal").modal({ keyboard: false }) // initialized with now keyboard
32
+ $("#myModal").modal('show') // initializes and invokes show immediately afterqwe2
33
+
34
+ ---
35
+
36
+ ### OPTIONS
37
+
38
+ Options should be sparse and add universal value. We should pick the right defaults.
39
+
40
+ All plugins should have a default object which can be modified to effect all instance's default options. The defaults object should be available via `$.fn.plugin.defaults`.
41
+
42
+ $.fn.modal.defaults = { … }
43
+
44
+ An options definition should take the following form:
45
+
46
+ *noun*: *adjective* - describes or modifies a quality of an instance
47
+
48
+ examples:
49
+
50
+ backdrop: true
51
+ keyboard: false
52
+ placement: 'top'
53
+
54
+ ---
55
+
56
+ ### EVENTS
57
+
58
+ All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action.
59
+
60
+ show | shown
61
+ hide | hidden
62
+
63
+ ---
64
+
65
+ ### CONSTRUCTORS
66
+
67
+ Each plugin should expose it's raw constructor on a `Constructor` property -- accessed in the following way:
68
+
69
+
70
+ $.fn.popover.Constructor
71
+
72
+ ---
73
+
74
+ ### DATA ACCESSOR
75
+
76
+ Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this:
77
+
78
+ $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor
79
+
80
+ ---
81
+
82
+ ### DATA ATTRIBUTES
83
+
84
+ Data attributes should take the following form:
85
+
86
+ - data-{{verb}}={{plugin}} - defines main interaction
87
+ - data-target || href^=# - defined on "control" element (if element controls an element other than self)
88
+ - data-{{noun}} - defines class instance options
89
+
90
+ examples:
91
+
92
+ // control other targets
93
+ data-toggle="modal" data-target="#foo"
94
+ data-toggle="collapse" data-target="#foo" data-parent="#bar"
95
+
96
+ // defined on element they control
97
+ data-spy="scroll"
98
+
99
+ data-dismiss="modal"
100
+ data-dismiss="alert"
101
+
102
+ data-toggle="dropdown"
103
+
104
+ data-toggle="button"
105
+ data-toggle="buttons-checkbox"
106
+ data-toggle="buttons-radio"
@@ -0,0 +1,156 @@
1
+ // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2
+ // IT'S ALL JUST JUNK FOR OUR DOCS!
3
+ // ++++++++++++++++++++++++++++++++++++++++++
4
+
5
+ !function ($) {
6
+
7
+ $(function(){
8
+
9
+ var $window = $(window)
10
+
11
+ // Disable certain links in docs
12
+ $('section [href^=#]').click(function (e) {
13
+ e.preventDefault()
14
+ })
15
+
16
+ // side bar
17
+ setTimeout(function () {
18
+ $('.bs-docs-sidenav').affix({
19
+ offset: {
20
+ top: function () { return $window.width() <= 980 ? 290 : 210 }
21
+ , bottom: 270
22
+ }
23
+ })
24
+ }, 100)
25
+
26
+ // make code pretty
27
+ window.prettyPrint && prettyPrint()
28
+
29
+ // add-ons
30
+ $('.add-on :checkbox').on('click', function () {
31
+ var $this = $(this)
32
+ , method = $this.attr('checked') ? 'addClass' : 'removeClass'
33
+ $(this).parents('.add-on')[method]('active')
34
+ })
35
+
36
+ // add tipsies to grid for scaffolding
37
+ if ($('#grid-system').length) {
38
+ $('#grid-system').tooltip({
39
+ selector: '.show-grid > [class*="span"]'
40
+ , title: function () { return $(this).width() + 'px' }
41
+ })
42
+ }
43
+
44
+ // tooltip demo
45
+ $('.tooltip-demo').tooltip({
46
+ selector: "a[data-toggle=tooltip]"
47
+ })
48
+
49
+ $('.tooltip-test').tooltip()
50
+ $('.popover-test').popover()
51
+
52
+ // popover demo
53
+ $("a[data-toggle=popover]")
54
+ .popover()
55
+ .click(function(e) {
56
+ e.preventDefault()
57
+ })
58
+
59
+ // button state demo
60
+ $('#fat-btn')
61
+ .click(function () {
62
+ var btn = $(this)
63
+ btn.button('loading')
64
+ setTimeout(function () {
65
+ btn.button('reset')
66
+ }, 3000)
67
+ })
68
+
69
+ // carousel demo
70
+ $('.bs-docs-carousel-example').carousel()
71
+
72
+ // javascript build logic
73
+ var inputsComponent = $("#components.download input")
74
+ , inputsPlugin = $("#plugins.download input")
75
+ , inputsVariables = $("#variables.download input")
76
+
77
+ // toggle all plugin checkboxes
78
+ $('#components.download .toggle-all').on('click', function (e) {
79
+ e.preventDefault()
80
+ inputsComponent.attr('checked', !inputsComponent.is(':checked'))
81
+ })
82
+
83
+ $('#plugins.download .toggle-all').on('click', function (e) {
84
+ e.preventDefault()
85
+ inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
86
+ })
87
+
88
+ $('#variables.download .toggle-all').on('click', function (e) {
89
+ e.preventDefault()
90
+ inputsVariables.val('')
91
+ })
92
+
93
+ // request built javascript
94
+ $('.download-btn .btn').on('click', function () {
95
+
96
+ var css = $("#components.download input:checked")
97
+ .map(function () { return this.value })
98
+ .toArray()
99
+ , js = $("#plugins.download input:checked")
100
+ .map(function () { return this.value })
101
+ .toArray()
102
+ , vars = {}
103
+ , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
104
+
105
+ $("#variables.download input")
106
+ .each(function () {
107
+ $(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
108
+ })
109
+
110
+ $.ajax({
111
+ type: 'POST'
112
+ , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com'
113
+ , dataType: 'jsonpi'
114
+ , params: {
115
+ js: js
116
+ , css: css
117
+ , vars: vars
118
+ , img: img
119
+ }
120
+ })
121
+ })
122
+ })
123
+
124
+ // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi
125
+ $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
126
+ var url = opts.url;
127
+
128
+ return {
129
+ send: function(_, completeCallback) {
130
+ var name = 'jQuery_iframe_' + jQuery.now()
131
+ , iframe, form
132
+
133
+ iframe = $('<iframe>')
134
+ .attr('name', name)
135
+ .appendTo('head')
136
+
137
+ form = $('<form>')
138
+ .attr('method', opts.type) // GET or POST
139
+ .attr('action', url)
140
+ .attr('target', name)
141
+
142
+ $.each(opts.params, function(k, v) {
143
+
144
+ $('<input>')
145
+ .attr('type', 'hidden')
146
+ .attr('name', k)
147
+ .attr('value', typeof v == 'string' ? v : JSON.stringify(v))
148
+ .appendTo(form)
149
+ })
150
+
151
+ form.appendTo('body').submit()
152
+ }
153
+ }
154
+ })
155
+
156
+ }(window.jQuery)
@@ -0,0 +1,117 @@
1
+ /* ==========================================================
2
+ * bootstrap-affix.js v3.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#affix
4
+ * ==========================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ========================================================== */
19
+
20
+
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* AFFIX CLASS DEFINITION
27
+ * ====================== */
28
+
29
+ var Affix = function (element, options) {
30
+ this.options = $.extend({}, $.fn.affix.defaults, options)
31
+ this.$window = $(window)
32
+ .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
33
+ .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
34
+ this.$element = $(element)
35
+ this.checkPosition()
36
+ }
37
+
38
+ Affix.prototype.checkPosition = function () {
39
+ if (!this.$element.is(':visible')) return
40
+
41
+ var scrollHeight = $(document).height()
42
+ , scrollTop = this.$window.scrollTop()
43
+ , position = this.$element.offset()
44
+ , offset = this.options.offset
45
+ , offsetBottom = offset.bottom
46
+ , offsetTop = offset.top
47
+ , reset = 'affix affix-top affix-bottom'
48
+ , affix
49
+
50
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
51
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
52
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
53
+
54
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
55
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
56
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
57
+ 'top' : false
58
+
59
+ if (this.affixed === affix) return
60
+
61
+ this.affixed = affix
62
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
63
+
64
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
65
+ }
66
+
67
+
68
+ /* AFFIX PLUGIN DEFINITION
69
+ * ======================= */
70
+
71
+ var old = $.fn.affix
72
+
73
+ $.fn.affix = function (option) {
74
+ return this.each(function () {
75
+ var $this = $(this)
76
+ , data = $this.data('affix')
77
+ , options = typeof option == 'object' && option
78
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
79
+ if (typeof option == 'string') data[option]()
80
+ })
81
+ }
82
+
83
+ $.fn.affix.Constructor = Affix
84
+
85
+ $.fn.affix.defaults = {
86
+ offset: 0
87
+ }
88
+
89
+
90
+ /* AFFIX NO CONFLICT
91
+ * ================= */
92
+
93
+ $.fn.affix.noConflict = function () {
94
+ $.fn.affix = old
95
+ return this
96
+ }
97
+
98
+
99
+ /* AFFIX DATA-API
100
+ * ============== */
101
+
102
+ $(window).on('load', function () {
103
+ $('[data-spy="affix"]').each(function () {
104
+ var $spy = $(this)
105
+ , data = $spy.data()
106
+
107
+ data.offset = data.offset || {}
108
+
109
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
110
+ data.offsetTop && (data.offset.top = data.offsetTop)
111
+
112
+ $spy.affix(data)
113
+ })
114
+ })
115
+
116
+
117
+ }(window.jQuery);
@@ -0,0 +1,99 @@
1
+ /* ==========================================================
2
+ * bootstrap-alert.js v3.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
4
+ * ==========================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ========================================================== */
19
+
20
+
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* ALERT CLASS DEFINITION
27
+ * ====================== */
28
+
29
+ var dismiss = '[data-dismiss="alert"]'
30
+ , Alert = function (el) {
31
+ $(el).on('click', dismiss, this.close)
32
+ }
33
+
34
+ Alert.prototype.close = function (e) {
35
+ var $this = $(this)
36
+ , selector = $this.attr('data-target')
37
+ , $parent
38
+
39
+ if (!selector) {
40
+ selector = $this.attr('href')
41
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42
+ }
43
+
44
+ $parent = $(selector)
45
+
46
+ e && e.preventDefault()
47
+
48
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
49
+
50
+ $parent.trigger(e = $.Event('close'))
51
+
52
+ if (e.isDefaultPrevented()) return
53
+
54
+ $parent.removeClass('in')
55
+
56
+ function removeElement() {
57
+ $parent
58
+ .trigger('closed')
59
+ .remove()
60
+ }
61
+
62
+ $.support.transition && $parent.hasClass('fade') ?
63
+ $parent.on($.support.transition.end, removeElement) :
64
+ removeElement()
65
+ }
66
+
67
+
68
+ /* ALERT PLUGIN DEFINITION
69
+ * ======================= */
70
+
71
+ var old = $.fn.alert
72
+
73
+ $.fn.alert = function (option) {
74
+ return this.each(function () {
75
+ var $this = $(this)
76
+ , data = $this.data('alert')
77
+ if (!data) $this.data('alert', (data = new Alert(this)))
78
+ if (typeof option == 'string') data[option].call($this)
79
+ })
80
+ }
81
+
82
+ $.fn.alert.Constructor = Alert
83
+
84
+
85
+ /* ALERT NO CONFLICT
86
+ * ================= */
87
+
88
+ $.fn.alert.noConflict = function () {
89
+ $.fn.alert = old
90
+ return this
91
+ }
92
+
93
+
94
+ /* ALERT DATA-API
95
+ * ============== */
96
+
97
+ $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
98
+
99
+ }(window.jQuery);