| author | Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> |
| Wed, 27 Apr 2011 18:54:31 +0200 | |
| changeset 133 | 9578d3ddce17 |
| parent 99 | 6cb4d10f0b8b |
| permissions | -rwxr-xr-x |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
1 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
2 |
* Interface Elements for jQuery |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
3 |
* Slider |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
4 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
5 |
* http://interface.eyecon.ro |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
6 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
7 |
* Copyright (c) 2006 Stefan Petre |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
8 |
* Dual licensed under the MIT (MIT-LICENSE.txt) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
9 |
* and GPL (GPL-LICENSE.txt) licenses. |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
10 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
11 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
12 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
13 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
14 |
jQuery.iSlider = { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
15 |
tabindex : 1, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
16 |
set : function (values) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
17 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
18 |
var values = values; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
19 |
return this.each( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
20 |
function() |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
21 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
22 |
this.slideCfg.sliders.each( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
23 |
function (key) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
24 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
25 |
jQuery.iSlider.dragmoveBy(this,values[key]); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
26 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
27 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
28 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
29 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
30 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
31 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
32 |
get : function() |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
33 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
34 |
var values = []; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
35 |
this.each( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
36 |
function(slider) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
37 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
38 |
if (this.isSlider) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
39 |
values[slider] = []; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
40 |
var elm = this; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
41 |
var sizes = jQuery.iUtil.getSize(this); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
42 |
this.slideCfg.sliders.each( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
43 |
function (key) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
44 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
45 |
var x = this.offsetLeft; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
46 |
var y = this.offsetTop; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
47 |
xproc = parseInt(x * 100 / (sizes.w - this.offsetWidth)); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
48 |
yproc = parseInt(y * 100 / (sizes.h - this.offsetHeight)); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
49 |
values[slider][key] = [xproc||0, yproc||0, x||0, y||0]; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
50 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
51 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
52 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
53 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
54 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
55 |
return values; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
56 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
57 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
58 |
modifyContainer : function (elm) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
59 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
60 |
elm.dragCfg.containerMaxx = elm.dragCfg.cont.w - elm.dragCfg.oC.wb; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
61 |
elm.dragCfg.containerMaxy = elm.dragCfg.cont.h - elm.dragCfg.oC.hb; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
62 |
if (elm.SliderContainer.slideCfg.restricted ) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
63 |
next = elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration+1); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
64 |
if (next) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
65 |
elm.dragCfg.cont.w = (parseInt(jQuery(next).css('left'))||0) + elm.dragCfg.oC.wb; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
66 |
elm.dragCfg.cont.h = (parseInt(jQuery(next).css('top'))||0) + elm.dragCfg.oC.hb; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
67 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
68 |
prev = elm.SliderContainer.slideCfg.sliders.get(elm.SliderIteration-1); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
69 |
if (prev) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
70 |
var prevLeft = parseInt(jQuery(prev).css('left'))||0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
71 |
var prevTop = parseInt(jQuery(prev).css('left'))||0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
72 |
elm.dragCfg.cont.x += prevLeft; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
73 |
elm.dragCfg.cont.y += prevTop; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
74 |
elm.dragCfg.cont.w -= prevLeft; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
75 |
elm.dragCfg.cont.h -= prevTop; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
76 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
77 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
78 |
elm.dragCfg.maxx = elm.dragCfg.cont.w - elm.dragCfg.oC.wb; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
79 |
elm.dragCfg.maxy = elm.dragCfg.cont.h - elm.dragCfg.oC.hb; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
80 |
if(elm.dragCfg.fractions) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
81 |
elm.dragCfg.gx = ((elm.dragCfg.cont.w - elm.dragCfg.oC.wb)/elm.dragCfg.fractions) || 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
82 |
elm.dragCfg.gy = ((elm.dragCfg.cont.h - elm.dragCfg.oC.hb)/elm.dragCfg.fractions) || 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
83 |
elm.dragCfg.fracW = elm.dragCfg.maxx / elm.dragCfg.fractions; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
84 |
elm.dragCfg.fracH = elm.dragCfg.maxy / elm.dragCfg.fractions; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
85 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
86 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
87 |
elm.dragCfg.cont.dx = elm.dragCfg.cont.x - elm.dragCfg.oR.x; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
88 |
elm.dragCfg.cont.dy = elm.dragCfg.cont.y - elm.dragCfg.oR.y; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
89 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
90 |
jQuery.iDrag.helper.css('cursor', 'default'); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
91 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
92 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
93 |
onSlide : function(elm, x, y) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
94 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
95 |
if (elm.dragCfg.fractions) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
96 |
xfrac = parseInt(x/elm.dragCfg.fracW); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
97 |
xproc = xfrac * 100 / elm.dragCfg.fractions; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
98 |
yfrac = parseInt(y/elm.dragCfg.fracH); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
99 |
yproc = yfrac * 100 / elm.dragCfg.fractions; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
100 |
} else { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
101 |
xproc = parseInt(x * 100 / elm.dragCfg.containerMaxx); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
102 |
yproc = parseInt(y * 100 / elm.dragCfg.containerMaxy); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
103 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
104 |
elm.dragCfg.lastSi = [xproc||0, yproc||0, x||0, y||0]; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
105 |
if (elm.dragCfg.onSlide) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
106 |
elm.dragCfg.onSlide.apply(elm, elm.dragCfg.lastSi); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
107 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
108 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
109 |
dragmoveByKey : function (event) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
110 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
111 |
pressedKey = event.charCode || event.keyCode || -1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
112 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
113 |
switch (pressedKey) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
114 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
115 |
//end |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
116 |
case 35: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
117 |
jQuery.iSlider.dragmoveBy(this.dragElem, [2000, 2000] ); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
118 |
break; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
119 |
//home |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
120 |
case 36: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
121 |
jQuery.iSlider.dragmoveBy(this.dragElem, [-2000, -2000] ); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
122 |
break; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
123 |
//left |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
124 |
case 37: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
125 |
jQuery.iSlider.dragmoveBy(this.dragElem, [-this.dragElem.dragCfg.gx||-1, 0] ); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
126 |
break; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
127 |
//up |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
128 |
case 38: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
129 |
jQuery.iSlider.dragmoveBy(this.dragElem, [0, -this.dragElem.dragCfg.gy||-1] ); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
130 |
break; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
131 |
//right |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
132 |
case 39: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
133 |
jQuery.iSlider.dragmoveBy(this.dragElem, [this.dragElem.dragCfg.gx||1, 0] ); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
134 |
break; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
135 |
//down; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
136 |
case 40: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
137 |
jQuery.iDrag.dragmoveBy(this.dragElem, [0, this.dragElem.dragCfg.gy||1] ); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
138 |
break; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
139 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
140 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
141 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
142 |
dragmoveBy : function (elm, position) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
143 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
144 |
if (!elm.dragCfg) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
145 |
return; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
146 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
147 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
148 |
elm.dragCfg.oC = jQuery.extend( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
149 |
jQuery.iUtil.getPosition(elm), |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
150 |
jQuery.iUtil.getSize(elm) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
151 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
152 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
153 |
elm.dragCfg.oR = { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
154 |
x : parseInt(jQuery.css(elm, 'left'))||0, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
155 |
y : parseInt(jQuery.css(elm, 'top'))||0 |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
156 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
157 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
158 |
elm.dragCfg.oP = jQuery.css(elm, 'position'); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
159 |
if (elm.dragCfg.oP != 'relative' && elm.dragCfg.oP != 'absolute') { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
160 |
elm.style.position = 'relative'; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
161 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
162 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
163 |
jQuery.iDrag.getContainment(elm); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
164 |
jQuery.iSlider.modifyContainer(elm); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
165 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
166 |
dx = parseInt(position[0]) || 0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
167 |
dy = parseInt(position[1]) || 0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
168 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
169 |
nx = elm.dragCfg.oR.x + dx; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
170 |
ny = elm.dragCfg.oR.y + dy; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
171 |
if(elm.dragCfg.fractions) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
172 |
newCoords = jQuery.iDrag.snapToGrid.apply(elm, [nx, ny, dx, dy]); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
173 |
if (newCoords.constructor == Object) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
174 |
dx = newCoords.dx; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
175 |
dy = newCoords.dy; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
176 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
177 |
nx = elm.dragCfg.oR.x + dx; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
178 |
ny = elm.dragCfg.oR.y + dy; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
179 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
180 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
181 |
newCoords = jQuery.iDrag.fitToContainer.apply(elm, [nx, ny, dx, dy]); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
182 |
if (newCoords && newCoords.constructor == Object) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
183 |
dx = newCoords.dx; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
184 |
dy = newCoords.dy; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
185 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
186 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
187 |
nx = elm.dragCfg.oR.x + dx; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
188 |
ny = elm.dragCfg.oR.y + dy; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
189 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
190 |
if (elm.dragCfg.si && (elm.dragCfg.onSlide || elm.dragCfg.onChange)) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
191 |
jQuery.iSlider.onSlide(elm, nx, ny); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
192 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
193 |
nx = !elm.dragCfg.axis || elm.dragCfg.axis == 'horizontally' ? nx : elm.dragCfg.oR.x||0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
194 |
ny = !elm.dragCfg.axis || elm.dragCfg.axis == 'vertically' ? ny : elm.dragCfg.oR.y||0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
195 |
elm.style.left = nx + 'px'; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
196 |
elm.style.top = ny + 'px'; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
197 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
198 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
199 |
build : function(o) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
200 |
return this.each( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
201 |
function() |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
202 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
203 |
if (this.isSlider == true || !o.accept || !jQuery.iUtil || !jQuery.iDrag || !jQuery.iDrop){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
204 |
return; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
205 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
206 |
toDrag = jQuery(o.accept, this); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
207 |
if (toDrag.size() == 0) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
208 |
return; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
209 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
210 |
var params = { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
211 |
containment: 'parent', |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
212 |
si : true, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
213 |
onSlide : o.onSlide && o.onSlide.constructor == Function ? o.onSlide : null, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
214 |
onChange : o.onChange && o.onChange.constructor == Function ? o.onChange : null, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
215 |
handle: this, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
216 |
opacity: o.opacity||false |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
217 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
218 |
if (o.fractions && parseInt(o.fractions)) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
219 |
params.fractions = parseInt(o.fractions)||1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
220 |
params.fractions = params.fractions > 0 ? params.fractions : 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
221 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
222 |
if (toDrag.size() == 1) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
223 |
toDrag.Draggable(params); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
224 |
else { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
225 |
jQuery(toDrag.get(0)).Draggable(params); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
226 |
params.handle = null; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
227 |
toDrag.Draggable(params); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
228 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
229 |
toDrag.keydown(jQuery.iSlider.dragmoveByKey); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
230 |
toDrag.attr('tabindex',jQuery.iSlider.tabindex++); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
231 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
232 |
this.isSlider = true; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
233 |
this.slideCfg = {}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
234 |
this.slideCfg.onslide = params.onslide; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
235 |
this.slideCfg.fractions = params.fractions; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
236 |
this.slideCfg.sliders = toDrag; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
237 |
this.slideCfg.restricted = o.restricted ? true : false; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
238 |
sliderEl = this; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
239 |
sliderEl.slideCfg.sliders.each( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
240 |
function(nr) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
241 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
242 |
this.SliderIteration = nr; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
243 |
this.SliderContainer = sliderEl; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
244 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
245 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
246 |
if (o.values && o.values.constructor == Array) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
247 |
for (i = o.values.length -1; i>=0;i--) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
248 |
if (o.values[i].constructor == Array && o.values[i].length == 2) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
249 |
el = this.slideCfg.sliders.get(i); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
250 |
if (el.tagName) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
251 |
jQuery.iSlider.dragmoveBy(el, o.values[i]); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
252 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
253 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
254 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
255 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
256 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
257 |
); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
258 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
259 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
260 |
jQuery.fn.extend( |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
261 |
{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
262 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
263 |
* Create a slider width options |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
264 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
265 |
* @name Slider |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
266 |
* @description Create a slider width options |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
267 |
* @param Hash hash A hash of parameters. All parameters are optional. |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
268 |
* @option Mixed accepts string to select slider indicators or DOMElement slider indicator |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
269 |
* @option Integer factions (optional) number of sgments to divide and snap slider |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
270 |
* @option Function onSlide (optional) A function to be executed whenever slider indicator it is moved |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
271 |
* @option Function onChanged (optional) A function to be executed whenever slider indicator was moved |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
272 |
* @option Array values (optional) Initial values for slider indicators |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
273 |
* @option Boolean restricted (optional) if true the slider indicator can not be moved beyond adjacent indicators |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
274 |
* @type jQuery |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
275 |
* @cat Plugins/Interface |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
276 |
* @author Stefan Petre |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
277 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
278 |
Slider : jQuery.iSlider.build, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
279 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
280 |
* Set value/position for slider indicators |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
281 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
282 |
* @name SliderSetValues |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
283 |
* @description Set value/position for slider indicators |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
284 |
* @param Array values array width values for each indicator |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
285 |
* @type jQuery |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
286 |
* @cat Plugins/Interface |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
287 |
* @author Stefan Petre |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
288 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
289 |
SliderSetValues : jQuery.iSlider.set, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
290 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
291 |
* Get value/position for slider indicators |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
292 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
293 |
* @name SliderSetValues |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
294 |
* @description Get value/position for slider indicators |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
295 |
* @type jQuery |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
296 |
* @cat Plugins/Interface |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
297 |
* @author Stefan Petre |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
298 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
299 |
SliderGetValues : jQuery.iSlider.get |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
300 |
} |
|
99
6cb4d10f0b8b
NEW WEBSITE WITH : HOME / ABOUT / CLIENT.PHP
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
diff
changeset
|
301 |
); |