spiderfw 0.5.19 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/VERSION +1 -1
- data/apps/core/auth/lib/rbac.rb +7 -2
- data/apps/core/auth/models/mixins/rbac_provider.rb +66 -4
- data/apps/core/components/assets.rb +63 -33
- data/apps/core/components/public/js/jquery/{jquery-1.4.3.js → jquery-1.5.2.js} +2617 -1126
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.apple.js +155 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.js +293 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/scrollable/scrollable.js +335 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.css +59 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.js +283 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/toolbox/toolbox.expose.js +224 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.dynamic.js +150 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.js +343 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js +78 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/button_bg.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/datepicker.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/icon_sprite.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/progress_bar.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_h_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_handles.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_v_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/tab_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/the_gradient.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/jquery-ui.custom.css +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-af.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ar.js +7 -8
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-az.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bg.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bs.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ca.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-cs.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-da.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-de.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-el.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eo.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-es.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-et.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eu.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fa.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fi.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fo.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr.js +12 -10
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-he.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hr.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hu.js +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hy.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-id.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-is.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-it.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ja.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ko.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-kz.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lt.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lv.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ms.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-nl.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-no.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pl.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ro.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ru.js +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sk.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sl.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sq.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sv.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ta.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-th.js +1 -1
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-tr.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-uk.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-vi.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.blind.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.bounce.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.clip.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.core.js +48 -15
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.drop.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.explode.js +2 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/jquery.effects.fade.js +32 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.fold.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.highlight.js +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.pulsate.js +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.scale.js +4 -4
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.shake.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.slide.js +4 -4
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.transfer.js +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.accordion.js +33 -20
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.autocomplete.js +104 -42
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.button.js +35 -13
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.core.js +111 -84
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.datepicker.js +87 -46
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.dialog.js +105 -75
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.draggable.js +17 -15
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.droppable.js +5 -5
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.mouse.js +16 -11
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.position.js +51 -32
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.progressbar.js +24 -10
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.resizable.js +7 -7
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.selectable.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.slider.js +9 -7
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.sortable.js +22 -20
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.tabs.js +15 -14
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.widget.js +50 -25
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/GPL-LICENSE.txt +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/MIT-LICENSE.txt +3 -7
- data/apps/core/components/public/js/jquery/plugins/bsmselect/README.md +185 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/css/jquery.bsmselect.css +64 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.compatibility.js +60 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +381 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.sortable.js +49 -0
- data/apps/core/components/public/js/plugins/sortable.js +16 -7
- data/apps/core/components/public/js/spider.js +60 -41
- data/apps/core/components/widgets/admin/admin.shtml +1 -1
- data/apps/core/components/widgets/list/list.shtml +2 -2
- data/apps/core/components/widgets/month_calendar/month_calendar.shtml +23 -20
- data/apps/core/components/widgets/switcher/switcher.rb +77 -21
- data/apps/core/components/widgets/switcher/templates/default.shtml +8 -0
- data/apps/core/components/widgets/switcher/templates/table.shtml +15 -0
- data/apps/core/components/widgets/table/table.rb +4 -1
- data/apps/core/components/widgets/table/table.shtml +10 -8
- data/apps/core/forms/public/css/form.css +9 -1
- data/apps/core/forms/public/date_time.js +14 -2
- data/apps/core/forms/public/input.js +1 -1
- data/apps/core/forms/public/select.js +4 -3
- data/apps/core/forms/tags/element_row.erb +11 -2
- data/apps/core/forms/widgets/inputs/date_time/date_time.rb +9 -0
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -1
- data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +2 -2
- data/apps/core/forms/widgets/inputs/input/input.rb +0 -3
- data/apps/core/forms/widgets/inputs/select/select.shtml +2 -2
- data/apps/messenger/backends/email/sendmail.rb +20 -0
- data/apps/messenger/backends/email/smtp.rb +12 -14
- data/apps/messenger/backends/email/test.rb +20 -0
- data/apps/messenger/config/options.rb +9 -9
- data/apps/messenger/config/test.config.yml +2 -0
- data/apps/messenger/controllers/mixins/messenger_helper.rb +41 -15
- data/apps/messenger/lib/email_backend.rb +10 -0
- data/apps/messenger/messenger.rb +45 -26
- data/apps/messenger/test/features/attachments.feature +26 -0
- data/apps/messenger/test/features/messenger_helper.feature +31 -0
- data/apps/messenger/test/features/sending_email.feature +10 -0
- data/apps/messenger/test/features/step_definitions/common_steps.rb +11 -0
- data/apps/messenger/test/features/step_definitions/email_steps.rb +98 -0
- data/apps/messenger/test/features/support/env.rb +11 -0
- data/apps/messenger/test/files/test_file1.txt +1 -0
- data/apps/messenger/test/lib/controllers/mail_test_controller.rb +34 -0
- data/apps/messenger/test/templates/email/multipart.html.erb +1 -0
- data/apps/messenger/test/templates/email/multipart.txt.erb +1 -0
- data/apps/messenger/test/templates/email/simple.erb +1 -0
- data/apps/messenger/test/templates/email/vars.erb +1 -0
- data/lib/spiderfw/cmd/cmd.rb +4 -0
- data/lib/spiderfw/cmd/commands/webserver.rb +12 -59
- data/lib/spiderfw/config/configuration.rb +4 -0
- data/lib/spiderfw/config/options/spider.rb +25 -8
- data/lib/spiderfw/controller/controller.rb +10 -4
- data/lib/spiderfw/controller/first_responder.rb +6 -20
- data/lib/spiderfw/controller/http_controller.rb +2 -1
- data/lib/spiderfw/controller/mixins/http_mixin.rb +12 -1
- data/lib/spiderfw/controller/mixins/visual.rb +3 -16
- data/lib/spiderfw/env.rb +1 -1
- data/lib/spiderfw/http/server.rb +178 -2
- data/lib/spiderfw/model/base_model.rb +142 -111
- data/lib/spiderfw/model/data_type.rb +15 -0
- data/lib/spiderfw/model/datatypes/decimal.rb +8 -0
- data/lib/spiderfw/model/datatypes/pk.rb +29 -0
- data/lib/spiderfw/model/datatypes.rb +1 -0
- data/lib/spiderfw/model/element.rb +5 -1
- data/lib/spiderfw/model/extended_models/managed.rb +1 -1
- data/lib/spiderfw/model/junction.rb +23 -0
- data/lib/spiderfw/model/mappers/db_mapper.rb +96 -80
- data/lib/spiderfw/model/mappers/document_mapper.rb +315 -0
- data/lib/spiderfw/model/mappers/mapper.rb +164 -75
- data/lib/spiderfw/model/mixins/list.rb +1 -0
- data/lib/spiderfw/model/mixins/versioned.rb +63 -27
- data/lib/spiderfw/model/model.rb +36 -9
- data/lib/spiderfw/model/query_funcs.rb +3 -0
- data/lib/spiderfw/model/query_set.rb +21 -1
- data/lib/spiderfw/model/storage/base_storage.rb +259 -6
- data/lib/spiderfw/model/storage/{db/db_connection_pool.rb → connection_pool.rb} +25 -21
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +25 -5
- data/lib/spiderfw/model/storage/db/adapters/oracle.rb +1 -1
- data/lib/spiderfw/model/storage/db/connectors/jdbc_oracle.rb +2 -2
- data/lib/spiderfw/model/storage/db/connectors/oci8.rb +3 -4
- data/lib/spiderfw/model/storage/db/db_storage.rb +18 -219
- data/lib/spiderfw/model/storage/document/adapters/mongodb.rb +307 -0
- data/lib/spiderfw/model/storage/document/document.rb +7 -0
- data/lib/spiderfw/model/storage/document/document_storage.rb +34 -0
- data/lib/spiderfw/model/storage.rb +23 -11
- data/lib/spiderfw/model/unit_of_work.rb +45 -22
- data/lib/spiderfw/spider.rb +660 -0
- data/lib/spiderfw/templates/blocks/html.rb +4 -2
- data/lib/spiderfw/templates/blocks/run.rb +1 -1
- data/lib/spiderfw/templates/blocks/tag_if.rb +1 -1
- data/lib/spiderfw/templates/blocks/widget.rb +1 -1
- data/lib/spiderfw/templates/layout.rb +29 -5
- data/lib/spiderfw/templates/template.rb +72 -7
- data/lib/spiderfw/templates/template_blocks.rb +1 -1
- data/lib/spiderfw/test/capybara.rb +7 -0
- data/lib/spiderfw/test/cucumber.rb +12 -0
- data/lib/spiderfw/test/page_object.rb +29 -0
- data/lib/spiderfw/test/spec.rb +20 -0
- data/lib/spiderfw/test/stubs/mapper_stub.rb +18 -0
- data/lib/spiderfw/test/stubs/storage_stub.rb +23 -0
- data/lib/spiderfw/test/unit.rb +23 -0
- data/lib/spiderfw/test.rb +89 -0
- data/lib/spiderfw/utils/json.rb +6 -0
- data/lib/spiderfw/utils/logger.rb +17 -4
- data/lib/spiderfw/utils/loggers/apache_commons_logger.rb +61 -0
- data/lib/spiderfw/utils/monkey/date_time.rb +2 -2
- data/lib/spiderfw/utils/monkey/module.rb +3 -1
- data/lib/spiderfw/utils/profiling.rb +2 -2
- data/lib/spiderfw/widget/widget.rb +31 -13
- data/lib/spiderfw.rb +1 -597
- data/spider.gemspec +9 -10
- metadata +193 -132
- data/apps/admin/_init.rb +0 -9
- data/apps/admin/controllers/admin_controller.rb +0 -12
- data/apps/admin/widgets/dashboard_widget/dashboard_widget.rb +0 -8
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/AUTHORS.txt +0 -30
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery-ui-i18n.js +0 -1176
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-no.js +0 -23
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/version.txt +0 -1
- data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.css +0 -64
- data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.js +0 -407
- data/apps/core/components/widgets/switcher/switcher.shtml +0 -17
- data/apps/master/po/master.pot +0 -400
@@ -0,0 +1,224 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* jQuery Tools @VERSION / Expose - Dim the lights
|
4
|
+
*
|
5
|
+
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
|
6
|
+
*
|
7
|
+
* http://flowplayer.org/tools/toolbox/expose.html
|
8
|
+
*
|
9
|
+
* Since: Mar 2010
|
10
|
+
* Date: @DATE
|
11
|
+
*/
|
12
|
+
(function($) {
|
13
|
+
|
14
|
+
// static constructs
|
15
|
+
$.tools = $.tools || {version: '@VERSION'};
|
16
|
+
|
17
|
+
var tool;
|
18
|
+
|
19
|
+
tool = $.tools.expose = {
|
20
|
+
|
21
|
+
conf: {
|
22
|
+
maskId: 'exposeMask',
|
23
|
+
loadSpeed: 'slow',
|
24
|
+
closeSpeed: 'fast',
|
25
|
+
closeOnClick: true,
|
26
|
+
closeOnEsc: true,
|
27
|
+
|
28
|
+
// css settings
|
29
|
+
zIndex: 9998,
|
30
|
+
opacity: 0.8,
|
31
|
+
startOpacity: 0,
|
32
|
+
color: '#fff',
|
33
|
+
|
34
|
+
// callbacks
|
35
|
+
onLoad: null,
|
36
|
+
onClose: null
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
/* one of the greatest headaches in the tool. finally made it */
|
41
|
+
function viewport() {
|
42
|
+
|
43
|
+
// the horror case
|
44
|
+
if ($.browser.msie) {
|
45
|
+
|
46
|
+
// if there are no scrollbars then use window.height
|
47
|
+
var d = $(document).height(), w = $(window).height();
|
48
|
+
|
49
|
+
return [
|
50
|
+
window.innerWidth || // ie7+
|
51
|
+
document.documentElement.clientWidth || // ie6
|
52
|
+
document.body.clientWidth, // ie6 quirks mode
|
53
|
+
d - w < 20 ? w : d
|
54
|
+
];
|
55
|
+
}
|
56
|
+
|
57
|
+
// other well behaving browsers
|
58
|
+
return [$(document).width(), $(document).height()];
|
59
|
+
}
|
60
|
+
|
61
|
+
function call(fn) {
|
62
|
+
if (fn) { return fn.call($.mask); }
|
63
|
+
}
|
64
|
+
|
65
|
+
var mask, exposed, loaded, config, overlayIndex;
|
66
|
+
|
67
|
+
|
68
|
+
$.mask = {
|
69
|
+
|
70
|
+
load: function(conf, els) {
|
71
|
+
|
72
|
+
// already loaded ?
|
73
|
+
if (loaded) { return this; }
|
74
|
+
|
75
|
+
// configuration
|
76
|
+
if (typeof conf == 'string') {
|
77
|
+
conf = {color: conf};
|
78
|
+
}
|
79
|
+
|
80
|
+
// use latest config
|
81
|
+
conf = conf || config;
|
82
|
+
|
83
|
+
config = conf = $.extend($.extend({}, tool.conf), conf);
|
84
|
+
|
85
|
+
// get the mask
|
86
|
+
mask = $("#" + conf.maskId);
|
87
|
+
|
88
|
+
// or create it
|
89
|
+
if (!mask.length) {
|
90
|
+
mask = $('<div/>').attr("id", conf.maskId);
|
91
|
+
$("body").append(mask);
|
92
|
+
}
|
93
|
+
|
94
|
+
// set position and dimensions
|
95
|
+
var size = viewport();
|
96
|
+
|
97
|
+
mask.css({
|
98
|
+
position:'absolute',
|
99
|
+
top: 0,
|
100
|
+
left: 0,
|
101
|
+
width: size[0],
|
102
|
+
height: size[1],
|
103
|
+
display: 'none',
|
104
|
+
opacity: conf.startOpacity,
|
105
|
+
zIndex: conf.zIndex
|
106
|
+
});
|
107
|
+
|
108
|
+
if (conf.color) {
|
109
|
+
mask.css("backgroundColor", conf.color);
|
110
|
+
}
|
111
|
+
|
112
|
+
// onBeforeLoad
|
113
|
+
if (call(conf.onBeforeLoad) === false) {
|
114
|
+
return this;
|
115
|
+
}
|
116
|
+
|
117
|
+
// esc button
|
118
|
+
if (conf.closeOnEsc) {
|
119
|
+
$(document).bind("keydown.mask", function(e) {
|
120
|
+
if (e.keyCode == 27) {
|
121
|
+
$.mask.close(e);
|
122
|
+
}
|
123
|
+
});
|
124
|
+
}
|
125
|
+
|
126
|
+
// mask click closes
|
127
|
+
if (conf.closeOnClick) {
|
128
|
+
mask.bind("click.mask", function(e) {
|
129
|
+
$.mask.close(e);
|
130
|
+
});
|
131
|
+
}
|
132
|
+
|
133
|
+
// resize mask when window is resized
|
134
|
+
$(window).bind("resize.mask", function() {
|
135
|
+
$.mask.fit();
|
136
|
+
});
|
137
|
+
|
138
|
+
// exposed elements
|
139
|
+
if (els && els.length) {
|
140
|
+
|
141
|
+
overlayIndex = els.eq(0).css("zIndex");
|
142
|
+
|
143
|
+
// make sure element is positioned absolutely or relatively
|
144
|
+
$.each(els, function() {
|
145
|
+
var el = $(this);
|
146
|
+
if (!/relative|absolute|fixed/i.test(el.css("position"))) {
|
147
|
+
el.css("position", "relative");
|
148
|
+
}
|
149
|
+
});
|
150
|
+
|
151
|
+
// make elements sit on top of the mask
|
152
|
+
exposed = els.css({ zIndex: Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)});
|
153
|
+
}
|
154
|
+
|
155
|
+
// reveal mask
|
156
|
+
mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() {
|
157
|
+
$.mask.fit();
|
158
|
+
call(conf.onLoad);
|
159
|
+
loaded = "full";
|
160
|
+
});
|
161
|
+
|
162
|
+
loaded = true;
|
163
|
+
return this;
|
164
|
+
},
|
165
|
+
|
166
|
+
close: function() {
|
167
|
+
if (loaded) {
|
168
|
+
|
169
|
+
// onBeforeClose
|
170
|
+
if (call(config.onBeforeClose) === false) { return this; }
|
171
|
+
|
172
|
+
mask.fadeOut(config.closeSpeed, function() {
|
173
|
+
call(config.onClose);
|
174
|
+
if (exposed) {
|
175
|
+
exposed.css({zIndex: overlayIndex});
|
176
|
+
}
|
177
|
+
loaded = false;
|
178
|
+
});
|
179
|
+
|
180
|
+
// unbind various event listeners
|
181
|
+
$(document).unbind("keydown.mask");
|
182
|
+
mask.unbind("click.mask");
|
183
|
+
$(window).unbind("resize.mask");
|
184
|
+
}
|
185
|
+
|
186
|
+
return this;
|
187
|
+
},
|
188
|
+
|
189
|
+
fit: function() {
|
190
|
+
if (loaded) {
|
191
|
+
var size = viewport();
|
192
|
+
mask.css({width: size[0], height: size[1]});
|
193
|
+
}
|
194
|
+
},
|
195
|
+
|
196
|
+
getMask: function() {
|
197
|
+
return mask;
|
198
|
+
},
|
199
|
+
|
200
|
+
isLoaded: function(fully) {
|
201
|
+
return fully ? loaded == 'full' : loaded;
|
202
|
+
},
|
203
|
+
|
204
|
+
getConf: function() {
|
205
|
+
return config;
|
206
|
+
},
|
207
|
+
|
208
|
+
getExposed: function() {
|
209
|
+
return exposed;
|
210
|
+
}
|
211
|
+
};
|
212
|
+
|
213
|
+
$.fn.mask = function(conf) {
|
214
|
+
$.mask.load(conf);
|
215
|
+
return this;
|
216
|
+
};
|
217
|
+
|
218
|
+
$.fn.expose = function(conf) {
|
219
|
+
$.mask.load(conf, this);
|
220
|
+
return this;
|
221
|
+
};
|
222
|
+
|
223
|
+
|
224
|
+
})(jQuery);
|
@@ -0,0 +1,150 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* jQuery Tools @VERSION / Tooltip Dynamic Positioning
|
4
|
+
*
|
5
|
+
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
|
6
|
+
*
|
7
|
+
* http://flowplayer.org/tools/tooltip/dynamic.html
|
8
|
+
*
|
9
|
+
* Since: July 2009
|
10
|
+
* Date: @DATE
|
11
|
+
*/
|
12
|
+
(function($) {
|
13
|
+
|
14
|
+
// version number
|
15
|
+
var t = $.tools.tooltip;
|
16
|
+
|
17
|
+
t.dynamic = {
|
18
|
+
conf: {
|
19
|
+
classNames: "top right bottom left"
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
/*
|
24
|
+
* See if element is on the viewport. Returns an boolean array specifying which
|
25
|
+
* edges are hidden. Edges are in following order:
|
26
|
+
*
|
27
|
+
* [top, right, bottom, left]
|
28
|
+
*
|
29
|
+
* For example following return value means that top and right edges are hidden
|
30
|
+
*
|
31
|
+
* [true, true, false, false]
|
32
|
+
*
|
33
|
+
*/
|
34
|
+
function getCropping(el) {
|
35
|
+
|
36
|
+
var w = $(window);
|
37
|
+
var right = w.width() + w.scrollLeft();
|
38
|
+
var bottom = w.height() + w.scrollTop();
|
39
|
+
|
40
|
+
return [
|
41
|
+
el.offset().top <= w.scrollTop(), // top
|
42
|
+
right <= el.offset().left + el.width(), // right
|
43
|
+
bottom <= el.offset().top + el.height(), // bottom
|
44
|
+
w.scrollLeft() >= el.offset().left // left
|
45
|
+
];
|
46
|
+
}
|
47
|
+
|
48
|
+
/*
|
49
|
+
Returns true if all edges of an element are on viewport. false if not
|
50
|
+
|
51
|
+
@param crop the cropping array returned by getCropping function
|
52
|
+
*/
|
53
|
+
function isVisible(crop) {
|
54
|
+
var i = crop.length;
|
55
|
+
while (i--) {
|
56
|
+
if (crop[i]) { return false; }
|
57
|
+
}
|
58
|
+
return true;
|
59
|
+
}
|
60
|
+
|
61
|
+
// dynamic plugin
|
62
|
+
$.fn.dynamic = function(conf) {
|
63
|
+
|
64
|
+
if (typeof conf == 'number') { conf = {speed: conf}; }
|
65
|
+
|
66
|
+
conf = $.extend({}, t.dynamic.conf, conf);
|
67
|
+
|
68
|
+
var cls = conf.classNames.split(/\s/), orig;
|
69
|
+
|
70
|
+
this.each(function() {
|
71
|
+
|
72
|
+
var api = $(this).tooltip().onBeforeShow(function(e, pos) {
|
73
|
+
|
74
|
+
// get nessessary variables
|
75
|
+
var tip = this.getTip(), tipConf = this.getConf();
|
76
|
+
|
77
|
+
/*
|
78
|
+
We store the original configuration and use it to restore back to the original state.
|
79
|
+
*/
|
80
|
+
if (!orig) {
|
81
|
+
orig = [
|
82
|
+
tipConf.position[0],
|
83
|
+
tipConf.position[1],
|
84
|
+
tipConf.offset[0],
|
85
|
+
tipConf.offset[1],
|
86
|
+
$.extend({}, tipConf)
|
87
|
+
];
|
88
|
+
}
|
89
|
+
|
90
|
+
/*
|
91
|
+
display tip in it's default position and by setting visibility to hidden.
|
92
|
+
this way we can check whether it will be on the viewport
|
93
|
+
*/
|
94
|
+
$.extend(tipConf, orig[4]);
|
95
|
+
tipConf.position = [orig[0], orig[1]];
|
96
|
+
tipConf.offset = [orig[2], orig[3]];
|
97
|
+
|
98
|
+
tip.css({
|
99
|
+
visibility: 'hidden',
|
100
|
+
position: 'absolute',
|
101
|
+
top: pos.top,
|
102
|
+
left: pos.left
|
103
|
+
}).show();
|
104
|
+
|
105
|
+
// now let's see for hidden edges
|
106
|
+
var crop = getCropping(tip);
|
107
|
+
|
108
|
+
// possibly alter the configuration
|
109
|
+
if (!isVisible(crop)) {
|
110
|
+
|
111
|
+
// change the position and add class
|
112
|
+
if (crop[2]) { $.extend(tipConf, conf.top); tipConf.position[0] = 'top'; tip.addClass(cls[0]); }
|
113
|
+
if (crop[3]) { $.extend(tipConf, conf.right); tipConf.position[1] = 'right'; tip.addClass(cls[1]); }
|
114
|
+
if (crop[0]) { $.extend(tipConf, conf.bottom); tipConf.position[0] = 'bottom'; tip.addClass(cls[2]); }
|
115
|
+
if (crop[1]) { $.extend(tipConf, conf.left); tipConf.position[1] = 'left'; tip.addClass(cls[3]); }
|
116
|
+
|
117
|
+
// vertical offset
|
118
|
+
if (crop[0] || crop[2]) { tipConf.offset[0] *= -1; }
|
119
|
+
|
120
|
+
// horizontal offset
|
121
|
+
if (crop[1] || crop[3]) { tipConf.offset[1] *= -1; }
|
122
|
+
}
|
123
|
+
|
124
|
+
tip.css({visibility: 'visible'}).hide();
|
125
|
+
|
126
|
+
});
|
127
|
+
|
128
|
+
// restore positioning as soon as possible
|
129
|
+
api.onBeforeShow(function() {
|
130
|
+
var c = this.getConf(), tip = this.getTip();
|
131
|
+
setTimeout(function() {
|
132
|
+
c.position = [orig[0], orig[1]];
|
133
|
+
c.offset = [orig[2], orig[3]];
|
134
|
+
}, 0);
|
135
|
+
});
|
136
|
+
|
137
|
+
// remove custom class names and restore original effect
|
138
|
+
api.onHide(function() {
|
139
|
+
var tip = this.getTip();
|
140
|
+
tip.removeClass(conf.classNames);
|
141
|
+
});
|
142
|
+
|
143
|
+
ret = api;
|
144
|
+
|
145
|
+
});
|
146
|
+
|
147
|
+
return conf.api ? ret : this;
|
148
|
+
};
|
149
|
+
|
150
|
+
}) (jQuery);
|
@@ -0,0 +1,343 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* jQuery Tools @VERSION Tooltip - UI essentials
|
4
|
+
*
|
5
|
+
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
|
6
|
+
*
|
7
|
+
* http://flowplayer.org/tools/tooltip/
|
8
|
+
*
|
9
|
+
* Since: November 2008
|
10
|
+
* Date: @DATE
|
11
|
+
*/
|
12
|
+
(function($) {
|
13
|
+
// static constructs
|
14
|
+
$.tools = $.tools || {version: '@VERSION'};
|
15
|
+
|
16
|
+
$.tools.tooltip = {
|
17
|
+
|
18
|
+
conf: {
|
19
|
+
|
20
|
+
// default effect variables
|
21
|
+
effect: 'toggle',
|
22
|
+
fadeOutSpeed: "fast",
|
23
|
+
predelay: 0,
|
24
|
+
delay: 30,
|
25
|
+
opacity: 1,
|
26
|
+
tip: 0,
|
27
|
+
|
28
|
+
// 'top', 'bottom', 'right', 'left', 'center'
|
29
|
+
position: ['top', 'center'],
|
30
|
+
offset: [0, 0],
|
31
|
+
relative: false,
|
32
|
+
cancelDefault: true,
|
33
|
+
|
34
|
+
// type to event mapping
|
35
|
+
events: {
|
36
|
+
def: "mouseenter,mouseleave",
|
37
|
+
input: "focus,blur",
|
38
|
+
widget: "focus mouseenter,blur mouseleave",
|
39
|
+
tooltip: "mouseenter,mouseleave"
|
40
|
+
},
|
41
|
+
|
42
|
+
// 1.2
|
43
|
+
layout: '<div/>',
|
44
|
+
tipClass: 'tooltip'
|
45
|
+
},
|
46
|
+
|
47
|
+
addEffect: function(name, loadFn, hideFn) {
|
48
|
+
effects[name] = [loadFn, hideFn];
|
49
|
+
}
|
50
|
+
};
|
51
|
+
|
52
|
+
|
53
|
+
var effects = {
|
54
|
+
toggle: [
|
55
|
+
function(done) {
|
56
|
+
var conf = this.getConf(), tip = this.getTip(), o = conf.opacity;
|
57
|
+
if (o < 1) { tip.css({opacity: o}); }
|
58
|
+
tip.show();
|
59
|
+
done.call();
|
60
|
+
},
|
61
|
+
|
62
|
+
function(done) {
|
63
|
+
this.getTip().hide();
|
64
|
+
done.call();
|
65
|
+
}
|
66
|
+
],
|
67
|
+
|
68
|
+
fade: [
|
69
|
+
function(done) {
|
70
|
+
var conf = this.getConf();
|
71
|
+
this.getTip().fadeTo(conf.fadeInSpeed, conf.opacity, done);
|
72
|
+
},
|
73
|
+
function(done) {
|
74
|
+
this.getTip().fadeOut(this.getConf().fadeOutSpeed, done);
|
75
|
+
}
|
76
|
+
]
|
77
|
+
};
|
78
|
+
|
79
|
+
|
80
|
+
/* calculate tip position relative to the trigger */
|
81
|
+
function getPosition(trigger, tip, conf) {
|
82
|
+
|
83
|
+
|
84
|
+
// get origin top/left position
|
85
|
+
var top = conf.relative ? trigger.position().top : trigger.offset().top,
|
86
|
+
left = conf.relative ? trigger.position().left : trigger.offset().left,
|
87
|
+
pos = conf.position[0];
|
88
|
+
|
89
|
+
top -= tip.outerHeight() - conf.offset[0];
|
90
|
+
left += trigger.outerWidth() + conf.offset[1];
|
91
|
+
|
92
|
+
// iPad position fix
|
93
|
+
if (/iPad/i.test(navigator.userAgent)) {
|
94
|
+
top -= $(window).scrollTop();
|
95
|
+
}
|
96
|
+
|
97
|
+
// adjust Y
|
98
|
+
var height = tip.outerHeight() + trigger.outerHeight();
|
99
|
+
if (pos == 'center') { top += height / 2; }
|
100
|
+
if (pos == 'bottom') { top += height; }
|
101
|
+
|
102
|
+
|
103
|
+
// adjust X
|
104
|
+
pos = conf.position[1];
|
105
|
+
var width = tip.outerWidth() + trigger.outerWidth();
|
106
|
+
if (pos == 'center') { left -= width / 2; }
|
107
|
+
if (pos == 'left') { left -= width; }
|
108
|
+
|
109
|
+
return {top: top, left: left};
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
function Tooltip(trigger, conf) {
|
115
|
+
|
116
|
+
var self = this,
|
117
|
+
fire = trigger.add(self),
|
118
|
+
tip,
|
119
|
+
timer = 0,
|
120
|
+
pretimer = 0,
|
121
|
+
title = trigger.attr("title"),
|
122
|
+
tipAttr = trigger.attr("data-tooltip"),
|
123
|
+
effect = effects[conf.effect],
|
124
|
+
shown,
|
125
|
+
|
126
|
+
// get show/hide configuration
|
127
|
+
isInput = trigger.is(":input"),
|
128
|
+
isWidget = isInput && trigger.is(":checkbox, :radio, select, :button, :submit"),
|
129
|
+
type = trigger.attr("type"),
|
130
|
+
evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def'];
|
131
|
+
|
132
|
+
|
133
|
+
// check that configuration is sane
|
134
|
+
if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; }
|
135
|
+
|
136
|
+
evt = evt.split(/,\s*/);
|
137
|
+
if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; }
|
138
|
+
|
139
|
+
|
140
|
+
// trigger --> show
|
141
|
+
trigger.bind(evt[0], function(e) {
|
142
|
+
|
143
|
+
clearTimeout(timer);
|
144
|
+
if (conf.predelay) {
|
145
|
+
pretimer = setTimeout(function() { self.show(e); }, conf.predelay);
|
146
|
+
|
147
|
+
} else {
|
148
|
+
self.show(e);
|
149
|
+
}
|
150
|
+
|
151
|
+
// trigger --> hide
|
152
|
+
}).bind(evt[1], function(e) {
|
153
|
+
clearTimeout(pretimer);
|
154
|
+
if (conf.delay) {
|
155
|
+
timer = setTimeout(function() { self.hide(e); }, conf.delay);
|
156
|
+
|
157
|
+
} else {
|
158
|
+
self.hide(e);
|
159
|
+
}
|
160
|
+
|
161
|
+
});
|
162
|
+
|
163
|
+
|
164
|
+
// remove default title
|
165
|
+
if (title && conf.cancelDefault) {
|
166
|
+
trigger.removeAttr("title");
|
167
|
+
trigger.data("title", title);
|
168
|
+
}
|
169
|
+
|
170
|
+
$.extend(self, {
|
171
|
+
|
172
|
+
show: function(e) {
|
173
|
+
|
174
|
+
// tip not initialized yet
|
175
|
+
if (!tip) {
|
176
|
+
|
177
|
+
// data-tooltip
|
178
|
+
if (tipAttr) {
|
179
|
+
tip = $(tipAttr);
|
180
|
+
|
181
|
+
// single tip element for all
|
182
|
+
} else if (conf.tip) {
|
183
|
+
tip = $(conf.tip).eq(0);
|
184
|
+
|
185
|
+
// autogenerated tooltip
|
186
|
+
} else if (title) {
|
187
|
+
tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body)
|
188
|
+
.hide().append(title);
|
189
|
+
|
190
|
+
// manual tooltip
|
191
|
+
} else {
|
192
|
+
tip = trigger.next();
|
193
|
+
if (!tip.length) { tip = trigger.parent().next(); }
|
194
|
+
}
|
195
|
+
|
196
|
+
if (!tip.length) { throw "Cannot find tooltip for " + trigger; }
|
197
|
+
}
|
198
|
+
|
199
|
+
if (self.isShown()) { return self; }
|
200
|
+
|
201
|
+
// stop previous animation
|
202
|
+
tip.stop(true, true);
|
203
|
+
|
204
|
+
// get position
|
205
|
+
var pos = getPosition(trigger, tip, conf);
|
206
|
+
|
207
|
+
// restore title for single tooltip element
|
208
|
+
if (conf.tip) {
|
209
|
+
tip.html(trigger.data("title"));
|
210
|
+
}
|
211
|
+
|
212
|
+
// onBeforeShow
|
213
|
+
e = e || $.Event();
|
214
|
+
e.type = "onBeforeShow";
|
215
|
+
fire.trigger(e, [pos]);
|
216
|
+
if (e.isDefaultPrevented()) { return self; }
|
217
|
+
|
218
|
+
|
219
|
+
// onBeforeShow may have altered the configuration
|
220
|
+
pos = getPosition(trigger, tip, conf);
|
221
|
+
|
222
|
+
// set position
|
223
|
+
tip.css({position:'absolute', top: pos.top, left: pos.left});
|
224
|
+
|
225
|
+
shown = true;
|
226
|
+
|
227
|
+
// invoke effect
|
228
|
+
effect[0].call(self, function() {
|
229
|
+
e.type = "onShow";
|
230
|
+
shown = 'full';
|
231
|
+
fire.trigger(e);
|
232
|
+
});
|
233
|
+
|
234
|
+
|
235
|
+
// tooltip events
|
236
|
+
var event = conf.events.tooltip.split(/,\s*/);
|
237
|
+
|
238
|
+
if (!tip.data("__set")) {
|
239
|
+
|
240
|
+
tip.bind(event[0], function() {
|
241
|
+
clearTimeout(timer);
|
242
|
+
clearTimeout(pretimer);
|
243
|
+
});
|
244
|
+
|
245
|
+
if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) {
|
246
|
+
tip.bind(event[1], function(e) {
|
247
|
+
|
248
|
+
// being moved to the trigger element
|
249
|
+
if (e.relatedTarget != trigger[0]) {
|
250
|
+
trigger.trigger(evt[1].split(" ")[0]);
|
251
|
+
}
|
252
|
+
});
|
253
|
+
}
|
254
|
+
|
255
|
+
tip.data("__set", true);
|
256
|
+
}
|
257
|
+
|
258
|
+
return self;
|
259
|
+
},
|
260
|
+
|
261
|
+
hide: function(e) {
|
262
|
+
|
263
|
+
if (!tip || !self.isShown()) { return self; }
|
264
|
+
|
265
|
+
// onBeforeHide
|
266
|
+
e = e || $.Event();
|
267
|
+
e.type = "onBeforeHide";
|
268
|
+
fire.trigger(e);
|
269
|
+
if (e.isDefaultPrevented()) { return; }
|
270
|
+
|
271
|
+
shown = false;
|
272
|
+
|
273
|
+
effects[conf.effect][1].call(self, function() {
|
274
|
+
e.type = "onHide";
|
275
|
+
fire.trigger(e);
|
276
|
+
});
|
277
|
+
|
278
|
+
return self;
|
279
|
+
},
|
280
|
+
|
281
|
+
isShown: function(fully) {
|
282
|
+
return fully ? shown == 'full' : shown;
|
283
|
+
},
|
284
|
+
|
285
|
+
getConf: function() {
|
286
|
+
return conf;
|
287
|
+
},
|
288
|
+
|
289
|
+
getTip: function() {
|
290
|
+
return tip;
|
291
|
+
},
|
292
|
+
|
293
|
+
getTrigger: function() {
|
294
|
+
return trigger;
|
295
|
+
}
|
296
|
+
|
297
|
+
});
|
298
|
+
|
299
|
+
// callbacks
|
300
|
+
$.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) {
|
301
|
+
|
302
|
+
// configuration
|
303
|
+
if ($.isFunction(conf[name])) {
|
304
|
+
$(self).bind(name, conf[name]);
|
305
|
+
}
|
306
|
+
|
307
|
+
// API
|
308
|
+
self[name] = function(fn) {
|
309
|
+
if (fn) { $(self).bind(name, fn); }
|
310
|
+
return self;
|
311
|
+
};
|
312
|
+
});
|
313
|
+
|
314
|
+
}
|
315
|
+
|
316
|
+
|
317
|
+
// jQuery plugin implementation
|
318
|
+
$.fn.tooltip = function(conf) {
|
319
|
+
|
320
|
+
// return existing instance
|
321
|
+
var api = this.data("tooltip");
|
322
|
+
if (api) { return api; }
|
323
|
+
|
324
|
+
conf = $.extend(true, {}, $.tools.tooltip.conf, conf);
|
325
|
+
|
326
|
+
// position can also be given as string
|
327
|
+
if (typeof conf.position == 'string') {
|
328
|
+
conf.position = conf.position.split(/,?\s/);
|
329
|
+
}
|
330
|
+
|
331
|
+
// install tooltip for each entry in jQuery object
|
332
|
+
this.each(function() {
|
333
|
+
api = new Tooltip($(this), conf);
|
334
|
+
$(this).data("tooltip", api);
|
335
|
+
});
|
336
|
+
|
337
|
+
return conf.api ? api: this;
|
338
|
+
};
|
339
|
+
|
340
|
+
}) (jQuery);
|
341
|
+
|
342
|
+
|
343
|
+
|