Version Description
- New option to hide on mobile devices
- Fixed conflicts with other plugins
Download this release
Release Info
Developer | syammohanm |
Plugin | WPFront Scroll Top |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.1
- classes/class-wpfront-scroll-top-options.php +4 -0
- classes/class-wpfront-scroll-top.php +9 -1
- languages/wpfront-scroll-top.mo +0 -0
- languages/wpfront-scroll-top.po +69 -31
- readme.txt +10 -1
- templates/options-template.php +36 -0
- templates/scroll-top-template.php +28 -0
- wpfront-scroll-top.php +1 -1
classes/class-wpfront-scroll-top-options.php
CHANGED
@@ -45,6 +45,10 @@ if (!class_exists('WPFront_Scroll_Top_Options')) {
|
|
45 |
$this->addOption('button_opacity', 'int', 80, array($this, 'validate_range_0_100'))->__('Button Opacity');
|
46 |
$this->addOption('button_fade_duration', 'int', 200, array($this, 'validate_zero_positive'))->__('Button Fade Duration');
|
47 |
$this->addOption('scroll_duration', 'int', 400, array($this, 'validate_zero_positive'))->__('Scroll Duration');
|
|
|
|
|
|
|
|
|
48 |
|
49 |
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->__('Location');
|
50 |
$this->addOption('marginX', 'int', 20)->__('Margin X');
|
45 |
$this->addOption('button_opacity', 'int', 80, array($this, 'validate_range_0_100'))->__('Button Opacity');
|
46 |
$this->addOption('button_fade_duration', 'int', 200, array($this, 'validate_zero_positive'))->__('Button Fade Duration');
|
47 |
$this->addOption('scroll_duration', 'int', 400, array($this, 'validate_zero_positive'))->__('Scroll Duration');
|
48 |
+
$this->addOption('hide_small_device', 'bit', FALSE)->__('Hide on Small Devices');
|
49 |
+
$this->addOption('small_device_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Device Max Width');
|
50 |
+
$this->addOption('hide_small_window', 'bit', FALSE)->__('Hide on Small Window');
|
51 |
+
$this->addOption('small_window_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Window Max Width');
|
52 |
|
53 |
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->__('Location');
|
54 |
$this->addOption('marginX', 'int', 20)->__('Margin X');
|
classes/class-wpfront-scroll-top.php
CHANGED
@@ -35,7 +35,7 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
35 |
class WPFront_Scroll_Top {
|
36 |
|
37 |
//Constants
|
38 |
-
const VERSION = '1.
|
39 |
const OPTIONSPAGE_SLUG = 'wpfront-scroll-top';
|
40 |
const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
|
41 |
const OPTION_NAME = 'wpfront-scroll-top-options';
|
@@ -173,7 +173,15 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
173 |
if ($this->scriptLoaded != TRUE) {
|
174 |
return;
|
175 |
}
|
|
|
|
|
|
|
|
|
176 |
|
|
|
|
|
|
|
|
|
177 |
if ($this->enabled()) {
|
178 |
include($this->pluginDIRRoot . 'templates/scroll-top-template.php');
|
179 |
|
35 |
class WPFront_Scroll_Top {
|
36 |
|
37 |
//Constants
|
38 |
+
const VERSION = '1.1';
|
39 |
const OPTIONSPAGE_SLUG = 'wpfront-scroll-top';
|
40 |
const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
|
41 |
const OPTION_NAME = 'wpfront-scroll-top-options';
|
173 |
if ($this->scriptLoaded != TRUE) {
|
174 |
return;
|
175 |
}
|
176 |
+
|
177 |
+
if (defined('DOING_AJAX') && DOING_AJAX) {
|
178 |
+
return;
|
179 |
+
}
|
180 |
|
181 |
+
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
182 |
+
return;
|
183 |
+
}
|
184 |
+
|
185 |
if ($this->enabled()) {
|
186 |
include($this->pluginDIRRoot . 'templates/scroll-top-template.php');
|
187 |
|
languages/wpfront-scroll-top.mo
CHANGED
Binary file
|
languages/wpfront-scroll-top.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WPFront Notification Bar\n"
|
4 |
-
"POT-Creation-Date: 2014-01-
|
5 |
-
"PO-Revision-Date: 2014-01-
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: WPFront <contact@wpfront.com>\n"
|
8 |
"Language: en\n"
|
@@ -36,16 +36,32 @@ msgstr "Button Fade Duration"
|
|
36 |
msgid "Scroll Duration"
|
37 |
msgstr "Scroll Duration"
|
38 |
|
|
|
|
|
|
|
|
|
39 |
#: ../classes/class-wpfront-scroll-top-options.php:49
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
msgid "Location"
|
42 |
msgstr "Location"
|
43 |
|
44 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
45 |
msgid "Margin X"
|
46 |
msgstr "Margin X"
|
47 |
|
48 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
49 |
msgid "Margin Y"
|
50 |
msgstr "Margin Y"
|
51 |
|
@@ -65,7 +81,7 @@ msgstr "You do not have sufficient permissions to access this page."
|
|
65 |
msgid "Settings"
|
66 |
msgstr "Settings"
|
67 |
|
68 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
69 |
msgid "Save Changes"
|
70 |
msgstr "Save Changes"
|
71 |
|
@@ -105,34 +121,74 @@ msgstr "[Button fade duration in milliseconds.]"
|
|
105 |
msgid "[Window scroll duration in milliseconds.]"
|
106 |
msgstr "[Window scroll duration in milliseconds.]"
|
107 |
|
108 |
-
#: ../templates/options-template.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
msgid "Bottom Right"
|
110 |
msgstr "Bottom Right"
|
111 |
|
112 |
-
#: ../templates/options-template.php:
|
113 |
msgid "Bottom Left"
|
114 |
msgstr "Bottom Left"
|
115 |
|
116 |
-
#: ../templates/options-template.php:
|
117 |
msgid "Top Right"
|
118 |
msgstr "Top Right"
|
119 |
|
120 |
-
#: ../templates/options-template.php:
|
121 |
msgid "Top Left"
|
122 |
msgstr "Top Left"
|
123 |
|
124 |
-
#: ../templates/options-template.php:
|
125 |
msgid "[Negative value allowed.]"
|
126 |
msgstr "[Negative value allowed.]"
|
127 |
|
128 |
-
#: ../templates/options-template.php:
|
129 |
msgid "Image"
|
130 |
msgstr "Image"
|
131 |
|
132 |
-
#: ../templates/options-template.php:
|
133 |
msgid "Custom URL"
|
134 |
msgstr "Custom URL"
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
#~ msgid "Bar Height"
|
137 |
#~ msgstr "Bar Height"
|
138 |
|
@@ -290,24 +346,6 @@ msgstr "Custom URL"
|
|
290 |
#~ msgid "Plugin Ideas"
|
291 |
#~ msgstr "Plugin Ideas"
|
292 |
|
293 |
-
#~ msgid "Settings Description"
|
294 |
-
#~ msgstr "Settings Description"
|
295 |
-
|
296 |
-
#~ msgid "Plugin FAQ"
|
297 |
-
#~ msgstr "Plugin FAQ"
|
298 |
-
|
299 |
-
#~ msgid "Feature Request"
|
300 |
-
#~ msgstr "Feature Request"
|
301 |
-
|
302 |
-
#~ msgid "Report Bug"
|
303 |
-
#~ msgstr "Report Bug"
|
304 |
-
|
305 |
-
#~ msgid "Write Review"
|
306 |
-
#~ msgstr "Write Review"
|
307 |
-
|
308 |
-
#~ msgid "Contact Me (syam@wpfront.com)"
|
309 |
-
#~ msgstr "Contact Me (syam@wpfront.com)"
|
310 |
-
|
311 |
#~ msgid "Animate Display"
|
312 |
#~ msgstr "Animate Display"
|
313 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WPFront Notification Bar\n"
|
4 |
+
"POT-Creation-Date: 2014-01-15 10:08-0700\n"
|
5 |
+
"PO-Revision-Date: 2014-01-15 10:08-0700\n"
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: WPFront <contact@wpfront.com>\n"
|
8 |
"Language: en\n"
|
36 |
msgid "Scroll Duration"
|
37 |
msgstr "Scroll Duration"
|
38 |
|
39 |
+
#: ../classes/class-wpfront-scroll-top-options.php:48
|
40 |
+
msgid "Hide on Small Devices"
|
41 |
+
msgstr "Hide on Small Devices"
|
42 |
+
|
43 |
#: ../classes/class-wpfront-scroll-top-options.php:49
|
44 |
+
msgid "Small Device Max Width"
|
45 |
+
msgstr "Small Device Max Width"
|
46 |
+
|
47 |
+
#: ../classes/class-wpfront-scroll-top-options.php:50
|
48 |
+
msgid "Hide on Small Window"
|
49 |
+
msgstr "Hide on Small Window"
|
50 |
+
|
51 |
+
#: ../classes/class-wpfront-scroll-top-options.php:51
|
52 |
+
msgid "Small Window Max Width"
|
53 |
+
msgstr "Small Window Max Width"
|
54 |
+
|
55 |
+
#: ../classes/class-wpfront-scroll-top-options.php:53
|
56 |
+
#: ../templates/options-template.php:143
|
57 |
msgid "Location"
|
58 |
msgstr "Location"
|
59 |
|
60 |
+
#: ../classes/class-wpfront-scroll-top-options.php:54
|
61 |
msgid "Margin X"
|
62 |
msgstr "Margin X"
|
63 |
|
64 |
+
#: ../classes/class-wpfront-scroll-top-options.php:55
|
65 |
msgid "Margin Y"
|
66 |
msgstr "Margin Y"
|
67 |
|
81 |
msgid "Settings"
|
82 |
msgstr "Settings"
|
83 |
|
84 |
+
#: ../classes/class-wpfront-scroll-top.php:217
|
85 |
msgid "Save Changes"
|
86 |
msgstr "Save Changes"
|
87 |
|
121 |
msgid "[Window scroll duration in milliseconds.]"
|
122 |
msgstr "[Window scroll duration in milliseconds.]"
|
123 |
|
124 |
+
#: ../templates/options-template.php:112
|
125 |
+
msgid "[Button will be hidden on small devices when the width matches.]"
|
126 |
+
msgstr "[Button will be hidden on small devices when the width matches.]"
|
127 |
+
|
128 |
+
#: ../templates/options-template.php:121
|
129 |
+
msgid "[Button will be hidden on devices with lesser or equal width.]"
|
130 |
+
msgstr "[Button will be hidden on devices with lesser or equal width.]"
|
131 |
+
|
132 |
+
#: ../templates/options-template.php:130
|
133 |
+
msgid "[Button will be hidden on broswer window when the width matches.]"
|
134 |
+
msgstr "[Button will be hidden on broswer window when the width matches.]"
|
135 |
+
|
136 |
+
#: ../templates/options-template.php:139
|
137 |
+
msgid "[Button will be hidden on browser window with lesser or equal width.]"
|
138 |
+
msgstr "[Button will be hidden on browser window with lesser or equal width.]"
|
139 |
+
|
140 |
+
#: ../templates/options-template.php:151
|
141 |
msgid "Bottom Right"
|
142 |
msgstr "Bottom Right"
|
143 |
|
144 |
+
#: ../templates/options-template.php:152
|
145 |
msgid "Bottom Left"
|
146 |
msgstr "Bottom Left"
|
147 |
|
148 |
+
#: ../templates/options-template.php:153
|
149 |
msgid "Top Right"
|
150 |
msgstr "Top Right"
|
151 |
|
152 |
+
#: ../templates/options-template.php:154
|
153 |
msgid "Top Left"
|
154 |
msgstr "Top Left"
|
155 |
|
156 |
+
#: ../templates/options-template.php:164 ../templates/options-template.php:173
|
157 |
msgid "[Negative value allowed.]"
|
158 |
msgstr "[Negative value allowed.]"
|
159 |
|
160 |
+
#: ../templates/options-template.php:177
|
161 |
msgid "Image"
|
162 |
msgstr "Image"
|
163 |
|
164 |
+
#: ../templates/options-template.php:193
|
165 |
msgid "Custom URL"
|
166 |
msgstr "Custom URL"
|
167 |
|
168 |
+
#: ../templates/options-template.php:200
|
169 |
+
msgid "Settings Description"
|
170 |
+
msgstr "Settings Description"
|
171 |
+
|
172 |
+
#: ../templates/options-template.php:202
|
173 |
+
msgid "Plugin FAQ"
|
174 |
+
msgstr "Plugin FAQ"
|
175 |
+
|
176 |
+
#: ../templates/options-template.php:204
|
177 |
+
msgid "Feature Request"
|
178 |
+
msgstr "Feature Request"
|
179 |
+
|
180 |
+
#: ../templates/options-template.php:206
|
181 |
+
msgid "Report Bug"
|
182 |
+
msgstr "Report Bug"
|
183 |
+
|
184 |
+
#: ../templates/options-template.php:208
|
185 |
+
msgid "Write Review"
|
186 |
+
msgstr "Write Review"
|
187 |
+
|
188 |
+
#: ../templates/options-template.php:210
|
189 |
+
msgid "Contact Me (syam@wpfront.com)"
|
190 |
+
msgstr "Contact Me (syam@wpfront.com)"
|
191 |
+
|
192 |
#~ msgid "Bar Height"
|
193 |
#~ msgstr "Bar Height"
|
194 |
|
346 |
#~ msgid "Plugin Ideas"
|
347 |
#~ msgstr "Plugin Ideas"
|
348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
#~ msgid "Animate Display"
|
350 |
#~ msgstr "Animate Display"
|
351 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpfront.com/donate/
|
|
4 |
Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -17,6 +17,7 @@ Allows the visitor to easily scroll back to the top of the page, with fully cust
|
|
17 |
* Displays a button when user scrolls down the page.
|
18 |
* Scrolls the page back to top with animation.
|
19 |
* Set any image you want.
|
|
|
20 |
|
21 |
== Installation ==
|
22 |
|
@@ -42,6 +43,10 @@ No one has asked anything yet.
|
|
42 |
|
43 |
== Changelog ==
|
44 |
|
|
|
|
|
|
|
|
|
45 |
= 1.0.1 =
|
46 |
* Bug fixes
|
47 |
|
@@ -50,6 +55,10 @@ No one has asked anything yet.
|
|
50 |
|
51 |
== Upgrade Notice ==
|
52 |
|
|
|
|
|
|
|
|
|
53 |
= 1.0.1 =
|
54 |
* Bug fixes
|
55 |
|
4 |
Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 1.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
17 |
* Displays a button when user scrolls down the page.
|
18 |
* Scrolls the page back to top with animation.
|
19 |
* Set any image you want.
|
20 |
+
* Hide on small devices.
|
21 |
|
22 |
== Installation ==
|
23 |
|
43 |
|
44 |
== Changelog ==
|
45 |
|
46 |
+
= 1.1 =
|
47 |
+
* New option to hide on mobile devices
|
48 |
+
* Fixed conflicts with other plugins
|
49 |
+
|
50 |
= 1.0.1 =
|
51 |
* Bug fixes
|
52 |
|
55 |
|
56 |
== Upgrade Notice ==
|
57 |
|
58 |
+
= 1.1 =
|
59 |
+
* New option to hide on mobile devices
|
60 |
+
* Fixed conflicts with other plugins
|
61 |
+
|
62 |
= 1.0.1 =
|
63 |
* Bug fixes
|
64 |
|
templates/options-template.php
CHANGED
@@ -103,6 +103,42 @@
|
|
103 |
<span class="description"><?php echo $this->__('[Window scroll duration in milliseconds.]'); ?></span>
|
104 |
</td>
|
105 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
</table>
|
107 |
<h3><?php echo $this->__('Location'); ?></h3>
|
108 |
<table class="form-table">
|
103 |
<span class="description"><?php echo $this->__('[Window scroll duration in milliseconds.]'); ?></span>
|
104 |
</td>
|
105 |
</tr>
|
106 |
+
<tr>
|
107 |
+
<th scope="row">
|
108 |
+
<?php echo $this->options->hide_small_device_label(); ?>
|
109 |
+
</th>
|
110 |
+
<td>
|
111 |
+
<input type="checkbox" name="<?php echo $this->options->hide_small_device_name(); ?>" <?php echo $this->options->hide_small_device() ? "checked" : ""; ?> />
|
112 |
+
<span class="description"><?php echo $this->__('[Button will be hidden on small devices when the width matches.]'); ?></span>
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
+
<tr>
|
116 |
+
<th scope="row">
|
117 |
+
<?php echo $this->options->small_device_width_label(); ?>
|
118 |
+
</th>
|
119 |
+
<td>
|
120 |
+
<input class="pixels" name="<?php echo $this->options->small_device_width_name(); ?>" value="<?php echo $this->options->small_device_width(); ?>" />px
|
121 |
+
<span class="description"><?php echo $this->__('[Button will be hidden on devices with lesser or equal width.]'); ?></span>
|
122 |
+
</td>
|
123 |
+
</tr>
|
124 |
+
<tr>
|
125 |
+
<th scope="row">
|
126 |
+
<?php echo $this->options->hide_small_window_label(); ?>
|
127 |
+
</th>
|
128 |
+
<td>
|
129 |
+
<input type="checkbox" name="<?php echo $this->options->hide_small_window_name(); ?>" <?php echo $this->options->hide_small_window() ? "checked" : ""; ?> />
|
130 |
+
<span class="description"><?php echo $this->__('[Button will be hidden on broswer window when the width matches.]'); ?></span>
|
131 |
+
</td>
|
132 |
+
</tr>
|
133 |
+
<tr>
|
134 |
+
<th scope="row">
|
135 |
+
<?php echo $this->options->small_window_width_label(); ?>
|
136 |
+
</th>
|
137 |
+
<td>
|
138 |
+
<input class="pixels" name="<?php echo $this->options->small_window_width_name(); ?>" value="<?php echo $this->options->small_window_width(); ?>" />px
|
139 |
+
<span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
</table>
|
143 |
<h3><?php echo $this->__('Location'); ?></h3>
|
144 |
<table class="form-table">
|
templates/scroll-top-template.php
CHANGED
@@ -29,4 +29,32 @@
|
|
29 |
*/
|
30 |
?>
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<div id="wpfront-scroll-top-container"><img src="<?php echo $this->image(); ?>" /></div>
|
29 |
*/
|
30 |
?>
|
31 |
|
32 |
+
<?php if ($this->options->hide_small_window()) { ?>
|
33 |
+
<style type="text/css">
|
34 |
+
|
35 |
+
@media screen and (max-width: <?php echo $this->options->small_window_width() . "px"; ?>) {
|
36 |
+
|
37 |
+
#wpfront-scroll-top-container {
|
38 |
+
visibility: hidden;
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
</style>
|
44 |
+
<?php } ?>
|
45 |
+
|
46 |
+
<?php if ($this->options->hide_small_device()) { ?>
|
47 |
+
<style type="text/css">
|
48 |
+
|
49 |
+
@media screen and (max-device-width: <?php echo $this->options->small_device_width() . "px"; ?>) {
|
50 |
+
|
51 |
+
#wpfront-scroll-top-container {
|
52 |
+
visibility: hidden;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
</style>
|
58 |
+
<?php } ?>
|
59 |
+
|
60 |
<div id="wpfront-scroll-top-container"><img src="<?php echo $this->image(); ?>" /></div>
|
wpfront-scroll-top.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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: 1.
|
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: 1.1
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|