spiderfw 0.5.13 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -0
- data/Rakefile +7 -4
- data/VERSION +1 -1
- data/apps/admin/_init.rb +9 -0
- data/apps/admin/controllers/admin_controller.rb +12 -0
- data/apps/admin/widgets/dashboard_widget/dashboard_widget.rb +8 -0
- data/apps/app_server/app_server.rb +11 -1
- data/apps/app_server/config/options.rb +4 -0
- data/apps/app_server/controllers/app_server_controller.rb +47 -9
- data/apps/app_server/lib/app.rb +3 -1
- data/apps/app_server/lib/git_app.rb +16 -0
- data/apps/app_server/views/app_list.shtml +1 -1
- data/apps/cas_server/config/options.rb +4 -0
- data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +192 -31
- data/apps/cas_server/lib/cas.rb +31 -9
- data/apps/core/auth/_init.rb +2 -2
- data/apps/core/auth/config/options.rb +6 -0
- data/apps/core/auth/controllers/login_controller.rb +1 -1
- data/apps/core/auth/controllers/mixins/auth_helper.rb +6 -1
- data/apps/core/auth/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
- data/apps/core/auth/lib/login_authenticator.rb +12 -1
- data/apps/core/auth/lib/rbac.rb +25 -0
- data/apps/core/auth/models/group.rb +3 -8
- data/apps/core/auth/models/login_user.rb +11 -1
- data/apps/core/auth/models/mixins/rbac_provider.rb +60 -0
- data/apps/core/auth/po/it/spider_auth.po +19 -3
- data/apps/core/auth/po/spider_auth.pot +18 -2
- data/apps/core/auth/views/login.shtml +1 -0
- data/apps/core/components/_init.rb +2 -0
- data/apps/core/components/assets.rb +112 -0
- data/apps/core/components/po/it/spider_components.po +20 -6
- data/apps/core/components/po/spider_components.pot +16 -4
- data/apps/core/components/public/css/grid/1140.css +80 -0
- data/apps/core/components/public/css/grid/ie.css +43 -0
- data/apps/core/components/public/css/grid/layout.css +32 -0
- data/apps/core/components/public/css/grid/mobile.css +26 -0
- data/apps/core/components/public/css/grid/smallerscreen.css +3 -0
- data/apps/core/components/public/css/grid/typeimg.css +72 -0
- data/apps/core/components/public/js/jquery/{jquery-1.4.2.js → jquery-1.4.3.js} +1524 -881
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/button_bg.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/datepicker.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/icon_sprite.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/progress_bar.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/slider_h_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/slider_handles.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/slider_v_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/tab_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/the_gradient.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/smoothness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness → jquery-ui-1.8.4/css/Aristo}/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css → jquery-ui-1.8.4/css/Aristo/jquery-ui.custom.css} +249 -135
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/AUTHORS.txt +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/GPL-LICENSE.txt +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/MIT-LICENSE.txt +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui → jquery-ui-1.8.4}/development-bundle/ui/i18n/jquery-ui-i18n.js +516 -111
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-af.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ar.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ar.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-az.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-bg.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-bg.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-bs.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ca.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ca.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-cs.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-cs.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-da.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-da.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-de.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-de.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-el.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-el.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-en-GB.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-eo.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-eo.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-es.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-es.js} +7 -3
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-et.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-eu.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-fa.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fa.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-fi.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fi.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fo.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fr-CH.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-fr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-he.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-he.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-hr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-hr.js} +8 -4
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-hu.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-hu.js} +8 -4
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-hy.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-hy.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-id.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-id.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-is.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-is.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-it.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-it.js} +10 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ja.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ja.js} +5 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ko.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ko.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-lt.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-lt.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-lv.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-lv.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ms.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ms.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-nl.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-nl.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-no.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-no.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-pl.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-pl.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-pt-BR.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-pt-BR.js} +9 -5
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ro.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ro.js} +7 -3
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-ru.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ru.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sk.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sk.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sl.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sl.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sq.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sq.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr-SR.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sr-SR.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sr.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-sv.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-sv.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-ta.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-th.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-th.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-tr.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-tr.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-uk.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-uk.js} +10 -12
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-vi.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-CN.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-zh-CN.js} +6 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-zh-HK.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-TW.js → jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-zh-TW.js} +6 -2
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.blind.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.blind.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.bounce.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.bounce.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.clip.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.clip.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.core.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.core.js} +390 -221
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.drop.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.drop.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.explode.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.explode.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.fold.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.fold.js} +6 -6
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.effects.highlight.js +50 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.effects.pulsate.js +51 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.scale.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.scale.js} +29 -31
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.shake.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.shake.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.slide.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.slide.js} +6 -6
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/effects.transfer.js → jquery-ui-1.8.4/development-bundle/ui/jquery.effects.transfer.js} +6 -6
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.accordion.js +598 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.autocomplete.js +550 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.button.js +365 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.core.js +281 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.datepicker.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.datepicker.js} +343 -247
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.dialog.js +827 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.draggable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.draggable.js} +107 -76
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.droppable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.droppable.js} +48 -45
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.mouse.js +151 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.position.js +233 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.progressbar.js +94 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.resizable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.resizable.js} +73 -61
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.selectable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.selectable.js} +42 -33
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.slider.js +680 -0
- data/apps/core/components/public/js/jquery/{jquery-ui/development-bundle/ui/ui.sortable.js → jquery-ui-1.8.4/development-bundle/ui/jquery.ui.sortable.js} +136 -84
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.tabs.js +757 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/jquery.ui.widget.js +237 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/version.txt +1 -0
- data/apps/core/components/public/js/jquery/patches/jquery-ui/jquery.ui.autocomplete-001.patch +17 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.datalink.js +258 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.json.js +178 -0
- data/apps/core/components/public/js/plugins/sortable.js +96 -72
- data/apps/core/components/public/js/spider.js +108 -50
- data/apps/core/components/public/js/utils.i18n.json +1 -0
- data/apps/core/components/public/js/utils.js +27 -0
- data/apps/core/components/widgets/admin/admin.rb +1 -1
- data/apps/core/components/widgets/admin/admin.shtml +1 -0
- data/apps/core/components/widgets/crud/crud.rb +6 -2
- data/apps/core/components/widgets/crud/crud.shtml +1 -0
- data/apps/core/components/widgets/list/list.rb +1 -1
- data/apps/core/components/widgets/list/list.shtml +2 -2
- data/apps/core/components/widgets/search_table/search_table.shtml +1 -1
- data/apps/core/components/widgets/switcher/switcher.rb +5 -1
- data/apps/core/components/widgets/table/table.rb +18 -3
- data/apps/core/components/widgets/table/table.shtml +1 -1
- data/apps/core/components/widgets/tabs/tabs.rb +0 -1
- data/apps/core/forms/_init.rb +3 -1
- data/apps/core/forms/public/ckeditor/adapters/jquery.js +6 -0
- data/apps/core/forms/public/ckeditor/ckeditor.js +137 -0
- data/apps/core/forms/public/ckeditor/images/spacer.gif +0 -0
- data/apps/core/forms/public/ckeditor/lang/_languages.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/_translationstatus.txt +60 -0
- data/apps/core/forms/public/ckeditor/lang/af.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ar.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/bg.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/bn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/bs.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ca.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/cs.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/cy.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/da.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/de.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/el.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en-au.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en-ca.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en-gb.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/eo.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/es.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/et.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/eu.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fa.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fi.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fo.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fr-ca.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/fr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/gl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/gu.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/hi.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/hr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/hu.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/is.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/it.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ja.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/km.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ko.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/lt.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/lv.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/mn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ms.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/nb.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/nl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/no.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/pl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/pt-br.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/pt.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ro.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/ru.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sk.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sl.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sr-latn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/sv.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/th.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/tr.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/uk.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/vi.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/zh-cn.js +6 -0
- data/apps/core/forms/public/ckeditor/lang/zh.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/a11yhelp/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/about/dialogs/about.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/autogrow/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/colordialog/dialogs/colordialog.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/apps/core/forms/public/ckeditor/plugins/div/dialogs/div.js +8 -0
- data/apps/core/forms/public/ckeditor/plugins/find/dialogs/find.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/flash/dialogs/flash.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/button.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/checkbox.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/form.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/radio.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/select.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textarea.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/dialogs/textfield.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/iframedialog/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/image/dialogs/image.js +13 -0
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/anchor.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/link/dialogs/link.js +11 -0
- data/apps/core/forms/public/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/liststyle/dialogs/liststyle.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/pastefromword/filter/default.js +10 -0
- data/apps/core/forms/public/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/options.js +8 -0
- data/apps/core/forms/public/ckeditor/plugins/scayt/dialogs/toolbar.css +6 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/dialogs/smiley.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/specialchar/dialogs/specialchar.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/styles/styles/default.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/table/dialogs/table.js +9 -0
- data/apps/core/forms/public/ckeditor/plugins/tableresize/plugin.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/tabletools/dialogs/tableCell.js +8 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/dialogs/templates.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/default.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/dialogs/uicolor.js +7 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/en.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/lang/he.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/plugin.js +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/assets/yui.css +6 -0
- data/apps/core/forms/public/ckeditor/plugins/uicolor/yui/yui.js +76 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.css +6 -0
- data/apps/core/forms/public/ckeditor/plugins/wsc/dialogs/wsc.js +7 -0
- data/apps/core/forms/public/ckeditor/skins/kama/dialog.css +9 -0
- data/apps/core/forms/public/ckeditor/skins/kama/editor.css +12 -0
- data/apps/core/forms/public/ckeditor/skins/kama/icons.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/mini.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/noimage.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/sprites.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/apps/core/forms/public/ckeditor/skins/kama/skin.js +7 -0
- data/apps/core/forms/public/ckeditor/skins/kama/templates.css +6 -0
- data/apps/core/forms/public/ckeditor/themes/default/theme.js +8 -0
- data/apps/core/forms/public/css/form.css +3 -0
- data/apps/core/forms/public/file_input.js +1 -1
- data/apps/core/forms/public/html_area.js +55 -0
- data/apps/core/forms/public/search_select.js +46 -19
- data/apps/core/forms/public/select.js +11 -5
- data/apps/core/forms/widgets/form/form.rb +22 -6
- data/apps/core/forms/widgets/form/form.shtml +2 -0
- data/apps/core/forms/widgets/inputs/date_time/date_time.rb +6 -1
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -0
- data/apps/core/forms/widgets/inputs/html_area/html_area.rb +51 -0
- data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +13 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.rb +8 -10
- data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +7 -7
- data/apps/core/forms/widgets/inputs/select/select.rb +15 -9
- data/apps/core/forms/widgets/inputs/select/select.shtml +1 -1
- data/apps/core/forms/widgets/inputs/time_span/time_span.rb +42 -0
- data/apps/core/forms/widgets/inputs/time_span/time_span.shtml +8 -0
- data/apps/master/_init.rb +18 -0
- data/apps/master/cmd.rb +57 -0
- data/apps/master/config/options.rb +6 -0
- data/apps/master/controllers/login_controller.rb +22 -0
- data/apps/master/controllers/master_controller.rb +261 -10
- data/apps/master/controllers/scout_controller.rb +121 -0
- data/apps/master/controllers/servant_controller.rb +16 -0
- data/apps/master/data/locale/it/LC_MESSAGES/spider_master.mo +0 -0
- data/apps/master/lib/resource.rb +7 -0
- data/apps/master/lib/resources/db_resource.rb +7 -0
- data/apps/master/lib/scout_plugin.rb +89 -0
- data/apps/master/lib/site_type.rb +24 -0
- data/apps/master/master.rb +40 -0
- data/apps/master/models/admin.rb +35 -0
- data/apps/master/models/command.rb +17 -0
- data/apps/master/models/customer.rb +20 -1
- data/apps/master/models/resource.rb +1 -0
- data/apps/master/models/scout_alert.rb +30 -0
- data/apps/master/models/scout_average.rb +23 -0
- data/apps/master/models/scout_error.rb +30 -0
- data/apps/master/models/scout_plugin_info.rb +11 -0
- data/apps/master/models/scout_plugin_instance.rb +303 -0
- data/apps/master/models/scout_plugin_trigger.rb +285 -0
- data/apps/master/models/scout_report.rb +31 -0
- data/apps/master/models/scout_report_field.rb +26 -0
- data/apps/master/models/servant.rb +82 -6
- data/apps/master/plugins/resources/apache/apache.rb +9 -0
- data/apps/master/plugins/resources/mysql/mysql.rb +45 -0
- data/apps/master/plugins/site_types/spider/spider.rb +11 -0
- data/apps/master/po/it/spider_master.po +352 -0
- data/apps/master/po/spider_master.pot +331 -0
- data/apps/master/public/css/img/web.png +0 -0
- data/apps/master/public/css/login.css +51 -0
- data/apps/master/public/css/master.css +290 -0
- data/apps/master/public/css/reset.css +23 -0
- data/apps/master/public/js/charts.js +84 -0
- data/apps/master/public/js/master.js +3 -0
- data/apps/master/templates/email/alert.html.erb +14 -0
- data/apps/master/templates/email/alert.text.erb +4 -0
- data/apps/master/views/admin.layout.shtml +14 -0
- data/apps/master/views/admin.shtml +5 -0
- data/apps/master/views/customer.shtml +37 -14
- data/apps/master/views/customers.shtml +9 -7
- data/apps/master/views/login.layout.shtml +13 -0
- data/apps/master/views/master.layout.shtml +26 -3
- data/apps/master/views/plugin_data.shtml +30 -0
- data/apps/master/views/plugin_edit.shtml +41 -0
- data/apps/master/views/plugin_instance.shtml +43 -0
- data/apps/master/views/servant.shtml +74 -0
- data/apps/master/views/servants.shtml +4 -0
- data/apps/master/views/site.shtml +3 -0
- data/apps/master/views/site_edit.shtml +17 -0
- data/apps/master/views/trigger_edit.shtml +100 -0
- data/apps/messenger/_init.rb +27 -1
- data/apps/messenger/backends/email/smtp.rb +76 -0
- data/apps/messenger/backends/sms/smstools.rb +46 -0
- data/apps/messenger/config/options.rb +28 -2
- data/apps/messenger/controllers/mixins/messenger_helper.rb +9 -5
- data/apps/messenger/lib/email_backend.rb +14 -0
- data/apps/messenger/lib/sms_backend.rb +14 -0
- data/apps/messenger/messenger.rb +32 -41
- data/apps/messenger/models/email.rb +2 -0
- data/apps/messenger/models/message.rb +37 -15
- data/apps/messenger/models/sms.rb +15 -0
- data/apps/servant/bin/spider-servant.rb +2 -1
- data/apps/servant/cmd.rb +62 -0
- data/apps/servant/controllers/servant_controller.rb +12 -0
- data/apps/servant/lib/resource.rb +3 -0
- data/apps/servant/lib/resources/db/mysql.rb +4 -0
- data/apps/servant/lib/resources/db.rb +1 -0
- data/apps/servant/lib/servant.rb +9 -3
- data/apps/worker/cmd.rb +1 -1
- data/apps/worker/models/job.rb +5 -2
- data/apps/worker/worker.rb +7 -5
- data/blueprints/install/config.ru +0 -1
- data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
- data/lib/spiderfw/app.rb +77 -5
- data/lib/spiderfw/cache/template_cache.rb +15 -5
- data/lib/spiderfw/cmd/cmd.rb +2 -0
- data/lib/spiderfw/cmd/commands/app.rb +159 -0
- data/lib/spiderfw/cmd/commands/config.rb +16 -0
- data/lib/spiderfw/cmd/commands/content.rb +1 -1
- data/lib/spiderfw/cmd/commands/create.rb +13 -0
- data/lib/spiderfw/cmd/commands/model.rb +5 -1
- data/lib/spiderfw/cmd/commands/setup.rb +44 -10
- data/lib/spiderfw/cmd/commands/webserver.rb +15 -1
- data/lib/spiderfw/config/configuration.rb +19 -2
- data/lib/spiderfw/config/configuration_editor.rb +197 -0
- data/lib/spiderfw/config/options/spider.rb +48 -22
- data/lib/spiderfw/{static_content.rb → content_utils.rb} +23 -1
- data/lib/spiderfw/controller/controller.rb +8 -5
- data/lib/spiderfw/controller/controller_mixin.rb +39 -3
- data/lib/spiderfw/controller/cookies.rb +0 -3
- data/lib/spiderfw/controller/dispatcher.rb +1 -1
- data/lib/spiderfw/controller/first_responder.rb +1 -0
- data/lib/spiderfw/controller/home_controller.rb +10 -1
- data/lib/spiderfw/controller/http_controller.rb +105 -6
- data/lib/spiderfw/controller/mixins/http_mixin.rb +0 -1
- data/lib/spiderfw/controller/mixins/static_content.rb +35 -12
- data/lib/spiderfw/controller/mixins/visual.rb +125 -72
- data/lib/spiderfw/controller/request.rb +13 -1
- data/lib/spiderfw/controller/response.rb +14 -8
- data/lib/spiderfw/controller/scene.rb +5 -0
- data/lib/spiderfw/controller/session/file_session.rb +1 -1
- data/lib/spiderfw/create.rb +17 -0
- data/lib/spiderfw/home.rb +20 -8
- data/lib/spiderfw/http/adapters/mongrel.rb +24 -15
- data/lib/spiderfw/http/adapters/rack.rb +8 -3
- data/lib/spiderfw/http/adapters/webrick.rb +1 -0
- data/lib/spiderfw/http/server.rb +1 -0
- data/lib/spiderfw/i18n/cldr.rb +8 -1
- data/lib/spiderfw/i18n/i18n.rb +3 -4
- data/lib/spiderfw/i18n/javascript_parser.rb +54 -0
- data/lib/spiderfw/model/base_model.rb +550 -120
- data/lib/spiderfw/model/condition.rb +11 -2
- data/lib/spiderfw/model/data_type.rb +1 -1
- data/lib/spiderfw/model/datatypes/bool.rb +3 -1
- data/lib/spiderfw/model/datatypes/decimal.rb +4 -0
- data/lib/spiderfw/model/datatypes/password.rb +1 -0
- data/lib/spiderfw/model/datatypes/time_span.rb +26 -0
- data/lib/spiderfw/model/datatypes.rb +1 -0
- data/lib/spiderfw/model/element.rb +29 -28
- data/lib/spiderfw/model/extended_models/managed.rb +15 -0
- data/lib/spiderfw/model/identity_mapper.rb +89 -10
- data/lib/spiderfw/model/inline_model.rb +20 -2
- data/lib/spiderfw/model/integrated_element.rb +41 -0
- data/lib/spiderfw/model/mappers/db_mapper.rb +31 -27
- data/lib/spiderfw/model/mappers/hash_mapper.rb +9 -2
- data/lib/spiderfw/model/mappers/mapper.rb +105 -50
- data/lib/spiderfw/model/mappers/vfs/flat_file.rb +1 -1
- data/lib/spiderfw/model/mixins/state_machine.rb +6 -0
- data/lib/spiderfw/model/mixins/tree.rb +20 -4
- data/lib/spiderfw/model/mixins/versioned.rb +440 -67
- data/lib/spiderfw/model/model.rb +78 -17
- data/lib/spiderfw/model/model_hash.rb +2 -2
- data/lib/spiderfw/model/query.rb +17 -0
- data/lib/spiderfw/model/query_set.rb +86 -14
- data/lib/spiderfw/model/storage/base_storage.rb +1 -0
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +44 -15
- data/lib/spiderfw/model/storage/db/adapters/oracle.rb +8 -7
- data/lib/spiderfw/model/storage/db/connectors/oci8.rb +7 -1
- data/lib/spiderfw/model/storage/db/db_schema.rb +13 -0
- data/lib/spiderfw/model/storage/db/db_storage.rb +25 -5
- data/lib/spiderfw/model/unit_of_work.rb +96 -15
- data/lib/spiderfw/requires.rb +9 -1
- data/lib/spiderfw/setup/app_manager.rb +81 -0
- data/lib/spiderfw/setup/app_server_client.rb +59 -0
- data/lib/spiderfw/setup/setup_task.rb +68 -6
- data/lib/spiderfw/setup/spider_setup_wizard.rb +375 -0
- data/lib/spiderfw/site.rb +53 -0
- data/lib/spiderfw/templates/blocks/attr_if.rb +2 -2
- data/lib/spiderfw/templates/blocks/comment.rb +7 -2
- data/lib/spiderfw/templates/blocks/each.rb +1 -1
- data/lib/spiderfw/templates/blocks/html.rb +7 -0
- data/lib/spiderfw/templates/blocks/layout_assets.rb +20 -0
- data/lib/spiderfw/templates/blocks/output.rb +18 -0
- data/lib/spiderfw/templates/blocks/text.rb +17 -19
- data/lib/spiderfw/templates/blocks/widget.rb +4 -2
- data/lib/spiderfw/templates/layout.rb +269 -2
- data/lib/spiderfw/templates/template.rb +279 -46
- data/lib/spiderfw/templates/template_blocks.rb +31 -37
- data/lib/spiderfw/utils/events/event_source.rb +54 -0
- data/lib/spiderfw/utils/json.rb +39 -0
- data/lib/spiderfw/utils/logger.rb +186 -23
- data/lib/spiderfw/utils/memory.rb +30 -0
- data/lib/spiderfw/utils/monkey/date_time.rb +32 -2
- data/lib/spiderfw/utils/monkey/module.rb +16 -0
- data/lib/spiderfw/utils/monkey/object.rb +8 -0
- data/lib/spiderfw/utils/ordered_hash.rb +148 -0
- data/lib/spiderfw/utils/profiling.rb +36 -0
- data/lib/spiderfw/utils/secure_random.rb +223 -0
- data/lib/spiderfw/version.rb +1 -1
- data/lib/spiderfw/widget/widget.rb +143 -51
- data/lib/spiderfw/widget/widget_plugin.rb +13 -2
- data/lib/spiderfw.rb +117 -35
- data/spider.gemspec +1 -1
- metadata +506 -255
- data/apps/core/components/public/js/jquery/jquery-1.3.2.js +0 -4376
- data/apps/core/components/public/js/jquery/jquery-1.4.2-min.js +0 -154
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css +0 -406
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/ChangeLog.txt +0 -20
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/META.json +0 -32
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.js +0 -100
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.min.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.pack.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/test/index.html +0 -197
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.js +0 -97
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.min.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.pack.js +0 -10
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.zip +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/jsdiff/jsdiff.js +0 -159
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testrunner.js +0 -780
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testsuite.css +0 -120
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/simulate/jquery.simulate.js +0 -152
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/jquery-1.3.2.js +0 -4376
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.accordion.css +0 -9
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.all.css +0 -2
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.base.css +0 -8
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.core.css +0 -37
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.datepicker.css +0 -62
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.dialog.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.progressbar.css +0 -4
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.resizable.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.slider.css +0 -17
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.tabs.css +0 -11
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.theme.css +0 -245
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/jquery-ui-1.7.2.custom.css +0 -406
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.accordion.css +0 -9
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.all.css +0 -2
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.base.css +0 -8
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.core.css +0 -37
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.datepicker.css +0 -62
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.dialog.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.progressbar.css +0 -4
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.resizable.css +0 -13
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.slider.css +0 -17
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.tabs.css +0 -11
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.theme.css +0 -247
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.highlight.js +0 -48
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.pulsate.js +0 -56
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js +0 -9133
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.accordion.js +0 -477
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.core.js +0 -519
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.dialog.js +0 -671
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.progressbar.js +0 -116
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.slider.js +0 -558
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.tabs.js +0 -685
- data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/version.txt +0 -1
- data/apps/core/components/public/js/jquery/jquery-ui/index.html +0 -367
- data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-1.3.2.min.js +0 -19
- data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-ui-1.7.2.custom.min.js +0 -298
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/changelog.txt +0 -27
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.css +0 -48
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js +0 -808
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.min.js +0 -13
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.pack.js +0 -12
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.ajaxQueue.js +0 -116
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.bgiframe.min.js +0 -10
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.js +0 -3558
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox-compressed.js +0 -10
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox.css +0 -163
- data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/todo +0 -166
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +0 -187
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +0 -1
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +0 -193
- data/apps/core/forms/widgets/inputs/subform/subform.rb +0 -10
- data/apps/core/forms/widgets/inputs/subform/subform.shtml +0 -5
- data/apps/hippo/_init.rb +0 -10
- data/apps/hippo/models/mixins/hippo_struct.rb +0 -226
- data/apps/hippo/models/security_group.rb +0 -21
- data/apps/hippo/models/security_user.rb +0 -29
- data/apps/hippo/script/converti_strutture.rb +0 -335
- data/data/locale/it/LC_MESSAGES/cms.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_files.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_images.mo +0 -0
- data/lib/spiderfw/utils/monkey/hpricot_compat.rb +0 -0
- data/lib/spiderfw/utils/setup_task.rb +0 -35
- data/lib/spiderfw/utils/test_case.rb +0 -24
- /data/apps/core/components/public/js/jquery/{jquery-ui/css/smoothness → jquery-ui-1.8.4/css/Aristo}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- /data/apps/{messenger/lib/backends/email/smtp.rb → servant/lib/commands/discovery.rb} +0 -0
data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js
DELETED
@@ -1,808 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery Autocomplete plugin 1.1
|
3
|
-
*
|
4
|
-
* Copyright (c) 2009 Jörn Zaefferer
|
5
|
-
*
|
6
|
-
* Dual licensed under the MIT and GPL licenses:
|
7
|
-
* http://www.opensource.org/licenses/mit-license.php
|
8
|
-
* http://www.gnu.org/licenses/gpl.html
|
9
|
-
*
|
10
|
-
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
|
11
|
-
*/
|
12
|
-
|
13
|
-
;(function($) {
|
14
|
-
|
15
|
-
$.fn.extend({
|
16
|
-
autocomplete: function(urlOrData, options) {
|
17
|
-
var isUrl = typeof urlOrData == "string";
|
18
|
-
options = $.extend({}, $.Autocompleter.defaults, {
|
19
|
-
url: isUrl ? urlOrData : null,
|
20
|
-
data: isUrl ? null : urlOrData,
|
21
|
-
delay: isUrl ? $.Autocompleter.defaults.delay : 10,
|
22
|
-
max: options && !options.scroll ? 10 : 150
|
23
|
-
}, options);
|
24
|
-
|
25
|
-
// if highlight is set to false, replace it with a do-nothing function
|
26
|
-
options.highlight = options.highlight || function(value) { return value; };
|
27
|
-
|
28
|
-
// if the formatMatch option is not specified, then use formatItem for backwards compatibility
|
29
|
-
options.formatMatch = options.formatMatch || options.formatItem;
|
30
|
-
|
31
|
-
return this.each(function() {
|
32
|
-
new $.Autocompleter(this, options);
|
33
|
-
});
|
34
|
-
},
|
35
|
-
result: function(handler) {
|
36
|
-
return this.bind("result", handler);
|
37
|
-
},
|
38
|
-
search: function(handler) {
|
39
|
-
return this.trigger("search", [handler]);
|
40
|
-
},
|
41
|
-
flushCache: function() {
|
42
|
-
return this.trigger("flushCache");
|
43
|
-
},
|
44
|
-
setOptions: function(options){
|
45
|
-
return this.trigger("setOptions", [options]);
|
46
|
-
},
|
47
|
-
unautocomplete: function() {
|
48
|
-
return this.trigger("unautocomplete");
|
49
|
-
}
|
50
|
-
});
|
51
|
-
|
52
|
-
$.Autocompleter = function(input, options) {
|
53
|
-
|
54
|
-
var KEY = {
|
55
|
-
UP: 38,
|
56
|
-
DOWN: 40,
|
57
|
-
DEL: 46,
|
58
|
-
TAB: 9,
|
59
|
-
RETURN: 13,
|
60
|
-
ESC: 27,
|
61
|
-
COMMA: 188,
|
62
|
-
PAGEUP: 33,
|
63
|
-
PAGEDOWN: 34,
|
64
|
-
BACKSPACE: 8
|
65
|
-
};
|
66
|
-
|
67
|
-
// Create $ object for input element
|
68
|
-
var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
|
69
|
-
|
70
|
-
var timeout;
|
71
|
-
var previousValue = "";
|
72
|
-
var cache = $.Autocompleter.Cache(options);
|
73
|
-
var hasFocus = 0;
|
74
|
-
var lastKeyPressCode;
|
75
|
-
var config = {
|
76
|
-
mouseDownOnSelect: false
|
77
|
-
};
|
78
|
-
var select = $.Autocompleter.Select(options, input, selectCurrent, config);
|
79
|
-
|
80
|
-
var blockSubmit;
|
81
|
-
|
82
|
-
// prevent form submit in opera when selecting with return key
|
83
|
-
$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
|
84
|
-
if (blockSubmit) {
|
85
|
-
blockSubmit = false;
|
86
|
-
return false;
|
87
|
-
}
|
88
|
-
});
|
89
|
-
|
90
|
-
// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
|
91
|
-
$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
|
92
|
-
// a keypress means the input has focus
|
93
|
-
// avoids issue where input had focus before the autocomplete was applied
|
94
|
-
hasFocus = 1;
|
95
|
-
// track last key pressed
|
96
|
-
lastKeyPressCode = event.keyCode;
|
97
|
-
switch(event.keyCode) {
|
98
|
-
|
99
|
-
case KEY.UP:
|
100
|
-
event.preventDefault();
|
101
|
-
if ( select.visible() ) {
|
102
|
-
select.prev();
|
103
|
-
} else {
|
104
|
-
onChange(0, true);
|
105
|
-
}
|
106
|
-
break;
|
107
|
-
|
108
|
-
case KEY.DOWN:
|
109
|
-
event.preventDefault();
|
110
|
-
if ( select.visible() ) {
|
111
|
-
select.next();
|
112
|
-
} else {
|
113
|
-
onChange(0, true);
|
114
|
-
}
|
115
|
-
break;
|
116
|
-
|
117
|
-
case KEY.PAGEUP:
|
118
|
-
event.preventDefault();
|
119
|
-
if ( select.visible() ) {
|
120
|
-
select.pageUp();
|
121
|
-
} else {
|
122
|
-
onChange(0, true);
|
123
|
-
}
|
124
|
-
break;
|
125
|
-
|
126
|
-
case KEY.PAGEDOWN:
|
127
|
-
event.preventDefault();
|
128
|
-
if ( select.visible() ) {
|
129
|
-
select.pageDown();
|
130
|
-
} else {
|
131
|
-
onChange(0, true);
|
132
|
-
}
|
133
|
-
break;
|
134
|
-
|
135
|
-
// matches also semicolon
|
136
|
-
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
|
137
|
-
case KEY.TAB:
|
138
|
-
case KEY.RETURN:
|
139
|
-
if( selectCurrent() ) {
|
140
|
-
// stop default to prevent a form submit, Opera needs special handling
|
141
|
-
event.preventDefault();
|
142
|
-
blockSubmit = true;
|
143
|
-
return false;
|
144
|
-
}
|
145
|
-
break;
|
146
|
-
|
147
|
-
case KEY.ESC:
|
148
|
-
select.hide();
|
149
|
-
break;
|
150
|
-
|
151
|
-
default:
|
152
|
-
clearTimeout(timeout);
|
153
|
-
timeout = setTimeout(onChange, options.delay);
|
154
|
-
break;
|
155
|
-
}
|
156
|
-
}).focus(function(){
|
157
|
-
// track whether the field has focus, we shouldn't process any
|
158
|
-
// results if the field no longer has focus
|
159
|
-
hasFocus++;
|
160
|
-
}).blur(function() {
|
161
|
-
hasFocus = 0;
|
162
|
-
if (!config.mouseDownOnSelect) {
|
163
|
-
hideResults();
|
164
|
-
}
|
165
|
-
}).click(function() {
|
166
|
-
// show select when clicking in a focused field
|
167
|
-
if ( hasFocus++ > 1 && !select.visible() ) {
|
168
|
-
onChange(0, true);
|
169
|
-
}
|
170
|
-
}).bind("search", function() {
|
171
|
-
// TODO why not just specifying both arguments?
|
172
|
-
var fn = (arguments.length > 1) ? arguments[1] : null;
|
173
|
-
function findValueCallback(q, data) {
|
174
|
-
var result;
|
175
|
-
if( data && data.length ) {
|
176
|
-
for (var i=0; i < data.length; i++) {
|
177
|
-
if( data[i].result.toLowerCase() == q.toLowerCase() ) {
|
178
|
-
result = data[i];
|
179
|
-
break;
|
180
|
-
}
|
181
|
-
}
|
182
|
-
}
|
183
|
-
if( typeof fn == "function" ) fn(result);
|
184
|
-
else $input.trigger("result", result && [result.data, result.value]);
|
185
|
-
}
|
186
|
-
$.each(trimWords($input.val()), function(i, value) {
|
187
|
-
request(value, findValueCallback, findValueCallback);
|
188
|
-
});
|
189
|
-
}).bind("flushCache", function() {
|
190
|
-
cache.flush();
|
191
|
-
}).bind("setOptions", function() {
|
192
|
-
$.extend(options, arguments[1]);
|
193
|
-
// if we've updated the data, repopulate
|
194
|
-
if ( "data" in arguments[1] )
|
195
|
-
cache.populate();
|
196
|
-
}).bind("unautocomplete", function() {
|
197
|
-
select.unbind();
|
198
|
-
$input.unbind();
|
199
|
-
$(input.form).unbind(".autocomplete");
|
200
|
-
});
|
201
|
-
|
202
|
-
|
203
|
-
function selectCurrent() {
|
204
|
-
var selected = select.selected();
|
205
|
-
if( !selected )
|
206
|
-
return false;
|
207
|
-
|
208
|
-
var v = selected.result;
|
209
|
-
previousValue = v;
|
210
|
-
|
211
|
-
if ( options.multiple ) {
|
212
|
-
var words = trimWords($input.val());
|
213
|
-
if ( words.length > 1 ) {
|
214
|
-
var seperator = options.multipleSeparator.length;
|
215
|
-
var cursorAt = $(input).selection().start;
|
216
|
-
var wordAt, progress = 0;
|
217
|
-
$.each(words, function(i, word) {
|
218
|
-
progress += word.length;
|
219
|
-
if (cursorAt <= progress) {
|
220
|
-
wordAt = i;
|
221
|
-
return false;
|
222
|
-
}
|
223
|
-
progress += seperator;
|
224
|
-
});
|
225
|
-
words[wordAt] = v;
|
226
|
-
// TODO this should set the cursor to the right position, but it gets overriden somewhere
|
227
|
-
//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
|
228
|
-
v = words.join( options.multipleSeparator );
|
229
|
-
}
|
230
|
-
v += options.multipleSeparator;
|
231
|
-
}
|
232
|
-
|
233
|
-
$input.val(v);
|
234
|
-
hideResultsNow();
|
235
|
-
$input.trigger("result", [selected.data, selected.value]);
|
236
|
-
return true;
|
237
|
-
}
|
238
|
-
|
239
|
-
function onChange(crap, skipPrevCheck) {
|
240
|
-
if( lastKeyPressCode == KEY.DEL ) {
|
241
|
-
select.hide();
|
242
|
-
return;
|
243
|
-
}
|
244
|
-
|
245
|
-
var currentValue = $input.val();
|
246
|
-
|
247
|
-
if ( !skipPrevCheck && currentValue == previousValue )
|
248
|
-
return;
|
249
|
-
|
250
|
-
previousValue = currentValue;
|
251
|
-
|
252
|
-
currentValue = lastWord(currentValue);
|
253
|
-
if ( currentValue.length >= options.minChars) {
|
254
|
-
$input.addClass(options.loadingClass);
|
255
|
-
if (!options.matchCase)
|
256
|
-
currentValue = currentValue.toLowerCase();
|
257
|
-
request(currentValue, receiveData, hideResultsNow);
|
258
|
-
} else {
|
259
|
-
stopLoading();
|
260
|
-
select.hide();
|
261
|
-
}
|
262
|
-
};
|
263
|
-
|
264
|
-
function trimWords(value) {
|
265
|
-
if (!value)
|
266
|
-
return [""];
|
267
|
-
if (!options.multiple)
|
268
|
-
return [$.trim(value)];
|
269
|
-
return $.map(value.split(options.multipleSeparator), function(word) {
|
270
|
-
return $.trim(value).length ? $.trim(word) : null;
|
271
|
-
});
|
272
|
-
}
|
273
|
-
|
274
|
-
function lastWord(value) {
|
275
|
-
if ( !options.multiple )
|
276
|
-
return value;
|
277
|
-
var words = trimWords(value);
|
278
|
-
if (words.length == 1)
|
279
|
-
return words[0];
|
280
|
-
var cursorAt = $(input).selection().start;
|
281
|
-
if (cursorAt == value.length) {
|
282
|
-
words = trimWords(value)
|
283
|
-
} else {
|
284
|
-
words = trimWords(value.replace(value.substring(cursorAt), ""));
|
285
|
-
}
|
286
|
-
return words[words.length - 1];
|
287
|
-
}
|
288
|
-
|
289
|
-
// fills in the input box w/the first match (assumed to be the best match)
|
290
|
-
// q: the term entered
|
291
|
-
// sValue: the first matching result
|
292
|
-
function autoFill(q, sValue){
|
293
|
-
// autofill in the complete box w/the first match as long as the user hasn't entered in more data
|
294
|
-
// if the last user key pressed was backspace, don't autofill
|
295
|
-
if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
|
296
|
-
// fill in the value (keep the case the user has typed)
|
297
|
-
$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
|
298
|
-
// select the portion of the value not typed by the user (so the next character will erase)
|
299
|
-
$(input).selection(previousValue.length, previousValue.length + sValue.length);
|
300
|
-
}
|
301
|
-
};
|
302
|
-
|
303
|
-
function hideResults() {
|
304
|
-
clearTimeout(timeout);
|
305
|
-
timeout = setTimeout(hideResultsNow, 200);
|
306
|
-
};
|
307
|
-
|
308
|
-
function hideResultsNow() {
|
309
|
-
var wasVisible = select.visible();
|
310
|
-
select.hide();
|
311
|
-
clearTimeout(timeout);
|
312
|
-
stopLoading();
|
313
|
-
if (options.mustMatch) {
|
314
|
-
// call search and run callback
|
315
|
-
$input.search(
|
316
|
-
function (result){
|
317
|
-
// if no value found, clear the input box
|
318
|
-
if( !result ) {
|
319
|
-
if (options.multiple) {
|
320
|
-
var words = trimWords($input.val()).slice(0, -1);
|
321
|
-
$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
|
322
|
-
}
|
323
|
-
else {
|
324
|
-
$input.val( "" );
|
325
|
-
$input.trigger("result", null);
|
326
|
-
}
|
327
|
-
}
|
328
|
-
}
|
329
|
-
);
|
330
|
-
}
|
331
|
-
};
|
332
|
-
|
333
|
-
function receiveData(q, data) {
|
334
|
-
if ( data && data.length && hasFocus ) {
|
335
|
-
stopLoading();
|
336
|
-
select.display(data, q);
|
337
|
-
autoFill(q, data[0].value);
|
338
|
-
select.show();
|
339
|
-
} else {
|
340
|
-
hideResultsNow();
|
341
|
-
}
|
342
|
-
};
|
343
|
-
|
344
|
-
function request(term, success, failure) {
|
345
|
-
if (!options.matchCase)
|
346
|
-
term = term.toLowerCase();
|
347
|
-
var data = cache.load(term);
|
348
|
-
// recieve the cached data
|
349
|
-
if (data && data.length) {
|
350
|
-
success(term, data);
|
351
|
-
// if an AJAX url has been supplied, try loading the data now
|
352
|
-
} else if( (typeof options.url == "string") && (options.url.length > 0) ){
|
353
|
-
|
354
|
-
var extraParams = {
|
355
|
-
timestamp: +new Date()
|
356
|
-
};
|
357
|
-
$.each(options.extraParams, function(key, param) {
|
358
|
-
extraParams[key] = typeof param == "function" ? param() : param;
|
359
|
-
});
|
360
|
-
|
361
|
-
$.ajax({
|
362
|
-
// try to leverage ajaxQueue plugin to abort previous requests
|
363
|
-
mode: "abort",
|
364
|
-
// limit abortion to this input
|
365
|
-
port: "autocomplete" + input.name,
|
366
|
-
dataType: options.dataType,
|
367
|
-
url: options.url,
|
368
|
-
data: $.extend({
|
369
|
-
q: lastWord(term),
|
370
|
-
limit: options.max
|
371
|
-
}, extraParams),
|
372
|
-
success: function(data) {
|
373
|
-
var parsed = options.parse && options.parse(data) || parse(data);
|
374
|
-
cache.add(term, parsed);
|
375
|
-
success(term, parsed);
|
376
|
-
}
|
377
|
-
});
|
378
|
-
} else {
|
379
|
-
// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
|
380
|
-
select.emptyList();
|
381
|
-
failure(term);
|
382
|
-
}
|
383
|
-
};
|
384
|
-
|
385
|
-
function parse(data) {
|
386
|
-
var parsed = [];
|
387
|
-
var rows = data.split("\n");
|
388
|
-
for (var i=0; i < rows.length; i++) {
|
389
|
-
var row = $.trim(rows[i]);
|
390
|
-
if (row) {
|
391
|
-
row = row.split("|");
|
392
|
-
parsed[parsed.length] = {
|
393
|
-
data: row,
|
394
|
-
value: row[0],
|
395
|
-
result: options.formatResult && options.formatResult(row, row[0]) || row[0]
|
396
|
-
};
|
397
|
-
}
|
398
|
-
}
|
399
|
-
return parsed;
|
400
|
-
};
|
401
|
-
|
402
|
-
function stopLoading() {
|
403
|
-
$input.removeClass(options.loadingClass);
|
404
|
-
};
|
405
|
-
|
406
|
-
};
|
407
|
-
|
408
|
-
$.Autocompleter.defaults = {
|
409
|
-
inputClass: "ac_input",
|
410
|
-
resultsClass: "ac_results",
|
411
|
-
loadingClass: "ac_loading",
|
412
|
-
minChars: 1,
|
413
|
-
delay: 400,
|
414
|
-
matchCase: false,
|
415
|
-
matchSubset: true,
|
416
|
-
matchContains: false,
|
417
|
-
cacheLength: 10,
|
418
|
-
max: 100,
|
419
|
-
mustMatch: false,
|
420
|
-
extraParams: {},
|
421
|
-
selectFirst: true,
|
422
|
-
formatItem: function(row) { return row[0]; },
|
423
|
-
formatMatch: null,
|
424
|
-
autoFill: false,
|
425
|
-
width: 0,
|
426
|
-
multiple: false,
|
427
|
-
multipleSeparator: ", ",
|
428
|
-
highlight: function(value, term) {
|
429
|
-
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
|
430
|
-
},
|
431
|
-
scroll: true,
|
432
|
-
scrollHeight: 180
|
433
|
-
};
|
434
|
-
|
435
|
-
$.Autocompleter.Cache = function(options) {
|
436
|
-
|
437
|
-
var data = {};
|
438
|
-
var length = 0;
|
439
|
-
|
440
|
-
function matchSubset(s, sub) {
|
441
|
-
if (!options.matchCase)
|
442
|
-
s = s.toLowerCase();
|
443
|
-
var i = s.indexOf(sub);
|
444
|
-
if (options.matchContains == "word"){
|
445
|
-
i = s.toLowerCase().search("\\b" + sub.toLowerCase());
|
446
|
-
}
|
447
|
-
if (i == -1) return false;
|
448
|
-
return i == 0 || options.matchContains;
|
449
|
-
};
|
450
|
-
|
451
|
-
function add(q, value) {
|
452
|
-
if (length > options.cacheLength){
|
453
|
-
flush();
|
454
|
-
}
|
455
|
-
if (!data[q]){
|
456
|
-
length++;
|
457
|
-
}
|
458
|
-
data[q] = value;
|
459
|
-
}
|
460
|
-
|
461
|
-
function populate(){
|
462
|
-
if( !options.data ) return false;
|
463
|
-
// track the matches
|
464
|
-
var stMatchSets = {},
|
465
|
-
nullData = 0;
|
466
|
-
|
467
|
-
// no url was specified, we need to adjust the cache length to make sure it fits the local data store
|
468
|
-
if( !options.url ) options.cacheLength = 1;
|
469
|
-
|
470
|
-
// track all options for minChars = 0
|
471
|
-
stMatchSets[""] = [];
|
472
|
-
|
473
|
-
// loop through the array and create a lookup structure
|
474
|
-
for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
|
475
|
-
var rawValue = options.data[i];
|
476
|
-
// if rawValue is a string, make an array otherwise just reference the array
|
477
|
-
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
|
478
|
-
|
479
|
-
var value = options.formatMatch(rawValue, i+1, options.data.length);
|
480
|
-
if ( value === false )
|
481
|
-
continue;
|
482
|
-
|
483
|
-
var firstChar = value.charAt(0).toLowerCase();
|
484
|
-
// if no lookup array for this character exists, look it up now
|
485
|
-
if( !stMatchSets[firstChar] )
|
486
|
-
stMatchSets[firstChar] = [];
|
487
|
-
|
488
|
-
// if the match is a string
|
489
|
-
var row = {
|
490
|
-
value: value,
|
491
|
-
data: rawValue,
|
492
|
-
result: options.formatResult && options.formatResult(rawValue) || value
|
493
|
-
};
|
494
|
-
|
495
|
-
// push the current match into the set list
|
496
|
-
stMatchSets[firstChar].push(row);
|
497
|
-
|
498
|
-
// keep track of minChars zero items
|
499
|
-
if ( nullData++ < options.max ) {
|
500
|
-
stMatchSets[""].push(row);
|
501
|
-
}
|
502
|
-
};
|
503
|
-
|
504
|
-
// add the data items to the cache
|
505
|
-
$.each(stMatchSets, function(i, value) {
|
506
|
-
// increase the cache size
|
507
|
-
options.cacheLength++;
|
508
|
-
// add to the cache
|
509
|
-
add(i, value);
|
510
|
-
});
|
511
|
-
}
|
512
|
-
|
513
|
-
// populate any existing data
|
514
|
-
setTimeout(populate, 25);
|
515
|
-
|
516
|
-
function flush(){
|
517
|
-
data = {};
|
518
|
-
length = 0;
|
519
|
-
}
|
520
|
-
|
521
|
-
return {
|
522
|
-
flush: flush,
|
523
|
-
add: add,
|
524
|
-
populate: populate,
|
525
|
-
load: function(q) {
|
526
|
-
if (!options.cacheLength || !length)
|
527
|
-
return null;
|
528
|
-
/*
|
529
|
-
* if dealing w/local data and matchContains than we must make sure
|
530
|
-
* to loop through all the data collections looking for matches
|
531
|
-
*/
|
532
|
-
if( !options.url && options.matchContains ){
|
533
|
-
// track all matches
|
534
|
-
var csub = [];
|
535
|
-
// loop through all the data grids for matches
|
536
|
-
for( var k in data ){
|
537
|
-
// don't search through the stMatchSets[""] (minChars: 0) cache
|
538
|
-
// this prevents duplicates
|
539
|
-
if( k.length > 0 ){
|
540
|
-
var c = data[k];
|
541
|
-
$.each(c, function(i, x) {
|
542
|
-
// if we've got a match, add it to the array
|
543
|
-
if (matchSubset(x.value, q)) {
|
544
|
-
csub.push(x);
|
545
|
-
}
|
546
|
-
});
|
547
|
-
}
|
548
|
-
}
|
549
|
-
return csub;
|
550
|
-
} else
|
551
|
-
// if the exact item exists, use it
|
552
|
-
if (data[q]){
|
553
|
-
return data[q];
|
554
|
-
} else
|
555
|
-
if (options.matchSubset) {
|
556
|
-
for (var i = q.length - 1; i >= options.minChars; i--) {
|
557
|
-
var c = data[q.substr(0, i)];
|
558
|
-
if (c) {
|
559
|
-
var csub = [];
|
560
|
-
$.each(c, function(i, x) {
|
561
|
-
if (matchSubset(x.value, q)) {
|
562
|
-
csub[csub.length] = x;
|
563
|
-
}
|
564
|
-
});
|
565
|
-
return csub;
|
566
|
-
}
|
567
|
-
}
|
568
|
-
}
|
569
|
-
return null;
|
570
|
-
}
|
571
|
-
};
|
572
|
-
};
|
573
|
-
|
574
|
-
$.Autocompleter.Select = function (options, input, select, config) {
|
575
|
-
var CLASSES = {
|
576
|
-
ACTIVE: "ac_over"
|
577
|
-
};
|
578
|
-
|
579
|
-
var listItems,
|
580
|
-
active = -1,
|
581
|
-
data,
|
582
|
-
term = "",
|
583
|
-
needsInit = true,
|
584
|
-
element,
|
585
|
-
list;
|
586
|
-
|
587
|
-
// Create results
|
588
|
-
function init() {
|
589
|
-
if (!needsInit)
|
590
|
-
return;
|
591
|
-
element = $("<div/>")
|
592
|
-
.hide()
|
593
|
-
.addClass(options.resultsClass)
|
594
|
-
.css("position", "absolute")
|
595
|
-
.appendTo(document.body);
|
596
|
-
|
597
|
-
list = $("<ul/>").appendTo(element).mouseover( function(event) {
|
598
|
-
if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
|
599
|
-
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
|
600
|
-
$(target(event)).addClass(CLASSES.ACTIVE);
|
601
|
-
}
|
602
|
-
}).click(function(event) {
|
603
|
-
$(target(event)).addClass(CLASSES.ACTIVE);
|
604
|
-
select();
|
605
|
-
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
|
606
|
-
input.focus();
|
607
|
-
return false;
|
608
|
-
}).mousedown(function() {
|
609
|
-
config.mouseDownOnSelect = true;
|
610
|
-
}).mouseup(function() {
|
611
|
-
config.mouseDownOnSelect = false;
|
612
|
-
});
|
613
|
-
|
614
|
-
if( options.width > 0 )
|
615
|
-
element.css("width", options.width);
|
616
|
-
|
617
|
-
needsInit = false;
|
618
|
-
}
|
619
|
-
|
620
|
-
function target(event) {
|
621
|
-
var element = event.target;
|
622
|
-
while(element && element.tagName != "LI")
|
623
|
-
element = element.parentNode;
|
624
|
-
// more fun with IE, sometimes event.target is empty, just ignore it then
|
625
|
-
if(!element)
|
626
|
-
return [];
|
627
|
-
return element;
|
628
|
-
}
|
629
|
-
|
630
|
-
function moveSelect(step) {
|
631
|
-
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
|
632
|
-
movePosition(step);
|
633
|
-
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
|
634
|
-
if(options.scroll) {
|
635
|
-
var offset = 0;
|
636
|
-
listItems.slice(0, active).each(function() {
|
637
|
-
offset += this.offsetHeight;
|
638
|
-
});
|
639
|
-
if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
|
640
|
-
list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
|
641
|
-
} else if(offset < list.scrollTop()) {
|
642
|
-
list.scrollTop(offset);
|
643
|
-
}
|
644
|
-
}
|
645
|
-
};
|
646
|
-
|
647
|
-
function movePosition(step) {
|
648
|
-
active += step;
|
649
|
-
if (active < 0) {
|
650
|
-
active = listItems.size() - 1;
|
651
|
-
} else if (active >= listItems.size()) {
|
652
|
-
active = 0;
|
653
|
-
}
|
654
|
-
}
|
655
|
-
|
656
|
-
function limitNumberOfItems(available) {
|
657
|
-
return options.max && options.max < available
|
658
|
-
? options.max
|
659
|
-
: available;
|
660
|
-
}
|
661
|
-
|
662
|
-
function fillList() {
|
663
|
-
list.empty();
|
664
|
-
var max = limitNumberOfItems(data.length);
|
665
|
-
for (var i=0; i < max; i++) {
|
666
|
-
if (!data[i])
|
667
|
-
continue;
|
668
|
-
var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
|
669
|
-
if ( formatted === false )
|
670
|
-
continue;
|
671
|
-
var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
|
672
|
-
$.data(li, "ac_data", data[i]);
|
673
|
-
}
|
674
|
-
listItems = list.find("li");
|
675
|
-
if ( options.selectFirst ) {
|
676
|
-
listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
|
677
|
-
active = 0;
|
678
|
-
}
|
679
|
-
// apply bgiframe if available
|
680
|
-
if ( $.fn.bgiframe )
|
681
|
-
list.bgiframe();
|
682
|
-
}
|
683
|
-
|
684
|
-
return {
|
685
|
-
display: function(d, q) {
|
686
|
-
init();
|
687
|
-
data = d;
|
688
|
-
term = q;
|
689
|
-
fillList();
|
690
|
-
},
|
691
|
-
next: function() {
|
692
|
-
moveSelect(1);
|
693
|
-
},
|
694
|
-
prev: function() {
|
695
|
-
moveSelect(-1);
|
696
|
-
},
|
697
|
-
pageUp: function() {
|
698
|
-
if (active != 0 && active - 8 < 0) {
|
699
|
-
moveSelect( -active );
|
700
|
-
} else {
|
701
|
-
moveSelect(-8);
|
702
|
-
}
|
703
|
-
},
|
704
|
-
pageDown: function() {
|
705
|
-
if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
|
706
|
-
moveSelect( listItems.size() - 1 - active );
|
707
|
-
} else {
|
708
|
-
moveSelect(8);
|
709
|
-
}
|
710
|
-
},
|
711
|
-
hide: function() {
|
712
|
-
element && element.hide();
|
713
|
-
listItems && listItems.removeClass(CLASSES.ACTIVE);
|
714
|
-
active = -1;
|
715
|
-
},
|
716
|
-
visible : function() {
|
717
|
-
return element && element.is(":visible");
|
718
|
-
},
|
719
|
-
current: function() {
|
720
|
-
return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
|
721
|
-
},
|
722
|
-
show: function() {
|
723
|
-
var offset = $(input).offset();
|
724
|
-
element.css({
|
725
|
-
width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
|
726
|
-
top: offset.top + input.offsetHeight,
|
727
|
-
left: offset.left
|
728
|
-
}).show();
|
729
|
-
if(options.scroll) {
|
730
|
-
list.scrollTop(0);
|
731
|
-
list.css({
|
732
|
-
maxHeight: options.scrollHeight,
|
733
|
-
overflow: 'auto'
|
734
|
-
});
|
735
|
-
|
736
|
-
if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
|
737
|
-
var listHeight = 0;
|
738
|
-
listItems.each(function() {
|
739
|
-
listHeight += this.offsetHeight;
|
740
|
-
});
|
741
|
-
var scrollbarsVisible = listHeight > options.scrollHeight;
|
742
|
-
list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
|
743
|
-
if (!scrollbarsVisible) {
|
744
|
-
// IE doesn't recalculate width when scrollbar disappears
|
745
|
-
listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
|
746
|
-
}
|
747
|
-
}
|
748
|
-
|
749
|
-
}
|
750
|
-
},
|
751
|
-
selected: function() {
|
752
|
-
var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
|
753
|
-
return selected && selected.length && $.data(selected[0], "ac_data");
|
754
|
-
},
|
755
|
-
emptyList: function (){
|
756
|
-
list && list.empty();
|
757
|
-
},
|
758
|
-
unbind: function() {
|
759
|
-
element && element.remove();
|
760
|
-
}
|
761
|
-
};
|
762
|
-
};
|
763
|
-
|
764
|
-
$.fn.selection = function(start, end) {
|
765
|
-
if (start !== undefined) {
|
766
|
-
return this.each(function() {
|
767
|
-
if( this.createTextRange ){
|
768
|
-
var selRange = this.createTextRange();
|
769
|
-
if (end === undefined || start == end) {
|
770
|
-
selRange.move("character", start);
|
771
|
-
selRange.select();
|
772
|
-
} else {
|
773
|
-
selRange.collapse(true);
|
774
|
-
selRange.moveStart("character", start);
|
775
|
-
selRange.moveEnd("character", end);
|
776
|
-
selRange.select();
|
777
|
-
}
|
778
|
-
} else if( this.setSelectionRange ){
|
779
|
-
this.setSelectionRange(start, end);
|
780
|
-
} else if( this.selectionStart ){
|
781
|
-
this.selectionStart = start;
|
782
|
-
this.selectionEnd = end;
|
783
|
-
}
|
784
|
-
});
|
785
|
-
}
|
786
|
-
var field = this[0];
|
787
|
-
if ( field.createTextRange ) {
|
788
|
-
var range = document.selection.createRange(),
|
789
|
-
orig = field.value,
|
790
|
-
teststring = "<->",
|
791
|
-
textLength = range.text.length;
|
792
|
-
range.text = teststring;
|
793
|
-
var caretAt = field.value.indexOf(teststring);
|
794
|
-
field.value = orig;
|
795
|
-
this.selection(caretAt, caretAt + textLength);
|
796
|
-
return {
|
797
|
-
start: caretAt,
|
798
|
-
end: caretAt + textLength
|
799
|
-
}
|
800
|
-
} else if( field.selectionStart !== undefined ){
|
801
|
-
return {
|
802
|
-
start: field.selectionStart,
|
803
|
-
end: field.selectionEnd
|
804
|
-
}
|
805
|
-
}
|
806
|
-
};
|
807
|
-
|
808
|
-
})(jQuery);
|