author | Lennard de Rijk <ljvderijk@gmail.com> |
Thu, 13 Aug 2009 11:52:43 -0700 | |
changeset 2769 | 279d26439495 |
parent 2749 | 4e2789b8e86d |
permissions | -rw-r--r-- |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
1 |
/* |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
2 |
* jQuery UI 1.7.2 |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
3 |
* |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
4 |
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
5 |
* Dual licensed under the MIT (MIT-LICENSE.txt) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
6 |
* and GPL (GPL-LICENSE.txt) licenses. |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
7 |
* |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
8 |
* http://docs.jquery.com/UI |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
9 |
*/ |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
10 |
;jQuery.ui || (function($) { |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
11 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
12 |
var _remove = $.fn.remove, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
13 |
isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
14 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
15 |
//Helper functions and ui object |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
16 |
$.ui = { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
17 |
version: "1.7.2", |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
18 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
19 |
// $.ui.plugin is deprecated. Use the proxy pattern instead. |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
20 |
plugin: { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
21 |
add: function(module, option, set) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
22 |
var proto = $.ui[module].prototype; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
23 |
for(var i in set) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
24 |
proto.plugins[i] = proto.plugins[i] || []; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
25 |
proto.plugins[i].push([option, set[i]]); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
26 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
27 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
28 |
call: function(instance, name, args) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
29 |
var set = instance.plugins[name]; |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
30 |
if(!set || !instance.element[0].parentNode) { return; } |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
31 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
32 |
for (var i = 0; i < set.length; i++) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
33 |
if (instance.options[set[i][0]]) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
34 |
set[i][1].apply(instance.element, args); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
35 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
36 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
37 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
38 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
39 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
40 |
contains: function(a, b) { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
41 |
return document.compareDocumentPosition |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
42 |
? a.compareDocumentPosition(b) & 16 |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
43 |
: a !== b && a.contains(b); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
44 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
45 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
46 |
hasScroll: function(el, a) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
47 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
48 |
//If overflow is hidden, the element might have extra content, but the user wants to hide it |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
49 |
if ($(el).css('overflow') == 'hidden') { return false; } |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
50 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
51 |
var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
52 |
has = false; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
53 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
54 |
if (el[scroll] > 0) { return true; } |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
55 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
56 |
// TODO: determine which cases actually cause this to happen |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
57 |
// if the element doesn't have the scroll set, see if it's possible to |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
58 |
// set the scroll |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
59 |
el[scroll] = 1; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
60 |
has = (el[scroll] > 0); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
61 |
el[scroll] = 0; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
62 |
return has; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
63 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
64 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
65 |
isOverAxis: function(x, reference, size) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
66 |
//Determines when x coordinate is over "b" element axis |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
67 |
return (x > reference) && (x < (reference + size)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
68 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
69 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
70 |
isOver: function(y, x, top, left, height, width) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
71 |
//Determines when x, y coordinates is over "b" element |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
72 |
return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
73 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
74 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
75 |
keyCode: { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
76 |
BACKSPACE: 8, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
77 |
CAPS_LOCK: 20, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
78 |
COMMA: 188, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
79 |
CONTROL: 17, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
80 |
DELETE: 46, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
81 |
DOWN: 40, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
82 |
END: 35, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
83 |
ENTER: 13, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
84 |
ESCAPE: 27, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
85 |
HOME: 36, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
86 |
INSERT: 45, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
87 |
LEFT: 37, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
88 |
NUMPAD_ADD: 107, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
89 |
NUMPAD_DECIMAL: 110, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
90 |
NUMPAD_DIVIDE: 111, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
91 |
NUMPAD_ENTER: 108, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
92 |
NUMPAD_MULTIPLY: 106, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
93 |
NUMPAD_SUBTRACT: 109, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
94 |
PAGE_DOWN: 34, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
95 |
PAGE_UP: 33, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
96 |
PERIOD: 190, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
97 |
RIGHT: 39, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
98 |
SHIFT: 16, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
99 |
SPACE: 32, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
100 |
TAB: 9, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
101 |
UP: 38 |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
102 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
103 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
104 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
105 |
// WAI-ARIA normalization |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
106 |
if (isFF2) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
107 |
var attr = $.attr, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
108 |
removeAttr = $.fn.removeAttr, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
109 |
ariaNS = "http://www.w3.org/2005/07/aaa", |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
110 |
ariaState = /^aria-/, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
111 |
ariaRole = /^wairole:/; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
112 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
113 |
$.attr = function(elem, name, value) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
114 |
var set = value !== undefined; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
115 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
116 |
return (name == 'role' |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
117 |
? (set |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
118 |
? attr.call(this, elem, name, "wairole:" + value) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
119 |
: (attr.apply(this, arguments) || "").replace(ariaRole, "")) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
120 |
: (ariaState.test(name) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
121 |
? (set |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
122 |
? elem.setAttributeNS(ariaNS, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
123 |
name.replace(ariaState, "aaa:"), value) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
124 |
: attr.call(this, elem, name.replace(ariaState, "aaa:"))) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
125 |
: attr.apply(this, arguments))); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
126 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
127 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
128 |
$.fn.removeAttr = function(name) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
129 |
return (ariaState.test(name) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
130 |
? this.each(function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
131 |
this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
132 |
}) : removeAttr.call(this, name)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
133 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
134 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
135 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
136 |
//jQuery plugins |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
137 |
$.fn.extend({ |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
138 |
remove: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
139 |
// Safari has a native remove event which actually removes DOM elements, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
140 |
// so we have to use triggerHandler instead of trigger (#3037). |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
141 |
$("*", this).add(this).each(function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
142 |
$(this).triggerHandler("remove"); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
143 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
144 |
return _remove.apply(this, arguments ); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
145 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
146 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
147 |
enableSelection: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
148 |
return this |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
149 |
.attr('unselectable', 'off') |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
150 |
.css('MozUserSelect', '') |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
151 |
.unbind('selectstart.ui'); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
152 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
153 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
154 |
disableSelection: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
155 |
return this |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
156 |
.attr('unselectable', 'on') |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
157 |
.css('MozUserSelect', 'none') |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
158 |
.bind('selectstart.ui', function() { return false; }); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
159 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
160 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
161 |
scrollParent: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
162 |
var scrollParent; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
163 |
if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
164 |
scrollParent = this.parents().filter(function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
165 |
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
166 |
}).eq(0); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
167 |
} else { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
168 |
scrollParent = this.parents().filter(function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
169 |
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
170 |
}).eq(0); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
171 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
172 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
173 |
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
174 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
175 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
176 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
177 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
178 |
//Additional selectors |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
179 |
$.extend($.expr[':'], { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
180 |
data: function(elem, i, match) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
181 |
return !!$.data(elem, match[3]); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
182 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
183 |
|
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
184 |
focusable: function(element) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
185 |
var nodeName = element.nodeName.toLowerCase(), |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
186 |
tabIndex = $.attr(element, 'tabindex'); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
187 |
return (/input|select|textarea|button|object/.test(nodeName) |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
188 |
? !element.disabled |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
189 |
: 'a' == nodeName || 'area' == nodeName |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
190 |
? element.href || !isNaN(tabIndex) |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
191 |
: !isNaN(tabIndex)) |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
192 |
// the element and all of its ancestors must be visible |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
193 |
// the browser may report that the area is hidden |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
194 |
&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
195 |
}, |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
196 |
|
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
197 |
tabbable: function(element) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
198 |
var tabIndex = $.attr(element, 'tabindex'); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
199 |
return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
200 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
201 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
202 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
203 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
204 |
// $.widget is a factory to create jQuery plugins |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
205 |
// taking some boilerplate code out of the plugin code |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
206 |
function getter(namespace, plugin, method, args) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
207 |
function getMethods(type) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
208 |
var methods = $[namespace][plugin][type] || []; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
209 |
return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
210 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
211 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
212 |
var methods = getMethods('getter'); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
213 |
if (args.length == 1 && typeof args[0] == 'string') { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
214 |
methods = methods.concat(getMethods('getterSetter')); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
215 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
216 |
return ($.inArray(method, methods) != -1); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
217 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
218 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
219 |
$.widget = function(name, prototype) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
220 |
var namespace = name.split(".")[0]; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
221 |
name = name.split(".")[1]; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
222 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
223 |
// create plugin method |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
224 |
$.fn[name] = function(options) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
225 |
var isMethodCall = (typeof options == 'string'), |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
226 |
args = Array.prototype.slice.call(arguments, 1); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
227 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
228 |
// prevent calls to internal methods |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
229 |
if (isMethodCall && options.substring(0, 1) == '_') { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
230 |
return this; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
231 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
232 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
233 |
// handle getter methods |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
234 |
if (isMethodCall && getter(namespace, name, options, args)) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
235 |
var instance = $.data(this[0], name); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
236 |
return (instance ? instance[options].apply(instance, args) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
237 |
: undefined); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
238 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
239 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
240 |
// handle initialization and non-getter methods |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
241 |
return this.each(function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
242 |
var instance = $.data(this, name); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
243 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
244 |
// constructor |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
245 |
(!instance && !isMethodCall && |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
246 |
$.data(this, name, new $[namespace][name](this, options))._init()); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
247 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
248 |
// method call |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
249 |
(instance && isMethodCall && $.isFunction(instance[options]) && |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
250 |
instance[options].apply(instance, args)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
251 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
252 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
253 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
254 |
// create widget constructor |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
255 |
$[namespace] = $[namespace] || {}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
256 |
$[namespace][name] = function(element, options) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
257 |
var self = this; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
258 |
|
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
259 |
this.namespace = namespace; |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
260 |
this.widgetName = name; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
261 |
this.widgetEventPrefix = $[namespace][name].eventPrefix || name; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
262 |
this.widgetBaseClass = namespace + '-' + name; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
263 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
264 |
this.options = $.extend({}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
265 |
$.widget.defaults, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
266 |
$[namespace][name].defaults, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
267 |
$.metadata && $.metadata.get(element)[name], |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
268 |
options); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
269 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
270 |
this.element = $(element) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
271 |
.bind('setData.' + name, function(event, key, value) { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
272 |
if (event.target == element) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
273 |
return self._setData(key, value); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
274 |
} |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
275 |
}) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
276 |
.bind('getData.' + name, function(event, key) { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
277 |
if (event.target == element) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
278 |
return self._getData(key); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
279 |
} |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
280 |
}) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
281 |
.bind('remove', function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
282 |
return self.destroy(); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
283 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
284 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
285 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
286 |
// add widget prototype |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
287 |
$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
288 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
289 |
// TODO: merge getter and getterSetter properties from widget prototype |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
290 |
// and plugin prototype |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
291 |
$[namespace][name].getterSetter = 'option'; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
292 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
293 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
294 |
$.widget.prototype = { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
295 |
_init: function() {}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
296 |
destroy: function() { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
297 |
this.element.removeData(this.widgetName) |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
298 |
.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled') |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
299 |
.removeAttr('aria-disabled'); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
300 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
301 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
302 |
option: function(key, value) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
303 |
var options = key, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
304 |
self = this; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
305 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
306 |
if (typeof key == "string") { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
307 |
if (value === undefined) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
308 |
return this._getData(key); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
309 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
310 |
options = {}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
311 |
options[key] = value; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
312 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
313 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
314 |
$.each(options, function(key, value) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
315 |
self._setData(key, value); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
316 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
317 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
318 |
_getData: function(key) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
319 |
return this.options[key]; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
320 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
321 |
_setData: function(key, value) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
322 |
this.options[key] = value; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
323 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
324 |
if (key == 'disabled') { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
325 |
this.element |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
326 |
[value ? 'addClass' : 'removeClass']( |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
327 |
this.widgetBaseClass + '-disabled' + ' ' + |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
328 |
this.namespace + '-state-disabled') |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
329 |
.attr("aria-disabled", value); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
330 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
331 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
332 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
333 |
enable: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
334 |
this._setData('disabled', false); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
335 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
336 |
disable: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
337 |
this._setData('disabled', true); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
338 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
339 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
340 |
_trigger: function(type, event, data) { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
341 |
var callback = this.options[type], |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
342 |
eventName = (type == this.widgetEventPrefix |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
343 |
? type : this.widgetEventPrefix + type); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
344 |
|
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
345 |
event = $.Event(event); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
346 |
event.type = eventName; |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
347 |
|
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
348 |
// copy original event properties over to the new event |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
349 |
// this would happen if we could call $.event.fix instead of $.Event |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
350 |
// but we don't have a way to force an event to be fixed multiple times |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
351 |
if (event.originalEvent) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
352 |
for (var i = $.event.props.length, prop; i;) { |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
353 |
prop = $.event.props[--i]; |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
354 |
event[prop] = event.originalEvent[prop]; |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
355 |
} |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
356 |
} |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
357 |
|
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
358 |
this.element.trigger(event, data); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
359 |
|
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
360 |
return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
361 |
|| event.isDefaultPrevented()); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
362 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
363 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
364 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
365 |
$.widget.defaults = { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
366 |
disabled: false |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
367 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
368 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
369 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
370 |
/** Mouse Interaction Plugin **/ |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
371 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
372 |
$.ui.mouse = { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
373 |
_mouseInit: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
374 |
var self = this; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
375 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
376 |
this.element |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
377 |
.bind('mousedown.'+this.widgetName, function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
378 |
return self._mouseDown(event); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
379 |
}) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
380 |
.bind('click.'+this.widgetName, function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
381 |
if(self._preventClickEvent) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
382 |
self._preventClickEvent = false; |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
383 |
event.stopImmediatePropagation(); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
384 |
return false; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
385 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
386 |
}); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
387 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
388 |
// Prevent text selection in IE |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
389 |
if ($.browser.msie) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
390 |
this._mouseUnselectable = this.element.attr('unselectable'); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
391 |
this.element.attr('unselectable', 'on'); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
392 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
393 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
394 |
this.started = false; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
395 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
396 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
397 |
// TODO: make sure destroying one instance of mouse doesn't mess with |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
398 |
// other instances of mouse |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
399 |
_mouseDestroy: function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
400 |
this.element.unbind('.'+this.widgetName); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
401 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
402 |
// Restore text selection in IE |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
403 |
($.browser.msie |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
404 |
&& this.element.attr('unselectable', this._mouseUnselectable)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
405 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
406 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
407 |
_mouseDown: function(event) { |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
408 |
// don't let more than one widget handle mouseStart |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
409 |
// TODO: figure out why we have to use originalEvent |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
410 |
event.originalEvent = event.originalEvent || {}; |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
411 |
if (event.originalEvent.mouseHandled) { return; } |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
412 |
|
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
413 |
// we may have missed mouseup (out of window) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
414 |
(this._mouseStarted && this._mouseUp(event)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
415 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
416 |
this._mouseDownEvent = event; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
417 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
418 |
var self = this, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
419 |
btnIsLeft = (event.which == 1), |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
420 |
elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
421 |
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
422 |
return true; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
423 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
424 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
425 |
this.mouseDelayMet = !this.options.delay; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
426 |
if (!this.mouseDelayMet) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
427 |
this._mouseDelayTimer = setTimeout(function() { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
428 |
self.mouseDelayMet = true; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
429 |
}, this.options.delay); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
430 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
431 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
432 |
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
433 |
this._mouseStarted = (this._mouseStart(event) !== false); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
434 |
if (!this._mouseStarted) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
435 |
event.preventDefault(); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
436 |
return true; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
437 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
438 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
439 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
440 |
// these delegates are required to keep context |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
441 |
this._mouseMoveDelegate = function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
442 |
return self._mouseMove(event); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
443 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
444 |
this._mouseUpDelegate = function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
445 |
return self._mouseUp(event); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
446 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
447 |
$(document) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
448 |
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
449 |
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
450 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
451 |
// preventDefault() is used to prevent the selection of text here - |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
452 |
// however, in Safari, this causes select boxes not to be selectable |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
453 |
// anymore, so this fix is needed |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
454 |
($.browser.safari || event.preventDefault()); |
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
455 |
|
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
456 |
event.originalEvent.mouseHandled = true; |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
457 |
return true; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
458 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
459 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
460 |
_mouseMove: function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
461 |
// IE mouseup check - mouseup happened when mouse was out of window |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
462 |
if ($.browser.msie && !event.button) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
463 |
return this._mouseUp(event); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
464 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
465 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
466 |
if (this._mouseStarted) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
467 |
this._mouseDrag(event); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
468 |
return event.preventDefault(); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
469 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
470 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
471 |
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
472 |
this._mouseStarted = |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
473 |
(this._mouseStart(this._mouseDownEvent, event) !== false); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
474 |
(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
475 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
476 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
477 |
return !this._mouseStarted; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
478 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
479 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
480 |
_mouseUp: function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
481 |
$(document) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
482 |
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
483 |
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
484 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
485 |
if (this._mouseStarted) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
486 |
this._mouseStarted = false; |
2749
4e2789b8e86d
Upgrade jQuery UI to version 1.7.
Mario Ferraro <fadinlight@gmail.com>
parents:
2420
diff
changeset
|
487 |
this._preventClickEvent = (event.target == this._mouseDownEvent.target); |
839
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
488 |
this._mouseStop(event); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
489 |
} |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
490 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
491 |
return false; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
492 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
493 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
494 |
_mouseDistanceMet: function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
495 |
return (Math.max( |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
496 |
Math.abs(this._mouseDownEvent.pageX - event.pageX), |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
497 |
Math.abs(this._mouseDownEvent.pageY - event.pageY) |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
498 |
) >= this.options.distance |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
499 |
); |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
500 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
501 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
502 |
_mouseDelayMet: function(event) { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
503 |
return this.mouseDelayMet; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
504 |
}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
505 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
506 |
// These are placeholder methods, to be overriden by extending plugin |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
507 |
_mouseStart: function(event) {}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
508 |
_mouseDrag: function(event) {}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
509 |
_mouseStop: function(event) {}, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
510 |
_mouseCapture: function(event) { return true; } |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
511 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
512 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
513 |
$.ui.mouse.defaults = { |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
514 |
cancel: null, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
515 |
distance: 1, |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
516 |
delay: 0 |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
517 |
}; |
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
518 |
|
3e50c012a4a8
Add datetimepicker javascript widget files and css file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
diff
changeset
|
519 |
})(jQuery); |