Version Description
- jQuery deprecation fixes.
- Compatibility fixes.
- SiteGround conflict fix.
Download this release
Release Info
Developer | syammohanm |
Plugin | WPFront Scroll Top |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- classes/base/class-wpfront-options-base.php +1 -0
- classes/class-wpfront-scroll-top-options.php +13 -11
- classes/class-wpfront-scroll-top.php +457 -480
- css/options.css +30 -2
- css/options.min.css +1 -2
- css/wpfront-scroll-top.min.css +1 -1
- images/icons/1.png +0 -0
- images/icons/10.png +0 -0
- images/icons/101.png +0 -0
- images/icons/102.png +0 -0
- images/icons/103.png +0 -0
- images/icons/104.png +0 -0
- images/icons/105.png +0 -0
- images/icons/106.png +0 -0
- images/icons/107.png +0 -0
- images/icons/108.png +0 -0
- images/icons/109.png +0 -0
- images/icons/11.png +0 -0
- images/icons/110.png +0 -0
- images/icons/111.png +0 -0
- images/icons/112.png +0 -0
- images/icons/113.png +0 -0
- images/icons/114.png +0 -0
- images/icons/115.png +0 -0
- images/icons/116.png +0 -0
- images/icons/117.png +0 -0
- images/icons/118.png +0 -0
- images/icons/119.png +0 -0
- images/icons/12.png +0 -0
- images/icons/13.png +0 -0
- images/icons/14.png +0 -0
- images/icons/15.png +0 -0
- images/icons/16.png +0 -0
- images/icons/17.png +0 -0
- images/icons/18.png +0 -0
- images/icons/19.png +0 -0
- images/icons/2.png +0 -0
- images/icons/21.png +0 -0
- images/icons/22.png +0 -0
- images/icons/23.png +0 -0
- images/icons/24.png +0 -0
- images/icons/25.png +0 -0
- images/icons/26.png +0 -0
- images/icons/28.png +0 -0
- images/icons/3.png +0 -0
- images/icons/30.png +0 -0
- images/icons/33.png +0 -0
- images/icons/34.png +0 -0
- images/icons/35.png +0 -0
- images/icons/36.png +0 -0
- images/icons/37.png +0 -0
- images/icons/38.png +0 -0
- images/icons/39.png +0 -0
- images/icons/4.png +0 -0
- images/icons/40.png +0 -0
- images/icons/41.png +0 -0
- images/icons/42.png +0 -0
- images/icons/43.png +0 -0
- images/icons/44.png +0 -0
- images/icons/46.png +0 -0
- images/icons/47.png +0 -0
- images/icons/48.png +0 -0
- images/icons/49.png +0 -0
- images/icons/5.PNG +0 -0
- images/icons/50.png +0 -0
- images/icons/51.png +0 -0
- images/icons/52.png +0 -0
- images/icons/53.png +0 -0
- images/icons/54.png +0 -0
- images/icons/55.png +0 -0
- images/icons/57.png +0 -0
- images/icons/58.png +0 -0
- images/icons/59.png +0 -0
- images/icons/6.png +0 -0
- images/icons/60.png +0 -0
- images/icons/61.png +0 -0
- images/icons/62.png +0 -0
- images/icons/7.png +0 -0
- images/icons/95.png +0 -0
- js/options.js +93 -93
- js/options.min.js +4 -2
- js/wpfront-scroll-top.js +15 -16
- js/wpfront-scroll-top.min.js +4 -2
- readme.txt +10 -2
- templates/options-template.php +736 -437
- templates/scroll-top-template.php +135 -68
- uninstall.php +4 -4
- wpfront-scroll-top.php +3 -1
classes/base/class-wpfront-options-base.php
CHANGED
@@ -121,6 +121,7 @@ class WPFront_Options_Base_ST {
|
|
121 |
}
|
122 |
|
123 |
switch ($type) {
|
|
|
124 |
case 'bool':
|
125 |
return (bool) $value;
|
126 |
case 'int':
|
121 |
}
|
122 |
|
123 |
switch ($type) {
|
124 |
+
case 'bit':
|
125 |
case 'bool':
|
126 |
return (bool) $value;
|
127 |
case 'int':
|
classes/class-wpfront-scroll-top-options.php
CHANGED
@@ -62,7 +62,7 @@ class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
|
62 |
$this->addOption('button_action_element_selector', 'string', '')->label(__('Element CSS Selector', 'wpfront-scroll-top'));
|
63 |
$this->addOption('button_action_container_selector', 'string', 'html, body', array($this, 'button_action_container_selector'))->label(__('Scroll Container CSS Selector', 'wpfront-scroll-top'));
|
64 |
$this->addOption('button_action_element_offset', 'int', 0)->label(__('Offset', 'wpfront-scroll-top'));
|
65 |
-
|
66 |
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->label(__('Location', 'wpfront-scroll-top'));
|
67 |
$this->addOption('marginX', 'int', 20)->label(__('Margin X', 'wpfront-scroll-top'));
|
68 |
$this->addOption('marginY', 'int', 20)->label(__('Margin Y', 'wpfront-scroll-top'));
|
@@ -85,11 +85,13 @@ class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
|
85 |
|
86 |
$this->addOption('image', 'string', '1.png');
|
87 |
$this->addOption('custom_url', 'string', '');
|
|
|
|
|
88 |
}
|
89 |
|
90 |
public function text_button_hover_color() {
|
91 |
$color = parent::text_button_hover_color();
|
92 |
-
if(empty($color))
|
93 |
return $this->text_button_background_color();
|
94 |
|
95 |
return $color;
|
@@ -98,12 +100,12 @@ class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
|
98 |
public function include_pages() {
|
99 |
$pages = parent::include_pages();
|
100 |
|
101 |
-
if(strpos($pages, '.') === FALSE)
|
102 |
return $pages;
|
103 |
|
104 |
$pages = explode(',', $pages);
|
105 |
|
106 |
-
for($i = 0; $i < count($pages); $i++) {
|
107 |
$e = explode('.', $pages[$i]);
|
108 |
$pages[$i] = $e[1];
|
109 |
}
|
@@ -114,12 +116,12 @@ class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
|
114 |
public function exclude_pages() {
|
115 |
$pages = parent::exclude_pages();
|
116 |
|
117 |
-
if(strpos($pages, '.') === FALSE)
|
118 |
return $pages;
|
119 |
|
120 |
$pages = explode(',', $pages);
|
121 |
|
122 |
-
for($i = 0; $i < count($pages); $i++) {
|
123 |
$e = explode('.', $pages[$i]);
|
124 |
$pages[$i] = $e[1];
|
125 |
}
|
@@ -153,7 +155,7 @@ class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
|
153 |
|
154 |
return 'image';
|
155 |
}
|
156 |
-
|
157 |
protected function validate_button_action($arg) {
|
158 |
if ($arg == 'element' || $arg == 'url')
|
159 |
return $arg;
|
@@ -182,12 +184,12 @@ class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
|
182 |
|
183 |
return $arg;
|
184 |
}
|
185 |
-
|
186 |
protected function button_action_container_selector($args) {
|
187 |
-
if(trim($args) === "")
|
188 |
return "html, body";
|
189 |
-
|
190 |
return $args;
|
191 |
}
|
192 |
|
193 |
-
}
|
62 |
$this->addOption('button_action_element_selector', 'string', '')->label(__('Element CSS Selector', 'wpfront-scroll-top'));
|
63 |
$this->addOption('button_action_container_selector', 'string', 'html, body', array($this, 'button_action_container_selector'))->label(__('Scroll Container CSS Selector', 'wpfront-scroll-top'));
|
64 |
$this->addOption('button_action_element_offset', 'int', 0)->label(__('Offset', 'wpfront-scroll-top'));
|
65 |
+
|
66 |
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->label(__('Location', 'wpfront-scroll-top'));
|
67 |
$this->addOption('marginX', 'int', 20)->label(__('Margin X', 'wpfront-scroll-top'));
|
68 |
$this->addOption('marginY', 'int', 20)->label(__('Margin Y', 'wpfront-scroll-top'));
|
85 |
|
86 |
$this->addOption('image', 'string', '1.png');
|
87 |
$this->addOption('custom_url', 'string', '');
|
88 |
+
|
89 |
+
$this->addOption('attach_on_shutdown', 'bit', false)->label(__('Attach on Shutdown', 'wpfront-scroll-top'));
|
90 |
}
|
91 |
|
92 |
public function text_button_hover_color() {
|
93 |
$color = parent::text_button_hover_color();
|
94 |
+
if (empty($color))
|
95 |
return $this->text_button_background_color();
|
96 |
|
97 |
return $color;
|
100 |
public function include_pages() {
|
101 |
$pages = parent::include_pages();
|
102 |
|
103 |
+
if (strpos($pages, '.') === FALSE)
|
104 |
return $pages;
|
105 |
|
106 |
$pages = explode(',', $pages);
|
107 |
|
108 |
+
for ($i = 0; $i < count($pages); $i++) {
|
109 |
$e = explode('.', $pages[$i]);
|
110 |
$pages[$i] = $e[1];
|
111 |
}
|
116 |
public function exclude_pages() {
|
117 |
$pages = parent::exclude_pages();
|
118 |
|
119 |
+
if (strpos($pages, '.') === FALSE)
|
120 |
return $pages;
|
121 |
|
122 |
$pages = explode(',', $pages);
|
123 |
|
124 |
+
for ($i = 0; $i < count($pages); $i++) {
|
125 |
$e = explode('.', $pages[$i]);
|
126 |
$pages[$i] = $e[1];
|
127 |
}
|
155 |
|
156 |
return 'image';
|
157 |
}
|
158 |
+
|
159 |
protected function validate_button_action($arg) {
|
160 |
if ($arg == 'element' || $arg == 'url')
|
161 |
return $arg;
|
184 |
|
185 |
return $arg;
|
186 |
}
|
187 |
+
|
188 |
protected function button_action_container_selector($args) {
|
189 |
+
if (trim($args) === "")
|
190 |
return "html, body";
|
191 |
+
|
192 |
return $args;
|
193 |
}
|
194 |
|
195 |
+
}
|
classes/class-wpfront-scroll-top.php
CHANGED
@@ -1,480 +1,457 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
WPFront Scroll Top Plugin
|
5 |
-
Copyright (C) 2013, WPFront.com
|
6 |
-
Website: wpfront.com
|
7 |
-
Contact: syam@wpfront.com
|
8 |
-
|
9 |
-
WPFront Scroll Top Plugin is distributed under the GNU General Public License, Version 3,
|
10 |
-
June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
|
11 |
-
St, Fifth Floor, Boston, MA 02110, USA
|
12 |
-
|
13 |
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
14 |
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
15 |
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
16 |
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
17 |
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
18 |
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
19 |
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
20 |
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
21 |
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
22 |
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace WPFront\Scroll_Top;
|
26 |
-
|
27 |
-
require_once("class-wpfront-scroll-top-options.php");
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
*
|
33 |
-
*
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
const
|
41 |
-
const
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
protected $
|
48 |
-
protected $
|
49 |
-
protected $
|
50 |
-
protected $
|
51 |
-
protected $
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
$this->
|
71 |
-
$this->
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$this->
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
add_action('
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
add_action('
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
$jsRoot = $this->pluginURLRoot . 'js/';
|
194 |
-
wp_enqueue_script('
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
$styleRoot = $this->pluginURLRoot . 'css/';
|
203 |
-
wp_enqueue_style('
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
if (
|
328 |
-
|
329 |
-
}
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
if ($
|
336 |
-
|
337 |
-
}
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
if (
|
346 |
-
|
347 |
-
}
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
$
|
410 |
-
|
411 |
-
$
|
412 |
-
}
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
$this->FAQLink = $FAQLink;
|
459 |
-
|
460 |
-
add_filter('admin_footer_text', array($this, 'admin_footer_text'));
|
461 |
-
}
|
462 |
-
|
463 |
-
public function admin_footer_text($text) {
|
464 |
-
$settingsLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/' . $this->settingsLink, __('Settings Description', 'wpfront-scroll-top'));
|
465 |
-
$reviewLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wordpress.org/support/plugin/' . self::PLUGIN_SLUG . '/reviews/', __('Write a Review', 'wpfront-scroll-top'));
|
466 |
-
$donateLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/donate/', __('Buy me a Beer or Coffee', 'wpfront-scroll-top'));
|
467 |
-
|
468 |
-
return sprintf('%s | %s | %s | %s', $settingsLink, $reviewLink, $donateLink, $text);
|
469 |
-
}
|
470 |
-
|
471 |
-
//for compatibility
|
472 |
-
public function submit_button() {
|
473 |
-
if (function_exists('submit_button')) {
|
474 |
-
submit_button();
|
475 |
-
} else {
|
476 |
-
echo '<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="' . __('Save Changes', 'wpfront-scroll-top') . '" /></p>';
|
477 |
-
}
|
478 |
-
}
|
479 |
-
}
|
480 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
WPFront Scroll Top Plugin
|
5 |
+
Copyright (C) 2013, WPFront.com
|
6 |
+
Website: wpfront.com
|
7 |
+
Contact: syam@wpfront.com
|
8 |
+
|
9 |
+
WPFront Scroll Top Plugin is distributed under the GNU General Public License, Version 3,
|
10 |
+
June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
|
11 |
+
St, Fifth Floor, Boston, MA 02110, USA
|
12 |
+
|
13 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
14 |
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
15 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
16 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
17 |
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
18 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
19 |
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
20 |
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
21 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
22 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace WPFront\Scroll_Top;
|
26 |
+
|
27 |
+
require_once("class-wpfront-scroll-top-options.php");
|
28 |
+
require_once(dirname(__DIR__) . '/templates/scroll-top-template.php');
|
29 |
+
require_once(dirname(__DIR__) . '/templates/options-template.php');
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Main class of WPFront Scroll Top plugin
|
33 |
+
*
|
34 |
+
* @author Syam Mohan <syam@wpfront.com>
|
35 |
+
* @copyright 2013 WPFront.com
|
36 |
+
*/
|
37 |
+
class WPFront_Scroll_Top {
|
38 |
+
|
39 |
+
//Constants
|
40 |
+
const VERSION = '2.0.3.03232';
|
41 |
+
const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
|
42 |
+
const OPTION_NAME = 'wpfront-scroll-top-options';
|
43 |
+
const PLUGIN_SLUG = 'wpfront-scroll-top';
|
44 |
+
const PLUGIN_FILE = 'wpfront-scroll-top/wpfront-scroll-top.php';
|
45 |
+
|
46 |
+
//Variables
|
47 |
+
protected $iconsDIR = '/tmp/icons/';
|
48 |
+
protected $iconsURL = '//tmp/icons/';
|
49 |
+
protected $pluginDIRRoot = '/tmp/';
|
50 |
+
protected $pluginURLRoot = '//tmp/';
|
51 |
+
protected $options;
|
52 |
+
protected $markupLoaded;
|
53 |
+
protected $scriptLoaded;
|
54 |
+
protected $min_file_suffix;
|
55 |
+
private static $instance = null;
|
56 |
+
|
57 |
+
protected function __construct() {
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
public static function Instance() {
|
62 |
+
if (empty(self::$instance)) {
|
63 |
+
self::$instance = new WPFront_Scroll_Top();
|
64 |
+
}
|
65 |
+
|
66 |
+
return self::$instance;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function init($pluginFile = null) {
|
70 |
+
$this->markupLoaded = FALSE;
|
71 |
+
$this->min_file_suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
|
72 |
+
|
73 |
+
//Root variables
|
74 |
+
$this->pluginURLRoot = plugins_url() . '/' . self::PLUGIN_SLUG . '/';
|
75 |
+
$this->iconsURL = $this->pluginURLRoot . 'images/icons/';
|
76 |
+
$this->pluginDIRRoot = plugin_dir_path($pluginFile);
|
77 |
+
$this->iconsDIR = $this->pluginDIRRoot . 'images/icons/';
|
78 |
+
|
79 |
+
add_action('plugins_loaded', array($this, 'plugins_loaded'));
|
80 |
+
|
81 |
+
$this->add_activation_redirect();
|
82 |
+
|
83 |
+
if (is_admin()) {
|
84 |
+
add_action('admin_init', array($this, 'admin_init'));
|
85 |
+
add_action('admin_menu', array($this, 'admin_menu'));
|
86 |
+
add_filter('plugin_action_links', array($this, 'action_links'), 10, 2);
|
87 |
+
|
88 |
+
add_action('admin_footer', array($this, 'write_markup'));
|
89 |
+
} else {
|
90 |
+
add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
|
91 |
+
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
|
92 |
+
|
93 |
+
add_action('wp_footer', array($this, 'write_markup'));
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
public function action_links($links, $file) {
|
98 |
+
if ($file == self::PLUGIN_FILE) {
|
99 |
+
$settings_link = '<a id="wpfront-scroll-top-settings-link" href="' . menu_page_url(self::PLUGIN_SLUG, FALSE) . '">' . __('Settings', 'wpfront-scroll-top') . '</a>';
|
100 |
+
array_unshift($links, $settings_link);
|
101 |
+
}
|
102 |
+
return $links;
|
103 |
+
}
|
104 |
+
|
105 |
+
protected function add_activation_redirect() {
|
106 |
+
add_action('activated_plugin', array($this, 'activated_plugin_callback'));
|
107 |
+
add_action('admin_init', array($this, 'admin_init_callback'), 999999);
|
108 |
+
}
|
109 |
+
|
110 |
+
public function activated_plugin_callback($plugin) {
|
111 |
+
if ($plugin !== self::PLUGIN_FILE) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
if (is_network_admin() || isset($_GET['activate-multi'])) {
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
$key = self::PLUGIN_SLUG . '-activation-redirect';
|
120 |
+
add_option($key, TRUE);
|
121 |
+
}
|
122 |
+
|
123 |
+
public function admin_init_callback() {
|
124 |
+
$key = self::PLUGIN_SLUG . '-activation-redirect';
|
125 |
+
|
126 |
+
if (get_option($key, FALSE)) {
|
127 |
+
delete_option($key);
|
128 |
+
|
129 |
+
if (is_network_admin() || isset($_GET['activate-multi'])) {
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
|
133 |
+
wp_safe_redirect(menu_page_url(self::PLUGIN_SLUG, FALSE));
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
//add scripts
|
138 |
+
public function enqueue_scripts() {
|
139 |
+
if ($this->enabled() == FALSE) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
$jsRoot = $this->pluginURLRoot . 'js/';
|
144 |
+
|
145 |
+
wp_enqueue_script('jquery');
|
146 |
+
wp_enqueue_script('wpfront-scroll-top', $jsRoot . 'wpfront-scroll-top' . $this->min_file_suffix . '.js', array('jquery'), self::VERSION, TRUE);
|
147 |
+
|
148 |
+
$this->scriptLoaded = TRUE;
|
149 |
+
}
|
150 |
+
|
151 |
+
//add styles
|
152 |
+
public function enqueue_styles() {
|
153 |
+
if ($this->enabled() == FALSE) {
|
154 |
+
return;
|
155 |
+
}
|
156 |
+
|
157 |
+
$cssRoot = $this->pluginURLRoot . 'css/';
|
158 |
+
|
159 |
+
wp_enqueue_style('wpfront-scroll-top', $cssRoot . 'wpfront-scroll-top' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
160 |
+
|
161 |
+
if ($this->options->button_style() == 'font-awesome') {
|
162 |
+
if (!$this->options->fa_button_exclude_URL() || is_admin()) {
|
163 |
+
$url = trim($this->options->fa_button_URL());
|
164 |
+
$ver = FALSE;
|
165 |
+
if (empty($url)) {
|
166 |
+
$url = '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css';
|
167 |
+
$ver = '4.7.0';
|
168 |
+
}
|
169 |
+
wp_enqueue_style('font-awesome', $url, array(), $ver);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
public function admin_init() {
|
175 |
+
register_setting(self::OPTIONS_GROUP_NAME, self::OPTION_NAME);
|
176 |
+
|
177 |
+
$this->enqueue_styles();
|
178 |
+
$this->enqueue_scripts();
|
179 |
+
}
|
180 |
+
|
181 |
+
public function admin_menu() {
|
182 |
+
$page_hook_suffix = add_options_page(__('WPFront Scroll Top', 'wpfront-scroll-top'), __('Scroll Top', 'wpfront-scroll-top'), 'manage_options', self::PLUGIN_SLUG, array($this, 'options_page'));
|
183 |
+
|
184 |
+
add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_options_scripts'));
|
185 |
+
add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_options_styles'));
|
186 |
+
}
|
187 |
+
|
188 |
+
public function enqueue_options_scripts() {
|
189 |
+
wp_enqueue_media();
|
190 |
+
|
191 |
+
$this->enqueue_scripts();
|
192 |
+
|
193 |
+
$jsRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/js/';
|
194 |
+
wp_enqueue_script('jquery.eyecon.colorpicker', $jsRoot . 'colorpicker' . $this->min_file_suffix . '.js', array('jquery'), self::VERSION);
|
195 |
+
|
196 |
+
$jsRoot = $this->pluginURLRoot . 'js/';
|
197 |
+
wp_enqueue_script('wpfront-scroll-top-options', $jsRoot . 'options' . $this->min_file_suffix . '.js', array('jquery'), self::VERSION);
|
198 |
+
}
|
199 |
+
|
200 |
+
//options page styles
|
201 |
+
public function enqueue_options_styles() {
|
202 |
+
$styleRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/css/';
|
203 |
+
wp_enqueue_style('jquery.eyecon.colorpicker', $styleRoot . 'colorpicker' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
204 |
+
|
205 |
+
$styleRoot = $this->pluginURLRoot . 'css/';
|
206 |
+
wp_enqueue_style('wpfront-scroll-top-options', $styleRoot . 'options' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
207 |
+
}
|
208 |
+
|
209 |
+
public function set_options($options = null) {
|
210 |
+
if ($options === null) {
|
211 |
+
$options = new WPFront_Scroll_Top_Options(self::OPTION_NAME, self::PLUGIN_SLUG);
|
212 |
+
}
|
213 |
+
|
214 |
+
$this->options = $options;
|
215 |
+
}
|
216 |
+
|
217 |
+
public function get_options() {
|
218 |
+
return $this->options;
|
219 |
+
}
|
220 |
+
|
221 |
+
public function plugins_loaded() {
|
222 |
+
//load plugin options
|
223 |
+
$this->set_options();
|
224 |
+
|
225 |
+
if ($this->options->javascript_async()) {
|
226 |
+
add_filter('script_loader_tag', array($this, 'script_loader_tag'), 999999, 3);
|
227 |
+
}
|
228 |
+
|
229 |
+
if (!is_admin()) {
|
230 |
+
if ($this->options->attach_on_shutdown()) {
|
231 |
+
add_action('shutdown', array($this, 'shutdown_callback'));
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
public function script_loader_tag($tag, $handle, $src) {
|
237 |
+
if ($handle === 'wpfront-scroll-top') {
|
238 |
+
return '<script type="text/javascript" src="' . $src . '" id="wpfront-scroll-top-js" async="async" defer="defer"></script>' . "\n";
|
239 |
+
}
|
240 |
+
|
241 |
+
return $tag;
|
242 |
+
}
|
243 |
+
|
244 |
+
public function shutdown_callback() {
|
245 |
+
if ($this->markupLoaded) {
|
246 |
+
return;
|
247 |
+
}
|
248 |
+
|
249 |
+
$headers = $this->get_headers();
|
250 |
+
$flag = FALSE;
|
251 |
+
foreach ($headers as $value) {
|
252 |
+
$value = strtolower(str_replace(' ', '', $value));
|
253 |
+
if (strpos($value, 'content-type:text/html') === 0) {
|
254 |
+
$flag = TRUE;
|
255 |
+
break;
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
if ($flag) {
|
260 |
+
$this->write_markup();
|
261 |
+
}
|
262 |
+
}
|
263 |
+
|
264 |
+
protected function get_headers() {
|
265 |
+
return headers_list();
|
266 |
+
}
|
267 |
+
|
268 |
+
//writes the html and script for the button
|
269 |
+
public function write_markup() {
|
270 |
+
if ($this->markupLoaded) {
|
271 |
+
return;
|
272 |
+
}
|
273 |
+
|
274 |
+
if (!$this->scriptLoaded) {
|
275 |
+
return;
|
276 |
+
}
|
277 |
+
|
278 |
+
if ($this->doing_ajax()) {
|
279 |
+
return;
|
280 |
+
}
|
281 |
+
|
282 |
+
if ($this->enabled()) {
|
283 |
+
if (is_admin()) {
|
284 |
+
$this->options->set_button_action('top');
|
285 |
+
}
|
286 |
+
|
287 |
+
$template = new WPFront_Scroll_Top_Template();
|
288 |
+
$template->write_markup($this);
|
289 |
+
}
|
290 |
+
|
291 |
+
$this->markupLoaded = TRUE;
|
292 |
+
}
|
293 |
+
|
294 |
+
protected function doing_ajax() {
|
295 |
+
if (defined('DOING_AJAX') && DOING_AJAX) {
|
296 |
+
return TRUE;
|
297 |
+
}
|
298 |
+
|
299 |
+
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
300 |
+
return TRUE;
|
301 |
+
}
|
302 |
+
|
303 |
+
if (!empty($_SERVER['REQUEST_URI']) && strtolower($_SERVER['REQUEST_URI']) == '/wp-admin/async-upload.php') {
|
304 |
+
return TRUE;
|
305 |
+
}
|
306 |
+
|
307 |
+
if (wp_doing_ajax()) {
|
308 |
+
return TRUE;
|
309 |
+
}
|
310 |
+
|
311 |
+
if (wp_is_json_request()) {
|
312 |
+
return TRUE;
|
313 |
+
}
|
314 |
+
|
315 |
+
if (wp_is_jsonp_request()) {
|
316 |
+
return TRUE;
|
317 |
+
}
|
318 |
+
|
319 |
+
if (wp_is_xml_request()) {
|
320 |
+
return TRUE;
|
321 |
+
}
|
322 |
+
|
323 |
+
if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
|
324 |
+
return TRUE;
|
325 |
+
}
|
326 |
+
|
327 |
+
if (defined('WP_CLI') && WP_CLI) {
|
328 |
+
return TRUE;
|
329 |
+
}
|
330 |
+
|
331 |
+
return FALSE;
|
332 |
+
}
|
333 |
+
|
334 |
+
public function apply_button_action_html($html) {
|
335 |
+
if ($this->options->button_action() == "url") {
|
336 |
+
return sprintf('<a href="%s">' . $html . '</a>', $this->options->button_action_page_url());
|
337 |
+
}
|
338 |
+
|
339 |
+
return $html;
|
340 |
+
}
|
341 |
+
|
342 |
+
protected function enabled() {
|
343 |
+
$enabled = TRUE;
|
344 |
+
|
345 |
+
if ($enabled && !$this->options->enabled()) {
|
346 |
+
$enabled = FALSE;
|
347 |
+
}
|
348 |
+
|
349 |
+
if ($enabled && $this->options->hide_wpadmin() && is_admin()) {
|
350 |
+
$enabled = FALSE;
|
351 |
+
}
|
352 |
+
|
353 |
+
if ($enabled && !$this->filter_pages()) {
|
354 |
+
$enabled = FALSE;
|
355 |
+
}
|
356 |
+
|
357 |
+
$enabled = apply_filters('wpfront_scroll_top_enabled', $enabled);
|
358 |
+
|
359 |
+
return $enabled;
|
360 |
+
}
|
361 |
+
|
362 |
+
public function filter_pages() {
|
363 |
+
if (is_admin()) {
|
364 |
+
return TRUE;
|
365 |
+
}
|
366 |
+
|
367 |
+
switch ($this->options->display_pages()) {
|
368 |
+
case 1:
|
369 |
+
return TRUE;
|
370 |
+
case 2:
|
371 |
+
case 3:
|
372 |
+
global $post;
|
373 |
+
$ID = FALSE;
|
374 |
+
if (is_home()) {
|
375 |
+
$ID = 'home';
|
376 |
+
} elseif (!empty($post)) {
|
377 |
+
$ID = $post->ID;
|
378 |
+
}
|
379 |
+
if ($this->options->display_pages() == 2) {
|
380 |
+
if ($ID !== FALSE) {
|
381 |
+
if ($this->filter_pages_contains($this->options->include_pages(), $ID) === FALSE) {
|
382 |
+
return FALSE;
|
383 |
+
} else {
|
384 |
+
return TRUE;
|
385 |
+
}
|
386 |
+
}
|
387 |
+
return FALSE;
|
388 |
+
}
|
389 |
+
if ($this->options->display_pages() == 3) {
|
390 |
+
if ($ID !== FALSE) {
|
391 |
+
if ($this->filter_pages_contains($this->options->exclude_pages(), $ID) === FALSE) {
|
392 |
+
return TRUE;
|
393 |
+
} else {
|
394 |
+
return FALSE;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
return TRUE;
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
return TRUE;
|
402 |
+
}
|
403 |
+
|
404 |
+
public function filter_pages_contains($list, $key) {
|
405 |
+
return strpos(',' . $list . ',', ',' . $key . ',');
|
406 |
+
}
|
407 |
+
|
408 |
+
public function image() {
|
409 |
+
$image = $this->options->image();
|
410 |
+
if ($image == 'custom') {
|
411 |
+
return $this->options->custom_url();
|
412 |
+
}
|
413 |
+
return $this->iconsURL . $image;
|
414 |
+
}
|
415 |
+
|
416 |
+
public function get_filter_objects() {
|
417 |
+
$objects = array();
|
418 |
+
|
419 |
+
$objects['home'] = __('[Page]', 'wpfront-scroll-top') . ' ' . __('Home', 'wpfront-scroll-top');
|
420 |
+
|
421 |
+
$pages = get_pages();
|
422 |
+
foreach ($pages as $page) {
|
423 |
+
$objects[$page->ID] = __('[Page]', 'wpfront-scroll-top') . ' ' . $page->post_title;
|
424 |
+
}
|
425 |
+
|
426 |
+
$posts = get_posts();
|
427 |
+
foreach ($posts as $post) {
|
428 |
+
$objects[$post->ID] = __('[Post]', 'wpfront-scroll-top') . ' ' . $post->post_title;
|
429 |
+
}
|
430 |
+
|
431 |
+
// $categories = get_categories();
|
432 |
+
// foreach ($categories as $category) {
|
433 |
+
// $objects['3.' . $category->cat_ID] = __('[Category]', 'wpfront-scroll-top') . ' ' . $category->cat_name;
|
434 |
+
// }
|
435 |
+
|
436 |
+
return $objects;
|
437 |
+
}
|
438 |
+
|
439 |
+
public function options_page() {
|
440 |
+
if (!current_user_can('manage_options')) {
|
441 |
+
wp_die(__('You do not have sufficient permissions to access this page.', 'wpfront-scroll-top'));
|
442 |
+
return;
|
443 |
+
}
|
444 |
+
|
445 |
+
$options_view = new WPFront_Scroll_Top_Options_View();
|
446 |
+
$options_view->view($this);
|
447 |
+
}
|
448 |
+
|
449 |
+
public function get_icon_dir() {
|
450 |
+
return $this->iconsDIR;
|
451 |
+
}
|
452 |
+
|
453 |
+
public function get_icon_url() {
|
454 |
+
return $this->iconsURL;
|
455 |
+
}
|
456 |
+
|
457 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/options.css
CHANGED
@@ -43,7 +43,7 @@
|
|
43 |
#wpfront-scroll-top-options table.form-table .color-selector-div
|
44 |
{
|
45 |
display: inline-block;
|
46 |
-
width:
|
47 |
}
|
48 |
|
49 |
#wpfront-scroll-top-options table.form-table .color-selector
|
@@ -51,13 +51,27 @@
|
|
51 |
vertical-align: middle;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
#wpfront-scroll-top-options table.form-table div.pages-selection
|
55 |
{
|
56 |
width: 70%;
|
57 |
height: 150px;
|
58 |
background-color: #fff;
|
59 |
overflow: auto;
|
60 |
-
|
61 |
border: 1px solid #dfdfdf;
|
62 |
-moz-border-radius: 4px;
|
63 |
-khtml-border-radius: 4px;
|
@@ -125,4 +139,18 @@
|
|
125 |
max-width: 650px;
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
43 |
#wpfront-scroll-top-options table.form-table .color-selector-div
|
44 |
{
|
45 |
display: inline-block;
|
46 |
+
width: 150px;
|
47 |
}
|
48 |
|
49 |
#wpfront-scroll-top-options table.form-table .color-selector
|
51 |
vertical-align: middle;
|
52 |
}
|
53 |
|
54 |
+
#wpfront-scroll-top-options input.color-selector-input
|
55 |
+
{
|
56 |
+
width: 75px;
|
57 |
+
height: 24px;
|
58 |
+
vertical-align: middle;
|
59 |
+
line-height: inherit;
|
60 |
+
min-height: 0;
|
61 |
+
}
|
62 |
+
|
63 |
+
.colorpicker input
|
64 |
+
{
|
65 |
+
min-height: 0;
|
66 |
+
}
|
67 |
+
|
68 |
#wpfront-scroll-top-options table.form-table div.pages-selection
|
69 |
{
|
70 |
width: 70%;
|
71 |
height: 150px;
|
72 |
background-color: #fff;
|
73 |
overflow: auto;
|
74 |
+
|
75 |
border: 1px solid #dfdfdf;
|
76 |
-moz-border-radius: 4px;
|
77 |
-khtml-border-radius: 4px;
|
139 |
max-width: 650px;
|
140 |
}
|
141 |
|
142 |
+
#wpfront-scroll-top-options #custom
|
143 |
+
{
|
144 |
+
margin-bottom: 0px;
|
145 |
+
}
|
146 |
+
|
147 |
+
#wpfront-scroll-top-options #media-library-button
|
148 |
+
{
|
149 |
+
min-height: 0px;
|
150 |
+
height: 24px;
|
151 |
+
margin-bottom: 5px;
|
152 |
+
line-height: inherit;
|
153 |
+
vertical-align: inherit;
|
154 |
+
}
|
155 |
+
|
156 |
|
css/options.min.css
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
|
2 |
-
#icon-wpfront-scroll-top{background:url("../images/settings32x32.png") no-repeat scroll 0 0 rgba(0,0,0,0)}#wpfront-scroll-top-options input.pixels{width:40px}#wpfront-scroll-top-options input.seconds{width:40px}#wpfront-scroll-top-options div.icons-container{display:inline-block;width:80%}#wpfront-scroll-top-options div.icons-container div{float:left;margin-right:20px;margin-bottom:10px;min-width:100px;min-height:80px;zoom:80%}#wpfront-scroll-top-options div.icons-container div.selected{background-color:silver}#wpfront-scroll-top-options div.icons-container div:hover{background-color:silver}#wpfront-scroll-top-options div.icons-container div input{vertical-align:top}#wpfront-scroll-top-options input.url{width:50%}#wpfront-scroll-top-options table.form-table .color-selector-div{display:inline-block;width:100px}#wpfront-scroll-top-options table.form-table .color-selector{vertical-align:middle}#wpfront-scroll-top-options table.form-table div.pages-selection{width:70%;height:150px;background-color:#fff;overflow:auto;border:1px solid #dfdfdf;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#wpfront-scroll-top-options table.form-table div.page-div{float:left;width:250px;padding:2px;white-space:nowrap;overflow:hidden}#wpfront-scroll-top-options input.post-id-list{width:70%}#wpfront-scroll-top-options div.button-action-container .alignment-holder{visibility:hidden}#wpfront-scroll-top-options div.button-action-container div.fields-container{display:table}#wpfront-scroll-top-options div.button-action-container div.fields-container.hidden{display:none}#wpfront-scroll-top-options div.button-action-container div.fields-container div{display:table-row}#wpfront-scroll-top-options div.button-action-container div.fields-container div span{display:table-cell}#wpfront-scroll-top-options div.button-action-container div.fields-container div span.description{display:inline}#wpfront-scroll-top-options div.button-action-container div.fields-container.url{width:100%}#wpfront-scroll-top-options div.button-action-container div.fields-container.url span.url{width:90%}#wpfront-scroll-top-options div.button-action-container div.fields-container.url span.url input.url{width:100%;max-width:650px}
|
1 |
+
#icon-wpfront-scroll-top{background:url("../images/settings32x32.png") no-repeat scroll 0 0 rgba(0,0,0,0)}#wpfront-scroll-top-options input.pixels{width:40px}#wpfront-scroll-top-options input.seconds{width:40px}#wpfront-scroll-top-options div.icons-container{display:inline-block;width:80%}#wpfront-scroll-top-options div.icons-container div{float:left;margin-right:20px;margin-bottom:10px;min-width:100px;min-height:80px;zoom:80%}#wpfront-scroll-top-options div.icons-container div.selected{background-color:silver}#wpfront-scroll-top-options div.icons-container div:hover{background-color:silver}#wpfront-scroll-top-options div.icons-container div input{vertical-align:top}#wpfront-scroll-top-options input.url{width:50%}#wpfront-scroll-top-options table.form-table .color-selector-div{display:inline-block;width:150px}#wpfront-scroll-top-options table.form-table .color-selector{vertical-align:middle}#wpfront-scroll-top-options input.color-selector-input{width:75px;height:24px;vertical-align:middle;line-height:inherit;min-height:0}.colorpicker input{min-height:0}#wpfront-scroll-top-options table.form-table div.pages-selection{width:70%;height:150px;background-color:#fff;overflow:auto;border:1px solid #dfdfdf;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#wpfront-scroll-top-options table.form-table div.page-div{float:left;width:250px;padding:2px;white-space:nowrap;overflow:hidden}#wpfront-scroll-top-options input.post-id-list{width:70%}#wpfront-scroll-top-options div.button-action-container .alignment-holder{visibility:hidden}#wpfront-scroll-top-options div.button-action-container div.fields-container{display:table}#wpfront-scroll-top-options div.button-action-container div.fields-container.hidden{display:none}#wpfront-scroll-top-options div.button-action-container div.fields-container div{display:table-row}#wpfront-scroll-top-options div.button-action-container div.fields-container div span{display:table-cell}#wpfront-scroll-top-options div.button-action-container div.fields-container div span.description{display:inline}#wpfront-scroll-top-options div.button-action-container div.fields-container.url{width:100%}#wpfront-scroll-top-options div.button-action-container div.fields-container.url span.url{width:90%}#wpfront-scroll-top-options div.button-action-container div.fields-container.url span.url input.url{width:100%;max-width:650px}#wpfront-scroll-top-options #custom{margin-bottom:0}#wpfront-scroll-top-options #media-library-button{min-height:0;height:24px;margin-bottom:5px;line-height:inherit;vertical-align:inherit}
|
|
css/wpfront-scroll-top.min.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
|
2 |
#wpfront-scroll-top-container{display:none;position:fixed;cursor:pointer;z-index:9999}#wpfront-scroll-top-container div.text-holder{padding:3px 10px;border-radius:3px;-webkit-border-radius:3px;-webkit-box-shadow:4px 4px 5px 0 rgba(50,50,50,0.5);-moz-box-shadow:4px 4px 5px 0 rgba(50,50,50,0.5);box-shadow:4px 4px 5px 0 rgba(50,50,50,0.5)}#wpfront-scroll-top-container a{outline-style:none;box-shadow:none;text-decoration:none}
|
1 |
+
|
2 |
#wpfront-scroll-top-container{display:none;position:fixed;cursor:pointer;z-index:9999}#wpfront-scroll-top-container div.text-holder{padding:3px 10px;border-radius:3px;-webkit-border-radius:3px;-webkit-box-shadow:4px 4px 5px 0 rgba(50,50,50,0.5);-moz-box-shadow:4px 4px 5px 0 rgba(50,50,50,0.5);box-shadow:4px 4px 5px 0 rgba(50,50,50,0.5)}#wpfront-scroll-top-container a{outline-style:none;box-shadow:none;text-decoration:none}
|
images/icons/1.png
CHANGED
Binary file
|
images/icons/10.png
CHANGED
Binary file
|
images/icons/101.png
CHANGED
Binary file
|
images/icons/102.png
CHANGED
Binary file
|
images/icons/103.png
CHANGED
Binary file
|
images/icons/104.png
CHANGED
Binary file
|
images/icons/105.png
CHANGED
Binary file
|
images/icons/106.png
CHANGED
Binary file
|
images/icons/107.png
CHANGED
Binary file
|
images/icons/108.png
CHANGED
Binary file
|
images/icons/109.png
CHANGED
Binary file
|
images/icons/11.png
CHANGED
Binary file
|
images/icons/110.png
CHANGED
Binary file
|
images/icons/111.png
CHANGED
Binary file
|
images/icons/112.png
CHANGED
Binary file
|
images/icons/113.png
CHANGED
Binary file
|
images/icons/114.png
CHANGED
Binary file
|
images/icons/115.png
CHANGED
Binary file
|
images/icons/116.png
CHANGED
Binary file
|
images/icons/117.png
CHANGED
Binary file
|
images/icons/118.png
CHANGED
Binary file
|
images/icons/119.png
CHANGED
Binary file
|
images/icons/12.png
CHANGED
Binary file
|
images/icons/13.png
CHANGED
Binary file
|
images/icons/14.png
CHANGED
Binary file
|
images/icons/15.png
CHANGED
Binary file
|
images/icons/16.png
CHANGED
Binary file
|
images/icons/17.png
CHANGED
Binary file
|
images/icons/18.png
CHANGED
Binary file
|
images/icons/19.png
CHANGED
Binary file
|
images/icons/2.png
CHANGED
Binary file
|
images/icons/21.png
CHANGED
Binary file
|
images/icons/22.png
CHANGED
Binary file
|
images/icons/23.png
CHANGED
Binary file
|
images/icons/24.png
CHANGED
Binary file
|
images/icons/25.png
CHANGED
Binary file
|
images/icons/26.png
CHANGED
Binary file
|
images/icons/28.png
CHANGED
Binary file
|
images/icons/3.png
CHANGED
Binary file
|
images/icons/30.png
CHANGED
Binary file
|
images/icons/33.png
CHANGED
Binary file
|
images/icons/34.png
CHANGED
Binary file
|
images/icons/35.png
CHANGED
Binary file
|
images/icons/36.png
CHANGED
Binary file
|
images/icons/37.png
CHANGED
Binary file
|
images/icons/38.png
CHANGED
Binary file
|
images/icons/39.png
CHANGED
Binary file
|
images/icons/4.png
CHANGED
Binary file
|
images/icons/40.png
CHANGED
Binary file
|
images/icons/41.png
CHANGED
Binary file
|
images/icons/42.png
CHANGED
Binary file
|
images/icons/43.png
CHANGED
Binary file
|
images/icons/44.png
CHANGED
Binary file
|
images/icons/46.png
CHANGED
Binary file
|
images/icons/47.png
CHANGED
Binary file
|
images/icons/48.png
CHANGED
Binary file
|
images/icons/49.png
CHANGED
Binary file
|
images/icons/5.PNG
CHANGED
Binary file
|
images/icons/50.png
CHANGED
Binary file
|
images/icons/51.png
CHANGED
Binary file
|
images/icons/52.png
CHANGED
Binary file
|
images/icons/53.png
CHANGED
Binary file
|
images/icons/54.png
CHANGED
Binary file
|
images/icons/55.png
CHANGED
Binary file
|
images/icons/57.png
CHANGED
Binary file
|
images/icons/58.png
CHANGED
Binary file
|
images/icons/59.png
CHANGED
Binary file
|
images/icons/6.png
CHANGED
Binary file
|
images/icons/60.png
CHANGED
Binary file
|
images/icons/61.png
CHANGED
Binary file
|
images/icons/62.png
CHANGED
Binary file
|
images/icons/7.png
CHANGED
Binary file
|
images/icons/95.png
CHANGED
Binary file
|
js/options.js
CHANGED
@@ -1,94 +1,94 @@
|
|
1 |
-
/*
|
2 |
-
WPFront Scroll Top Plugin
|
3 |
-
Copyright (C) 2013, WPFront.com
|
4 |
-
Website: wpfront.com
|
5 |
-
Contact: syam@wpfront.com
|
6 |
-
|
7 |
-
WPFront Scroll Top Plugin is distributed under the GNU General Public License, Version 3,
|
8 |
-
June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
|
9 |
-
St, Fifth Floor, Boston, MA 02110, USA
|
10 |
-
|
11 |
-
*/
|
12 |
-
|
13 |
-
(function () {
|
14 |
-
window.init_wpfront_scroll_top_options = function (settings) {
|
15 |
-
var $ = jQuery;
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
var $
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
$text
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
$('
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
(
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
if(mediaLibrary === null) {
|
72 |
-
mediaLibrary = wp.media.frames.file_frame = wp.media({
|
73 |
-
title: settings.label_choose_image,
|
74 |
-
multiple: false,
|
75 |
-
button: {
|
76 |
-
text: settings.label_select_image
|
77 |
-
}
|
78 |
-
}).on('select', function() {
|
79 |
-
var obj = mediaLibrary.state().get('selection').first().toJSON();
|
80 |
-
|
81 |
-
$('#custom').prop('checked', true);
|
82 |
-
$('#custom-url-textbox').val(obj.url);
|
83 |
-
|
84 |
-
if(obj.alt !== "")
|
85 |
-
$('#alt-textbox').val(obj.alt);
|
86 |
-
});
|
87 |
-
}
|
88 |
-
|
89 |
-
mediaLibrary.open();
|
90 |
-
return false;
|
91 |
-
});
|
92 |
-
})();
|
93 |
-
};
|
94 |
})();
|
1 |
+
/*
|
2 |
+
WPFront Scroll Top Plugin
|
3 |
+
Copyright (C) 2013, WPFront.com
|
4 |
+
Website: wpfront.com
|
5 |
+
Contact: syam@wpfront.com
|
6 |
+
|
7 |
+
WPFront Scroll Top Plugin is distributed under the GNU General Public License, Version 3,
|
8 |
+
June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
|
9 |
+
St, Fifth Floor, Boston, MA 02110, USA
|
10 |
+
|
11 |
+
*/
|
12 |
+
|
13 |
+
(function () {
|
14 |
+
window.init_wpfront_scroll_top_options = function (settings) {
|
15 |
+
var $ = jQuery;
|
16 |
+
var $divOptions = $('#wpfront-scroll-top-options');
|
17 |
+
|
18 |
+
function setColorPicker(div) {
|
19 |
+
div.ColorPicker({
|
20 |
+
color: div.attr('color'),
|
21 |
+
onShow: function(colpkr) {
|
22 |
+
$(colpkr).fadeIn(500);
|
23 |
+
return false;
|
24 |
+
},
|
25 |
+
onHide: function(colpkr) {
|
26 |
+
$(colpkr).fadeOut(500);
|
27 |
+
return false;
|
28 |
+
},
|
29 |
+
onChange: function(hsb, hex, rgb) {
|
30 |
+
div.css('backgroundColor', '#' + hex);
|
31 |
+
div.next().val('#' + hex);
|
32 |
+
}
|
33 |
+
}).css('backgroundColor', div.attr('color'));
|
34 |
+
}
|
35 |
+
|
36 |
+
$divOptions.find(".color-selector").each(function(i, e) {
|
37 |
+
setColorPicker($(e));
|
38 |
+
});
|
39 |
+
|
40 |
+
$divOptions.on('change', '.pages-selection input[type="checkbox"]', function() {
|
41 |
+
var $this = $(this);
|
42 |
+
var $input = $this.parent().parent().parent().prev();
|
43 |
+
var $text = $input.val();
|
44 |
+
|
45 |
+
if($this.prop('checked')) {
|
46 |
+
$text += ',' + $this.val();
|
47 |
+
} else {
|
48 |
+
$text = (',' + $text + ',').replace(',' + $this.val() + ',', ',');
|
49 |
+
}
|
50 |
+
|
51 |
+
$text = $text.replace(/(^[,\s]+)|([,\s]+$)/g, '');
|
52 |
+
$input.val($text);
|
53 |
+
});
|
54 |
+
|
55 |
+
$divOptions.on('change', 'input.button-style', function() {
|
56 |
+
$divOptions.find('.button-options').addClass('hidden').filter('.' + $(this).val()).removeClass('hidden');
|
57 |
+
});
|
58 |
+
|
59 |
+
$divOptions.find('.button-options').addClass('hidden').filter('.' + settings.button_style).removeClass('hidden');
|
60 |
+
|
61 |
+
$divOptions.on('change', 'input.button-action', function() {
|
62 |
+
$divOptions.find('div.button-action-container div.fields-container').addClass('hidden').filter('.' + $(this).val()).removeClass('hidden');
|
63 |
+
});
|
64 |
+
|
65 |
+
$divOptions.find('div.button-action-container div.fields-container').filter('.' + settings.button_action).removeClass('hidden');
|
66 |
+
|
67 |
+
(function() {
|
68 |
+
var mediaLibrary = null;
|
69 |
+
|
70 |
+
$divOptions.on('click', '#media-library-button', function() {
|
71 |
+
if(mediaLibrary === null) {
|
72 |
+
mediaLibrary = wp.media.frames.file_frame = wp.media({
|
73 |
+
title: settings.label_choose_image,
|
74 |
+
multiple: false,
|
75 |
+
button: {
|
76 |
+
text: settings.label_select_image
|
77 |
+
}
|
78 |
+
}).on('select', function() {
|
79 |
+
var obj = mediaLibrary.state().get('selection').first().toJSON();
|
80 |
+
|
81 |
+
$('#custom').prop('checked', true);
|
82 |
+
$('#custom-url-textbox').val(obj.url);
|
83 |
+
|
84 |
+
if(obj.alt !== "")
|
85 |
+
$('#alt-textbox').val(obj.alt);
|
86 |
+
});
|
87 |
+
}
|
88 |
+
|
89 |
+
mediaLibrary.open();
|
90 |
+
return false;
|
91 |
+
});
|
92 |
+
})();
|
93 |
+
};
|
94 |
})();
|
js/options.min.js
CHANGED
@@ -1,2 +1,4 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
1 |
+
(function(){window.init_wpfront_scroll_top_options=function(e){function f(b){b.ColorPicker({color:b.attr("color"),onShow:function(b){c(b).fadeIn(500);return!1},onHide:function(b){c(b).fadeOut(500);return!1},onChange:function(c,a,e){b.css("backgroundColor","#"+a);b.next().val("#"+a)}}).css("backgroundColor",b.attr("color"))}var c=jQuery,a=c("#wpfront-scroll-top-options");a.find(".color-selector").each(function(b,a){f(c(a))});a.on("change",'.pages-selection input[type="checkbox"]',function(){var b=
|
2 |
+
c(this),a=b.parent().parent().parent().prev(),d=a.val();d=b.prop("checked")?d+(","+b.val()):(","+d+",").replace(","+b.val()+",",",");d=d.replace(/(^[,\s]+)|([,\s]+$)/g,"");a.val(d)});a.on("change","input.button-style",function(){a.find(".button-options").addClass("hidden").filter("."+c(this).val()).removeClass("hidden")});a.find(".button-options").addClass("hidden").filter("."+e.button_style).removeClass("hidden");a.on("change","input.button-action",function(){a.find("div.button-action-container div.fields-container").addClass("hidden").filter("."+
|
3 |
+
c(this).val()).removeClass("hidden")});a.find("div.button-action-container div.fields-container").filter("."+e.button_action).removeClass("hidden");(function(){var b=null;a.on("click","#media-library-button",function(){null===b&&(b=wp.media.frames.file_frame=wp.media({title:e.label_choose_image,multiple:!1,button:{text:e.label_select_image}}).on("select",function(){var a=b.state().get("selection").first().toJSON();c("#custom").prop("checked",!0);c("#custom-url-textbox").val(a.url);""!==a.alt&&c("#alt-textbox").val(a.alt)}));
|
4 |
+
b.open();return!1})})()}})();
|
js/wpfront-scroll-top.js
CHANGED
@@ -68,7 +68,7 @@
|
|
68 |
var fnHideEvent = function () {
|
69 |
if(!data.auto_hide)
|
70 |
return;
|
71 |
-
|
72 |
clearTimeout(hideEventID);
|
73 |
hideEventID = setTimeout(function () {
|
74 |
fnHide();
|
@@ -94,50 +94,49 @@
|
|
94 |
scrollHandled = false;
|
95 |
};
|
96 |
|
97 |
-
$(window).scroll
|
98 |
-
$(document).scroll
|
99 |
|
100 |
container
|
101 |
-
.
|
102 |
clearTimeout(hideEventID);
|
103 |
mouse_over = true;
|
104 |
$(this).css("opacity", 1);
|
105 |
-
}, function
|
106 |
$(this).css("opacity", data.button_opacity);
|
107 |
mouse_over = false;
|
108 |
fnHideEvent();
|
109 |
-
})
|
110 |
-
.click(function (e) {
|
111 |
if(data.button_action === "url") {
|
112 |
return true;
|
113 |
} else if(data.button_action === "element") {
|
114 |
e.preventDefault();
|
115 |
-
|
116 |
var element = $(data.button_action_element_selector).first();
|
117 |
var container = $(data.button_action_container_selector);
|
118 |
-
|
119 |
var offset = element.offset();
|
120 |
if(offset == null)
|
121 |
return false;
|
122 |
-
|
123 |
var contOffset = container.last().offset();
|
124 |
if(contOffset == null)
|
125 |
return false;
|
126 |
-
|
127 |
data.button_action_element_offset = parseInt(data.button_action_element_offset);
|
128 |
if(isNaN(data.button_action_element_offset))
|
129 |
data.button_action_element_offset = 0;
|
130 |
-
|
131 |
var top = offset.top - contOffset.top - data.button_action_element_offset;
|
132 |
-
|
133 |
container.animate({scrollTop: top}, data.scroll_duration);
|
134 |
-
|
135 |
return false;
|
136 |
}
|
137 |
-
|
138 |
e.preventDefault();
|
139 |
$("html, body").animate({scrollTop: 0}, data.scroll_duration);
|
140 |
return false;
|
141 |
});
|
142 |
};
|
143 |
-
})();
|
68 |
var fnHideEvent = function () {
|
69 |
if(!data.auto_hide)
|
70 |
return;
|
71 |
+
|
72 |
clearTimeout(hideEventID);
|
73 |
hideEventID = setTimeout(function () {
|
74 |
fnHide();
|
94 |
scrollHandled = false;
|
95 |
};
|
96 |
|
97 |
+
$(window).on('scroll', fnScroll);
|
98 |
+
$(document).on('scroll', fnScroll);
|
99 |
|
100 |
container
|
101 |
+
.on('mouseenter', function() {
|
102 |
clearTimeout(hideEventID);
|
103 |
mouse_over = true;
|
104 |
$(this).css("opacity", 1);
|
105 |
+
}).on('mouseleave', function() {
|
106 |
$(this).css("opacity", data.button_opacity);
|
107 |
mouse_over = false;
|
108 |
fnHideEvent();
|
109 |
+
}).on('click', function(e) {
|
|
|
110 |
if(data.button_action === "url") {
|
111 |
return true;
|
112 |
} else if(data.button_action === "element") {
|
113 |
e.preventDefault();
|
114 |
+
|
115 |
var element = $(data.button_action_element_selector).first();
|
116 |
var container = $(data.button_action_container_selector);
|
117 |
+
|
118 |
var offset = element.offset();
|
119 |
if(offset == null)
|
120 |
return false;
|
121 |
+
|
122 |
var contOffset = container.last().offset();
|
123 |
if(contOffset == null)
|
124 |
return false;
|
125 |
+
|
126 |
data.button_action_element_offset = parseInt(data.button_action_element_offset);
|
127 |
if(isNaN(data.button_action_element_offset))
|
128 |
data.button_action_element_offset = 0;
|
129 |
+
|
130 |
var top = offset.top - contOffset.top - data.button_action_element_offset;
|
131 |
+
|
132 |
container.animate({scrollTop: top}, data.scroll_duration);
|
133 |
+
|
134 |
return false;
|
135 |
}
|
136 |
+
|
137 |
e.preventDefault();
|
138 |
$("html, body").animate({scrollTop: 0}, data.scroll_duration);
|
139 |
return false;
|
140 |
});
|
141 |
};
|
142 |
+
})();
|
js/wpfront-scroll-top.min.js
CHANGED
@@ -1,2 +1,4 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
1 |
+
(function(){window.wpfront_scroll_top=function(a){var d=jQuery,c=d("#wpfront-scroll-top-container").css("opacity",0),b={};switch(a.location){case 1:b.right=a.marginX+"px";b.bottom=a.marginY+"px";break;case 2:b.left=a.marginX+"px";b.bottom=a.marginY+"px";break;case 3:b.right=a.marginX+"px";b.top=a.marginY+"px";break;case 4:b.left=a.marginX+"px",b.top=a.marginY+"px"}c.css(b);a.button_width=0==a.button_width?"auto":a.button_width+"px";a.button_height=0==a.button_height?"auto":a.button_height+"px";c.children("img").css({width:a.button_width,
|
2 |
+
height:a.button_height});if(!a.hide_iframe||d(window).attr("self")===d(window).attr("top")){var e=!1,f=0,h=function(){clearTimeout(f);c.is(":visible")&&c.stop().fadeTo(a.button_fade_duration,0,function(){c.hide();e=!1})},k=function(){a.auto_hide&&(clearTimeout(f),f=setTimeout(function(){h()},1E3*a.auto_hide_after))},g=!1;b=function(){g||(g=!0,d(window).scrollTop()>a.scroll_offset?(c.stop().css("opacity",e?1:a.button_opacity).show(),e||k()):h(),g=!1)};d(window).on("scroll",b);d(document).on("scroll",
|
3 |
+
b);c.on("mouseenter",function(){clearTimeout(f);e=!0;d(this).css("opacity",1)}).on("mouseleave",function(){d(this).css("opacity",a.button_opacity);e=!1;k()}).on("click",function(b){if("url"===a.button_action)return!0;if("element"===a.button_action){b.preventDefault();var c=d(a.button_action_element_selector).first();b=d(a.button_action_container_selector);c=c.offset();if(null==c)return!1;var e=b.last().offset();if(null==e)return!1;a.button_action_element_offset=parseInt(a.button_action_element_offset);
|
4 |
+
isNaN(a.button_action_element_offset)&&(a.button_action_element_offset=0);b.animate({scrollTop:c.top-e.top-a.button_action_element_offset},a.scroll_duration);return!1}b.preventDefault();d("html, body").animate({scrollTop:0},a.scroll_duration);return!1})}}})();
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: syammohanm
|
|
3 |
Donate link: http://wpfront.com/donate/
|
4 |
Tags: scroll to top, back to top, scroll top, scroll up, wordpress scroll top
|
5 |
Requires at least: 4.1
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.0.2
|
8 |
Requires PHP: 5.3
|
|
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -53,6 +53,11 @@ Visit [WPFront Scroll Top FAQ](http://wpfront.com/scroll-top-plugin-faq/) page f
|
|
53 |
|
54 |
== Changelog ==
|
55 |
|
|
|
|
|
|
|
|
|
|
|
56 |
= 2.0.2 =
|
57 |
* Fixes WordPress 5.2 site health, wp_version_check, conflict.
|
58 |
|
@@ -131,6 +136,9 @@ Visit [WPFront Scroll Top FAQ](http://wpfront.com/scroll-top-plugin-faq/) page f
|
|
131 |
|
132 |
== Upgrade Notice ==
|
133 |
|
|
|
|
|
|
|
134 |
= 2.0.2 =
|
135 |
* Bug fix.
|
136 |
|
3 |
Donate link: http://wpfront.com/donate/
|
4 |
Tags: scroll to top, back to top, scroll top, scroll up, wordpress scroll top
|
5 |
Requires at least: 4.1
|
6 |
+
Tested up to: 5.7
|
|
|
7 |
Requires PHP: 5.3
|
8 |
+
Stable tag: 2.0.3
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
53 |
|
54 |
== Changelog ==
|
55 |
|
56 |
+
= 2.0.3 =
|
57 |
+
* jQuery deprecation fixes.
|
58 |
+
* Compatibility fixes.
|
59 |
+
* SiteGround conflict fix.
|
60 |
+
|
61 |
= 2.0.2 =
|
62 |
* Fixes WordPress 5.2 site health, wp_version_check, conflict.
|
63 |
|
136 |
|
137 |
== Upgrade Notice ==
|
138 |
|
139 |
+
= 2.0.3 =
|
140 |
+
* Compatibility fixes.
|
141 |
+
|
142 |
= 2.0.2 =
|
143 |
* Bug fix.
|
144 |
|
templates/options-template.php
CHANGED
@@ -29,449 +29,748 @@ namespace WPFront\Scroll_Top;
|
|
29 |
* @author Syam Mohan <syam@wpfront.com>
|
30 |
* @copyright 2013 WPFront.com
|
31 |
*/
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
</th>
|
59 |
-
<td>
|
60 |
-
<input class="pixels" name="<?php echo $this->options->scroll_offset_name(); ?>" value="<?php echo $this->options->scroll_offset(); ?>" />px
|
61 |
-
<span class="description"><?php echo __('[Number of pixels to be scrolled before the button appears.]', 'wpfront-scroll-top'); ?></span>
|
62 |
-
</td>
|
63 |
-
</tr>
|
64 |
-
<tr>
|
65 |
-
<th scope="row">
|
66 |
-
<?php echo __('Button Size', 'wpfront-scroll-top'); ?>
|
67 |
-
</th>
|
68 |
-
<td>
|
69 |
-
<input class="pixels" name="<?php echo $this->options->button_width_name(); ?>" value="<?php echo $this->options->button_width(); ?>" />px
|
70 |
-
X
|
71 |
-
<input class="pixels" name="<?php echo $this->options->button_height_name(); ?>" value="<?php echo $this->options->button_height(); ?>" />px
|
72 |
-
<span class="description"><?php echo __('[Set 0px to auto fit.]', 'wpfront-scroll-top'); ?></span>
|
73 |
-
</td>
|
74 |
-
</tr>
|
75 |
-
<tr>
|
76 |
-
<th scope="row">
|
77 |
-
<?php echo $this->options->button_opacity_label(); ?>
|
78 |
-
</th>
|
79 |
-
<td>
|
80 |
-
<input class="seconds" name="<?php echo $this->options->button_opacity_name(); ?>" value="<?php echo $this->options->button_opacity(); ?>" />%
|
81 |
-
</td>
|
82 |
-
</tr>
|
83 |
-
<tr>
|
84 |
-
<th scope="row">
|
85 |
-
<?php echo $this->options->button_fade_duration_label(); ?>
|
86 |
-
</th>
|
87 |
-
<td>
|
88 |
-
<input class="seconds" name="<?php echo $this->options->button_fade_duration_name(); ?>" value="<?php echo $this->options->button_fade_duration(); ?>" />ms
|
89 |
-
<span class="description"><?php echo __('[Button fade duration in milliseconds.]', 'wpfront-scroll-top'); ?></span>
|
90 |
-
</td>
|
91 |
-
</tr>
|
92 |
-
<tr>
|
93 |
-
<th scope="row">
|
94 |
-
<?php echo $this->options->scroll_duration_label(); ?>
|
95 |
-
</th>
|
96 |
-
<td>
|
97 |
-
<input class="seconds" name="<?php echo $this->options->scroll_duration_name(); ?>" value="<?php echo $this->options->scroll_duration(); ?>" />ms
|
98 |
-
<span class="description"><?php echo __('[Window scroll duration in milliseconds.]', 'wpfront-scroll-top'); ?></span>
|
99 |
-
</td>
|
100 |
-
</tr>
|
101 |
-
<tr>
|
102 |
-
<th scope="row">
|
103 |
-
<?php echo $this->options->auto_hide_label(); ?>
|
104 |
-
</th>
|
105 |
-
<td>
|
106 |
-
<input type="checkbox" name="<?php echo $this->options->auto_hide_name(); ?>" <?php echo $this->options->auto_hide() ? "checked" : ""; ?> />
|
107 |
-
</td>
|
108 |
-
</tr>
|
109 |
-
<tr>
|
110 |
-
<th scope="row">
|
111 |
-
<?php echo $this->options->auto_hide_after_label(); ?>
|
112 |
-
</th>
|
113 |
-
<td>
|
114 |
-
<input class="seconds" name="<?php echo $this->options->auto_hide_after_name(); ?>" value="<?php echo $this->options->auto_hide_after(); ?>" />sec
|
115 |
-
<span class="description"><?php echo __('[Button will be auto hidden after this duration in seconds, if enabled.]', 'wpfront-scroll-top'); ?></span>
|
116 |
-
</td>
|
117 |
-
</tr>
|
118 |
-
<tr>
|
119 |
-
<th scope="row">
|
120 |
-
<?php echo $this->options->hide_small_device_label(); ?>
|
121 |
-
</th>
|
122 |
-
<td>
|
123 |
-
<input type="checkbox" name="<?php echo $this->options->hide_small_device_name(); ?>" <?php echo $this->options->hide_small_device() ? "checked" : ""; ?> />
|
124 |
-
<span class="description"><?php echo __('[Button will be hidden on small devices when the width matches.]', 'wpfront-scroll-top'); ?></span>
|
125 |
-
</td>
|
126 |
-
</tr>
|
127 |
-
<tr>
|
128 |
-
<th scope="row">
|
129 |
-
<?php echo $this->options->small_device_width_label(); ?>
|
130 |
-
</th>
|
131 |
-
<td>
|
132 |
-
<input class="pixels" name="<?php echo $this->options->small_device_width_name(); ?>" value="<?php echo $this->options->small_device_width(); ?>" />px
|
133 |
-
<span class="description"><?php echo __('[Button will be hidden on devices with lesser or equal width.]', 'wpfront-scroll-top'); ?></span>
|
134 |
-
</td>
|
135 |
-
</tr>
|
136 |
-
<tr>
|
137 |
-
<th scope="row">
|
138 |
-
<?php echo $this->options->hide_small_window_label(); ?>
|
139 |
-
</th>
|
140 |
-
<td>
|
141 |
-
<input type="checkbox" name="<?php echo $this->options->hide_small_window_name(); ?>" <?php echo $this->options->hide_small_window() ? "checked" : ""; ?> />
|
142 |
-
<span class="description"><?php echo __('[Button will be hidden on broswer window when the width matches.]', 'wpfront-scroll-top'); ?></span>
|
143 |
-
</td>
|
144 |
-
</tr>
|
145 |
-
<tr>
|
146 |
-
<th scope="row">
|
147 |
-
<?php echo $this->options->small_window_width_label(); ?>
|
148 |
-
</th>
|
149 |
-
<td>
|
150 |
-
<input class="pixels" name="<?php echo $this->options->small_window_width_name(); ?>" value="<?php echo $this->options->small_window_width(); ?>" />px
|
151 |
-
<span class="description"><?php echo __('[Button will be hidden on browser window with lesser or equal width.]', 'wpfront-scroll-top'); ?></span>
|
152 |
-
</td>
|
153 |
-
</tr>
|
154 |
-
<tr>
|
155 |
-
<th scope="row">
|
156 |
-
<?php echo $this->options->hide_wpadmin_label(); ?>
|
157 |
-
</th>
|
158 |
-
<td>
|
159 |
-
<input type="checkbox" name="<?php echo $this->options->hide_wpadmin_name(); ?>" <?php echo $this->options->hide_wpadmin() ? "checked" : ""; ?> />
|
160 |
-
<span class="description"><?php echo __('[Button will be hidden on \'wp-admin\'.]', 'wpfront-scroll-top'); ?></span>
|
161 |
-
</td>
|
162 |
-
</tr>
|
163 |
-
<tr>
|
164 |
-
<th scope="row">
|
165 |
-
<?php echo $this->options->hide_iframe_label(); ?>
|
166 |
-
</th>
|
167 |
-
<td>
|
168 |
-
<input type="checkbox" name="<?php echo $this->options->hide_iframe_name(); ?>" <?php echo $this->options->hide_iframe() ? "checked" : ""; ?> />
|
169 |
-
<span class="description"><?php echo __('[Button will be hidden on iframes, usually inside popups.]', 'wpfront-scroll-top'); ?></span>
|
170 |
-
</td>
|
171 |
-
</tr>
|
172 |
-
<tr>
|
173 |
-
<th scope="row">
|
174 |
-
<?php echo $this->options->button_style_label(); ?>
|
175 |
-
</th>
|
176 |
-
<td>
|
177 |
-
<div>
|
178 |
-
<label><input type="radio" class="button-style" name="<?php echo $this->options->button_style_name(); ?>" value="image" <?php echo $this->options->button_style() == 'image' ? 'checked' : ''; ?> /> <?php echo __('Image', 'wpfront-scroll-top'); ?></label>
|
179 |
-
<br />
|
180 |
-
<label><input type="radio" class="button-style" name="<?php echo $this->options->button_style_name(); ?>" value="text" <?php echo $this->options->button_style() == 'text' ? 'checked' : ''; ?> /> <?php echo __('Text', 'wpfront-scroll-top'); ?></label>
|
181 |
-
<br />
|
182 |
-
<label><input type="radio" class="button-style" name="<?php echo $this->options->button_style_name(); ?>" value="font-awesome" <?php echo $this->options->button_style() == 'font-awesome' ? 'checked' : ''; ?> /> <?php echo __('Font Awesome', 'wpfront-scroll-top'); ?></label>
|
183 |
-
</div>
|
184 |
-
</td>
|
185 |
-
</tr>
|
186 |
-
<tr>
|
187 |
-
<th scope="row">
|
188 |
-
<?php echo $this->options->button_action_label(); ?>
|
189 |
-
</th>
|
190 |
-
<td>
|
191 |
-
<div class="button-action-container">
|
192 |
-
<label><input type="radio" class="button-action" name="<?php echo $this->options->button_action_name(); ?>" value="top" <?php echo $this->options->button_action() == 'top' ? 'checked' : ''; ?> /> <?php echo __('Scroll to Top', 'wpfront-scroll-top'); ?></label> <span class="description"><?php echo __('[Default action on WP-ADMIN pages.]', 'wpfront-scroll-top'); ?></span>
|
193 |
-
<br />
|
194 |
-
<label><input type="radio" class="button-action" name="<?php echo $this->options->button_action_name(); ?>" value="element" <?php echo $this->options->button_action() == 'element' ? 'checked' : ''; ?> /> <?php echo __('Scroll to Element', 'wpfront-scroll-top'); ?></label>
|
195 |
-
<div class="fields-container element hidden">
|
196 |
-
<div>
|
197 |
-
<span><input class="alignment-holder" type="radio"/></span>
|
198 |
-
<span class="sub-label"><?php echo $this->options->button_action_element_selector_label() . ': '; ?></span>
|
199 |
-
<span><input name="<?php echo $this->options->button_action_element_selector_name(); ?>" value="<?php echo $this->options->button_action_element_selector(); ?>" /> <span class="description"><?php echo __('[CSS selector of the element, you are trying to scroll to. Ex: #myDivID, .myDivClass]', 'wpfront-scroll-top'); ?></span></span>
|
200 |
-
</div>
|
201 |
-
<div>
|
202 |
-
<span><input class="alignment-holder" type="radio"/></span>
|
203 |
-
<span class="sub-label"><?php echo $this->options->button_action_container_selector_label() . ': '; ?></span>
|
204 |
-
<span><input name="<?php echo $this->options->button_action_container_selector_name(); ?>" value="<?php echo $this->options->button_action_container_selector(); ?>" /> <span class="description"><?php echo __('[CSS selector of the element, which has the scroll bar. "html, body" works in almost all cases.]', 'wpfront-scroll-top'); ?></span></span>
|
205 |
-
</div>
|
206 |
-
<div>
|
207 |
-
<span><input class="alignment-holder" type="radio"/></span>
|
208 |
-
<span class="sub-label"><?php echo $this->options->button_action_element_offset_label() . ': '; ?></span>
|
209 |
-
<span><input class="pixels" name="<?php echo $this->options->button_action_element_offset_name(); ?>" value="<?php echo $this->options->button_action_element_offset(); ?>" />px <span class="description"><?php echo __('[Negative value allowed. Use this filed to precisely set scroll position. Useful when you have overlapping elements.]', 'wpfront-scroll-top'); ?></span></span>
|
210 |
-
</div>
|
211 |
-
<div>
|
212 |
-
<span><input class="alignment-holder" type="radio"/></span>
|
213 |
-
<span class="sub-label"><a target="_blank" href="https://wpfront.com/wordpress-plugins/scroll-top-plugin/scroll-top-plugin-faq/"><?php echo __('How to find CSS selector?', 'wpfront-scroll-top'); ?></a></span>
|
214 |
-
</div>
|
215 |
-
</div>
|
216 |
-
<br />
|
217 |
-
<label><input type="radio" class="button-action" name="<?php echo $this->options->button_action_name(); ?>" value="url" <?php echo $this->options->button_action() == 'url' ? 'checked' : ''; ?> /> <?php echo __('Link to Page', 'wpfront-scroll-top'); ?></label>
|
218 |
-
<div class="fields-container url hidden">
|
219 |
-
<div>
|
220 |
-
<span><input class="alignment-holder" type="radio"/></span>
|
221 |
-
<span class="sub-label"><?php echo $this->options->button_action_page_url_label() . ': '; ?></span>
|
222 |
-
<span class="url"><input class="url" name="<?php echo $this->options->button_action_page_url_name(); ?>" value="<?php echo $this->options->button_action_page_url(); ?>" /></span>
|
223 |
-
</div>
|
224 |
-
</div>
|
225 |
-
</div>
|
226 |
-
</td>
|
227 |
-
</tr>
|
228 |
-
</table>
|
229 |
-
|
230 |
-
<h3><?php echo __('Location', 'wpfront-scroll-top'); ?></h3>
|
231 |
-
<table class="form-table">
|
232 |
-
<tr>
|
233 |
-
<th scope="row">
|
234 |
-
<?php echo $this->options->location_label(); ?>
|
235 |
-
</th>
|
236 |
-
<td>
|
237 |
-
<select name="<?php echo $this->options->location_name(); ?>">
|
238 |
-
<option value="1" <?php echo $this->options->location() == 1 ? 'selected' : ''; ?> ><?php echo __('Bottom Right', 'wpfront-scroll-top'); ?></option>
|
239 |
-
<option value="2" <?php echo $this->options->location() == 2 ? 'selected' : ''; ?> ><?php echo __('Bottom Left', 'wpfront-scroll-top'); ?></option>
|
240 |
-
<option value="3" <?php echo $this->options->location() == 3 ? 'selected' : ''; ?> ><?php echo __('Top Right', 'wpfront-scroll-top'); ?></option>
|
241 |
-
<option value="4" <?php echo $this->options->location() == 4 ? 'selected' : ''; ?> ><?php echo __('Top Left', 'wpfront-scroll-top'); ?></option>
|
242 |
-
</select>
|
243 |
-
</td>
|
244 |
-
</tr>
|
245 |
-
<tr>
|
246 |
-
<th scope="row">
|
247 |
-
<?php echo $this->options->marginX_label(); ?>
|
248 |
-
</th>
|
249 |
-
<td>
|
250 |
-
<input class="pixels" name="<?php echo $this->options->marginX_name(); ?>" value="<?php echo $this->options->marginX(); ?>" />px
|
251 |
-
<span class="description"><?php echo __('[Negative value allowed.]', 'wpfront-scroll-top'); ?></span>
|
252 |
-
</td>
|
253 |
-
</tr>
|
254 |
-
<tr>
|
255 |
-
<th scope="row">
|
256 |
-
<?php echo $this->options->marginY_label(); ?>
|
257 |
-
</th>
|
258 |
-
<td>
|
259 |
-
<input class="pixels" name="<?php echo $this->options->marginY_name(); ?>" value="<?php echo $this->options->marginY(); ?>" />px
|
260 |
-
<span class="description"><?php echo __('[Negative value allowed.]', 'wpfront-scroll-top'); ?></span>
|
261 |
-
</td>
|
262 |
-
</tr>
|
263 |
-
</table>
|
264 |
-
|
265 |
-
<h3><?php echo __('Filter', 'wpfront-scroll-top'); ?></h3>
|
266 |
-
<table class="form-table">
|
267 |
-
<tr>
|
268 |
-
<th scope="row">
|
269 |
-
<?php echo $this->options->display_pages_label(); ?>
|
270 |
-
</th>
|
271 |
-
<td>
|
272 |
-
<label>
|
273 |
-
<input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="1" <?php echo $this->options->display_pages() == 1 ? 'checked' : ''; ?> />
|
274 |
-
<span><?php echo __('All pages.', 'wpfront-scroll-top'); ?></span>
|
275 |
-
</label>
|
276 |
-
<br />
|
277 |
-
<label>
|
278 |
-
<input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="2" <?php echo $this->options->display_pages() == 2 ? 'checked' : ''; ?> />
|
279 |
-
<span><?php echo __('Include in following pages', 'wpfront-scroll-top'); ?></span> <span class="description"><?php echo __('[Use the textbox below to specify the post IDs as a comma separated list.]', 'wpfront-scroll-top'); ?></span>
|
280 |
-
</label>
|
281 |
-
<br />
|
282 |
-
<input class="post-id-list" name="<?php echo $this->options->include_pages_name(); ?>" value="<?php echo $this->options->include_pages(); ?>" />
|
283 |
-
<div class="pages-selection">
|
284 |
-
<?php
|
285 |
-
$objects = $this->get_filter_objects();
|
286 |
-
foreach ($objects as $key => $value) {
|
287 |
-
?>
|
288 |
-
<div class="page-div">
|
289 |
-
<label>
|
290 |
-
<input type="checkbox" value="<?php echo $key; ?>" <?php echo $this->filter_pages_contains($this->options->include_pages(), $key) === FALSE ? '' : 'checked'; ?> />
|
291 |
-
<?php echo $value; ?>
|
292 |
-
</label>
|
293 |
-
</div>
|
294 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
}
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
</div>
|
315 |
<?php
|
316 |
}
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
<tr>
|
326 |
-
<th scope="row">
|
327 |
-
<?php echo $this->options->text_button_text_label(); ?>
|
328 |
-
</th>
|
329 |
-
<td>
|
330 |
-
<input name="<?php echo $this->options->text_button_text_name(); ?>" value="<?php echo $this->options->text_button_text(); ?>" />
|
331 |
-
</td>
|
332 |
-
</tr>
|
333 |
-
<tr>
|
334 |
-
<th scope="row">
|
335 |
-
<?php echo $this->options->text_button_text_color_label(); ?>
|
336 |
-
</th>
|
337 |
-
<td>
|
338 |
-
<div class="color-selector-div">
|
339 |
-
<div class="color-selector" color="<?php echo $this->options->text_button_text_color(); ?>"></div> <span><?php echo $this->options->text_button_text_color(); ?></span>
|
340 |
-
<input type="hidden" name="<?php echo $this->options->text_button_text_color_name(); ?>" value="<?php echo $this->options->text_button_text_color(); ?>" />
|
341 |
-
</div>
|
342 |
-
</td>
|
343 |
-
</tr>
|
344 |
-
<tr>
|
345 |
-
<th scope="row">
|
346 |
-
<?php echo $this->options->text_button_background_color_label(); ?>
|
347 |
-
</th>
|
348 |
-
<td>
|
349 |
-
<div class="color-selector-div">
|
350 |
-
<div class="color-selector" color="<?php echo $this->options->text_button_background_color(); ?>"></div> <span><?php echo $this->options->text_button_background_color(); ?></span>
|
351 |
-
<input type="hidden" name="<?php echo $this->options->text_button_background_color_name(); ?>" value="<?php echo $this->options->text_button_background_color(); ?>" />
|
352 |
-
</div>
|
353 |
-
</td>
|
354 |
-
</tr>
|
355 |
-
<tr>
|
356 |
-
<th scope="row">
|
357 |
-
<?php echo $this->options->text_button_hover_color_label(); ?>
|
358 |
-
</th>
|
359 |
-
<td>
|
360 |
-
<div class="color-selector-div">
|
361 |
-
<div class="color-selector" color="<?php echo $this->options->text_button_hover_color(); ?>"></div> <span><?php echo $this->options->text_button_hover_color(); ?></span>
|
362 |
-
<input type="hidden" name="<?php echo $this->options->text_button_hover_color_name(); ?>" value="<?php echo $this->options->text_button_hover_color(); ?>" />
|
363 |
-
</div>
|
364 |
-
</td>
|
365 |
-
</tr>
|
366 |
-
<tr>
|
367 |
-
<th scope="row">
|
368 |
-
<?php echo $this->options->text_button_css_label(); ?>
|
369 |
-
</th>
|
370 |
-
<td>
|
371 |
-
<textarea name="<?php echo $this->options->text_button_css_name(); ?>" rows="5" cols="100"><?php echo $this->options->text_button_css(); ?></textarea>
|
372 |
-
<br />
|
373 |
-
<span class="description"><?php echo '[' . __('ex:', 'wpfront-scroll-top') . ' font-size: 1.5em; padding: 10px;]'; ?></span>
|
374 |
-
</td>
|
375 |
-
</tr>
|
376 |
-
</table>
|
377 |
-
|
378 |
-
<h3 class="button-options font-awesome"><?php echo __('Font Awesome Button', 'wpfront-scroll-top'); ?></h3>
|
379 |
-
<table class="form-table button-options font-awesome">
|
380 |
-
<tr>
|
381 |
-
<th scope="row">
|
382 |
-
<?php echo $this->options->fa_button_class_label(); ?>
|
383 |
-
</th>
|
384 |
-
<td>
|
385 |
-
<input class="regular-text" name="<?php echo $this->options->fa_button_class_name(); ?>" value="<?php echo $this->options->fa_button_class(); ?>" />
|
386 |
-
<span class="description"><?php echo '[' . __('ex:', 'wpfront-scroll-top') . ' fa fa-arrow-circle-up fa-5x]'; ?></span>
|
387 |
-
</td>
|
388 |
-
</tr>
|
389 |
-
<tr>
|
390 |
-
<th scope="row">
|
391 |
-
<?php echo $this->options->fa_button_URL_label(); ?>
|
392 |
-
</th>
|
393 |
-
<td>
|
394 |
-
<input class="url" name="<?php echo $this->options->fa_button_URL_name(); ?>" value="<?php echo $this->options->fa_button_URL(); ?>" />
|
395 |
-
<br />
|
396 |
-
<span class="description"><?php echo '[Leave blank to use BootstrapCDN URL by MaxCDN. Otherwise specify the URL you want to use.]'; ?></span>
|
397 |
-
</td>
|
398 |
-
</tr>
|
399 |
-
<tr>
|
400 |
-
<th scope="row">
|
401 |
-
<?php echo $this->options->fa_button_exclude_URL_label(); ?>
|
402 |
-
</th>
|
403 |
-
<td>
|
404 |
-
<input type="checkbox" name="<?php echo $this->options->fa_button_exclude_URL_name(); ?>" <?php echo $this->options->fa_button_exclude_URL() ? "checked" : ""; ?> />
|
405 |
-
<span class="description"><?php echo '[Enable this setting if your site already has Font Awesome. Usually your theme includes it.]'; ?></span>
|
406 |
-
</td>
|
407 |
-
</tr>
|
408 |
-
<tr>
|
409 |
-
<th scope="row">
|
410 |
-
<?php echo $this->options->fa_button_text_color_label(); ?>
|
411 |
-
</th>
|
412 |
-
<td>
|
413 |
-
<div class="color-selector-div">
|
414 |
-
<div class="color-selector" color="<?php echo $this->options->fa_button_text_color(); ?>"></div> <span><?php echo $this->options->fa_button_text_color(); ?></span>
|
415 |
-
<input type="hidden" name="<?php echo $this->options->fa_button_text_color_name(); ?>" value="<?php echo $this->options->fa_button_text_color(); ?>" />
|
416 |
</div>
|
417 |
-
</
|
418 |
-
</tr>
|
419 |
-
<tr>
|
420 |
-
<th scope="row">
|
421 |
-
<?php echo $this->options->fa_button_css_label(); ?>
|
422 |
-
</th>
|
423 |
-
<td>
|
424 |
-
<textarea name="<?php echo $this->options->fa_button_css_name(); ?>" rows="5" cols="100"><?php echo $this->options->fa_button_css(); ?></textarea>
|
425 |
-
<br />
|
426 |
-
<span class="description"><?php echo '[' . __('ex:', 'wpfront-scroll-top') . ' #wpfront-scroll-top-container i:hover{ color: #000000; }]'; ?></span>
|
427 |
-
</td>
|
428 |
-
</tr>
|
429 |
-
</table>
|
430 |
-
|
431 |
-
<h3 class="button-options image"><?php echo __('Image Button', 'wpfront-scroll-top'); ?></h3>
|
432 |
-
<div class="button-options image">
|
433 |
-
<div class="icons-container">
|
434 |
<?php
|
435 |
-
$
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
444 |
?>
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
</th>
|
458 |
-
<td>
|
459 |
-
<input id="alt-textbox" class="altText" name="<?php echo $this->options->image_alt_name(); ?>" value="<?php echo $this->options->image_alt(); ?>" />
|
460 |
-
</td>
|
461 |
-
</tr>
|
462 |
-
</table>
|
463 |
-
</div>
|
464 |
-
|
465 |
-
<?php @$this->options_page_footer('scroll-top-plugin-settings/', 'scroll-top-plugin-faq/'); ?>
|
466 |
-
|
467 |
-
<script type="text/javascript">
|
468 |
-
(function() {
|
469 |
-
init_wpfront_scroll_top_options({
|
470 |
-
button_style: '<?php echo $this->options->button_style(); ?>',
|
471 |
-
button_action: '<?php echo $this->options->button_action(); ?>',
|
472 |
-
label_choose_image: '<?php echo __('Choose Image', 'wpfront-scroll-top'); ?>',
|
473 |
-
label_select_image: '<?php echo __('Select Image', 'wpfront-scroll-top'); ?>'
|
474 |
-
});
|
475 |
-
})();
|
476 |
-
</script>
|
477 |
|
|
29 |
* @author Syam Mohan <syam@wpfront.com>
|
30 |
* @copyright 2013 WPFront.com
|
31 |
*/
|
32 |
+
class WPFront_Scroll_Top_Options_View {
|
33 |
+
|
34 |
+
protected $controller;
|
35 |
+
protected $options;
|
36 |
+
|
37 |
+
public function view($controller) {
|
38 |
+
$this->controller = $controller;
|
39 |
+
$this->options = $controller->get_options();
|
40 |
+
|
41 |
+
$this->options_page_header();
|
42 |
+
$this->display_section();
|
43 |
+
$this->location_section();
|
44 |
+
$this->filter_section();
|
45 |
+
$this->text_button_section();
|
46 |
+
$this->font_awesome_button_section();
|
47 |
+
$this->image_button_section();
|
48 |
+
$this->options_page_footer();
|
49 |
+
$this->script_section();
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function options_page_header() {
|
53 |
+
?>
|
54 |
+
<div class="wrap">
|
55 |
+
<h2><?php echo __('WPFront Scroll Top Settings', 'wpfront-scroll-top'); ?></h2>
|
56 |
+
<div id="wpfront-scroll-top-options" class="inside">
|
57 |
+
<form method="post" action="options.php">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
<?php
|
59 |
+
settings_fields(WPFront_Scroll_Top::OPTIONS_GROUP_NAME);
|
60 |
+
do_settings_sections('wpfront-scroll-top');
|
61 |
+
|
62 |
+
if ((isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true') || (isset($_GET['updated']) && $_GET['updated'] == 'true')) {
|
63 |
+
?>
|
64 |
+
<div class="updated">
|
65 |
+
<p>
|
66 |
+
<strong><?php echo __('If you have a caching plugin, clear the cache for the new settings to take effect.', 'wpfront-scroll-top'); ?></strong>
|
67 |
+
</p>
|
68 |
+
</div>
|
69 |
+
<?php
|
70 |
+
}
|
71 |
}
|
72 |
+
|
73 |
+
protected function display_section() {
|
74 |
+
?>
|
75 |
+
<h3><?php echo __('Display', 'wpfront-scroll-top'); ?></h3>
|
76 |
+
<table class="form-table">
|
77 |
+
<?php
|
78 |
+
$this->display_table_row_enabled();
|
79 |
+
$this->display_table_row_javascript_async();
|
80 |
+
$this->display_table_row_scroll_offset();
|
81 |
+
$this->display_table_row_button_size();
|
82 |
+
$this->display_table_row_button_opacity();
|
83 |
+
$this->display_table_row_button_fade_duration();
|
84 |
+
$this->display_table_row_scroll_duration();
|
85 |
+
$this->display_table_row_auto_hide();
|
86 |
+
$this->display_table_row_auto_hide_after();
|
87 |
+
$this->display_table_row_hide_small_device();
|
88 |
+
$this->display_table_row_small_device_width();
|
89 |
+
$this->display_table_row_hide_small_window();
|
90 |
+
$this->display_table_row_small_window_width();
|
91 |
+
$this->display_table_row_hide_wpadmin();
|
92 |
+
$this->display_table_row_hide_iframe();
|
93 |
+
$this->display_table_row_attach_on_shutdown();
|
94 |
+
$this->display_table_row_button_style();
|
95 |
+
$this->display_table_row_button_action();
|
96 |
+
?>
|
97 |
+
</table>
|
98 |
+
<?php
|
99 |
+
}
|
100 |
+
|
101 |
+
protected function display_table_row_enabled() {
|
102 |
+
?>
|
103 |
+
<tr>
|
104 |
+
<th scope="row">
|
105 |
+
<?php echo $this->options->enabled_label(); ?>
|
106 |
+
</th>
|
107 |
+
<td>
|
108 |
+
<input type="checkbox" name="<?php echo $this->options->enabled_name(); ?>" <?php echo $this->options->enabled() ? 'checked' : ''; ?> />
|
109 |
+
</td>
|
110 |
+
</tr>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
114 |
+
protected function display_table_row_javascript_async() {
|
115 |
+
?>
|
116 |
+
<tr>
|
117 |
+
<th scope="row">
|
118 |
+
<?php echo $this->options->javascript_async_label(); ?>
|
119 |
+
</th>
|
120 |
+
<td>
|
121 |
+
<input type="checkbox" name="<?php echo $this->options->javascript_async_name(); ?>" <?php echo $this->options->javascript_async() ? 'checked' : ''; ?> />
|
122 |
+
<span class="description"><?php echo __('[Increases site performance. Keep it enabled, if there are no conflicts.]', 'wpfront-scroll-top'); ?></span>
|
123 |
+
</td>
|
124 |
+
</tr>
|
125 |
+
<?php
|
126 |
+
}
|
127 |
+
|
128 |
+
protected function display_table_row_scroll_offset() {
|
129 |
+
?>
|
130 |
+
<tr>
|
131 |
+
<th scope="row">
|
132 |
+
<?php echo $this->options->scroll_offset_label(); ?>
|
133 |
+
</th>
|
134 |
+
<td>
|
135 |
+
<input class="pixels" name="<?php echo $this->options->scroll_offset_name(); ?>" value="<?php echo $this->options->scroll_offset(); ?>" />px
|
136 |
+
<span class="description"><?php echo __('[Number of pixels to be scrolled before the button appears.]', 'wpfront-scroll-top'); ?></span>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
<?php
|
140 |
+
}
|
141 |
+
|
142 |
+
protected function display_table_row_button_size() {
|
143 |
+
?>
|
144 |
+
<tr>
|
145 |
+
<th scope="row">
|
146 |
+
<?php echo __('Button Size', 'wpfront-scroll-top'); ?>
|
147 |
+
</th>
|
148 |
+
<td>
|
149 |
+
<input class="pixels" name="<?php echo $this->options->button_width_name(); ?>" value="<?php echo $this->options->button_width(); ?>" />px
|
150 |
+
X
|
151 |
+
<input class="pixels" name="<?php echo $this->options->button_height_name(); ?>" value="<?php echo $this->options->button_height(); ?>" />px
|
152 |
+
<span class="description"><?php echo __('[Set 0px to auto fit.]', 'wpfront-scroll-top'); ?></span>
|
153 |
+
</td>
|
154 |
+
</tr>
|
155 |
+
<?php
|
156 |
+
}
|
157 |
+
|
158 |
+
protected function display_table_row_button_opacity() {
|
159 |
+
?>
|
160 |
+
<tr>
|
161 |
+
<th scope="row">
|
162 |
+
<?php echo $this->options->button_opacity_label(); ?>
|
163 |
+
</th>
|
164 |
+
<td>
|
165 |
+
<input class="seconds" name="<?php echo $this->options->button_opacity_name(); ?>" value="<?php echo $this->options->button_opacity(); ?>" />%
|
166 |
+
</td>
|
167 |
+
</tr>
|
168 |
+
<?php
|
169 |
+
}
|
170 |
+
|
171 |
+
protected function display_table_row_button_fade_duration() {
|
172 |
+
?>
|
173 |
+
<tr>
|
174 |
+
<th scope="row">
|
175 |
+
<?php echo $this->options->button_fade_duration_label(); ?>
|
176 |
+
</th>
|
177 |
+
<td>
|
178 |
+
<input class="seconds" name="<?php echo $this->options->button_fade_duration_name(); ?>" value="<?php echo $this->options->button_fade_duration(); ?>" />ms
|
179 |
+
<span class="description"><?php echo __('[Button fade duration in milliseconds.]', 'wpfront-scroll-top'); ?></span>
|
180 |
+
</td>
|
181 |
+
</tr>
|
182 |
+
<?php
|
183 |
+
}
|
184 |
+
|
185 |
+
protected function display_table_row_scroll_duration() {
|
186 |
+
?>
|
187 |
+
<tr>
|
188 |
+
<th scope="row">
|
189 |
+
<?php echo $this->options->scroll_duration_label(); ?>
|
190 |
+
</th>
|
191 |
+
<td>
|
192 |
+
<input class="seconds" name="<?php echo $this->options->scroll_duration_name(); ?>" value="<?php echo $this->options->scroll_duration(); ?>" />ms
|
193 |
+
<span class="description"><?php echo __('[Window scroll duration in milliseconds.]', 'wpfront-scroll-top'); ?></span>
|
194 |
+
</td>
|
195 |
+
</tr>
|
196 |
+
<?php
|
197 |
+
}
|
198 |
+
|
199 |
+
protected function display_table_row_auto_hide() {
|
200 |
+
?>
|
201 |
+
<tr>
|
202 |
+
<th scope="row">
|
203 |
+
<?php echo $this->options->auto_hide_label(); ?>
|
204 |
+
</th>
|
205 |
+
<td>
|
206 |
+
<input type="checkbox" name="<?php echo $this->options->auto_hide_name(); ?>" <?php echo $this->options->auto_hide() ? "checked" : ""; ?> />
|
207 |
+
</td>
|
208 |
+
</tr>
|
209 |
+
<?php
|
210 |
+
}
|
211 |
+
|
212 |
+
protected function display_table_row_auto_hide_after() {
|
213 |
+
?>
|
214 |
+
<tr>
|
215 |
+
<th scope="row">
|
216 |
+
<?php echo $this->options->auto_hide_after_label(); ?>
|
217 |
+
</th>
|
218 |
+
<td>
|
219 |
+
<input class="seconds" name="<?php echo $this->options->auto_hide_after_name(); ?>" value="<?php echo $this->options->auto_hide_after(); ?>" />sec
|
220 |
+
<span class="description"><?php echo __('[Button will be auto hidden after this duration in seconds, if enabled.]', 'wpfront-scroll-top'); ?></span>
|
221 |
+
</td>
|
222 |
+
</tr>
|
223 |
+
<?php
|
224 |
+
}
|
225 |
+
|
226 |
+
protected function display_table_row_hide_small_device() {
|
227 |
+
?>
|
228 |
+
<tr>
|
229 |
+
<th scope="row">
|
230 |
+
<?php echo $this->options->hide_small_device_label(); ?>
|
231 |
+
</th>
|
232 |
+
<td>
|
233 |
+
<input type="checkbox" name="<?php echo $this->options->hide_small_device_name(); ?>" <?php echo $this->options->hide_small_device() ? "checked" : ""; ?> />
|
234 |
+
<span class="description"><?php echo __('[Button will be hidden on small devices when the width matches.]', 'wpfront-scroll-top'); ?></span>
|
235 |
+
</td>
|
236 |
+
</tr>
|
237 |
+
<?php
|
238 |
+
}
|
239 |
+
|
240 |
+
protected function display_table_row_small_device_width() {
|
241 |
+
?>
|
242 |
+
<tr>
|
243 |
+
<th scope="row">
|
244 |
+
<?php echo $this->options->small_device_width_label(); ?>
|
245 |
+
</th>
|
246 |
+
<td>
|
247 |
+
<input class="pixels" name="<?php echo $this->options->small_device_width_name(); ?>" value="<?php echo $this->options->small_device_width(); ?>" />px
|
248 |
+
<span class="description"><?php echo __('[Button will be hidden on devices with lesser or equal width.]', 'wpfront-scroll-top'); ?></span>
|
249 |
+
</td>
|
250 |
+
</tr>
|
251 |
+
<?php
|
252 |
+
}
|
253 |
+
|
254 |
+
protected function display_table_row_hide_small_window() {
|
255 |
+
?>
|
256 |
+
<tr>
|
257 |
+
<th scope="row">
|
258 |
+
<?php echo $this->options->hide_small_window_label(); ?>
|
259 |
+
</th>
|
260 |
+
<td>
|
261 |
+
<input type="checkbox" name="<?php echo $this->options->hide_small_window_name(); ?>" <?php echo $this->options->hide_small_window() ? "checked" : ""; ?> />
|
262 |
+
<span class="description"><?php echo __('[Button will be hidden on broswer window when the width matches.]', 'wpfront-scroll-top'); ?></span>
|
263 |
+
</td>
|
264 |
+
</tr>
|
265 |
+
<?php
|
266 |
+
}
|
267 |
+
|
268 |
+
protected function display_table_row_small_window_width() {
|
269 |
+
?>
|
270 |
+
<tr>
|
271 |
+
<th scope="row">
|
272 |
+
<?php echo $this->options->small_window_width_label(); ?>
|
273 |
+
</th>
|
274 |
+
<td>
|
275 |
+
<input class="pixels" name="<?php echo $this->options->small_window_width_name(); ?>" value="<?php echo $this->options->small_window_width(); ?>" />px
|
276 |
+
<span class="description"><?php echo __('[Button will be hidden on browser window with lesser or equal width.]', 'wpfront-scroll-top'); ?></span>
|
277 |
+
</td>
|
278 |
+
</tr>
|
279 |
+
<?php
|
280 |
+
}
|
281 |
+
|
282 |
+
protected function display_table_row_hide_wpadmin() {
|
283 |
+
?>
|
284 |
+
<tr>
|
285 |
+
<th scope="row">
|
286 |
+
<?php echo $this->options->hide_wpadmin_label(); ?>
|
287 |
+
</th>
|
288 |
+
<td>
|
289 |
+
<input type="checkbox" name="<?php echo $this->options->hide_wpadmin_name(); ?>" <?php echo $this->options->hide_wpadmin() ? "checked" : ""; ?> />
|
290 |
+
<span class="description"><?php echo __('[Button will be hidden on \'wp-admin\'.]', 'wpfront-scroll-top'); ?></span>
|
291 |
+
</td>
|
292 |
+
</tr>
|
293 |
+
<?php
|
294 |
+
}
|
295 |
+
|
296 |
+
protected function display_table_row_hide_iframe() {
|
297 |
+
?>
|
298 |
+
<tr>
|
299 |
+
<th scope="row">
|
300 |
+
<?php echo $this->options->hide_iframe_label(); ?>
|
301 |
+
</th>
|
302 |
+
<td>
|
303 |
+
<input type="checkbox" name="<?php echo $this->options->hide_iframe_name(); ?>" <?php echo $this->options->hide_iframe() ? "checked" : ""; ?> />
|
304 |
+
<span class="description"><?php echo __('[Button will be hidden on iframes, usually inside popups.]', 'wpfront-scroll-top'); ?></span>
|
305 |
+
</td>
|
306 |
+
</tr>
|
307 |
+
<?php
|
308 |
+
}
|
309 |
+
|
310 |
+
protected function display_table_row_attach_on_shutdown() {
|
311 |
+
?>
|
312 |
+
<tr>
|
313 |
+
<th scope="row">
|
314 |
+
<?php echo $this->options->attach_on_shutdown_label(); ?>
|
315 |
+
</th>
|
316 |
+
<td>
|
317 |
+
<input type="checkbox" name="<?php echo $this->options->attach_on_shutdown_name(); ?>" <?php echo $this->options->attach_on_shutdown() ? 'checked' : ''; ?> />
|
318 |
+
<span class="description"><?php echo __('[Enable as a last resort if the button is not working. This could create compatibility issues.]', 'wpfront-scroll-top'); ?></span>
|
319 |
+
</td>
|
320 |
+
</tr>
|
321 |
+
<?php
|
322 |
+
}
|
323 |
+
|
324 |
+
protected function display_table_row_button_style() {
|
325 |
+
?>
|
326 |
+
<tr>
|
327 |
+
<th scope="row">
|
328 |
+
<?php echo $this->options->button_style_label(); ?>
|
329 |
+
</th>
|
330 |
+
<td>
|
331 |
+
<div>
|
332 |
+
<label><input type="radio" class="button-style" name="<?php echo $this->options->button_style_name(); ?>" value="image" <?php echo $this->options->button_style() == 'image' ? 'checked' : ''; ?> /> <?php echo __('Image', 'wpfront-scroll-top'); ?></label>
|
333 |
+
<br />
|
334 |
+
<label><input type="radio" class="button-style" name="<?php echo $this->options->button_style_name(); ?>" value="text" <?php echo $this->options->button_style() == 'text' ? 'checked' : ''; ?> /> <?php echo __('Text', 'wpfront-scroll-top'); ?></label>
|
335 |
+
<br />
|
336 |
+
<label><input type="radio" class="button-style" name="<?php echo $this->options->button_style_name(); ?>" value="font-awesome" <?php echo $this->options->button_style() == 'font-awesome' ? 'checked' : ''; ?> /> <?php echo __('Font Awesome', 'wpfront-scroll-top'); ?></label>
|
337 |
+
</div>
|
338 |
+
</td>
|
339 |
+
</tr>
|
340 |
+
<?php
|
341 |
+
}
|
342 |
+
|
343 |
+
protected function display_table_row_button_action() {
|
344 |
+
?>
|
345 |
+
<tr>
|
346 |
+
<th scope="row">
|
347 |
+
<?php echo $this->options->button_action_label(); ?>
|
348 |
+
</th>
|
349 |
+
<td>
|
350 |
+
<div class="button-action-container">
|
351 |
+
<label><input type="radio" class="button-action" name="<?php echo $this->options->button_action_name(); ?>" value="top" <?php echo $this->options->button_action() == 'top' ? 'checked' : ''; ?> /> <?php echo __('Scroll to Top', 'wpfront-scroll-top'); ?></label> <span class="description"><?php echo __('[Default action on WP-ADMIN pages.]', 'wpfront-scroll-top'); ?></span>
|
352 |
+
<br />
|
353 |
+
<label><input type="radio" class="button-action" name="<?php echo $this->options->button_action_name(); ?>" value="element" <?php echo $this->options->button_action() == 'element' ? 'checked' : ''; ?> /> <?php echo __('Scroll to Element', 'wpfront-scroll-top'); ?></label>
|
354 |
+
<div class="fields-container element hidden">
|
355 |
+
<div>
|
356 |
+
<span><input class="alignment-holder" type="radio"/></span>
|
357 |
+
<span class="sub-label"><?php echo $this->options->button_action_element_selector_label() . ': '; ?></span>
|
358 |
+
<span><input name="<?php echo $this->options->button_action_element_selector_name(); ?>" value="<?php echo $this->options->button_action_element_selector(); ?>" /> <span class="description"><?php echo __('[CSS selector of the element, you are trying to scroll to. Ex: #myDivID, .myDivClass]', 'wpfront-scroll-top'); ?></span></span>
|
359 |
+
</div>
|
360 |
+
<div>
|
361 |
+
<span><input class="alignment-holder" type="radio"/></span>
|
362 |
+
<span class="sub-label"><?php echo $this->options->button_action_container_selector_label() . ': '; ?></span>
|
363 |
+
<span><input name="<?php echo $this->options->button_action_container_selector_name(); ?>" value="<?php echo $this->options->button_action_container_selector(); ?>" /> <span class="description"><?php echo __('[CSS selector of the element, which has the scroll bar. "html, body" works in almost all cases.]', 'wpfront-scroll-top'); ?></span></span>
|
364 |
+
</div>
|
365 |
+
<div>
|
366 |
+
<span><input class="alignment-holder" type="radio"/></span>
|
367 |
+
<span class="sub-label"><?php echo $this->options->button_action_element_offset_label() . ': '; ?></span>
|
368 |
+
<span><input class="pixels" name="<?php echo $this->options->button_action_element_offset_name(); ?>" value="<?php echo $this->options->button_action_element_offset(); ?>" />px <span class="description"><?php echo __('[Negative value allowed. Use this filed to precisely set scroll position. Useful when you have overlapping elements.]', 'wpfront-scroll-top'); ?></span></span>
|
369 |
+
</div>
|
370 |
+
<div>
|
371 |
+
<span><input class="alignment-holder" type="radio"/></span>
|
372 |
+
<span class="sub-label"><a target="_blank" href="https://wpfront.com/wordpress-plugins/scroll-top-plugin/scroll-top-plugin-faq/"><?php echo __('How to find CSS selector?', 'wpfront-scroll-top'); ?></a></span>
|
373 |
+
</div>
|
374 |
+
</div>
|
375 |
+
<br />
|
376 |
+
<label><input type="radio" class="button-action" name="<?php echo $this->options->button_action_name(); ?>" value="url" <?php echo $this->options->button_action() == 'url' ? 'checked' : ''; ?> /> <?php echo __('Link to Page', 'wpfront-scroll-top'); ?></label>
|
377 |
+
<div class="fields-container url hidden">
|
378 |
+
<div>
|
379 |
+
<span><input class="alignment-holder" type="radio"/></span>
|
380 |
+
<span class="sub-label"><?php echo $this->options->button_action_page_url_label() . ': '; ?></span>
|
381 |
+
<span class="url"><input class="url" name="<?php echo $this->options->button_action_page_url_name(); ?>" value="<?php echo $this->options->button_action_page_url(); ?>" /></span>
|
382 |
+
</div>
|
383 |
+
</div>
|
384 |
+
</div>
|
385 |
+
</td>
|
386 |
+
</tr>
|
387 |
+
<?php
|
388 |
+
}
|
389 |
+
|
390 |
+
protected function location_section() {
|
391 |
+
?>
|
392 |
+
<h3><?php echo __('Location', 'wpfront-scroll-top'); ?></h3>
|
393 |
+
<table class="form-table">
|
394 |
+
<?php
|
395 |
+
$this->location_table_row_location();
|
396 |
+
$this->location_table_row_marginX();
|
397 |
+
$this->location_table_row_marginY();
|
398 |
+
?>
|
399 |
+
</table>
|
400 |
+
<?php
|
401 |
+
}
|
402 |
+
|
403 |
+
protected function location_table_row_location() {
|
404 |
+
?>
|
405 |
+
<tr>
|
406 |
+
<th scope="row">
|
407 |
+
<?php echo $this->options->location_label(); ?>
|
408 |
+
</th>
|
409 |
+
<td>
|
410 |
+
<select name="<?php echo $this->options->location_name(); ?>">
|
411 |
+
<option value="1" <?php echo $this->options->location() == 1 ? 'selected' : ''; ?> ><?php echo __('Bottom Right', 'wpfront-scroll-top'); ?></option>
|
412 |
+
<option value="2" <?php echo $this->options->location() == 2 ? 'selected' : ''; ?> ><?php echo __('Bottom Left', 'wpfront-scroll-top'); ?></option>
|
413 |
+
<option value="3" <?php echo $this->options->location() == 3 ? 'selected' : ''; ?> ><?php echo __('Top Right', 'wpfront-scroll-top'); ?></option>
|
414 |
+
<option value="4" <?php echo $this->options->location() == 4 ? 'selected' : ''; ?> ><?php echo __('Top Left', 'wpfront-scroll-top'); ?></option>
|
415 |
+
</select>
|
416 |
+
</td>
|
417 |
+
</tr>
|
418 |
+
<?php
|
419 |
+
}
|
420 |
+
|
421 |
+
protected function location_table_row_marginX() {
|
422 |
+
?>
|
423 |
+
<tr>
|
424 |
+
<th scope="row">
|
425 |
+
<?php echo $this->options->marginX_label(); ?>
|
426 |
+
</th>
|
427 |
+
<td>
|
428 |
+
<input class="pixels" name="<?php echo $this->options->marginX_name(); ?>" value="<?php echo $this->options->marginX(); ?>" />px
|
429 |
+
<span class="description"><?php echo __('[Negative value allowed.]', 'wpfront-scroll-top'); ?></span>
|
430 |
+
</td>
|
431 |
+
</tr>
|
432 |
+
|
433 |
+
<?php
|
434 |
+
}
|
435 |
+
|
436 |
+
protected function location_table_row_marginY() {
|
437 |
+
?>
|
438 |
+
<tr>
|
439 |
+
<th scope="row">
|
440 |
+
<?php echo $this->options->marginY_label(); ?>
|
441 |
+
</th>
|
442 |
+
<td>
|
443 |
+
<input class="pixels" name="<?php echo $this->options->marginY_name(); ?>" value="<?php echo $this->options->marginY(); ?>" />px
|
444 |
+
<span class="description"><?php echo __('[Negative value allowed.]', 'wpfront-scroll-top'); ?></span>
|
445 |
+
</td>
|
446 |
+
</tr>
|
447 |
+
<?php
|
448 |
+
}
|
449 |
+
|
450 |
+
protected function filter_section() {
|
451 |
+
?>
|
452 |
+
<h3><?php echo __('Filter', 'wpfront-scroll-top'); ?></h3>
|
453 |
+
<table class="form-table">
|
454 |
+
<?php
|
455 |
+
$this->filter_table_row_display_page();
|
456 |
+
?>
|
457 |
+
</table>
|
458 |
+
<?php
|
459 |
+
}
|
460 |
+
|
461 |
+
protected function filter_table_row_display_page() {
|
462 |
+
?>
|
463 |
+
<tr>
|
464 |
+
<th scope="row">
|
465 |
+
<?php echo $this->options->display_pages_label(); ?>
|
466 |
+
</th>
|
467 |
+
<td>
|
468 |
+
<label>
|
469 |
+
<input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="1" <?php echo $this->options->display_pages() == 1 ? 'checked' : ''; ?> />
|
470 |
+
<span><?php echo __('All pages.', 'wpfront-scroll-top'); ?></span>
|
471 |
+
</label>
|
472 |
+
<br />
|
473 |
+
<label>
|
474 |
+
<input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="2" <?php echo $this->options->display_pages() == 2 ? 'checked' : ''; ?> />
|
475 |
+
<span><?php echo __('Include in following pages', 'wpfront-scroll-top'); ?></span> <span class="description"><?php echo __('[Use the textbox below to specify the post IDs as a comma separated list.]', 'wpfront-scroll-top'); ?></span>
|
476 |
+
</label>
|
477 |
+
<br />
|
478 |
+
<input class="post-id-list" name="<?php echo $this->options->include_pages_name(); ?>" value="<?php echo $this->options->include_pages(); ?>" />
|
479 |
+
<div class="pages-selection">
|
480 |
+
<?php
|
481 |
+
$objects = $this->controller->get_filter_objects();
|
482 |
+
foreach ($objects as $key => $value) {
|
483 |
+
?>
|
484 |
+
<div class="page-div">
|
485 |
+
<label>
|
486 |
+
<input type="checkbox" value="<?php echo $key; ?>" <?php echo $this->controller->filter_pages_contains($this->options->include_pages(), $key) === FALSE ? '' : 'checked'; ?> />
|
487 |
+
<?php echo $value; ?>
|
488 |
+
</label>
|
489 |
+
</div>
|
490 |
+
<?php
|
491 |
+
}
|
492 |
+
?>
|
493 |
+
</div>
|
494 |
+
<label>
|
495 |
+
<input type="radio" name="<?php echo $this->options->display_pages_name(); ?>" value="3" <?php echo $this->options->display_pages() == 3 ? 'checked' : ''; ?> />
|
496 |
+
<span><?php echo __('Exclude in following pages', 'wpfront-scroll-top'); ?></span> <span class="description"><?php echo __('[Use the textbox below to specify the post IDs as a comma separated list.]', 'wpfront-scroll-top'); ?></span>
|
497 |
+
</label>
|
498 |
+
<br />
|
499 |
+
<input class="post-id-list" name="<?php echo $this->options->exclude_pages_name(); ?>" value="<?php echo $this->options->exclude_pages(); ?>" />
|
500 |
+
<div class="pages-selection">
|
501 |
+
<?php
|
502 |
+
$objects = $this->controller->get_filter_objects();
|
503 |
+
foreach ($objects as $key => $value) {
|
504 |
+
?>
|
505 |
+
<div class="page-div">
|
506 |
+
<label>
|
507 |
+
<input type="checkbox" value="<?php echo $key; ?>" <?php echo $this->controller->filter_pages_contains($this->options->exclude_pages(), $key) === FALSE ? '' : 'checked'; ?> />
|
508 |
+
<?php echo $value; ?>
|
509 |
+
</label>
|
510 |
+
</div>
|
511 |
+
<?php
|
512 |
+
}
|
513 |
+
?>
|
514 |
+
</div>
|
515 |
+
</td>
|
516 |
+
</tr>
|
517 |
+
<?php
|
518 |
+
}
|
519 |
+
|
520 |
+
protected function text_button_section() {
|
521 |
+
?>
|
522 |
+
<h3 class="button-options text"><?php echo __('Text Button', 'wpfront-scroll-top'); ?></h3>
|
523 |
+
<table class="form-table button-options text">
|
524 |
+
<?php
|
525 |
+
$this->text_button_table_row_text();
|
526 |
+
$this->text_button_table_row_color();
|
527 |
+
$this->text_button_table_row_background_color();
|
528 |
+
$this->text_button_table_row_hower_color();
|
529 |
+
$this->text_button_table_row_css();
|
530 |
+
?>
|
531 |
+
</table>
|
532 |
+
<?php
|
533 |
+
}
|
534 |
+
|
535 |
+
protected function text_button_table_row_text() {
|
536 |
+
?>
|
537 |
+
<tr>
|
538 |
+
<th scope="row">
|
539 |
+
<?php echo $this->options->text_button_text_label(); ?>
|
540 |
+
</th>
|
541 |
+
<td>
|
542 |
+
<input name="<?php echo $this->options->text_button_text_name(); ?>" value="<?php echo $this->options->text_button_text(); ?>" />
|
543 |
+
</td>
|
544 |
+
</tr>
|
545 |
+
<?php
|
546 |
+
}
|
547 |
+
|
548 |
+
protected function text_button_table_row_color() {
|
549 |
+
?>
|
550 |
+
<tr>
|
551 |
+
<th scope="row">
|
552 |
+
<?php echo $this->options->text_button_text_color_label(); ?>
|
553 |
+
</th>
|
554 |
+
<td>
|
555 |
+
<div class="color-selector-div">
|
556 |
+
<div class="color-selector" id="color-selector[text_button_text_color]" color="<?php echo $this->options->text_button_text_color(); ?>"></div> 
|
557 |
+
<input type="text" class="color-selector-input" name="<?php echo $this->options->text_button_text_color_name(); ?>" value="<?php echo $this->options->text_button_text_color(); ?>" />
|
558 |
+
</div>
|
559 |
+
</td>
|
560 |
+
</tr>
|
561 |
+
<?php
|
562 |
+
}
|
563 |
+
|
564 |
+
protected function text_button_table_row_background_color() {
|
565 |
+
?>
|
566 |
+
<tr>
|
567 |
+
<th scope="row">
|
568 |
+
<?php echo $this->options->text_button_background_color_label(); ?>
|
569 |
+
</th>
|
570 |
+
<td>
|
571 |
+
<div class="color-selector-div">
|
572 |
+
<div class="color-selector" id="color-selector[text_button_background_color]" color="<?php echo $this->options->text_button_background_color(); ?>"></div> 
|
573 |
+
<input type="text" class="color-selector-input" name="<?php echo $this->options->text_button_background_color_name(); ?>" value="<?php echo $this->options->text_button_background_color(); ?>" />
|
574 |
+
</div>
|
575 |
+
</td>
|
576 |
+
</tr>
|
577 |
+
<?php
|
578 |
+
}
|
579 |
+
|
580 |
+
protected function text_button_table_row_hower_color() {
|
581 |
+
?>
|
582 |
+
<tr>
|
583 |
+
<th scope="row">
|
584 |
+
<?php echo $this->options->text_button_hover_color_label(); ?>
|
585 |
+
</th>
|
586 |
+
<td>
|
587 |
+
<div class="color-selector-div">
|
588 |
+
<div class="color-selector" id="color-selector[text_button_hover_color]" color="<?php echo $this->options->text_button_hover_color(); ?>"></div> 
|
589 |
+
<input type="text" class="color-selector-input" name="<?php echo $this->options->text_button_hover_color_name(); ?>" value="<?php echo $this->options->text_button_hover_color(); ?>" />
|
590 |
+
</div>
|
591 |
+
</td>
|
592 |
+
</tr>
|
593 |
+
<?php
|
594 |
+
}
|
595 |
+
|
596 |
+
protected function text_button_table_row_css() {
|
597 |
+
?>
|
598 |
+
<tr>
|
599 |
+
<th scope="row">
|
600 |
+
<?php echo $this->options->text_button_css_label(); ?>
|
601 |
+
</th>
|
602 |
+
<td>
|
603 |
+
<textarea name="<?php echo $this->options->text_button_css_name(); ?>" rows="5" cols="100"><?php echo $this->options->text_button_css(); ?></textarea>
|
604 |
+
<br />
|
605 |
+
<span class="description"><?php echo '[' . __('ex:', 'wpfront-scroll-top') . ' font-size: 1.5em; padding: 10px;]'; ?></span>
|
606 |
+
</td>
|
607 |
+
</tr>
|
608 |
+
<?php
|
609 |
+
}
|
610 |
+
|
611 |
+
protected function font_awesome_button_section() {
|
612 |
+
?>
|
613 |
+
<h3 class="button-options font-awesome"><?php echo __('Font Awesome Button', 'wpfront-scroll-top'); ?></h3>
|
614 |
+
<table class="form-table button-options font-awesome">
|
615 |
+
<?php
|
616 |
+
$this->fa_button_table_row_class();
|
617 |
+
$this->fa_button_display_row_url();
|
618 |
+
$this->fa_button_display_row_exclude_url();
|
619 |
+
$this->fa_button_display_row_text_color();
|
620 |
+
$this->fa_button_display_row_css();
|
621 |
+
?>
|
622 |
+
</table>
|
623 |
+
<?php
|
624 |
+
}
|
625 |
+
|
626 |
+
protected function fa_button_table_row_class() {
|
627 |
+
?>
|
628 |
+
<tr>
|
629 |
+
<th scope="row">
|
630 |
+
<?php echo $this->options->fa_button_class_label(); ?>
|
631 |
+
</th>
|
632 |
+
<td>
|
633 |
+
<input class="regular-text" name="<?php echo $this->options->fa_button_class_name(); ?>" value="<?php echo $this->options->fa_button_class(); ?>" />
|
634 |
+
<span class="description"><?php echo '[' . __('ex:', 'wpfront-scroll-top') . ' fa fa-arrow-circle-up fa-5x]'; ?></span>
|
635 |
+
</td>
|
636 |
+
</tr>
|
637 |
+
<?php
|
638 |
+
}
|
639 |
+
|
640 |
+
protected function fa_button_display_row_url() {
|
641 |
+
?>
|
642 |
+
<tr>
|
643 |
+
<th scope="row">
|
644 |
+
<?php echo $this->options->fa_button_URL_label(); ?>
|
645 |
+
</th>
|
646 |
+
<td>
|
647 |
+
<input class="url" name="<?php echo $this->options->fa_button_URL_name(); ?>" value="<?php echo $this->options->fa_button_URL(); ?>" />
|
648 |
+
<br />
|
649 |
+
<span class="description"><?php echo '[Leave blank to use BootstrapCDN URL by MaxCDN. Otherwise specify the URL you want to use.]'; ?></span>
|
650 |
+
</td>
|
651 |
+
</tr>
|
652 |
+
<?php
|
653 |
+
}
|
654 |
+
|
655 |
+
protected function fa_button_display_row_exclude_url() {
|
656 |
+
?>
|
657 |
+
<tr>
|
658 |
+
<th scope="row">
|
659 |
+
<?php echo $this->options->fa_button_exclude_URL_label(); ?>
|
660 |
+
</th>
|
661 |
+
<td>
|
662 |
+
<input type="checkbox" name="<?php echo $this->options->fa_button_exclude_URL_name(); ?>" <?php echo $this->options->fa_button_exclude_URL() ? "checked" : ""; ?> />
|
663 |
+
<span class="description"><?php echo '[Enable this setting if your site already has Font Awesome. Usually your theme includes it.]'; ?></span>
|
664 |
+
</td>
|
665 |
+
</tr>
|
666 |
+
<?php
|
667 |
+
}
|
668 |
+
|
669 |
+
protected function fa_button_display_row_text_color() {
|
670 |
+
?>
|
671 |
+
<tr>
|
672 |
+
<th scope="row">
|
673 |
+
<?php echo $this->options->fa_button_text_color_label(); ?>
|
674 |
+
</th>
|
675 |
+
<td>
|
676 |
+
<div class="color-selector-div">
|
677 |
+
<div class="color-selector" id="color-selector[fa_button_text_color]" color="<?php echo $this->options->fa_button_text_color(); ?>"></div> 
|
678 |
+
<input type="text" class="color-selector-input" name="<?php echo $this->options->fa_button_text_color_name(); ?>" value="<?php echo $this->options->fa_button_text_color(); ?>" />
|
679 |
+
</div>
|
680 |
+
</td>
|
681 |
+
</tr>
|
682 |
+
<?php
|
683 |
+
}
|
684 |
+
|
685 |
+
protected function fa_button_display_row_css() {
|
686 |
+
?>
|
687 |
+
<tr>
|
688 |
+
<th scope="row">
|
689 |
+
<?php echo $this->options->fa_button_css_label(); ?>
|
690 |
+
</th>
|
691 |
+
<td>
|
692 |
+
<textarea name="<?php echo $this->options->fa_button_css_name(); ?>" rows="5" cols="100"><?php echo $this->options->fa_button_css(); ?></textarea>
|
693 |
+
<br />
|
694 |
+
<span class="description"><?php echo '[' . __('ex:', 'wpfront-scroll-top') . ' #wpfront-scroll-top-container i:hover{ color: #000000; }]'; ?></span>
|
695 |
+
</td>
|
696 |
+
</tr>
|
697 |
+
<?php
|
698 |
+
}
|
699 |
+
|
700 |
+
protected function image_button_section() {
|
701 |
+
?>
|
702 |
+
<h3 class="button-options image"><?php echo __('Image Button', 'wpfront-scroll-top'); ?></h3>
|
703 |
+
<div class="button-options image">
|
704 |
+
<div class="icons-container">
|
705 |
+
<?php
|
706 |
+
$files = scandir($this->controller->get_icon_dir());
|
707 |
+
foreach ($files as $file) {
|
708 |
+
if ($file == '.' || $file == '..')
|
709 |
+
continue;
|
710 |
+
echo '<div ' . ($this->options->image() == $file ? 'class="selected"' : '') . '>';
|
711 |
+
echo '<input id="' . $file . '" name="' . $this->options->image_name() . '" type="radio" value="' . $file . '" ' . ($this->options->image() == $file ? 'checked' : '') . ' />';
|
712 |
+
echo '<label for="' . $file . '"><img src="' . $this->controller->get_icon_url() . $file . '"/></label>';
|
713 |
+
echo '</div>';
|
714 |
+
}
|
715 |
+
?>
|
716 |
+
</div>
|
717 |
+
<div>
|
718 |
+
<input id="custom" name="<?php echo $this->options->image_name(); ?>" type="radio" value="custom" <?php echo ($this->options->image() == 'custom' ? 'checked' : ''); ?> />
|
719 |
+
<label for="custom"><?php echo __('Custom URL', 'wpfront-scroll-top'); ?>
|
720 |
+
<input id="custom-url-textbox" class="url" name="<?php echo $this->options->custom_url_name(); ?>" value="<?php echo $this->options->custom_url(); ?>"/>
|
721 |
+
<input type="button" id="media-library-button" class="button" value="<?php echo __('Media Library', 'wpfront-scroll-top'); ?>" />
|
722 |
+
</label>
|
723 |
+
</div>
|
724 |
+
<table class="form-table">
|
725 |
+
<tr>
|
726 |
+
<th scope="row">
|
727 |
+
<?php echo $this->options->image_alt_label(); ?>
|
728 |
+
</th>
|
729 |
+
<td>
|
730 |
+
<input id="alt-textbox" class="altText" name="<?php echo $this->options->image_alt_name(); ?>" value="<?php echo $this->options->image_alt(); ?>" />
|
731 |
+
</td>
|
732 |
+
</tr>
|
733 |
+
</table>
|
734 |
</div>
|
735 |
<?php
|
736 |
}
|
737 |
+
|
738 |
+
protected function options_page_footer() {
|
739 |
+
|
740 |
+
$settingsLink = 'scroll-top-plugin-settings/';
|
741 |
+
$FAQLink = 'scroll-top-plugin-faq/';
|
742 |
+
submit_button();
|
743 |
+
?>
|
744 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
745 |
</div>
|
746 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
<?php
|
748 |
+
$this->settingsLink = $settingsLink;
|
749 |
+
$this->FAQLink = $FAQLink;
|
750 |
+
add_filter('admin_footer_text', array($this, 'admin_footer_text'));
|
751 |
+
}
|
752 |
+
|
753 |
+
public function admin_footer_text($text) {
|
754 |
+
$settingsLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/' . $this->settingsLink, __('Settings Description', 'wpfront-scroll-top'));
|
755 |
+
$reviewLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wordpress.org/support/plugin/' . WPFront_Scroll_Top::PLUGIN_SLUG . '/reviews/', __('Write a Review', 'wpfront-scroll-top'));
|
756 |
+
$donateLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/donate/', __('Buy me a Beer or Coffee', 'wpfront-scroll-top'));
|
757 |
+
|
758 |
+
return sprintf('%s | %s | %s | %s', $settingsLink, $reviewLink, $donateLink, $text);
|
759 |
+
}
|
760 |
+
|
761 |
+
protected function script_section() {
|
762 |
?>
|
763 |
+
<script type="text/javascript">
|
764 |
+
(function () {
|
765 |
+
init_wpfront_scroll_top_options({
|
766 |
+
button_style: '<?php echo $this->options->button_style(); ?>',
|
767 |
+
button_action: '<?php echo $this->options->button_action(); ?>',
|
768 |
+
label_choose_image: '<?php echo __('Choose Image', 'wpfront-scroll-top'); ?>',
|
769 |
+
label_select_image: '<?php echo __('Select Image', 'wpfront-scroll-top'); ?>'
|
770 |
+
});
|
771 |
+
})();
|
772 |
+
</script>
|
773 |
+
<?php
|
774 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
775 |
|
776 |
+
}
|
templates/scroll-top-template.php
CHANGED
@@ -29,89 +29,156 @@ namespace WPFront\Scroll_Top;
|
|
29 |
* @author Syam Mohan <syam@wpfront.com>
|
30 |
* @copyright 2013 WPFront.com
|
31 |
*/
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
|
|
|
|
|
|
43 |
}
|
|
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
|
|
52 |
|
53 |
-
#wpfront-scroll-top-container {
|
54 |
-
|
55 |
}
|
|
|
|
|
|
|
56 |
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
|
62 |
-
<?php
|
63 |
-
|
64 |
-
?>
|
65 |
-
<div id="wpfront-scroll-top-container">
|
66 |
<?php
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
?>
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
color: <?php echo $this->options->text_button_text_color(); ?>;
|
76 |
-
background-color: <?php echo $this->options->text_button_background_color(); ?>;
|
77 |
-
width: <?php echo $this->options->button_width() == 0 ? 'auto' : $this->options->button_width() . 'px'; ?>;
|
78 |
-
height: <?php echo $this->options->button_height() == 0 ? 'auto' : $this->options->button_height() . 'px'; ?>;
|
79 |
-
|
80 |
-
<?php echo $this->options->text_button_css(); ?>
|
81 |
-
}
|
82 |
-
|
83 |
-
#wpfront-scroll-top-container div.text-holder:hover {
|
84 |
-
background-color: <?php echo $this->options->text_button_hover_color(); ?>;
|
85 |
-
}
|
86 |
-
</style>
|
87 |
-
<?php
|
88 |
-
} elseif($this->options->button_style() == 'font-awesome') {
|
89 |
-
?>
|
90 |
-
<div id="wpfront-scroll-top-container">
|
91 |
-
<?php
|
92 |
-
$html = sprintf('<i class="%s"></i>', $this->options->fa_button_class());
|
93 |
-
$html = $this->apply_button_action_html($html);
|
94 |
echo $html;
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
<style type="text/css">
|
99 |
-
#wpfront-scroll-top-container i {
|
100 |
-
color: <?php echo $this->options->fa_button_text_color(); ?>;
|
101 |
-
}
|
102 |
-
|
103 |
-
<?php echo $this->options->fa_button_css(); ?>
|
104 |
-
</style>
|
105 |
-
<?php
|
106 |
-
} else {
|
107 |
-
?>
|
108 |
-
<div id="wpfront-scroll-top-container">
|
109 |
<?php
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
?>
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
-
?>
|
29 |
* @author Syam Mohan <syam@wpfront.com>
|
30 |
* @copyright 2013 WPFront.com
|
31 |
*/
|
32 |
+
class WPFront_Scroll_Top_Template {
|
33 |
+
|
34 |
+
protected $controller;
|
35 |
+
protected $options;
|
36 |
+
|
37 |
+
public function write_markup($controller) {
|
38 |
+
$this->controller = $controller;
|
39 |
+
$this->options = $controller->get_options();
|
40 |
+
|
41 |
+
$this->hide_small_window();
|
42 |
+
$this->hide_small_device();
|
43 |
+
$this->button_style_css();
|
44 |
+
$this->button_script_section();
|
45 |
+
}
|
46 |
+
|
47 |
+
public function hide_small_window() {
|
48 |
+
if ($this->options->hide_small_window()) {
|
49 |
+
?>
|
50 |
+
<style type="text/css">
|
51 |
+
@media screen and (max-width: <?php echo $this->options->small_window_width() . "px"; ?>) {
|
52 |
+
#wpfront-scroll-top-container {
|
53 |
+
visibility: hidden;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
</style>
|
57 |
+
<?php
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
public function hide_small_device() {
|
62 |
+
if ($this->options->hide_small_device()) {
|
63 |
+
?>
|
64 |
+
<style type="text/css">
|
65 |
+
@media screen and (max-device-width: <?php echo $this->options->small_device_width() . "px"; ?>) {
|
66 |
+
#wpfront-scroll-top-container {
|
67 |
+
visibility: hidden;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
</style>
|
71 |
+
<?php
|
72 |
+
}
|
73 |
+
}
|
74 |
|
75 |
+
public function button_style_css() {
|
76 |
+
switch ($this->options->button_style()) {
|
77 |
+
case 'text':
|
78 |
+
$this->button_style_css_text();
|
79 |
+
break;
|
80 |
|
81 |
+
case 'font-awesome':
|
82 |
+
$this->button_style_css_font_awesome();
|
83 |
+
break;
|
84 |
|
85 |
+
default:
|
86 |
+
$this->button_style_css_image();
|
87 |
+
break;
|
88 |
}
|
89 |
+
}
|
90 |
|
91 |
+
public function button_style_css_text() {
|
92 |
+
?>
|
93 |
+
<div id="wpfront-scroll-top-container">
|
94 |
+
<?php
|
95 |
+
$html = sprintf('<div class="text-holder">%s</div>', $this->options->text_button_text());
|
96 |
+
$html = $this->controller->apply_button_action_html($html);
|
97 |
+
echo $html;
|
98 |
+
?>
|
99 |
+
</div>
|
100 |
|
101 |
+
<style type="text/css">
|
102 |
+
#wpfront-scroll-top-container div.text-holder {
|
103 |
+
color: <?php echo $this->options->text_button_text_color(); ?>;
|
104 |
+
background-color: <?php echo $this->options->text_button_background_color(); ?>;
|
105 |
+
width: <?php echo $this->options->button_width() == 0 ? 'auto' : $this->options->button_width() . 'px'; ?>;
|
106 |
+
height: <?php echo $this->options->button_height() == 0 ? 'auto' : $this->options->button_height() . 'px'; ?>;
|
107 |
|
108 |
+
<?php echo $this->options->text_button_css(); ?>
|
109 |
+
}
|
110 |
|
111 |
+
#wpfront-scroll-top-container div.text-holder:hover {
|
112 |
+
background-color: <?php echo $this->options->text_button_hover_color(); ?>;
|
113 |
}
|
114 |
+
</style>
|
115 |
+
<?php
|
116 |
+
}
|
117 |
|
118 |
+
public function button_style_css_font_awesome() {
|
119 |
+
?>
|
120 |
+
<div id="wpfront-scroll-top-container">
|
121 |
+
<?php
|
122 |
+
$html = sprintf('<i class="%s"></i>', $this->options->fa_button_class());
|
123 |
+
$html = $this->controller->apply_button_action_html($html);
|
124 |
+
echo $html;
|
125 |
+
?>
|
126 |
+
</div>
|
127 |
|
128 |
+
<style type="text/css">
|
129 |
+
#wpfront-scroll-top-container i {
|
130 |
+
color: <?php echo $this->options->fa_button_text_color(); ?>;
|
131 |
+
}
|
132 |
|
133 |
+
<?php echo $this->options->fa_button_css(); ?>
|
134 |
+
</style>
|
|
|
|
|
135 |
<?php
|
136 |
+
}
|
137 |
+
|
138 |
+
public function button_style_css_image() {
|
139 |
?>
|
140 |
+
<div id="wpfront-scroll-top-container">
|
141 |
+
<?php
|
142 |
+
$html = sprintf('<img src="%s" alt="%s" />', $this->controller->image(), $this->options->image_alt());
|
143 |
+
$html = $this->controller->apply_button_action_html($html);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
echo $html;
|
145 |
+
?>
|
146 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<?php
|
148 |
+
}
|
149 |
+
|
150 |
+
private function button_script_section() {
|
151 |
+
|
152 |
+
$json = json_encode(array(
|
153 |
+
'scroll_offset' => $this->options->scroll_offset(),
|
154 |
+
'button_width' => $this->options->button_width(),
|
155 |
+
'button_height' => $this->options->button_height(),
|
156 |
+
'button_opacity' => $this->options->button_opacity() / 100,
|
157 |
+
'button_fade_duration' => $this->options->button_fade_duration(),
|
158 |
+
'scroll_duration' => $this->options->scroll_duration(),
|
159 |
+
'location' => $this->options->location(),
|
160 |
+
'marginX' => $this->options->marginX(),
|
161 |
+
'marginY' => $this->options->marginY(),
|
162 |
+
'hide_iframe' => $this->options->hide_iframe(),
|
163 |
+
'auto_hide' => $this->options->auto_hide(),
|
164 |
+
'auto_hide_after' => $this->options->auto_hide_after(),
|
165 |
+
'button_action' => $this->options->button_action(),
|
166 |
+
'button_action_element_selector' => $this->options->button_action_element_selector(),
|
167 |
+
'button_action_container_selector' => $this->options->button_action_container_selector(),
|
168 |
+
'button_action_element_offset' => $this->options->button_action_element_offset()
|
169 |
+
));
|
170 |
?>
|
171 |
+
<script type="text/javascript">
|
172 |
+
function wpfront_scroll_top_init() {
|
173 |
+
if (typeof wpfront_scroll_top === "function" && typeof jQuery !== "undefined") {
|
174 |
+
wpfront_scroll_top(<?php echo $json; ?>);
|
175 |
+
} else {
|
176 |
+
setTimeout(wpfront_scroll_top_init, 100);
|
177 |
+
}
|
178 |
+
}
|
179 |
+
wpfront_scroll_top_init();
|
180 |
+
</script>
|
181 |
+
<?php
|
182 |
+
}
|
183 |
+
|
184 |
}
|
|
uninstall.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
-
|
|
|
|
|
5 |
}
|
6 |
|
7 |
-
$option_name = 'wpfront-scroll-top-options';
|
8 |
|
9 |
-
delete_option($option_name);
|
10 |
|
11 |
//TODO: Multisite delete
|
12 |
//http://codex.wordpress.org/Function_Reference/register_uninstall_hook
|
1 |
<?php
|
2 |
|
3 |
+
if (defined('WP_UNINSTALL_PLUGIN')) {
|
4 |
+
$option_name = 'wpfront-scroll-top-options';
|
5 |
+
|
6 |
+
delete_option($option_name);
|
7 |
}
|
8 |
|
|
|
9 |
|
|
|
10 |
|
11 |
//TODO: Multisite delete
|
12 |
//http://codex.wordpress.org/Function_Reference/register_uninstall_hook
|
wpfront-scroll-top.php
CHANGED
@@ -3,7 +3,9 @@
|
|
3 |
* Plugin Name: WPFront Scroll Top
|
4 |
* Plugin URI: http://wpfront.com/scroll-top-plugin/
|
5 |
* Description: Allows the visitor to easily scroll back to the top of the page.
|
6 |
-
* Version: 2.0.
|
|
|
|
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|
3 |
* Plugin Name: WPFront Scroll Top
|
4 |
* Plugin URI: http://wpfront.com/scroll-top-plugin/
|
5 |
* Description: Allows the visitor to easily scroll back to the top of the page.
|
6 |
+
* Version: 2.0.3.03232
|
7 |
+
* Requires at least: 4.1
|
8 |
+
* Requires PHP: 5.3
|
9 |
* Author: Syam Mohan
|
10 |
* Author URI: http://wpfront.com
|
11 |
* License: GPL v3
|