databaseformalizer 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/.project +18 -0
  2. data/README +256 -0
  3. data/README.md +2 -0
  4. data/Rakefile +21 -0
  5. data/app/controllers/databaseformalizer/attr_defs_controller.rb +98 -0
  6. data/app/controllers/databaseformalizer/attr_vals_controller.rb +85 -0
  7. data/app/controllers/databaseformalizer/dbformahome_controller.rb +7 -0
  8. data/app/controllers/databaseformalizer/entities_controller.rb +105 -0
  9. data/app/controllers/databaseformalizer/entity_defs_controller.rb +90 -0
  10. data/app/helpers/application_helper.rb +2 -0
  11. data/app/helpers/databaseformalizer/application_helper.rb +4 -0
  12. data/app/helpers/databaseformalizer/attr_defs_helper.rb +4 -0
  13. data/app/helpers/databaseformalizer/attr_vals_helper.rb +4 -0
  14. data/app/helpers/databaseformalizer/dbformahome_helper.rb +4 -0
  15. data/app/helpers/databaseformalizer/entities_helper.rb +160 -0
  16. data/app/helpers/databaseformalizer/entity_defs_helper.rb +68 -0
  17. data/app/models/databaseformalizer/attr_def.rb +48 -0
  18. data/app/models/databaseformalizer/attr_list_join_def.rb +17 -0
  19. data/app/models/databaseformalizer/attr_list_join_val.rb +18 -0
  20. data/app/models/databaseformalizer/attr_val.rb +36 -0
  21. data/app/models/databaseformalizer/attr_vals_entity.rb +18 -0
  22. data/app/models/databaseformalizer/entity.rb +27 -0
  23. data/app/models/databaseformalizer/entity_def.rb +24 -0
  24. data/app/models/databaseformalizer/entity_def_attr_def.rb +18 -0
  25. data/app/views/databaseformalizer/attr_defs/_form.html.erb +74 -0
  26. data/app/views/databaseformalizer/attr_defs/edit.html.erb +7 -0
  27. data/app/views/databaseformalizer/attr_defs/index.html.erb +38 -0
  28. data/app/views/databaseformalizer/attr_defs/new.html.erb +6 -0
  29. data/app/views/databaseformalizer/attr_defs/show.html.erb +50 -0
  30. data/app/views/databaseformalizer/attr_vals/_form.html.erb +29 -0
  31. data/app/views/databaseformalizer/attr_vals/edit.html.erb +7 -0
  32. data/app/views/databaseformalizer/attr_vals/index.html.erb +28 -0
  33. data/app/views/databaseformalizer/attr_vals/new.html.erb +6 -0
  34. data/app/views/databaseformalizer/attr_vals/show.html.erb +20 -0
  35. data/app/views/databaseformalizer/dbformahome/index.html.erb +19 -0
  36. data/app/views/databaseformalizer/entities/_attr_val_boolean_form.html.erb +7 -0
  37. data/app/views/databaseformalizer/entities/_attr_val_checkList_form.html.erb +22 -0
  38. data/app/views/databaseformalizer/entities/_attr_val_datetime_form.html.erb +15 -0
  39. data/app/views/databaseformalizer/entities/_attr_val_entityDef_form.html.erb +14 -0
  40. data/app/views/databaseformalizer/entities/_attr_val_form_all.html.erb +4 -0
  41. data/app/views/databaseformalizer/entities/_attr_val_form_one.html.erb +6 -0
  42. data/app/views/databaseformalizer/entities/_attr_val_integer_form.html.erb +10 -0
  43. data/app/views/databaseformalizer/entities/_attr_val_openList_element_form.html.erb +16 -0
  44. data/app/views/databaseformalizer/entities/_attr_val_openList_form.html.erb +12 -0
  45. data/app/views/databaseformalizer/entities/_attr_val_selectOneInList_form.html.erb +20 -0
  46. data/app/views/databaseformalizer/entities/_attr_val_string_form.html.erb +10 -0
  47. data/app/views/databaseformalizer/entities/_attr_val_text_form.html.erb +10 -0
  48. data/app/views/databaseformalizer/entities/_form.html.erb +54 -0
  49. data/app/views/databaseformalizer/entities/edit.html.erb +8 -0
  50. data/app/views/databaseformalizer/entities/index.html.erb +45 -0
  51. data/app/views/databaseformalizer/entities/new.html.erb +10 -0
  52. data/app/views/databaseformalizer/entities/new.js.erb +1 -0
  53. data/app/views/databaseformalizer/entities/show.html.erb +50 -0
  54. data/app/views/databaseformalizer/entity_defs/_form.html.erb +51 -0
  55. data/app/views/databaseformalizer/entity_defs/edit.html.erb +7 -0
  56. data/app/views/databaseformalizer/entity_defs/index.html.erb +57 -0
  57. data/app/views/databaseformalizer/entity_defs/new.html.erb +6 -0
  58. data/app/views/databaseformalizer/entity_defs/show.html.erb +30 -0
  59. data/app/views/databaseformalizer/layouts/application.html.erb +134 -0
  60. data/databaseformalizer.gemspec +34 -0
  61. data/lib/acts_as_entity/base.rb +101 -0
  62. data/lib/application_controller.rb +21 -0
  63. data/lib/application_helper.rb +3 -0
  64. data/lib/databaseformalizer.rb +27 -0
  65. data/lib/engine.rb +23 -0
  66. data/lib/generators/entity_def/USAGE +8 -0
  67. data/lib/generators/entity_def/entity_def_generator.rb +39 -0
  68. data/lib/generators/entity_def/templates/controller.rb +98 -0
  69. data/lib/generators/entity_def/templates/helper.rb +2 -0
  70. data/lib/generators/entity_def/templates/model.rb +3 -0
  71. data/lib/generators/entity_def/templates/view/_form.html.erb +35 -0
  72. data/lib/generators/entity_def/templates/view/edit.html.erb +6 -0
  73. data/lib/generators/entity_def/templates/view/index.html.erb +27 -0
  74. data/lib/generators/entity_def/templates/view/new.html.erb +5 -0
  75. data/lib/generators/entity_def/templates/view/show.html.erb +3 -0
  76. data/lib/rails/generators/databaseformalizer/databaseformalizer_generator.rb +52 -0
  77. data/lib/rails/generators/databaseformalizer/templates/initializer.rb +8 -0
  78. data/lib/rails/generators/databaseformalizer/templates/migration.rb +9 -0
  79. data/lib/rails/generators/databaseformalizer/templates/migration.rb.bak +9 -0
  80. data/lib/rails/generators/databaseformalizer/templates/schema.rb +84 -0
  81. data/lib/rails/railties/tasks.rake +8 -0
  82. data/public/bootstrap/css/bootstrap-fixed-header.css +15 -0
  83. data/public/bootstrap/css/bootstrap-responsive.css +808 -0
  84. data/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
  85. data/public/bootstrap/css/bootstrap-toggle.css +242 -0
  86. data/public/bootstrap/css/cerulean/bootstrap.min.css +740 -0
  87. data/public/bootstrap/css/img/glyphicons-halflings-white.png +0 -0
  88. data/public/bootstrap/css/img/glyphicons-halflings.png +0 -0
  89. data/public/bootstrap/js/bootstrap-alert.js +90 -0
  90. data/public/bootstrap/js/bootstrap-collapse.js +157 -0
  91. data/public/bootstrap/js/bootstrap-dropdown.js +100 -0
  92. data/public/bootstrap/js/bootstrap-fixed-header.js +54 -0
  93. data/public/bootstrap/js/bootstrap-modal.js +218 -0
  94. data/public/bootstrap/js/bootstrap-popover.js +98 -0
  95. data/public/bootstrap/js/bootstrap-tab.js +135 -0
  96. data/public/bootstrap/js/bootstrap-toggle.js +104 -0
  97. data/public/bootstrap/js/bootstrap-tooltip.js +275 -0
  98. data/public/bootstrap/js/bootstrap-transition.js +61 -0
  99. data/public/bootstrap/js/bootstrap.js +1824 -0
  100. data/public/bootstrap/js/bootstrap.min.js +6 -0
  101. data/public/images/Thumbs.db +0 -0
  102. data/public/images/bootstrap/Thumbs.db +0 -0
  103. data/public/images/bootstrap/glyphicons-halflings.png +0 -0
  104. data/public/images/databaseformalizer.jpg +0 -0
  105. data/public/images/metamodel.png +0 -0
  106. data/public/images/model.png +0 -0
  107. data/public/javascripts/databaseformalizer.js +13 -0
  108. data/public/javascripts/jquery.js +9252 -0
  109. data/public/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  110. data/public/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  111. data/public/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  112. data/public/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  113. data/public/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  114. data/public/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  115. data/public/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  116. data/public/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  117. data/public/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  118. data/public/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  119. data/public/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  120. data/public/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  121. data/public/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  122. data/public/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  123. data/public/jquery-ui/css/ui-lightness/jquery-ui-1.8.21.custom.css +565 -0
  124. data/public/jquery-ui/js/jquery-1.7.2.min.js +4 -0
  125. data/public/jquery-ui/js/jquery-ui-1.8.21.custom.min.js +125 -0
  126. data/public/jquery-validation/README.md +8 -0
  127. data/public/jquery-validation/additional-methods.js +300 -0
  128. data/public/jquery-validation/additional-methods.min.js +29 -0
  129. data/public/jquery-validation/changelog.txt +277 -0
  130. data/public/jquery-validation/jquery.validate.js +1188 -0
  131. data/public/jquery-validation/jquery.validate.min.js +51 -0
  132. data/public/jquery-validation/lib/jquery-1.3.2.js +4376 -0
  133. data/public/jquery-validation/lib/jquery-1.4.2.js +6240 -0
  134. data/public/jquery-validation/lib/jquery-1.4.4.js +7179 -0
  135. data/public/jquery-validation/lib/jquery-1.5.2.js +8374 -0
  136. data/public/jquery-validation/lib/jquery-1.6.1.js +8936 -0
  137. data/public/jquery-validation/lib/jquery.form.js +660 -0
  138. data/public/jquery-validation/lib/jquery.js +4376 -0
  139. data/public/jquery-validation/lib/jquery.metadata.js +122 -0
  140. data/public/jquery-validation/lib/jquery.mockjax.js +382 -0
  141. data/public/jquery-validation/localization/messages_ar.js +24 -0
  142. data/public/jquery-validation/localization/messages_bg.js +23 -0
  143. data/public/jquery-validation/localization/messages_ca.js +23 -0
  144. data/public/jquery-validation/localization/messages_cn.js +23 -0
  145. data/public/jquery-validation/localization/messages_cs.js +23 -0
  146. data/public/jquery-validation/localization/messages_da.js +20 -0
  147. data/public/jquery-validation/localization/messages_de.js +20 -0
  148. data/public/jquery-validation/localization/messages_el.js +24 -0
  149. data/public/jquery-validation/localization/messages_es.js +23 -0
  150. data/public/jquery-validation/localization/messages_eu.js +23 -0
  151. data/public/jquery-validation/localization/messages_fa.js +23 -0
  152. data/public/jquery-validation/localization/messages_fi.js +21 -0
  153. data/public/jquery-validation/localization/messages_fr.js +23 -0
  154. data/public/jquery-validation/localization/messages_ge.js +23 -0
  155. data/public/jquery-validation/localization/messages_he.js +23 -0
  156. data/public/jquery-validation/localization/messages_hu.js +20 -0
  157. data/public/jquery-validation/localization/messages_it.js +23 -0
  158. data/public/jquery-validation/localization/messages_ja.js +23 -0
  159. data/public/jquery-validation/localization/messages_kk.js +23 -0
  160. data/public/jquery-validation/localization/messages_lt.js +23 -0
  161. data/public/jquery-validation/localization/messages_lv.js +23 -0
  162. data/public/jquery-validation/localization/messages_nl.js +23 -0
  163. data/public/jquery-validation/localization/messages_no.js +23 -0
  164. data/public/jquery-validation/localization/messages_pl.js +23 -0
  165. data/public/jquery-validation/localization/messages_ptbr.js +23 -0
  166. data/public/jquery-validation/localization/messages_ptpt.js +23 -0
  167. data/public/jquery-validation/localization/messages_ro.js +23 -0
  168. data/public/jquery-validation/localization/messages_ru.js +23 -0
  169. data/public/jquery-validation/localization/messages_se.js +21 -0
  170. data/public/jquery-validation/localization/messages_si.js +23 -0
  171. data/public/jquery-validation/localization/messages_sk.js +20 -0
  172. data/public/jquery-validation/localization/messages_sl.js +23 -0
  173. data/public/jquery-validation/localization/messages_sr.js +23 -0
  174. data/public/jquery-validation/localization/messages_th.js +23 -0
  175. data/public/jquery-validation/localization/messages_tr.js +23 -0
  176. data/public/jquery-validation/localization/messages_tw.js +23 -0
  177. data/public/jquery-validation/localization/messages_ua.js +23 -0
  178. data/public/jquery-validation/localization/messages_vi.js +23 -0
  179. data/public/jquery-validation/localization/methods_de.js +12 -0
  180. data/public/jquery-validation/localization/methods_nl.js +9 -0
  181. data/public/jquery-validation/localization/methods_pt.js +9 -0
  182. data/public/jquery-validation/todo +172 -0
  183. data/public/jquery-validation/version.txt +1 -0
  184. data/public/stylesheets/databaseformalizer.css +64 -0
  185. data/public/stylesheets/scaffold.css +56 -0
  186. data/public/tablesorter/addons/.svn/all-wcprops +5 -0
  187. data/public/tablesorter/addons/.svn/entries +31 -0
  188. data/public/tablesorter/addons/pager/.svn/all-wcprops +17 -0
  189. data/public/tablesorter/addons/pager/.svn/entries +96 -0
  190. data/public/tablesorter/addons/pager/.svn/prop-base/jquery.tablesorter.pager.css.svn-base +5 -0
  191. data/public/tablesorter/addons/pager/.svn/prop-base/jquery.tablesorter.pager.js.svn-base +5 -0
  192. data/public/tablesorter/addons/pager/.svn/text-base/jquery.tablesorter.pager.css.svn-base +25 -0
  193. data/public/tablesorter/addons/pager/.svn/text-base/jquery.tablesorter.pager.js.svn-base +184 -0
  194. data/public/tablesorter/addons/pager/jquery.tablesorter.pager.css +25 -0
  195. data/public/tablesorter/addons/pager/jquery.tablesorter.pager.js +184 -0
  196. data/public/tablesorter/build/.svn/all-wcprops +47 -0
  197. data/public/tablesorter/build/.svn/entries +266 -0
  198. data/public/tablesorter/build/.svn/prop-base/ParseMaster.js.svn-base +5 -0
  199. data/public/tablesorter/build/.svn/prop-base/js.jar.svn-base +5 -0
  200. data/public/tablesorter/build/.svn/prop-base/jsmin.js.svn-base +5 -0
  201. data/public/tablesorter/build/.svn/prop-base/min.js.svn-base +5 -0
  202. data/public/tablesorter/build/.svn/prop-base/pack.js.svn-base +5 -0
  203. data/public/tablesorter/build/.svn/prop-base/packer.js.svn-base +5 -0
  204. data/public/tablesorter/build/.svn/prop-base/writeFile.js.svn-base +5 -0
  205. data/public/tablesorter/build/.svn/text-base/ParseMaster.js.svn-base +106 -0
  206. data/public/tablesorter/build/.svn/text-base/js.jar.svn-base +0 -0
  207. data/public/tablesorter/build/.svn/text-base/jsmin.js.svn-base +316 -0
  208. data/public/tablesorter/build/.svn/text-base/min.js.svn-base +5 -0
  209. data/public/tablesorter/build/.svn/text-base/pack.js.svn-base +5 -0
  210. data/public/tablesorter/build/.svn/text-base/packer.js.svn-base +316 -0
  211. data/public/tablesorter/build/.svn/text-base/writeFile.js.svn-base +19 -0
  212. data/public/tablesorter/build/ParseMaster.js +106 -0
  213. data/public/tablesorter/build/js.jar +0 -0
  214. data/public/tablesorter/build/jsmin.js +316 -0
  215. data/public/tablesorter/build/min.js +5 -0
  216. data/public/tablesorter/build/pack.js +5 -0
  217. data/public/tablesorter/build/packer.js +316 -0
  218. data/public/tablesorter/build/writeFile.js +19 -0
  219. data/public/tablesorter/build.xml +26 -0
  220. data/public/tablesorter/changelog +41 -0
  221. data/public/tablesorter/jquery-latest.js +154 -0
  222. data/public/tablesorter/jquery.metadata.js +122 -0
  223. data/public/tablesorter/jquery.tablesorter.js +1031 -0
  224. data/public/tablesorter/jquery.tablesorter.min.js +4 -0
  225. data/public/tablesorter/jquery.tablesorter.widgets.js +433 -0
  226. data/public/tablesorter/jquery.ui.datepicker.js +1727 -0
  227. data/public/tablesorter/style.css +110 -0
  228. data/public/tablesorter/themes/.svn/all-wcprops +5 -0
  229. data/public/tablesorter/themes/.svn/entries +34 -0
  230. data/public/tablesorter/themes/blue/.svn/all-wcprops +35 -0
  231. data/public/tablesorter/themes/blue/.svn/entries +198 -0
  232. data/public/tablesorter/themes/blue/.svn/prop-base/asc.gif.svn-base +5 -0
  233. data/public/tablesorter/themes/blue/.svn/prop-base/bg.gif.svn-base +5 -0
  234. data/public/tablesorter/themes/blue/.svn/prop-base/blue.zip.svn-base +5 -0
  235. data/public/tablesorter/themes/blue/.svn/prop-base/desc.gif.svn-base +5 -0
  236. data/public/tablesorter/themes/blue/.svn/prop-base/style.css.svn-base +5 -0
  237. data/public/tablesorter/themes/blue/.svn/text-base/asc.gif.svn-base +0 -0
  238. data/public/tablesorter/themes/blue/.svn/text-base/bg.gif.svn-base +0 -0
  239. data/public/tablesorter/themes/blue/.svn/text-base/blue.zip.svn-base +0 -0
  240. data/public/tablesorter/themes/blue/.svn/text-base/desc.gif.svn-base +0 -0
  241. data/public/tablesorter/themes/blue/.svn/text-base/style.css.svn-base +39 -0
  242. data/public/tablesorter/themes/blue/asc.gif +0 -0
  243. data/public/tablesorter/themes/blue/bg.gif +0 -0
  244. data/public/tablesorter/themes/blue/blue.zip +0 -0
  245. data/public/tablesorter/themes/blue/desc.gif +0 -0
  246. data/public/tablesorter/themes/blue/style.css +39 -0
  247. data/public/tablesorter/themes/green/.svn/all-wcprops +35 -0
  248. data/public/tablesorter/themes/green/.svn/entries +198 -0
  249. data/public/tablesorter/themes/green/.svn/prop-base/asc.png.svn-base +5 -0
  250. data/public/tablesorter/themes/green/.svn/prop-base/bg.png.svn-base +5 -0
  251. data/public/tablesorter/themes/green/.svn/prop-base/desc.png.svn-base +5 -0
  252. data/public/tablesorter/themes/green/.svn/prop-base/green.zip.svn-base +5 -0
  253. data/public/tablesorter/themes/green/.svn/prop-base/style.css.svn-base +5 -0
  254. data/public/tablesorter/themes/green/.svn/text-base/asc.png.svn-base +0 -0
  255. data/public/tablesorter/themes/green/.svn/text-base/bg.png.svn-base +0 -0
  256. data/public/tablesorter/themes/green/.svn/text-base/desc.png.svn-base +0 -0
  257. data/public/tablesorter/themes/green/.svn/text-base/green.zip.svn-base +0 -0
  258. data/public/tablesorter/themes/green/.svn/text-base/style.css.svn-base +39 -0
  259. data/public/tablesorter/themes/green/asc.png +0 -0
  260. data/public/tablesorter/themes/green/bg.png +0 -0
  261. data/public/tablesorter/themes/green/desc.png +0 -0
  262. data/public/tablesorter/themes/green/green.zip +0 -0
  263. data/public/tablesorter/themes/green/style.css +39 -0
  264. data/test/database.yml +5 -0
  265. data/test/test_helper.rb +56 -0
  266. data/test/unit/databaseformalizer_test.rb +11 -0
  267. metadata +332 -0
@@ -0,0 +1,98 @@
1
+ /* ===========================================================
2
+ * bootstrap-popover.js v2.0.4
3
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
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
+ /* POPOVER PUBLIC CLASS DEFINITION
27
+ * =============================== */
28
+
29
+ var Popover = function ( element, options ) {
30
+ this.init('popover', element, options)
31
+ }
32
+
33
+
34
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
35
+ ========================================== */
36
+
37
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
38
+
39
+ constructor: Popover
40
+
41
+ , setContent: function () {
42
+ var $tip = this.tip()
43
+ , title = this.getTitle()
44
+ , content = this.getContent()
45
+
46
+ $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
47
+ $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
48
+
49
+ $tip.removeClass('fade top bottom left right in')
50
+ }
51
+
52
+ , hasContent: function () {
53
+ return this.getTitle() || this.getContent()
54
+ }
55
+
56
+ , getContent: function () {
57
+ var content
58
+ , $e = this.$element
59
+ , o = this.options
60
+
61
+ content = $e.attr('data-content')
62
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
63
+
64
+ return content
65
+ }
66
+
67
+ , tip: function () {
68
+ if (!this.$tip) {
69
+ this.$tip = $(this.options.template)
70
+ }
71
+ return this.$tip
72
+ }
73
+
74
+ })
75
+
76
+
77
+ /* POPOVER PLUGIN DEFINITION
78
+ * ======================= */
79
+
80
+ $.fn.popover = function (option) {
81
+ return this.each(function () {
82
+ var $this = $(this)
83
+ , data = $this.data('popover')
84
+ , options = typeof option == 'object' && option
85
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
86
+ if (typeof option == 'string') data[option]()
87
+ })
88
+ }
89
+
90
+ $.fn.popover.Constructor = Popover
91
+
92
+ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
93
+ placement: 'right'
94
+ , content: ''
95
+ , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
96
+ })
97
+
98
+ }(window.jQuery);
@@ -0,0 +1,135 @@
1
+ /* ========================================================
2
+ * bootstrap-tab.js v2.0.3
3
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
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
+ /* TAB CLASS DEFINITION
27
+ * ==================== */
28
+
29
+ var Tab = function ( element ) {
30
+ this.element = $(element)
31
+ }
32
+
33
+ Tab.prototype = {
34
+
35
+ constructor: Tab
36
+
37
+ , show: function () {
38
+ var $this = this.element
39
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
40
+ , selector = $this.attr('data-target')
41
+ , previous
42
+ , $target
43
+ , e
44
+
45
+ if (!selector) {
46
+ selector = $this.attr('href')
47
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
48
+ }
49
+
50
+ if ( $this.parent('li').hasClass('active') ) return
51
+
52
+ previous = $ul.find('.active a').last()[0]
53
+
54
+ e = $.Event('show', {
55
+ relatedTarget: previous
56
+ })
57
+
58
+ $this.trigger(e)
59
+
60
+ if (e.isDefaultPrevented()) return
61
+
62
+ $target = $(selector)
63
+
64
+ this.activate($this.parent('li'), $ul)
65
+ this.activate($target, $target.parent(), function () {
66
+ $this.trigger({
67
+ type: 'shown'
68
+ , relatedTarget: previous
69
+ })
70
+ })
71
+ }
72
+
73
+ , activate: function ( element, container, callback) {
74
+ var $active = container.find('> .active')
75
+ , transition = callback
76
+ && $.support.transition
77
+ && $active.hasClass('fade')
78
+
79
+ function next() {
80
+ $active
81
+ .removeClass('active')
82
+ .find('> .dropdown-menu > .active')
83
+ .removeClass('active')
84
+
85
+ element.addClass('active')
86
+
87
+ if (transition) {
88
+ element[0].offsetWidth // reflow for transition
89
+ element.addClass('in')
90
+ } else {
91
+ element.removeClass('fade')
92
+ }
93
+
94
+ if ( element.parent('.dropdown-menu') ) {
95
+ element.closest('li.dropdown').addClass('active')
96
+ }
97
+
98
+ callback && callback()
99
+ }
100
+
101
+ transition ?
102
+ $active.one($.support.transition.end, next) :
103
+ next()
104
+
105
+ $active.removeClass('in')
106
+ }
107
+ }
108
+
109
+
110
+ /* TAB PLUGIN DEFINITION
111
+ * ===================== */
112
+
113
+ $.fn.tab = function ( option ) {
114
+ return this.each(function () {
115
+ var $this = $(this)
116
+ , data = $this.data('tab')
117
+ if (!data) $this.data('tab', (data = new Tab(this)))
118
+ if (typeof option == 'string') data[option]()
119
+ })
120
+ }
121
+
122
+ $.fn.tab.Constructor = Tab
123
+
124
+
125
+ /* TAB DATA-API
126
+ * ============ */
127
+
128
+ $(function () {
129
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
130
+ e.preventDefault()
131
+ $(this).tab('show')
132
+ })
133
+ })
134
+
135
+ }(window.jQuery);
@@ -0,0 +1,104 @@
1
+ /**
2
+ * bootstrap-toggle.js v1.0
3
+ * http://github.com/Nijikokun/bootstrap-toggle/
4
+ * --
5
+ * http://twitter.com/nijikokun
6
+ * Copyright 2012 Nijiko Yonskai, Goodybag Inc
7
+ * --
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+
21
+ !function ($) {
22
+
23
+ var Toggle = function (element, options) {
24
+ var self = this;
25
+
26
+ // Collect elements
27
+ this.$element = $(element)
28
+ this.$checkbox = this.$element.children('.checkbox')
29
+ this.options = $.extend({}, $.fn.toggle.defaults, options)
30
+
31
+ // Initial Setup from options
32
+ var status = this.$checkbox.is(':checked')
33
+ if(this.options.text.enabled) this.$element.attr('data-enabled', this.options.text.enabled)
34
+ if(this.options.text.disabled) this.$element.attr('data-disabled', this.options.text.disabled)
35
+
36
+ if(status)
37
+ if(this.options.style.enabled)
38
+ this.$element.addClass(this.options.style.enabled)
39
+ else
40
+ if(this.options.style.disabled)
41
+ this.$element.addClass('disabled-' + this.options.style.disabled);
42
+
43
+ // Setup Click
44
+ this.$element.click(function (e) {
45
+ if(self.options.onClick) self.options.onClick(e, self.$checkbox.is(':checked'))
46
+ self.toggle()
47
+ });
48
+ }
49
+
50
+ Toggle.prototype.setState = function (state) {
51
+ // change checkbox state
52
+ this.$checkbox.attr('checked', state)
53
+
54
+ if(state) {
55
+ this.$element.removeClass('disabled')
56
+ if(this.options.style.disabled)
57
+ this.$element.removeClass('disabled-' + this.options.style.disabled)
58
+ if(this.options.style.enabled)
59
+ this.$element.addClass(this.options.style.enabled)
60
+ } else {
61
+ this.$element.addClass('disabled')
62
+ if(this.options.style.enabled)
63
+ this.$element.removeClass(this.options.style.enabled)
64
+ if(this.options.style.disabled)
65
+ this.$element.addClass('disabled-' + this.options.style.disabled)
66
+ }
67
+ }
68
+
69
+ Toggle.prototype.on = function () {
70
+ this.setState(true)
71
+ }
72
+
73
+ Toggle.prototype.off = function () {
74
+ this.setState(false)
75
+ }
76
+
77
+ Toggle.prototype.toggle = function () {
78
+ var status = this.$checkbox.is(':checked')
79
+
80
+ // Toggle status
81
+ this.setState(!status)
82
+ }
83
+
84
+ /*
85
+ * Toggle Definition
86
+ */
87
+ $.fn.toggle = function (options) {
88
+ return new Toggle(this, typeof options == 'object' ? options : {})
89
+ }
90
+
91
+ $.fn.toggle.defaults = {
92
+ onClick: function () {},
93
+ text: {
94
+ enabled: false,
95
+ disabled: false
96
+ },
97
+ style: {
98
+ enabled: false,
99
+ disabled: false
100
+ }
101
+ }
102
+
103
+ $.fn.toggle.Constructor = Toggle
104
+ }(window.jQuery);
@@ -0,0 +1,275 @@
1
+ /* ===========================================================
2
+ * bootstrap-tooltip.js v2.0.4
3
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
4
+ * Inspired by the original jQuery.tipsy by Jason Frame
5
+ * ===========================================================
6
+ * Copyright 2012 Twitter, Inc.
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ * ========================================================== */
20
+
21
+
22
+ !function ($) {
23
+
24
+ "use strict"; // jshint ;_;
25
+
26
+
27
+ /* TOOLTIP PUBLIC CLASS DEFINITION
28
+ * =============================== */
29
+
30
+ var Tooltip = function (element, options) {
31
+ this.init('tooltip', element, options)
32
+ }
33
+
34
+ Tooltip.prototype = {
35
+
36
+ constructor: Tooltip
37
+
38
+ , init: function (type, element, options) {
39
+ var eventIn
40
+ , eventOut
41
+
42
+ this.type = type
43
+ this.$element = $(element)
44
+ this.options = this.getOptions(options)
45
+ this.enabled = true
46
+
47
+ if (this.options.trigger != 'manual') {
48
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
49
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
50
+ this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
51
+ this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
52
+ }
53
+
54
+ this.options.selector ?
55
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
56
+ this.fixTitle()
57
+ }
58
+
59
+ , getOptions: function (options) {
60
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
61
+
62
+ if (options.delay && typeof options.delay == 'number') {
63
+ options.delay = {
64
+ show: options.delay
65
+ , hide: options.delay
66
+ }
67
+ }
68
+
69
+ return options
70
+ }
71
+
72
+ , enter: function (e) {
73
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
74
+
75
+ if (!self.options.delay || !self.options.delay.show) return self.show()
76
+
77
+ clearTimeout(this.timeout)
78
+ self.hoverState = 'in'
79
+ this.timeout = setTimeout(function() {
80
+ if (self.hoverState == 'in') self.show()
81
+ }, self.options.delay.show)
82
+ }
83
+
84
+ , leave: function (e) {
85
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
86
+
87
+ if (this.timeout) clearTimeout(this.timeout)
88
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
89
+
90
+ self.hoverState = 'out'
91
+ this.timeout = setTimeout(function() {
92
+ if (self.hoverState == 'out') self.hide()
93
+ }, self.options.delay.hide)
94
+ }
95
+
96
+ , show: function () {
97
+ var $tip
98
+ , inside
99
+ , pos
100
+ , actualWidth
101
+ , actualHeight
102
+ , placement
103
+ , tp
104
+
105
+ if (this.hasContent() && this.enabled) {
106
+ $tip = this.tip()
107
+ this.setContent()
108
+
109
+ if (this.options.animation) {
110
+ $tip.addClass('fade')
111
+ }
112
+
113
+ placement = typeof this.options.placement == 'function' ?
114
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
115
+ this.options.placement
116
+
117
+ inside = /in/.test(placement)
118
+
119
+ $tip
120
+ .remove()
121
+ .css({ top: 0, left: 0, display: 'block' })
122
+ .appendTo(inside ? this.$element : document.body)
123
+
124
+ pos = this.getPosition(inside)
125
+
126
+ actualWidth = $tip[0].offsetWidth
127
+ actualHeight = $tip[0].offsetHeight
128
+
129
+ switch (inside ? placement.split(' ')[1] : placement) {
130
+ case 'bottom':
131
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
132
+ break
133
+ case 'top':
134
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
135
+ break
136
+ case 'left':
137
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
138
+ break
139
+ case 'right':
140
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
141
+ break
142
+ }
143
+
144
+ $tip
145
+ .css(tp)
146
+ .addClass(placement)
147
+ .addClass('in')
148
+ }
149
+ }
150
+
151
+ , isHTML: function(text) {
152
+ // html string detection logic adapted from jQuery
153
+ return typeof text != 'string'
154
+ || ( text.charAt(0) === "<"
155
+ && text.charAt( text.length - 1 ) === ">"
156
+ && text.length >= 3
157
+ ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
158
+ }
159
+
160
+ , setContent: function () {
161
+ var $tip = this.tip()
162
+ , title = this.getTitle()
163
+
164
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
165
+ $tip.removeClass('fade in top bottom left right')
166
+ }
167
+
168
+ , hide: function () {
169
+ var that = this
170
+ , $tip = this.tip()
171
+
172
+ $tip.removeClass('in')
173
+
174
+ function removeWithAnimation() {
175
+ var timeout = setTimeout(function () {
176
+ $tip.off($.support.transition.end).remove()
177
+ }, 500)
178
+
179
+ $tip.one($.support.transition.end, function () {
180
+ clearTimeout(timeout)
181
+ $tip.remove()
182
+ })
183
+ }
184
+
185
+ $.support.transition && this.$tip.hasClass('fade') ?
186
+ removeWithAnimation() :
187
+ $tip.remove()
188
+ }
189
+
190
+ , fixTitle: function () {
191
+ var $e = this.$element
192
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
193
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
194
+ }
195
+ }
196
+
197
+ , hasContent: function () {
198
+ return this.getTitle()
199
+ }
200
+
201
+ , getPosition: function (inside) {
202
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
203
+ width: this.$element[0].offsetWidth
204
+ , height: this.$element[0].offsetHeight
205
+ })
206
+ }
207
+
208
+ , getTitle: function () {
209
+ var title
210
+ , $e = this.$element
211
+ , o = this.options
212
+
213
+ title = $e.attr('data-original-title')
214
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
215
+
216
+ return title
217
+ }
218
+
219
+ , tip: function () {
220
+ return this.$tip = this.$tip || $(this.options.template)
221
+ }
222
+
223
+ , validate: function () {
224
+ if (!this.$element[0].parentNode) {
225
+ this.hide()
226
+ this.$element = null
227
+ this.options = null
228
+ }
229
+ }
230
+
231
+ , enable: function () {
232
+ this.enabled = true
233
+ }
234
+
235
+ , disable: function () {
236
+ this.enabled = false
237
+ }
238
+
239
+ , toggleEnabled: function () {
240
+ this.enabled = !this.enabled
241
+ }
242
+
243
+ , toggle: function () {
244
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
245
+ }
246
+
247
+ }
248
+
249
+
250
+ /* TOOLTIP PLUGIN DEFINITION
251
+ * ========================= */
252
+
253
+ $.fn.tooltip = function ( option ) {
254
+ return this.each(function () {
255
+ var $this = $(this)
256
+ , data = $this.data('tooltip')
257
+ , options = typeof option == 'object' && option
258
+ if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
259
+ if (typeof option == 'string') data[option]()
260
+ })
261
+ }
262
+
263
+ $.fn.tooltip.Constructor = Tooltip
264
+
265
+ $.fn.tooltip.defaults = {
266
+ animation: true
267
+ , placement: 'top'
268
+ , selector: false
269
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
270
+ , trigger: 'hover'
271
+ , title: ''
272
+ , delay: 0
273
+ }
274
+
275
+ }(window.jQuery);
@@ -0,0 +1,61 @@
1
+ /* ===================================================
2
+ * bootstrap-transition.js v2.0.3
3
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
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
+ $(function () {
24
+
25
+ "use strict"; // jshint ;_;
26
+
27
+
28
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29
+ * ======================================================= */
30
+
31
+ $.support.transition = (function () {
32
+
33
+ var transitionEnd = (function () {
34
+
35
+ var el = document.createElement('bootstrap')
36
+ , transEndEventNames = {
37
+ 'WebkitTransition' : 'webkitTransitionEnd'
38
+ , 'MozTransition' : 'transitionend'
39
+ , 'OTransition' : 'oTransitionEnd'
40
+ , 'msTransition' : 'MSTransitionEnd'
41
+ , 'transition' : 'transitionend'
42
+ }
43
+ , name
44
+
45
+ for (name in transEndEventNames){
46
+ if (el.style[name] !== undefined) {
47
+ return transEndEventNames[name]
48
+ }
49
+ }
50
+
51
+ }())
52
+
53
+ return transitionEnd && {
54
+ end: transitionEnd
55
+ }
56
+
57
+ })()
58
+
59
+ })
60
+
61
+ }(window.jQuery);