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,269 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery UI Selectable @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/selectable/
|
10
|
+
*
|
11
|
+
* Depends:
|
12
|
+
* jquery.ui.core.js
|
13
|
+
* jquery.ui.mouse.js
|
14
|
+
* jquery.ui.widget.js
|
15
|
+
*/
|
16
|
+
(function( $, undefined ) {
|
17
|
+
|
18
|
+
$.widget("ui.selectable", $.ui.mouse, {
|
19
|
+
version: "@VERSION",
|
20
|
+
options: {
|
21
|
+
appendTo: "body",
|
22
|
+
autoRefresh: true,
|
23
|
+
distance: 0,
|
24
|
+
filter: "*",
|
25
|
+
tolerance: "touch"
|
26
|
+
},
|
27
|
+
_create: function() {
|
28
|
+
var selectees,
|
29
|
+
that = this;
|
30
|
+
|
31
|
+
this.element.addClass("ui-selectable");
|
32
|
+
|
33
|
+
this.dragged = false;
|
34
|
+
|
35
|
+
// cache selectee children based on filter
|
36
|
+
this.refresh = function() {
|
37
|
+
selectees = $(that.options.filter, that.element[0]);
|
38
|
+
selectees.addClass("ui-selectee");
|
39
|
+
selectees.each(function() {
|
40
|
+
var $this = $(this),
|
41
|
+
pos = $this.offset();
|
42
|
+
$.data(this, "selectable-item", {
|
43
|
+
element: this,
|
44
|
+
$element: $this,
|
45
|
+
left: pos.left,
|
46
|
+
top: pos.top,
|
47
|
+
right: pos.left + $this.outerWidth(),
|
48
|
+
bottom: pos.top + $this.outerHeight(),
|
49
|
+
startselected: false,
|
50
|
+
selected: $this.hasClass("ui-selected"),
|
51
|
+
selecting: $this.hasClass("ui-selecting"),
|
52
|
+
unselecting: $this.hasClass("ui-unselecting")
|
53
|
+
});
|
54
|
+
});
|
55
|
+
};
|
56
|
+
this.refresh();
|
57
|
+
|
58
|
+
this.selectees = selectees.addClass("ui-selectee");
|
59
|
+
|
60
|
+
this._mouseInit();
|
61
|
+
|
62
|
+
this.helper = $("<div class='ui-selectable-helper'></div>");
|
63
|
+
},
|
64
|
+
|
65
|
+
_destroy: function() {
|
66
|
+
this.selectees
|
67
|
+
.removeClass("ui-selectee")
|
68
|
+
.removeData("selectable-item");
|
69
|
+
this.element
|
70
|
+
.removeClass("ui-selectable ui-selectable-disabled");
|
71
|
+
this._mouseDestroy();
|
72
|
+
},
|
73
|
+
|
74
|
+
_mouseStart: function(event) {
|
75
|
+
var that = this,
|
76
|
+
options = this.options;
|
77
|
+
|
78
|
+
this.opos = [event.pageX, event.pageY];
|
79
|
+
|
80
|
+
if (this.options.disabled) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
|
84
|
+
this.selectees = $(options.filter, this.element[0]);
|
85
|
+
|
86
|
+
this._trigger("start", event);
|
87
|
+
|
88
|
+
$(options.appendTo).append(this.helper);
|
89
|
+
// position helper (lasso)
|
90
|
+
this.helper.css({
|
91
|
+
"left": event.pageX,
|
92
|
+
"top": event.pageY,
|
93
|
+
"width": 0,
|
94
|
+
"height": 0
|
95
|
+
});
|
96
|
+
|
97
|
+
if (options.autoRefresh) {
|
98
|
+
this.refresh();
|
99
|
+
}
|
100
|
+
|
101
|
+
this.selectees.filter(".ui-selected").each(function() {
|
102
|
+
var selectee = $.data(this, "selectable-item");
|
103
|
+
selectee.startselected = true;
|
104
|
+
if (!event.metaKey && !event.ctrlKey) {
|
105
|
+
selectee.$element.removeClass("ui-selected");
|
106
|
+
selectee.selected = false;
|
107
|
+
selectee.$element.addClass("ui-unselecting");
|
108
|
+
selectee.unselecting = true;
|
109
|
+
// selectable UNSELECTING callback
|
110
|
+
that._trigger("unselecting", event, {
|
111
|
+
unselecting: selectee.element
|
112
|
+
});
|
113
|
+
}
|
114
|
+
});
|
115
|
+
|
116
|
+
$(event.target).parents().addBack().each(function() {
|
117
|
+
var doSelect,
|
118
|
+
selectee = $.data(this, "selectable-item");
|
119
|
+
if (selectee) {
|
120
|
+
doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
|
121
|
+
selectee.$element
|
122
|
+
.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
|
123
|
+
.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
|
124
|
+
selectee.unselecting = !doSelect;
|
125
|
+
selectee.selecting = doSelect;
|
126
|
+
selectee.selected = doSelect;
|
127
|
+
// selectable (UN)SELECTING callback
|
128
|
+
if (doSelect) {
|
129
|
+
that._trigger("selecting", event, {
|
130
|
+
selecting: selectee.element
|
131
|
+
});
|
132
|
+
} else {
|
133
|
+
that._trigger("unselecting", event, {
|
134
|
+
unselecting: selectee.element
|
135
|
+
});
|
136
|
+
}
|
137
|
+
return false;
|
138
|
+
}
|
139
|
+
});
|
140
|
+
|
141
|
+
},
|
142
|
+
|
143
|
+
_mouseDrag: function(event) {
|
144
|
+
|
145
|
+
this.dragged = true;
|
146
|
+
|
147
|
+
if (this.options.disabled) {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
|
151
|
+
var tmp,
|
152
|
+
that = this,
|
153
|
+
options = this.options,
|
154
|
+
x1 = this.opos[0],
|
155
|
+
y1 = this.opos[1],
|
156
|
+
x2 = event.pageX,
|
157
|
+
y2 = event.pageY;
|
158
|
+
|
159
|
+
if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
|
160
|
+
if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
|
161
|
+
this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
|
162
|
+
|
163
|
+
this.selectees.each(function() {
|
164
|
+
var selectee = $.data(this, "selectable-item"),
|
165
|
+
hit = false;
|
166
|
+
|
167
|
+
//prevent helper from being selected if appendTo: selectable
|
168
|
+
if (!selectee || selectee.element === that.element[0]) {
|
169
|
+
return;
|
170
|
+
}
|
171
|
+
|
172
|
+
if (options.tolerance === "touch") {
|
173
|
+
hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
|
174
|
+
} else if (options.tolerance === "fit") {
|
175
|
+
hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
|
176
|
+
}
|
177
|
+
|
178
|
+
if (hit) {
|
179
|
+
// SELECT
|
180
|
+
if (selectee.selected) {
|
181
|
+
selectee.$element.removeClass("ui-selected");
|
182
|
+
selectee.selected = false;
|
183
|
+
}
|
184
|
+
if (selectee.unselecting) {
|
185
|
+
selectee.$element.removeClass("ui-unselecting");
|
186
|
+
selectee.unselecting = false;
|
187
|
+
}
|
188
|
+
if (!selectee.selecting) {
|
189
|
+
selectee.$element.addClass("ui-selecting");
|
190
|
+
selectee.selecting = true;
|
191
|
+
// selectable SELECTING callback
|
192
|
+
that._trigger("selecting", event, {
|
193
|
+
selecting: selectee.element
|
194
|
+
});
|
195
|
+
}
|
196
|
+
} else {
|
197
|
+
// UNSELECT
|
198
|
+
if (selectee.selecting) {
|
199
|
+
if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
|
200
|
+
selectee.$element.removeClass("ui-selecting");
|
201
|
+
selectee.selecting = false;
|
202
|
+
selectee.$element.addClass("ui-selected");
|
203
|
+
selectee.selected = true;
|
204
|
+
} else {
|
205
|
+
selectee.$element.removeClass("ui-selecting");
|
206
|
+
selectee.selecting = false;
|
207
|
+
if (selectee.startselected) {
|
208
|
+
selectee.$element.addClass("ui-unselecting");
|
209
|
+
selectee.unselecting = true;
|
210
|
+
}
|
211
|
+
// selectable UNSELECTING callback
|
212
|
+
that._trigger("unselecting", event, {
|
213
|
+
unselecting: selectee.element
|
214
|
+
});
|
215
|
+
}
|
216
|
+
}
|
217
|
+
if (selectee.selected) {
|
218
|
+
if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
|
219
|
+
selectee.$element.removeClass("ui-selected");
|
220
|
+
selectee.selected = false;
|
221
|
+
|
222
|
+
selectee.$element.addClass("ui-unselecting");
|
223
|
+
selectee.unselecting = true;
|
224
|
+
// selectable UNSELECTING callback
|
225
|
+
that._trigger("unselecting", event, {
|
226
|
+
unselecting: selectee.element
|
227
|
+
});
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
231
|
+
});
|
232
|
+
|
233
|
+
return false;
|
234
|
+
},
|
235
|
+
|
236
|
+
_mouseStop: function(event) {
|
237
|
+
var that = this;
|
238
|
+
|
239
|
+
this.dragged = false;
|
240
|
+
|
241
|
+
$(".ui-unselecting", this.element[0]).each(function() {
|
242
|
+
var selectee = $.data(this, "selectable-item");
|
243
|
+
selectee.$element.removeClass("ui-unselecting");
|
244
|
+
selectee.unselecting = false;
|
245
|
+
selectee.startselected = false;
|
246
|
+
that._trigger("unselected", event, {
|
247
|
+
unselected: selectee.element
|
248
|
+
});
|
249
|
+
});
|
250
|
+
$(".ui-selecting", this.element[0]).each(function() {
|
251
|
+
var selectee = $.data(this, "selectable-item");
|
252
|
+
selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
|
253
|
+
selectee.selecting = false;
|
254
|
+
selectee.selected = true;
|
255
|
+
selectee.startselected = true;
|
256
|
+
that._trigger("selected", event, {
|
257
|
+
selected: selectee.element
|
258
|
+
});
|
259
|
+
});
|
260
|
+
this._trigger("stop", event);
|
261
|
+
|
262
|
+
this.helper.remove();
|
263
|
+
|
264
|
+
return false;
|
265
|
+
}
|
266
|
+
|
267
|
+
});
|
268
|
+
|
269
|
+
})(jQuery);
|