Version Description
Download this release
Release Info
Developer | sksmatt |
Plugin | Dynamic "To Top" Plugin |
Version | 3.0 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 3.0
- css/dynamic-to-top-admin.css +433 -0
- css/dynamic-to-top-css.php +28 -0
- css/images/pat4.gif +0 -0
- css/images/picker.png +0 -0
- css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- css/images/ui-icons_222222_256x240.png +0 -0
- css/images/ui-icons_2e83ff_256x240.png +0 -0
- css/images/ui-icons_454545_256x240.png +0 -0
- css/images/ui-icons_888888_256x240.png +0 -0
- css/images/ui-icons_cd0a0a_256x240.png +0 -0
- css/images/up.png +0 -0
- css/img/ui.totop.png +0 -0
- css/ui.totop.css +0 -30
- css/ui.totop.text.css +0 -18
- dynamic-to-top.php +34 -148
- inc/dynamic-to-top-class.php +661 -0
- inc/dynamic-to-top-options.php +772 -0
- js/dynamic-to-top-js.php +28 -0
- js/dynamic.to.top.settings.js +328 -0
- js/jquery.easing.1.3.js +0 -205
- js/jquery.ui.totop.js +0 -62
- readme.txt +14 -7
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
css/dynamic-to-top-admin.css
ADDED
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 {
|
318 |
+
float: left;
|
319 |
+
margin-right: 10px;
|
320 |
+
}
|
321 |
+
|
322 |
+
div.desc {
|
323 |
+
display:block;
|
324 |
+
clear:both;
|
325 |
+
}
|
326 |
+
|
327 |
+
.ddt-bg-colors {
|
328 |
+
margin-left:10px;
|
329 |
+
}
|
330 |
+
|
331 |
+
.ddt-bg-colors:hover,.picker:hover {
|
332 |
+
cursor:pointer;
|
333 |
+
}
|
334 |
+
|
335 |
+
#dynamic-to-top-preview {
|
336 |
+
overflow:hidden;
|
337 |
+
display:block;
|
338 |
+
margin-left:10px;
|
339 |
+
width:39.35em;
|
340 |
+
border:1px solid #b3b3b3;
|
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 |
+
|
348 |
+
#dynamic-to-top-button {
|
349 |
+
position:absolute;
|
350 |
+
display:block;
|
351 |
+
width:auto;
|
352 |
+
overflow:hidden;
|
353 |
+
-webkit-background-origin:border;
|
354 |
+
-moz-background-origin:border;
|
355 |
+
-icab-background-origin:border;
|
356 |
+
-o-background-origin:border;
|
357 |
+
-khtml-background-origin:border;
|
358 |
+
-ms-background-origin:border;
|
359 |
+
background-origin:border;
|
360 |
+
-webkit-background-clip:padding-box;
|
361 |
+
-moz-background-clip:padding-box;
|
362 |
+
-icab-background-clip:padding-box;
|
363 |
+
-khtml-background-clip:padding-box;
|
364 |
+
-o-background-clip:padding-box;
|
365 |
+
-ms-background-clip:padding-box;
|
366 |
+
background-clip:padding-box;
|
367 |
+
font-family: sans-serif;
|
368 |
+
}
|
369 |
+
|
370 |
+
#dynamic-to-top-button span#dtt-text {
|
371 |
+
display:none;
|
372 |
+
}
|
373 |
+
|
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);
|
384 |
+
-moz-box-shadow:0 1px 3px rgba(0,0,0,0.4);
|
385 |
+
-o-box-shadow:0 1px 3px rgba(0,0,0,0.4);
|
386 |
+
-khtml-box-shadow:0 1px 3px rgba(0,0,0,0.4);
|
387 |
+
-icab-box-shadow:0 1px 3px rgba(0,0,0,0.4);
|
388 |
+
-ms-box-shadow:0 1px 3px rgba(0,0,0,0.4);
|
389 |
+
box-shadow:0 1px 3px rgba(0,0,0,0.4);
|
390 |
+
}
|
391 |
+
|
392 |
+
.dynamic-to-top-inset {
|
393 |
+
-webkit-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
394 |
+
-moz-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
395 |
+
-o-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
396 |
+
-khtml-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
397 |
+
-icab-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
398 |
+
-ms-box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
399 |
+
box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
400 |
+
}
|
401 |
+
|
402 |
+
#dynamic-to-top-button.dynamic-to-top-shadow.dynamic-to-top-inset {
|
403 |
+
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
404 |
+
-moz-box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
405 |
+
-o-box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
406 |
+
-khtml-box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
407 |
+
-icab-box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
408 |
+
-ms-box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
409 |
+
box-shadow:0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1);
|
410 |
+
}
|
411 |
+
|
412 |
+
#dynamic-to-top-button:hover {
|
413 |
+
background: -webkit-gradient( linear, 0% 0%, 0% 100%, from(rgba(255,255,255,.2)),to(rgba(0,0,0,0)));
|
414 |
+
background: -webkit-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
415 |
+
background: -moz-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
416 |
+
background: -o-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
417 |
+
background: -icab-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
418 |
+
background: -ms-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
419 |
+
background: linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
420 |
+
cursor:pointer;
|
421 |
+
}
|
422 |
+
|
423 |
+
#dynamic-to-top-button:active {
|
424 |
+
background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(0,0,0,.3)), to(rgba(0,0,0,0)));
|
425 |
+
background:-webkit-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
426 |
+
background:-moz-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
427 |
+
background:-o-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
428 |
+
background:-icab-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
429 |
+
background:-ms-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
430 |
+
background:-khtml-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
431 |
+
background:linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
432 |
+
|
433 |
+
}
|
css/dynamic-to-top-css.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dynamic To Top CSS
|
4 |
+
*
|
5 |
+
* @package Dynamic To Top
|
6 |
+
* @author Matt Varone
|
7 |
+
*/
|
8 |
+
|
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();
|
24 |
+
|
25 |
+
$OBJ_dynamic_to_top = new Dynamic_To_Top();
|
26 |
+
}
|
27 |
+
|
28 |
+
echo $OBJ_dynamic_to_top->get_css();
|
css/images/pat4.gif
ADDED
Binary file
|
css/images/picker.png
ADDED
Binary file
|
css/images/ui-bg_flat_0_aaaaaa_40x100.png
ADDED
Binary file
|
css/images/ui-bg_flat_75_ffffff_40x100.png
ADDED
Binary file
|
css/images/ui-bg_glass_55_fbf9ee_1x400.png
ADDED
Binary file
|
css/images/ui-bg_glass_65_ffffff_1x400.png
ADDED
Binary file
|
css/images/ui-bg_glass_75_dadada_1x400.png
ADDED
Binary file
|
css/images/ui-bg_glass_75_e6e6e6_1x400.png
ADDED
Binary file
|
css/images/ui-bg_glass_95_fef1ec_1x400.png
ADDED
Binary file
|
css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
ADDED
Binary file
|
css/images/ui-icons_222222_256x240.png
ADDED
Binary file
|
css/images/ui-icons_2e83ff_256x240.png
ADDED
Binary file
|
css/images/ui-icons_454545_256x240.png
ADDED
Binary file
|
css/images/ui-icons_888888_256x240.png
ADDED
Binary file
|
css/images/ui-icons_cd0a0a_256x240.png
ADDED
Binary file
|
css/images/up.png
ADDED
Binary file
|
css/img/ui.totop.png
DELETED
Binary file
|
css/ui.totop.css
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
#toTop {
|
2 |
-
display:none;
|
3 |
-
text-decoration:none;
|
4 |
-
position:fixed;
|
5 |
-
bottom:10px;
|
6 |
-
right:10px;
|
7 |
-
overflow:hidden;
|
8 |
-
width:51px;
|
9 |
-
height:51px;
|
10 |
-
border:none;
|
11 |
-
text-indent:-999px;
|
12 |
-
background:url(img/ui.totop.png) no-repeat left top
|
13 |
-
}
|
14 |
-
|
15 |
-
#toTopHover {
|
16 |
-
background:url(img/ui.totop.png) no-repeat left -51px;
|
17 |
-
width:51px;
|
18 |
-
height:51px;
|
19 |
-
display:block;
|
20 |
-
overflow:hidden;
|
21 |
-
float:left;
|
22 |
-
opacity: 0;
|
23 |
-
-moz-opacity: 0;
|
24 |
-
filter:alpha(opacity=0)
|
25 |
-
}
|
26 |
-
|
27 |
-
#toTop:active, #toTop:focus
|
28 |
-
{
|
29 |
-
outline:none
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/ui.totop.text.css
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
#toTop {
|
2 |
-
display:none;
|
3 |
-
text-decoration:none;
|
4 |
-
position:fixed;
|
5 |
-
bottom:10px;
|
6 |
-
right:10px;
|
7 |
-
overflow:hidden;
|
8 |
-
border:1px solid #000;
|
9 |
-
padding:5px 15px;
|
10 |
-
background:#111;
|
11 |
-
color:white
|
12 |
-
}
|
13 |
-
|
14 |
-
|
15 |
-
#toTop:active, #toTop:focus
|
16 |
-
{
|
17 |
-
outline:none
|
18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dynamic-to-top.php
CHANGED
@@ -1,164 +1,50 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Dynamic To Top
|
|
|
4 |
Plugin URI: http://www.mattvarone.com
|
5 |
Description: Adds an automatic and dynamic "To Top" button to scroll long pages back to the top.
|
6 |
Author: Matt Varone
|
7 |
-
Version: 2.1
|
8 |
Author URI: http://www.mattvarone.com
|
9 |
*/
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
21 |
-
if ( !defined( 'WP_PLUGIN_URL' ) )
|
22 |
-
define('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
|
23 |
-
if ( !defined( 'WP_PLUGIN_DIR' ) )
|
24 |
-
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
if (empty($options_db))
|
33 |
-
update_option('dynamic_to_top', $this->options);
|
34 |
-
|
35 |
-
}
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
function options_page()
|
43 |
-
{
|
44 |
-
$option = get_option('dynamic_to_top');
|
45 |
-
?>
|
46 |
-
<div class="wrap">
|
47 |
-
<div id="icon-options-general" class="icon32"><br /></div>
|
48 |
-
<h2>Dynamic To Top Settings</h2>
|
49 |
-
|
50 |
-
<p>Welcome to the Dynamic To Top 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. <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5061646" title="Donations are welcome" target="_blank">Donations are welcome</a>.</p>
|
51 |
-
|
52 |
-
<form method="post" action="options-general.php?page=dynamic_to_top">
|
53 |
-
|
54 |
-
<table class="form-table">
|
55 |
-
<tr valign="top">
|
56 |
-
<th scope="row"><label><strong>Scroll Time</strong> <small>( miliseconds )</small></label></th>
|
57 |
-
<td><input type="text" value="<?php echo $option['speed']; ?>" name="dynamic_to_top[speed]" class="regular-text" /></td>
|
58 |
-
</tr>
|
59 |
-
<tr valign="top">
|
60 |
-
<th scope="row"><label><strong>Fade-in distance</strong> <small>( pixels )</small></label></th>
|
61 |
-
<td><input type="text" value="<?php echo $option['distance']; ?>" name="dynamic_to_top[distance]" class="regular-text" /></td>
|
62 |
-
</tr>
|
63 |
-
<tr valign="top">
|
64 |
-
<th scope="row"><label><strong>Easing</strong></label></th>
|
65 |
-
<td><select name="dynamic_to_top[easing]">
|
66 |
-
<?php
|
67 |
-
|
68 |
-
$easing_types = array( 'linear', 'easeInQuad', 'easeOutQuad', 'easeInOutQuad', 'easeInExpo', 'easeOutExpo', 'easeInOutExpo', 'easeInBack', 'easeOutBack', 'easeInOutBack' );
|
69 |
-
foreach ( $easing_types as $type )
|
70 |
-
{
|
71 |
-
$selected = "";
|
72 |
-
if ( $option['easing'] == $type) $selected = 'selected="selected"';
|
73 |
-
|
74 |
-
echo '<option value="'.$type.'" '.$selected.' >'.$type.'</option>';
|
75 |
-
|
76 |
-
}
|
77 |
-
?>
|
78 |
-
</select></td>
|
79 |
-
</tr>
|
80 |
-
<tr valign="top">
|
81 |
-
<th scope="row"><label><strong>Text version</strong></label></th>
|
82 |
-
<td><input type="checkbox" value="yes" name="dynamic_to_top[text_version]" <?php if ( $option['text_version'] == 'yes' ) echo 'checked="checked"'; ?> />
|
83 |
-
</td>
|
84 |
-
</tr>
|
85 |
-
<tr valign="top">
|
86 |
-
<th scope="row"><label><strong>Button Text</strong></label></th>
|
87 |
-
<td><input type="text" value="<?php echo $option['text']; ?>" name="dynamic_to_top[text]" class="regular-text" /></td>
|
88 |
-
</tr>
|
89 |
-
</table>
|
90 |
-
|
91 |
-
<p class="submit">
|
92 |
-
<input type="submit" name="Submit" class="button-primary" value="Save Changes" />
|
93 |
-
</p>
|
94 |
-
</form>
|
95 |
-
|
96 |
-
<p><small><strong>Dynamic To Top plugin</strong> brought to you by <a href="http://www.mattvarone.com" title="Matt Varone" target="_blank"><strong>Matt Varone</strong></a>.</small>
|
97 |
-
</p>
|
98 |
-
</div>
|
99 |
-
<?php
|
100 |
-
}
|
101 |
-
|
102 |
-
function print_js()
|
103 |
-
{
|
104 |
-
$option = get_option("dynamic_to_top");
|
105 |
-
$out = "<script type=\"text/javascript\">jQuery().ready(function() { jQuery('body').UItoTop({ text: '".$option['text']."', min: ".$option['distance'].", scrollSpeed: ".$option['speed'].", easingType: '".$option['easing']."'}); });</script>\n";
|
106 |
-
echo $out;
|
107 |
-
}
|
108 |
|
109 |
-
|
110 |
-
{
|
111 |
-
|
112 |
-
$option_values = array();
|
113 |
-
|
114 |
-
foreach ( $this->options as $option_name => $option_value )
|
115 |
-
{
|
116 |
-
|
117 |
-
if ($data[$option_name] == '')
|
118 |
-
{
|
119 |
-
if ( $option_name == 'text_version' )
|
120 |
-
$option_values['text_version'] = "no";
|
121 |
-
continue;
|
122 |
-
}
|
123 |
-
else { $option_values[$option_name] = $data[$option_name]; }
|
124 |
-
}
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
}
|
133 |
-
|
134 |
-
$dynamic_to_top = new DynamicToTop();
|
135 |
|
136 |
-
if (
|
|
|
|
|
|
|
137 |
|
138 |
-
|
139 |
-
{
|
140 |
-
|
141 |
-
$option = get_option("dynamic_to_top");
|
142 |
-
|
143 |
-
if ( trim($option['text_version']) == "yes")
|
144 |
-
wp_enqueue_style( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/css/ui.totop.text.css', false, 1.0, 'all' );
|
145 |
-
else
|
146 |
-
wp_enqueue_style( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/css/ui.totop.css', false, 1.0, 'all' );
|
147 |
-
|
148 |
-
wp_enqueue_script( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/js/jquery.ui.totop.js', array('jquery'), 1.1, true );
|
149 |
-
|
150 |
-
if ( $option['easing'] != "linear")
|
151 |
-
wp_enqueue_script( 'jquery-easing', DYNAMIC_TO_TOP_URL . '/js/jquery.easing.1.3.js', array('jquery'), 1.3, true );
|
152 |
-
|
153 |
-
add_action('wp_footer', array($dynamic_to_top,'print_js'));
|
154 |
-
|
155 |
-
}
|
156 |
-
|
157 |
-
add_action('admin_menu', array($dynamic_to_top,'create_menu'));
|
158 |
-
|
159 |
-
if (isset($_POST['dynamic_to_top'])) {
|
160 |
-
$dynamic_to_top->save_settings($_POST['dynamic_to_top']);
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Dynamic To Top
|
4 |
+
Version: 3.0
|
5 |
Plugin URI: http://www.mattvarone.com
|
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 |
+
/**
|
12 |
+
* Dynamic To Top Initialize
|
13 |
+
*
|
14 |
+
* @package Dynamic To Top
|
15 |
+
* @author Matt Varone
|
16 |
+
*/
|
17 |
|
18 |
+
/*
|
19 |
+
|--------------------------------------------------------------------------
|
20 |
+
| DYNAMIC TO TOP CONSTANTS
|
21 |
+
|--------------------------------------------------------------------------
|
22 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
23 |
|
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.0');
|
28 |
+
define('DYNAMIC_TO_TOP_FOLDER', '/'.basename(dirname(__FILE__)));
|
29 |
+
define('DYNAMIC_TO_TOP_DOMAIN', 'dynamic-to-top');
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
/*
|
32 |
+
|--------------------------------------------------------------------------
|
33 |
+
| DYNAMIC TO TOP INTERNALIZATION
|
34 |
+
|--------------------------------------------------------------------------
|
35 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
load_plugin_textdomain( DYNAMIC_TO_TOP_DOMAIN, false, DYNAMIC_TO_TOP_FOLDER.'/lan' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
+
/*
|
40 |
+
|--------------------------------------------------------------------------
|
41 |
+
| DYNAMIC TO TOP INCLUDES
|
42 |
+
|--------------------------------------------------------------------------
|
43 |
+
*/
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
if (is_admin())
|
46 |
+
require_once(DYNAMIC_TO_TOP_PATH.'inc/dynamic-to-top-options.php');
|
47 |
+
else
|
48 |
+
require_once(DYNAMIC_TO_TOP_PATH.'inc/dynamic-to-top-class.php');
|
49 |
|
50 |
+
// free willy!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/dynamic-to-top-class.php
ADDED
@@ -0,0 +1,661 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dynamic To Top Class
|
4 |
+
*
|
5 |
+
* @package Dynamic To Top
|
6 |
+
* @author Matt Varone
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !class_exists('Dynamic_To_Top'))
|
10 |
+
{
|
11 |
+
|
12 |
+
class Dynamic_To_Top
|
13 |
+
{
|
14 |
+
public $options;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Dynamic To Top
|
18 |
+
*
|
19 |
+
* Construct class. calls for options and assets.
|
20 |
+
*
|
21 |
+
* @package Dynamic To Top
|
22 |
+
* @subpackage Main Class
|
23 |
+
* @since 3.0
|
24 |
+
*
|
25 |
+
*/
|
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();
|
35 |
+
}
|
36 |
+
|
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' => 'ease-in',
|
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 |
+
/**
|
95 |
+
* Enqueue Assets
|
96 |
+
*
|
97 |
+
* Adds JS and CSS assets actions.
|
98 |
+
* Checks if its needed to prevent on mobile browsers.
|
99 |
+
*
|
100 |
+
* @package Dynamic To Top
|
101 |
+
* @subpackage Main Class
|
102 |
+
* @since 3.0
|
103 |
+
*/
|
104 |
+
|
105 |
+
function enqueue_assets()
|
106 |
+
{
|
107 |
+
if ( $this->is_checked('prevent_on_mobile') )
|
108 |
+
{
|
109 |
+
if ( $this->is_mobile() )
|
110 |
+
return false;
|
111 |
+
}
|
112 |
+
|
113 |
+
add_action('wp_print_styles', array(&$this,'enqueue_style'));
|
114 |
+
add_action('wp_print_scripts', array(&$this,'enqueue_script'));
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Enqueue Style
|
119 |
+
*
|
120 |
+
* @package Dynamic To Top
|
121 |
+
* @subpackage Main Class
|
122 |
+
* @since 3.0
|
123 |
+
*/
|
124 |
+
|
125 |
+
function enqueue_style()
|
126 |
+
{
|
127 |
+
wp_enqueue_style( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/css/dynamic-to-top-css.php', false, DYNAMIC_TO_TOP_VERSION, 'all' );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Enqueue Script
|
132 |
+
*
|
133 |
+
* @package Dynamic To Top
|
134 |
+
* @subpackage Main Class
|
135 |
+
* @since 3.0
|
136 |
+
*/
|
137 |
+
|
138 |
+
function enqueue_script()
|
139 |
+
{
|
140 |
+
wp_enqueue_script( 'dynamic-to-top', DYNAMIC_TO_TOP_URL . '/js/dynamic-to-top-js.php', array('jquery'), DYNAMIC_TO_TOP_VERSION, true );
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Get CSS
|
145 |
+
*
|
146 |
+
* Returns CSS declarations.
|
147 |
+
* Checks for transient CSS or generates and set new.
|
148 |
+
*
|
149 |
+
* @package Dynamic To Top
|
150 |
+
* @subpackage Main Class
|
151 |
+
* @since 3.0
|
152 |
+
* @return string $css css Declarations.
|
153 |
+
*/
|
154 |
+
|
155 |
+
function get_css($css="")
|
156 |
+
{
|
157 |
+
$css = get_transient('dynamic_to_top_transient_css');
|
158 |
+
|
159 |
+
if ($css)
|
160 |
+
return $css;
|
161 |
+
|
162 |
+
$css = $this->generate_custom_css();
|
163 |
+
|
164 |
+
set_transient('dynamic_to_top_transient_css',$css,60*60*24*90);
|
165 |
+
|
166 |
+
return $css;
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Get JS
|
171 |
+
*
|
172 |
+
* Returns JS declarations.
|
173 |
+
* Checks for transient JS or generates and set new.
|
174 |
+
*
|
175 |
+
* @package Dynamic To Top
|
176 |
+
* @subpackage Main Class
|
177 |
+
* @since 3.0
|
178 |
+
* @return string $js JS scripts.
|
179 |
+
*/
|
180 |
+
|
181 |
+
function get_js($js="")
|
182 |
+
{
|
183 |
+
$js = get_transient('dynamic_to_top_transient_js');
|
184 |
+
|
185 |
+
if ($js)
|
186 |
+
return $js;
|
187 |
+
|
188 |
+
$js = $this->generate_custom_js();
|
189 |
+
|
190 |
+
set_transient('dynamic_to_top_transient_js',$js,60*60*24*90);
|
191 |
+
|
192 |
+
return $js;
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Is Checked
|
197 |
+
*
|
198 |
+
* Conditional method to validate checked options.
|
199 |
+
*
|
200 |
+
* @package Dynamic To Top
|
201 |
+
* @subpackage Main Class
|
202 |
+
* @since 3.0
|
203 |
+
* @param string $option Option name.
|
204 |
+
* @param string $against String to match option.
|
205 |
+
* @return boolean
|
206 |
+
*/
|
207 |
+
|
208 |
+
function is_checked($option="",$against="yes")
|
209 |
+
{
|
210 |
+
if ($option == "")
|
211 |
+
return false;
|
212 |
+
|
213 |
+
if (!isset($this->options[$option]))
|
214 |
+
return false;
|
215 |
+
|
216 |
+
if ($against == "")
|
217 |
+
return true;
|
218 |
+
else {
|
219 |
+
if ($this->options[$option] == $against)
|
220 |
+
return true;
|
221 |
+
else
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Get Easing Type
|
228 |
+
*
|
229 |
+
* Returns the easing type function name.
|
230 |
+
* Used on the JS script.
|
231 |
+
*
|
232 |
+
* @package Dynamic To Top
|
233 |
+
* @subpackage Main Class
|
234 |
+
* @since 3.0
|
235 |
+
* @return string $easing Name of easing function.
|
236 |
+
*/
|
237 |
+
|
238 |
+
function get_easing_type($easing="linear")
|
239 |
+
{
|
240 |
+
switch ($this->options['easing'])
|
241 |
+
{
|
242 |
+
case 'Bounce':
|
243 |
+
$easing = "easeOutBounce";
|
244 |
+
break;
|
245 |
+
|
246 |
+
case 'Elastic':
|
247 |
+
$easing = "easeInElastic";
|
248 |
+
break;
|
249 |
+
|
250 |
+
case 'In Out':
|
251 |
+
$easing = "easeInOutExpo";
|
252 |
+
break;
|
253 |
+
|
254 |
+
case 'In':
|
255 |
+
$easing = "easeInExpo";
|
256 |
+
break;
|
257 |
+
|
258 |
+
case 'Out':
|
259 |
+
$easing = "easeOutExpo";
|
260 |
+
break;
|
261 |
+
}
|
262 |
+
return $easing;
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Get Position
|
267 |
+
*
|
268 |
+
* Returns CSS properties for the selected position.
|
269 |
+
* Used on the CSS style.
|
270 |
+
*
|
271 |
+
* @package Dynamic To Top
|
272 |
+
* @subpackage Main Class
|
273 |
+
* @since 3.0
|
274 |
+
* @return string $position Properties of the position selected.
|
275 |
+
*/
|
276 |
+
|
277 |
+
function get_position($position="")
|
278 |
+
{
|
279 |
+
|
280 |
+
if (!isset($this->options['margin']))
|
281 |
+
$this->options['margin'] = 20;
|
282 |
+
|
283 |
+
switch ($this->options['position'])
|
284 |
+
{
|
285 |
+
case 'Bottom Right':
|
286 |
+
$position = "bottom:".$this->options['margin']."px;right:".$this->options['margin']."px;top:auto;left:auto;";
|
287 |
+
break;
|
288 |
+
|
289 |
+
case 'Bottom Left':
|
290 |
+
$position = "bottom:".$this->options['margin']."px;left:".$this->options['margin']."px;top:auto;right:auto;";
|
291 |
+
break;
|
292 |
+
|
293 |
+
case 'Top Right':
|
294 |
+
$position = "top:".$this->options['margin']."px;right:".$this->options['margin']."px;bottom:auto;left:auto;";
|
295 |
+
break;
|
296 |
+
|
297 |
+
case 'Top Left':
|
298 |
+
$position = "top:".$this->options['margin']."px;left:".$this->options['margin']."px;bottom:auto;right:auto;";
|
299 |
+
break;
|
300 |
+
}
|
301 |
+
|
302 |
+
return $position;
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Generate Custom CSS
|
307 |
+
*
|
308 |
+
* Returns Dynamic To Top custom CSS styles.
|
309 |
+
*
|
310 |
+
* @package Dynamic To Top
|
311 |
+
* @subpackage Main Class
|
312 |
+
* @since 3.0
|
313 |
+
* @return string $css CSS declarations.
|
314 |
+
*/
|
315 |
+
|
316 |
+
function generate_custom_css($css="")
|
317 |
+
{
|
318 |
+
|
319 |
+
$css .= "/* Dynamic To Top Plugin ver. ".DYNAMIC_TO_TOP_VERSION." - http://www.mattvarone.com */\n\n";
|
320 |
+
|
321 |
+
$css .= "#dynamic-to-top {
|
322 |
+
|
323 |
+
display:none;
|
324 |
+
overflow:hidden;
|
325 |
+
width:auto;
|
326 |
+
|
327 |
+
position:fixed;
|
328 |
+
".$this->get_position()."
|
329 |
+
|
330 |
+
font-family: sans-serif;
|
331 |
+
font-size:".$this->options['font_size']."em;
|
332 |
+
color:".$this->options['text_color'].";
|
333 |
+
text-decoration:none;\n";
|
334 |
+
|
335 |
+
if ( $this->is_checked('text_shadow') )
|
336 |
+
$css .= "text-shadow:0 1px 0 ".$this->options['shadow_color'].";\n";
|
337 |
+
|
338 |
+
if ( $this->is_checked('bold') )
|
339 |
+
$css .="font-weight:bold;\n";
|
340 |
+
|
341 |
+
$css.= "padding:".$this->options['padding_top_bottom']."px ".$this->options['padding_left_right']."px;
|
342 |
+
border:".$this->options['border_width']."px solid ".$this->options['border_color'].";
|
343 |
+
background:".$this->options['background_color'].";
|
344 |
+
|
345 |
+
-webkit-background-origin:border;
|
346 |
+
-moz-background-origin:border;
|
347 |
+
-icab-background-origin:border;
|
348 |
+
-khtml-background-origin:border;
|
349 |
+
-o-background-origin:border;
|
350 |
+
background-origin:border;
|
351 |
+
|
352 |
+
-webkit-background-clip:padding-box;
|
353 |
+
-moz-background-clip:padding-box;
|
354 |
+
-icab-background-clip:padding-box;
|
355 |
+
-khtml-background-clip:padding-box;
|
356 |
+
-o-background-clip:padding-box;
|
357 |
+
background-clip:padding-box;\n";
|
358 |
+
|
359 |
+
$box_shadow = "";
|
360 |
+
|
361 |
+
if ( $this->is_checked('shadow'))
|
362 |
+
$box_shadow .= "0 1px 3px rgba(0,0,0,0.4)";
|
363 |
+
|
364 |
+
if ( $this->is_checked('inset') ) {
|
365 |
+
if ( $box_shadow != "") $box_shadow = $box_shadow.",";
|
366 |
+
$box_shadow .= "inset 0 0 0 1px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,.4),inset 0 10px 10px rgba(255,255,255,.1)";
|
367 |
+
}
|
368 |
+
|
369 |
+
if (strlen($box_shadow)>1)
|
370 |
+
$css .= "-webkit-box-shadow:".$box_shadow.";
|
371 |
+
-ms-box-shadow:".$box_shadow.";
|
372 |
+
-moz-box-shadow:".$box_shadow.";
|
373 |
+
-o-box-shadow:".$box_shadow.";
|
374 |
+
-khtml-box-shadow:".$box_shadow.";
|
375 |
+
-icab-box-shadow:".$box_shadow.";
|
376 |
+
box-shadow:".$box_shadow.";\n\n";
|
377 |
+
|
378 |
+
$css .= "-webkit-border-radius: ".$this->options['radius']."px;
|
379 |
+
-moz-border-radius: ".$this->options['radius']."px;
|
380 |
+
-icab-border-radius: ".$this->options['radius']."px;
|
381 |
+
-khtml-border-radius: ".$this->options['radius']."px;
|
382 |
+
border-radius: ".$this->options['radius']."px;\n}\n\n";
|
383 |
+
|
384 |
+
$css .= "#dynamic-to-top:hover {
|
385 |
+
background: ".$this->get_ligther_hex($this->options['background_color']).";
|
386 |
+
background: ".$this->options['background_color']." -webkit-gradient( linear, 0% 0%, 0% 100%, from(rgba(255,255,255,.2)),to(rgba(0,0,0,0)));
|
387 |
+
background: ".$this->options['background_color']." -webkit-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
388 |
+
background: ".$this->options['background_color']." -khtml-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
389 |
+
background: ".$this->options['background_color']." -moz-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
390 |
+
background: ".$this->options['background_color']." -o-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
391 |
+
background: ".$this->options['background_color']." -ms-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
392 |
+
background: ".$this->options['background_color']." -icab-linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
393 |
+
background: ".$this->options['background_color']." linear-gradient( top, rgba(255,255,255,.2), rgba(0,0,0,0));
|
394 |
+
cursor:pointer;
|
395 |
+
}
|
396 |
+
|
397 |
+
#dynamic-to-top:active {
|
398 |
+
background: ".$this->options['background_color'].";
|
399 |
+
background: ".$this->options['background_color']." -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(0,0,0,.3)), to(rgba(0,0,0,0)));
|
400 |
+
background: ".$this->options['background_color']." -webkit-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
401 |
+
background: ".$this->options['background_color']." -moz-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
402 |
+
background: ".$this->options['background_color']." -khtml-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
403 |
+
background: ".$this->options['background_color']." -o-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
404 |
+
background: ".$this->options['background_color']." -ms-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
405 |
+
background: ".$this->options['background_color']." -icab-linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
406 |
+
background: ".$this->options['background_color']." linear-gradient( top, rgba(0,0,0,.1), rgba(0,0,0,0));
|
407 |
+
}
|
408 |
+
|
409 |
+
#dynamic-to-top,#dynamic-to-top:active,#dynamic-to-top:focus,#dynamic-to-top:hover
|
410 |
+
{
|
411 |
+
outline:none
|
412 |
+
}
|
413 |
+
|
414 |
+
#dynamic-to-top span {
|
415 |
+
display:block;
|
416 |
+
overflow:hidden;
|
417 |
+
width:17px;
|
418 |
+
height:12px;
|
419 |
+
background:url(".DYNAMIC_TO_TOP_URL."/css/images/up.png) no-repeat center center;
|
420 |
+
}";
|
421 |
+
|
422 |
+
return $css;
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Generate Custom JS script
|
427 |
+
*
|
428 |
+
* Returns Dynamic To Top custom JS script.
|
429 |
+
*
|
430 |
+
* @package Dynamic To Top
|
431 |
+
* @subpackage Main Class
|
432 |
+
* @since 3.0
|
433 |
+
* @return string $js
|
434 |
+
*/
|
435 |
+
|
436 |
+
function generate_custom_js($js="")
|
437 |
+
{
|
438 |
+
|
439 |
+
$js .= "/// Dynamic To Top Plugin ver. ".DYNAMIC_TO_TOP_VERSION." - http://www.mattvarone.com\n\n";
|
440 |
+
|
441 |
+
$js .= "(function(jQuery){
|
442 |
+
jQuery.fn.DynamicToTop = function(options) {
|
443 |
+
|
444 |
+
var defaults = {";
|
445 |
+
|
446 |
+
if ( $this->is_checked('text_version','yes') )
|
447 |
+
$js .= "text: '".$this->options['text']."',";
|
448 |
+
else
|
449 |
+
$js .= "text: '<span> </span>',";
|
450 |
+
|
451 |
+
$js .="
|
452 |
+
min: ".$this->options['distance'].",
|
453 |
+
inDelay:600,
|
454 |
+
outDelay:400,
|
455 |
+
containerID: 'dynamic-to-top',
|
456 |
+
scrollSpeed: ".$this->options['speed'].",
|
457 |
+
easingType: '".$this->get_easing_type()."'
|
458 |
+
};
|
459 |
+
|
460 |
+
var settings = jQuery.extend(defaults, options);
|
461 |
+
var containerIDhash = '#'+settings.containerID;
|
462 |
+
|
463 |
+
jQuery('body').append('<a href=\"#\" id=\"'+settings.containerID+'\">'+settings.text+'</a>');
|
464 |
+
|
465 |
+
jQuery(containerIDhash).hide().click(function(){
|
466 |
+
jQuery('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
|
467 |
+
return false;
|
468 |
+
});
|
469 |
+
|
470 |
+
jQuery(window).scroll(function() {
|
471 |
+
var sd = jQuery(window).scrollTop();
|
472 |
+
if(typeof document.body.style.maxHeight === \"undefined\") {
|
473 |
+
jQuery(containerIDhash).css({
|
474 |
+
'position': 'absolute',
|
475 |
+
'top': jQuery(window).scrollTop() + jQuery(window).height() - 50
|
476 |
+
});
|
477 |
+
}
|
478 |
+
if ( sd > settings.min )
|
479 |
+
jQuery(containerIDhash).fadeIn(settings.inDelay);
|
480 |
+
else
|
481 |
+
jQuery(containerIDhash).fadeOut(settings.Outdelay);
|
482 |
+
});
|
483 |
+
|
484 |
+
};
|
485 |
+
})(jQuery);\n\n";
|
486 |
+
|
487 |
+
$js .= "// jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
488 |
+
|
489 |
+
if(typeof jQuery.easeInExpo != 'function') {
|
490 |
+
|
491 |
+
jQuery.extend( jQuery.easing,
|
492 |
+
{
|
493 |
+
def: 'easeOutExpo',
|
494 |
+
swing: function (x, t, b, c, d) {
|
495 |
+
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
496 |
+
},
|
497 |
+
easeInExpo: function (x, t, b, c, d) {
|
498 |
+
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
499 |
+
},
|
500 |
+
easeOutExpo: function (x, t, b, c, d) {
|
501 |
+
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
502 |
+
},
|
503 |
+
easeInOutExpo: function (x, t, b, c, d) {
|
504 |
+
if (t==0) return b;
|
505 |
+
if (t==d) return b+c;
|
506 |
+
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
507 |
+
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
508 |
+
},
|
509 |
+
easeInBounce: function (x, t, b, c, d) {
|
510 |
+
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
511 |
+
},
|
512 |
+
easeOutBounce: function (x, t, b, c, d) {
|
513 |
+
if ((t/=d) < (1/2.75)) {
|
514 |
+
return c*(7.5625*t*t) + b;
|
515 |
+
} else if (t < (2/2.75)) {
|
516 |
+
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
517 |
+
} else if (t < (2.5/2.75)) {
|
518 |
+
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
519 |
+
} else {
|
520 |
+
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
521 |
+
}
|
522 |
+
},
|
523 |
+
easeInOutBounce: function (x, t, b, c, d) {
|
524 |
+
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
525 |
+
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
526 |
+
},
|
527 |
+
easeInElastic: function (x, t, b, c, d) {
|
528 |
+
var s=1.70158;var p=0;var a=c;
|
529 |
+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
530 |
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
531 |
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
532 |
+
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
533 |
+
},
|
534 |
+
easeInOutElastic: function (x, t, b, c, d) {
|
535 |
+
var s=1.70158;var p=0;var a=c;
|
536 |
+
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
537 |
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
538 |
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
539 |
+
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
540 |
+
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
541 |
+
}
|
542 |
+
});}\n\n";
|
543 |
+
|
544 |
+
$js .= "\n\njQuery().ready(function() { jQuery('body').DynamicToTop();});\n";
|
545 |
+
|
546 |
+
return $js;
|
547 |
+
}
|
548 |
+
|
549 |
+
/**
|
550 |
+
* Is Mobile
|
551 |
+
*
|
552 |
+
* Checks if the browser is mobile.
|
553 |
+
*
|
554 |
+
* @package Dynamic To Top
|
555 |
+
* @subpackage Main Class
|
556 |
+
* @since 3.0
|
557 |
+
* @author Rever Studios
|
558 |
+
* @link http://www.reverbstudios.ie/
|
559 |
+
* @return boolean.
|
560 |
+
*/
|
561 |
+
|
562 |
+
function is_mobile()
|
563 |
+
{
|
564 |
+
|
565 |
+
if(isset($_SERVER["HTTP_X_WAP_PROFILE"]))
|
566 |
+
return true;
|
567 |
+
|
568 |
+
if(preg_match("/wap\.|\.wap/i",$_SERVER["HTTP_ACCEPT"]))
|
569 |
+
return true;
|
570 |
+
|
571 |
+
if(isset($_SERVER["HTTP_USER_AGENT"]))
|
572 |
+
{
|
573 |
+
$user_agents = array(
|
574 |
+
"midp", "j2me", "iphone","avantg", "docomo", "novarra", "palmos",
|
575 |
+
"palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/",
|
576 |
+
"blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi",
|
577 |
+
"phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC",
|
578 |
+
"mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC",
|
579 |
+
"philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover",
|
580 |
+
"pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal",
|
581 |
+
"kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto");
|
582 |
+
|
583 |
+
foreach($user_agents as $user_string)
|
584 |
+
{
|
585 |
+
if(preg_match("/".$user_string."/i",$_SERVER["HTTP_USER_AGENT"]))
|
586 |
+
return true;
|
587 |
+
}
|
588 |
+
}
|
589 |
+
|
590 |
+
return false;
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Get Lighter Hex
|
595 |
+
*
|
596 |
+
* Returns a lighter version of an Hex color.
|
597 |
+
*
|
598 |
+
* @package Dynamic To Top
|
599 |
+
* @subpackage Main Class
|
600 |
+
* @since 3.0
|
601 |
+
* @author Justin French
|
602 |
+
* @link http://justinfrench.com/
|
603 |
+
* @return boolean.
|
604 |
+
*/
|
605 |
+
|
606 |
+
function get_ligther_hex($hex,$factor = 30)
|
607 |
+
{
|
608 |
+
|
609 |
+
$new_hex = '#';
|
610 |
+
|
611 |
+
$base['R'] = hexdec($hex{0}.$hex{1});
|
612 |
+
$base['G'] = hexdec($hex{2}.$hex{3});
|
613 |
+
$base['B'] = hexdec($hex{4}.$hex{5});
|
614 |
+
|
615 |
+
foreach ($base as $k => $v)
|
616 |
+
{
|
617 |
+
$amount = 255 - $v;
|
618 |
+
$amount = $amount / 100;
|
619 |
+
$amount = round($amount * $factor);
|
620 |
+
$new_decimal = $v + $amount;
|
621 |
+
|
622 |
+
$new_hex_component = dechex($new_decimal);
|
623 |
+
|
624 |
+
if(strlen($new_hex_component) < 2)
|
625 |
+
$new_hex_component = "0".$new_hex_component;
|
626 |
+
|
627 |
+
$new_hex .= $new_hex_component;
|
628 |
+
}
|
629 |
+
|
630 |
+
return $new_hex;
|
631 |
+
}
|
632 |
+
|
633 |
+
|
634 |
+
}
|
635 |
+
|
636 |
+
/*
|
637 |
+
|--------------------------------------------------------------------------
|
638 |
+
| DYNAMIC TO TOP CLASS INITIALIZE
|
639 |
+
|--------------------------------------------------------------------------
|
640 |
+
*/
|
641 |
+
|
642 |
+
if (!function_exists('dynamic_to_top_init'))
|
643 |
+
{
|
644 |
+
|
645 |
+
/**
|
646 |
+
* Initializes the main Dynamic to top class.
|
647 |
+
*
|
648 |
+
* @package Dynamic To Top
|
649 |
+
* @since 3.0
|
650 |
+
*
|
651 |
+
*/
|
652 |
+
|
653 |
+
function dynamic_to_top_init()
|
654 |
+
{
|
655 |
+
global $OBJ_dynamic_to_top;
|
656 |
+
$OBJ_dynamic_to_top = new Dynamic_To_Top();
|
657 |
+
}
|
658 |
+
|
659 |
+
add_action('init', 'dynamic_to_top_init');
|
660 |
+
}
|
661 |
+
}
|
inc/dynamic-to-top-options.php
ADDED
@@ -0,0 +1,772 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dynamic To Top Options
|
4 |
+
*
|
5 |
+
* @package Dynamic To Top
|
6 |
+
* @subpackage Options
|
7 |
+
* @author Matt Varone
|
8 |
+
*/
|
9 |
+
|
10 |
+
add_action('admin_menu', 'dynamic_to_top_create_options_page');
|
11 |
+
add_action('admin_init', 'dynamic_to_top_register_and_build_fields');
|
12 |
+
|
13 |
+
if ( !function_exists('dynamic_to_top_create_options_page') )
|
14 |
+
{
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Create Options Page
|
18 |
+
*
|
19 |
+
* @package Dynamic To Top
|
20 |
+
* @subpackage Options
|
21 |
+
* @since 3.0
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
function dynamic_to_top_create_options_page()
|
26 |
+
{
|
27 |
+
// Create Options Page
|
28 |
+
add_options_page('Dynamic To Top Options','Dynamic To Top', 'administrator', __FILE__, 'dynamic_to_top_options_page');
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( !function_exists('dynamic_to_top_register_and_build_fields') )
|
33 |
+
{
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Register and Build Fields
|
37 |
+
*
|
38 |
+
* Register fields and sections.
|
39 |
+
*
|
40 |
+
* @package Dynamic To Top
|
41 |
+
* @subpackage Options
|
42 |
+
* @since 3.0
|
43 |
+
*
|
44 |
+
*/
|
45 |
+
|
46 |
+
function 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');
|
57 |
+
add_settings_field('position',__('Position',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_position',__FILE__,'settings_section');
|
58 |
+
add_settings_field('prevent_on_mobile',__('Prevent on mobile',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_prevent_on_mobile',__FILE__,'settings_section');
|
59 |
+
|
60 |
+
add_settings_field('text_version',__('Text version',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_version',__FILE__,'appearance_section');
|
61 |
+
add_settings_field('text',__('Button text',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text',__FILE__,'appearance_section');
|
62 |
+
add_settings_field('padding_top_bottom',__('Top/bottom padding',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_padding_top_bottom',__FILE__,'appearance_section');
|
63 |
+
add_settings_field('padding_left_right',__('Sides padding',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_padding_left_right',__FILE__,'appearance_section');
|
64 |
+
add_settings_field('font_size',__('Font size',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_font_size',__FILE__,'appearance_section');
|
65 |
+
add_settings_field('text_color',__('Text color',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_text_color',__FILE__,'appearance_section');
|
66 |
+
add_settings_field('bold',__('Bold Text',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_bold',__FILE__,'appearance_section');
|
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');
|
74 |
+
add_settings_field('inset',__('Inset highlighting',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_inset',__FILE__,'appearance_section');
|
75 |
+
add_settings_field('shadow',__('Shadow',DYNAMIC_TO_TOP_DOMAIN),'dynamic_to_top_field_shadow',__FILE__,'appearance_section');
|
76 |
+
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
/*
|
81 |
+
|--------------------------------------------------------------------------
|
82 |
+
| DYNAMIC TO TOP OPTIONS PAGE
|
83 |
+
|--------------------------------------------------------------------------
|
84 |
+
*/
|
85 |
+
|
86 |
+
if ( !function_exists('dynamic_to_top_options_page') )
|
87 |
+
{
|
88 |
+
/**
|
89 |
+
* Options Page
|
90 |
+
*
|
91 |
+
* Options page layout.
|
92 |
+
*
|
93 |
+
* @package Dynamic To Top
|
94 |
+
* @subpackage Options
|
95 |
+
* @since 3.0
|
96 |
+
*
|
97 |
+
*/
|
98 |
+
|
99 |
+
function dynamic_to_top_options_page()
|
100 |
+
{
|
101 |
+
|
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">
|
111 |
+
<?php settings_fields('dynamic_to_top'); ?>
|
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>
|
122 |
+
<?php
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( !function_exists('dynamic_to_top_appearance_section') )
|
128 |
+
{
|
129 |
+
function dynamic_to_top_appearance_section()
|
130 |
+
{
|
131 |
+
echo '<div id="dynamic-to-top-preview"><div id="dynamic-to-top-button"><span id="dtt-text"></span><span id="dtt-image"></span></div></div>';
|
132 |
+
echo '<p class="ddt-bg-colors"><small>'.__('Preview over',DYNAMIC_TO_TOP_DOMAIN).' <a href="#" title="black">'.__('black',DYNAMIC_TO_TOP_DOMAIN).'</a>, <a href="#" title="lightgrey">'.__('grey',DYNAMIC_TO_TOP_DOMAIN).'</a> or <a href="#" title="white">'.__('white',DYNAMIC_TO_TOP_DOMAIN).'</a>.</small></p>';
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
if ( !function_exists('dynamic_to_top_save_settings') )
|
137 |
+
{
|
138 |
+
function dynamic_to_top_save_settings($options)
|
139 |
+
{
|
140 |
+
delete_transient('dynamic_to_top_transient_css');
|
141 |
+
delete_transient('dynamic_to_top_transient_js');
|
142 |
+
|
143 |
+
return $options;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
/*
|
148 |
+
|--------------------------------------------------------------------------
|
149 |
+
| DYNAMIC TO TOP OPTIONS PAGE ASSETS
|
150 |
+
|--------------------------------------------------------------------------
|
151 |
+
*/
|
152 |
+
|
153 |
+
if ( !function_exists('dynamic_to_top_styles') )
|
154 |
+
{
|
155 |
+
/**
|
156 |
+
* Options page enqueue style.
|
157 |
+
*
|
158 |
+
* @package Dynamic To Top
|
159 |
+
* @subpackage Options
|
160 |
+
* @since 3.0
|
161 |
+
*
|
162 |
+
*/
|
163 |
+
|
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 |
+
|
172 |
+
add_action( 'admin_print_styles', 'dynamic_to_top_styles' );
|
173 |
+
}
|
174 |
+
|
175 |
+
if ( !function_exists('dynamic_to_top_scripts') )
|
176 |
+
{
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Options page enqueue script.
|
180 |
+
*
|
181 |
+
* @package Dynamic To Top
|
182 |
+
* @subpackage Options
|
183 |
+
* @since 3.0
|
184 |
+
*
|
185 |
+
*/
|
186 |
+
|
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' );
|
194 |
+
}
|
195 |
+
|
196 |
+
if ( !function_exists('dynamic_to_top_is_page_options') )
|
197 |
+
{
|
198 |
+
function dynamic_to_top_is_page_options()
|
199 |
+
{
|
200 |
+
global $pagenow;
|
201 |
+
|
202 |
+
if (function_exists('get_current_screen'))
|
203 |
+
{
|
204 |
+
$screen = get_current_screen();
|
205 |
+
|
206 |
+
if ( isset($screen->base) && $screen->base == 'settings_page_dynamic-to-top/inc/dynamic-to-top-options')
|
207 |
+
return true;
|
208 |
+
else
|
209 |
+
return false;
|
210 |
+
}
|
211 |
+
else
|
212 |
+
{
|
213 |
+
$pages = array('options-general.php');
|
214 |
+
|
215 |
+
if (in_array($pagenow, $pages) && isset($_GET['page']) && $_GET['page'] == 'dynamic-to-top/inc/dynamic-to-top-options.php')
|
216 |
+
return true;
|
217 |
+
}
|
218 |
+
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/*
|
224 |
+
|--------------------------------------------------------------------------
|
225 |
+
| DYNAMIC TO TOP OPTIONS PAGE FIELDS
|
226 |
+
|--------------------------------------------------------------------------
|
227 |
+
*/
|
228 |
+
|
229 |
+
// COLOR PICKERS /////////////////////////
|
230 |
+
|
231 |
+
if ( !function_exists('dynamic_to_top_field_border_color') )
|
232 |
+
{
|
233 |
+
|
234 |
+
/**
|
235 |
+
* @package Dynamic To Top
|
236 |
+
* @subpackage Options
|
237 |
+
* @since 3.0
|
238 |
+
*
|
239 |
+
*/
|
240 |
+
|
241 |
+
function dynamic_to_top_field_border_color()
|
242 |
+
{
|
243 |
+
echo dynamic_to_top_do_textfield_color('border_color','#ddd',__('Color for the button border.',DYNAMIC_TO_TOP_DOMAIN));
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
if ( !function_exists('dynamic_to_top_field_background_color') )
|
248 |
+
{
|
249 |
+
|
250 |
+
/**
|
251 |
+
* @package Dynamic To Top
|
252 |
+
* @subpackage Options
|
253 |
+
* @since 3.0
|
254 |
+
*
|
255 |
+
*/
|
256 |
+
|
257 |
+
function dynamic_to_top_field_background_color()
|
258 |
+
{
|
259 |
+
echo dynamic_to_top_do_textfield_color('background_color','#111',__('Background color for the button.',DYNAMIC_TO_TOP_DOMAIN));
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
if ( !function_exists('dynamic_to_top_field_text_color') )
|
264 |
+
{
|
265 |
+
|
266 |
+
/**
|
267 |
+
* @package Dynamic To Top
|
268 |
+
* @subpackage Options
|
269 |
+
* @since 3.0
|
270 |
+
*
|
271 |
+
*/
|
272 |
+
|
273 |
+
function dynamic_to_top_field_text_color()
|
274 |
+
{
|
275 |
+
echo dynamic_to_top_do_textfield_color('text_color','#fff',__('Button text color.',DYNAMIC_TO_TOP_DOMAIN));
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
if ( !function_exists('dynamic_to_top_field_text_shadow_color') )
|
280 |
+
{
|
281 |
+
|
282 |
+
/**
|
283 |
+
* @package Dynamic To Top
|
284 |
+
* @subpackage Options
|
285 |
+
* @since 3.0
|
286 |
+
*
|
287 |
+
*/
|
288 |
+
|
289 |
+
function dynamic_to_top_field_text_shadow_color()
|
290 |
+
{
|
291 |
+
echo dynamic_to_top_do_textfield_color('shadow_color','#333',__('Text shadow color.',DYNAMIC_TO_TOP_DOMAIN));
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
if ( !function_exists('dynamic_to_top_field_box_shadow_color') )
|
296 |
+
{
|
297 |
+
|
298 |
+
/**
|
299 |
+
* @package Dynamic To Top
|
300 |
+
* @subpackage Options
|
301 |
+
* @since 3.0
|
302 |
+
*
|
303 |
+
*/
|
304 |
+
|
305 |
+
function dynamic_to_top_field_box_shadow_color()
|
306 |
+
{
|
307 |
+
echo dynamic_to_top_do_textfield_color('box_shadow_color','#333',__('Text shadow color.',DYNAMIC_TO_TOP_DOMAIN));
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
// SELECT BOX /////////////////////////
|
312 |
+
|
313 |
+
if ( !function_exists('dynamic_to_top_field_easing') )
|
314 |
+
{
|
315 |
+
|
316 |
+
/**
|
317 |
+
* @package Dynamic To Top
|
318 |
+
* @subpackage Options
|
319 |
+
* @since 3.0
|
320 |
+
*
|
321 |
+
*/
|
322 |
+
|
323 |
+
function dynamic_to_top_field_easing()
|
324 |
+
{
|
325 |
+
$options = array( 'Linear', 'In','Out','In Out','Bounce','Elastic');
|
326 |
+
|
327 |
+
echo dynamic_to_top_do_select('easing',$options,'easeInOutExpo',__('<a href="http://gsgd.co.uk/sandbox/jquery/easing" title="Easing type">Easing type</a> used to scroll the page up.',DYNAMIC_TO_TOP_DOMAIN));
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
if ( !function_exists('dynamic_to_top_field_position') )
|
332 |
+
{
|
333 |
+
|
334 |
+
/**
|
335 |
+
* @package Dynamic To Top
|
336 |
+
* @subpackage Options
|
337 |
+
* @since 3.0
|
338 |
+
*
|
339 |
+
*/
|
340 |
+
|
341 |
+
function dynamic_to_top_field_position()
|
342 |
+
{
|
343 |
+
$options = array( 'Top Left', 'Top Right', 'Bottom Left', 'Bottom Right');
|
344 |
+
|
345 |
+
echo dynamic_to_top_do_select('position',$options,'Bottom Right',__('Button position.',DYNAMIC_TO_TOP_DOMAIN));
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
// SLIDER UI /////////////////////////
|
350 |
+
|
351 |
+
if ( !function_exists('dynamic_to_top_field_scroll_time') )
|
352 |
+
{
|
353 |
+
|
354 |
+
/**
|
355 |
+
* @package Dynamic To Top
|
356 |
+
* @subpackage Options
|
357 |
+
* @since 3.0
|
358 |
+
*
|
359 |
+
*/
|
360 |
+
|
361 |
+
function dynamic_to_top_field_scroll_time()
|
362 |
+
{
|
363 |
+
echo dynamic_to_top_do_slider('speed',1000,__('Time it takes for the page to scroll up. Less for faster. ( <span id="speed-val"></span> Milliseconds )',DYNAMIC_TO_TOP_DOMAIN));
|
364 |
+
}
|
365 |
+
}
|
366 |
+
|
367 |
+
if ( !function_exists('dynamic_to_top_field_font_size') )
|
368 |
+
{
|
369 |
+
|
370 |
+
/**
|
371 |
+
* @package Dynamic To Top
|
372 |
+
* @subpackage Options
|
373 |
+
* @since 3.0
|
374 |
+
*
|
375 |
+
*/
|
376 |
+
|
377 |
+
function dynamic_to_top_field_font_size()
|
378 |
+
{
|
379 |
+
echo dynamic_to_top_do_slider('font_size',1,__('Button text size. ( <span id="font-size-val"></span> Em/s )',DYNAMIC_TO_TOP_DOMAIN));
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
if ( !function_exists('dynamic_to_top_field_padding_top_bottom') )
|
384 |
+
{
|
385 |
+
|
386 |
+
/**
|
387 |
+
* @package Dynamic To Top
|
388 |
+
* @subpackage Options
|
389 |
+
* @since 3.0
|
390 |
+
*
|
391 |
+
*/
|
392 |
+
|
393 |
+
function dynamic_to_top_field_padding_top_bottom()
|
394 |
+
{
|
395 |
+
echo dynamic_to_top_do_slider('padding_top_bottom',5,__('Spacing on Top and Bottom. ( <span id="padding-top-bottom-val"></span>px )',DYNAMIC_TO_TOP_DOMAIN));
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
if ( !function_exists('dynamic_to_top_field_padding_left_right') )
|
400 |
+
{
|
401 |
+
|
402 |
+
/**
|
403 |
+
* @package Dynamic To Top
|
404 |
+
* @subpackage Options
|
405 |
+
* @since 3.0
|
406 |
+
*
|
407 |
+
*/
|
408 |
+
|
409 |
+
function dynamic_to_top_field_padding_left_right()
|
410 |
+
{
|
411 |
+
echo dynamic_to_top_do_slider('padding_left_right',21,__('Spacing on Left and Right. ( <span id="padding-left-right-val"></span>px )',DYNAMIC_TO_TOP_DOMAIN));
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
if ( !function_exists('dynamic_to_top_field_border_width') )
|
416 |
+
{
|
417 |
+
|
418 |
+
/**
|
419 |
+
* @package Dynamic To Top
|
420 |
+
* @subpackage Options
|
421 |
+
* @since 3.0
|
422 |
+
*
|
423 |
+
*/
|
424 |
+
|
425 |
+
function dynamic_to_top_field_border_width()
|
426 |
+
{
|
427 |
+
echo dynamic_to_top_do_slider('border_width','1',__('Button border width',DYNAMIC_TO_TOP_DOMAIN).' <span id="border-val"></span>px.');
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
if ( !function_exists('dynamic_to_top_field_border_radius') )
|
432 |
+
{
|
433 |
+
|
434 |
+
/**
|
435 |
+
* @package Dynamic To Top
|
436 |
+
* @subpackage Options
|
437 |
+
* @since 3.0
|
438 |
+
*
|
439 |
+
*/
|
440 |
+
|
441 |
+
function dynamic_to_top_field_border_radius()
|
442 |
+
{
|
443 |
+
echo dynamic_to_top_do_slider('radius','3',__('Button border radius',DYNAMIC_TO_TOP_DOMAIN).' <span id="radius-val"></span>px.');
|
444 |
+
}
|
445 |
+
}
|
446 |
+
|
447 |
+
// TEXTFIELDS /////////////////////////
|
448 |
+
|
449 |
+
if ( !function_exists('dynamic_to_top_field_distance') )
|
450 |
+
{
|
451 |
+
|
452 |
+
/**
|
453 |
+
* @package Dynamic To Top
|
454 |
+
* @subpackage Options
|
455 |
+
* @since 3.0
|
456 |
+
*
|
457 |
+
*/
|
458 |
+
|
459 |
+
function dynamic_to_top_field_distance()
|
460 |
+
{
|
461 |
+
echo dynamic_to_top_do_textfield('distance',200,__('Distance from top to show the button. ( Pixels )',DYNAMIC_TO_TOP_DOMAIN));
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
if ( !function_exists('dynamic_to_top_field_text') )
|
466 |
+
{
|
467 |
+
|
468 |
+
/**
|
469 |
+
* @package Dynamic To Top
|
470 |
+
* @subpackage Options
|
471 |
+
* @since 3.0
|
472 |
+
*
|
473 |
+
*/
|
474 |
+
|
475 |
+
function dynamic_to_top_field_text()
|
476 |
+
{
|
477 |
+
echo dynamic_to_top_do_textfield('text',__('To Top',DYNAMIC_TO_TOP_DOMAIN),__('Text displayed on the button.',DYNAMIC_TO_TOP_DOMAIN),'regular-text');
|
478 |
+
}
|
479 |
+
}
|
480 |
+
|
481 |
+
// CHECKBOXES /////////////////////////
|
482 |
+
|
483 |
+
if ( !function_exists('dynamic_to_top_field_prevent_on_mobile') )
|
484 |
+
{
|
485 |
+
|
486 |
+
/**
|
487 |
+
* @package Dynamic To Top
|
488 |
+
* @subpackage Options
|
489 |
+
* @since 3.0
|
490 |
+
*
|
491 |
+
*/
|
492 |
+
|
493 |
+
function dynamic_to_top_field_prevent_on_mobile()
|
494 |
+
{
|
495 |
+
echo dynamic_to_top_do_checkbox('prevent_on_mobile',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Disable the button on mobile browsers.',DYNAMIC_TO_TOP_DOMAIN));
|
496 |
+
}
|
497 |
+
}
|
498 |
+
|
499 |
+
if ( !function_exists('dynamic_to_top_field_text_version') )
|
500 |
+
{
|
501 |
+
|
502 |
+
/**
|
503 |
+
* @package Dynamic To Top
|
504 |
+
* @subpackage Options
|
505 |
+
* @since 3.0
|
506 |
+
*
|
507 |
+
*/
|
508 |
+
|
509 |
+
function dynamic_to_top_field_text_version()
|
510 |
+
{
|
511 |
+
echo dynamic_to_top_do_checkbox('text_version',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Show a text version instead of the arrow up icon.',DYNAMIC_TO_TOP_DOMAIN));
|
512 |
+
}
|
513 |
+
}
|
514 |
+
|
515 |
+
if ( !function_exists('dynamic_to_top_field_inset') )
|
516 |
+
{
|
517 |
+
|
518 |
+
/**
|
519 |
+
* @package Dynamic To Top
|
520 |
+
* @subpackage Options
|
521 |
+
* @since 3.0
|
522 |
+
*
|
523 |
+
*/
|
524 |
+
|
525 |
+
function dynamic_to_top_field_inset()
|
526 |
+
{
|
527 |
+
echo dynamic_to_top_do_checkbox('inset',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Add CSS3 inset-highlight.',DYNAMIC_TO_TOP_DOMAIN));
|
528 |
+
}
|
529 |
+
}
|
530 |
+
|
531 |
+
if ( !function_exists('dynamic_to_top_field_shadow') )
|
532 |
+
{
|
533 |
+
|
534 |
+
/**
|
535 |
+
* @package Dynamic To Top
|
536 |
+
* @subpackage Options
|
537 |
+
* @since 3.0
|
538 |
+
*
|
539 |
+
*/
|
540 |
+
|
541 |
+
function dynamic_to_top_field_shadow()
|
542 |
+
{
|
543 |
+
echo dynamic_to_top_do_checkbox('shadow',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Add CSS3 shadow.',DYNAMIC_TO_TOP_DOMAIN));
|
544 |
+
}
|
545 |
+
}
|
546 |
+
|
547 |
+
if ( !function_exists('dynamic_to_top_field_weight') )
|
548 |
+
{
|
549 |
+
|
550 |
+
/**
|
551 |
+
* @package Dynamic To Top
|
552 |
+
* @subpackage Options
|
553 |
+
* @since 3.0
|
554 |
+
*
|
555 |
+
*/
|
556 |
+
|
557 |
+
function dynamic_to_top_field_bold()
|
558 |
+
{
|
559 |
+
echo dynamic_to_top_do_checkbox('bold',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Make the text bold.',DYNAMIC_TO_TOP_DOMAIN));
|
560 |
+
}
|
561 |
+
}
|
562 |
+
|
563 |
+
if ( !function_exists('dynamic_to_top_field_text_shadow') )
|
564 |
+
{
|
565 |
+
|
566 |
+
/**
|
567 |
+
* @package Dynamic To Top
|
568 |
+
* @subpackage Options
|
569 |
+
* @since 3.0
|
570 |
+
*
|
571 |
+
*/
|
572 |
+
|
573 |
+
function dynamic_to_top_field_text_shadow()
|
574 |
+
{
|
575 |
+
echo dynamic_to_top_do_checkbox('text_shadow',__('Yes',DYNAMIC_TO_TOP_DOMAIN),'yes',__('Add a subtle text shadow.',DYNAMIC_TO_TOP_DOMAIN));
|
576 |
+
}
|
577 |
+
}
|
578 |
+
/*
|
579 |
+
|--------------------------------------------------------------------------
|
580 |
+
| DYNAMIC TO TOP OPTION FIELDS HELPERS
|
581 |
+
|--------------------------------------------------------------------------
|
582 |
+
*/
|
583 |
+
|
584 |
+
if ( !function_exists('dynamic_to_top_do_checkbox') )
|
585 |
+
{
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Do Checkbox
|
589 |
+
*
|
590 |
+
* Generates a checkbox.
|
591 |
+
*
|
592 |
+
* @package Dynamic To Top
|
593 |
+
* @subpackage Options
|
594 |
+
* @since 3.0
|
595 |
+
*
|
596 |
+
*/
|
597 |
+
|
598 |
+
function dynamic_to_top_do_checkbox($meta,$label="Yes",$value='yes',$desc="")
|
599 |
+
{
|
600 |
+
|
601 |
+
$options_db = get_option('dynamic_to_top');
|
602 |
+
|
603 |
+
if ( isset($options_db[$meta]) && $options_db[$meta] == $value)
|
604 |
+
$c = 'checked="checked"';
|
605 |
+
else
|
606 |
+
$c = "";
|
607 |
+
|
608 |
+
if ( $desc != "")
|
609 |
+
$desc = '<div class="desc">'.$desc.'</div>';
|
610 |
+
|
611 |
+
$sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
|
612 |
+
|
613 |
+
return '<input type="checkbox" name="dynamic_to_top['.$meta.']" value="'.$value.'" '.$c.' id="checkbox-'.$sanitized_meta_title.'" /> '.$label.$desc;
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
if ( !function_exists('dynamic_to_top_do_textfield') )
|
618 |
+
{
|
619 |
+
|
620 |
+
/**
|
621 |
+
* Do Textfield
|
622 |
+
*
|
623 |
+
* Generates a Textfield.
|
624 |
+
*
|
625 |
+
* @package Dynamic To Top
|
626 |
+
* @subpackage Options
|
627 |
+
* @since 3.0
|
628 |
+
*
|
629 |
+
*/
|
630 |
+
|
631 |
+
function dynamic_to_top_do_textfield($meta,$value="",$desc="",$class="")
|
632 |
+
{
|
633 |
+
|
634 |
+
$options_db = get_option('dynamic_to_top');
|
635 |
+
|
636 |
+
if ( isset($options_db[$meta]))
|
637 |
+
$value = $options_db[$meta];
|
638 |
+
|
639 |
+
if ( $desc != "")
|
640 |
+
$desc = '<div class="desc">'.$desc.'</div>';
|
641 |
+
|
642 |
+
if ( $class != "")
|
643 |
+
$class = 'class="'.$class.'"';
|
644 |
+
|
645 |
+
$sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
|
646 |
+
|
647 |
+
return '<input type="text" id="text-'.$sanitized_meta_title.'" name="dynamic_to_top['.$meta.']" '.$class.' value="'.$value.'" /> '.$desc;
|
648 |
+
}
|
649 |
+
}
|
650 |
+
|
651 |
+
if ( !function_exists('dynamic_to_top_do_select') )
|
652 |
+
{
|
653 |
+
|
654 |
+
/**
|
655 |
+
* Do Select Box
|
656 |
+
*
|
657 |
+
* Generate a select box.
|
658 |
+
*
|
659 |
+
* @package Dynamic To Top
|
660 |
+
* @subpackage Options
|
661 |
+
* @since 3.0
|
662 |
+
*
|
663 |
+
*/
|
664 |
+
|
665 |
+
function dynamic_to_top_do_select($meta,$options=array(),$value="",$desc="")
|
666 |
+
{
|
667 |
+
|
668 |
+
$options_out = "";
|
669 |
+
|
670 |
+
$options_db = get_option('dynamic_to_top');
|
671 |
+
|
672 |
+
if ( isset($options_db[$meta]))
|
673 |
+
$value = $options_db[$meta];
|
674 |
+
|
675 |
+
$value = sanitize_title($value);
|
676 |
+
|
677 |
+
foreach ($options as $option)
|
678 |
+
{
|
679 |
+
$selected = "";
|
680 |
+
|
681 |
+
$option_slug = sanitize_title($option);
|
682 |
+
|
683 |
+
if ( $value == $option_slug )
|
684 |
+
$selected = 'selected="selected"';
|
685 |
+
|
686 |
+
$options_out .= '<option name="'.sanitize_title($option).'" '.$selected.' >'.$option.'</option>';
|
687 |
+
}
|
688 |
+
|
689 |
+
if ( $desc != "")
|
690 |
+
$desc = '<div class="desc">'.$desc.'</div>';
|
691 |
+
|
692 |
+
$sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
|
693 |
+
|
694 |
+
return '<select name="dynamic_to_top['.$meta.']" id="select-'.$sanitized_meta_title.'"> '.$options_out.'</select>'.$desc;
|
695 |
+
}
|
696 |
+
}
|
697 |
+
|
698 |
+
if ( !function_exists('dynamic_to_top_do_textfield_color') )
|
699 |
+
{
|
700 |
+
|
701 |
+
/**
|
702 |
+
* Do Textfield Color
|
703 |
+
*
|
704 |
+
* Generates a Textfield with Farbtastic.
|
705 |
+
*
|
706 |
+
* @package Dynamic To Top
|
707 |
+
* @subpackage Options
|
708 |
+
* @since 3.0
|
709 |
+
*
|
710 |
+
*/
|
711 |
+
|
712 |
+
function dynamic_to_top_do_textfield_color($meta,$value="",$desc="",$class="")
|
713 |
+
{
|
714 |
+
|
715 |
+
$options_db = get_option('dynamic_to_top');
|
716 |
+
|
717 |
+
if ( isset($options_db[$meta]))
|
718 |
+
$value = $options_db[$meta];
|
719 |
+
|
720 |
+
if ( $desc != "")
|
721 |
+
$desc = '<div class="desc">'.$desc.'</div>';
|
722 |
+
|
723 |
+
if ( $class != "")
|
724 |
+
$class .= " ";
|
725 |
+
|
726 |
+
$class = 'class="'.$class.'colorvalue"';
|
727 |
+
|
728 |
+
$sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
|
729 |
+
|
730 |
+
$out ='<div id="farbtastic-picker-'.$sanitized_meta_title.'" class="dtt-farbtastic">';
|
731 |
+
$out .= '</div><input type="text" name="dynamic_to_top['.$meta.']" id="farbtastic-'.$sanitized_meta_title.'" '.$class.' value="'.$value.'" />';
|
732 |
+
$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;
|
733 |
+
|
734 |
+
return $out;
|
735 |
+
}
|
736 |
+
}
|
737 |
+
|
738 |
+
if ( !function_exists('dynamic_to_top_do_slider') )
|
739 |
+
{
|
740 |
+
|
741 |
+
/**
|
742 |
+
* Do Textfield Color
|
743 |
+
*
|
744 |
+
* Generates a Textfield with a slider.
|
745 |
+
*
|
746 |
+
* @package Dynamic To Top
|
747 |
+
* @subpackage Options
|
748 |
+
* @since 3.0
|
749 |
+
*
|
750 |
+
*/
|
751 |
+
|
752 |
+
function dynamic_to_top_do_slider($meta,$value="",$desc="",$class="")
|
753 |
+
{
|
754 |
+
|
755 |
+
$options_db = get_option('dynamic_to_top');
|
756 |
+
|
757 |
+
if ( isset($options_db[$meta]))
|
758 |
+
$value = $options_db[$meta];
|
759 |
+
|
760 |
+
if ( $desc != "")
|
761 |
+
$desc = '<div class="desc">'.$desc.'</div>';
|
762 |
+
|
763 |
+
if ( $class != "")
|
764 |
+
$class .= " ";
|
765 |
+
|
766 |
+
$class = 'class="'.$class.'colorvalue"';
|
767 |
+
|
768 |
+
$sanitized_meta_title = str_replace('_','-',sanitize_title($meta));
|
769 |
+
|
770 |
+
return '<div id="slider-picker-'.$sanitized_meta_title.'" class="dtt-slider"></div><input type="text" name="dynamic_to_top['.$meta.']" id="slider-'.$sanitized_meta_title.'" '.$class.' value="'.$value.'" />'.$desc;
|
771 |
+
}
|
772 |
+
}
|
js/dynamic-to-top-js.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.settings.js
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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');
|
11 |
+
var preview_button_version = jQuery('#dynamic-to-top-button #dtt-image');
|
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();
|
38 |
+
|
39 |
+
var update_fields = '#checkbox-bold, #checkbox-inset, #checkbox-shadow, #checkbox-text-shadow, .colorvalue';
|
40 |
+
|
41 |
+
jQuery(update_fields).change(function(){update_preview()});
|
42 |
+
jQuery('#select-position').change(function(){update_position();});
|
43 |
+
|
44 |
+
jQuery('#text-text').keyup(function(){update_preview()});
|
45 |
+
|
46 |
+
jQuery('.ddt-bg-colors a').click(function(e){
|
47 |
+
e.preventDefault();
|
48 |
+
var color = jQuery(this).attr('title');
|
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 |
+
|
142 |
+
jQuery('#slider-picker-radius').slider({
|
143 |
+
range: "min",
|
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 |
+
|
158 |
+
jQuery('#slider-picker-border-width').slider({
|
159 |
+
range: "min",
|
160 |
+
value: slider_2.val(),
|
161 |
+
min: 0,
|
162 |
+
max: 10,
|
163 |
+
slide: function( event, ui ) {
|
164 |
+
slider_2.val( ui.value );
|
165 |
+
slider_val_2.html( ui.value);
|
166 |
+
preview.css('border-width',ui.value+'px');
|
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 |
+
|
174 |
+
jQuery('#slider-picker-speed').slider({
|
175 |
+
range: "max",
|
176 |
+
value: slider_3.val(),
|
177 |
+
min: 600,
|
178 |
+
step:100,
|
179 |
+
max: 3000,
|
180 |
+
slide: function( event, ui ) {
|
181 |
+
slider_3.val( ui.value );
|
182 |
+
slider_val_3.html( ui.value);
|
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 |
+
|
190 |
+
jQuery('#slider-picker-padding-top-bottom').slider({
|
191 |
+
range: "min",
|
192 |
+
value: slider_4.val(),
|
193 |
+
min: 2,
|
194 |
+
max: 21,
|
195 |
+
slide: function( event, ui ) {
|
196 |
+
slider_4.val( ui.value );
|
197 |
+
slider_val_4.html( ui.value);
|
198 |
+
preview.css({paddingTop:ui.value+'px',paddingBottom:ui.value+'px'});
|
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 |
+
|
206 |
+
jQuery('#slider-picker-padding-left-right').slider({
|
207 |
+
range: "min",
|
208 |
+
value: slider_5.val(),
|
209 |
+
min: 2,
|
210 |
+
max: 40,
|
211 |
+
slide: function( event, ui ) {
|
212 |
+
slider_5.val( ui.value );
|
213 |
+
slider_val_5.html( ui.value);
|
214 |
+
preview.css({paddingLeft:ui.value+'px',paddingRight:ui.value+'px'});
|
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 |
+
|
222 |
+
jQuery('#slider-picker-font-size').slider({
|
223 |
+
range: "min",
|
224 |
+
value: slider_6.val(),
|
225 |
+
min: 0.8,
|
226 |
+
max: 2,
|
227 |
+
step:0.05,
|
228 |
+
slide: function( event, ui ) {
|
229 |
+
slider_6.val( ui.value );
|
230 |
+
slider_val_6.html( ui.value);
|
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');
|
242 |
+
jQuery('#farbtastic-picker-shadow-color').farbtastic('#farbtastic-shadow-color');
|
243 |
+
|
244 |
+
jQuery('.dtt-farbtastic').hide().css('margin-bottom','15px').mouseup(function(){update_preview()});
|
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 |
+
;
|
js/jquery.easing.1.3.js
DELETED
@@ -1,205 +0,0 @@
|
|
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 |
-
// t: current time, b: begInnIng value, c: change In value, d: duration
|
39 |
-
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
40 |
-
|
41 |
-
jQuery.extend( jQuery.easing,
|
42 |
-
{
|
43 |
-
def: 'easeOutQuad',
|
44 |
-
swing: function (x, t, b, c, d) {
|
45 |
-
//alert(jQuery.easing.default);
|
46 |
-
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
47 |
-
},
|
48 |
-
easeInQuad: function (x, t, b, c, d) {
|
49 |
-
return c*(t/=d)*t + b;
|
50 |
-
},
|
51 |
-
easeOutQuad: function (x, t, b, c, d) {
|
52 |
-
return -c *(t/=d)*(t-2) + b;
|
53 |
-
},
|
54 |
-
easeInOutQuad: function (x, t, b, c, d) {
|
55 |
-
if ((t/=d/2) < 1) return c/2*t*t + b;
|
56 |
-
return -c/2 * ((--t)*(t-2) - 1) + b;
|
57 |
-
},
|
58 |
-
easeInCubic: function (x, t, b, c, d) {
|
59 |
-
return c*(t/=d)*t*t + b;
|
60 |
-
},
|
61 |
-
easeOutCubic: function (x, t, b, c, d) {
|
62 |
-
return c*((t=t/d-1)*t*t + 1) + b;
|
63 |
-
},
|
64 |
-
easeInOutCubic: function (x, t, b, c, d) {
|
65 |
-
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
66 |
-
return c/2*((t-=2)*t*t + 2) + b;
|
67 |
-
},
|
68 |
-
easeInQuart: function (x, t, b, c, d) {
|
69 |
-
return c*(t/=d)*t*t*t + b;
|
70 |
-
},
|
71 |
-
easeOutQuart: function (x, t, b, c, d) {
|
72 |
-
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
73 |
-
},
|
74 |
-
easeInOutQuart: function (x, t, b, c, d) {
|
75 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
76 |
-
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
77 |
-
},
|
78 |
-
easeInQuint: function (x, t, b, c, d) {
|
79 |
-
return c*(t/=d)*t*t*t*t + b;
|
80 |
-
},
|
81 |
-
easeOutQuint: function (x, t, b, c, d) {
|
82 |
-
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
83 |
-
},
|
84 |
-
easeInOutQuint: function (x, t, b, c, d) {
|
85 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
86 |
-
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
87 |
-
},
|
88 |
-
easeInSine: function (x, t, b, c, d) {
|
89 |
-
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
90 |
-
},
|
91 |
-
easeOutSine: function (x, t, b, c, d) {
|
92 |
-
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
93 |
-
},
|
94 |
-
easeInOutSine: function (x, t, b, c, d) {
|
95 |
-
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
96 |
-
},
|
97 |
-
easeInExpo: function (x, t, b, c, d) {
|
98 |
-
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
99 |
-
},
|
100 |
-
easeOutExpo: function (x, t, b, c, d) {
|
101 |
-
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
102 |
-
},
|
103 |
-
easeInOutExpo: function (x, t, b, c, d) {
|
104 |
-
if (t==0) return b;
|
105 |
-
if (t==d) return b+c;
|
106 |
-
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
107 |
-
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
108 |
-
},
|
109 |
-
easeInCirc: function (x, t, b, c, d) {
|
110 |
-
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
111 |
-
},
|
112 |
-
easeOutCirc: function (x, t, b, c, d) {
|
113 |
-
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
114 |
-
},
|
115 |
-
easeInOutCirc: function (x, t, b, c, d) {
|
116 |
-
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
117 |
-
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
118 |
-
},
|
119 |
-
easeInElastic: function (x, t, b, c, d) {
|
120 |
-
var s=1.70158;var p=0;var a=c;
|
121 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
122 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
123 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
124 |
-
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
125 |
-
},
|
126 |
-
easeOutElastic: function (x, t, b, c, d) {
|
127 |
-
var s=1.70158;var p=0;var a=c;
|
128 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
129 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
130 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
131 |
-
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
132 |
-
},
|
133 |
-
easeInOutElastic: function (x, t, b, c, d) {
|
134 |
-
var s=1.70158;var p=0;var a=c;
|
135 |
-
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
136 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
137 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
138 |
-
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
139 |
-
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
140 |
-
},
|
141 |
-
easeInBack: function (x, t, b, c, d, s) {
|
142 |
-
if (s == undefined) s = 1.70158;
|
143 |
-
return c*(t/=d)*t*((s+1)*t - s) + b;
|
144 |
-
},
|
145 |
-
easeOutBack: function (x, t, b, c, d, s) {
|
146 |
-
if (s == undefined) s = 1.70158;
|
147 |
-
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
148 |
-
},
|
149 |
-
easeInOutBack: function (x, t, b, c, d, s) {
|
150 |
-
if (s == undefined) s = 1.70158;
|
151 |
-
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
152 |
-
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
153 |
-
},
|
154 |
-
easeInBounce: function (x, t, b, c, d) {
|
155 |
-
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
156 |
-
},
|
157 |
-
easeOutBounce: function (x, t, b, c, d) {
|
158 |
-
if ((t/=d) < (1/2.75)) {
|
159 |
-
return c*(7.5625*t*t) + b;
|
160 |
-
} else if (t < (2/2.75)) {
|
161 |
-
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
162 |
-
} else if (t < (2.5/2.75)) {
|
163 |
-
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
164 |
-
} else {
|
165 |
-
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
166 |
-
}
|
167 |
-
},
|
168 |
-
easeInOutBounce: function (x, t, b, c, d) {
|
169 |
-
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
170 |
-
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
171 |
-
}
|
172 |
-
});
|
173 |
-
|
174 |
-
/*
|
175 |
-
*
|
176 |
-
* TERMS OF USE - EASING EQUATIONS
|
177 |
-
*
|
178 |
-
* Open source under the BSD License.
|
179 |
-
*
|
180 |
-
* Copyright © 2001 Robert Penner
|
181 |
-
* All rights reserved.
|
182 |
-
*
|
183 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
184 |
-
* are permitted provided that the following conditions are met:
|
185 |
-
*
|
186 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
187 |
-
* conditions and the following disclaimer.
|
188 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
189 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
190 |
-
* provided with the distribution.
|
191 |
-
*
|
192 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
193 |
-
* or promote products derived from this software without specific prior written permission.
|
194 |
-
*
|
195 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
196 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
197 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
198 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
199 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
200 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
201 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
202 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
203 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
204 |
-
*
|
205 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/jquery.ui.totop.js
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
|--------------------------------------------------------------------------
|
3 |
-
| UItoTop jQuery Plugin ver 1.1
|
4 |
-
| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/
|
5 |
-
| By Matt Varone.
|
6 |
-
| Thanks to Remy Tourbiez
|
7 |
-
|--------------------------------------------------------------------------
|
8 |
-
*/
|
9 |
-
|
10 |
-
(function(jQuery){
|
11 |
-
jQuery.fn.UItoTop = function(options) {
|
12 |
-
|
13 |
-
var defaults = {
|
14 |
-
text: 'To Top',
|
15 |
-
min: 200,
|
16 |
-
inDelay:600,
|
17 |
-
outDelay:400,
|
18 |
-
containerID: 'toTop',
|
19 |
-
containerHoverID: 'toTopHover',
|
20 |
-
scrollSpeed: 1200,
|
21 |
-
easingType: 'linear'
|
22 |
-
};
|
23 |
-
|
24 |
-
var settings = jQuery.extend(defaults, options);
|
25 |
-
var containerIDhash = '#'+settings.containerID;
|
26 |
-
var containerHoverIDHash = '#'+settings.containerHoverID;
|
27 |
-
|
28 |
-
jQuery('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');
|
29 |
-
jQuery(containerIDhash).hide().click(function(){
|
30 |
-
jQuery('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
|
31 |
-
jQuery('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.Outdelay, settings.easingType);
|
32 |
-
return false;
|
33 |
-
})
|
34 |
-
.prepend('<span id="'+settings.containerHoverID+'"></span>')
|
35 |
-
.hover(function() {
|
36 |
-
jQuery(containerHoverIDHash, this).stop().animate({
|
37 |
-
'opacity': 1
|
38 |
-
}, 600, 'linear');
|
39 |
-
}, function() {
|
40 |
-
jQuery(containerHoverIDHash, this).stop().animate({
|
41 |
-
'opacity': 0
|
42 |
-
}, 700, 'linear');
|
43 |
-
});
|
44 |
-
|
45 |
-
jQuery(window).scroll(function() {
|
46 |
-
var sd = jQuery(window).scrollTop();
|
47 |
-
if(typeof document.body.style.maxHeight === "undefined") {
|
48 |
-
jQuery(containerIDhash).css({
|
49 |
-
'position': 'absolute',
|
50 |
-
'top': jQuery(window).scrollTop() + jQuery(window).height() - 50
|
51 |
-
});
|
52 |
-
}
|
53 |
-
if ( sd > settings.min )
|
54 |
-
jQuery(containerIDhash).fadeIn(settings.inDelay);
|
55 |
-
else
|
56 |
-
jQuery(containerIDhash).fadeOut(settings.Outdelay);
|
57 |
-
});
|
58 |
-
|
59 |
-
};
|
60 |
-
})(jQuery);
|
61 |
-
|
62 |
-
jQuery().ready(function() { jQuery().UItoTop(); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Dynamic "To Top" Plugin ===
|
2 |
Contributors: sksmatt
|
3 |
Donate link: http://www.mattvarone.com
|
4 |
-
Tags: Dynamic, UI, Scroll, To top
|
5 |
Requires at least: 2.5
|
6 |
-
Tested up to:
|
7 |
-
Stable tag:
|
8 |
|
9 |
Adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
|
10 |
|
@@ -12,9 +12,14 @@ Adds an automatic and dynamic "To Top" button to easily scroll long pages back t
|
|
12 |
|
13 |
This plugin for WordPress adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
|
14 |
|
15 |
-
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
== Installation ==
|
20 |
|
@@ -26,5 +31,7 @@ Based on [UiTotop jQuery Plugin](http://www.mattvarone.com/web-design/uitotop-jq
|
|
26 |
|
27 |
== Screenshots ==
|
28 |
|
29 |
-
1. Dynamic To Top
|
30 |
-
2. Dynamic To Top
|
|
|
|
1 |
=== Dynamic "To Top" Plugin ===
|
2 |
Contributors: sksmatt
|
3 |
Donate link: http://www.mattvarone.com
|
4 |
+
Tags: Dynamic, UI, Scroll, To top, Automatic
|
5 |
Requires at least: 2.5
|
6 |
+
Tested up to: 3.1.2
|
7 |
+
Stable tag: 3.1
|
8 |
|
9 |
Adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
|
10 |
|
12 |
|
13 |
This plugin for WordPress adds an automatic and dynamic "To Top" button to easily scroll long pages back to the top.
|
14 |
|
15 |
+
It features an intuitive control panel to style and adjust to each website's need. The button only appears for JS enabled browsers and can be optionally disabled for mobile visitors.
|
16 |
|
17 |
+
* Image and text version supported.
|
18 |
+
* Elegant 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 |
|
24 |
== Installation ==
|
25 |
|
31 |
|
32 |
== Screenshots ==
|
33 |
|
34 |
+
1. Dynamic To Top button version in action.
|
35 |
+
2. Dynamic To Top text version in action.
|
36 |
+
3. Dynamic To Top settings page on button mode.
|
37 |
+
4. Dynamic To Top settings page on text mode.
|
screenshot-1.jpg
CHANGED
Binary file
|
screenshot-2.jpg
CHANGED
Binary file
|
screenshot-3.jpg
ADDED
Binary file
|
screenshot-4.jpg
ADDED
Binary file
|