Version Description
- Requires minimum PHP 5.3.
- Bug fixes.
- Moved menu under 'Settings' menu.
- PHP 7.2 compatibility fixes.
Download this release
Release Info
Developer | syammohanm |
Plugin | WPFront Scroll Top |
Version | 1.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.1 to 1.6.2
- classes/base/class-wpfront-base-menu.php +0 -86
- classes/base/class-wpfront-base.php +144 -149
- classes/base/class-wpfront-options-base.php +109 -110
- classes/base/class-wpfront-static.php +29 -31
- classes/base/images/wpfront_menu.png +0 -0
- classes/class-wpfront-scroll-top-options.php +125 -128
- classes/class-wpfront-scroll-top.php +216 -224
- js/wpfront-scroll-top.js +4 -1
- js/wpfront-scroll-top.min.js +2 -1
- languages/wpfront-scroll-top.mo +0 -0
- languages/wpfront-scroll-top.po +73 -280
- readme.txt +15 -2
- templates/options-template.php +2 -24
- templates/scroll-top-template.php +2 -0
- wpfront-scroll-top.php +2 -1
classes/base/class-wpfront-base-menu.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
WPFront Plugins Base Menu
|
4 |
-
Copyright (C) 2013, WPFront.com
|
5 |
-
Website: wpfront.com
|
6 |
-
Contact: syam@wpfront.com
|
7 |
-
|
8 |
-
WPFront Plugins are distributed under the GNU General Public License, Version 3,
|
9 |
-
June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
|
10 |
-
St, Fifth Floor, Boston, MA 02110, USA
|
11 |
-
|
12 |
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
13 |
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
14 |
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
15 |
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
16 |
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
17 |
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
18 |
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
19 |
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
20 |
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
21 |
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
22 |
-
*/
|
23 |
-
|
24 |
-
if (!class_exists('WPFront_Base_Menu')) {
|
25 |
-
|
26 |
-
class WPFront_Base_Menu {
|
27 |
-
|
28 |
-
const MENU_SLUG = 'wpfront-plugins';
|
29 |
-
|
30 |
-
private static $wpfrontBase = NULL;
|
31 |
-
private static $wpfrontBaseMenu = NULL;
|
32 |
-
|
33 |
-
function __construct($wpfrontBase) {
|
34 |
-
if (self::$wpfrontBase == NULL) {
|
35 |
-
self::$wpfrontBase = $wpfrontBase;
|
36 |
-
self::$wpfrontBaseMenu = $this;
|
37 |
-
} else {
|
38 |
-
if (version_compare($this->version(), self::$wpfrontBaseMenu->version()) > 0) {
|
39 |
-
self::$wpfrontBase = $wpfrontBase;
|
40 |
-
self::$wpfrontBaseMenu = $this;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
protected function version() {
|
46 |
-
return '1.0';
|
47 |
-
}
|
48 |
-
|
49 |
-
protected function create_admin_menu($menu_data) {
|
50 |
-
$menu_slug = $menu_data[0]['slug'];
|
51 |
-
|
52 |
-
global $admin_page_hooks, $submenu;
|
53 |
-
if (!isset($admin_page_hooks[$menu_slug])) {
|
54 |
-
add_menu_page(__('WPFront', 'wpfront-scroll-top'), __('WPFront', 'wpfront-scroll-top'), 'manage_options', $menu_slug, null, self::$wpfrontBase->pluginURL() . 'classes/base/images/wpfront_menu.png');
|
55 |
-
}
|
56 |
-
|
57 |
-
foreach ($menu_data as $value) {
|
58 |
-
$flag = FALSE;
|
59 |
-
|
60 |
-
if(!empty($submenu[$menu_slug])) {
|
61 |
-
foreach ($submenu[$menu_slug] as $s) {
|
62 |
-
if ($s[2] == $value['slug']) {
|
63 |
-
$flag = TRUE;
|
64 |
-
break;
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
if ($flag == TRUE)
|
70 |
-
continue;
|
71 |
-
|
72 |
-
$page_hook_suffix = add_submenu_page($menu_slug, $value['title'], $value['link'], 'manage_options', $value['slug'], array($value['this'], 'options_page'));
|
73 |
-
|
74 |
-
add_action('admin_print_scripts-' . $page_hook_suffix, array($value['this'], 'enqueue_options_scripts'));
|
75 |
-
add_action('admin_print_styles-' . $page_hook_suffix, array($value['this'], 'enqueue_options_styles'));
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
public static function admin_menu($menu_data) {
|
80 |
-
self::$wpfrontBaseMenu->create_admin_menu($menu_data);
|
81 |
-
}
|
82 |
-
|
83 |
-
}
|
84 |
-
|
85 |
-
}
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/base/class-wpfront-base.php
CHANGED
@@ -22,186 +22,181 @@
|
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
|
|
|
|
25 |
require_once("class-wpfront-static.php");
|
26 |
-
require_once("class-wpfront-base-menu.php");
|
27 |
-
|
28 |
-
if (!class_exists('WPFront_Base_ST')) {
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Plugin framework base class
|
32 |
-
*
|
33 |
-
* @author Syam Mohan <syam@wpfront.com>
|
34 |
-
* @copyright 2013 WPFront.com
|
35 |
-
*/
|
36 |
-
class WPFront_Base_ST {
|
37 |
-
|
38 |
-
private $plugin_slug;
|
39 |
-
private $options_page_slug;
|
40 |
-
private $settingsLink;
|
41 |
-
private $FAQLink;
|
42 |
-
|
43 |
-
protected $pluginURLRoot;
|
44 |
-
protected $pluginDIRRoot;
|
45 |
-
private static $menu_data = array();
|
46 |
-
|
47 |
-
function __construct($file, $pluginSlug, $wpfrontBaseMenu = NULL) {
|
48 |
-
$this->plugin_slug = $pluginSlug;
|
49 |
-
$this->options_page_slug = $this->plugin_slug;
|
50 |
-
if ($wpfrontBaseMenu == NULL)
|
51 |
-
$wpfrontBaseMenu = new WPFront_Base_Menu($this);
|
52 |
-
|
53 |
-
$this->pluginURLRoot = plugins_url() . '/' . $this->plugin_slug . '/';
|
54 |
-
$this->pluginDIRRoot = dirname($file) . '/../';
|
55 |
-
|
56 |
-
add_action('init', array(&$this, 'init'));
|
57 |
-
add_action('plugins_loaded', array(&$this, 'plugins_loaded_base'));
|
58 |
-
|
59 |
-
//register actions
|
60 |
-
if (is_admin()) {
|
61 |
-
add_action('admin_init', array(&$this, 'admin_init'));
|
62 |
-
add_action('admin_menu', array(&$this, 'admin_menu'));
|
63 |
-
add_filter('plugin_action_links', array(&$this, 'action_links'), 10, 2);
|
64 |
-
} else {
|
65 |
-
add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
|
66 |
-
add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
|
67 |
-
}
|
68 |
-
}
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
}
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
|
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
}
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
}
|
97 |
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
|
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
-
|
107 |
-
if ($file == $this->plugin_slug . '/' . $this->plugin_slug . '.php') {
|
108 |
-
$settings_link = '<a href="' . menu_page_url($this->options_page_slug, FALSE) . '">' . __('Settings', 'wpfront-scroll-top') . '</a>';
|
109 |
-
array_unshift($links, $settings_link);
|
110 |
-
}
|
111 |
-
return $links;
|
112 |
-
}
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
}
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
}
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
}
|
129 |
|
130 |
-
|
131 |
-
public function options_page() {
|
132 |
-
if (!current_user_can('manage_options')) {
|
133 |
-
wp_die(__('You do not have sufficient permissions to access this page.', 'wpfront-scroll-top'));
|
134 |
-
return;
|
135 |
-
}
|
136 |
|
137 |
-
|
138 |
-
}
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
</p>
|
155 |
-
</div>
|
156 |
-
';
|
157 |
-
}
|
158 |
}
|
|
|
|
|
159 |
|
160 |
-
|
161 |
-
@$this->submit_button();
|
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 |
-
} else {
|
193 |
-
echo '<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="' . __('Save Changes', 'wpfront-scroll-top') . '" /></p>';
|
194 |
}
|
195 |
}
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
|
|
203 |
}
|
|
|
|
|
|
|
|
|
|
|
204 |
|
|
|
|
|
205 |
}
|
206 |
|
207 |
}
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
+
namespace WPFront\Scroll_Top;
|
26 |
+
|
27 |
require_once("class-wpfront-static.php");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
/**
|
30 |
+
* Plugin framework base class
|
31 |
+
*
|
32 |
+
* @author Syam Mohan <syam@wpfront.com>
|
33 |
+
* @copyright 2013 WPFront.com
|
34 |
+
*/
|
35 |
+
class WPFront_Base_ST {
|
|
|
36 |
|
37 |
+
private $plugin_slug;
|
38 |
+
private $options_page_slug;
|
39 |
+
private $settingsLink;
|
40 |
+
private $FAQLink;
|
41 |
|
42 |
+
protected $pluginURLRoot;
|
43 |
+
protected $pluginDIRRoot;
|
44 |
+
private static $menu_data = array();
|
45 |
|
46 |
+
function __construct($file, $pluginSlug) {
|
47 |
+
$this->plugin_slug = $pluginSlug;
|
48 |
+
$this->options_page_slug = $this->plugin_slug;
|
49 |
|
50 |
+
$this->pluginURLRoot = plugins_url() . '/' . $this->plugin_slug . '/';
|
51 |
+
$this->pluginDIRRoot = dirname($file) . '/../';
|
|
|
52 |
|
53 |
+
add_action('init', array(&$this, 'init'));
|
54 |
+
add_action('plugins_loaded', array(&$this, 'plugins_loaded_base'));
|
|
|
55 |
|
56 |
+
//register actions
|
57 |
+
if (is_admin()) {
|
58 |
+
add_action('admin_init', array(&$this, 'admin_init'));
|
59 |
+
add_action('admin_menu', array(&$this, 'admin_menu'));
|
60 |
+
add_filter('plugin_action_links', array(&$this, 'action_links'), 10, 2);
|
61 |
+
} else {
|
62 |
+
add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
|
63 |
+
add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
|
64 |
}
|
65 |
+
}
|
66 |
|
67 |
+
protected function add_menu($title, $link) {
|
68 |
+
self::$menu_data[] = array(
|
69 |
+
'title' => $title,
|
70 |
+
'link' => $link,
|
71 |
+
'this' => $this,
|
72 |
+
'slug' => $this->options_page_slug
|
73 |
+
);
|
74 |
+
}
|
75 |
|
76 |
+
public function init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
+
}
|
|
|
|
|
79 |
|
80 |
+
public function plugins_loaded_base() {
|
81 |
+
//for localization
|
82 |
+
//load_plugin_textdomain($this->plugin_slug, FALSE, $this->plugin_slug . '/languages/');
|
83 |
|
84 |
+
$this->plugins_loaded();
|
85 |
+
}
|
|
|
86 |
|
87 |
+
public function plugins_loaded() {
|
|
|
|
|
88 |
|
89 |
+
}
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
+
public function admin_init() {
|
|
|
92 |
|
93 |
+
}
|
94 |
+
|
95 |
+
public function admin_menu() {
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
public static function submenu_compare($a, $b) {
|
100 |
+
return strcmp($a[0], $b[0]);
|
101 |
+
}
|
102 |
+
|
103 |
+
public function action_links($links, $file) {
|
104 |
+
if ($file == $this->plugin_slug . '/' . $this->plugin_slug . '.php') {
|
105 |
+
$settings_link = '<a href="' . menu_page_url($this->options_page_slug, FALSE) . '">' . __('Settings', 'wpfront-scroll-top') . '</a>';
|
106 |
+
array_unshift($links, $settings_link);
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
+
return $links;
|
109 |
+
}
|
110 |
|
111 |
+
public function enqueue_styles() {
|
|
|
112 |
|
113 |
+
}
|
114 |
+
|
115 |
+
public function enqueue_scripts() {
|
116 |
+
|
117 |
+
}
|
|
|
118 |
|
119 |
+
public function enqueue_options_styles() {
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
public function enqueue_options_scripts() {
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
//creates options page
|
128 |
+
public function options_page() {
|
129 |
+
if (!current_user_can('manage_options')) {
|
130 |
+
wp_die(__('You do not have sufficient permissions to access this page.', 'wpfront-scroll-top'));
|
131 |
+
return;
|
132 |
}
|
133 |
+
|
134 |
+
include($this->pluginDIRRoot . 'templates/options-template.php');
|
135 |
+
}
|
136 |
+
|
137 |
+
protected function options_page_header($title, $optionsGroupName) {
|
138 |
+
echo '<div class="wrap">';
|
139 |
+
@screen_icon($this->options_page_slug);
|
140 |
+
echo '<h2>' . $title . '</h2>';
|
141 |
+
echo '<div id="' . $this->options_page_slug . '-options" class="inside">';
|
142 |
+
echo '<form method="post" action="options.php">';
|
143 |
+
@settings_fields($optionsGroupName);
|
144 |
+
@do_settings_sections($this->options_page_slug);
|
145 |
+
|
146 |
+
if ((isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true') || (isset($_GET['updated']) && $_GET['updated'] == 'true')) {
|
147 |
+
echo '
|
148 |
+
<div class="updated">
|
149 |
+
<p>
|
150 |
+
<strong>' . __('If you have a caching plugin, clear the cache for the new settings to take effect.', 'wpfront-scroll-top') . '</strong>
|
151 |
+
</p>
|
152 |
+
</div>
|
153 |
+
';
|
154 |
}
|
155 |
+
}
|
156 |
+
|
157 |
+
protected function options_page_footer($settingsLink, $FAQLink, $extraLinks = NULL) {
|
158 |
+
@$this->submit_button();
|
159 |
|
160 |
+
if ($extraLinks != NULL) {
|
161 |
+
foreach ($extraLinks as $value) {
|
162 |
+
echo '<a href="' . $value['href'] . '" target="' . $value['target'] . '">' . $value['text'] . '</a>';
|
163 |
+
echo ' | ';
|
|
|
|
|
164 |
}
|
165 |
}
|
166 |
|
167 |
+
echo '</form>';
|
168 |
+
echo '</div>';
|
169 |
+
echo '</div>';
|
170 |
+
|
171 |
+
$this->settingsLink = $settingsLink;
|
172 |
+
$this->FAQLink = $FAQLink;
|
173 |
+
|
174 |
+
add_filter('admin_footer_text', array($this, 'admin_footer_text'));
|
175 |
+
}
|
176 |
+
|
177 |
+
public function admin_footer_text($text) {
|
178 |
+
$settingsLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/' . $this->settingsLink, __('Settings Description', 'wpfront-scroll-top'));
|
179 |
+
$reviewLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wordpress.org/support/plugin/' . $this->plugin_slug . '/reviews/', __('Write a Review', 'wpfront-scroll-top'));
|
180 |
+
$donateLink = sprintf('<a href="%s" target="_blank">%s</a>', 'https://wpfront.com/donate/', __('Buy me a Beer or Coffee', 'wpfront-scroll-top'));
|
181 |
+
|
182 |
+
return sprintf('%s | %s | %s | %s', $settingsLink, $reviewLink, $donateLink, $text);
|
183 |
+
}
|
184 |
|
185 |
+
//for compatibility
|
186 |
+
public function submit_button() {
|
187 |
+
if (function_exists('submit_button')) {
|
188 |
+
submit_button();
|
189 |
+
} else {
|
190 |
+
echo '<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="' . __('Save Changes', 'wpfront-scroll-top') . '" /></p>';
|
191 |
}
|
192 |
+
}
|
193 |
+
|
194 |
+
public function pluginURL() {
|
195 |
+
return $this->pluginURLRoot;
|
196 |
+
}
|
197 |
|
198 |
+
public function pluginDIR() {
|
199 |
+
return $this->pluginDIRRoot;
|
200 |
}
|
201 |
|
202 |
}
|
classes/base/class-wpfront-options-base.php
CHANGED
@@ -22,134 +22,133 @@
|
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
}
|
52 |
-
|
53 |
-
$this->optionNames = array();
|
54 |
}
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
if (isset($this->__data[$name])) {
|
59 |
-
echo 'Duplicate option ' . $name;
|
60 |
-
return $this;
|
61 |
-
}
|
62 |
-
$this->__data[$name]['name'] = $name;
|
63 |
-
$this->__data[$name]['type'] = $type;
|
64 |
-
$this->__data[$name]['default'] = $default;
|
65 |
-
$this->__data[$name]['validate'] = isset($validate) ? $validate : array(&$this, 'validate_default');
|
66 |
-
|
67 |
-
//dynamic function returning option value
|
68 |
-
$this->__data[$name]['func'] = create_function('$self, $data', '
|
69 |
-
$value = NULL;
|
70 |
-
if(array_key_exists($data["name"], $self->__options))
|
71 |
-
$value = $self->__options[$data["name"]];
|
72 |
-
return $self->get_value($data["type"], $value, $data["default"], $data["validate"]);
|
73 |
-
');
|
74 |
-
|
75 |
-
$this->__data[$name . '_name'] = $this->__data[$name];
|
76 |
-
//dynamic function returning option name for settings page
|
77 |
-
$this->__data[$name . '_name']['func'] = create_function('$self, $data', '
|
78 |
-
return $self->__optionName . "[" . $data["name"] . "]";
|
79 |
-
');
|
80 |
-
|
81 |
-
$this->__data[$name . '_label'] = $this->__data[$name];
|
82 |
-
|
83 |
-
//dynamic function returning option label for settings page
|
84 |
-
$this->__data[$name . '_label']['func'] = create_function('$self, $data', '
|
85 |
-
return __($data["label"], $self->__localizeSlug);
|
86 |
-
');
|
87 |
-
|
88 |
-
$this->lastOptionName = $name;
|
89 |
-
array_push($this->optionNames, $name);
|
90 |
|
|
|
|
|
|
|
|
|
91 |
return $this;
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
if ($arg < 0) {
|
102 |
-
return 0;
|
103 |
-
}
|
104 |
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
111 |
}
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
case 'int':
|
123 |
-
return call_user_func($validate, intval($value));
|
124 |
-
case 'float':
|
125 |
-
return call_user_func($validate, floatval($value));
|
126 |
-
case 'string':
|
127 |
-
return call_user_func($validate, strval($value));
|
128 |
-
}
|
129 |
-
return $value;
|
130 |
}
|
|
|
|
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
}
|
138 |
-
return $options;
|
139 |
}
|
|
|
|
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
}
|
147 |
-
|
148 |
-
array_unshift($args, $this->__data[$name]);
|
149 |
-
array_unshift($args, $this);
|
150 |
-
return call_user_func_array($this->__data[$name]['func'], $args);
|
151 |
}
|
152 |
|
|
|
|
|
|
|
153 |
}
|
154 |
|
155 |
}
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
+
namespace WPFront\Scroll_Top;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Options framework base class
|
29 |
+
*
|
30 |
+
* @author Syam Mohan <syam@wpfront.com>
|
31 |
+
* @copyright 2013 WPFront.com
|
32 |
+
*/
|
33 |
+
class WPFront_Options_Base_ST {
|
34 |
+
|
35 |
+
//variables to hold options data
|
36 |
+
public $__data = array();
|
37 |
+
public $__optionName;
|
38 |
+
public $__localizeSlug;
|
39 |
+
public $__options;
|
40 |
+
private $lastOptionName;
|
41 |
+
private $optionNames;
|
42 |
+
|
43 |
+
function __construct($optionName, $localizeSlug) {
|
44 |
+
$this->__optionName = $optionName;
|
45 |
+
$this->__localizeSlug = $localizeSlug;
|
46 |
+
|
47 |
+
$this->__options = get_option($this->__optionName);
|
48 |
+
|
49 |
+
if (!is_array($this->__options)) {
|
50 |
+
$this->__options = array();
|
|
|
|
|
|
|
51 |
}
|
52 |
|
53 |
+
$this->optionNames = array();
|
54 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
//defines option with data
|
57 |
+
protected function addOption($name, $type, $default, $validate = NULL) {
|
58 |
+
if (isset($this->__data[$name])) {
|
59 |
+
echo 'Duplicate option ' . $name;
|
60 |
return $this;
|
61 |
}
|
62 |
+
$this->__data[$name]['name'] = $name;
|
63 |
+
$this->__data[$name]['type'] = $type;
|
64 |
+
$this->__data[$name]['default'] = $default;
|
65 |
+
$this->__data[$name]['validate'] = isset($validate) ? $validate : array(&$this, 'validate_default');
|
66 |
+
|
67 |
+
//dynamic function returning option value
|
68 |
+
$this->__data[$name]['func'] = function($self, $data) {
|
69 |
+
$value = NULL;
|
70 |
+
if(array_key_exists($data["name"], $self->__options))
|
71 |
+
$value = $self->__options[$data["name"]];
|
72 |
+
return $self->get_value($data["type"], $value, $data["default"], $data["validate"]);
|
73 |
+
};
|
74 |
+
|
75 |
+
$this->__data[$name . '_name'] = $this->__data[$name];
|
76 |
+
|
77 |
+
//dynamic function returning option name for settings page
|
78 |
+
$this->__data[$name . '_name']['func'] = function($self, $data) {
|
79 |
+
return $self->__optionName . "[" . $data["name"] . "]";
|
80 |
+
};
|
81 |
+
|
82 |
+
$this->__data[$name . '_label'] = $this->__data[$name];
|
83 |
+
|
84 |
+
//dynamic function returning option label for settings page
|
85 |
+
$this->__data[$name . '_label']['func'] = function($self, $data) {
|
86 |
+
return __($data["label"], $self->__localizeSlug);
|
87 |
+
};
|
88 |
+
|
89 |
+
$this->lastOptionName = $name;
|
90 |
+
array_push($this->optionNames, $name);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
|
95 |
+
//default validation function
|
96 |
+
private function validate_default($arg) {
|
97 |
+
return $arg;
|
98 |
+
}
|
99 |
+
|
100 |
+
//validates a zero or positive number
|
101 |
+
protected function validate_zero_positive($arg) {
|
102 |
+
if ($arg < 0) {
|
103 |
+
return 0;
|
104 |
}
|
105 |
|
106 |
+
return $arg;
|
107 |
+
}
|
|
|
|
|
|
|
108 |
|
109 |
+
//sets the label of the option, for POEDIT compatibility
|
110 |
+
protected function label($label) {
|
111 |
+
$this->__data[$this->lastOptionName . '_label']['label'] = $label;
|
112 |
+
}
|
113 |
|
114 |
+
//returns the value of option
|
115 |
+
public function get_value($type, $value, $default, $validate) {
|
116 |
+
if (!isset($value)) {
|
117 |
+
return $default;
|
118 |
}
|
119 |
|
120 |
+
switch ($type) {
|
121 |
+
case 'bool':
|
122 |
+
return (bool) $value;
|
123 |
+
case 'int':
|
124 |
+
return call_user_func($validate, intval($value));
|
125 |
+
case 'float':
|
126 |
+
return call_user_func($validate, floatval($value));
|
127 |
+
case 'string':
|
128 |
+
return call_user_func($validate, strval($value));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
+
return $value;
|
131 |
+
}
|
132 |
|
133 |
+
//returns optons array
|
134 |
+
public function get_options() {
|
135 |
+
$options = array();
|
136 |
+
foreach ($this->optionNames as $val) {
|
137 |
+
$options[$val] = $this->$val();
|
|
|
|
|
138 |
}
|
139 |
+
return $options;
|
140 |
+
}
|
141 |
|
142 |
+
//PHP magic function to call dynamic methods
|
143 |
+
public function __call($name, array $args) {
|
144 |
+
if (!array_key_exists($name, $this->__data)) {
|
145 |
+
echo '"' . $name . '" option not yet added';
|
146 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
|
149 |
+
array_unshift($args, $this->__data[$name]);
|
150 |
+
array_unshift($args, $this);
|
151 |
+
return call_user_func_array($this->__data[$name]['func'], $args);
|
152 |
}
|
153 |
|
154 |
}
|
classes/base/class-wpfront-static.php
CHANGED
@@ -22,47 +22,45 @@
|
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
public static function is_admin_bar_showing() {
|
36 |
-
if (function_exists('is_admin_bar_showing')) {
|
37 |
-
return is_admin_bar_showing();
|
38 |
-
}
|
39 |
|
40 |
-
|
|
|
|
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
return self_admin_url($path, $scheme);
|
46 |
|
47 |
-
|
48 |
-
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
if (!empty($_SERVER['REQUEST_URI']) && strtolower($_SERVER['REQUEST_URI']) == '/wp-admin/async-upload.php') {
|
60 |
-
return TRUE;
|
61 |
-
}
|
62 |
|
63 |
-
|
|
|
64 |
}
|
65 |
|
|
|
66 |
}
|
67 |
|
68 |
}
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
+
namespace WPFront\Scroll_Top;
|
26 |
|
27 |
+
/**
|
28 |
+
* Plugin framework static helpers
|
29 |
+
*
|
30 |
+
* @author Syam Mohan <syam@wpfront.com>
|
31 |
+
* @copyright 2013 WPFront.com
|
32 |
+
*/
|
33 |
+
class WPFront_Static_ST {
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
public static function is_admin_bar_showing() {
|
36 |
+
if (function_exists('is_admin_bar_showing')) {
|
37 |
+
return is_admin_bar_showing();
|
38 |
}
|
39 |
|
40 |
+
return FALSE;
|
41 |
+
}
|
|
|
42 |
|
43 |
+
public static function self_admin_url($path = '', $scheme = 'admin') {
|
44 |
+
if (function_exists('self_admin_url'))
|
45 |
+
return self_admin_url($path, $scheme);
|
46 |
|
47 |
+
return admin_url($path, $scheme);
|
48 |
+
}
|
49 |
+
|
50 |
+
public static function doing_ajax() {
|
51 |
+
if (defined('DOING_AJAX') && DOING_AJAX) {
|
52 |
+
return TRUE;
|
53 |
+
}
|
54 |
|
55 |
+
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
56 |
+
return TRUE;
|
57 |
+
}
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
if (!empty($_SERVER['REQUEST_URI']) && strtolower($_SERVER['REQUEST_URI']) == '/wp-admin/async-upload.php') {
|
60 |
+
return TRUE;
|
61 |
}
|
62 |
|
63 |
+
return FALSE;
|
64 |
}
|
65 |
|
66 |
}
|
classes/base/images/wpfront_menu.png
DELETED
Binary file
|
classes/class-wpfront-scroll-top-options.php
CHANGED
@@ -22,155 +22,152 @@
|
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
|
|
|
|
25 |
require_once("base/class-wpfront-options-base.php");
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
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 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
$this->addOption('image', 'string', '1.png');
|
82 |
-
$this->addOption('custom_url', 'string', '');
|
83 |
-
}
|
84 |
-
|
85 |
-
public function text_button_hover_color() {
|
86 |
-
$color = parent::text_button_hover_color();
|
87 |
-
if(empty($color))
|
88 |
-
return $this->text_button_background_color();
|
89 |
-
|
90 |
-
return $color;
|
91 |
-
}
|
92 |
-
|
93 |
-
public function include_pages() {
|
94 |
-
$pages = parent::include_pages();
|
95 |
-
|
96 |
-
if(strpos($pages, '.') === FALSE)
|
97 |
-
return $pages;
|
98 |
-
|
99 |
-
$pages = explode(',', $pages);
|
100 |
-
|
101 |
-
for($i = 0; $i < count($pages); $i++) {
|
102 |
-
$e = explode('.', $pages[$i]);
|
103 |
-
$pages[$i] = $e[1];
|
104 |
-
}
|
105 |
-
|
106 |
-
return implode(',', $pages);
|
107 |
-
}
|
108 |
-
|
109 |
-
public function exclude_pages() {
|
110 |
-
$pages = parent::exclude_pages();
|
111 |
-
|
112 |
-
if(strpos($pages, '.') === FALSE)
|
113 |
-
return $pages;
|
114 |
-
|
115 |
-
$pages = explode(',', $pages);
|
116 |
-
|
117 |
-
for($i = 0; $i < count($pages); $i++) {
|
118 |
-
$e = explode('.', $pages[$i]);
|
119 |
-
$pages[$i] = $e[1];
|
120 |
-
}
|
121 |
-
|
122 |
-
return implode(',', $pages);
|
123 |
-
}
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
128 |
|
129 |
-
|
130 |
-
|
131 |
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
return 1;
|
138 |
|
139 |
-
|
140 |
-
return 4;
|
141 |
|
142 |
-
|
|
|
|
|
143 |
}
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
return $arg;
|
148 |
|
149 |
-
|
150 |
-
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
return '#ffffff';
|
155 |
|
156 |
-
|
157 |
-
return '#ffffff';
|
158 |
|
159 |
-
|
|
|
|
|
160 |
}
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
|
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
}
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
return $arg;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
|
|
|
174 |
}
|
175 |
|
176 |
}
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
+
namespace WPFront\Scroll_Top;
|
26 |
+
|
27 |
require_once("base/class-wpfront-options-base.php");
|
28 |
|
29 |
+
/**
|
30 |
+
* Options class for WPFront Scroll Top plugin
|
31 |
+
*
|
32 |
+
* @author Syam Mohan <syam@wpfront.com>
|
33 |
+
* @copyright 2013 WPFront.com
|
34 |
+
*/
|
35 |
+
class WPFront_Scroll_Top_Options extends WPFront_Options_Base_ST {
|
36 |
+
|
37 |
+
function __construct($optionName, $pluginSlug) {
|
38 |
+
parent::__construct($optionName, $pluginSlug);
|
39 |
+
|
40 |
+
//add the options required for this plugin
|
41 |
+
$this->addOption('enabled', 'bit', FALSE)->label(__('Enabled', 'wpfront-scroll-top'));
|
42 |
+
$this->addOption('javascript_async', 'bit', FALSE)->label(__('JavaScript Async', 'wpfront-scroll-top'));
|
43 |
+
$this->addOption('scroll_offset', 'int', 100, array($this, 'validate_zero_positive'))->label(__('Scroll Offset', 'wpfront-scroll-top'));
|
44 |
+
$this->addOption('button_width', 'int', 0, array($this, 'validate_zero_positive'));
|
45 |
+
$this->addOption('button_height', 'int', 0, array($this, 'validate_zero_positive'));
|
46 |
+
$this->addOption('button_opacity', 'int', 80, array($this, 'validate_range_0_100'))->label(__('Button Opacity', 'wpfront-scroll-top'));
|
47 |
+
$this->addOption('button_fade_duration', 'int', 200, array($this, 'validate_zero_positive'))->label(__('Button Fade Duration', 'wpfront-scroll-top'));
|
48 |
+
$this->addOption('scroll_duration', 'int', 400, array($this, 'validate_zero_positive'))->label(__('Scroll Duration', 'wpfront-scroll-top'));
|
49 |
+
$this->addOption('auto_hide', 'bit', FALSE)->label(__('Auto Hide', 'wpfront-scroll-top'));
|
50 |
+
$this->addOption('auto_hide_after', 'float', 2, array($this, 'validate_zero_positive'))->label(__('Auto Hide After', 'wpfront-scroll-top'));
|
51 |
+
$this->addOption('hide_small_device', 'bit', FALSE)->label(__('Hide on Small Devices', 'wpfront-scroll-top'));
|
52 |
+
$this->addOption('small_device_width', 'int', 640, array($this, 'validate_zero_positive'))->label(__('Small Device Max Width', 'wpfront-scroll-top'));
|
53 |
+
$this->addOption('hide_small_window', 'bit', FALSE)->label(__('Hide on Small Window', 'wpfront-scroll-top'));
|
54 |
+
$this->addOption('small_window_width', 'int', 640, array($this, 'validate_zero_positive'))->label(__('Small Window Max Width', 'wpfront-scroll-top'));
|
55 |
+
$this->addOption('button_style', 'string', 'image', array($this, 'validate_button_style'))->label(__('Button Style', 'wpfront-scroll-top'));
|
56 |
+
$this->addOption('image_alt', 'string', '')->label(__('Image ALT', 'wpfront-scroll-top'));
|
57 |
+
$this->addOption('hide_wpadmin', 'bit', FALSE)->label(__('Hide on WP-ADMIN', 'wpfront-scroll-top'));
|
58 |
+
$this->addOption('hide_iframe', 'bit', FALSE)->label(__('Hide on iframes', 'wpfront-scroll-top'));
|
59 |
+
|
60 |
+
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->label(__('Location', 'wpfront-scroll-top'));
|
61 |
+
$this->addOption('marginX', 'int', 20)->label(__('Margin X', 'wpfront-scroll-top'));
|
62 |
+
$this->addOption('marginY', 'int', 20)->label(__('Margin Y', 'wpfront-scroll-top'));
|
63 |
+
|
64 |
+
$this->addOption('text_button_text', 'string', '')->label(__('Text', 'wpfront-scroll-top'));
|
65 |
+
$this->addOption('text_button_text_color', 'string', '#ffffff', array($this, 'validate_color'))->label(__('Text Color', 'wpfront-scroll-top'));
|
66 |
+
$this->addOption('text_button_background_color', 'string', '#000000', array($this, 'validate_color'))->label(__('Background Color', 'wpfront-scroll-top'));
|
67 |
+
$this->addOption('text_button_hover_color', 'string', '', array($this, 'validate_color'))->label(__('Mouse Over Color', 'wpfront-scroll-top'));
|
68 |
+
$this->addOption('text_button_css', 'string', '')->label(__('Custom CSS', 'wpfront-scroll-top'));
|
69 |
+
|
70 |
+
$this->addOption('fa_button_class', 'string', '')->label(__('Icon Class', 'wpfront-scroll-top'));
|
71 |
+
$this->addOption('fa_button_URL', 'string', '')->label(__('Font Awesome URL', 'wpfront-scroll-top'));
|
72 |
+
$this->addOption('fa_button_exclude_URL', 'bit', FALSE)->label(__('Do not include URL', 'wpfront-scroll-top'));
|
73 |
+
$this->addOption('fa_button_text_color', 'string', '#000000', array($this, 'validate_color'))->label(__('Icon Color', 'wpfront-scroll-top'));
|
74 |
+
$this->addOption('fa_button_css', 'string', '')->label(__('Custom CSS', 'wpfront-scroll-top'));
|
75 |
+
|
76 |
+
$this->addOption('display_pages', 'int', '1', array($this, 'validate_display_pages'))->label(__('Display on Pages', 'wpfront-scroll-top'));
|
77 |
+
$this->addOption('include_pages', 'string', '');
|
78 |
+
$this->addOption('exclude_pages', 'string', '');
|
79 |
+
|
80 |
+
$this->addOption('image', 'string', '1.png');
|
81 |
+
$this->addOption('custom_url', 'string', '');
|
82 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
+
public function text_button_hover_color() {
|
85 |
+
$color = parent::text_button_hover_color();
|
86 |
+
if(empty($color))
|
87 |
+
return $this->text_button_background_color();
|
88 |
|
89 |
+
return $color;
|
90 |
+
}
|
91 |
|
92 |
+
public function include_pages() {
|
93 |
+
$pages = parent::include_pages();
|
94 |
|
95 |
+
if(strpos($pages, '.') === FALSE)
|
96 |
+
return $pages;
|
|
|
97 |
|
98 |
+
$pages = explode(',', $pages);
|
|
|
99 |
|
100 |
+
for($i = 0; $i < count($pages); $i++) {
|
101 |
+
$e = explode('.', $pages[$i]);
|
102 |
+
$pages[$i] = $e[1];
|
103 |
}
|
104 |
|
105 |
+
return implode(',', $pages);
|
106 |
+
}
|
|
|
107 |
|
108 |
+
public function exclude_pages() {
|
109 |
+
$pages = parent::exclude_pages();
|
110 |
|
111 |
+
if(strpos($pages, '.') === FALSE)
|
112 |
+
return $pages;
|
|
|
113 |
|
114 |
+
$pages = explode(',', $pages);
|
|
|
115 |
|
116 |
+
for($i = 0; $i < count($pages); $i++) {
|
117 |
+
$e = explode('.', $pages[$i]);
|
118 |
+
$pages[$i] = $e[1];
|
119 |
}
|
120 |
|
121 |
+
return implode(',', $pages);
|
122 |
+
}
|
123 |
+
|
124 |
+
protected function validate_range_0_100($arg) {
|
125 |
+
if ($arg < 0)
|
126 |
+
return 0;
|
127 |
|
128 |
+
if ($arg > 100)
|
129 |
+
return 100;
|
|
|
130 |
|
131 |
+
return $arg;
|
132 |
+
}
|
133 |
+
|
134 |
+
protected function validate_range_1_4($arg) {
|
135 |
+
if ($arg < 1)
|
136 |
+
return 1;
|
137 |
+
|
138 |
+
if ($arg > 4)
|
139 |
+
return 4;
|
140 |
+
|
141 |
+
return $arg;
|
142 |
+
}
|
143 |
+
|
144 |
+
protected function validate_button_style($arg) {
|
145 |
+
if ($arg == 'text' || $arg == 'font-awesome')
|
146 |
return $arg;
|
147 |
+
|
148 |
+
return 'image';
|
149 |
+
}
|
150 |
+
|
151 |
+
protected function validate_color($arg) {
|
152 |
+
if (strlen($arg) != 7)
|
153 |
+
return '#ffffff';
|
154 |
+
|
155 |
+
if (strpos($arg, '#') != 0)
|
156 |
+
return '#ffffff';
|
157 |
+
|
158 |
+
return $arg;
|
159 |
+
}
|
160 |
+
|
161 |
+
protected function validate_display_pages($arg) {
|
162 |
+
if ($arg < 1) {
|
163 |
+
return 1;
|
164 |
+
}
|
165 |
+
|
166 |
+
if ($arg > 3) {
|
167 |
+
return 3;
|
168 |
}
|
169 |
|
170 |
+
return $arg;
|
171 |
}
|
172 |
|
173 |
}
|
classes/class-wpfront-scroll-top.php
CHANGED
@@ -22,282 +22,274 @@
|
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
|
|
|
|
25 |
require_once("base/class-wpfront-base.php");
|
26 |
require_once("class-wpfront-scroll-top-options.php");
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
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 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
add_action('shutdown', array(&$this, 'shutdown_callback'));
|
64 |
-
}
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
-
|
72 |
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
}
|
96 |
-
wp_enqueue_style('font-awesome', $url, array(), $ver);
|
97 |
}
|
|
|
98 |
}
|
99 |
}
|
|
|
100 |
|
101 |
-
|
102 |
-
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
public function admin_menu() {
|
109 |
-
if($this->options->move_admin_menu()) {
|
110 |
-
$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'));
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
}
|
115 |
-
else {
|
116 |
-
$this->add_menu(__('WPFront Scroll Top', 'wpfront-scroll-top'), __('Scroll Top', 'wpfront-scroll-top'));
|
117 |
-
parent::admin_menu();
|
118 |
-
}
|
119 |
-
}
|
120 |
|
121 |
-
|
122 |
-
|
|
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
}
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
wp_enqueue_style('jquery.eyecon.colorpicker.colorpicker', $styleRoot . 'colorpicker' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
if($this->options->javascript_async())
|
142 |
-
add_filter('script_loader_tag', array($this, 'script_loader_tag'), 999999, 3);
|
143 |
-
}
|
144 |
-
|
145 |
-
public function script_loader_tag($tag, $handle, $src) {
|
146 |
-
if($handle === 'wpfront-scroll-top')
|
147 |
-
return '<script type="text/javascript" src="' . $src . '" async="async" defer="defer"></script>' . "\n";
|
148 |
-
|
149 |
-
return $tag;
|
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 |
-
echo '<script type="text/javascript">';
|
189 |
-
echo 'function wpfront_scroll_top_init() {';
|
190 |
-
echo 'if(typeof wpfront_scroll_top == "function" && typeof jQuery !== "undefined") {';
|
191 |
-
echo 'wpfront_scroll_top(' . json_encode(array(
|
192 |
-
'scroll_offset' => $this->options->scroll_offset(),
|
193 |
-
'button_width' => $this->options->button_width(),
|
194 |
-
'button_height' => $this->options->button_height(),
|
195 |
-
'button_opacity' => $this->options->button_opacity() / 100,
|
196 |
-
'button_fade_duration' => $this->options->button_fade_duration(),
|
197 |
-
'scroll_duration' => $this->options->scroll_duration(),
|
198 |
-
'location' => $this->options->location(),
|
199 |
-
'marginX' => $this->options->marginX(),
|
200 |
-
'marginY' => $this->options->marginY(),
|
201 |
-
'hide_iframe' => $this->options->hide_iframe(),
|
202 |
-
'auto_hide' => $this->options->auto_hide(),
|
203 |
-
'auto_hide_after' => $this->options->auto_hide_after(),
|
204 |
-
)) . ');';
|
205 |
-
echo '} else {';
|
206 |
-
echo 'setTimeout(wpfront_scroll_top_init, 100);';
|
207 |
-
echo '}';
|
208 |
-
echo '}';
|
209 |
-
echo 'wpfront_scroll_top_init();';
|
210 |
-
echo '</script>';
|
211 |
-
}
|
212 |
|
213 |
-
|
|
|
214 |
}
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
|
|
222 |
|
223 |
-
|
224 |
-
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
return TRUE;
|
227 |
-
}
|
228 |
|
229 |
-
|
230 |
-
|
231 |
return TRUE;
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
$ID =
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
$ID
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
if ($this->filter_pages_contains($this->options->include_pages(), $ID) === FALSE)
|
248 |
-
return FALSE;
|
249 |
-
else
|
250 |
-
return TRUE;
|
251 |
-
}
|
252 |
-
return FALSE;
|
253 |
}
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
}
|
263 |
-
|
264 |
-
|
265 |
-
return TRUE;
|
266 |
}
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
}
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
return $this->iconsURL . $this->options->image();
|
276 |
-
}
|
277 |
|
278 |
-
|
279 |
-
|
|
|
|
|
|
|
280 |
|
281 |
-
|
|
|
282 |
|
283 |
-
|
284 |
-
foreach ($pages as $page) {
|
285 |
-
$objects[$page->ID] = __('[Page]', 'wpfront-scroll-top') . ' ' . $page->post_title;
|
286 |
-
}
|
287 |
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
// $categories = get_categories();
|
294 |
// foreach ($categories as $category) {
|
295 |
// $objects['3.' . $category->cat_ID] = __('[Category]', 'wpfront-scroll-top') . ' ' . $category->cat_name;
|
296 |
// }
|
297 |
|
298 |
-
|
299 |
-
}
|
300 |
-
|
301 |
}
|
302 |
|
303 |
}
|
22 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
*/
|
24 |
|
25 |
+
namespace WPFront\Scroll_Top;
|
26 |
+
|
27 |
require_once("base/class-wpfront-base.php");
|
28 |
require_once("class-wpfront-scroll-top-options.php");
|
29 |
|
30 |
+
/**
|
31 |
+
* Main class of WPFront Scroll Top plugin
|
32 |
+
*
|
33 |
+
* @author Syam Mohan <syam@wpfront.com>
|
34 |
+
* @copyright 2013 WPFront.com
|
35 |
+
*/
|
36 |
+
class WPFront_Scroll_Top extends WPFront_Base_ST {
|
37 |
+
|
38 |
+
//Constants
|
39 |
+
const VERSION = '1.6.2';
|
40 |
+
const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
|
41 |
+
const OPTION_NAME = 'wpfront-scroll-top-options';
|
42 |
+
const PLUGIN_SLUG = 'wpfront-scroll-top';
|
43 |
+
|
44 |
+
//Variables
|
45 |
+
protected $iconsDIR;
|
46 |
+
protected $iconsURL;
|
47 |
+
protected $options;
|
48 |
+
protected $markupLoaded;
|
49 |
+
protected $scriptLoaded;
|
50 |
+
protected $min_file_suffix;
|
51 |
+
|
52 |
+
function __construct() {
|
53 |
+
parent::__construct(__FILE__, self::PLUGIN_SLUG);
|
54 |
+
|
55 |
+
$this->markupLoaded = FALSE;
|
56 |
+
$this->min_file_suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
|
57 |
+
|
58 |
+
//Root variables
|
59 |
+
$this->iconsDIR = $this->pluginDIRRoot . 'images/icons/';
|
60 |
+
$this->iconsURL = $this->pluginURLRoot . 'images/icons/';
|
61 |
+
|
62 |
+
add_action('wp_footer', array(&$this, 'write_markup'));
|
63 |
+
add_action('shutdown', array(&$this, 'shutdown_callback'));
|
64 |
+
}
|
|
|
|
|
65 |
|
66 |
+
//add scripts
|
67 |
+
public function enqueue_scripts() {
|
68 |
+
if ($this->enabled() == FALSE)
|
69 |
+
return;
|
70 |
|
71 |
+
$jsRoot = $this->pluginURLRoot . 'js/';
|
72 |
|
73 |
+
wp_enqueue_script('jquery');
|
74 |
+
wp_enqueue_script('wpfront-scroll-top', $jsRoot . 'wpfront-scroll-top' . $this->min_file_suffix . '.js', array('jquery'), self::VERSION, TRUE);
|
75 |
|
76 |
+
$this->scriptLoaded = TRUE;
|
77 |
+
}
|
78 |
|
79 |
+
//add styles
|
80 |
+
public function enqueue_styles() {
|
81 |
+
if ($this->enabled() == FALSE)
|
82 |
+
return;
|
83 |
+
|
84 |
+
$cssRoot = $this->pluginURLRoot . 'css/';
|
85 |
+
|
86 |
+
wp_enqueue_style('wpfront-scroll-top', $cssRoot . 'wpfront-scroll-top' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
87 |
+
|
88 |
+
if($this->options->button_style() == 'font-awesome') {
|
89 |
+
if(!$this->options->fa_button_exclude_URL() || is_admin()) {
|
90 |
+
$url = trim($this->options->fa_button_URL());
|
91 |
+
$ver = FALSE;
|
92 |
+
if(empty($url)) {
|
93 |
+
$url = '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css';
|
94 |
+
$ver = '4.7.0';
|
|
|
|
|
95 |
}
|
96 |
+
wp_enqueue_style('font-awesome', $url, array(), $ver);
|
97 |
}
|
98 |
}
|
99 |
+
}
|
100 |
|
101 |
+
public function admin_init() {
|
102 |
+
register_setting(self::OPTIONS_GROUP_NAME, self::OPTION_NAME);
|
103 |
|
104 |
+
$this->enqueue_styles();
|
105 |
+
$this->enqueue_scripts();
|
106 |
+
}
|
|
|
|
|
|
|
|
|
107 |
|
108 |
+
public function admin_menu() {
|
109 |
+
$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'));
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
+
add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_options_scripts'));
|
112 |
+
add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_options_styles'));
|
113 |
+
}
|
114 |
|
115 |
+
public function enqueue_options_scripts() {
|
116 |
+
$this->enqueue_scripts();
|
|
|
117 |
|
118 |
+
$jsRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/js/';
|
119 |
+
wp_enqueue_script('jquery.eyecon.colorpicker', $jsRoot . 'colorpicker' . $this->min_file_suffix . '.js', array('jquery'), self::VERSION);
|
120 |
+
}
|
|
|
121 |
|
122 |
+
//options page styles
|
123 |
+
public function enqueue_options_styles() {
|
124 |
+
$styleRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/css/';
|
125 |
+
wp_enqueue_style('jquery.eyecon.colorpicker.colorpicker', $styleRoot . 'colorpicker' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
126 |
|
127 |
+
$styleRoot = $this->pluginURLRoot . 'css/';
|
128 |
+
wp_enqueue_style('wpfront-scroll-top-options', $styleRoot . 'options' . $this->min_file_suffix . '.css', array(), self::VERSION);
|
129 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
+
public function plugins_loaded() {
|
132 |
+
//load plugin options
|
133 |
+
$this->options = new WPFront_Scroll_Top_Options(self::OPTION_NAME, self::PLUGIN_SLUG);
|
|
|
134 |
|
135 |
+
if($this->options->javascript_async())
|
136 |
+
add_filter('script_loader_tag', array($this, 'script_loader_tag'), 999999, 3);
|
137 |
+
}
|
138 |
+
|
139 |
+
public function script_loader_tag($tag, $handle, $src) {
|
140 |
+
if($handle === 'wpfront-scroll-top')
|
141 |
+
return '<script type="text/javascript" src="' . $src . '" async="async" defer="defer"></script>' . "\n";
|
142 |
+
|
143 |
+
return $tag;
|
144 |
+
}
|
145 |
|
146 |
+
public function shutdown_callback() {
|
147 |
+
if ($this->markupLoaded) {
|
148 |
+
return;
|
149 |
}
|
150 |
|
151 |
+
$headers = headers_list();
|
152 |
+
$flag = FALSE;
|
153 |
+
foreach ($headers as $value) {
|
154 |
+
$value = strtolower(str_replace(' ', '', $value));
|
155 |
+
if (strpos($value, 'content-type:text/html') === 0) {
|
156 |
+
$flag = TRUE;
|
157 |
+
break;
|
158 |
}
|
159 |
+
}
|
160 |
|
161 |
+
if ($flag)
|
162 |
+
$this->write_markup();
|
163 |
+
}
|
164 |
|
165 |
+
//writes the html and script for the button
|
166 |
+
public function write_markup() {
|
167 |
+
if ($this->markupLoaded) {
|
168 |
+
return;
|
169 |
+
}
|
170 |
|
171 |
+
if ($this->scriptLoaded != TRUE) {
|
172 |
+
return;
|
173 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
+
if (WPFront_Static_ST::doing_ajax()) {
|
176 |
+
return;
|
177 |
}
|
178 |
|
179 |
+
if ($this->enabled()) {
|
180 |
+
include($this->pluginDIRRoot . 'templates/scroll-top-template.php');
|
181 |
+
|
182 |
+
echo '<script type="text/javascript">';
|
183 |
+
echo 'function wpfront_scroll_top_init() {';
|
184 |
+
echo 'if(typeof wpfront_scroll_top == "function" && typeof jQuery !== "undefined") {';
|
185 |
+
echo 'wpfront_scroll_top(' . json_encode(array(
|
186 |
+
'scroll_offset' => $this->options->scroll_offset(),
|
187 |
+
'button_width' => $this->options->button_width(),
|
188 |
+
'button_height' => $this->options->button_height(),
|
189 |
+
'button_opacity' => $this->options->button_opacity() / 100,
|
190 |
+
'button_fade_duration' => $this->options->button_fade_duration(),
|
191 |
+
'scroll_duration' => $this->options->scroll_duration(),
|
192 |
+
'location' => $this->options->location(),
|
193 |
+
'marginX' => $this->options->marginX(),
|
194 |
+
'marginY' => $this->options->marginY(),
|
195 |
+
'hide_iframe' => $this->options->hide_iframe(),
|
196 |
+
'auto_hide' => $this->options->auto_hide(),
|
197 |
+
'auto_hide_after' => $this->options->auto_hide_after(),
|
198 |
+
)) . ');';
|
199 |
+
echo '} else {';
|
200 |
+
echo 'setTimeout(wpfront_scroll_top_init, 100);';
|
201 |
+
echo '}';
|
202 |
+
echo '}';
|
203 |
+
echo 'wpfront_scroll_top_init();';
|
204 |
+
echo '</script>';
|
205 |
+
}
|
206 |
|
207 |
+
$this->markupLoaded = TRUE;
|
208 |
+
}
|
209 |
+
|
210 |
+
private function enabled() {
|
211 |
+
if (!$this->options->enabled())
|
212 |
+
return FALSE;
|
213 |
|
214 |
+
if ($this->options->hide_wpadmin() && is_admin())
|
215 |
+
return FALSE;
|
216 |
|
217 |
+
if (!$this->filter_pages())
|
218 |
+
return FALSE;
|
219 |
+
|
220 |
+
return TRUE;
|
221 |
+
}
|
222 |
+
|
223 |
+
private function filter_pages() {
|
224 |
+
if (is_admin())
|
225 |
return TRUE;
|
|
|
226 |
|
227 |
+
switch ($this->options->display_pages()) {
|
228 |
+
case 1:
|
229 |
return TRUE;
|
230 |
+
case 2:
|
231 |
+
case 3:
|
232 |
+
global $post;
|
233 |
+
$ID = FALSE;
|
234 |
+
if (is_home()) {
|
235 |
+
$ID = 'home';
|
236 |
+
} elseif(!empty($post)) {
|
237 |
+
$ID = $post->ID;
|
238 |
+
}
|
239 |
+
if ($this->options->display_pages() == 2) {
|
240 |
+
if ($ID !== FALSE) {
|
241 |
+
if ($this->filter_pages_contains($this->options->include_pages(), $ID) === FALSE)
|
242 |
+
return FALSE;
|
243 |
+
else
|
244 |
+
return TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
}
|
246 |
+
return FALSE;
|
247 |
+
}
|
248 |
+
if ($this->options->display_pages() == 3) {
|
249 |
+
if ($ID !== FALSE) {
|
250 |
+
if ($this->filter_pages_contains($this->options->exclude_pages(), $ID) === FALSE)
|
251 |
+
return TRUE;
|
252 |
+
else
|
253 |
+
return FALSE;
|
254 |
}
|
255 |
+
return TRUE;
|
256 |
+
}
|
|
|
257 |
}
|
258 |
|
259 |
+
return TRUE;
|
260 |
+
}
|
|
|
261 |
|
262 |
+
public function filter_pages_contains($list, $key) {
|
263 |
+
return strpos(',' . $list . ',', ',' . $key . ',');
|
264 |
+
}
|
|
|
|
|
265 |
|
266 |
+
private function image() {
|
267 |
+
if ($this->options->image() == 'custom')
|
268 |
+
return $this->options->custom_url();
|
269 |
+
return $this->iconsURL . $this->options->image();
|
270 |
+
}
|
271 |
|
272 |
+
protected function get_filter_objects() {
|
273 |
+
$objects = array();
|
274 |
|
275 |
+
$objects['home'] = __('[Page]', 'wpfront-scroll-top') . ' ' . __('Home', 'wpfront-scroll-top');
|
|
|
|
|
|
|
276 |
|
277 |
+
$pages = get_pages();
|
278 |
+
foreach ($pages as $page) {
|
279 |
+
$objects[$page->ID] = __('[Page]', 'wpfront-scroll-top') . ' ' . $page->post_title;
|
280 |
+
}
|
281 |
+
|
282 |
+
$posts = get_posts();
|
283 |
+
foreach ($posts as $post) {
|
284 |
+
$objects[$post->ID] = __('[Post]', 'wpfront-scroll-top') . ' ' . $post->post_title;
|
285 |
+
}
|
286 |
|
287 |
// $categories = get_categories();
|
288 |
// foreach ($categories as $category) {
|
289 |
// $objects['3.' . $category->cat_ID] = __('[Category]', 'wpfront-scroll-top') . ' ' . $category->cat_name;
|
290 |
// }
|
291 |
|
292 |
+
return $objects;
|
|
|
|
|
293 |
}
|
294 |
|
295 |
}
|
js/wpfront-scroll-top.js
CHANGED
@@ -66,6 +66,9 @@
|
|
66 |
};
|
67 |
|
68 |
var fnHideEvent = function () {
|
|
|
|
|
|
|
69 |
clearTimeout(hideEventID);
|
70 |
hideEventID = setTimeout(function () {
|
71 |
fnHide();
|
@@ -81,7 +84,7 @@
|
|
81 |
|
82 |
if ($(window).scrollTop() > data.scroll_offset) {
|
83 |
container.stop().css("opacity", mouse_over ? 1 : data.button_opacity).show();
|
84 |
-
if (!mouse_over
|
85 |
fnHideEvent();
|
86 |
}
|
87 |
} else {
|
66 |
};
|
67 |
|
68 |
var fnHideEvent = function () {
|
69 |
+
if(!data.auto_hide)
|
70 |
+
return;
|
71 |
+
|
72 |
clearTimeout(hideEventID);
|
73 |
hideEventID = setTimeout(function () {
|
74 |
fnHide();
|
84 |
|
85 |
if ($(window).scrollTop() > data.scroll_offset) {
|
86 |
container.stop().css("opacity", mouse_over ? 1 : data.button_opacity).show();
|
87 |
+
if (!mouse_over) {
|
88 |
fnHideEvent();
|
89 |
}
|
90 |
} else {
|
js/wpfront-scroll-top.min.js
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
|
|
1 |
+
|
2 |
+
(function(){window.wpfront_scroll_top=function(d){var e=jQuery;var a=e("#wpfront-scroll-top-container").css("opacity",0);var f={};switch(d.location){case 1:f.right=d.marginX+"px";f.bottom=d.marginY+"px";break;case 2:f.left=d.marginX+"px";f.bottom=d.marginY+"px";break;case 3:f.right=d.marginX+"px";f.top=d.marginY+"px";break;case 4:f.left=d.marginX+"px";f.top=d.marginY+"px";break}a.css(f);if(d.button_width==0){d.button_width="auto"}else{d.button_width+="px"}if(d.button_height==0){d.button_height="auto"}else{d.button_height+="px"}a.children("img").css({width:d.button_width,height:d.button_height});if(d.hide_iframe){if(e(window).attr("self")!==e(window).attr("top")){return}}var g=false;var b=0;var h=function(){clearTimeout(b);if(a.is(":visible")){a.stop().fadeTo(d.button_fade_duration,0,function(){a.hide();g=false})}};var j=function(){if(!d.auto_hide){return}clearTimeout(b);b=setTimeout(function(){h()},d.auto_hide_after*1000)};var i=false;var c=function(){if(i){return}i=true;if(e(window).scrollTop()>d.scroll_offset){a.stop().css("opacity",g?1:d.button_opacity).show();if(!g){j()}}else{h()}i=false};e(window).scroll(c);e(document).scroll(c);a.hover(function(){clearTimeout(b);g=true;e(this).css("opacity",1)},function(){e(this).css("opacity",d.button_opacity);g=false;j()}).click(function(){e("html, body").animate({scrollTop:0},d.scroll_duration);return false})}})();
|
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:
|
5 |
-
"PO-Revision-Date:
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: WPFront <contact@wpfront.com>\n"
|
8 |
"Language: en\n"
|
@@ -16,19 +16,15 @@ msgstr ""
|
|
16 |
"X-Poedit-KeywordsList: __;_e\n"
|
17 |
"X-Poedit-SearchPath-0: ..\n"
|
18 |
|
19 |
-
#: ../classes/base/class-wpfront-base
|
20 |
-
msgid "WPFront"
|
21 |
-
msgstr "WPFront"
|
22 |
-
|
23 |
-
#: ../classes/base/class-wpfront-base.php:108
|
24 |
msgid "Settings"
|
25 |
msgstr "Settings"
|
26 |
|
27 |
-
#: ../classes/base/class-wpfront-base.php:
|
28 |
msgid "You do not have sufficient permissions to access this page."
|
29 |
msgstr "You do not have sufficient permissions to access this page."
|
30 |
|
31 |
-
#: ../classes/base/class-wpfront-base.php:
|
32 |
msgid ""
|
33 |
"If you have a caching plugin, clear the cache for the new settings to take "
|
34 |
"effect."
|
@@ -36,19 +32,19 @@ msgstr ""
|
|
36 |
"If you have a caching plugin, clear the cache for the new settings to take "
|
37 |
"effect."
|
38 |
|
39 |
-
#: ../classes/base/class-wpfront-base.php:
|
40 |
msgid "Settings Description"
|
41 |
msgstr "Settings Description"
|
42 |
|
43 |
-
#: ../classes/base/class-wpfront-base.php:
|
44 |
msgid "Write a Review"
|
45 |
msgstr "Write a Review"
|
46 |
|
47 |
-
#: ../classes/base/class-wpfront-base.php:
|
48 |
msgid "Buy me a Beer or Coffee"
|
49 |
msgstr "Buy me a Beer or Coffee"
|
50 |
|
51 |
-
#: ../classes/base/class-wpfront-base.php:
|
52 |
msgid "Save Changes"
|
53 |
msgstr "Save Changes"
|
54 |
|
@@ -116,428 +112,225 @@ msgstr "Hide on WP-ADMIN"
|
|
116 |
msgid "Hide on iframes"
|
117 |
msgstr "Hide on iframes"
|
118 |
|
119 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
120 |
-
|
121 |
-
msgstr "Move Admin Menu"
|
122 |
-
|
123 |
-
#: ../classes/class-wpfront-scroll-top-options.php:61
|
124 |
-
#: ../templates/options-template.php:195
|
125 |
msgid "Location"
|
126 |
msgstr "Location"
|
127 |
|
128 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
129 |
msgid "Margin X"
|
130 |
msgstr "Margin X"
|
131 |
|
132 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
133 |
msgid "Margin Y"
|
134 |
msgstr "Margin Y"
|
135 |
|
136 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
137 |
-
#: ../templates/options-template.php:
|
138 |
msgid "Text"
|
139 |
msgstr "Text"
|
140 |
|
141 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
142 |
msgid "Text Color"
|
143 |
msgstr "Text Color"
|
144 |
|
145 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
146 |
msgid "Background Color"
|
147 |
msgstr "Background Color"
|
148 |
|
149 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
150 |
msgid "Mouse Over Color"
|
151 |
msgstr "Mouse Over Color"
|
152 |
|
153 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
154 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
155 |
msgid "Custom CSS"
|
156 |
msgstr "Custom CSS"
|
157 |
|
158 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
159 |
msgid "Icon Class"
|
160 |
msgstr "Icon Class"
|
161 |
|
162 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
163 |
msgid "Font Awesome URL"
|
164 |
msgstr "Font Awesome URL"
|
165 |
|
166 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
167 |
msgid "Do not include URL"
|
168 |
msgstr "Do not include URL"
|
169 |
|
170 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
171 |
msgid "Icon Color"
|
172 |
msgstr "Icon Color"
|
173 |
|
174 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
175 |
msgid "Display on Pages"
|
176 |
msgstr "Display on Pages"
|
177 |
|
178 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
179 |
-
#: ../classes/class-wpfront-scroll-top.php:116
|
180 |
msgid "WPFront Scroll Top"
|
181 |
msgstr "WPFront Scroll Top"
|
182 |
|
183 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
184 |
-
#: ../classes/class-wpfront-scroll-top.php:116
|
185 |
msgid "Scroll Top"
|
186 |
msgstr "Scroll Top"
|
187 |
|
188 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
189 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
190 |
msgid "[Page]"
|
191 |
msgstr "[Page]"
|
192 |
|
193 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
194 |
msgid "Home"
|
195 |
msgstr "Home"
|
196 |
|
197 |
-
#: ../classes/class-wpfront-scroll-top.php:
|
198 |
msgid "[Post]"
|
199 |
msgstr "[Post]"
|
200 |
|
201 |
-
#: ../templates/options-template.php:
|
202 |
msgid "WPFront Scroll Top Settings"
|
203 |
msgstr "WPFront Scroll Top Settings"
|
204 |
|
205 |
-
#: ../templates/options-template.php:
|
206 |
msgid "Display"
|
207 |
msgstr "Display"
|
208 |
|
209 |
-
#: ../templates/options-template.php:
|
210 |
msgid ""
|
211 |
"[Increases site performance. Keep it enabled, if there are no conflicts.]"
|
212 |
msgstr ""
|
213 |
"[Increases site performance. Keep it enabled, if there are no conflicts.]"
|
214 |
|
215 |
-
#: ../templates/options-template.php:
|
216 |
msgid "[Number of pixels to be scrolled before the button appears.]"
|
217 |
msgstr "[Number of pixels to be scrolled before the button appears.]"
|
218 |
|
219 |
-
#: ../templates/options-template.php:
|
220 |
msgid "Button Size"
|
221 |
msgstr "Button Size"
|
222 |
|
223 |
-
#: ../templates/options-template.php:
|
224 |
msgid "[Set 0px to auto fit.]"
|
225 |
msgstr "[Set 0px to auto fit.]"
|
226 |
|
227 |
-
#: ../templates/options-template.php:
|
228 |
msgid "[Button fade duration in milliseconds.]"
|
229 |
msgstr "[Button fade duration in milliseconds.]"
|
230 |
|
231 |
-
#: ../templates/options-template.php:
|
232 |
msgid "[Window scroll duration in milliseconds.]"
|
233 |
msgstr "[Window scroll duration in milliseconds.]"
|
234 |
|
235 |
-
#: ../templates/options-template.php:
|
236 |
msgid ""
|
237 |
"[Button will be auto hidden after this duration in seconds, if enabled.]"
|
238 |
msgstr ""
|
239 |
"[Button will be auto hidden after this duration in seconds, if enabled.]"
|
240 |
|
241 |
-
#: ../templates/options-template.php:
|
242 |
msgid "[Button will be hidden on small devices when the width matches.]"
|
243 |
msgstr "[Button will be hidden on small devices when the width matches.]"
|
244 |
|
245 |
-
#: ../templates/options-template.php:
|
246 |
msgid "[Button will be hidden on devices with lesser or equal width.]"
|
247 |
msgstr "[Button will be hidden on devices with lesser or equal width.]"
|
248 |
|
249 |
-
#: ../templates/options-template.php:
|
250 |
msgid "[Button will be hidden on broswer window when the width matches.]"
|
251 |
msgstr "[Button will be hidden on broswer window when the width matches.]"
|
252 |
|
253 |
-
#: ../templates/options-template.php:
|
254 |
msgid "[Button will be hidden on browser window with lesser or equal width.]"
|
255 |
msgstr "[Button will be hidden on browser window with lesser or equal width.]"
|
256 |
|
257 |
-
#: ../templates/options-template.php:
|
258 |
msgid "[Button will be hidden on 'wp-admin'.]"
|
259 |
msgstr "[Button will be hidden on 'wp-admin'.]"
|
260 |
|
261 |
-
#: ../templates/options-template.php:
|
262 |
msgid "[Button will be hidden on iframes, usually inside popups.]"
|
263 |
msgstr "[Button will be hidden on iframes, usually inside popups.]"
|
264 |
|
265 |
-
#: ../templates/options-template.php:
|
266 |
-
msgid "[This will place the 'Scroll Top' menu under 'Settings'.]"
|
267 |
-
msgstr "[This will place the 'Scroll Top' menu under 'Settings'.]"
|
268 |
-
|
269 |
-
#: ../templates/options-template.php:185
|
270 |
msgid "Image"
|
271 |
msgstr "Image"
|
272 |
|
273 |
-
#: ../templates/options-template.php:
|
274 |
msgid "Font Awesome"
|
275 |
msgstr "Font Awesome"
|
276 |
|
277 |
-
#: ../templates/options-template.php:
|
278 |
msgid "Bottom Right"
|
279 |
msgstr "Bottom Right"
|
280 |
|
281 |
-
#: ../templates/options-template.php:
|
282 |
msgid "Bottom Left"
|
283 |
msgstr "Bottom Left"
|
284 |
|
285 |
-
#: ../templates/options-template.php:
|
286 |
msgid "Top Right"
|
287 |
msgstr "Top Right"
|
288 |
|
289 |
-
#: ../templates/options-template.php:
|
290 |
msgid "Top Left"
|
291 |
msgstr "Top Left"
|
292 |
|
293 |
-
#: ../templates/options-template.php:
|
294 |
-
#: ../templates/options-template.php:
|
295 |
msgid "[Negative value allowed.]"
|
296 |
msgstr "[Negative value allowed.]"
|
297 |
|
298 |
-
#: ../templates/options-template.php:
|
299 |
msgid "Filter"
|
300 |
msgstr "Filter"
|
301 |
|
302 |
-
#: ../templates/options-template.php:
|
303 |
msgid "All pages."
|
304 |
msgstr "All pages."
|
305 |
|
306 |
-
#: ../templates/options-template.php:
|
307 |
msgid "Include in following pages"
|
308 |
msgstr "Include in following pages"
|
309 |
|
310 |
-
#: ../templates/options-template.php:
|
311 |
-
#: ../templates/options-template.php:
|
312 |
msgid ""
|
313 |
"[Use the textbox below to specify the post IDs as a comma separated list.]"
|
314 |
msgstr ""
|
315 |
"[Use the textbox below to specify the post IDs as a comma separated list.]"
|
316 |
|
317 |
-
#: ../templates/options-template.php:
|
318 |
msgid "Exclude in following pages"
|
319 |
msgstr "Exclude in following pages"
|
320 |
|
321 |
-
#: ../templates/options-template.php:
|
322 |
msgid "Text Button"
|
323 |
msgstr "Text Button"
|
324 |
|
325 |
-
#: ../templates/options-template.php:
|
326 |
-
#: ../templates/options-template.php:
|
327 |
-
#: ../templates/options-template.php:
|
328 |
msgid "ex:"
|
329 |
msgstr "ex:"
|
330 |
|
331 |
-
#: ../templates/options-template.php:
|
332 |
msgid "Font Awesome Button"
|
333 |
msgstr "Font Awesome Button"
|
334 |
|
335 |
-
#: ../templates/options-template.php:
|
336 |
msgid "Image Button"
|
337 |
msgstr "Image Button"
|
338 |
|
339 |
-
#: ../templates/options-template.php:
|
340 |
msgid "Custom URL"
|
341 |
msgstr "Custom URL"
|
342 |
|
343 |
-
#~ msgid "
|
344 |
-
#~ msgstr "
|
345 |
-
|
346 |
-
#~ msgid "Version"
|
347 |
-
#~ msgstr "Version"
|
348 |
-
|
349 |
-
#~ msgid "Rating"
|
350 |
-
#~ msgstr "Rating"
|
351 |
-
|
352 |
-
#~ msgid "Description"
|
353 |
-
#~ msgstr "Description"
|
354 |
-
|
355 |
-
#~ msgid "based on %s rating(s)"
|
356 |
-
#~ msgstr "based on %s rating(s)"
|
357 |
-
|
358 |
-
#~ msgid "Unable to communicate with WordPress.org"
|
359 |
-
#~ msgstr "Unable to communicate with WordPress.org"
|
360 |
-
|
361 |
-
#~ msgid "WPFront Plugins"
|
362 |
-
#~ msgstr "WPFront Plugins"
|
363 |
-
|
364 |
-
#~ msgid "By %s"
|
365 |
-
#~ msgstr "By %s"
|
366 |
-
|
367 |
-
#~ msgid "More information about %s"
|
368 |
-
#~ msgstr "More information about %s"
|
369 |
-
|
370 |
-
#~ msgid "Details"
|
371 |
-
#~ msgstr "Details"
|
372 |
-
|
373 |
-
#~ msgid "Install %s"
|
374 |
-
#~ msgstr "Install %s"
|
375 |
-
|
376 |
-
#~ msgid "Install Now"
|
377 |
-
#~ msgstr "Install Now"
|
378 |
-
|
379 |
-
#~ msgid "Update to version %s"
|
380 |
-
#~ msgstr "Update to version %s"
|
381 |
-
|
382 |
-
#~ msgid "Update Now"
|
383 |
-
#~ msgstr "Update Now"
|
384 |
-
|
385 |
-
#~ msgid "This plugin is already installed and is up to date"
|
386 |
-
#~ msgstr "This plugin is already installed and is up to date"
|
387 |
-
|
388 |
-
#~ msgid "Installed"
|
389 |
-
#~ msgstr "Installed"
|
390 |
-
|
391 |
-
#~ msgid "Activate"
|
392 |
-
#~ msgstr "Activate"
|
393 |
-
|
394 |
-
#~ msgid "Feedback"
|
395 |
-
#~ msgstr "Feedback"
|
396 |
-
|
397 |
-
#~ msgid "All Plugins"
|
398 |
-
#~ msgstr "All Plugins"
|
399 |
-
|
400 |
-
#~ msgid "Write Review"
|
401 |
-
#~ msgstr "Write Review"
|
402 |
-
|
403 |
-
#~ msgid "Plugin FAQ"
|
404 |
-
#~ msgstr "Plugin FAQ"
|
405 |
-
|
406 |
-
#~ msgid "Feature Request"
|
407 |
-
#~ msgstr "Feature Request"
|
408 |
-
|
409 |
-
#~ msgid "Report Bug"
|
410 |
-
#~ msgstr "Report Bug"
|
411 |
-
|
412 |
-
#~ msgid "Contact Me"
|
413 |
-
#~ msgstr "Contact Me"
|
414 |
-
|
415 |
-
#~ msgid "Contact Me (syam@wpfront.com)"
|
416 |
-
#~ msgstr "Contact Me (syam@wpfront.com)"
|
417 |
-
|
418 |
-
#~ msgid "Bar Height"
|
419 |
-
#~ msgstr "Bar Height"
|
420 |
-
|
421 |
-
#~ msgid "Message Text"
|
422 |
-
#~ msgstr "Message Text"
|
423 |
-
|
424 |
-
#~ msgid "Display After"
|
425 |
-
#~ msgstr "Display After"
|
426 |
-
|
427 |
-
#~ msgid "Display Close Button"
|
428 |
-
#~ msgstr "Display Close Button"
|
429 |
-
|
430 |
-
#~ msgid "Display Button"
|
431 |
-
#~ msgstr "Display Button"
|
432 |
-
|
433 |
-
#~ msgid "Open URL:"
|
434 |
-
#~ msgstr "Open URL:"
|
435 |
-
|
436 |
-
#~ msgid "Open URL in new tab/window"
|
437 |
-
#~ msgstr "Open URL in new tab/window"
|
438 |
-
|
439 |
-
#~ msgid "Execute JavaScript"
|
440 |
-
#~ msgstr "Execute JavaScript"
|
441 |
-
|
442 |
-
#~ msgid "Close Bar on Button Click"
|
443 |
-
#~ msgstr "Close Bar on Button Click"
|
444 |
-
|
445 |
-
#~ msgid "Display Shadow"
|
446 |
-
#~ msgstr "Display Shadow"
|
447 |
-
|
448 |
-
#~ msgid "Fixed at Position"
|
449 |
-
#~ msgstr "Fixed at Position"
|
450 |
-
|
451 |
-
#~ msgid "Message Text Color"
|
452 |
-
#~ msgstr "Message Text Color"
|
453 |
-
|
454 |
-
#~ msgid "From Color"
|
455 |
-
#~ msgstr "From Color"
|
456 |
-
|
457 |
-
#~ msgid "Button Text Color"
|
458 |
-
#~ msgstr "Button Text Color"
|
459 |
-
|
460 |
-
#~ msgid "Display Reopen Button"
|
461 |
-
#~ msgstr "Display Reopen Button"
|
462 |
-
|
463 |
-
#~ msgid "Reopen Button Color"
|
464 |
-
#~ msgstr "Reopen Button Color"
|
465 |
-
|
466 |
-
#~ msgid "Keep Closed"
|
467 |
-
#~ msgstr "Keep Closed"
|
468 |
-
|
469 |
-
#~ msgid "Position Offset"
|
470 |
-
#~ msgstr "Position Offset"
|
471 |
-
|
472 |
-
#~ msgid "WPFront Notification Bar"
|
473 |
-
#~ msgstr "WPFront Notification Bar"
|
474 |
-
|
475 |
-
#~ msgid "Notification Bar"
|
476 |
-
#~ msgstr "Notification Bar"
|
477 |
-
|
478 |
-
#~ msgid "Top"
|
479 |
-
#~ msgstr "Top"
|
480 |
-
|
481 |
-
#~ msgid "[Sticky Bar, bar will stay at position regardless of scrolling.]"
|
482 |
-
#~ msgstr "[Sticky Bar, bar will stay at position regardless of scrolling.]"
|
483 |
-
|
484 |
-
#~ msgid "px"
|
485 |
-
#~ msgstr "px"
|
486 |
-
|
487 |
-
#~ msgid ""
|
488 |
-
#~ "(Top bar only) If you find the bar overlapping, try increasing this "
|
489 |
-
#~ "value. (eg. WordPress 3.8 Twenty Fourteen theme, set 48px)"
|
490 |
-
#~ msgstr ""
|
491 |
-
#~ "(Top bar only) If you find the bar overlapping, try increasing this "
|
492 |
-
#~ "value. (eg. WordPress 3.8 Twenty Fourteen theme, set 48px)"
|
493 |
-
|
494 |
-
#~ msgid "second(s)"
|
495 |
-
#~ msgstr "second(s)"
|
496 |
-
|
497 |
-
#~ msgid "Set 0 second(s) to display immediately."
|
498 |
-
#~ msgstr "Set 0 second(s) to display immediately."
|
499 |
-
|
500 |
-
#~ msgid "Set 0 second(s) for no animation."
|
501 |
-
#~ msgstr "Set 0 second(s) for no animation."
|
502 |
-
|
503 |
-
#~ msgid "[Displays a close button at the top right corner of the bar.]"
|
504 |
-
#~ msgstr "[Displays a close button at the top right corner of the bar.]"
|
505 |
-
|
506 |
-
#~ msgid "Set 0 second(s) to disable auto close."
|
507 |
-
#~ msgstr "Set 0 second(s) to disable auto close."
|
508 |
-
|
509 |
-
#~ msgid "A reopen button will be displayed after the bar is closed."
|
510 |
-
#~ msgstr "A reopen button will be displayed after the bar is closed."
|
511 |
-
|
512 |
-
#~ msgid "Once closed, bar will display closed on other pages."
|
513 |
-
#~ msgstr "Once closed, bar will display closed on other pages."
|
514 |
-
|
515 |
-
#~ msgid "Content"
|
516 |
-
#~ msgstr "Content"
|
517 |
-
|
518 |
-
#~ msgid "[HTML tags are allowed. e.g. Add <br /> for break.]"
|
519 |
-
#~ msgstr "[HTML tags are allowed. e.g. Add <br /> for break.]"
|
520 |
-
|
521 |
-
#~ msgid "[Displays a button next to the message.]"
|
522 |
-
#~ msgstr "[Displays a button next to the message.]"
|
523 |
-
|
524 |
-
#~ msgid "Only in landing page."
|
525 |
-
#~ msgstr "Only in landing page."
|
526 |
-
|
527 |
-
#~ msgid "[The first page they visit on your website.]"
|
528 |
-
#~ msgstr "[The first page they visit on your website.]"
|
529 |
-
|
530 |
-
#~ msgid "Color"
|
531 |
-
#~ msgstr "Color"
|
532 |
-
|
533 |
-
#~ msgid "[Select two different colors to create a gradient.]"
|
534 |
-
#~ msgstr "[Select two different colors to create a gradient.]"
|
535 |
-
|
536 |
-
#~ msgid "Button Color"
|
537 |
-
#~ msgstr "Button Color"
|
538 |
|
539 |
-
#~ msgid "
|
540 |
-
#~ msgstr "
|
541 |
|
542 |
-
#~ msgid "
|
543 |
-
#~ msgstr "
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WPFront Notification Bar\n"
|
4 |
+
"POT-Creation-Date: 2018-03-07 15:33+0530\n"
|
5 |
+
"PO-Revision-Date: 2018-03-07 15:33+0530\n"
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: WPFront <contact@wpfront.com>\n"
|
8 |
"Language: en\n"
|
16 |
"X-Poedit-KeywordsList: __;_e\n"
|
17 |
"X-Poedit-SearchPath-0: ..\n"
|
18 |
|
19 |
+
#: ../classes/base/class-wpfront-base.php:105
|
|
|
|
|
|
|
|
|
20 |
msgid "Settings"
|
21 |
msgstr "Settings"
|
22 |
|
23 |
+
#: ../classes/base/class-wpfront-base.php:130
|
24 |
msgid "You do not have sufficient permissions to access this page."
|
25 |
msgstr "You do not have sufficient permissions to access this page."
|
26 |
|
27 |
+
#: ../classes/base/class-wpfront-base.php:150
|
28 |
msgid ""
|
29 |
"If you have a caching plugin, clear the cache for the new settings to take "
|
30 |
"effect."
|
32 |
"If you have a caching plugin, clear the cache for the new settings to take "
|
33 |
"effect."
|
34 |
|
35 |
+
#: ../classes/base/class-wpfront-base.php:178
|
36 |
msgid "Settings Description"
|
37 |
msgstr "Settings Description"
|
38 |
|
39 |
+
#: ../classes/base/class-wpfront-base.php:179
|
40 |
msgid "Write a Review"
|
41 |
msgstr "Write a Review"
|
42 |
|
43 |
+
#: ../classes/base/class-wpfront-base.php:180
|
44 |
msgid "Buy me a Beer or Coffee"
|
45 |
msgstr "Buy me a Beer or Coffee"
|
46 |
|
47 |
+
#: ../classes/base/class-wpfront-base.php:190
|
48 |
msgid "Save Changes"
|
49 |
msgstr "Save Changes"
|
50 |
|
112 |
msgid "Hide on iframes"
|
113 |
msgstr "Hide on iframes"
|
114 |
|
115 |
+
#: ../classes/class-wpfront-scroll-top-options.php:60
|
116 |
+
#: ../templates/options-template.php:188
|
|
|
|
|
|
|
|
|
117 |
msgid "Location"
|
118 |
msgstr "Location"
|
119 |
|
120 |
+
#: ../classes/class-wpfront-scroll-top-options.php:61
|
121 |
msgid "Margin X"
|
122 |
msgstr "Margin X"
|
123 |
|
124 |
+
#: ../classes/class-wpfront-scroll-top-options.php:62
|
125 |
msgid "Margin Y"
|
126 |
msgstr "Margin Y"
|
127 |
|
128 |
+
#: ../classes/class-wpfront-scroll-top-options.php:64
|
129 |
+
#: ../templates/options-template.php:180
|
130 |
msgid "Text"
|
131 |
msgstr "Text"
|
132 |
|
133 |
+
#: ../classes/class-wpfront-scroll-top-options.php:65
|
134 |
msgid "Text Color"
|
135 |
msgstr "Text Color"
|
136 |
|
137 |
+
#: ../classes/class-wpfront-scroll-top-options.php:66
|
138 |
msgid "Background Color"
|
139 |
msgstr "Background Color"
|
140 |
|
141 |
+
#: ../classes/class-wpfront-scroll-top-options.php:67
|
142 |
msgid "Mouse Over Color"
|
143 |
msgstr "Mouse Over Color"
|
144 |
|
145 |
+
#: ../classes/class-wpfront-scroll-top-options.php:68
|
146 |
+
#: ../classes/class-wpfront-scroll-top-options.php:74
|
147 |
msgid "Custom CSS"
|
148 |
msgstr "Custom CSS"
|
149 |
|
150 |
+
#: ../classes/class-wpfront-scroll-top-options.php:70
|
151 |
msgid "Icon Class"
|
152 |
msgstr "Icon Class"
|
153 |
|
154 |
+
#: ../classes/class-wpfront-scroll-top-options.php:71
|
155 |
msgid "Font Awesome URL"
|
156 |
msgstr "Font Awesome URL"
|
157 |
|
158 |
+
#: ../classes/class-wpfront-scroll-top-options.php:72
|
159 |
msgid "Do not include URL"
|
160 |
msgstr "Do not include URL"
|
161 |
|
162 |
+
#: ../classes/class-wpfront-scroll-top-options.php:73
|
163 |
msgid "Icon Color"
|
164 |
msgstr "Icon Color"
|
165 |
|
166 |
+
#: ../classes/class-wpfront-scroll-top-options.php:76
|
167 |
msgid "Display on Pages"
|
168 |
msgstr "Display on Pages"
|
169 |
|
170 |
+
#: ../classes/class-wpfront-scroll-top.php:109
|
|
|
171 |
msgid "WPFront Scroll Top"
|
172 |
msgstr "WPFront Scroll Top"
|
173 |
|
174 |
+
#: ../classes/class-wpfront-scroll-top.php:109
|
|
|
175 |
msgid "Scroll Top"
|
176 |
msgstr "Scroll Top"
|
177 |
|
178 |
+
#: ../classes/class-wpfront-scroll-top.php:275
|
179 |
+
#: ../classes/class-wpfront-scroll-top.php:279
|
180 |
msgid "[Page]"
|
181 |
msgstr "[Page]"
|
182 |
|
183 |
+
#: ../classes/class-wpfront-scroll-top.php:275
|
184 |
msgid "Home"
|
185 |
msgstr "Home"
|
186 |
|
187 |
+
#: ../classes/class-wpfront-scroll-top.php:284
|
188 |
msgid "[Post]"
|
189 |
msgstr "[Post]"
|
190 |
|
191 |
+
#: ../templates/options-template.php:34
|
192 |
msgid "WPFront Scroll Top Settings"
|
193 |
msgstr "WPFront Scroll Top Settings"
|
194 |
|
195 |
+
#: ../templates/options-template.php:36
|
196 |
msgid "Display"
|
197 |
msgstr "Display"
|
198 |
|
199 |
+
#: ../templates/options-template.php:52
|
200 |
msgid ""
|
201 |
"[Increases site performance. Keep it enabled, if there are no conflicts.]"
|
202 |
msgstr ""
|
203 |
"[Increases site performance. Keep it enabled, if there are no conflicts.]"
|
204 |
|
205 |
+
#: ../templates/options-template.php:61
|
206 |
msgid "[Number of pixels to be scrolled before the button appears.]"
|
207 |
msgstr "[Number of pixels to be scrolled before the button appears.]"
|
208 |
|
209 |
+
#: ../templates/options-template.php:66
|
210 |
msgid "Button Size"
|
211 |
msgstr "Button Size"
|
212 |
|
213 |
+
#: ../templates/options-template.php:72
|
214 |
msgid "[Set 0px to auto fit.]"
|
215 |
msgstr "[Set 0px to auto fit.]"
|
216 |
|
217 |
+
#: ../templates/options-template.php:89
|
218 |
msgid "[Button fade duration in milliseconds.]"
|
219 |
msgstr "[Button fade duration in milliseconds.]"
|
220 |
|
221 |
+
#: ../templates/options-template.php:98
|
222 |
msgid "[Window scroll duration in milliseconds.]"
|
223 |
msgstr "[Window scroll duration in milliseconds.]"
|
224 |
|
225 |
+
#: ../templates/options-template.php:115
|
226 |
msgid ""
|
227 |
"[Button will be auto hidden after this duration in seconds, if enabled.]"
|
228 |
msgstr ""
|
229 |
"[Button will be auto hidden after this duration in seconds, if enabled.]"
|
230 |
|
231 |
+
#: ../templates/options-template.php:124
|
232 |
msgid "[Button will be hidden on small devices when the width matches.]"
|
233 |
msgstr "[Button will be hidden on small devices when the width matches.]"
|
234 |
|
235 |
+
#: ../templates/options-template.php:133
|
236 |
msgid "[Button will be hidden on devices with lesser or equal width.]"
|
237 |
msgstr "[Button will be hidden on devices with lesser or equal width.]"
|
238 |
|
239 |
+
#: ../templates/options-template.php:142
|
240 |
msgid "[Button will be hidden on broswer window when the width matches.]"
|
241 |
msgstr "[Button will be hidden on broswer window when the width matches.]"
|
242 |
|
243 |
+
#: ../templates/options-template.php:151
|
244 |
msgid "[Button will be hidden on browser window with lesser or equal width.]"
|
245 |
msgstr "[Button will be hidden on browser window with lesser or equal width.]"
|
246 |
|
247 |
+
#: ../templates/options-template.php:160
|
248 |
msgid "[Button will be hidden on 'wp-admin'.]"
|
249 |
msgstr "[Button will be hidden on 'wp-admin'.]"
|
250 |
|
251 |
+
#: ../templates/options-template.php:169
|
252 |
msgid "[Button will be hidden on iframes, usually inside popups.]"
|
253 |
msgstr "[Button will be hidden on iframes, usually inside popups.]"
|
254 |
|
255 |
+
#: ../templates/options-template.php:178
|
|
|
|
|
|
|
|
|
256 |
msgid "Image"
|
257 |
msgstr "Image"
|
258 |
|
259 |
+
#: ../templates/options-template.php:182
|
260 |
msgid "Font Awesome"
|
261 |
msgstr "Font Awesome"
|
262 |
|
263 |
+
#: ../templates/options-template.php:196
|
264 |
msgid "Bottom Right"
|
265 |
msgstr "Bottom Right"
|
266 |
|
267 |
+
#: ../templates/options-template.php:197
|
268 |
msgid "Bottom Left"
|
269 |
msgstr "Bottom Left"
|
270 |
|
271 |
+
#: ../templates/options-template.php:198
|
272 |
msgid "Top Right"
|
273 |
msgstr "Top Right"
|
274 |
|
275 |
+
#: ../templates/options-template.php:199
|
276 |
msgid "Top Left"
|
277 |
msgstr "Top Left"
|
278 |
|
279 |
+
#: ../templates/options-template.php:209
|
280 |
+
#: ../templates/options-template.php:218
|
281 |
msgid "[Negative value allowed.]"
|
282 |
msgstr "[Negative value allowed.]"
|
283 |
|
284 |
+
#: ../templates/options-template.php:223
|
285 |
msgid "Filter"
|
286 |
msgstr "Filter"
|
287 |
|
288 |
+
#: ../templates/options-template.php:232
|
289 |
msgid "All pages."
|
290 |
msgstr "All pages."
|
291 |
|
292 |
+
#: ../templates/options-template.php:237
|
293 |
msgid "Include in following pages"
|
294 |
msgstr "Include in following pages"
|
295 |
|
296 |
+
#: ../templates/options-template.php:237
|
297 |
+
#: ../templates/options-template.php:258
|
298 |
msgid ""
|
299 |
"[Use the textbox below to specify the post IDs as a comma separated list.]"
|
300 |
msgstr ""
|
301 |
"[Use the textbox below to specify the post IDs as a comma separated list.]"
|
302 |
|
303 |
+
#: ../templates/options-template.php:258
|
304 |
msgid "Exclude in following pages"
|
305 |
msgstr "Exclude in following pages"
|
306 |
|
307 |
+
#: ../templates/options-template.php:281
|
308 |
msgid "Text Button"
|
309 |
msgstr "Text Button"
|
310 |
|
311 |
+
#: ../templates/options-template.php:331
|
312 |
+
#: ../templates/options-template.php:344
|
313 |
+
#: ../templates/options-template.php:384
|
314 |
msgid "ex:"
|
315 |
msgstr "ex:"
|
316 |
|
317 |
+
#: ../templates/options-template.php:336
|
318 |
msgid "Font Awesome Button"
|
319 |
msgstr "Font Awesome Button"
|
320 |
|
321 |
+
#: ../templates/options-template.php:389
|
322 |
msgid "Image Button"
|
323 |
msgstr "Image Button"
|
324 |
|
325 |
+
#: ../templates/options-template.php:406
|
326 |
msgid "Custom URL"
|
327 |
msgstr "Custom URL"
|
328 |
|
329 |
+
#~ msgid "WPFront"
|
330 |
+
#~ msgstr "WPFront"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
+
#~ msgid "Move Admin Menu"
|
333 |
+
#~ msgstr "Move Admin Menu"
|
334 |
|
335 |
+
#~ msgid "[This will place the 'Scroll Top' menu under 'Settings'.]"
|
336 |
+
#~ msgstr "[This will place the 'Scroll Top' menu under 'Settings'.]"
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ 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: 4.9.
|
7 |
-
Stable tag: 1.6.
|
8 |
Requires PHP: 5.3
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -45,12 +45,22 @@ Visit [WPFront Scroll Top Settings](http://wpfront.com/scroll-top-plugin-setting
|
|
45 |
|
46 |
Visit [WPFront Scroll Top FAQ](http://wpfront.com/scroll-top-plugin-faq/) page for FAQ.
|
47 |
|
|
|
|
|
|
|
|
|
48 |
== Screenshots ==
|
49 |
|
50 |
1. Settings page.
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
= 1.6.1 =
|
55 |
* Undefined variable fix.
|
56 |
|
@@ -114,6 +124,9 @@ Visit [WPFront Scroll Top FAQ](http://wpfront.com/scroll-top-plugin-faq/) page f
|
|
114 |
|
115 |
== Upgrade Notice ==
|
116 |
|
|
|
|
|
|
|
117 |
= 1.6.1 =
|
118 |
* Bug fix.
|
119 |
|
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: 4.9.4
|
7 |
+
Stable tag: 1.6.2
|
8 |
Requires PHP: 5.3
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
45 |
|
46 |
Visit [WPFront Scroll Top FAQ](http://wpfront.com/scroll-top-plugin-faq/) page for FAQ.
|
47 |
|
48 |
+
= WPFront Scroll Top and GDPR compliance? =
|
49 |
+
|
50 |
+
This plugin doesn’t collect any personal information. For more information please visit [GDPR compliance](https://wpfront.com/wpfront-and-gdpr-compliance/).
|
51 |
+
|
52 |
== Screenshots ==
|
53 |
|
54 |
1. Settings page.
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
= 1.6.2 =
|
59 |
+
* Requires minimum PHP 5.3.
|
60 |
+
* Bug fixes.
|
61 |
+
* Moved menu under 'Settings' menu.
|
62 |
+
* PHP 7.2 compatibility fixes.
|
63 |
+
|
64 |
= 1.6.1 =
|
65 |
* Undefined variable fix.
|
66 |
|
124 |
|
125 |
== Upgrade Notice ==
|
126 |
|
127 |
+
= 1.6.2 =
|
128 |
+
* Bug and compatibility fixes.
|
129 |
+
|
130 |
= 1.6.1 =
|
131 |
* Bug fix.
|
132 |
|
templates/options-template.php
CHANGED
@@ -21,6 +21,8 @@
|
|
21 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
22 |
*/
|
23 |
|
|
|
|
|
24 |
/**
|
25 |
* Template for WPFront Scroll Top Options
|
26 |
*
|
@@ -167,15 +169,6 @@
|
|
167 |
<span class="description"><?php echo __('[Button will be hidden on iframes, usually inside popups.]', 'wpfront-scroll-top'); ?></span>
|
168 |
</td>
|
169 |
</tr>
|
170 |
-
<tr>
|
171 |
-
<th scope="row">
|
172 |
-
<?php echo $this->options->move_admin_menu_label(); ?>
|
173 |
-
</th>
|
174 |
-
<td>
|
175 |
-
<input class="move-admin-menu" type="checkbox" name="<?php echo $this->options->move_admin_menu_name(); ?>" <?php echo $this->options->move_admin_menu() ? "checked" : ""; ?> />
|
176 |
-
<span class="description"><?php echo __('[This will place the \'Scroll Top\' menu under \'Settings\'.]', 'wpfront-scroll-top'); ?></span>
|
177 |
-
</td>
|
178 |
-
</tr>
|
179 |
<tr>
|
180 |
<th scope="row">
|
181 |
<?php echo $this->options->button_style_label(); ?>
|
@@ -430,21 +423,6 @@
|
|
430 |
|
431 |
<script type="text/javascript">
|
432 |
(function($) {
|
433 |
-
var moveMenu = <?php echo $this->options->move_admin_menu()? 'true' : 'false'; ?>;
|
434 |
-
var optionsURL = '<?php echo admin_url('admin.php?page=wpfront-scroll-top&settings-updated=true')?>';
|
435 |
-
|
436 |
-
$('#wpfront-scroll-top-options form').submit(function(e) {
|
437 |
-
if(moveMenu && !$('#wpfront-scroll-top-options .move-admin-menu').prop('checked')) {
|
438 |
-
e.preventDefault();
|
439 |
-
|
440 |
-
$.post($(this).attr('action'), $(this).serialize()).always(function() {
|
441 |
-
$(location).attr('href', optionsURL);
|
442 |
-
});
|
443 |
-
|
444 |
-
$(this).find(':input').prop('disabled', true);
|
445 |
-
}
|
446 |
-
});
|
447 |
-
|
448 |
function setColorPicker(div) {
|
449 |
div.ColorPicker({
|
450 |
color: div.attr('color'),
|
21 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
22 |
*/
|
23 |
|
24 |
+
namespace WPFront\Scroll_Top;
|
25 |
+
|
26 |
/**
|
27 |
* Template for WPFront Scroll Top Options
|
28 |
*
|
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(); ?>
|
423 |
|
424 |
<script type="text/javascript">
|
425 |
(function($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
function setColorPicker(div) {
|
427 |
div.ColorPicker({
|
428 |
color: div.attr('color'),
|
templates/scroll-top-template.php
CHANGED
@@ -21,6 +21,8 @@
|
|
21 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
22 |
*/
|
23 |
|
|
|
|
|
24 |
/**
|
25 |
* Template for WPFront Scroll Top
|
26 |
*
|
21 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
22 |
*/
|
23 |
|
24 |
+
namespace WPFront\Scroll_Top;
|
25 |
+
|
26 |
/**
|
27 |
* Template for WPFront Scroll Top
|
28 |
*
|
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.6.
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|
@@ -31,6 +31,7 @@
|
|
31 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32 |
*/
|
33 |
|
|
|
34 |
|
35 |
require_once("classes/class-wpfront-scroll-top.php");
|
36 |
|
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.6.2
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|
31 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32 |
*/
|
33 |
|
34 |
+
namespace WPFront\Scroll_Top;
|
35 |
|
36 |
require_once("classes/class-wpfront-scroll-top.php");
|
37 |
|