Dynamic "To Top" Plugin - Version 3.1.5

Version Description

  • JS performance improved with wp_localize_script();
  • CSS performance improved.
  • Added uninstall.
  • Code improvements.
Download this release

Release Info

Developer sksmatt
Plugin Icon wp plugin Dynamic "To Top" Plugin
Version 3.1.5
Comparing to
See all releases

Code changes from version 3.1.4 to 3.1.5

css/dynamic-to-top-admin.css CHANGED
@@ -1,317 +1,20 @@
1
  /*
2
- * jQuery UI CSS Framework 1.8.13
 
3
  *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
 
7
  *
8
- * http://docs.jquery.com/UI/Theming/API
9
- */
10
-
11
- /* Layout helpers
12
- ----------------------------------*/
13
- .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
- .ui-helper-clearfix { display: inline-block; }
18
- /* required comment for clearfix to work in Opera \*/
19
- * html .ui-helper-clearfix { height:1%; }
20
- .ui-helper-clearfix { display:block; }
21
- /* end clearfix */
22
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
-
24
-
25
- /* Interaction Cues
26
- ----------------------------------*/
27
- .ui-state-disabled { cursor: default !important; }
28
-
29
-
30
- /* Icons
31
- ----------------------------------*/
32
-
33
- /* states and images */
34
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
-
36
-
37
- /* Misc visuals
38
- ----------------------------------*/
39
-
40
- /* Overlays */
41
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
-
43
- /* Component containers
44
- ----------------------------------*/
45
- .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
46
- .ui-widget .ui-widget { font-size: 1em; }
47
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
48
- .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
49
- .ui-widget-content a { color: #222222; }
50
- .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
51
- .ui-widget-header a { color: #222222; }
52
-
53
- /* Interaction states
54
- ----------------------------------*/
55
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
56
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
57
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
58
- .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
59
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
60
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
61
- .ui-widget :active { outline: none; }
62
-
63
- /* Interaction Cues
64
- ----------------------------------*/
65
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
66
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
67
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
68
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
69
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
70
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
71
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
72
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
73
-
74
- /* Icons
75
- ----------------------------------*/
76
-
77
- /* states and images */
78
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
79
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
80
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
81
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
82
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
83
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
84
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
85
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
86
-
87
- /* positioning */
88
- .ui-icon-carat-1-n { background-position: 0 0; }
89
- .ui-icon-carat-1-ne { background-position: -16px 0; }
90
- .ui-icon-carat-1-e { background-position: -32px 0; }
91
- .ui-icon-carat-1-se { background-position: -48px 0; }
92
- .ui-icon-carat-1-s { background-position: -64px 0; }
93
- .ui-icon-carat-1-sw { background-position: -80px 0; }
94
- .ui-icon-carat-1-w { background-position: -96px 0; }
95
- .ui-icon-carat-1-nw { background-position: -112px 0; }
96
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
97
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
98
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
99
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
100
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
101
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
102
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
103
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
104
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
105
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
106
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
107
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
108
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
109
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
110
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
111
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
112
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
113
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
114
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
115
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
116
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
117
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
118
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
119
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
120
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
121
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
122
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
123
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
124
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
125
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
126
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
127
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
128
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
129
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
130
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
131
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
132
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
133
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
134
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
135
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
136
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
137
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
138
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
139
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
140
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
141
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
142
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
143
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
144
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
145
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
146
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
147
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
148
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
149
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
150
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
151
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
152
- .ui-icon-arrow-4 { background-position: 0 -80px; }
153
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
154
- .ui-icon-extlink { background-position: -32px -80px; }
155
- .ui-icon-newwin { background-position: -48px -80px; }
156
- .ui-icon-refresh { background-position: -64px -80px; }
157
- .ui-icon-shuffle { background-position: -80px -80px; }
158
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
159
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
160
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
161
- .ui-icon-folder-open { background-position: -16px -96px; }
162
- .ui-icon-document { background-position: -32px -96px; }
163
- .ui-icon-document-b { background-position: -48px -96px; }
164
- .ui-icon-note { background-position: -64px -96px; }
165
- .ui-icon-mail-closed { background-position: -80px -96px; }
166
- .ui-icon-mail-open { background-position: -96px -96px; }
167
- .ui-icon-suitcase { background-position: -112px -96px; }
168
- .ui-icon-comment { background-position: -128px -96px; }
169
- .ui-icon-person { background-position: -144px -96px; }
170
- .ui-icon-print { background-position: -160px -96px; }
171
- .ui-icon-trash { background-position: -176px -96px; }
172
- .ui-icon-locked { background-position: -192px -96px; }
173
- .ui-icon-unlocked { background-position: -208px -96px; }
174
- .ui-icon-bookmark { background-position: -224px -96px; }
175
- .ui-icon-tag { background-position: -240px -96px; }
176
- .ui-icon-home { background-position: 0 -112px; }
177
- .ui-icon-flag { background-position: -16px -112px; }
178
- .ui-icon-calendar { background-position: -32px -112px; }
179
- .ui-icon-cart { background-position: -48px -112px; }
180
- .ui-icon-pencil { background-position: -64px -112px; }
181
- .ui-icon-clock { background-position: -80px -112px; }
182
- .ui-icon-disk { background-position: -96px -112px; }
183
- .ui-icon-calculator { background-position: -112px -112px; }
184
- .ui-icon-zoomin { background-position: -128px -112px; }
185
- .ui-icon-zoomout { background-position: -144px -112px; }
186
- .ui-icon-search { background-position: -160px -112px; }
187
- .ui-icon-wrench { background-position: -176px -112px; }
188
- .ui-icon-gear { background-position: -192px -112px; }
189
- .ui-icon-heart { background-position: -208px -112px; }
190
- .ui-icon-star { background-position: -224px -112px; }
191
- .ui-icon-link { background-position: -240px -112px; }
192
- .ui-icon-cancel { background-position: 0 -128px; }
193
- .ui-icon-plus { background-position: -16px -128px; }
194
- .ui-icon-plusthick { background-position: -32px -128px; }
195
- .ui-icon-minus { background-position: -48px -128px; }
196
- .ui-icon-minusthick { background-position: -64px -128px; }
197
- .ui-icon-close { background-position: -80px -128px; }
198
- .ui-icon-closethick { background-position: -96px -128px; }
199
- .ui-icon-key { background-position: -112px -128px; }
200
- .ui-icon-lightbulb { background-position: -128px -128px; }
201
- .ui-icon-scissors { background-position: -144px -128px; }
202
- .ui-icon-clipboard { background-position: -160px -128px; }
203
- .ui-icon-copy { background-position: -176px -128px; }
204
- .ui-icon-contact { background-position: -192px -128px; }
205
- .ui-icon-image { background-position: -208px -128px; }
206
- .ui-icon-video { background-position: -224px -128px; }
207
- .ui-icon-script { background-position: -240px -128px; }
208
- .ui-icon-alert { background-position: 0 -144px; }
209
- .ui-icon-info { background-position: -16px -144px; }
210
- .ui-icon-notice { background-position: -32px -144px; }
211
- .ui-icon-help { background-position: -48px -144px; }
212
- .ui-icon-check { background-position: -64px -144px; }
213
- .ui-icon-bullet { background-position: -80px -144px; }
214
- .ui-icon-radio-off { background-position: -96px -144px; }
215
- .ui-icon-radio-on { background-position: -112px -144px; }
216
- .ui-icon-pin-w { background-position: -128px -144px; }
217
- .ui-icon-pin-s { background-position: -144px -144px; }
218
- .ui-icon-play { background-position: 0 -160px; }
219
- .ui-icon-pause { background-position: -16px -160px; }
220
- .ui-icon-seek-next { background-position: -32px -160px; }
221
- .ui-icon-seek-prev { background-position: -48px -160px; }
222
- .ui-icon-seek-end { background-position: -64px -160px; }
223
- .ui-icon-seek-start { background-position: -80px -160px; }
224
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
225
- .ui-icon-seek-first { background-position: -80px -160px; }
226
- .ui-icon-stop { background-position: -96px -160px; }
227
- .ui-icon-eject { background-position: -112px -160px; }
228
- .ui-icon-volume-off { background-position: -128px -160px; }
229
- .ui-icon-volume-on { background-position: -144px -160px; }
230
- .ui-icon-power { background-position: 0 -176px; }
231
- .ui-icon-signal-diag { background-position: -16px -176px; }
232
- .ui-icon-signal { background-position: -32px -176px; }
233
- .ui-icon-battery-0 { background-position: -48px -176px; }
234
- .ui-icon-battery-1 { background-position: -64px -176px; }
235
- .ui-icon-battery-2 { background-position: -80px -176px; }
236
- .ui-icon-battery-3 { background-position: -96px -176px; }
237
- .ui-icon-circle-plus { background-position: 0 -192px; }
238
- .ui-icon-circle-minus { background-position: -16px -192px; }
239
- .ui-icon-circle-close { background-position: -32px -192px; }
240
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
241
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
242
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
243
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
244
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
245
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
246
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
247
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
248
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
249
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
250
- .ui-icon-circle-check { background-position: -208px -192px; }
251
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
252
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
253
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
254
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
255
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
256
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
257
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
258
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
259
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
260
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
261
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
262
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
263
-
264
-
265
- /* Misc visuals
266
- ----------------------------------*/
267
-
268
- /* Corner radius */
269
- .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
270
- .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
271
- .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
272
- .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
273
- .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
274
- .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
275
- .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
276
- .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
277
- .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
278
-
279
- /* Overlays */
280
- .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
281
- .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
282
-
283
- /* slider */
284
- .ui-slider { position: relative; text-align: left; }
285
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
286
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
287
-
288
- .ui-slider-horizontal { height: .8em; }
289
- .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
290
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
291
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
292
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
293
-
294
- .ui-slider-vertical { width: .8em; height: 100px; }
295
- .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
296
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
297
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
298
- .ui-slider-vertical .ui-slider-range-max { top: 0; }
299
-
300
- .picker {
301
- height:23px;
302
- padding-left:21px;
303
- line-height:23px;
304
- text-decoration:none;
305
- background:url(images/picker.png) no-repeat left 4px;
306
- overflow:hidden;
307
- clear:right;
308
- float: left;
309
- display: inline;
310
- cursor:pointer;
311
- }
312
-
313
- .picker.picker-opened {
314
- background-position:left -19px;
315
  }
316
 
317
  input.colorvalue {
@@ -341,7 +44,6 @@ div.desc {
341
  padding:20px 10px;
342
  height:3.95em;
343
  position:relative;
344
- background:url(images/pat4.gif) repeat 1px 1px;
345
  background-color:lightgrey;
346
  }
347
 
@@ -374,10 +76,9 @@ div.desc {
374
  #dynamic-to-top-button span#dtt-image {
375
  display:none;
376
  overflow:hidden;
377
- width:17px;
378
  height:12px;
379
  background:url(images/up.png) no-repeat center center;
380
-
381
  }
382
  .dynamic-to-top-shadow {
383
  -webkit-box-shadow:0 1px 3px rgba(0,0,0,0.4);
1
  /*
2
+ * Dynamic To Top Plugin Admin CSS
3
+ * http://www.mattvarone.com
4
  *
 
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * By Matt Varone
7
+ * @sksmatt
8
  *
9
+ */
10
+
11
+ .dtt-farbtastic {
12
+ z-index: 100;
13
+ background: #EEE;
14
+ border: 1px solid #CCC;
15
+ position: absolute;
16
+ display: block;
17
+ margin-top:0.5em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
 
20
  input.colorvalue {
44
  padding:20px 10px;
45
  height:3.95em;
46
  position:relative;
 
47
  background-color:lightgrey;
48
  }
49
 
76
  #dynamic-to-top-button span#dtt-image {
77
  display:none;
78
  overflow:hidden;
79
+ width:14px;
80
  height:12px;
81
  background:url(images/up.png) no-repeat center center;
 
82
  }
83
  .dynamic-to-top-shadow {
84
  -webkit-box-shadow:0 1px 3px rgba(0,0,0,0.4);
css/dynamic-to-top-css.php CHANGED
@@ -9,15 +9,15 @@
9
  // set the correct header
10
  header ("content-type: text/css; charset: UTF-8");
11
 
12
- // require wordpress
13
  require_once('../../../../wp-load.php');
14
 
15
- if (!defined('DYNAMIC_TO_TOP_VERSION'))
16
  die();
17
 
18
  global $OBJ_dynamic_to_top;
19
 
20
- if ( !isset($OBJ_dynamic_to_top) OR !is_object($OBJ_dynamic_to_top))
21
  {
22
  if (!class_exists('Dynamic_To_Top'))
23
  die();
9
  // set the correct header
10
  header ("content-type: text/css; charset: UTF-8");
11
 
12
+ // require WordPress
13
  require_once('../../../../wp-load.php');
14
 
15
+ if(!defined('DYNAMIC_TO_TOP_VERSION'))
16
  die();
17
 
18
  global $OBJ_dynamic_to_top;
19
 
20
+ if (!isset($OBJ_dynamic_to_top) OR !is_object($OBJ_dynamic_to_top))
21
  {
22
  if (!class_exists('Dynamic_To_Top'))
23
  die();
css/dynamic-to-top-jquery-ui.css ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.13
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
+ .ui-helper-clearfix { display: inline-block; }
18
+ /* required comment for clearfix to work in Opera \*/
19
+ * html .ui-helper-clearfix { height:1%; }
20
+ .ui-helper-clearfix { display:block; }
21
+ /* end clearfix */
22
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
+
24
+ /* Interaction Cues
25
+ ----------------------------------*/
26
+ .ui-state-disabled { cursor: default !important; }
27
+
28
+ /* states and images */
29
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
30
+
31
+ /* Component containers
32
+ ----------------------------------*/
33
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
34
+ .ui-widget .ui-widget { font-size: 1em; }
35
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
36
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
37
+ .ui-widget-content a { color: #222222; }
38
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
39
+ .ui-widget-header a { color: #222222; }
40
+
41
+ /* Interaction states
42
+ ----------------------------------*/
43
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
44
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
45
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
46
+ .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
47
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
48
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
49
+ .ui-widget :active { outline: none; }
50
+
51
+ /* Interaction Cues
52
+ ----------------------------------*/
53
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
54
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
55
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
56
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
57
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
58
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
59
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
60
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
61
+
62
+ /* Corner radius */
63
+ .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
64
+ .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
65
+ .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
66
+ .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
67
+ .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
68
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
69
+ .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
70
+ .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
71
+ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
72
+
73
+ /* slider */
74
+ .ui-slider { position: relative; text-align: left; }
75
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
76
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
77
+
78
+ .ui-slider-horizontal { height: .8em; }
79
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
80
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
81
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
82
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
83
+
84
+ .ui-slider-vertical { width: .8em; height: 100px; }
85
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
86
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
87
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
88
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }
dynamic-to-top.php CHANGED
@@ -1,11 +1,14 @@
1
  <?php
2
  /*
3
  Plugin Name: Dynamic To Top
4
- Version: 3.1.4
5
  Plugin URI: http://www.mattvarone.com/wordpress/dynamic-to-top-wordpress-plugin
6
  Description: Adds an automatic and dynamic "To Top" button to scroll long pages back to the top.
7
  Author: Matt Varone
8
  Author URI: http://www.mattvarone.com
 
 
 
9
  */
10
 
11
  /**
@@ -24,8 +27,8 @@ Author URI: http://www.mattvarone.com
24
  define('DYNAMIC_TO_TOP_BASENAME', plugin_basename(__FILE__));
25
  define('DYNAMIC_TO_TOP_URL', plugins_url('',__FILE__));
26
  define('DYNAMIC_TO_TOP_PATH', plugin_dir_path(__FILE__));
27
- define('DYNAMIC_TO_TOP_VERSION', '3.1.3');
28
- define('DYNAMIC_TO_TOP_FOLDER', '/'.basename(dirname(__FILE__)));
29
  define('DYNAMIC_TO_TOP_DOMAIN', 'dynamic-to-top');
30
 
31
  /*
@@ -34,7 +37,7 @@ define('DYNAMIC_TO_TOP_DOMAIN', 'dynamic-to-top');
34
  |--------------------------------------------------------------------------
35
  */
36
 
37
- load_plugin_textdomain( DYNAMIC_TO_TOP_DOMAIN, false, DYNAMIC_TO_TOP_FOLDER.'/lan' );
38
 
39
  /*
40
  |--------------------------------------------------------------------------
@@ -47,4 +50,32 @@ if (is_admin())
47
  else
48
  require_once(DYNAMIC_TO_TOP_PATH.'inc/dynamic-to-top-class.php');
49
 
50
- // free willy!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  Plugin Name: Dynamic To Top
4
+ Version: 3.1.5
5
  Plugin URI: http://www.mattvarone.com/wordpress/dynamic-to-top-wordpress-plugin
6
  Description: Adds an automatic and dynamic "To Top" button to scroll long pages back to the top.
7
  Author: Matt Varone
8
  Author URI: http://www.mattvarone.com
9
+
10
+ Dual licensed under the MIT or GPL Version 2 licenses.
11
+
12
  */
13
 
14
  /**
27
  define('DYNAMIC_TO_TOP_BASENAME', plugin_basename(__FILE__));
28
  define('DYNAMIC_TO_TOP_URL', plugins_url('',__FILE__));
29
  define('DYNAMIC_TO_TOP_PATH', plugin_dir_path(__FILE__));
30
+ define('DYNAMIC_TO_TOP_VERSION', '3.1.5');
31
+ define('DYNAMIC_TO_TOP_FOLDER', basename(dirname(__FILE__)));
32
  define('DYNAMIC_TO_TOP_DOMAIN', 'dynamic-to-top');
33
 
34
  /*
37
  |--------------------------------------------------------------------------
38
  */
39
 
40
+ load_plugin_textdomain( DYNAMIC_TO_TOP_DOMAIN, false, '/'.DYNAMIC_TO_TOP_FOLDER.'/lan' );
41
 
42
  /*
43
  |--------------------------------------------------------------------------
50
  else
51
  require_once(DYNAMIC_TO_TOP_PATH.'inc/dynamic-to-top-class.php');
52
 
53
+ /*
54
+ |--------------------------------------------------------------------------
55
+ | DYNAMIC TO TOP ON ACTIVATION
56
+ |--------------------------------------------------------------------------
57
+ */
58
+
59
+ if ( !function_exists('dynamic_to_top_activation') )
60
+ {
61
+
62
+ /**
63
+ * Dynamic To Top Activation
64
+ *
65
+ * @package Dynamic To Top
66
+ * @since 3.1.5
67
+ *
68
+ */
69
+
70
+ function dynamic_to_top_activation()
71
+ {
72
+ // check compatibility
73
+ if ( version_compare( get_bloginfo('version' ),'3.0') >= 0 )
74
+ deactivate_plugins( basename( __FILE__ ) );
75
+
76
+ // refresh cache
77
+ delete_transient('dynamic_to_top_transient_css');
78
+ }
79
+
80
+ register_activation_hook( __FILE__, 'dynamic_to_top_activation' );
81
+ }
inc/dynamic-to-top-class.php CHANGED
@@ -12,6 +12,28 @@ if ( !class_exists('Dynamic_To_Top'))
12
  class Dynamic_To_Top
13
  {
14
  public $options;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  /**
17
  * Dynamic To Top
@@ -26,9 +48,8 @@ if ( !class_exists('Dynamic_To_Top'))
26
 
27
  function Dynamic_To_Top()
28
  {
29
- // Check if options are stored otherwise populate with defaults.
30
- if( false === $this->get_options() )
31
- $this->set_default_options();
32
 
33
  // Enqueue CSS and JS.
34
  $this->enqueue_assets();
@@ -37,58 +58,16 @@ if ( !class_exists('Dynamic_To_Top'))
37
  /**
38
  * Get Options
39
  *
40
- * Grabs the options from the db and checks for a Dynamic To Top 3.0
41
- * specific setting to add an extra validation layer.
42
  *
43
  * @package Dynamic To Top
44
  * @subpackage Main Class
45
  * @since 3.0
46
- * @return boolean
47
  */
48
 
49
  function get_options()
50
  {
51
- $this->options = get_option('dynamic_to_top');
52
-
53
- if ( !empty($this->options) && isset($this->options['padding_top_bottom']) )
54
- return true;
55
- else
56
- return false;
57
- }
58
-
59
- /**
60
- * Set Default Options
61
- *
62
- * Stores default options on the db.
63
- *
64
- * @package Dynamic To Top
65
- * @subpackage Main Class
66
- * @since 3.0
67
- */
68
-
69
- function set_default_options()
70
- {
71
- $this->options = array(
72
- 'speed' => 1000,
73
- 'distance' => 200,
74
- 'easing' => 'In Out',
75
- 'position' => 'Bottom Right',
76
- 'padding_top_bottom' => '21',
77
- 'padding_left_right' => '19',
78
- 'font_size' => '1',
79
- 'text_color' => '#fff',
80
- 'bold'=>'yes',
81
- 'text_shadow'=>'yes',
82
- 'shadow_color'=>'#111',
83
- 'background_color'=>'#272727',
84
- 'border_color'=>'#000',
85
- 'border_width'=>'1',
86
- 'radius'=>'9',
87
- 'shadow'=>'',
88
- 'inset'=>'yes',
89
- );
90
-
91
- update_option('dynamic_to_top', $this->options);
92
  }
93
 
94
  /**
@@ -110,8 +89,6 @@ if ( !class_exists('Dynamic_To_Top'))
110
  return false;
111
  }
112
 
113
- $this->options['margin'] = 20;
114
-
115
  add_action('wp_print_styles', array(&$this,'enqueue_style'));
116
  add_action('wp_print_scripts', array(&$this,'enqueue_script'));
117
  }
@@ -126,7 +103,7 @@ if ( !class_exists('Dynamic_To_Top'))
126
 
127
  function enqueue_style()
128
  {
129
- wp_enqueue_style( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/css/dynamic-to-top-css.php', false, DYNAMIC_TO_TOP_VERSION, 'all' );
130
  }
131
 
132
  /**
@@ -139,165 +116,45 @@ if ( !class_exists('Dynamic_To_Top'))
139
 
140
  function enqueue_script()
141
  {
142
- wp_enqueue_script( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/js/dynamic-to-top-js.php', array('jquery'), DYNAMIC_TO_TOP_VERSION, true );
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
 
145
  /**
146
  * Get CSS
147
  *
148
  * Returns CSS declarations.
149
- * Checks for transient CSS or generates and set new.
150
  *
151
  * @package Dynamic To Top
152
  * @subpackage Main Class
153
  * @since 3.0
154
- * @return string $css css Declarations.
155
  */
156
 
157
  function get_css($css="")
158
  {
159
  $css = get_transient('dynamic_to_top_transient_css');
160
-
161
  if ($css)
162
  return $css;
163
-
164
- $css = $this->generate_custom_css();
165
-
166
- set_transient('dynamic_to_top_transient_css',$css,60*60*24*90);
167
-
168
- return $css;
169
- }
170
-
171
- /**
172
- * Get JS
173
- *
174
- * Returns JS declarations.
175
- * Checks for transient JS or generates and set new.
176
- *
177
- * @package Dynamic To Top
178
- * @subpackage Main Class
179
- * @since 3.0
180
- * @return string $js JS scripts.
181
- */
182
 
183
- function get_js($js="")
184
- {
185
- $js = get_transient('dynamic_to_top_transient_js');
186
-
187
- if ($js)
188
- return $js;
189
-
190
- $js = $this->generate_custom_js();
191
 
192
- set_transient('dynamic_to_top_transient_js',$js,60*60*24*90);
193
-
194
- return $js;
195
- }
196
-
197
- /**
198
- * Is Checked
199
- *
200
- * Conditional method to validate checked options.
201
- *
202
- * @package Dynamic To Top
203
- * @subpackage Main Class
204
- * @since 3.0
205
- * @param string $option Option name.
206
- * @param string $against String to match option.
207
- * @return boolean
208
- */
209
-
210
- function is_checked($option="",$against="yes")
211
- {
212
- if ($option == "")
213
- return false;
214
-
215
- if (!isset($this->options[$option]))
216
- return false;
217
-
218
- if ($against == "")
219
- return true;
220
- else {
221
- if ($this->options[$option] == $against)
222
- return true;
223
- else
224
- return false;
225
- }
226
- }
227
-
228
- /**
229
- * Get Easing Type
230
- *
231
- * Returns the easing type function name.
232
- * Used on the JS script.
233
- *
234
- * @package Dynamic To Top
235
- * @subpackage Main Class
236
- * @since 3.0
237
- * @return string $easing Name of easing function.
238
- */
239
-
240
- function get_easing_type($easing="linear")
241
- {
242
- switch ($this->options['easing'])
243
- {
244
- case 'Bounce':
245
- $easing = "easeOutBounce";
246
- break;
247
-
248
- case 'Elastic':
249
- $easing = "easeInElastic";
250
- break;
251
-
252
- case 'In Out':
253
- $easing = "easeInOutExpo";
254
- break;
255
-
256
- case 'In':
257
- $easing = "easeInExpo";
258
- break;
259
-
260
- case 'Out':
261
- $easing = "easeOutExpo";
262
- break;
263
- }
264
- return $easing;
265
- }
266
-
267
- /**
268
- * Get Position
269
- *
270
- * Returns CSS properties for the selected position.
271
- * Used on the CSS style.
272
- *
273
- * @package Dynamic To Top
274
- * @subpackage Main Class
275
- * @since 3.0
276
- * @return string $position Properties of the position selected.
277
- */
278
 
279
- function get_position($position="")
280
- {
281
- switch ($this->options['position'])
282
- {
283
- case 'Bottom Right':
284
- $position = "bottom:".$this->options['margin']."px;right:".$this->options['margin']."px;top:auto;left:auto;";
285
- break;
286
-
287
- case 'Bottom Left':
288
- $position = "bottom:".$this->options['margin']."px;left:".$this->options['margin']."px;top:auto;right:auto;";
289
- break;
290
-
291
- case 'Top Right':
292
- $position = "top:".$this->options['margin']."px;right:".$this->options['margin']."px;bottom:auto;left:auto;";
293
- break;
294
-
295
- case 'Top Left':
296
- $position = "top:".$this->options['margin']."px;left:".$this->options['margin']."px;bottom:auto;right:auto;";
297
- break;
298
- }
299
-
300
- return $position;
301
  }
302
 
303
  /**
@@ -316,7 +173,7 @@ if ( !class_exists('Dynamic_To_Top'))
316
 
317
  $css .= "/* Dynamic To Top Plugin ver. ".DYNAMIC_TO_TOP_VERSION." - http://www.mattvarone.com */\n\n";
318
 
319
- $css .= "body { position:relative}
320
 
321
  #dynamic-to-top {
322
  display:none;
@@ -405,7 +262,8 @@ if ( !class_exists('Dynamic_To_Top'))
405
  background: ".$this->options['background_color']." linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
406
  }
407
 
408
- #dynamic-to-top,#dynamic-to-top:active,#dynamic-to-top:focus,#dynamic-to-top:hover
 
409
  {
410
  outline:none
411
  }
@@ -413,138 +271,120 @@ if ( !class_exists('Dynamic_To_Top'))
413
  #dynamic-to-top span {
414
  display:block;
415
  overflow:hidden;
416
- width:17px;
417
  height:12px;
418
  background:url(".DYNAMIC_TO_TOP_URL."/css/images/up.png) no-repeat center center;
419
  }";
420
 
421
  return $css;
422
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
 
424
  /**
425
- * Generate Custom JS script
426
  *
427
- * Returns Dynamic To Top custom JS script.
 
428
  *
429
  * @package Dynamic To Top
430
  * @subpackage Main Class
431
  * @since 3.0
432
- * @return string $js
433
  */
434
 
435
- function generate_custom_js($js="")
436
- {
437
-
438
- $js .= "/// Dynamic To Top Plugin ver. ".DYNAMIC_TO_TOP_VERSION." - http://www.mattvarone.com\n\n";
439
-
440
- $js .= "(function(jQuery){
441
- jQuery.fn.DynamicToTop = function(options) {
442
-
443
- var defaults = {";
444
-
445
- if ( $this->is_checked('text_version','yes') )
446
- $js .= "text: '".$this->options['text']."',";
447
- else
448
- $js .= "text: '<span>&nbsp;</span>',";
449
-
450
- $js .="
451
- min: ".$this->options['distance'].",
452
- inDelay:600,
453
- outDelay:400,
454
- containerID: 'dynamic-to-top',
455
- scrollSpeed: ".$this->options['speed'].",
456
- easingType: '".$this->get_easing_type()."'
457
- };
458
-
459
- var settings = jQuery.extend(defaults, options);
460
- var containerIDhash = '#'+settings.containerID;
461
-
462
- jQuery('body').append('<a href=\"#\" id=\"'+settings.containerID+'\">'+settings.text+'</a>');
463
-
464
- jQuery(containerIDhash).hide().click(function(){
465
- jQuery('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
466
- return false;
467
- });
468
-
469
- jQuery(window).scroll(function() {
470
- var sd = jQuery(window).scrollTop();
471
- if(typeof document.body.style.maxHeight === \"undefined\") {
472
- jQuery(containerIDhash).css({
473
- 'position': 'absolute',
474
- 'top': jQuery(window).scrollTop() + jQuery(window).height() - ".$this->options['margin']."
475
- });
476
- }
477
- if ( sd > settings.min )
478
- jQuery(containerIDhash).fadeIn(settings.inDelay);
479
- else
480
- jQuery(containerIDhash).fadeOut(settings.Outdelay);
481
- });
482
-
483
- };
484
- })(jQuery);\n\n";
485
-
486
- $js .= "// jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
487
-
488
- if(typeof jQuery.easing.easeInBounce != 'function') {
489
-
490
- jQuery.extend( jQuery.easing,
491
  {
492
- def: 'easeOutExpo',
493
- swing: function (x, t, b, c, d) {
494
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
495
- },
496
- easeInExpo: function (x, t, b, c, d) {
497
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
498
- },
499
- easeOutExpo: function (x, t, b, c, d) {
500
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
501
- },
502
- easeInOutExpo: function (x, t, b, c, d) {
503
- if (t==0) return b;
504
- if (t==d) return b+c;
505
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
506
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
507
- },
508
- easeInBounce: function (x, t, b, c, d) {
509
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
510
- },
511
- easeOutBounce: function (x, t, b, c, d) {
512
- if ((t/=d) < (1/2.75)) {
513
- return c*(7.5625*t*t) + b;
514
- } else if (t < (2/2.75)) {
515
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
516
- } else if (t < (2.5/2.75)) {
517
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
518
- } else {
519
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
520
- }
521
- },
522
- easeInOutBounce: function (x, t, b, c, d) {
523
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
524
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
525
- },
526
- easeInElastic: function (x, t, b, c, d) {
527
- var s=1.70158;var p=0;var a=c;
528
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
529
- if (a < Math.abs(c)) { a=c; var s=p/4; }
530
- else var s = p/(2*Math.PI) * Math.asin (c/a);
531
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
532
- },
533
- easeInOutElastic: function (x, t, b, c, d) {
534
- var s=1.70158;var p=0;var a=c;
535
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
536
- if (a < Math.abs(c)) { a=c; var s=p/4; }
537
- else var s = p/(2*Math.PI) * Math.asin (c/a);
538
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
539
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
540
- }
541
- });}\n\n";
542
-
543
- $js .= "\n\njQuery().ready(function() { jQuery('body').DynamicToTop();});\n";
544
 
545
- return $js;
546
  }
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  /**
549
  * Is Mobile
550
  *
@@ -553,7 +393,7 @@ if ( !class_exists('Dynamic_To_Top'))
553
  * @package Dynamic To Top
554
  * @subpackage Main Class
555
  * @since 3.0
556
- * @author Rever Studios
557
  * @link http://www.reverbstudios.ie/
558
  * @return boolean.
559
  */
@@ -606,12 +446,18 @@ if ( !class_exists('Dynamic_To_Top'))
606
  {
607
 
608
  $new_hex = '#';
609
-
610
- $base['R'] = hexdec($hex{0}.$hex{1});
611
- $base['G'] = hexdec($hex{2}.$hex{3});
612
- $base['B'] = hexdec($hex{4}.$hex{5});
613
-
614
- foreach ($base as $k => $v)
 
 
 
 
 
 
615
  {
616
  $amount = 255 - $v;
617
  $amount = $amount / 100;
@@ -628,6 +474,28 @@ if ( !class_exists('Dynamic_To_Top'))
628
 
629
  return $new_hex;
630
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
 
632
 
633
  }
12
  class Dynamic_To_Top
13
  {
14
  public $options;
15
+ private $defaults = array(
16
+ 'speed'=>1000,
17
+ 'distance'=>200,
18
+ 'easing'=>'In Out',
19
+ 'position'=>'Bottom Right',
20
+ 'padding_top_bottom'=>'21',
21
+ 'padding_left_right'=>'20',
22
+ 'font_size'=>'1',
23
+ 'text_color'=>'#fff',
24
+ 'bold'=>'',
25
+ 'text_shadow'=>'',
26
+ 'shadow_color'=>'#111',
27
+ 'background_color'=>'#272727',
28
+ 'border_color'=>'#000',
29
+ 'border_width'=>'1',
30
+ 'radius'=>'9',
31
+ 'shadow'=>'',
32
+ 'inset'=>'',
33
+ 'text'=>'',
34
+ 'margin'=>20,
35
+ 'text_version'=>'',
36
+ );
37
 
38
  /**
39
  * Dynamic To Top
48
 
49
  function Dynamic_To_Top()
50
  {
51
+ // Get options.
52
+ $this->get_options();
 
53
 
54
  // Enqueue CSS and JS.
55
  $this->enqueue_assets();
58
  /**
59
  * Get Options
60
  *
61
+ * Sets and parses the db options with the default values.
 
62
  *
63
  * @package Dynamic To Top
64
  * @subpackage Main Class
65
  * @since 3.0
 
66
  */
67
 
68
  function get_options()
69
  {
70
+ $this->options = wp_parse_args(get_option('dynamic_to_top'), $this->defaults);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
 
73
  /**
89
  return false;
90
  }
91
 
 
 
92
  add_action('wp_print_styles', array(&$this,'enqueue_style'));
93
  add_action('wp_print_scripts', array(&$this,'enqueue_script'));
94
  }
103
 
104
  function enqueue_style()
105
  {
106
+ wp_enqueue_style('dynamic-to-top', DYNAMIC_TO_TOP_URL . '/css/dynamic-to-top-css.php', false, DYNAMIC_TO_TOP_VERSION,'all');
107
  }
108
 
109
  /**
116
 
117
  function enqueue_script()
118
  {
119
+ wp_register_script('jquery-easing',DYNAMIC_TO_TOP_URL . '/js/libs/jquery.easing.js', array('jquery'),'1.3', true);
120
+ wp_enqueue_script('dynamic-to-top', DYNAMIC_TO_TOP_URL . '/js/dynamic.to.top.js', array('jquery-easing'), DYNAMIC_TO_TOP_VERSION, true);
121
+
122
+ $params = array(
123
+ 'text' => $this->options['text'],
124
+ 'version' => $this->options['text_version'],
125
+ 'min' => $this->options['distance'],
126
+ 'speed' => $this->options['speed'],
127
+ 'easing' => $this->get_easing_type(),
128
+ 'margin' => $this->options['margin'],
129
+ );
130
+
131
+ wp_localize_script( 'dynamic-to-top', 'mv_dynamic_to_top', $params );
132
  }
133
 
134
  /**
135
  * Get CSS
136
  *
137
  * Returns CSS declarations.
138
+ * Checks for transient CSS or generates and sets a new one.
139
  *
140
  * @package Dynamic To Top
141
  * @subpackage Main Class
142
  * @since 3.0
143
+ * @return string $css CSS Declarations.
144
  */
145
 
146
  function get_css($css="")
147
  {
148
  $css = get_transient('dynamic_to_top_transient_css');
149
+
150
  if ($css)
151
  return $css;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
+ $css = $this->minify($this->generate_custom_css());
 
 
 
 
 
 
 
154
 
155
+ set_transient('dynamic_to_top_transient_css',$css,60*60*24*90);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
+ return $css;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
 
160
  /**
173
 
174
  $css .= "/* Dynamic To Top Plugin ver. ".DYNAMIC_TO_TOP_VERSION." - http://www.mattvarone.com */\n\n";
175
 
176
+ $css .= "body {position:relative}
177
 
178
  #dynamic-to-top {
179
  display:none;
262
  background: ".$this->options['background_color']." linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
263
  }
264
 
265
+ #dynamic-to-top,#dynamic-to-top:active,
266
+ #dynamic-to-top:focus,#dynamic-to-top:hover
267
  {
268
  outline:none
269
  }
271
  #dynamic-to-top span {
272
  display:block;
273
  overflow:hidden;
274
+ width:14px;
275
  height:12px;
276
  background:url(".DYNAMIC_TO_TOP_URL."/css/images/up.png) no-repeat center center;
277
  }";
278
 
279
  return $css;
280
  }
281
+
282
+ /**
283
+ * Get Easing Type
284
+ *
285
+ * Returns the easing type function name.
286
+ * Used on the JS script.
287
+ *
288
+ * @package Dynamic To Top
289
+ * @subpackage Main Class
290
+ * @since 3.0
291
+ * @return string $easing Name of easing function.
292
+ */
293
+
294
+ function get_easing_type($easing="linear")
295
+ {
296
+ switch ($this->options['easing'])
297
+ {
298
+ case 'Bounce':
299
+ $easing = "easeOutBounce";
300
+ break;
301
+
302
+ case 'Elastic':
303
+ $easing = "easeInElastic";
304
+ break;
305
+
306
+ case 'In Out':
307
+ $easing = "easeInOutExpo";
308
+ break;
309
+
310
+ case 'In':
311
+ $easing = "easeInExpo";
312
+ break;
313
+
314
+ case 'Out':
315
+ $easing = "easeOutExpo";
316
+ break;
317
+ }
318
+ return $easing;
319
+ }
320
 
321
  /**
322
+ * Get Position
323
  *
324
+ * Returns CSS properties for the selected position.
325
+ * Used on the CSS style.
326
  *
327
  * @package Dynamic To Top
328
  * @subpackage Main Class
329
  * @since 3.0
330
+ * @return string $position Properties of the position selected.
331
  */
332
 
333
+ function get_position($position="")
334
+ {
335
+ switch ($this->options['position'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  {
337
+ case 'Bottom Right':
338
+ $position = "bottom:".$this->options['margin']."px;right:".$this->options['margin']."px;top:auto;left:auto;";
339
+ break;
340
+
341
+ case 'Bottom Left':
342
+ $position = "bottom:".$this->options['margin']."px;left:".$this->options['margin']."px;top:auto;right:auto;";
343
+ break;
344
+
345
+ case 'Top Right':
346
+ $position = "top:".$this->options['margin']."px;right:".$this->options['margin']."px;bottom:auto;left:auto;";
347
+ break;
348
+
349
+ case 'Top Left':
350
+ $position = "top:".$this->options['margin']."px;left:".$this->options['margin']."px;bottom:auto;right:auto;";
351
+ break;
352
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
 
354
+ return $position;
355
  }
356
 
357
+ /**
358
+ * Is Checked
359
+ *
360
+ * Conditional method to validate checked options.
361
+ *
362
+ * @package Dynamic To Top
363
+ * @subpackage Main Class
364
+ * @since 3.0
365
+ * @param string $option Option name.
366
+ * @param string $against String to match option.
367
+ * @return boolean
368
+ */
369
+
370
+ function is_checked($option="",$against="yes")
371
+ {
372
+ if ($option == "")
373
+ return false;
374
+
375
+ if (!isset($this->options[$option]))
376
+ return false;
377
+
378
+ if ($against == "")
379
+ return true;
380
+ else {
381
+ if ($this->options[$option] == $against)
382
+ return true;
383
+ else
384
+ return false;
385
+ }
386
+ }
387
+
388
  /**
389
  * Is Mobile
390
  *
393
  * @package Dynamic To Top
394
  * @subpackage Main Class
395
  * @since 3.0
396
+ * @author Reverb Studios
397
  * @link http://www.reverbstudios.ie/
398
  * @return boolean.
399
  */
446
  {
447
 
448
  $new_hex = '#';
449
+
450
+ if (strlen($hex)==7)
451
+ {
452
+ $base['R'] = hexdec($hex{0}.$hex{1});
453
+ $base['G'] = hexdec($hex{2}.$hex{3});
454
+ $base['B'] = hexdec($hex{4}.$hex{5});
455
+ } else {
456
+ $base['R'] = hexdec($hex{0}.$hex{0});
457
+ $base['G'] = hexdec($hex{1}.$hex{1});
458
+ $base['B'] = hexdec($hex{2}.$hex{2});
459
+ }
460
+ foreach ($base as $k=>$v)
461
  {
462
  $amount = 255 - $v;
463
  $amount = $amount / 100;
474
 
475
  return $new_hex;
476
  }
477
+
478
+ /**
479
+ *
480
+ * Simple Minify CSS
481
+ *
482
+ * Minifies CSS.
483
+ *
484
+ * @package Dynamic To Top
485
+ * @subpackage Main Class
486
+ * @since 3.0
487
+ * @author Karthik Viswanathan
488
+ * @link http://www.lateralcode.com/css-minifier/
489
+ * @return string.
490
+ */
491
+
492
+ function minify( $css )
493
+ {
494
+ $css = preg_replace('#\s+#', ' ', $css);
495
+ $css = preg_replace('#/\*.*?\*/#s', '', $css);
496
+ $css = str_replace(array('; ',': ',' {','{ ',', ','} ',';}'), array(';',':','{','{',',','}','}'),$css);
497
+ return trim($css);
498
+ }
499
 
500
 
501
  }
inc/dynamic-to-top-options.php CHANGED
@@ -47,10 +47,9 @@ if ( !function_exists('dynamic_to_top_register_and_build_fields') )
47
  {
48
  register_setting('dynamic_to_top', 'dynamic_to_top','dynamic_to_top_save_settings');
49
 
50
- add_settings_section('settings_section', __('Behaviour', DYNAMIC_TO_TOP_DOMAIN),'__return_true',__FILE__);
51
  add_settings_section('appearance_section', __('Appearance', DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_appearance_section',__FILE__);
52
 
53
-
54
  add_settings_field('speed',__('Scroll time',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_scroll_time',__FILE__,'settings_section');
55
  add_settings_field('distance',__('Fade-in distance',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_distance',__FILE__,'settings_section');
56
  add_settings_field('easing',__('Easing',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_easing',__FILE__,'settings_section');
@@ -67,7 +66,6 @@ if ( !function_exists('dynamic_to_top_register_and_build_fields') )
67
  add_settings_field('text_shadow',__('Text shadow',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow',__FILE__,'appearance_section');
68
  add_settings_field('shadow_color',__('Text shadow color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow_color',__FILE__,'appearance_section');
69
  add_settings_field('background_color',__('Background color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_background_color',__FILE__,'appearance_section');
70
-
71
  add_settings_field('border_color',__('Border color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_color',__FILE__,'appearance_section');
72
  add_settings_field('border_width',__('Border width',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_width',__FILE__,'appearance_section');
73
  add_settings_field('radius',__('Border radius',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_radius',__FILE__,'appearance_section');
@@ -102,9 +100,9 @@ if ( !function_exists('dynamic_to_top_options_page') )
102
  ?>
103
  <div class="wrap">
104
  <?php screen_icon(); ?>
105
- <h2><?php echo __('Dynamic To Top Options', DYNAMIC_TO_TOP_DOMAIN); ?></h2>
106
 
107
- <p><?php echo __('Welcome to the <strong>Dynamic To Top</strong> plugin settings. Click <a href="http://www.mattvarone.com/wordpress/dynamic-to-top-wordpress-plugin/" target="_blank">here</a> to learn more about this plugin.',DYNAMIC_TO_TOP_DOMAIN); ?></p>
108
 
109
 
110
  <form method="post" action="options.php" enctype="multipart/form-data">
@@ -112,10 +110,10 @@ if ( !function_exists('dynamic_to_top_options_page') )
112
  <?php do_settings_sections(__FILE__); ?>
113
 
114
  <p class="submit">
115
- <input name="Submit" type="submit" class="button-primary" value="<?php echo __('Save Changes', DYNAMIC_TO_TOP_DOMAIN); ?>" />
116
  </p>
117
 
118
- <p><small><?php echo __('<strong>Dynamic To Top plugin</strong> brought to you by',DYNAMIC_TO_TOP_DOMAIN); ?> <a href="http://www.mattvarone.com" title="Matt Varone" target="_blank"><strong>Matt Varone</strong></a>.</small></p>
119
 
120
  </form>
121
  </div>
@@ -164,8 +162,9 @@ if ( !function_exists('dynamic_to_top_styles') )
164
  function dynamic_to_top_styles()
165
  {
166
  if (dynamic_to_top_is_page_options()) {
167
- wp_enqueue_style( 'farbtastic' );
168
- wp_enqueue_style('dynamic-to-top-admin',DYNAMIC_TO_TOP_URL.'/css/dynamic-to-top-admin.css',array(),'1.8.13');
 
169
  }
170
  }
171
 
@@ -187,7 +186,12 @@ if ( !function_exists('dynamic_to_top_scripts') )
187
  function dynamic_to_top_scripts()
188
  {
189
  if (dynamic_to_top_is_page_options())
190
- wp_enqueue_script('dynamic-to-top-settings',DYNAMIC_TO_TOP_URL.'/js/dynamic.to.top.settings.js',array('jquery','jquery-ui-core','farbtastic'),'1.0',true);
 
 
 
 
 
191
  }
192
 
193
  add_action( 'admin_print_scripts', 'dynamic_to_top_scripts' );
@@ -214,7 +218,7 @@ if ( !function_exists('dynamic_to_top_is_page_options') )
214
  {
215
  $screen = get_current_screen();
216
 
217
- if ( isset($screen->base) && $screen->base == 'settings_page_dynamic-to-top/inc/dynamic-to-top-options')
218
  return true;
219
  else
220
  return false;
@@ -223,7 +227,7 @@ if ( !function_exists('dynamic_to_top_is_page_options') )
223
  {
224
  $pages = array('options-general.php');
225
 
226
- if (in_array($pagenow, $pages) && isset($_GET['page']) && $_GET['page'] == 'dynamic-to-top/inc/dynamic-to-top-options.php')
227
  return true;
228
  }
229
 
@@ -251,7 +255,7 @@ if ( !function_exists('dynamic_to_top_field_border_color') )
251
 
252
  function dynamic_to_top_field_border_color()
253
  {
254
- echo dynamic_to_top_do_textfield_color('border_color','#ddd',__('Color for the button border.',DYNAMIC_TO_TOP_DOMAIN));
255
  }
256
  }
257
 
@@ -739,9 +743,10 @@ if ( !function_exists('dynamic_to_top_do_textfield_color') )
739
 
740
  $sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
741
 
742
- $out ='<div id="farbtastic-picker-'.$sanitized_meta_title.'" class="dtt-farbtastic">';
743
- $out .= '</div><input type="text" name="dynamic_to_top['.$meta.']" id="farbtastic-'.$sanitized_meta_title.'" '.$class.' value="'.$value.'" />';
744
- $out .= '<a class="picker" href="#" data-closed="'.__('Close',DYNAMIC_TO_TOP_DOMAIN).'" data-open="'.__('Open',DYNAMIC_TO_TOP_DOMAIN).'">'.__('Open',DYNAMIC_TO_TOP_DOMAIN).'</a>'.$desc;
 
745
 
746
  return $out;
747
  }
47
  {
48
  register_setting('dynamic_to_top', 'dynamic_to_top','dynamic_to_top_save_settings');
49
 
50
+ add_settings_section('settings_section', __('Behavior', DYNAMIC_TO_TOP_DOMAIN),'__return_true',__FILE__);
51
  add_settings_section('appearance_section', __('Appearance', DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_appearance_section',__FILE__);
52
 
 
53
  add_settings_field('speed',__('Scroll time',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_scroll_time',__FILE__,'settings_section');
54
  add_settings_field('distance',__('Fade-in distance',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_distance',__FILE__,'settings_section');
55
  add_settings_field('easing',__('Easing',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_easing',__FILE__,'settings_section');
66
  add_settings_field('text_shadow',__('Text shadow',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow',__FILE__,'appearance_section');
67
  add_settings_field('shadow_color',__('Text shadow color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_shadow_color',__FILE__,'appearance_section');
68
  add_settings_field('background_color',__('Background color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_background_color',__FILE__,'appearance_section');
 
69
  add_settings_field('border_color',__('Border color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_color',__FILE__,'appearance_section');
70
  add_settings_field('border_width',__('Border width',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_width',__FILE__,'appearance_section');
71
  add_settings_field('radius',__('Border radius',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_border_radius',__FILE__,'appearance_section');
100
  ?>
101
  <div class="wrap">
102
  <?php screen_icon(); ?>
103
+ <h2><?php _e('Dynamic To Top Options', DYNAMIC_TO_TOP_DOMAIN); ?></h2>
104
 
105
+ <p><?php _e('Welcome to the <strong>Dynamic To Top</strong> plugin settings. Click <a href="http://www.mattvarone.com/wordpress/dynamic-to-top-wordpress-plugin/" target="_blank">here</a> to learn more about this plugin.',DYNAMIC_TO_TOP_DOMAIN); ?></p>
106
 
107
 
108
  <form method="post" action="options.php" enctype="multipart/form-data">
110
  <?php do_settings_sections(__FILE__); ?>
111
 
112
  <p class="submit">
113
+ <input name="Submit" type="submit" class="button-primary" value="<?php _e('Save Changes', DYNAMIC_TO_TOP_DOMAIN); ?>" />
114
  </p>
115
 
116
+ <p><small><?php _e('<strong>Dynamic To Top</strong> plugin brought to you by',DYNAMIC_TO_TOP_DOMAIN); ?> <a href="http://www.mattvarone.com" title="Matt Varone" target="_blank"><strong>Matt Varone</strong></a>.</small></p>
117
 
118
  </form>
119
  </div>
162
  function dynamic_to_top_styles()
163
  {
164
  if (dynamic_to_top_is_page_options()) {
165
+ wp_enqueue_style('farbtastic');
166
+ wp_enqueue_style('dynamic-to-top-jquery-ui', DYNAMIC_TO_TOP_URL.'/css/dynamic-to-top-jquery-ui.css',array(),'1.8.13');
167
+ wp_enqueue_style('dynamic-to-top-admin', DYNAMIC_TO_TOP_URL.'/css/dynamic-to-top-admin.css',array('dynamic-to-top-jquery-ui'),DYNAMIC_TO_TOP_VERSION);
168
  }
169
  }
170
 
186
  function dynamic_to_top_scripts()
187
  {
188
  if (dynamic_to_top_is_page_options())
189
+ {
190
+ wp_enqueue_script('jquery-ui-widget', DYNAMIC_TO_TOP_URL.'/js/libs/jquery.ui.widget.js', array('jquery-ui-core'),'1.8.14');
191
+ wp_enqueue_script('jquery-ui-mouse', DYNAMIC_TO_TOP_URL.'/js/libs/jquery.ui.mouse.js', array('jquery-ui-widget'),'1.8.14');
192
+ wp_enqueue_script('jquery-ui-slider', DYNAMIC_TO_TOP_URL.'/js/libs/jquery.ui.slider.js', array('jquery-ui-mouse'),'1.8.14');
193
+ wp_enqueue_script('dynamic-to-top-settings',DYNAMIC_TO_TOP_URL.'/js/dynamic.to.top.settings.js',array('jquery-ui-slider','farbtastic'),'1.0',true);
194
+ }
195
  }
196
 
197
  add_action( 'admin_print_scripts', 'dynamic_to_top_scripts' );
218
  {
219
  $screen = get_current_screen();
220
 
221
+ if ( isset($screen->base) && $screen->base == 'settings_page_'.DYNAMIC_TO_TOP_FOLDER.'/inc/dynamic-to-top-options')
222
  return true;
223
  else
224
  return false;
227
  {
228
  $pages = array('options-general.php');
229
 
230
+ if (in_array($pagenow, $pages) && isset($_GET['page']) && $_GET['page'] == DYNAMIC_TO_TOP_FOLDER.'/inc/dynamic-to-top-options.php')
231
  return true;
232
  }
233
 
255
 
256
  function dynamic_to_top_field_border_color()
257
  {
258
+ echo dynamic_to_top_do_textfield_color('border_color','#000',__('Color for the button border.',DYNAMIC_TO_TOP_DOMAIN));
259
  }
260
  }
261
 
743
 
744
  $sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
745
 
746
+ $out = '<input type="text" name="dynamic_to_top['.$meta.']" id="farbtastic-'.$sanitized_meta_title.'" '.$class.' value="'.$value.'" />';
747
+ $out .= '<a class="picker hide-if-no-js" href="#" data-closed="'.__('close',DYNAMIC_TO_TOP_DOMAIN).'" data-open="'.__('select a color',DYNAMIC_TO_TOP_DOMAIN).'">'.__('select a color',DYNAMIC_TO_TOP_DOMAIN).'</a>';
748
+ $out .= '<div id="farbtastic-picker-'.$sanitized_meta_title.'" class="dtt-farbtastic"></div>';
749
+ $out .= $desc;
750
 
751
  return $out;
752
  }
js/dynamic-to-top-js.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * Dynamic To Top Edit JS
4
- *
5
- * @package Dynamic To Top
6
- * @author Matt Varone
7
- */
8
-
9
- // set the correct header
10
- header("Content-type: application/x-javascript; charset: UTF-8");
11
-
12
- // require wordpress
13
- require_once('../../../../wp-load.php');
14
-
15
- if (!defined('DYNAMIC_TO_TOP_VERSION'))
16
- die();
17
-
18
- global $OBJ_dynamic_to_top;
19
-
20
- if ( !isset($OBJ_dynamic_to_top) OR !is_object($OBJ_dynamic_to_top))
21
- {
22
- if (!class_exists('Dynamic_To_Top'))
23
- die();
24
-
25
- $OBJ_dynamic_to_top = new Dynamic_To_Top();
26
- }
27
-
28
- echo $OBJ_dynamic_to_top->get_js();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/dynamic.to.top.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;/*
2
+ * Dynamic To Top Plugin
3
+ * http://www.mattvarone.com
4
+ *
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * By Matt Varone
7
+ * @sksmatt
8
+ *
9
+ */
10
+ var mv_dynamic_to_top;
11
+ (function($){
12
+ jQuery.fn.DynamicToTop = function(options) {
13
+ var defaults = {
14
+ text: mv_dynamic_to_top.text,
15
+ min: mv_dynamic_to_top.min,
16
+ fade_in:600,
17
+ fade_out:400,
18
+ speed: mv_dynamic_to_top.speed,
19
+ easing: mv_dynamic_to_top.easing,
20
+ version: mv_dynamic_to_top.version,
21
+ id:'dynamic-to-top'
22
+ };
23
+ var settings = $.extend(defaults, options);
24
+ if (settings.version == ""){settings.text = '<span>&nbsp;</span>';}
25
+ var $toTop = $('<a href=\"#\" id=\"'+settings.id+'\"></a>').html(settings.text);
26
+ $('body').append($toTop);
27
+ $toTop.hide().click(function(){
28
+ $('html, body').stop().animate({scrollTop:0},settings.speed,settings.easing);
29
+ return false;
30
+ });
31
+ $(window).scroll(function() {
32
+ var sd = jQuery(window).scrollTop();
33
+ if(typeof document.body.style.maxHeight === "undefined") {
34
+ $toTop.css({
35
+ 'position': 'absolute',
36
+ 'top': jQuery(window).scrollTop()+$(window).height()-mv_dynamic_to_top.margin
37
+ });
38
+ }
39
+ if ( sd > settings.min ){
40
+ $toTop.fadeIn(settings.fade_in);
41
+ }else{
42
+ $toTop.fadeOut(settings.fade_out);}
43
+ });
44
+ };
45
+ $('body').DynamicToTop();
46
+ })(jQuery);
js/dynamic.to.top.settings.js CHANGED
@@ -1,10 +1,12 @@
1
- /*
2
- * Dynamic To Top Plugin Settings ver 3.0
3
  * http://www.mattvarone.com
4
- * By Matt Varone.
 
 
5
  * @sksmatt
 
6
  */
7
-
8
  jQuery(document).ready(function() {
9
 
10
  var preview = jQuery('#dynamic-to-top-button');
@@ -12,26 +14,8 @@ jQuery(document).ready(function() {
12
  var preview_text_version = jQuery('#dynamic-to-top-button #dtt-text');
13
  var hide_on_button = jQuery('#text-text, #slider-font-size, #checkbox-bold, #checkbox-text-shadow, #farbtastic-text-color, #farbtastic-shadow-color').parent().parent();
14
 
15
- jQuery('#checkbox-text-version').click(function(){
16
- toggle_text_version();
17
- });
18
-
19
- function toggle_text_version()
20
- {
21
- if ( jQuery('#checkbox-text-version').attr('checked') )
22
- {
23
- preview_button_version.hide();
24
- preview_text_version.show();
25
- preview.removeClass('button-version');
26
- hide_on_button.show();
27
- } else {
28
- preview_button_version.show().css('display','block');
29
- preview_text_version.hide();
30
- preview.addClass('button-version');
31
- hide_on_button.hide();
32
- }
33
- }
34
-
35
  toggle_text_version();
36
  update_preview();
37
  update_position();
@@ -49,93 +33,7 @@ jQuery(document).ready(function() {
49
  jQuery('#dynamic-to-top-preview').css('background-color',color);
50
  });
51
 
52
- function update_position()
53
- {
54
- var preview_position = jQuery('#select-position').val();
55
-
56
- switch(preview_position)
57
- {
58
- case 'Top Left':
59
- preview.css({top:'10px',left:'10px',bottom:'',right:''});
60
- break;
61
-
62
- case 'Top Right':
63
- preview.css({top:'10px',right:'10px',bottom:'',left:''});
64
- break;
65
-
66
- case 'Bottom Left':
67
- preview.css({bottom:'10px',left:'10px',top:'',right:''});
68
- break;
69
-
70
- case 'Bottom Right':
71
- preview.css({bottom:'10px',right:'10px',top:'',left:''});
72
- break;
73
- }
74
- }
75
-
76
- function update_preview()
77
- {
78
- prevew = new Object;
79
- preview.text = jQuery('#text-text').val();
80
- preview.border_width = jQuery('#slider-border-width').val();
81
- preview.border_radius = jQuery('#slider-radius').val();
82
- preview.text_color = jQuery('#farbtastic-text-color').val();
83
- preview.bg_color = jQuery('#farbtastic-background-color').val();
84
- preview.border_color = jQuery('#farbtastic-border-color').val();
85
- preview.padding_top_bottom = jQuery('#slider-padding-top-bottom').val();
86
- preview.padding_left_right = jQuery('#slider-padding-left-right').val();
87
- preview.find('#dtt-text').font_size = jQuery('#slider-font-size').val();
88
- preview.shadow = jQuery('#checkbox-shadow').attr("checked");
89
- preview.inset = jQuery('#checkbox-inset').attr("checked");
90
- preview.bold = jQuery('#checkbox-bold').attr("checked");
91
- preview.position = jQuery('#select-position').val();
92
- preview.text_shadow = jQuery('#checkbox-text-shadow').attr("checked");
93
- preview.text_shadow_color = jQuery('#farbtastic-shadow-color').val();
94
-
95
- preview
96
- .css({
97
- borderStyle:'solid',
98
- borderWidth: preview.border_width+'px',
99
- borderRadius: preview.border_radius+'px',
100
- borderColor: preview.border_color,
101
- backgroundColor: preview.bg_color,
102
- color: preview.text_color,
103
- paddingTop: preview.padding_top_bottom+'px',
104
- paddingBottom:preview.padding_top_bottom+'px',
105
- paddingLeft:preview.padding_left_right+'px',
106
- paddingRight:preview.padding_left_right+'px',
107
- fontSize:preview.font_size+'em',
108
- })
109
- .find('#dtt-text').html(preview.text);
110
-
111
- if (preview.bold) {
112
- preview.css('font-weight','bold');
113
- } else {
114
- preview.css('font-weight','normal');
115
- }
116
-
117
- if (preview.shadow) {
118
- preview.addClass('dynamic-to-top-shadow');
119
- } else {
120
- preview.removeClass('dynamic-to-top-shadow');
121
- }
122
-
123
- if (preview.inset) {
124
- preview.addClass('dynamic-to-top-inset');
125
- } else {
126
- preview.removeClass('dynamic-to-top-inset');
127
- }
128
-
129
- if (preview.text_shadow) {
130
- preview.css('text-shadow','0 1px 0 '+preview.text_shadow_color);
131
- } else {
132
- preview.css('text-shadow','');
133
- }
134
-
135
- }
136
-
137
  // Slider Radius
138
-
139
  var slider = jQuery( "#slider-radius" ).hide();
140
  var slider_val = jQuery('span#radius-val').html(slider.val());
141
 
@@ -144,14 +42,13 @@ jQuery(document).ready(function() {
144
  value: slider.val(),
145
  min: 0,
146
  max: 30,
147
- slide: function( event, ui ) {
148
  slider.val( ui.value );
149
  slider_val.html( ui.value);
150
  preview.css('border-radius',ui.value+'px');
151
  }});
152
 
153
  // Slider Border Width
154
-
155
  var slider_2 = jQuery( "#slider-border-width" ).hide();
156
  var slider_val_2 = jQuery('span#border-val').html(slider_2.val());
157
 
@@ -167,7 +64,6 @@ jQuery(document).ready(function() {
167
  }});
168
 
169
  // Slider Speed
170
-
171
  var slider_3 = jQuery('#slider-speed').hide();
172
  var slider_val_3 = jQuery('span#speed-val').html(slider_3.val());
173
 
@@ -183,7 +79,6 @@ jQuery(document).ready(function() {
183
  }});
184
 
185
  // Slider Padding Top/Bottom
186
-
187
  var slider_4 = jQuery( "#slider-padding-top-bottom" ).hide();
188
  var slider_val_4 = jQuery('span#padding-top-bottom-val').html(slider_4.val());
189
 
@@ -199,7 +94,6 @@ jQuery(document).ready(function() {
199
  }});
200
 
201
  // Slider Padding Left/Right
202
-
203
  var slider_5 = jQuery( "#slider-padding-left-right" ).hide();
204
  var slider_val_5 = jQuery('span#padding-left-right-val').html(slider_5.val());
205
 
@@ -215,7 +109,6 @@ jQuery(document).ready(function() {
215
  }});
216
 
217
  // Slider Font Size
218
-
219
  var slider_6 = jQuery( "#slider-font-size" ).hide();
220
  var slider_val_6 = jQuery('span#font-size-val').html(slider_6.val());
221
 
@@ -231,11 +124,9 @@ jQuery(document).ready(function() {
231
  preview.css({fontSize:ui.value+'em'});
232
  }});
233
 
234
-
235
  jQuery('.dtt-slider').css('width','25em');
236
 
237
  // Color Pickers
238
-
239
  jQuery('#farbtastic-picker-text-color').farbtastic('#farbtastic-text-color');
240
  jQuery('#farbtastic-picker-background-color').farbtastic('#farbtastic-background-color');
241
  jQuery('#farbtastic-picker-border-color').farbtastic('#farbtastic-border-color');
@@ -245,84 +136,131 @@ jQuery(document).ready(function() {
245
 
246
  jQuery('.picker').click(function(e){
247
  e.preventDefault();
248
- var self = jQuery(this);
249
-
250
- self.parent().find('.dtt-farbtastic').slideToggle();
 
 
 
 
 
 
 
 
 
 
 
251
 
252
- var open = self.attr('data-open');
253
- if (self.html() == open) {
254
- self.html(self.attr('data-closed'));
255
- self.parent().find('.picker').addClass('picker-opened');
256
  } else {
257
- self.parent().find('.picker').removeClass('picker-opened');
258
- self.html(open);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
- });
261
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
 
263
- /*!
264
- * jQuery UI Widget 1.8.13
265
- *
266
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
267
- * Dual licensed under the MIT or GPL Version 2 licenses.
268
- * http://jquery.org/license
269
- *
270
- * http://docs.jquery.com/UI/Widget
271
- */
272
- (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
273
- a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
274
- e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
275
- this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
276
- widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
277
- enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
278
- ;/*!
279
- * jQuery UI Mouse 1.8.13
280
- *
281
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
282
- * Dual licensed under the MIT or GPL Version 2 licenses.
283
- * http://jquery.org/license
284
- *
285
- * http://docs.jquery.com/UI/Mouse
286
- *
287
- * Depends:
288
- * jquery.ui.widget.js
289
- */
290
- (function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
291
- this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
292
- this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
293
- !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
294
- false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
295
- ;/*
296
- * jQuery UI Slider 1.8.13
297
- *
298
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
299
- * Dual licensed under the MIT or GPL Version 2 licenses.
300
- * http://jquery.org/license
301
- *
302
- * http://docs.jquery.com/UI/Slider
303
- *
304
- * Depends:
305
- * jquery.ui.core.js
306
- * jquery.ui.mouse.js
307
- * jquery.ui.widget.js
308
- */
309
- (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=a.values&&a.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
310
- this.orientation+" ui-widget ui-widget-content ui-corner-all"+(a.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(a.range){if(a.range===true){if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
311
- this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
312
- g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length?
313
- (h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i-
314
- m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
315
- return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false;
316
- this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a=
317
- this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a=
318
- this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);
319
- c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c<f))c=f;if(c!==this.values(a)){f=this.values();f[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:f});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],value:c});
320
- b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
321
- this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,a){var c,f,e;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
322
- this.value();else return this._values()},_setOption:function(b,a){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
323
- this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
324
- return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
325
- _refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate);
326
- if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
327
- 1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.13"})})(jQuery);
328
- ;
1
+ ;/*
2
+ * Dynamic To Top Plugin Settings
3
  * http://www.mattvarone.com
4
+ *
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * By Matt Varone
7
  * @sksmatt
8
+ *
9
  */
 
10
  jQuery(document).ready(function() {
11
 
12
  var preview = jQuery('#dynamic-to-top-button');
14
  var preview_text_version = jQuery('#dynamic-to-top-button #dtt-text');
15
  var hide_on_button = jQuery('#text-text, #slider-font-size, #checkbox-bold, #checkbox-text-shadow, #farbtastic-text-color, #farbtastic-shadow-color').parent().parent();
16
 
17
+ jQuery('#checkbox-text-version').click(function(){toggle_text_version();});
18
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  toggle_text_version();
20
  update_preview();
21
  update_position();
33
  jQuery('#dynamic-to-top-preview').css('background-color',color);
34
  });
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  // Slider Radius
 
37
  var slider = jQuery( "#slider-radius" ).hide();
38
  var slider_val = jQuery('span#radius-val').html(slider.val());
39
 
42
  value: slider.val(),
43
  min: 0,
44
  max: 30,
45
+ slide: function( event, ui ){
46
  slider.val( ui.value );
47
  slider_val.html( ui.value);
48
  preview.css('border-radius',ui.value+'px');
49
  }});
50
 
51
  // Slider Border Width
 
52
  var slider_2 = jQuery( "#slider-border-width" ).hide();
53
  var slider_val_2 = jQuery('span#border-val').html(slider_2.val());
54
 
64
  }});
65
 
66
  // Slider Speed
 
67
  var slider_3 = jQuery('#slider-speed').hide();
68
  var slider_val_3 = jQuery('span#speed-val').html(slider_3.val());
69
 
79
  }});
80
 
81
  // Slider Padding Top/Bottom
 
82
  var slider_4 = jQuery( "#slider-padding-top-bottom" ).hide();
83
  var slider_val_4 = jQuery('span#padding-top-bottom-val').html(slider_4.val());
84
 
94
  }});
95
 
96
  // Slider Padding Left/Right
 
97
  var slider_5 = jQuery( "#slider-padding-left-right" ).hide();
98
  var slider_val_5 = jQuery('span#padding-left-right-val').html(slider_5.val());
99
 
109
  }});
110
 
111
  // Slider Font Size
 
112
  var slider_6 = jQuery( "#slider-font-size" ).hide();
113
  var slider_val_6 = jQuery('span#font-size-val').html(slider_6.val());
114
 
124
  preview.css({fontSize:ui.value+'em'});
125
  }});
126
 
 
127
  jQuery('.dtt-slider').css('width','25em');
128
 
129
  // Color Pickers
 
130
  jQuery('#farbtastic-picker-text-color').farbtastic('#farbtastic-text-color');
131
  jQuery('#farbtastic-picker-background-color').farbtastic('#farbtastic-background-color');
132
  jQuery('#farbtastic-picker-border-color').farbtastic('#farbtastic-border-color');
136
 
137
  jQuery('.picker').click(function(e){
138
  e.preventDefault();
139
+ toogle_picker(jQuery(this));
140
+
141
+ });
142
+
143
+ jQuery('.colorvalue').click(function(){
144
+ var picker = jQuery(this).parent().find('.picker');
145
+ if (picker.html() == picker.attr('data-closed')) {
146
+ toogle_picker(picker);
147
+ }
148
+ });
149
+
150
+ function toogle_picker(picker)
151
+ {
152
+ picker.parent().find('.dtt-farbtastic').toggle();
153
 
154
+ var open = picker.attr('data-open');
155
+ if (picker.html() == open) {
156
+ picker.html(picker.attr('data-closed'));
157
+ picker.parent().find('.picker').addClass('picker-opened');
158
  } else {
159
+ picker.parent().find('.picker').removeClass('picker-opened');
160
+ picker.html(open);
161
+ }
162
+ }
163
+
164
+ /* FUNCTIONS
165
+ /////////////////////////////*/
166
+
167
+ function toggle_text_version()
168
+ {
169
+ if ( jQuery('#checkbox-text-version').attr('checked') )
170
+ {
171
+ preview_button_version.hide();
172
+ preview_text_version.show();
173
+ preview.removeClass('button-version');
174
+ hide_on_button.show();
175
+ } else {
176
+ preview_button_version.show().css('display','block');
177
+ preview_text_version.hide();
178
+ preview.addClass('button-version');
179
+ hide_on_button.hide();
180
+ }
181
+ }
182
+
183
+ function update_position()
184
+ {
185
+ var preview_position = jQuery('#select-position').val();
186
+
187
+ switch(preview_position)
188
+ {
189
+ case 'Top Left':
190
+ preview.css({top:'10px',left:'10px',bottom:'',right:''});
191
+ break;
192
+
193
+ case 'Top Right':
194
+ preview.css({top:'10px',right:'10px',bottom:'',left:''});
195
+ break;
196
+
197
+ case 'Bottom Left':
198
+ preview.css({bottom:'10px',left:'10px',top:'',right:''});
199
+ break;
200
+
201
+ case 'Bottom Right':
202
+ preview.css({bottom:'10px',right:'10px',top:'',left:''});
203
+ break;
204
  }
205
+ }
206
+
207
+ function update_preview()
208
+ {
209
+ prevew = new Object;
210
+ preview.text = jQuery('#text-text').val();
211
+ preview.border_width = jQuery('#slider-border-width').val();
212
+ preview.border_radius = jQuery('#slider-radius').val();
213
+ preview.text_color = jQuery('#farbtastic-text-color').val();
214
+ preview.bg_color = jQuery('#farbtastic-background-color').val();
215
+ preview.border_color = jQuery('#farbtastic-border-color').val();
216
+ preview.padding_top_bottom = jQuery('#slider-padding-top-bottom').val();
217
+ preview.padding_left_right = jQuery('#slider-padding-left-right').val();
218
+ preview.find('#dtt-text').font_size = jQuery('#slider-font-size').val();
219
+ preview.shadow = jQuery('#checkbox-shadow').attr("checked");
220
+ preview.inset = jQuery('#checkbox-inset').attr("checked");
221
+ preview.bold = jQuery('#checkbox-bold').attr("checked");
222
+ preview.position = jQuery('#select-position').val();
223
+ preview.text_shadow = jQuery('#checkbox-text-shadow').attr("checked");
224
+ preview.text_shadow_color = jQuery('#farbtastic-shadow-color').val();
225
+
226
+ preview.css({
227
+ borderStyle:'solid',
228
+ borderWidth: preview.border_width+'px',
229
+ borderRadius: preview.border_radius+'px',
230
+ borderColor: preview.border_color,
231
+ backgroundColor: preview.bg_color,
232
+ color: preview.text_color,
233
+ paddingTop: preview.padding_top_bottom+'px',
234
+ paddingBottom:preview.padding_top_bottom+'px',
235
+ paddingLeft:preview.padding_left_right+'px',
236
+ paddingRight:preview.padding_left_right+'px',
237
+ fontSize:preview.font_size+'em',
238
+ }).find('#dtt-text').html(preview.text);
239
 
240
+ if (preview.bold) {
241
+ preview.css('font-weight','bold');
242
+ } else {
243
+ preview.css('font-weight','normal');
244
+ }
245
+
246
+ if (preview.shadow) {
247
+ preview.addClass('dynamic-to-top-shadow');
248
+ } else {
249
+ preview.removeClass('dynamic-to-top-shadow');
250
+ }
251
+
252
+ if (preview.inset) {
253
+ preview.addClass('dynamic-to-top-inset');
254
+ } else {
255
+ preview.removeClass('dynamic-to-top-inset');
256
+ }
257
+
258
+ if (preview.text_shadow) {
259
+ preview.css('text-shadow','0 1px 0 '+preview.text_shadow_color);
260
+ } else {
261
+ preview.css('text-shadow','');
262
+ }
263
+
264
+ }
265
+
266
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/libs/jquery.easing.js ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ jQuery.extend( jQuery.easing,
39
+ {
40
+ def: 'easeOutQuad',
41
+ swing: function (x, t, b, c, d) {
42
+ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
43
+ },
44
+ easeInQuad: function (x, t, b, c, d) {
45
+ return c*(t/=d)*t + b;
46
+ },
47
+ easeOutQuad: function (x, t, b, c, d) {
48
+ return -c *(t/=d)*(t-2) + b;
49
+ },
50
+ easeInOutQuad: function (x, t, b, c, d) {
51
+ if ((t/=d/2) < 1) return c/2*t*t + b;
52
+ return -c/2 * ((--t)*(t-2) - 1) + b;
53
+ },
54
+ easeInCubic: function (x, t, b, c, d) {
55
+ return c*(t/=d)*t*t + b;
56
+ },
57
+ easeOutCubic: function (x, t, b, c, d) {
58
+ return c*((t=t/d-1)*t*t + 1) + b;
59
+ },
60
+ easeInOutCubic: function (x, t, b, c, d) {
61
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
62
+ return c/2*((t-=2)*t*t + 2) + b;
63
+ },
64
+ easeInQuart: function (x, t, b, c, d) {
65
+ return c*(t/=d)*t*t*t + b;
66
+ },
67
+ easeOutQuart: function (x, t, b, c, d) {
68
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
69
+ },
70
+ easeInOutQuart: function (x, t, b, c, d) {
71
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
72
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
73
+ },
74
+ easeInQuint: function (x, t, b, c, d) {
75
+ return c*(t/=d)*t*t*t*t + b;
76
+ },
77
+ easeOutQuint: function (x, t, b, c, d) {
78
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
79
+ },
80
+ easeInOutQuint: function (x, t, b, c, d) {
81
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
82
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
83
+ },
84
+ easeInSine: function (x, t, b, c, d) {
85
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
86
+ },
87
+ easeOutSine: function (x, t, b, c, d) {
88
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
89
+ },
90
+ easeInOutSine: function (x, t, b, c, d) {
91
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
92
+ },
93
+ easeInExpo: function (x, t, b, c, d) {
94
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
95
+ },
96
+ easeOutExpo: function (x, t, b, c, d) {
97
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
98
+ },
99
+ easeInOutExpo: function (x, t, b, c, d) {
100
+ if (t==0) return b;
101
+ if (t==d) return b+c;
102
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
103
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
104
+ },
105
+ easeInCirc: function (x, t, b, c, d) {
106
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
107
+ },
108
+ easeOutCirc: function (x, t, b, c, d) {
109
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
110
+ },
111
+ easeInOutCirc: function (x, t, b, c, d) {
112
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
113
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
114
+ },
115
+ easeInElastic: function (x, t, b, c, d) {
116
+ var s=1.70158;var p=0;var a=c;
117
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
118
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
119
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
120
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
121
+ },
122
+ easeOutElastic: function (x, t, b, c, d) {
123
+ var s=1.70158;var p=0;var a=c;
124
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
125
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
126
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
127
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
128
+ },
129
+ easeInOutElastic: function (x, t, b, c, d) {
130
+ var s=1.70158;var p=0;var a=c;
131
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
132
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
133
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
134
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
135
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
136
+ },
137
+ easeInBack: function (x, t, b, c, d, s) {
138
+ if (s == undefined) s = 1.70158;
139
+ return c*(t/=d)*t*((s+1)*t - s) + b;
140
+ },
141
+ easeOutBack: function (x, t, b, c, d, s) {
142
+ if (s == undefined) s = 1.70158;
143
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
144
+ },
145
+ easeInOutBack: function (x, t, b, c, d, s) {
146
+ if (s == undefined) s = 1.70158;
147
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
148
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
149
+ },
150
+ easeInBounce: function (x, t, b, c, d) {
151
+ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
152
+ },
153
+ easeOutBounce: function (x, t, b, c, d) {
154
+ if ((t/=d) < (1/2.75)) {
155
+ return c*(7.5625*t*t) + b;
156
+ } else if (t < (2/2.75)) {
157
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
158
+ } else if (t < (2.5/2.75)) {
159
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
160
+ } else {
161
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
162
+ }
163
+ },
164
+ easeInOutBounce: function (x, t, b, c, d) {
165
+ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
166
+ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
167
+ }
168
+ });
169
+
170
+ /*
171
+ *
172
+ * TERMS OF USE - EASING EQUATIONS
173
+ *
174
+ * Open source under the BSD License.
175
+ *
176
+ * Copyright © 2001 Robert Penner
177
+ * All rights reserved.
178
+ *
179
+ * Redistribution and use in source and binary forms, with or without modification,
180
+ * are permitted provided that the following conditions are met:
181
+ *
182
+ * Redistributions of source code must retain the above copyright notice, this list of
183
+ * conditions and the following disclaimer.
184
+ * Redistributions in binary form must reproduce the above copyright notice, this list
185
+ * of conditions and the following disclaimer in the documentation and/or other materials
186
+ * provided with the distribution.
187
+ *
188
+ * Neither the name of the author nor the names of contributors may be used to endorse
189
+ * or promote products derived from this software without specific prior written permission.
190
+ *
191
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
192
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
193
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
194
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
195
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
196
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
197
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
198
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
199
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
200
+ *
201
+ */
js/libs/jquery.ui.mouse.js ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI Mouse 1.8.14
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Mouse
9
+ *
10
+ * Depends:
11
+ * jquery.ui.widget.js
12
+ */
13
+ (function( $, undefined ) {
14
+
15
+ var mouseHandled = false;
16
+ $(document).mousedown(function(e) {
17
+ mouseHandled = false;
18
+ });
19
+
20
+ $.widget("ui.mouse", {
21
+ options: {
22
+ cancel: ':input,option',
23
+ distance: 1,
24
+ delay: 0
25
+ },
26
+ _mouseInit: function() {
27
+ var self = this;
28
+
29
+ this.element
30
+ .bind('mousedown.'+this.widgetName, function(event) {
31
+ return self._mouseDown(event);
32
+ })
33
+ .bind('click.'+this.widgetName, function(event) {
34
+ if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
35
+ $.removeData(event.target, self.widgetName + '.preventClickEvent');
36
+ event.stopImmediatePropagation();
37
+ return false;
38
+ }
39
+ });
40
+
41
+ this.started = false;
42
+ },
43
+
44
+ // TODO: make sure destroying one instance of mouse doesn't mess with
45
+ // other instances of mouse
46
+ _mouseDestroy: function() {
47
+ this.element.unbind('.'+this.widgetName);
48
+ },
49
+
50
+ _mouseDown: function(event) {
51
+ // don't let more than one widget handle mouseStart
52
+ if(mouseHandled) {return};
53
+
54
+ // we may have missed mouseup (out of window)
55
+ (this._mouseStarted && this._mouseUp(event));
56
+
57
+ this._mouseDownEvent = event;
58
+
59
+ var self = this,
60
+ btnIsLeft = (event.which == 1),
61
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).closest(this.options.cancel).length : false);
62
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
63
+ return true;
64
+ }
65
+
66
+ this.mouseDelayMet = !this.options.delay;
67
+ if (!this.mouseDelayMet) {
68
+ this._mouseDelayTimer = setTimeout(function() {
69
+ self.mouseDelayMet = true;
70
+ }, this.options.delay);
71
+ }
72
+
73
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
74
+ this._mouseStarted = (this._mouseStart(event) !== false);
75
+ if (!this._mouseStarted) {
76
+ event.preventDefault();
77
+ return true;
78
+ }
79
+ }
80
+
81
+ // Click event may never have fired (Gecko & Opera)
82
+ if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
83
+ $.removeData(event.target, this.widgetName + '.preventClickEvent');
84
+ }
85
+
86
+ // these delegates are required to keep context
87
+ this._mouseMoveDelegate = function(event) {
88
+ return self._mouseMove(event);
89
+ };
90
+ this._mouseUpDelegate = function(event) {
91
+ return self._mouseUp(event);
92
+ };
93
+ $(document)
94
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
95
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
96
+
97
+ event.preventDefault();
98
+
99
+ mouseHandled = true;
100
+ return true;
101
+ },
102
+
103
+ _mouseMove: function(event) {
104
+ // IE mouseup check - mouseup happened when mouse was out of window
105
+ if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
106
+ return this._mouseUp(event);
107
+ }
108
+
109
+ if (this._mouseStarted) {
110
+ this._mouseDrag(event);
111
+ return event.preventDefault();
112
+ }
113
+
114
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
115
+ this._mouseStarted =
116
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
117
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
118
+ }
119
+
120
+ return !this._mouseStarted;
121
+ },
122
+
123
+ _mouseUp: function(event) {
124
+ $(document)
125
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
126
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
127
+
128
+ if (this._mouseStarted) {
129
+ this._mouseStarted = false;
130
+
131
+ if (event.target == this._mouseDownEvent.target) {
132
+ $.data(event.target, this.widgetName + '.preventClickEvent', true);
133
+ }
134
+
135
+ this._mouseStop(event);
136
+ }
137
+
138
+ return false;
139
+ },
140
+
141
+ _mouseDistanceMet: function(event) {
142
+ return (Math.max(
143
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
144
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
145
+ ) >= this.options.distance
146
+ );
147
+ },
148
+
149
+ _mouseDelayMet: function(event) {
150
+ return this.mouseDelayMet;
151
+ },
152
+
153
+ // These are placeholder methods, to be overriden by extending plugin
154
+ _mouseStart: function(event) {},
155
+ _mouseDrag: function(event) {},
156
+ _mouseStop: function(event) {},
157
+ _mouseCapture: function(event) { return true; }
158
+ });
159
+
160
+ })(jQuery);
js/libs/jquery.ui.slider.js ADDED
@@ -0,0 +1,666 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Slider 1.8.14
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Slider
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.mouse.js
13
+ * jquery.ui.widget.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ // number of pages in a slider
18
+ // (how many times can you page up/down to go through the whole range)
19
+ var numPages = 5;
20
+
21
+ $.widget( "ui.slider", $.ui.mouse, {
22
+
23
+ widgetEventPrefix: "slide",
24
+
25
+ options: {
26
+ animate: false,
27
+ distance: 0,
28
+ max: 100,
29
+ min: 0,
30
+ orientation: "horizontal",
31
+ range: false,
32
+ step: 1,
33
+ value: 0,
34
+ values: null
35
+ },
36
+
37
+ _create: function() {
38
+ var self = this,
39
+ o = this.options,
40
+ existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
41
+ handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
42
+ handleCount = ( o.values && o.values.length ) || 1,
43
+ handles = [];
44
+
45
+ this._keySliding = false;
46
+ this._mouseSliding = false;
47
+ this._animateOff = true;
48
+ this._handleIndex = null;
49
+ this._detectOrientation();
50
+ this._mouseInit();
51
+
52
+ this.element
53
+ .addClass( "ui-slider" +
54
+ " ui-slider-" + this.orientation +
55
+ " ui-widget" +
56
+ " ui-widget-content" +
57
+ " ui-corner-all" +
58
+ ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) );
59
+
60
+ this.range = $([]);
61
+
62
+ if ( o.range ) {
63
+ if ( o.range === true ) {
64
+ if ( !o.values ) {
65
+ o.values = [ this._valueMin(), this._valueMin() ];
66
+ }
67
+ if ( o.values.length && o.values.length !== 2 ) {
68
+ o.values = [ o.values[0], o.values[0] ];
69
+ }
70
+ }
71
+
72
+ this.range = $( "<div></div>" )
73
+ .appendTo( this.element )
74
+ .addClass( "ui-slider-range" +
75
+ // note: this isn't the most fittingly semantic framework class for this element,
76
+ // but worked best visually with a variety of themes
77
+ " ui-widget-header" +
78
+ ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
79
+ }
80
+
81
+ for ( var i = existingHandles.length; i < handleCount; i += 1 ) {
82
+ handles.push( handle );
83
+ }
84
+
85
+ this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) );
86
+
87
+ this.handle = this.handles.eq( 0 );
88
+
89
+ this.handles.add( this.range ).filter( "a" )
90
+ .click(function( event ) {
91
+ event.preventDefault();
92
+ })
93
+ .hover(function() {
94
+ if ( !o.disabled ) {
95
+ $( this ).addClass( "ui-state-hover" );
96
+ }
97
+ }, function() {
98
+ $( this ).removeClass( "ui-state-hover" );
99
+ })
100
+ .focus(function() {
101
+ if ( !o.disabled ) {
102
+ $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );
103
+ $( this ).addClass( "ui-state-focus" );
104
+ } else {
105
+ $( this ).blur();
106
+ }
107
+ })
108
+ .blur(function() {
109
+ $( this ).removeClass( "ui-state-focus" );
110
+ });
111
+
112
+ this.handles.each(function( i ) {
113
+ $( this ).data( "index.ui-slider-handle", i );
114
+ });
115
+
116
+ this.handles
117
+ .keydown(function( event ) {
118
+ var ret = true,
119
+ index = $( this ).data( "index.ui-slider-handle" ),
120
+ allowed,
121
+ curVal,
122
+ newVal,
123
+ step;
124
+
125
+ if ( self.options.disabled ) {
126
+ return;
127
+ }
128
+
129
+ switch ( event.keyCode ) {
130
+ case $.ui.keyCode.HOME:
131
+ case $.ui.keyCode.END:
132
+ case $.ui.keyCode.PAGE_UP:
133
+ case $.ui.keyCode.PAGE_DOWN:
134
+ case $.ui.keyCode.UP:
135
+ case $.ui.keyCode.RIGHT:
136
+ case $.ui.keyCode.DOWN:
137
+ case $.ui.keyCode.LEFT:
138
+ ret = false;
139
+ if ( !self._keySliding ) {
140
+ self._keySliding = true;
141
+ $( this ).addClass( "ui-state-active" );
142
+ allowed = self._start( event, index );
143
+ if ( allowed === false ) {
144
+ return;
145
+ }
146
+ }
147
+ break;
148
+ }
149
+
150
+ step = self.options.step;
151
+ if ( self.options.values && self.options.values.length ) {
152
+ curVal = newVal = self.values( index );
153
+ } else {
154
+ curVal = newVal = self.value();
155
+ }
156
+
157
+ switch ( event.keyCode ) {
158
+ case $.ui.keyCode.HOME:
159
+ newVal = self._valueMin();
160
+ break;
161
+ case $.ui.keyCode.END:
162
+ newVal = self._valueMax();
163
+ break;
164
+ case $.ui.keyCode.PAGE_UP:
165
+ newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
166
+ break;
167
+ case $.ui.keyCode.PAGE_DOWN:
168
+ newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
169
+ break;
170
+ case $.ui.keyCode.UP:
171
+ case $.ui.keyCode.RIGHT:
172
+ if ( curVal === self._valueMax() ) {
173
+ return;
174
+ }
175
+ newVal = self._trimAlignValue( curVal + step );
176
+ break;
177
+ case $.ui.keyCode.DOWN:
178
+ case $.ui.keyCode.LEFT:
179
+ if ( curVal === self._valueMin() ) {
180
+ return;
181
+ }
182
+ newVal = self._trimAlignValue( curVal - step );
183
+ break;
184
+ }
185
+
186
+ self._slide( event, index, newVal );
187
+
188
+ return ret;
189
+
190
+ })
191
+ .keyup(function( event ) {
192
+ var index = $( this ).data( "index.ui-slider-handle" );
193
+
194
+ if ( self._keySliding ) {
195
+ self._keySliding = false;
196
+ self._stop( event, index );
197
+ self._change( event, index );
198
+ $( this ).removeClass( "ui-state-active" );
199
+ }
200
+
201
+ });
202
+
203
+ this._refreshValue();
204
+
205
+ this._animateOff = false;
206
+ },
207
+
208
+ destroy: function() {
209
+ this.handles.remove();
210
+ this.range.remove();
211
+
212
+ this.element
213
+ .removeClass( "ui-slider" +
214
+ " ui-slider-horizontal" +
215
+ " ui-slider-vertical" +
216
+ " ui-slider-disabled" +
217
+ " ui-widget" +
218
+ " ui-widget-content" +
219
+ " ui-corner-all" )
220
+ .removeData( "slider" )
221
+ .unbind( ".slider" );
222
+
223
+ this._mouseDestroy();
224
+
225
+ return this;
226
+ },
227
+
228
+ _mouseCapture: function( event ) {
229
+ var o = this.options,
230
+ position,
231
+ normValue,
232
+ distance,
233
+ closestHandle,
234
+ self,
235
+ index,
236
+ allowed,
237
+ offset,
238
+ mouseOverHandle;
239
+
240
+ if ( o.disabled ) {
241
+ return false;
242
+ }
243
+
244
+ this.elementSize = {
245
+ width: this.element.outerWidth(),
246
+ height: this.element.outerHeight()
247
+ };
248
+ this.elementOffset = this.element.offset();
249
+
250
+ position = { x: event.pageX, y: event.pageY };
251
+ normValue = this._normValueFromMouse( position );
252
+ distance = this._valueMax() - this._valueMin() + 1;
253
+ self = this;
254
+ this.handles.each(function( i ) {
255
+ var thisDistance = Math.abs( normValue - self.values(i) );
256
+ if ( distance > thisDistance ) {
257
+ distance = thisDistance;
258
+ closestHandle = $( this );
259
+ index = i;
260
+ }
261
+ });
262
+
263
+ // workaround for bug #3736 (if both handles of a range are at 0,
264
+ // the first is always used as the one with least distance,
265
+ // and moving it is obviously prevented by preventing negative ranges)
266
+ if( o.range === true && this.values(1) === o.min ) {
267
+ index += 1;
268
+ closestHandle = $( this.handles[index] );
269
+ }
270
+
271
+ allowed = this._start( event, index );
272
+ if ( allowed === false ) {
273
+ return false;
274
+ }
275
+ this._mouseSliding = true;
276
+
277
+ self._handleIndex = index;
278
+
279
+ closestHandle
280
+ .addClass( "ui-state-active" )
281
+ .focus();
282
+
283
+ offset = closestHandle.offset();
284
+ mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
285
+ this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
286
+ left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
287
+ top: event.pageY - offset.top -
288
+ ( closestHandle.height() / 2 ) -
289
+ ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
290
+ ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
291
+ ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
292
+ };
293
+
294
+ if ( !this.handles.hasClass( "ui-state-hover" ) ) {
295
+ this._slide( event, index, normValue );
296
+ }
297
+ this._animateOff = true;
298
+ return true;
299
+ },
300
+
301
+ _mouseStart: function( event ) {
302
+ return true;
303
+ },
304
+
305
+ _mouseDrag: function( event ) {
306
+ var position = { x: event.pageX, y: event.pageY },
307
+ normValue = this._normValueFromMouse( position );
308
+
309
+ this._slide( event, this._handleIndex, normValue );
310
+
311
+ return false;
312
+ },
313
+
314
+ _mouseStop: function( event ) {
315
+ this.handles.removeClass( "ui-state-active" );
316
+ this._mouseSliding = false;
317
+
318
+ this._stop( event, this._handleIndex );
319
+ this._change( event, this._handleIndex );
320
+
321
+ this._handleIndex = null;
322
+ this._clickOffset = null;
323
+ this._animateOff = false;
324
+
325
+ return false;
326
+ },
327
+
328
+ _detectOrientation: function() {
329
+ this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
330
+ },
331
+
332
+ _normValueFromMouse: function( position ) {
333
+ var pixelTotal,
334
+ pixelMouse,
335
+ percentMouse,
336
+ valueTotal,
337
+ valueMouse;
338
+
339
+ if ( this.orientation === "horizontal" ) {
340
+ pixelTotal = this.elementSize.width;
341
+ pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
342
+ } else {
343
+ pixelTotal = this.elementSize.height;
344
+ pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
345
+ }
346
+
347
+ percentMouse = ( pixelMouse / pixelTotal );
348
+ if ( percentMouse > 1 ) {
349
+ percentMouse = 1;
350
+ }
351
+ if ( percentMouse < 0 ) {
352
+ percentMouse = 0;
353
+ }
354
+ if ( this.orientation === "vertical" ) {
355
+ percentMouse = 1 - percentMouse;
356
+ }
357
+
358
+ valueTotal = this._valueMax() - this._valueMin();
359
+ valueMouse = this._valueMin() + percentMouse * valueTotal;
360
+
361
+ return this._trimAlignValue( valueMouse );
362
+ },
363
+
364
+ _start: function( event, index ) {
365
+ var uiHash = {
366
+ handle: this.handles[ index ],
367
+ value: this.value()
368
+ };
369
+ if ( this.options.values && this.options.values.length ) {
370
+ uiHash.value = this.values( index );
371
+ uiHash.values = this.values();
372
+ }
373
+ return this._trigger( "start", event, uiHash );
374
+ },
375
+
376
+ _slide: function( event, index, newVal ) {
377
+ var otherVal,
378
+ newValues,
379
+ allowed;
380
+
381
+ if ( this.options.values && this.options.values.length ) {
382
+ otherVal = this.values( index ? 0 : 1 );
383
+
384
+ if ( ( this.options.values.length === 2 && this.options.range === true ) &&
385
+ ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
386
+ ) {
387
+ newVal = otherVal;
388
+ }
389
+
390
+ if ( newVal !== this.values( index ) ) {
391
+ newValues = this.values();
392
+ newValues[ index ] = newVal;
393
+ // A slide can be canceled by returning false from the slide callback
394
+ allowed = this._trigger( "slide", event, {
395
+ handle: this.handles[ index ],
396
+ value: newVal,
397
+ values: newValues
398
+ } );
399
+ otherVal = this.values( index ? 0 : 1 );
400
+ if ( allowed !== false ) {
401
+ this.values( index, newVal, true );
402
+ }
403
+ }
404
+ } else {
405
+ if ( newVal !== this.value() ) {
406
+ // A slide can be canceled by returning false from the slide callback
407
+ allowed = this._trigger( "slide", event, {
408
+ handle: this.handles[ index ],
409
+ value: newVal
410
+ } );
411
+ if ( allowed !== false ) {
412
+ this.value( newVal );
413
+ }
414
+ }
415
+ }
416
+ },
417
+
418
+ _stop: function( event, index ) {
419
+ var uiHash = {
420
+ handle: this.handles[ index ],
421
+ value: this.value()
422
+ };
423
+ if ( this.options.values && this.options.values.length ) {
424
+ uiHash.value = this.values( index );
425
+ uiHash.values = this.values();
426
+ }
427
+
428
+ this._trigger( "stop", event, uiHash );
429
+ },
430
+
431
+ _change: function( event, index ) {
432
+ if ( !this._keySliding && !this._mouseSliding ) {
433
+ var uiHash = {
434
+ handle: this.handles[ index ],
435
+ value: this.value()
436
+ };
437
+ if ( this.options.values && this.options.values.length ) {
438
+ uiHash.value = this.values( index );
439
+ uiHash.values = this.values();
440
+ }
441
+
442
+ this._trigger( "change", event, uiHash );
443
+ }
444
+ },
445
+
446
+ value: function( newValue ) {
447
+ if ( arguments.length ) {
448
+ this.options.value = this._trimAlignValue( newValue );
449
+ this._refreshValue();
450
+ this._change( null, 0 );
451
+ return;
452
+ }
453
+
454
+ return this._value();
455
+ },
456
+
457
+ values: function( index, newValue ) {
458
+ var vals,
459
+ newValues,
460
+ i;
461
+
462
+ if ( arguments.length > 1 ) {
463
+ this.options.values[ index ] = this._trimAlignValue( newValue );
464
+ this._refreshValue();
465
+ this._change( null, index );
466
+ return;
467
+ }
468
+
469
+ if ( arguments.length ) {
470
+ if ( $.isArray( arguments[ 0 ] ) ) {
471
+ vals = this.options.values;
472
+ newValues = arguments[ 0 ];
473
+ for ( i = 0; i < vals.length; i += 1 ) {
474
+ vals[ i ] = this._trimAlignValue( newValues[ i ] );
475
+ this._change( null, i );
476
+ }
477
+ this._refreshValue();
478
+ } else {
479
+ if ( this.options.values && this.options.values.length ) {
480
+ return this._values( index );
481
+ } else {
482
+ return this.value();
483
+ }
484
+ }
485
+ } else {
486
+ return this._values();
487
+ }
488
+ },
489
+
490
+ _setOption: function( key, value ) {
491
+ var i,
492
+ valsLength = 0;
493
+
494
+ if ( $.isArray( this.options.values ) ) {
495
+ valsLength = this.options.values.length;
496
+ }
497
+
498
+ $.Widget.prototype._setOption.apply( this, arguments );
499
+
500
+ switch ( key ) {
501
+ case "disabled":
502
+ if ( value ) {
503
+ this.handles.filter( ".ui-state-focus" ).blur();
504
+ this.handles.removeClass( "ui-state-hover" );
505
+ this.handles.attr( "disabled", "disabled" );
506
+ this.element.addClass( "ui-disabled" );
507
+ } else {
508
+ this.handles.removeAttr( "disabled" );
509
+ this.element.removeClass( "ui-disabled" );
510
+ }
511
+ break;
512
+ case "orientation":
513
+ this._detectOrientation();
514
+ this.element
515
+ .removeClass( "ui-slider-horizontal ui-slider-vertical" )
516
+ .addClass( "ui-slider-" + this.orientation );
517
+ this._refreshValue();
518
+ break;
519
+ case "value":
520
+ this._animateOff = true;
521
+ this._refreshValue();
522
+ this._change( null, 0 );
523
+ this._animateOff = false;
524
+ break;
525
+ case "values":
526
+ this._animateOff = true;
527
+ this._refreshValue();
528
+ for ( i = 0; i < valsLength; i += 1 ) {
529
+ this._change( null, i );
530
+ }
531
+ this._animateOff = false;
532
+ break;
533
+ }
534
+ },
535
+
536
+ //internal value getter
537
+ // _value() returns value trimmed by min and max, aligned by step
538
+ _value: function() {
539
+ var val = this.options.value;
540
+ val = this._trimAlignValue( val );
541
+
542
+ return val;
543
+ },
544
+
545
+ //internal values getter
546
+ // _values() returns array of values trimmed by min and max, aligned by step
547
+ // _values( index ) returns single value trimmed by min and max, aligned by step
548
+ _values: function( index ) {
549
+ var val,
550
+ vals,
551
+ i;
552
+
553
+ if ( arguments.length ) {
554
+ val = this.options.values[ index ];
555
+ val = this._trimAlignValue( val );
556
+
557
+ return val;
558
+ } else {
559
+ // .slice() creates a copy of the array
560
+ // this copy gets trimmed by min and max and then returned
561
+ vals = this.options.values.slice();
562
+ for ( i = 0; i < vals.length; i+= 1) {
563
+ vals[ i ] = this._trimAlignValue( vals[ i ] );
564
+ }
565
+
566
+ return vals;
567
+ }
568
+ },
569
+
570
+ // returns the step-aligned value that val is closest to, between (inclusive) min and max
571
+ _trimAlignValue: function( val ) {
572
+ if ( val <= this._valueMin() ) {
573
+ return this._valueMin();
574
+ }
575
+ if ( val >= this._valueMax() ) {
576
+ return this._valueMax();
577
+ }
578
+ var step = ( this.options.step > 0 ) ? this.options.step : 1,
579
+ valModStep = (val - this._valueMin()) % step;
580
+ alignValue = val - valModStep;
581
+
582
+ if ( Math.abs(valModStep) * 2 >= step ) {
583
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
584
+ }
585
+
586
+ // Since JavaScript has problems with large floats, round
587
+ // the final value to 5 digits after the decimal point (see #4124)
588
+ return parseFloat( alignValue.toFixed(5) );
589
+ },
590
+
591
+ _valueMin: function() {
592
+ return this.options.min;
593
+ },
594
+
595
+ _valueMax: function() {
596
+ return this.options.max;
597
+ },
598
+
599
+ _refreshValue: function() {
600
+ var oRange = this.options.range,
601
+ o = this.options,
602
+ self = this,
603
+ animate = ( !this._animateOff ) ? o.animate : false,
604
+ valPercent,
605
+ _set = {},
606
+ lastValPercent,
607
+ value,
608
+ valueMin,
609
+ valueMax;
610
+
611
+ if ( this.options.values && this.options.values.length ) {
612
+ this.handles.each(function( i, j ) {
613
+ valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;
614
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
615
+ $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
616
+ if ( self.options.range === true ) {
617
+ if ( self.orientation === "horizontal" ) {
618
+ if ( i === 0 ) {
619
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
620
+ }
621
+ if ( i === 1 ) {
622
+ self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
623
+ }
624
+ } else {
625
+ if ( i === 0 ) {
626
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
627
+ }
628
+ if ( i === 1 ) {
629
+ self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
630
+ }
631
+ }
632
+ }
633
+ lastValPercent = valPercent;
634
+ });
635
+ } else {
636
+ value = this.value();
637
+ valueMin = this._valueMin();
638
+ valueMax = this._valueMax();
639
+ valPercent = ( valueMax !== valueMin ) ?
640
+ ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
641
+ 0;
642
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
643
+ this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
644
+
645
+ if ( oRange === "min" && this.orientation === "horizontal" ) {
646
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
647
+ }
648
+ if ( oRange === "max" && this.orientation === "horizontal" ) {
649
+ this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
650
+ }
651
+ if ( oRange === "min" && this.orientation === "vertical" ) {
652
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
653
+ }
654
+ if ( oRange === "max" && this.orientation === "vertical" ) {
655
+ this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
656
+ }
657
+ }
658
+ }
659
+
660
+ });
661
+
662
+ $.extend( $.ui.slider, {
663
+ version: "1.8.14"
664
+ });
665
+
666
+ }(jQuery));
js/libs/jquery.ui.widget.js ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI Widget 1.8.14
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Widget
9
+ */
10
+ (function( $, undefined ) {
11
+
12
+ // jQuery 1.4+
13
+ if ( $.cleanData ) {
14
+ var _cleanData = $.cleanData;
15
+ $.cleanData = function( elems ) {
16
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
17
+ $( elem ).triggerHandler( "remove" );
18
+ }
19
+ _cleanData( elems );
20
+ };
21
+ } else {
22
+ var _remove = $.fn.remove;
23
+ $.fn.remove = function( selector, keepData ) {
24
+ return this.each(function() {
25
+ if ( !keepData ) {
26
+ if ( !selector || $.filter( selector, [ this ] ).length ) {
27
+ $( "*", this ).add( [ this ] ).each(function() {
28
+ $( this ).triggerHandler( "remove" );
29
+ });
30
+ }
31
+ }
32
+ return _remove.call( $(this), selector, keepData );
33
+ });
34
+ };
35
+ }
36
+
37
+ $.widget = function( name, base, prototype ) {
38
+ var namespace = name.split( "." )[ 0 ],
39
+ fullName;
40
+ name = name.split( "." )[ 1 ];
41
+ fullName = namespace + "-" + name;
42
+
43
+ if ( !prototype ) {
44
+ prototype = base;
45
+ base = $.Widget;
46
+ }
47
+
48
+ // create selector for plugin
49
+ $.expr[ ":" ][ fullName ] = function( elem ) {
50
+ return !!$.data( elem, name );
51
+ };
52
+
53
+ $[ namespace ] = $[ namespace ] || {};
54
+ $[ namespace ][ name ] = function( options, element ) {
55
+ // allow instantiation without initializing for simple inheritance
56
+ if ( arguments.length ) {
57
+ this._createWidget( options, element );
58
+ }
59
+ };
60
+
61
+ var basePrototype = new base();
62
+ // we need to make the options hash a property directly on the new instance
63
+ // otherwise we'll modify the options hash on the prototype that we're
64
+ // inheriting from
65
+ // $.each( basePrototype, function( key, val ) {
66
+ // if ( $.isPlainObject(val) ) {
67
+ // basePrototype[ key ] = $.extend( {}, val );
68
+ // }
69
+ // });
70
+ basePrototype.options = $.extend( true, {}, basePrototype.options );
71
+ $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
72
+ namespace: namespace,
73
+ widgetName: name,
74
+ widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
75
+ widgetBaseClass: fullName
76
+ }, prototype );
77
+
78
+ $.widget.bridge( name, $[ namespace ][ name ] );
79
+ };
80
+
81
+ $.widget.bridge = function( name, object ) {
82
+ $.fn[ name ] = function( options ) {
83
+ var isMethodCall = typeof options === "string",
84
+ args = Array.prototype.slice.call( arguments, 1 ),
85
+ returnValue = this;
86
+
87
+ // allow multiple hashes to be passed on init
88
+ options = !isMethodCall && args.length ?
89
+ $.extend.apply( null, [ true, options ].concat(args) ) :
90
+ options;
91
+
92
+ // prevent calls to internal methods
93
+ if ( isMethodCall && options.charAt( 0 ) === "_" ) {
94
+ return returnValue;
95
+ }
96
+
97
+ if ( isMethodCall ) {
98
+ this.each(function() {
99
+ var instance = $.data( this, name ),
100
+ methodValue = instance && $.isFunction( instance[options] ) ?
101
+ instance[ options ].apply( instance, args ) :
102
+ instance;
103
+ // TODO: add this back in 1.9 and use $.error() (see #5972)
104
+ // if ( !instance ) {
105
+ // throw "cannot call methods on " + name + " prior to initialization; " +
106
+ // "attempted to call method '" + options + "'";
107
+ // }
108
+ // if ( !$.isFunction( instance[options] ) ) {
109
+ // throw "no such method '" + options + "' for " + name + " widget instance";
110
+ // }
111
+ // var methodValue = instance[ options ].apply( instance, args );
112
+ if ( methodValue !== instance && methodValue !== undefined ) {
113
+ returnValue = methodValue;
114
+ return false;
115
+ }
116
+ });
117
+ } else {
118
+ this.each(function() {
119
+ var instance = $.data( this, name );
120
+ if ( instance ) {
121
+ instance.option( options || {} )._init();
122
+ } else {
123
+ $.data( this, name, new object( options, this ) );
124
+ }
125
+ });
126
+ }
127
+
128
+ return returnValue;
129
+ };
130
+ };
131
+
132
+ $.Widget = function( options, element ) {
133
+ // allow instantiation without initializing for simple inheritance
134
+ if ( arguments.length ) {
135
+ this._createWidget( options, element );
136
+ }
137
+ };
138
+
139
+ $.Widget.prototype = {
140
+ widgetName: "widget",
141
+ widgetEventPrefix: "",
142
+ options: {
143
+ disabled: false
144
+ },
145
+ _createWidget: function( options, element ) {
146
+ // $.widget.bridge stores the plugin instance, but we do it anyway
147
+ // so that it's stored even before the _create function runs
148
+ $.data( element, this.widgetName, this );
149
+ this.element = $( element );
150
+ this.options = $.extend( true, {},
151
+ this.options,
152
+ this._getCreateOptions(),
153
+ options );
154
+
155
+ var self = this;
156
+ this.element.bind( "remove." + this.widgetName, function() {
157
+ self.destroy();
158
+ });
159
+
160
+ this._create();
161
+ this._trigger( "create" );
162
+ this._init();
163
+ },
164
+ _getCreateOptions: function() {
165
+ return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
166
+ },
167
+ _create: function() {},
168
+ _init: function() {},
169
+
170
+ destroy: function() {
171
+ this.element
172
+ .unbind( "." + this.widgetName )
173
+ .removeData( this.widgetName );
174
+ this.widget()
175
+ .unbind( "." + this.widgetName )
176
+ .removeAttr( "aria-disabled" )
177
+ .removeClass(
178
+ this.widgetBaseClass + "-disabled " +
179
+ "ui-state-disabled" );
180
+ },
181
+
182
+ widget: function() {
183
+ return this.element;
184
+ },
185
+
186
+ option: function( key, value ) {
187
+ var options = key;
188
+
189
+ if ( arguments.length === 0 ) {
190
+ // don't return a reference to the internal hash
191
+ return $.extend( {}, this.options );
192
+ }
193
+
194
+ if (typeof key === "string" ) {
195
+ if ( value === undefined ) {
196
+ return this.options[ key ];
197
+ }
198
+ options = {};
199
+ options[ key ] = value;
200
+ }
201
+
202
+ this._setOptions( options );
203
+
204
+ return this;
205
+ },
206
+ _setOptions: function( options ) {
207
+ var self = this;
208
+ $.each( options, function( key, value ) {
209
+ self._setOption( key, value );
210
+ });
211
+
212
+ return this;
213
+ },
214
+ _setOption: function( key, value ) {
215
+ this.options[ key ] = value;
216
+
217
+ if ( key === "disabled" ) {
218
+ this.widget()
219
+ [ value ? "addClass" : "removeClass"](
220
+ this.widgetBaseClass + "-disabled" + " " +
221
+ "ui-state-disabled" )
222
+ .attr( "aria-disabled", value );
223
+ }
224
+
225
+ return this;
226
+ },
227
+
228
+ enable: function() {
229
+ return this._setOption( "disabled", false );
230
+ },
231
+ disable: function() {
232
+ return this._setOption( "disabled", true );
233
+ },
234
+
235
+ _trigger: function( type, event, data ) {
236
+ var callback = this.options[ type ];
237
+
238
+ event = $.Event( event );
239
+ event.type = ( type === this.widgetEventPrefix ?
240
+ type :
241
+ this.widgetEventPrefix + type ).toLowerCase();
242
+ data = data || {};
243
+
244
+ // copy original event properties over to the new event
245
+ // this would happen if we could call $.event.fix instead of $.Event
246
+ // but we don't have a way to force an event to be fixed multiple times
247
+ if ( event.originalEvent ) {
248
+ for ( var i = $.event.props.length, prop; i; ) {
249
+ prop = $.event.props[ --i ];
250
+ event[ prop ] = event.originalEvent[ prop ];
251
+ }
252
+ }
253
+
254
+ this.element.trigger( event, data );
255
+
256
+ return !( $.isFunction(callback) &&
257
+ callback.call( this.element[0], event, data ) === false ||
258
+ event.isDefaultPrevented() );
259
+ }
260
+ };
261
+
262
+ })( jQuery );
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: sksmatt
3
  Donate link: http://www.mattvarone.com
4
  Tags: Dynamic, UI, Scroll, To top, Automatic, Enhance, UX
5
- Requires at least: 2.5
6
- Tested up to: 3.1.2
7
- Stable tag: 3.1.4
8
 
9
  Adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
10
 
@@ -17,14 +17,14 @@ It features an intuitive control panel to style and adjust to each website's nee
17
  * Image and text version supported.
18
  * Options panel to style as desired.
19
  * CSS3 created button and hover effect with decent degradation for older browsers.
20
- * Custom created CSS and Javascript assets.
21
- * Caches assets for better performance.
22
  * Ready for internationalization.
23
  * Uninstall included.
24
 
25
  == Installation ==
26
 
27
- 1. Unzip files
28
  2. Upload "dynamic-to-top" folder into your plugins directory.
29
  3. Activate the plugin.
30
  4. Configure settings to your needs.
@@ -37,37 +37,42 @@ It features an intuitive control panel to style and adjust to each website's nee
37
  3. Dynamic To Top settings page on button mode.
38
  4. Dynamic To Top settings page on text mode.
39
 
40
- == Changelog ==
41
 
 
 
 
 
 
42
 
43
  = 3.1.4 =
44
- * Fixes JS problem on 3.1.1 to 3.1.3
45
 
46
  = 3.1.3 =
47
- * Code improvements
48
- * Fixes Options problem
49
 
50
  = 3.1.2 =
51
- * Fixed default settings
52
- * Code improvements
53
 
54
  = 3.1.1 =
55
- * Added Uninstall
56
- * Code improvements
57
 
58
  = 3.1 =
59
- * Fixes Permissions Problem
60
- * Code Improvements
61
 
62
  = 3.0 =
63
- * Rewritten from scratch. Using CSS3. More/better options.
64
 
65
  = 2.1 =
66
  * Bug fixing
67
- * Code Improvements
68
 
69
  = 2.0 =
70
- * Settings panel added
71
 
72
  = 1.0 =
73
- * First version out
2
  Contributors: sksmatt
3
  Donate link: http://www.mattvarone.com
4
  Tags: Dynamic, UI, Scroll, To top, Automatic, Enhance, UX
5
+ Requires at least: 3.0
6
+ Tested up to: 3.1.4
7
+ Stable tag: 3.1.5
8
 
9
  Adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
10
 
17
  * Image and text version supported.
18
  * Options panel to style as desired.
19
  * CSS3 created button and hover effect with decent degradation for older browsers.
20
+ * Custom generated CSS and Javascript assets.
21
+ * Caches and minify CSS for better performance.
22
  * Ready for internationalization.
23
  * Uninstall included.
24
 
25
  == Installation ==
26
 
27
+ 1. Unzip files.
28
  2. Upload "dynamic-to-top" folder into your plugins directory.
29
  3. Activate the plugin.
30
  4. Configure settings to your needs.
37
  3. Dynamic To Top settings page on button mode.
38
  4. Dynamic To Top settings page on text mode.
39
 
40
+ == Change log ==
41
 
42
+ = 3.1.5 =
43
+ * JS performance improved with wp_localize_script();
44
+ * CSS performance improved.
45
+ * Added uninstall.
46
+ * Code improvements.
47
 
48
  = 3.1.4 =
49
+ * Fixes JS problem on 3.1.1 to 3.1.3.
50
 
51
  = 3.1.3 =
52
+ * Code improvements.
53
+ * Fixes Options problem.
54
 
55
  = 3.1.2 =
56
+ * Fixed default settings.
57
+ * Code improvements.
58
 
59
  = 3.1.1 =
60
+ * Added Uninstall.
61
+ * Code improvements.
62
 
63
  = 3.1 =
64
+ * Fixes Permissions Problem.
65
+ * Code Improvements.
66
 
67
  = 3.0 =
68
+ * Rewritten from scratch. Using CSS3. More and better options.
69
 
70
  = 2.1 =
71
  * Bug fixing
72
+ * Code Improvements.
73
 
74
  = 2.0 =
75
+ * Settings panel added.
76
 
77
  = 1.0 =
78
+ * First version out.