databaseformalizer 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.project +18 -0
- data/README +256 -0
- data/README.md +2 -0
- data/Rakefile +21 -0
- data/app/controllers/databaseformalizer/attr_defs_controller.rb +98 -0
- data/app/controllers/databaseformalizer/attr_vals_controller.rb +85 -0
- data/app/controllers/databaseformalizer/dbformahome_controller.rb +7 -0
- data/app/controllers/databaseformalizer/entities_controller.rb +105 -0
- data/app/controllers/databaseformalizer/entity_defs_controller.rb +90 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/databaseformalizer/application_helper.rb +4 -0
- data/app/helpers/databaseformalizer/attr_defs_helper.rb +4 -0
- data/app/helpers/databaseformalizer/attr_vals_helper.rb +4 -0
- data/app/helpers/databaseformalizer/dbformahome_helper.rb +4 -0
- data/app/helpers/databaseformalizer/entities_helper.rb +160 -0
- data/app/helpers/databaseformalizer/entity_defs_helper.rb +68 -0
- data/app/models/databaseformalizer/attr_def.rb +48 -0
- data/app/models/databaseformalizer/attr_list_join_def.rb +17 -0
- data/app/models/databaseformalizer/attr_list_join_val.rb +18 -0
- data/app/models/databaseformalizer/attr_val.rb +36 -0
- data/app/models/databaseformalizer/attr_vals_entity.rb +18 -0
- data/app/models/databaseformalizer/entity.rb +27 -0
- data/app/models/databaseformalizer/entity_def.rb +24 -0
- data/app/models/databaseformalizer/entity_def_attr_def.rb +18 -0
- data/app/views/databaseformalizer/attr_defs/_form.html.erb +74 -0
- data/app/views/databaseformalizer/attr_defs/edit.html.erb +7 -0
- data/app/views/databaseformalizer/attr_defs/index.html.erb +38 -0
- data/app/views/databaseformalizer/attr_defs/new.html.erb +6 -0
- data/app/views/databaseformalizer/attr_defs/show.html.erb +50 -0
- data/app/views/databaseformalizer/attr_vals/_form.html.erb +29 -0
- data/app/views/databaseformalizer/attr_vals/edit.html.erb +7 -0
- data/app/views/databaseformalizer/attr_vals/index.html.erb +28 -0
- data/app/views/databaseformalizer/attr_vals/new.html.erb +6 -0
- data/app/views/databaseformalizer/attr_vals/show.html.erb +20 -0
- data/app/views/databaseformalizer/dbformahome/index.html.erb +19 -0
- data/app/views/databaseformalizer/entities/_attr_val_boolean_form.html.erb +7 -0
- data/app/views/databaseformalizer/entities/_attr_val_checkList_form.html.erb +22 -0
- data/app/views/databaseformalizer/entities/_attr_val_datetime_form.html.erb +15 -0
- data/app/views/databaseformalizer/entities/_attr_val_entityDef_form.html.erb +14 -0
- data/app/views/databaseformalizer/entities/_attr_val_form_all.html.erb +4 -0
- data/app/views/databaseformalizer/entities/_attr_val_form_one.html.erb +6 -0
- data/app/views/databaseformalizer/entities/_attr_val_integer_form.html.erb +10 -0
- data/app/views/databaseformalizer/entities/_attr_val_openList_element_form.html.erb +16 -0
- data/app/views/databaseformalizer/entities/_attr_val_openList_form.html.erb +12 -0
- data/app/views/databaseformalizer/entities/_attr_val_selectOneInList_form.html.erb +20 -0
- data/app/views/databaseformalizer/entities/_attr_val_string_form.html.erb +10 -0
- data/app/views/databaseformalizer/entities/_attr_val_text_form.html.erb +10 -0
- data/app/views/databaseformalizer/entities/_form.html.erb +54 -0
- data/app/views/databaseformalizer/entities/edit.html.erb +8 -0
- data/app/views/databaseformalizer/entities/index.html.erb +45 -0
- data/app/views/databaseformalizer/entities/new.html.erb +10 -0
- data/app/views/databaseformalizer/entities/new.js.erb +1 -0
- data/app/views/databaseformalizer/entities/show.html.erb +50 -0
- data/app/views/databaseformalizer/entity_defs/_form.html.erb +51 -0
- data/app/views/databaseformalizer/entity_defs/edit.html.erb +7 -0
- data/app/views/databaseformalizer/entity_defs/index.html.erb +57 -0
- data/app/views/databaseformalizer/entity_defs/new.html.erb +6 -0
- data/app/views/databaseformalizer/entity_defs/show.html.erb +30 -0
- data/app/views/databaseformalizer/layouts/application.html.erb +134 -0
- data/databaseformalizer.gemspec +34 -0
- data/lib/acts_as_entity/base.rb +101 -0
- data/lib/application_controller.rb +21 -0
- data/lib/application_helper.rb +3 -0
- data/lib/databaseformalizer.rb +27 -0
- data/lib/engine.rb +23 -0
- data/lib/generators/entity_def/USAGE +8 -0
- data/lib/generators/entity_def/entity_def_generator.rb +39 -0
- data/lib/generators/entity_def/templates/controller.rb +98 -0
- data/lib/generators/entity_def/templates/helper.rb +2 -0
- data/lib/generators/entity_def/templates/model.rb +3 -0
- data/lib/generators/entity_def/templates/view/_form.html.erb +35 -0
- data/lib/generators/entity_def/templates/view/edit.html.erb +6 -0
- data/lib/generators/entity_def/templates/view/index.html.erb +27 -0
- data/lib/generators/entity_def/templates/view/new.html.erb +5 -0
- data/lib/generators/entity_def/templates/view/show.html.erb +3 -0
- data/lib/rails/generators/databaseformalizer/databaseformalizer_generator.rb +52 -0
- data/lib/rails/generators/databaseformalizer/templates/initializer.rb +8 -0
- data/lib/rails/generators/databaseformalizer/templates/migration.rb +9 -0
- data/lib/rails/generators/databaseformalizer/templates/migration.rb.bak +9 -0
- data/lib/rails/generators/databaseformalizer/templates/schema.rb +84 -0
- data/lib/rails/railties/tasks.rake +8 -0
- data/public/bootstrap/css/bootstrap-fixed-header.css +15 -0
- data/public/bootstrap/css/bootstrap-responsive.css +808 -0
- data/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
- data/public/bootstrap/css/bootstrap-toggle.css +242 -0
- data/public/bootstrap/css/cerulean/bootstrap.min.css +740 -0
- data/public/bootstrap/css/img/glyphicons-halflings-white.png +0 -0
- data/public/bootstrap/css/img/glyphicons-halflings.png +0 -0
- data/public/bootstrap/js/bootstrap-alert.js +90 -0
- data/public/bootstrap/js/bootstrap-collapse.js +157 -0
- data/public/bootstrap/js/bootstrap-dropdown.js +100 -0
- data/public/bootstrap/js/bootstrap-fixed-header.js +54 -0
- data/public/bootstrap/js/bootstrap-modal.js +218 -0
- data/public/bootstrap/js/bootstrap-popover.js +98 -0
- data/public/bootstrap/js/bootstrap-tab.js +135 -0
- data/public/bootstrap/js/bootstrap-toggle.js +104 -0
- data/public/bootstrap/js/bootstrap-tooltip.js +275 -0
- data/public/bootstrap/js/bootstrap-transition.js +61 -0
- data/public/bootstrap/js/bootstrap.js +1824 -0
- data/public/bootstrap/js/bootstrap.min.js +6 -0
- data/public/images/Thumbs.db +0 -0
- data/public/images/bootstrap/Thumbs.db +0 -0
- data/public/images/bootstrap/glyphicons-halflings.png +0 -0
- data/public/images/databaseformalizer.jpg +0 -0
- data/public/images/metamodel.png +0 -0
- data/public/images/model.png +0 -0
- data/public/javascripts/databaseformalizer.js +13 -0
- data/public/javascripts/jquery.js +9252 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/jquery-ui/css/ui-lightness/jquery-ui-1.8.21.custom.css +565 -0
- data/public/jquery-ui/js/jquery-1.7.2.min.js +4 -0
- data/public/jquery-ui/js/jquery-ui-1.8.21.custom.min.js +125 -0
- data/public/jquery-validation/README.md +8 -0
- data/public/jquery-validation/additional-methods.js +300 -0
- data/public/jquery-validation/additional-methods.min.js +29 -0
- data/public/jquery-validation/changelog.txt +277 -0
- data/public/jquery-validation/jquery.validate.js +1188 -0
- data/public/jquery-validation/jquery.validate.min.js +51 -0
- data/public/jquery-validation/lib/jquery-1.3.2.js +4376 -0
- data/public/jquery-validation/lib/jquery-1.4.2.js +6240 -0
- data/public/jquery-validation/lib/jquery-1.4.4.js +7179 -0
- data/public/jquery-validation/lib/jquery-1.5.2.js +8374 -0
- data/public/jquery-validation/lib/jquery-1.6.1.js +8936 -0
- data/public/jquery-validation/lib/jquery.form.js +660 -0
- data/public/jquery-validation/lib/jquery.js +4376 -0
- data/public/jquery-validation/lib/jquery.metadata.js +122 -0
- data/public/jquery-validation/lib/jquery.mockjax.js +382 -0
- data/public/jquery-validation/localization/messages_ar.js +24 -0
- data/public/jquery-validation/localization/messages_bg.js +23 -0
- data/public/jquery-validation/localization/messages_ca.js +23 -0
- data/public/jquery-validation/localization/messages_cn.js +23 -0
- data/public/jquery-validation/localization/messages_cs.js +23 -0
- data/public/jquery-validation/localization/messages_da.js +20 -0
- data/public/jquery-validation/localization/messages_de.js +20 -0
- data/public/jquery-validation/localization/messages_el.js +24 -0
- data/public/jquery-validation/localization/messages_es.js +23 -0
- data/public/jquery-validation/localization/messages_eu.js +23 -0
- data/public/jquery-validation/localization/messages_fa.js +23 -0
- data/public/jquery-validation/localization/messages_fi.js +21 -0
- data/public/jquery-validation/localization/messages_fr.js +23 -0
- data/public/jquery-validation/localization/messages_ge.js +23 -0
- data/public/jquery-validation/localization/messages_he.js +23 -0
- data/public/jquery-validation/localization/messages_hu.js +20 -0
- data/public/jquery-validation/localization/messages_it.js +23 -0
- data/public/jquery-validation/localization/messages_ja.js +23 -0
- data/public/jquery-validation/localization/messages_kk.js +23 -0
- data/public/jquery-validation/localization/messages_lt.js +23 -0
- data/public/jquery-validation/localization/messages_lv.js +23 -0
- data/public/jquery-validation/localization/messages_nl.js +23 -0
- data/public/jquery-validation/localization/messages_no.js +23 -0
- data/public/jquery-validation/localization/messages_pl.js +23 -0
- data/public/jquery-validation/localization/messages_ptbr.js +23 -0
- data/public/jquery-validation/localization/messages_ptpt.js +23 -0
- data/public/jquery-validation/localization/messages_ro.js +23 -0
- data/public/jquery-validation/localization/messages_ru.js +23 -0
- data/public/jquery-validation/localization/messages_se.js +21 -0
- data/public/jquery-validation/localization/messages_si.js +23 -0
- data/public/jquery-validation/localization/messages_sk.js +20 -0
- data/public/jquery-validation/localization/messages_sl.js +23 -0
- data/public/jquery-validation/localization/messages_sr.js +23 -0
- data/public/jquery-validation/localization/messages_th.js +23 -0
- data/public/jquery-validation/localization/messages_tr.js +23 -0
- data/public/jquery-validation/localization/messages_tw.js +23 -0
- data/public/jquery-validation/localization/messages_ua.js +23 -0
- data/public/jquery-validation/localization/messages_vi.js +23 -0
- data/public/jquery-validation/localization/methods_de.js +12 -0
- data/public/jquery-validation/localization/methods_nl.js +9 -0
- data/public/jquery-validation/localization/methods_pt.js +9 -0
- data/public/jquery-validation/todo +172 -0
- data/public/jquery-validation/version.txt +1 -0
- data/public/stylesheets/databaseformalizer.css +64 -0
- data/public/stylesheets/scaffold.css +56 -0
- data/public/tablesorter/addons/.svn/all-wcprops +5 -0
- data/public/tablesorter/addons/.svn/entries +31 -0
- data/public/tablesorter/addons/pager/.svn/all-wcprops +17 -0
- data/public/tablesorter/addons/pager/.svn/entries +96 -0
- data/public/tablesorter/addons/pager/.svn/prop-base/jquery.tablesorter.pager.css.svn-base +5 -0
- data/public/tablesorter/addons/pager/.svn/prop-base/jquery.tablesorter.pager.js.svn-base +5 -0
- data/public/tablesorter/addons/pager/.svn/text-base/jquery.tablesorter.pager.css.svn-base +25 -0
- data/public/tablesorter/addons/pager/.svn/text-base/jquery.tablesorter.pager.js.svn-base +184 -0
- data/public/tablesorter/addons/pager/jquery.tablesorter.pager.css +25 -0
- data/public/tablesorter/addons/pager/jquery.tablesorter.pager.js +184 -0
- data/public/tablesorter/build/.svn/all-wcprops +47 -0
- data/public/tablesorter/build/.svn/entries +266 -0
- data/public/tablesorter/build/.svn/prop-base/ParseMaster.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/prop-base/js.jar.svn-base +5 -0
- data/public/tablesorter/build/.svn/prop-base/jsmin.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/prop-base/min.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/prop-base/pack.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/prop-base/packer.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/prop-base/writeFile.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/text-base/ParseMaster.js.svn-base +106 -0
- data/public/tablesorter/build/.svn/text-base/js.jar.svn-base +0 -0
- data/public/tablesorter/build/.svn/text-base/jsmin.js.svn-base +316 -0
- data/public/tablesorter/build/.svn/text-base/min.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/text-base/pack.js.svn-base +5 -0
- data/public/tablesorter/build/.svn/text-base/packer.js.svn-base +316 -0
- data/public/tablesorter/build/.svn/text-base/writeFile.js.svn-base +19 -0
- data/public/tablesorter/build/ParseMaster.js +106 -0
- data/public/tablesorter/build/js.jar +0 -0
- data/public/tablesorter/build/jsmin.js +316 -0
- data/public/tablesorter/build/min.js +5 -0
- data/public/tablesorter/build/pack.js +5 -0
- data/public/tablesorter/build/packer.js +316 -0
- data/public/tablesorter/build/writeFile.js +19 -0
- data/public/tablesorter/build.xml +26 -0
- data/public/tablesorter/changelog +41 -0
- data/public/tablesorter/jquery-latest.js +154 -0
- data/public/tablesorter/jquery.metadata.js +122 -0
- data/public/tablesorter/jquery.tablesorter.js +1031 -0
- data/public/tablesorter/jquery.tablesorter.min.js +4 -0
- data/public/tablesorter/jquery.tablesorter.widgets.js +433 -0
- data/public/tablesorter/jquery.ui.datepicker.js +1727 -0
- data/public/tablesorter/style.css +110 -0
- data/public/tablesorter/themes/.svn/all-wcprops +5 -0
- data/public/tablesorter/themes/.svn/entries +34 -0
- data/public/tablesorter/themes/blue/.svn/all-wcprops +35 -0
- data/public/tablesorter/themes/blue/.svn/entries +198 -0
- data/public/tablesorter/themes/blue/.svn/prop-base/asc.gif.svn-base +5 -0
- data/public/tablesorter/themes/blue/.svn/prop-base/bg.gif.svn-base +5 -0
- data/public/tablesorter/themes/blue/.svn/prop-base/blue.zip.svn-base +5 -0
- data/public/tablesorter/themes/blue/.svn/prop-base/desc.gif.svn-base +5 -0
- data/public/tablesorter/themes/blue/.svn/prop-base/style.css.svn-base +5 -0
- data/public/tablesorter/themes/blue/.svn/text-base/asc.gif.svn-base +0 -0
- data/public/tablesorter/themes/blue/.svn/text-base/bg.gif.svn-base +0 -0
- data/public/tablesorter/themes/blue/.svn/text-base/blue.zip.svn-base +0 -0
- data/public/tablesorter/themes/blue/.svn/text-base/desc.gif.svn-base +0 -0
- data/public/tablesorter/themes/blue/.svn/text-base/style.css.svn-base +39 -0
- data/public/tablesorter/themes/blue/asc.gif +0 -0
- data/public/tablesorter/themes/blue/bg.gif +0 -0
- data/public/tablesorter/themes/blue/blue.zip +0 -0
- data/public/tablesorter/themes/blue/desc.gif +0 -0
- data/public/tablesorter/themes/blue/style.css +39 -0
- data/public/tablesorter/themes/green/.svn/all-wcprops +35 -0
- data/public/tablesorter/themes/green/.svn/entries +198 -0
- data/public/tablesorter/themes/green/.svn/prop-base/asc.png.svn-base +5 -0
- data/public/tablesorter/themes/green/.svn/prop-base/bg.png.svn-base +5 -0
- data/public/tablesorter/themes/green/.svn/prop-base/desc.png.svn-base +5 -0
- data/public/tablesorter/themes/green/.svn/prop-base/green.zip.svn-base +5 -0
- data/public/tablesorter/themes/green/.svn/prop-base/style.css.svn-base +5 -0
- data/public/tablesorter/themes/green/.svn/text-base/asc.png.svn-base +0 -0
- data/public/tablesorter/themes/green/.svn/text-base/bg.png.svn-base +0 -0
- data/public/tablesorter/themes/green/.svn/text-base/desc.png.svn-base +0 -0
- data/public/tablesorter/themes/green/.svn/text-base/green.zip.svn-base +0 -0
- data/public/tablesorter/themes/green/.svn/text-base/style.css.svn-base +39 -0
- data/public/tablesorter/themes/green/asc.png +0 -0
- data/public/tablesorter/themes/green/bg.png +0 -0
- data/public/tablesorter/themes/green/desc.png +0 -0
- data/public/tablesorter/themes/green/green.zip +0 -0
- data/public/tablesorter/themes/green/style.css +39 -0
- data/test/database.yml +5 -0
- data/test/test_helper.rb +56 -0
- data/test/unit/databaseformalizer_test.rb +11 -0
- metadata +332 -0
Binary file
|
Binary file
|
@@ -0,0 +1,90 @@
|
|
1
|
+
/* ==========================================================
|
2
|
+
* bootstrap-alert.js v2.0.3
|
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
|
+
$.fn.alert = function (option) {
|
72
|
+
return this.each(function () {
|
73
|
+
var $this = $(this)
|
74
|
+
, data = $this.data('alert')
|
75
|
+
if (!data) $this.data('alert', (data = new Alert(this)))
|
76
|
+
if (typeof option == 'string') data[option].call($this)
|
77
|
+
})
|
78
|
+
}
|
79
|
+
|
80
|
+
$.fn.alert.Constructor = Alert
|
81
|
+
|
82
|
+
|
83
|
+
/* ALERT DATA-API
|
84
|
+
* ============== */
|
85
|
+
|
86
|
+
$(function () {
|
87
|
+
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
88
|
+
})
|
89
|
+
|
90
|
+
}(window.jQuery);
|
@@ -0,0 +1,157 @@
|
|
1
|
+
/* =============================================================
|
2
|
+
* bootstrap-collapse.js v2.0.4
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
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
|
+
/* COLLAPSE PUBLIC CLASS DEFINITION
|
27
|
+
* ================================ */
|
28
|
+
|
29
|
+
var Collapse = function (element, options) {
|
30
|
+
this.$element = $(element)
|
31
|
+
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
32
|
+
|
33
|
+
if (this.options.parent) {
|
34
|
+
this.$parent = $(this.options.parent)
|
35
|
+
}
|
36
|
+
|
37
|
+
this.options.toggle && this.toggle()
|
38
|
+
}
|
39
|
+
|
40
|
+
Collapse.prototype = {
|
41
|
+
|
42
|
+
constructor: Collapse
|
43
|
+
|
44
|
+
, dimension: function () {
|
45
|
+
var hasWidth = this.$element.hasClass('width')
|
46
|
+
return hasWidth ? 'width' : 'height'
|
47
|
+
}
|
48
|
+
|
49
|
+
, show: function () {
|
50
|
+
var dimension
|
51
|
+
, scroll
|
52
|
+
, actives
|
53
|
+
, hasData
|
54
|
+
|
55
|
+
if (this.transitioning) return
|
56
|
+
|
57
|
+
dimension = this.dimension()
|
58
|
+
scroll = $.camelCase(['scroll', dimension].join('-'))
|
59
|
+
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
60
|
+
|
61
|
+
if (actives && actives.length) {
|
62
|
+
hasData = actives.data('collapse')
|
63
|
+
if (hasData && hasData.transitioning) return
|
64
|
+
actives.collapse('hide')
|
65
|
+
hasData || actives.data('collapse', null)
|
66
|
+
}
|
67
|
+
|
68
|
+
this.$element[dimension](0)
|
69
|
+
this.transition('addClass', $.Event('show'), 'shown')
|
70
|
+
this.$element[dimension](this.$element[0][scroll])
|
71
|
+
}
|
72
|
+
|
73
|
+
, hide: function () {
|
74
|
+
var dimension
|
75
|
+
if (this.transitioning) return
|
76
|
+
dimension = this.dimension()
|
77
|
+
this.reset(this.$element[dimension]())
|
78
|
+
this.transition('removeClass', $.Event('hide'), 'hidden')
|
79
|
+
this.$element[dimension](0)
|
80
|
+
}
|
81
|
+
|
82
|
+
, reset: function (size) {
|
83
|
+
var dimension = this.dimension()
|
84
|
+
|
85
|
+
this.$element
|
86
|
+
.removeClass('collapse')
|
87
|
+
[dimension](size || 'auto')
|
88
|
+
[0].offsetWidth
|
89
|
+
|
90
|
+
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
91
|
+
|
92
|
+
return this
|
93
|
+
}
|
94
|
+
|
95
|
+
, transition: function (method, startEvent, completeEvent) {
|
96
|
+
var that = this
|
97
|
+
, complete = function () {
|
98
|
+
if (startEvent.type == 'show') that.reset()
|
99
|
+
that.transitioning = 0
|
100
|
+
that.$element.trigger(completeEvent)
|
101
|
+
}
|
102
|
+
|
103
|
+
this.$element.trigger(startEvent)
|
104
|
+
|
105
|
+
if (startEvent.isDefaultPrevented()) return
|
106
|
+
|
107
|
+
this.transitioning = 1
|
108
|
+
|
109
|
+
this.$element[method]('in')
|
110
|
+
|
111
|
+
$.support.transition && this.$element.hasClass('collapse') ?
|
112
|
+
this.$element.one($.support.transition.end, complete) :
|
113
|
+
complete()
|
114
|
+
}
|
115
|
+
|
116
|
+
, toggle: function () {
|
117
|
+
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
118
|
+
}
|
119
|
+
|
120
|
+
}
|
121
|
+
|
122
|
+
|
123
|
+
/* COLLAPSIBLE PLUGIN DEFINITION
|
124
|
+
* ============================== */
|
125
|
+
|
126
|
+
$.fn.collapse = function (option) {
|
127
|
+
return this.each(function () {
|
128
|
+
var $this = $(this)
|
129
|
+
, data = $this.data('collapse')
|
130
|
+
, options = typeof option == 'object' && option
|
131
|
+
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
132
|
+
if (typeof option == 'string') data[option]()
|
133
|
+
})
|
134
|
+
}
|
135
|
+
|
136
|
+
$.fn.collapse.defaults = {
|
137
|
+
toggle: true
|
138
|
+
}
|
139
|
+
|
140
|
+
$.fn.collapse.Constructor = Collapse
|
141
|
+
|
142
|
+
|
143
|
+
/* COLLAPSIBLE DATA-API
|
144
|
+
* ==================== */
|
145
|
+
|
146
|
+
$(function () {
|
147
|
+
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
|
148
|
+
var $this = $(this), href
|
149
|
+
, target = $this.attr('data-target')
|
150
|
+
|| e.preventDefault()
|
151
|
+
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
152
|
+
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
153
|
+
$(target).collapse(option)
|
154
|
+
})
|
155
|
+
})
|
156
|
+
|
157
|
+
}(window.jQuery);
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/* ============================================================
|
2
|
+
* bootstrap-dropdown.js v2.0.3
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
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
|
+
/* DROPDOWN CLASS DEFINITION
|
27
|
+
* ========================= */
|
28
|
+
|
29
|
+
var toggle = '[data-toggle="dropdown"]'
|
30
|
+
, Dropdown = function (element) {
|
31
|
+
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
32
|
+
$('html').on('click.dropdown.data-api', function () {
|
33
|
+
$el.parent().removeClass('open')
|
34
|
+
})
|
35
|
+
}
|
36
|
+
|
37
|
+
Dropdown.prototype = {
|
38
|
+
|
39
|
+
constructor: Dropdown
|
40
|
+
|
41
|
+
, toggle: function (e) {
|
42
|
+
var $this = $(this)
|
43
|
+
, $parent
|
44
|
+
, selector
|
45
|
+
, isActive
|
46
|
+
|
47
|
+
if ($this.is('.disabled, :disabled')) return
|
48
|
+
|
49
|
+
selector = $this.attr('data-target')
|
50
|
+
|
51
|
+
if (!selector) {
|
52
|
+
selector = $this.attr('href')
|
53
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
54
|
+
}
|
55
|
+
|
56
|
+
$parent = $(selector)
|
57
|
+
$parent.length || ($parent = $this.parent())
|
58
|
+
|
59
|
+
isActive = $parent.hasClass('open')
|
60
|
+
|
61
|
+
clearMenus()
|
62
|
+
|
63
|
+
if (!isActive) $parent.toggleClass('open')
|
64
|
+
|
65
|
+
return false
|
66
|
+
}
|
67
|
+
|
68
|
+
}
|
69
|
+
|
70
|
+
function clearMenus() {
|
71
|
+
$(toggle).parent().removeClass('open')
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
/* DROPDOWN PLUGIN DEFINITION
|
76
|
+
* ========================== */
|
77
|
+
|
78
|
+
$.fn.dropdown = function (option) {
|
79
|
+
return this.each(function () {
|
80
|
+
var $this = $(this)
|
81
|
+
, data = $this.data('dropdown')
|
82
|
+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
83
|
+
if (typeof option == 'string') data[option].call($this)
|
84
|
+
})
|
85
|
+
}
|
86
|
+
|
87
|
+
$.fn.dropdown.Constructor = Dropdown
|
88
|
+
|
89
|
+
|
90
|
+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
91
|
+
* =================================== */
|
92
|
+
|
93
|
+
$(function () {
|
94
|
+
$('html').on('click.dropdown.data-api', clearMenus)
|
95
|
+
$('body')
|
96
|
+
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
97
|
+
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
98
|
+
})
|
99
|
+
|
100
|
+
}(window.jQuery);
|
@@ -0,0 +1,54 @@
|
|
1
|
+
(function($) {
|
2
|
+
|
3
|
+
$.fn.fixedHeader = function (options) {
|
4
|
+
var config = {
|
5
|
+
topOffset: 40,
|
6
|
+
bgColor: '#EEEEEE'
|
7
|
+
};
|
8
|
+
if (options){ $.extend(config, options); }
|
9
|
+
|
10
|
+
return this.each( function() {
|
11
|
+
var o = $(this);
|
12
|
+
|
13
|
+
var $win = $(window)
|
14
|
+
, $head = $('thead.header', o)
|
15
|
+
, isFixed = 0;
|
16
|
+
var headTop = $head.length && $head.offset().top - config.topOffset;
|
17
|
+
|
18
|
+
function processScroll() {
|
19
|
+
if (!o.is(':visible')) return;
|
20
|
+
var i, scrollTop = $win.scrollTop();
|
21
|
+
var t = $head.length && $head.offset().top - config.topOffset;
|
22
|
+
if (!isFixed && headTop != t) { headTop = t; }
|
23
|
+
if (scrollTop >= headTop && !isFixed) {
|
24
|
+
isFixed = 1;
|
25
|
+
$head.addClass('header-fixed');
|
26
|
+
} else if (scrollTop <= headTop && isFixed) {
|
27
|
+
isFixed = 0;
|
28
|
+
$head.removeClass('header-fixed');
|
29
|
+
}
|
30
|
+
isFixed ? $('thead.header-copy', o).removeClass('hide')
|
31
|
+
: $('thead.header-copy', o).addClass('hide');
|
32
|
+
}
|
33
|
+
$win.on('scroll', processScroll);
|
34
|
+
|
35
|
+
// hack sad times - holdover until rewrite for 2.1
|
36
|
+
$head.on('click', function () {
|
37
|
+
if (!isFixed) setTimeout(function () { $win.scrollTop($win.scrollTop() - 47) }, 10);
|
38
|
+
})
|
39
|
+
|
40
|
+
$head.clone().removeClass('header header-fixed').addClass('header-copy').appendTo(o);
|
41
|
+
o.find('tbody > tr:first > td').each(function (i, h){
|
42
|
+
var w = $(h).width();
|
43
|
+
var d = $('<div>').css({overflow:'hidden', width: w});
|
44
|
+
$(h).css({width: w});
|
45
|
+
$head.find('> tr > th:eq('+i+')').append(d.clone());
|
46
|
+
});
|
47
|
+
$head.css({ margin:'0 auto',
|
48
|
+
width: o.width(),
|
49
|
+
'background-color':config.bgColor });
|
50
|
+
processScroll();
|
51
|
+
});
|
52
|
+
};
|
53
|
+
|
54
|
+
})(jQuery);
|
@@ -0,0 +1,218 @@
|
|
1
|
+
/* =========================================================
|
2
|
+
* bootstrap-modal.js v2.0.3
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#modals
|
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
|
+
/* MODAL CLASS DEFINITION
|
27
|
+
* ====================== */
|
28
|
+
|
29
|
+
var Modal = function (content, options) {
|
30
|
+
this.options = options
|
31
|
+
this.$element = $(content)
|
32
|
+
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
33
|
+
}
|
34
|
+
|
35
|
+
Modal.prototype = {
|
36
|
+
|
37
|
+
constructor: Modal
|
38
|
+
|
39
|
+
, toggle: function () {
|
40
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
41
|
+
}
|
42
|
+
|
43
|
+
, show: function () {
|
44
|
+
var that = this
|
45
|
+
, e = $.Event('show')
|
46
|
+
|
47
|
+
this.$element.trigger(e)
|
48
|
+
|
49
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
50
|
+
|
51
|
+
$('body').addClass('modal-open')
|
52
|
+
|
53
|
+
this.isShown = true
|
54
|
+
|
55
|
+
escape.call(this)
|
56
|
+
backdrop.call(this, function () {
|
57
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
58
|
+
|
59
|
+
if (!that.$element.parent().length) {
|
60
|
+
that.$element.appendTo(document.body) //don't move modals dom position
|
61
|
+
}
|
62
|
+
|
63
|
+
that.$element
|
64
|
+
.show()
|
65
|
+
|
66
|
+
if (transition) {
|
67
|
+
that.$element[0].offsetWidth // force reflow
|
68
|
+
}
|
69
|
+
|
70
|
+
that.$element.addClass('in')
|
71
|
+
|
72
|
+
transition ?
|
73
|
+
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
74
|
+
that.$element.trigger('shown')
|
75
|
+
|
76
|
+
})
|
77
|
+
}
|
78
|
+
|
79
|
+
, hide: function (e) {
|
80
|
+
e && e.preventDefault()
|
81
|
+
|
82
|
+
var that = this
|
83
|
+
|
84
|
+
e = $.Event('hide')
|
85
|
+
|
86
|
+
this.$element.trigger(e)
|
87
|
+
|
88
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
89
|
+
|
90
|
+
this.isShown = false
|
91
|
+
|
92
|
+
$('body').removeClass('modal-open')
|
93
|
+
|
94
|
+
escape.call(this)
|
95
|
+
|
96
|
+
this.$element.removeClass('in')
|
97
|
+
|
98
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
99
|
+
hideWithTransition.call(this) :
|
100
|
+
hideModal.call(this)
|
101
|
+
}
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
/* MODAL PRIVATE METHODS
|
107
|
+
* ===================== */
|
108
|
+
|
109
|
+
function hideWithTransition() {
|
110
|
+
var that = this
|
111
|
+
, timeout = setTimeout(function () {
|
112
|
+
that.$element.off($.support.transition.end)
|
113
|
+
hideModal.call(that)
|
114
|
+
}, 500)
|
115
|
+
|
116
|
+
this.$element.one($.support.transition.end, function () {
|
117
|
+
clearTimeout(timeout)
|
118
|
+
hideModal.call(that)
|
119
|
+
})
|
120
|
+
}
|
121
|
+
|
122
|
+
function hideModal(that) {
|
123
|
+
this.$element
|
124
|
+
.hide()
|
125
|
+
.trigger('hidden')
|
126
|
+
|
127
|
+
backdrop.call(this)
|
128
|
+
}
|
129
|
+
|
130
|
+
function backdrop(callback) {
|
131
|
+
var that = this
|
132
|
+
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
133
|
+
|
134
|
+
if (this.isShown && this.options.backdrop) {
|
135
|
+
var doAnimate = $.support.transition && animate
|
136
|
+
|
137
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
138
|
+
.appendTo(document.body)
|
139
|
+
|
140
|
+
if (this.options.backdrop != 'static') {
|
141
|
+
this.$backdrop.click($.proxy(this.hide, this))
|
142
|
+
}
|
143
|
+
|
144
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
145
|
+
|
146
|
+
this.$backdrop.addClass('in')
|
147
|
+
|
148
|
+
doAnimate ?
|
149
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
150
|
+
callback()
|
151
|
+
|
152
|
+
} else if (!this.isShown && this.$backdrop) {
|
153
|
+
this.$backdrop.removeClass('in')
|
154
|
+
|
155
|
+
$.support.transition && this.$element.hasClass('fade')?
|
156
|
+
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
|
157
|
+
removeBackdrop.call(this)
|
158
|
+
|
159
|
+
} else if (callback) {
|
160
|
+
callback()
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
function removeBackdrop() {
|
165
|
+
this.$backdrop.remove()
|
166
|
+
this.$backdrop = null
|
167
|
+
}
|
168
|
+
|
169
|
+
function escape() {
|
170
|
+
var that = this
|
171
|
+
if (this.isShown && this.options.keyboard) {
|
172
|
+
$(document).on('keyup.dismiss.modal', function ( e ) {
|
173
|
+
e.which == 27 && that.hide()
|
174
|
+
})
|
175
|
+
} else if (!this.isShown) {
|
176
|
+
$(document).off('keyup.dismiss.modal')
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
/* MODAL PLUGIN DEFINITION
|
182
|
+
* ======================= */
|
183
|
+
|
184
|
+
$.fn.modal = function (option) {
|
185
|
+
return this.each(function () {
|
186
|
+
var $this = $(this)
|
187
|
+
, data = $this.data('modal')
|
188
|
+
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
189
|
+
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
190
|
+
if (typeof option == 'string') data[option]()
|
191
|
+
else if (options.show) data.show()
|
192
|
+
})
|
193
|
+
}
|
194
|
+
|
195
|
+
$.fn.modal.defaults = {
|
196
|
+
backdrop: true
|
197
|
+
, keyboard: true
|
198
|
+
, show: true
|
199
|
+
}
|
200
|
+
|
201
|
+
$.fn.modal.Constructor = Modal
|
202
|
+
|
203
|
+
|
204
|
+
/* MODAL DATA-API
|
205
|
+
* ============== */
|
206
|
+
|
207
|
+
$(function () {
|
208
|
+
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
209
|
+
var $this = $(this), href
|
210
|
+
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
211
|
+
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
212
|
+
|
213
|
+
e.preventDefault()
|
214
|
+
$target.modal(option)
|
215
|
+
})
|
216
|
+
})
|
217
|
+
|
218
|
+
}(window.jQuery);
|