spiderfw 0.6.27 → 0.6.28
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION +1 -1
- data/apps/core/admin/admin.rb +6 -2
- data/apps/core/admin/controllers/admin_controller.rb +10 -3
- data/apps/core/admin/controllers/app_admin_controller.rb +15 -0
- data/apps/core/admin/public/css/sass/admin.css +29 -33
- data/apps/core/admin/public/css/sass/grid.css +14 -0
- data/apps/core/admin/public/sass/admin.scss +3 -2
- data/apps/core/admin/views/admin.layout.shtml +1 -0
- data/apps/core/auth/controllers/mixins/auth_helper.rb +15 -5
- data/apps/core/components/assets.rb +60 -41
- data/apps/core/components/public/js/jquery/jquery-1.8.3.js +9472 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/jquery.ui.core.js +1 -1
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/button_bg.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/datepicker.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/icon_sprite.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/progress_bar.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/slider_h_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/slider_handles.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/slider_v_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/tab_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/the_gradient.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/css/Aristo/jquery-ui.custom.css +528 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-af.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ar.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-az.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-be.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-bg.js +24 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-bs.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ca.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-cs.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-cy-GB.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-da.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-de.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-el.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-en-GB.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-eo.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-es.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-et.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-eu.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fa.js +59 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fi.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fo.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fr-CA.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fr-CH.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-fr.js +25 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-he.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hi.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hr.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hu.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-hy.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-id.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-is.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-it.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ja.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ka.js +21 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-kk.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-km.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ko.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ky.js +24 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-lb.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-lt.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-lv.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-mk.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ms.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nb.js +22 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nl-BE.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nl.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-nn.js +22 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-no.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-pl.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-pt-BR.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ro.js +26 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ru.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sk.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sl.js +24 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sq.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sr-SR.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sr.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-sv.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-ta.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-th.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-tr.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-uk.js +24 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-vi.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-zh-CN.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-zh-HK.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-zh-TW.js +23 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.accordion.js +571 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.autocomplete.js +614 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.button.js +419 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.core.js +324 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.datepicker.js +2044 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.dialog.js +767 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.draggable.js +941 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.droppable.js +364 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-blind.js +82 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-bounce.js +113 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js +67 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-drop.js +65 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-explode.js +97 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-fade.js +30 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-fold.js +76 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-highlight.js +50 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-pulsate.js +63 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-scale.js +318 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-shake.js +74 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-slide.js +64 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-transfer.js +47 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect.js +1259 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.menu.js +621 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.mouse.js +169 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.position.js +497 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.progressbar.js +145 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.resizable.js +963 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.selectable.js +269 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.slider.js +641 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.sortable.js +1236 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.spinner.js +492 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.tabs.js +846 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.tooltip.js +400 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.widget.js +521 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +3 -1
- data/apps/core/components/public/js/plugins/sortable.js +5 -5
- data/apps/core/components/widgets/month_calendar/month_calendar.shtml +1 -1
- data/apps/core/components/widgets/table/table.rb +18 -5
- data/apps/core/forms/public/date_time.js +3 -0
- data/apps/core/forms/widgets/form/form.rb +1 -1
- data/apps/core/forms/widgets/inputs/date_time/date_time.rb +5 -0
- data/apps/core/forms/widgets/inputs/file_input/file_input.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.rb +11 -16
- data/apps/messenger/config/options.rb +5 -5
- data/apps/messenger/controllers/messenger_admin_controller.rb +1 -1
- data/apps/messenger/controllers/messenger_controller.rb +1 -1
- data/apps/messenger/lib/backends/mobyt.rb +1 -1
- data/apps/messenger/messenger.rb +4 -2
- data/apps/messenger/views/admin/index.shtml +1 -1
- data/lib/spiderfw/controller/dispatcher.rb +5 -5
- data/lib/spiderfw/controller/mixins/visual.rb +10 -8
- data/lib/spiderfw/http/http.rb +1 -1
- data/lib/spiderfw/model/base_model.rb +2 -2
- data/lib/spiderfw/model/mappers/db_mapper.rb +4 -2
- data/lib/spiderfw/model/mixins/tree.rb +4 -5
- data/lib/spiderfw/model/model.rb +2 -1
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +18 -20
- data/lib/spiderfw/model/storage/db/adapters/oracle.rb +1 -1
- data/lib/spiderfw/spider.rb +5 -1
- data/lib/spiderfw/templates/blocks/layout_assets.rb +5 -2
- data/lib/spiderfw/templates/layout.rb +7 -3
- data/lib/spiderfw/templates/template.rb +8 -1
- data/lib/spiderfw/utils/monkey/date_time.rb +7 -5
- data/lib/spiderfw/utils/monkey/module.rb +12 -0
- metadata +373 -157
- data/lib/spiderfw/model/storage/db/connectors/mysql.rb +0 -16
- data/lib/spiderfw/model/storage/db/connectors/mysql2.rb +0 -9
- /data/apps/core/admin/public/img/{icons-s845a69dd9f.png → icons-s8b18557db6.png} +0 -0
@@ -0,0 +1,400 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery UI Tooltip @VERSION
|
3
|
+
* http://jqueryui.com
|
4
|
+
*
|
5
|
+
* Copyright 2012 jQuery Foundation and other contributors
|
6
|
+
* Released under the MIT license.
|
7
|
+
* http://jquery.org/license
|
8
|
+
*
|
9
|
+
* http://api.jqueryui.com/tooltip/
|
10
|
+
*
|
11
|
+
* Depends:
|
12
|
+
* jquery.ui.core.js
|
13
|
+
* jquery.ui.widget.js
|
14
|
+
* jquery.ui.position.js
|
15
|
+
*/
|
16
|
+
(function( $ ) {
|
17
|
+
|
18
|
+
var increments = 0;
|
19
|
+
|
20
|
+
function addDescribedBy( elem, id ) {
|
21
|
+
var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
|
22
|
+
describedby.push( id );
|
23
|
+
elem
|
24
|
+
.data( "ui-tooltip-id", id )
|
25
|
+
.attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
|
26
|
+
}
|
27
|
+
|
28
|
+
function removeDescribedBy( elem ) {
|
29
|
+
var id = elem.data( "ui-tooltip-id" ),
|
30
|
+
describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
|
31
|
+
index = $.inArray( id, describedby );
|
32
|
+
if ( index !== -1 ) {
|
33
|
+
describedby.splice( index, 1 );
|
34
|
+
}
|
35
|
+
|
36
|
+
elem.removeData( "ui-tooltip-id" );
|
37
|
+
describedby = $.trim( describedby.join( " " ) );
|
38
|
+
if ( describedby ) {
|
39
|
+
elem.attr( "aria-describedby", describedby );
|
40
|
+
} else {
|
41
|
+
elem.removeAttr( "aria-describedby" );
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
$.widget( "ui.tooltip", {
|
46
|
+
version: "@VERSION",
|
47
|
+
options: {
|
48
|
+
content: function() {
|
49
|
+
var title = $( this ).attr( "title" );
|
50
|
+
// Escape title, since we're going from an attribute to raw HTML
|
51
|
+
return $( "<a>" ).text( title ).html();
|
52
|
+
},
|
53
|
+
hide: true,
|
54
|
+
// Disabled elements have inconsistent behavior across browsers (#8661)
|
55
|
+
items: "[title]:not([disabled])",
|
56
|
+
position: {
|
57
|
+
my: "left top+15",
|
58
|
+
at: "left bottom",
|
59
|
+
collision: "flipfit flip"
|
60
|
+
},
|
61
|
+
show: true,
|
62
|
+
tooltipClass: null,
|
63
|
+
track: false,
|
64
|
+
|
65
|
+
// callbacks
|
66
|
+
close: null,
|
67
|
+
open: null
|
68
|
+
},
|
69
|
+
|
70
|
+
_create: function() {
|
71
|
+
this._on({
|
72
|
+
mouseover: "open",
|
73
|
+
focusin: "open"
|
74
|
+
});
|
75
|
+
|
76
|
+
// IDs of generated tooltips, needed for destroy
|
77
|
+
this.tooltips = {};
|
78
|
+
// IDs of parent tooltips where we removed the title attribute
|
79
|
+
this.parents = {};
|
80
|
+
|
81
|
+
if ( this.options.disabled ) {
|
82
|
+
this._disable();
|
83
|
+
}
|
84
|
+
},
|
85
|
+
|
86
|
+
_setOption: function( key, value ) {
|
87
|
+
var that = this;
|
88
|
+
|
89
|
+
if ( key === "disabled" ) {
|
90
|
+
this[ value ? "_disable" : "_enable" ]();
|
91
|
+
this.options[ key ] = value;
|
92
|
+
// disable element style changes
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
|
96
|
+
this._super( key, value );
|
97
|
+
|
98
|
+
if ( key === "content" ) {
|
99
|
+
$.each( this.tooltips, function( id, element ) {
|
100
|
+
that._updateContent( element );
|
101
|
+
});
|
102
|
+
}
|
103
|
+
},
|
104
|
+
|
105
|
+
_disable: function() {
|
106
|
+
var that = this;
|
107
|
+
|
108
|
+
// close open tooltips
|
109
|
+
$.each( this.tooltips, function( id, element ) {
|
110
|
+
var event = $.Event( "blur" );
|
111
|
+
event.target = event.currentTarget = element[0];
|
112
|
+
that.close( event, true );
|
113
|
+
});
|
114
|
+
|
115
|
+
// remove title attributes to prevent native tooltips
|
116
|
+
this.element.find( this.options.items ).addBack().each(function() {
|
117
|
+
var element = $( this );
|
118
|
+
if ( element.is( "[title]" ) ) {
|
119
|
+
element
|
120
|
+
.data( "ui-tooltip-title", element.attr( "title" ) )
|
121
|
+
.attr( "title", "" );
|
122
|
+
}
|
123
|
+
});
|
124
|
+
},
|
125
|
+
|
126
|
+
_enable: function() {
|
127
|
+
// restore title attributes
|
128
|
+
this.element.find( this.options.items ).addBack().each(function() {
|
129
|
+
var element = $( this );
|
130
|
+
if ( element.data( "ui-tooltip-title" ) ) {
|
131
|
+
element.attr( "title", element.data( "ui-tooltip-title" ) );
|
132
|
+
}
|
133
|
+
});
|
134
|
+
},
|
135
|
+
|
136
|
+
open: function( event ) {
|
137
|
+
var that = this,
|
138
|
+
target = $( event ? event.target : this.element )
|
139
|
+
// we need closest here due to mouseover bubbling,
|
140
|
+
// but always pointing at the same event target
|
141
|
+
.closest( this.options.items );
|
142
|
+
|
143
|
+
// No element to show a tooltip for or the tooltip is already open
|
144
|
+
if ( !target.length || target.data( "ui-tooltip-id" ) ) {
|
145
|
+
return;
|
146
|
+
}
|
147
|
+
|
148
|
+
if ( target.attr( "title" ) ) {
|
149
|
+
target.data( "ui-tooltip-title", target.attr( "title" ) );
|
150
|
+
}
|
151
|
+
|
152
|
+
target.data( "ui-tooltip-open", true );
|
153
|
+
|
154
|
+
// kill parent tooltips, custom or native, for hover
|
155
|
+
if ( event && event.type === "mouseover" ) {
|
156
|
+
target.parents().each(function() {
|
157
|
+
var parent = $( this ),
|
158
|
+
blurEvent;
|
159
|
+
if ( parent.data( "ui-tooltip-open" ) ) {
|
160
|
+
blurEvent = $.Event( "blur" );
|
161
|
+
blurEvent.target = blurEvent.currentTarget = this;
|
162
|
+
that.close( blurEvent, true );
|
163
|
+
}
|
164
|
+
if ( parent.attr( "title" ) ) {
|
165
|
+
parent.uniqueId();
|
166
|
+
that.parents[ this.id ] = {
|
167
|
+
element: this,
|
168
|
+
title: parent.attr( "title" )
|
169
|
+
};
|
170
|
+
parent.attr( "title", "" );
|
171
|
+
}
|
172
|
+
});
|
173
|
+
}
|
174
|
+
|
175
|
+
this._updateContent( target, event );
|
176
|
+
},
|
177
|
+
|
178
|
+
_updateContent: function( target, event ) {
|
179
|
+
var content,
|
180
|
+
contentOption = this.options.content,
|
181
|
+
that = this,
|
182
|
+
eventType = event ? event.type : null;
|
183
|
+
|
184
|
+
if ( typeof contentOption === "string" ) {
|
185
|
+
return this._open( event, target, contentOption );
|
186
|
+
}
|
187
|
+
|
188
|
+
content = contentOption.call( target[0], function( response ) {
|
189
|
+
// ignore async response if tooltip was closed already
|
190
|
+
if ( !target.data( "ui-tooltip-open" ) ) {
|
191
|
+
return;
|
192
|
+
}
|
193
|
+
// IE may instantly serve a cached response for ajax requests
|
194
|
+
// delay this call to _open so the other call to _open runs first
|
195
|
+
that._delay(function() {
|
196
|
+
// jQuery creates a special event for focusin when it doesn't
|
197
|
+
// exist natively. To improve performance, the native event
|
198
|
+
// object is reused and the type is changed. Therefore, we can't
|
199
|
+
// rely on the type being correct after the event finished
|
200
|
+
// bubbling, so we set it back to the previous value. (#8740)
|
201
|
+
if ( event ) {
|
202
|
+
event.type = eventType;
|
203
|
+
}
|
204
|
+
this._open( event, target, response );
|
205
|
+
});
|
206
|
+
});
|
207
|
+
if ( content ) {
|
208
|
+
this._open( event, target, content );
|
209
|
+
}
|
210
|
+
},
|
211
|
+
|
212
|
+
_open: function( event, target, content ) {
|
213
|
+
var tooltip, events, delayedShow,
|
214
|
+
positionOption = $.extend( {}, this.options.position );
|
215
|
+
|
216
|
+
if ( !content ) {
|
217
|
+
return;
|
218
|
+
}
|
219
|
+
|
220
|
+
// Content can be updated multiple times. If the tooltip already
|
221
|
+
// exists, then just update the content and bail.
|
222
|
+
tooltip = this._find( target );
|
223
|
+
if ( tooltip.length ) {
|
224
|
+
tooltip.find( ".ui-tooltip-content" ).html( content );
|
225
|
+
return;
|
226
|
+
}
|
227
|
+
|
228
|
+
// if we have a title, clear it to prevent the native tooltip
|
229
|
+
// we have to check first to avoid defining a title if none exists
|
230
|
+
// (we don't want to cause an element to start matching [title])
|
231
|
+
//
|
232
|
+
// We use removeAttr only for key events, to allow IE to export the correct
|
233
|
+
// accessible attributes. For mouse events, set to empty string to avoid
|
234
|
+
// native tooltip showing up (happens only when removing inside mouseover).
|
235
|
+
if ( target.is( "[title]" ) ) {
|
236
|
+
if ( event && event.type === "mouseover" ) {
|
237
|
+
target.attr( "title", "" );
|
238
|
+
} else {
|
239
|
+
target.removeAttr( "title" );
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
tooltip = this._tooltip( target );
|
244
|
+
addDescribedBy( target, tooltip.attr( "id" ) );
|
245
|
+
tooltip.find( ".ui-tooltip-content" ).html( content );
|
246
|
+
|
247
|
+
function position( event ) {
|
248
|
+
positionOption.of = event;
|
249
|
+
if ( tooltip.is( ":hidden" ) ) {
|
250
|
+
return;
|
251
|
+
}
|
252
|
+
tooltip.position( positionOption );
|
253
|
+
}
|
254
|
+
if ( this.options.track && event && /^mouse/.test( event.type ) ) {
|
255
|
+
this._on( this.document, {
|
256
|
+
mousemove: position
|
257
|
+
});
|
258
|
+
// trigger once to override element-relative positioning
|
259
|
+
position( event );
|
260
|
+
} else {
|
261
|
+
tooltip.position( $.extend({
|
262
|
+
of: target
|
263
|
+
}, this.options.position ) );
|
264
|
+
}
|
265
|
+
|
266
|
+
tooltip.hide();
|
267
|
+
|
268
|
+
this._show( tooltip, this.options.show );
|
269
|
+
// Handle tracking tooltips that are shown with a delay (#8644). As soon
|
270
|
+
// as the tooltip is visible, position the tooltip using the most recent
|
271
|
+
// event.
|
272
|
+
if ( this.options.show && this.options.show.delay ) {
|
273
|
+
delayedShow = this.delayedShow = setInterval(function() {
|
274
|
+
if ( tooltip.is( ":visible" ) ) {
|
275
|
+
position( positionOption.of );
|
276
|
+
clearInterval( delayedShow );
|
277
|
+
}
|
278
|
+
}, $.fx.interval );
|
279
|
+
}
|
280
|
+
|
281
|
+
this._trigger( "open", event, { tooltip: tooltip } );
|
282
|
+
|
283
|
+
events = {
|
284
|
+
keyup: function( event ) {
|
285
|
+
if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
|
286
|
+
var fakeEvent = $.Event(event);
|
287
|
+
fakeEvent.currentTarget = target[0];
|
288
|
+
this.close( fakeEvent, true );
|
289
|
+
}
|
290
|
+
},
|
291
|
+
remove: function() {
|
292
|
+
this._removeTooltip( tooltip );
|
293
|
+
}
|
294
|
+
};
|
295
|
+
if ( !event || event.type === "mouseover" ) {
|
296
|
+
events.mouseleave = "close";
|
297
|
+
}
|
298
|
+
if ( !event || event.type === "focusin" ) {
|
299
|
+
events.focusout = "close";
|
300
|
+
}
|
301
|
+
this._on( true, target, events );
|
302
|
+
},
|
303
|
+
|
304
|
+
close: function( event ) {
|
305
|
+
var that = this,
|
306
|
+
target = $( event ? event.currentTarget : this.element ),
|
307
|
+
tooltip = this._find( target );
|
308
|
+
|
309
|
+
// disabling closes the tooltip, so we need to track when we're closing
|
310
|
+
// to avoid an infinite loop in case the tooltip becomes disabled on close
|
311
|
+
if ( this.closing ) {
|
312
|
+
return;
|
313
|
+
}
|
314
|
+
|
315
|
+
// Clear the interval for delayed tracking tooltips
|
316
|
+
clearInterval( this.delayedShow );
|
317
|
+
|
318
|
+
// only set title if we had one before (see comment in _open())
|
319
|
+
if ( target.data( "ui-tooltip-title" ) ) {
|
320
|
+
target.attr( "title", target.data( "ui-tooltip-title" ) );
|
321
|
+
}
|
322
|
+
|
323
|
+
removeDescribedBy( target );
|
324
|
+
|
325
|
+
tooltip.stop( true );
|
326
|
+
this._hide( tooltip, this.options.hide, function() {
|
327
|
+
that._removeTooltip( $( this ) );
|
328
|
+
});
|
329
|
+
|
330
|
+
target.removeData( "ui-tooltip-open" );
|
331
|
+
this._off( target, "mouseleave focusout keyup" );
|
332
|
+
// Remove 'remove' binding only on delegated targets
|
333
|
+
if ( target[0] !== this.element[0] ) {
|
334
|
+
this._off( target, "remove" );
|
335
|
+
}
|
336
|
+
this._off( this.document, "mousemove" );
|
337
|
+
|
338
|
+
if ( event && event.type === "mouseleave" ) {
|
339
|
+
$.each( this.parents, function( id, parent ) {
|
340
|
+
$( parent.element ).attr( "title", parent.title );
|
341
|
+
delete that.parents[ id ];
|
342
|
+
});
|
343
|
+
}
|
344
|
+
|
345
|
+
this.closing = true;
|
346
|
+
this._trigger( "close", event, { tooltip: tooltip } );
|
347
|
+
this.closing = false;
|
348
|
+
},
|
349
|
+
|
350
|
+
_tooltip: function( element ) {
|
351
|
+
var id = "ui-tooltip-" + increments++,
|
352
|
+
tooltip = $( "<div>" )
|
353
|
+
.attr({
|
354
|
+
id: id,
|
355
|
+
role: "tooltip"
|
356
|
+
})
|
357
|
+
.addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
|
358
|
+
( this.options.tooltipClass || "" ) );
|
359
|
+
$( "<div>" )
|
360
|
+
.addClass( "ui-tooltip-content" )
|
361
|
+
.appendTo( tooltip );
|
362
|
+
tooltip.appendTo( this.document[0].body );
|
363
|
+
this.tooltips[ id ] = element;
|
364
|
+
return tooltip;
|
365
|
+
},
|
366
|
+
|
367
|
+
_find: function( target ) {
|
368
|
+
var id = target.data( "ui-tooltip-id" );
|
369
|
+
return id ? $( "#" + id ) : $();
|
370
|
+
},
|
371
|
+
|
372
|
+
_removeTooltip: function( tooltip ) {
|
373
|
+
tooltip.remove();
|
374
|
+
delete this.tooltips[ tooltip.attr( "id" ) ];
|
375
|
+
},
|
376
|
+
|
377
|
+
_destroy: function() {
|
378
|
+
var that = this;
|
379
|
+
|
380
|
+
// close open tooltips
|
381
|
+
$.each( this.tooltips, function( id, element ) {
|
382
|
+
// Delegate to close method to handle common cleanup
|
383
|
+
var event = $.Event( "blur" );
|
384
|
+
event.target = event.currentTarget = element[0];
|
385
|
+
that.close( event, true );
|
386
|
+
|
387
|
+
// Remove immediately; destroying an open tooltip doesn't use the
|
388
|
+
// hide animation
|
389
|
+
$( "#" + id ).remove();
|
390
|
+
|
391
|
+
// Restore the title
|
392
|
+
if ( element.data( "ui-tooltip-title" ) ) {
|
393
|
+
element.attr( "title", element.data( "ui-tooltip-title" ) );
|
394
|
+
element.removeData( "ui-tooltip-title" );
|
395
|
+
}
|
396
|
+
});
|
397
|
+
}
|
398
|
+
});
|
399
|
+
|
400
|
+
}( jQuery ) );
|