Version Description
- Fixed issue with target id attribute having special characters (like %, &, # etc.).
- Extended "Prevent other scripts from handling plugins links" option with special selector option field.
- Removed jQuery 1.x deprecated functions from plugin script (.bind, .delegate, .unbind etc. are replaced with .on, .off etc.).
- Updated plugin's contextual help and notices.
Download this release
Release Info
Developer | malihu |
Plugin | Page scroll to id |
Version | 1.7.3 |
Comparing to | |
See all releases |
Code changes from version 1.7.2 to 1.7.3
- css/admin.css +72 -6
- includes/admin.php +4 -2
- includes/elegant-themes-160x600.gif +0 -0
- includes/help/plugin-settings.inc +1 -0
- includes/mo-admin-notice.php +0 -173
- includes/ps2id-plugin-admin-notice.php +97 -0
- includes/seo-admin-notice.php +0 -116
- includes/seo-checklist-illustration-3-opt.png +0 -0
- includes/the-seo-checklist-by-seo-buddy.png +0 -0
- js/admin.js +11 -11
- js/jquery.malihu.PageScroll2id-init.js +16 -10
- js/jquery.malihu.PageScroll2id-unbind-defer.js +35 -0
- js/jquery.malihu.PageScroll2id.js +18 -15
- js/page-scroll-to-id.min.js +2 -2
- malihu-pagescroll2id.php +33 -7
- readme.txt +13 -2
css/admin.css
CHANGED
@@ -114,6 +114,16 @@
|
|
114 |
|
115 |
.donate span + input{
|
116 |
vertical-align: middle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
}
|
118 |
|
119 |
.description code{
|
@@ -152,8 +162,8 @@
|
|
152 |
}
|
153 |
|
154 |
.plugin-body-section-2{
|
155 |
-
|
156 |
-
display: none; /* plugin settings banner off */
|
157 |
min-height: 100px;
|
158 |
right: 0;
|
159 |
top: 0;
|
@@ -163,13 +173,37 @@
|
|
163 |
.plugin-body-section-2 img{
|
164 |
max-width: 100%;
|
165 |
height: auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
}
|
167 |
|
168 |
@media only screen and (min-width: 480px){
|
169 |
/* plugin settings banner on */
|
170 |
-
|
171 |
margin-right: calc(35vw + 1em);
|
172 |
-
}
|
173 |
|
174 |
.plugin-body-section-2{
|
175 |
position: absolute;
|
@@ -178,13 +212,45 @@
|
|
178 |
}
|
179 |
}
|
180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
@media only screen and (min-width: 782px){
|
182 |
/* plugin settings banner on */
|
183 |
-
|
184 |
margin-right: calc(25vw + 1em);
|
185 |
-
}
|
186 |
|
187 |
.plugin-body-section-2{
|
188 |
width: 25vw;
|
189 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
}
|
114 |
|
115 |
.donate span + input{
|
116 |
vertical-align: middle;
|
117 |
+
transform: translateY(-.1em);
|
118 |
+
}
|
119 |
+
|
120 |
+
.donate > form > span{
|
121 |
+
display: block;
|
122 |
+
margin-bottom: .75em;
|
123 |
+
}
|
124 |
+
|
125 |
+
.donate > form > span > b{
|
126 |
+
display: inline-block;
|
127 |
}
|
128 |
|
129 |
.description code{
|
162 |
}
|
163 |
|
164 |
.plugin-body-section-2{
|
165 |
+
display: block; /* plugin settings banner on */
|
166 |
+
/* display: none; */ /* plugin settings banner off */
|
167 |
min-height: 100px;
|
168 |
right: 0;
|
169 |
top: 0;
|
173 |
.plugin-body-section-2 img{
|
174 |
max-width: 100%;
|
175 |
height: auto;
|
176 |
+
margin:.25em 0;
|
177 |
+
}
|
178 |
+
|
179 |
+
.plugin-body-section-2 > *:first-child{
|
180 |
+
display: block;
|
181 |
+
font-size: 13px;
|
182 |
+
line-height: 1.5;
|
183 |
+
color: #777;
|
184 |
+
margin-bottom: 1em;
|
185 |
+
margin-left: .25em;
|
186 |
+
margin-right: .25em;
|
187 |
+
font-style: italic;
|
188 |
+
}
|
189 |
+
|
190 |
+
.plugin-body-section-2 > *:first-child > b, .donate > form > span > b{
|
191 |
+
font-size: 17px;
|
192 |
+
transform: translateY(.05em);
|
193 |
+
margin-left: .2em;
|
194 |
+
font-weight: 400;
|
195 |
+
font-style: normal;
|
196 |
+
}
|
197 |
+
|
198 |
+
.plugin-body-section-2 > *:first-child > b{
|
199 |
+
display: none;
|
200 |
}
|
201 |
|
202 |
@media only screen and (min-width: 480px){
|
203 |
/* plugin settings banner on */
|
204 |
+
.plugin-body-section-1{
|
205 |
margin-right: calc(35vw + 1em);
|
206 |
+
}
|
207 |
|
208 |
.plugin-body-section-2{
|
209 |
position: absolute;
|
212 |
}
|
213 |
}
|
214 |
|
215 |
+
@media only screen and (min-width: 576px){
|
216 |
+
.plugin-body-section-2 img{
|
217 |
+
margin-left: .5em;
|
218 |
+
margin-right: .5em;
|
219 |
+
}
|
220 |
+
|
221 |
+
.plugin-body-section-2 > *:first-child{
|
222 |
+
margin-left: 0;
|
223 |
+
margin-right: 0;
|
224 |
+
}
|
225 |
+
|
226 |
+
.plugin-body-section-2 > *:first-child > b{
|
227 |
+
display: inline-block;
|
228 |
+
}
|
229 |
+
|
230 |
+
.donate > form > span{
|
231 |
+
display: inline-block;
|
232 |
+
margin-right: .75em;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
@media only screen and (min-width: 782px){
|
237 |
/* plugin settings banner on */
|
238 |
+
.plugin-body-section-1{
|
239 |
margin-right: calc(25vw + 1em);
|
240 |
+
}
|
241 |
|
242 |
.plugin-body-section-2{
|
243 |
width: 25vw;
|
244 |
}
|
245 |
+
}
|
246 |
+
|
247 |
+
@media only screen and (min-width: 1200px){
|
248 |
+
/* plugin settings banner on */
|
249 |
+
.plugin-body-section-1{
|
250 |
+
margin-right: calc(18vw + 1em);
|
251 |
+
}
|
252 |
+
|
253 |
+
.plugin-body-section-2{
|
254 |
+
width: 18vw;
|
255 |
+
}
|
256 |
}
|
includes/admin.php
CHANGED
@@ -81,7 +81,9 @@ $toggle_instance_title=__('Click to toggle', $this->plugin_slug);
|
|
81 |
</div>
|
82 |
|
83 |
<div class="plugin-body-section-2">
|
84 |
-
|
|
|
|
|
85 |
</div>
|
86 |
|
87 |
</div>
|
@@ -95,7 +97,7 @@ $toggle_instance_title=__('Click to toggle', $this->plugin_slug);
|
|
95 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
96 |
<input type="hidden" name="cmd" value="_s-xclick">
|
97 |
<input type="hidden" name="hosted_button_id" value="UYJ5G65M6ZA28">
|
98 |
-
<span>If you like this plugin and find it useful, consider making a donation
|
99 |
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
100 |
</form>
|
101 |
</div>
|
81 |
</div>
|
82 |
|
83 |
<div class="plugin-body-section-2">
|
84 |
+
<span>Help me support the plugin <b>:-)</b></span>
|
85 |
+
<?php // Elegant themes banner --edit-- ?>
|
86 |
+
<a href="https://www.elegantthemes.com/affiliates/idevaffiliate.php?id=36986_1_1_14" target="_blank" rel="nofollow"><img src="<?php echo plugins_url('elegant-themes-160x600.gif', __FILE__); ?>" style="border:0px" /></a>
|
87 |
</div>
|
88 |
|
89 |
</div>
|
97 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
98 |
<input type="hidden" name="cmd" value="_s-xclick">
|
99 |
<input type="hidden" name="hosted_button_id" value="UYJ5G65M6ZA28">
|
100 |
+
<span>If you like this plugin and find it useful, consider making a donation <b>:-)</b></span> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
101 |
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
102 |
</form>
|
103 |
</div>
|
includes/elegant-themes-160x600.gif
ADDED
Binary file
|
includes/help/plugin-settings.inc
CHANGED
@@ -76,6 +76,7 @@ $help_plugin_settings_text=<<<EOD
|
|
76 |
<p>
|
77 |
<a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced" target="_blank"><strong>Advanced options</strong></a> -
|
78 |
If another plugin or a theme script handles page scrolling and conflicts with "Page scroll to id", try enabling <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-remove-other-click-events" target="_blank">Prevent other scripts from handling plugin’s links</a> option. <br />
|
|
|
79 |
Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-normalize-targets" target="_blank">Normalize anchor-point targets</a> to normalize/reset the CSS properties (height, line-height, border etc.) of anchor-point targets. <br />
|
80 |
Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-encode-links" target="_blank">Encode unicode characters on links URL</a> when having links with encoded unicode characters (e.g. on internationalized domain names) in their href/URL.
|
81 |
</p>
|
76 |
<p>
|
77 |
<a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced" target="_blank"><strong>Advanced options</strong></a> -
|
78 |
If another plugin or a theme script handles page scrolling and conflicts with "Page scroll to id", try enabling <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-remove-other-click-events" target="_blank">Prevent other scripts from handling plugin’s links</a> option. <br />
|
79 |
+
You may add a specific selector for the option above using the <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-remove-other-click-events-selector" target="_blank">Prevent other scripts from handling plugin’s links selector(s)</a> field below. <br />
|
80 |
Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-normalize-targets" target="_blank">Normalize anchor-point targets</a> to normalize/reset the CSS properties (height, line-height, border etc.) of anchor-point targets. <br />
|
81 |
Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-encode-links" target="_blank">Encode unicode characters on links URL</a> when having links with encoded unicode characters (e.g. on internationalized domain names) in their href/URL.
|
82 |
</p>
|
includes/mo-admin-notice.php
DELETED
@@ -1,173 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!class_exists('MO_Admin_Notice')) {
|
3 |
-
|
4 |
-
class MO_Admin_Notice
|
5 |
-
{
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
add_action('admin_notices', array($this, 'admin_notice'));
|
9 |
-
add_action('network_admin_notices', array($this, 'admin_notice'));
|
10 |
-
add_action('admin_init', array($this, 'dismiss_admin_notice'));
|
11 |
-
}
|
12 |
-
|
13 |
-
public function dismiss_admin_notice()
|
14 |
-
{
|
15 |
-
if (!isset($_GET['mo-adaction']) || $_GET['mo-adaction'] != 'mo_dismiss_adnotice') {
|
16 |
-
return;
|
17 |
-
}
|
18 |
-
|
19 |
-
$url = admin_url();
|
20 |
-
update_option('mo_dismiss_adnotice', 'true');
|
21 |
-
|
22 |
-
wp_redirect($url);
|
23 |
-
exit;
|
24 |
-
}
|
25 |
-
|
26 |
-
public function admin_notice()
|
27 |
-
{
|
28 |
-
if (get_option('mo_dismiss_adnotice', 'false') == 'true') {
|
29 |
-
return;
|
30 |
-
}
|
31 |
-
|
32 |
-
if ($this->is_plugin_installed() && $this->is_plugin_active()) {
|
33 |
-
return;
|
34 |
-
}
|
35 |
-
|
36 |
-
$dismiss_url = esc_url_raw(
|
37 |
-
add_query_arg(
|
38 |
-
array(
|
39 |
-
'mo-adaction' => 'mo_dismiss_adnotice'
|
40 |
-
),
|
41 |
-
admin_url()
|
42 |
-
)
|
43 |
-
);
|
44 |
-
$this->notice_css();
|
45 |
-
$install_url = wp_nonce_url(
|
46 |
-
admin_url('update.php?action=install-plugin&plugin=mailoptin'),
|
47 |
-
'install-plugin_mailoptin'
|
48 |
-
);
|
49 |
-
|
50 |
-
$activate_url = wp_nonce_url(admin_url('plugins.php?action=activate&plugin=mailoptin%2Fmailoptin.php'), 'activate-plugin_mailoptin/mailoptin.php');
|
51 |
-
?>
|
52 |
-
<div class="mo-admin-notice notice notice-success updated fade below-h2 is-dismissible">
|
53 |
-
<div class="mo-notice-first-half">
|
54 |
-
<p>
|
55 |
-
<?php
|
56 |
-
printf(
|
57 |
-
__('Free optin form plugin that will %1$sincrease your email list subscribers%2$s and keep them engaged with %1$sautomated and schedule newsletters%2$s.'),
|
58 |
-
'<span class="mo-stylize"><strong>', '</strong></span>');
|
59 |
-
?>
|
60 |
-
</p>
|
61 |
-
<p style="text-decoration: underline;font-size: 12px;">Recommended by "Page scroll to id" plugin</p>
|
62 |
-
</div>
|
63 |
-
<div class="mo-notice-other-half">
|
64 |
-
<p>
|
65 |
-
<?php if ( ! $this->is_plugin_installed()) : ?>
|
66 |
-
<a class="button button-primary button-hero" id="mo-install-mailoptin-plugin" href="<?php echo $install_url; ?>">
|
67 |
-
<?php _e('Install MailOptin Now for Free!'); ?>
|
68 |
-
</a>
|
69 |
-
<?php endif; ?>
|
70 |
-
<?php if ($this->is_plugin_installed() && ! $this->is_plugin_active()) : ?>
|
71 |
-
<a class="button button-primary button-hero" id="mo-activate-mailoptin-plugin" href="<?php echo $activate_url; ?>">
|
72 |
-
<?php _e('Activate MailOptin Now!'); ?>
|
73 |
-
</a>
|
74 |
-
<?php endif; ?>
|
75 |
-
</p>
|
76 |
-
<div class="mo-notice-learn-more">
|
77 |
-
<a target="_blank" href="https://mailoptin.io">Learn more</a> | <a href="<?php echo $dismiss_url; ?>"><?php _e('Dismiss this notice'); ?></a>
|
78 |
-
</div>
|
79 |
-
</div>
|
80 |
-
<a href="<?php echo $dismiss_url; ?>">
|
81 |
-
<button type="button">
|
82 |
-
<span class="screen-reader-text"><?php _e('Dismiss this notice'); ?>.</span>
|
83 |
-
</button>
|
84 |
-
</a>
|
85 |
-
</div>
|
86 |
-
<?php
|
87 |
-
}
|
88 |
-
|
89 |
-
public function is_plugin_installed()
|
90 |
-
{
|
91 |
-
$installed_plugins = get_plugins();
|
92 |
-
|
93 |
-
return isset($installed_plugins['mailoptin/mailoptin.php']);
|
94 |
-
}
|
95 |
-
|
96 |
-
public function is_plugin_active()
|
97 |
-
{
|
98 |
-
return is_plugin_active('mailoptin/mailoptin.php');
|
99 |
-
}
|
100 |
-
|
101 |
-
public function notice_css()
|
102 |
-
{
|
103 |
-
?>
|
104 |
-
<style type="text/css">
|
105 |
-
.mo-admin-notice {
|
106 |
-
background: #fff;
|
107 |
-
color: #000;
|
108 |
-
border-left-color: #46b450;
|
109 |
-
position: relative;
|
110 |
-
}
|
111 |
-
div.updated.mo-admin-notice{
|
112 |
-
margin: 40px 15px 15px 0;
|
113 |
-
}
|
114 |
-
.mo-admin-notice.updated > a > button {
|
115 |
-
padding: 0;
|
116 |
-
border: 0;
|
117 |
-
}
|
118 |
-
.mo-admin-notice .notice-dismiss:before {
|
119 |
-
color: #72777c;
|
120 |
-
}
|
121 |
-
.mo-admin-notice .mo-stylize {
|
122 |
-
line-height: 2;
|
123 |
-
}
|
124 |
-
.mo-admin-notice .button-primary {
|
125 |
-
background: #006799;
|
126 |
-
text-shadow: none;
|
127 |
-
border: 0;
|
128 |
-
box-shadow: none;
|
129 |
-
}
|
130 |
-
.mo-notice-first-half {
|
131 |
-
width: 66%;
|
132 |
-
}
|
133 |
-
.mo-notice-first-half, .mo-notice-other-half {
|
134 |
-
margin: 10px 0;
|
135 |
-
display: inline-block;
|
136 |
-
}
|
137 |
-
.mo-notice-other-half {
|
138 |
-
width: 33%;
|
139 |
-
position: absolute;
|
140 |
-
text-align: center;
|
141 |
-
margin-top: 5px;
|
142 |
-
}
|
143 |
-
.mo-notice-first-half p {
|
144 |
-
font-size: 14px;
|
145 |
-
}
|
146 |
-
.mo-notice-learn-more a {
|
147 |
-
margin: 10px;
|
148 |
-
}
|
149 |
-
.mo-notice-learn-more {
|
150 |
-
margin-top: 10px;
|
151 |
-
}
|
152 |
-
p + .mo-notice-learn-more {
|
153 |
-
margin-top: 0;
|
154 |
-
}
|
155 |
-
</style>
|
156 |
-
<?php
|
157 |
-
}
|
158 |
-
|
159 |
-
public static function instance()
|
160 |
-
{
|
161 |
-
static $instance = null;
|
162 |
-
|
163 |
-
if (is_null($instance)) {
|
164 |
-
$instance = new self();
|
165 |
-
}
|
166 |
-
|
167 |
-
return $instance;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
MO_Admin_Notice::instance();
|
173 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/ps2id-plugin-admin-notice.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!class_exists('ps2id_Plugin_Admin_Notice')) {
|
3 |
+
|
4 |
+
class ps2id_Plugin_Admin_Notice{
|
5 |
+
public function __construct(){
|
6 |
+
add_action('admin_notices', array($this, 'admin_notice'));
|
7 |
+
add_action('network_admin_notices', array($this, 'admin_notice'));
|
8 |
+
add_action('admin_init', array($this, 'dismiss_admin_notice'));
|
9 |
+
}
|
10 |
+
|
11 |
+
public function dismiss_admin_notice(){
|
12 |
+
if (!isset($_GET['ps2id-plugin-admin-notice-action']) || $_GET['ps2id-plugin-admin-notice-action'] != 'ps2id_plugin_admin_notice_dismiss_notice') {
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
|
16 |
+
$url = admin_url();
|
17 |
+
update_option('ps2id_plugin_admin_notice_dismiss_notice', 'true');
|
18 |
+
|
19 |
+
wp_redirect($url);
|
20 |
+
exit;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function admin_notice(){
|
24 |
+
if (get_option('ps2id_plugin_admin_notice_dismiss_notice', 'false') == 'true') {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
+
$dismiss_url = esc_url_raw(
|
29 |
+
add_query_arg(
|
30 |
+
array(
|
31 |
+
'ps2id-plugin-admin-notice-action' => 'ps2id_plugin_admin_notice_dismiss_notice'
|
32 |
+
),
|
33 |
+
admin_url()
|
34 |
+
)
|
35 |
+
);
|
36 |
+
$this->notice_css();
|
37 |
+
?>
|
38 |
+
<div id="ps2id-plugin-admin-notice" class="notice notice-info">
|
39 |
+
<p><span class="ps2id-admin-notice-title">Thank you for using <strong>Page scroll to id</strong>!</span>
|
40 |
+
<span class="br"></span>
|
41 |
+
For more information about using the plugin and its settings, visit <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/" target="_blank">plugin's homepage</a>, <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress-tutorial/" target="_blank">tutorial</a> and <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/2/" target="_blank">FAQ</a>.
|
42 |
+
<br />
|
43 |
+
If you need help, please use the <a href="https://wordpress.org/support/plugin/page-scroll-to-id/" target="_blank">support forum</a> or the <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#comments" target="_blank">comments system in plugin's homepage</a>. I'll be more than happy to assist you!
|
44 |
+
<span class="br"></span>
|
45 |
+
If you like the plugin and want to support my effort to provide it for free, please consider <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28" target="_blank">making a donation</a> <span class="smile">:-)</span>
|
46 |
+
<span class="br"></span>
|
47 |
+
<a href="<?php echo $dismiss_url; ?>"><?php _e('Dismiss this notice'); ?></a>
|
48 |
+
</p>
|
49 |
+
<a href="<?php echo $dismiss_url; ?>" class="notice-dismiss ps2id-plugin-admin-notice-dismiss" title="<?php _e('Dismiss this notice'); ?>">
|
50 |
+
<span class="screen-reader-text"><?php _e('Dismiss this notice'); ?>.</span>
|
51 |
+
</a>
|
52 |
+
</div>
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
|
56 |
+
public function notice_css(){
|
57 |
+
?>
|
58 |
+
<style type="text/css">
|
59 |
+
#ps2id-plugin-admin-notice{
|
60 |
+
position: relative;
|
61 |
+
padding-right: 48px;
|
62 |
+
}
|
63 |
+
.ps2id-admin-notice-title{
|
64 |
+
font-size: 14px;
|
65 |
+
margin-bottom: .2em;
|
66 |
+
}
|
67 |
+
.notice-dismiss.ps2id-plugin-admin-notice-dismiss{
|
68 |
+
text-decoration: none;
|
69 |
+
}
|
70 |
+
#ps2id-plugin-admin-notice .br{
|
71 |
+
display: block;
|
72 |
+
margin-bottom: .5em;
|
73 |
+
}
|
74 |
+
#ps2id-plugin-admin-notice .smile{
|
75 |
+
display: inline-block;
|
76 |
+
font-size: 125%;
|
77 |
+
margin-left: .25em;
|
78 |
+
transform: translateY(.05em);
|
79 |
+
}
|
80 |
+
</style>
|
81 |
+
<?php
|
82 |
+
}
|
83 |
+
|
84 |
+
public static function instance(){
|
85 |
+
static $instance = null;
|
86 |
+
|
87 |
+
if (is_null($instance)) {
|
88 |
+
$instance = new self();
|
89 |
+
}
|
90 |
+
|
91 |
+
return $instance;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
ps2id_Plugin_Admin_Notice::instance();
|
97 |
+
?>
|
includes/seo-admin-notice.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!class_exists('SEO_Admin_Notice')) {
|
3 |
-
|
4 |
-
class SEO_Admin_Notice{
|
5 |
-
public function __construct(){
|
6 |
-
add_action('admin_notices', array($this, 'admin_notice'));
|
7 |
-
add_action('network_admin_notices', array($this, 'admin_notice'));
|
8 |
-
add_action('admin_init', array($this, 'dismiss_admin_notice'));
|
9 |
-
}
|
10 |
-
|
11 |
-
public function dismiss_admin_notice(){
|
12 |
-
if (!isset($_GET['seo-adaction']) || $_GET['seo-adaction'] != 'seo_dismiss_adnotice') {
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
$url = admin_url();
|
17 |
-
update_option('seo_dismiss_adnotice', 'true');
|
18 |
-
|
19 |
-
wp_redirect($url);
|
20 |
-
exit;
|
21 |
-
}
|
22 |
-
|
23 |
-
public function admin_notice(){
|
24 |
-
if (get_option('seo_dismiss_adnotice', 'false') == 'true') {
|
25 |
-
return;
|
26 |
-
}
|
27 |
-
|
28 |
-
$dismiss_url = esc_url_raw(
|
29 |
-
add_query_arg(
|
30 |
-
array(
|
31 |
-
'seo-adaction' => 'seo_dismiss_adnotice'
|
32 |
-
),
|
33 |
-
admin_url()
|
34 |
-
)
|
35 |
-
);
|
36 |
-
$this->notice_css();
|
37 |
-
$learn_more_url = 'https://seobuddy.com/seo-checklist/pagescroll';
|
38 |
-
?>
|
39 |
-
<div id="ps2id-seo-admin-notice" class="notice notice-info">
|
40 |
-
<p>
|
41 |
-
Thank you for using Page Scroll to id! If you like our plugin and want to support our effort to provide it for free, we would also like to recommend this
|
42 |
-
<a href="<?php echo $learn_more_url; ?>" target="_blank"><strong class="em-text">102-Point SEO Checklist</strong></a>. It includes 42 step-by-step guides (SOPs) to every important SEO action you need to take to optimize your website and get more organic traffic. And using discount coupon <em>PAGESCROLL</em> you get a 25% off the original price!
|
43 |
-
<br />
|
44 |
-
<a href="<?php echo $learn_more_url; ?>" target="_blank" class="seo-checklist-learn-more">Learn more</a>
|
45 |
-
<a href="<?php echo $dismiss_url; ?>"><?php _e('Dismiss this notice'); ?></a>
|
46 |
-
</p>
|
47 |
-
<a href="<?php echo $learn_more_url; ?>" target="_blank" class="seo-checklist-logo" title="Learn more">
|
48 |
-
<img src="<?php echo plugins_url('the-seo-checklist-by-seo-buddy.png', __FILE__); ?>" />
|
49 |
-
</a>
|
50 |
-
<a href="<?php echo $dismiss_url; ?>" class="notice-dismiss seo-checklist-dismiss" title="<?php _e('Dismiss this notice'); ?>">
|
51 |
-
<span class="screen-reader-text"><?php _e('Dismiss this notice'); ?>.</span>
|
52 |
-
</a>
|
53 |
-
</div>
|
54 |
-
<?php
|
55 |
-
}
|
56 |
-
|
57 |
-
public function notice_css(){
|
58 |
-
?>
|
59 |
-
<style type="text/css">
|
60 |
-
#ps2id-seo-admin-notice{
|
61 |
-
position: relative;
|
62 |
-
padding-right: 48px;
|
63 |
-
}
|
64 |
-
.seo-checklist-learn-more{
|
65 |
-
margin-right: 1em;
|
66 |
-
}
|
67 |
-
.seo-checklist-logo{
|
68 |
-
display: block;
|
69 |
-
height: auto;
|
70 |
-
max-width: 100%;
|
71 |
-
}
|
72 |
-
.seo-checklist-logo img{
|
73 |
-
height: auto;
|
74 |
-
max-width: 100%;
|
75 |
-
}
|
76 |
-
.em-text{
|
77 |
-
font-weight: 400;
|
78 |
-
font-size: 110%;
|
79 |
-
}
|
80 |
-
.notice-dismiss.seo-checklist-dismiss{
|
81 |
-
text-decoration: none;
|
82 |
-
}
|
83 |
-
@media only screen and (min-width: 768px){
|
84 |
-
.seo-checklist-logo{
|
85 |
-
position: absolute;
|
86 |
-
top: 56%;
|
87 |
-
transform: translateY(-50%);
|
88 |
-
right: 48px;
|
89 |
-
}
|
90 |
-
#ps2id-seo-admin-notice > p{
|
91 |
-
margin-right: 350px;
|
92 |
-
}
|
93 |
-
}
|
94 |
-
@media only screen and (max-width: 767px){
|
95 |
-
#ps2id-seo-admin-notice > p{
|
96 |
-
margin-bottom: 1em;
|
97 |
-
}
|
98 |
-
}
|
99 |
-
</style>
|
100 |
-
<?php
|
101 |
-
}
|
102 |
-
|
103 |
-
public static function instance(){
|
104 |
-
static $instance = null;
|
105 |
-
|
106 |
-
if (is_null($instance)) {
|
107 |
-
$instance = new self();
|
108 |
-
}
|
109 |
-
|
110 |
-
return $instance;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
SEO_Admin_Notice::instance();
|
116 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/seo-checklist-illustration-3-opt.png
DELETED
Binary file
|
includes/the-seo-checklist-by-seo-buddy.png
DELETED
Binary file
|
js/admin.js
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
|
30 |
$(".js .wrap form").css({"opacity":1});
|
31 |
|
32 |
-
$(".repeatable-add").click
|
33 |
e.preventDefault();
|
34 |
var repeatable=loc=$(adminID+" .repeatable:last"),cloned;
|
35 |
if(repeatable.length>0){
|
@@ -59,16 +59,16 @@
|
|
59 |
}
|
60 |
});
|
61 |
|
62 |
-
$("body").
|
63 |
$(this).sortable("refresh");
|
64 |
-
}).
|
65 |
e.preventDefault();
|
66 |
if(!$(this).hasClass("remove-disabled")){
|
67 |
$(this).parent().parent().parent(".repeatable").remove();
|
68 |
totalInstances.val(parseInt(totalInstances.val())-1);
|
69 |
setRepeatable();
|
70 |
}
|
71 |
-
}).
|
72 |
e.preventDefault();
|
73 |
var $this=$(this);
|
74 |
$this.parent().toggleClass("closed");
|
@@ -81,7 +81,7 @@
|
|
81 |
}
|
82 |
}
|
83 |
|
84 |
-
$(".reset-to-default").click
|
85 |
e.preventDefault();
|
86 |
resetField.val("true");
|
87 |
$("#submit").attr({"id":"none","name":"none"});
|
@@ -174,32 +174,32 @@
|
|
174 |
}
|
175 |
}
|
176 |
|
177 |
-
$(".mPS2id-show-option-common-values").click
|
178 |
e.preventDefault();
|
179 |
$(this).next("span").toggleClass("mPS2id-show");
|
180 |
});
|
181 |
|
182 |
-
$(".mPS2id-open-help").click
|
183 |
e.preventDefault();
|
184 |
openHelp();
|
185 |
});
|
186 |
|
187 |
-
$(".mPS2id-open-help-overview").click
|
188 |
e.preventDefault();
|
189 |
openHelp("overview");
|
190 |
});
|
191 |
|
192 |
-
$(".mPS2id-open-help-get-started").click
|
193 |
e.preventDefault();
|
194 |
openHelp("get-started");
|
195 |
});
|
196 |
|
197 |
-
$(".mPS2id-open-help-plugin-settings").click
|
198 |
e.preventDefault();
|
199 |
openHelp("plugin-settings");
|
200 |
});
|
201 |
|
202 |
-
$(".mPS2id-open-help-shortcodes").click
|
203 |
e.preventDefault();
|
204 |
openHelp("shortcodes");
|
205 |
});
|
29 |
|
30 |
$(".js .wrap form").css({"opacity":1});
|
31 |
|
32 |
+
$(".repeatable-add").on("click",function(e){
|
33 |
e.preventDefault();
|
34 |
var repeatable=loc=$(adminID+" .repeatable:last"),cloned;
|
35 |
if(repeatable.length>0){
|
59 |
}
|
60 |
});
|
61 |
|
62 |
+
$("body").on("click",".repeatable-group",function(){
|
63 |
$(this).sortable("refresh");
|
64 |
+
}).on("click",".repeatable-remove",function(e){
|
65 |
e.preventDefault();
|
66 |
if(!$(this).hasClass("remove-disabled")){
|
67 |
$(this).parent().parent().parent(".repeatable").remove();
|
68 |
totalInstances.val(parseInt(totalInstances.val())-1);
|
69 |
setRepeatable();
|
70 |
}
|
71 |
+
}).on("click",".handlediv",function(e){
|
72 |
e.preventDefault();
|
73 |
var $this=$(this);
|
74 |
$this.parent().toggleClass("closed");
|
81 |
}
|
82 |
}
|
83 |
|
84 |
+
$(".reset-to-default").on("click",function(e){
|
85 |
e.preventDefault();
|
86 |
resetField.val("true");
|
87 |
$("#submit").attr({"id":"none","name":"none"});
|
174 |
}
|
175 |
}
|
176 |
|
177 |
+
$(".mPS2id-show-option-common-values").on("click",function(e){
|
178 |
e.preventDefault();
|
179 |
$(this).next("span").toggleClass("mPS2id-show");
|
180 |
});
|
181 |
|
182 |
+
$(".mPS2id-open-help").on("click",function(e){
|
183 |
e.preventDefault();
|
184 |
openHelp();
|
185 |
});
|
186 |
|
187 |
+
$(".mPS2id-open-help-overview").on("click",function(e){
|
188 |
e.preventDefault();
|
189 |
openHelp("overview");
|
190 |
});
|
191 |
|
192 |
+
$(".mPS2id-open-help-get-started").on("click",function(e){
|
193 |
e.preventDefault();
|
194 |
openHelp("get-started");
|
195 |
});
|
196 |
|
197 |
+
$(".mPS2id-open-help-plugin-settings").on("click",function(e){
|
198 |
e.preventDefault();
|
199 |
openHelp("plugin-settings");
|
200 |
});
|
201 |
|
202 |
+
$(".mPS2id-open-help-shortcodes").on("click",function(e){
|
203 |
e.preventDefault();
|
204 |
openHelp("shortcodes");
|
205 |
});
|
js/jquery.malihu.PageScroll2id-init.js
CHANGED
@@ -4,9 +4,15 @@
|
|
4 |
shortcodeClass=_o.shortcode_class, //shortcode without suffix
|
5 |
_hash=location.hash || null,
|
6 |
_targetPosition,
|
|
|
7 |
_validateLocHash=function(val,forAll){
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
10 |
},
|
11 |
_offset=function(val){
|
12 |
if(val.indexOf(",")!==-1){
|
@@ -189,7 +195,7 @@
|
|
189 |
}
|
190 |
}
|
191 |
//attempt to unbind click events from other scripts
|
192 |
-
if(_o.instances[_p+"_instance_"+i]["unbindUnrelatedClickEvents"]==="true"){
|
193 |
setTimeout(function(){
|
194 |
var $events=sel.length ? $._data(sel[0],"events") : null,
|
195 |
$docEvents=sel.length ? $._data($(document)[0],"events") : null;
|
@@ -217,20 +223,20 @@
|
|
217 |
}
|
218 |
});
|
219 |
//extend jQuery's selectors
|
220 |
-
$.extend($.expr
|
221 |
//position based - e.g. :fixed
|
222 |
-
absolute:$.expr
|
223 |
-
relative:$.expr
|
224 |
-
static:$.expr
|
225 |
-
fixed:$.expr
|
226 |
//width based - e.g. :width(200), :width(>200), :width(>200):width(<300) etc.
|
227 |
-
width:$.expr
|
228 |
var val=m[3].replace("<","<").replace(">",">");
|
229 |
if(!val){return false;}
|
230 |
return val.substr(0,1)===">" ? $(a).width()>val.substr(1) : val.substr(0,1)==="<" ? $(a).width()<val.substr(1) : $(a).width()===parseInt(val);
|
231 |
},
|
232 |
//height based - e.g. :height(200), :height(>200), :height(>200):height(<300) etc.
|
233 |
-
height:$.expr
|
234 |
var val=m[3].replace("<","<").replace(">",">");
|
235 |
if(!val){return false;}
|
236 |
return val.substr(0,1)===">" ? $(a).height()>val.substr(1) : val.substr(0,1)==="<" ? $(a).height()<val.substr(1) : $(a).height()===parseInt(val);
|
4 |
shortcodeClass=_o.shortcode_class, //shortcode without suffix
|
5 |
_hash=location.hash || null,
|
6 |
_targetPosition,
|
7 |
+
specialChars=/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,
|
8 |
_validateLocHash=function(val,forAll){
|
9 |
+
var _id=val.substring(val.indexOf('#')+1);
|
10 |
+
try{ //avoid js errors on invalid selectors
|
11 |
+
var $val=specialChars.test(_id) ? $(document.getElementById(_id)) : $("#"+_id);
|
12 |
+
}catch(error){
|
13 |
+
return false;
|
14 |
+
}
|
15 |
+
return (specialChars.test(_id) ? $(document.getElementById(_id)) : $("#"+_id)).length && (forAll || $("a[href*='#"+_id+"']").filter(function(){return $(this).data(_p+"Element")==true}).length);
|
16 |
},
|
17 |
_offset=function(val){
|
18 |
if(val.indexOf(",")!==-1){
|
195 |
}
|
196 |
}
|
197 |
//attempt to unbind click events from other scripts
|
198 |
+
if(_o.instances[_p+"_instance_"+i]["unbindUnrelatedClickEvents"]==="true" && !_o.instances[_p+"_instance_"+i]["unbindUnrelatedClickEventsSelector"]){
|
199 |
setTimeout(function(){
|
200 |
var $events=sel.length ? $._data(sel[0],"events") : null,
|
201 |
$docEvents=sel.length ? $._data($(document)[0],"events") : null;
|
223 |
}
|
224 |
});
|
225 |
//extend jQuery's selectors
|
226 |
+
$.extend($.expr.pseudos,{
|
227 |
//position based - e.g. :fixed
|
228 |
+
absolute:$.expr.pseudos.absolute || function(el){return $(el).css("position")==="absolute";},
|
229 |
+
relative:$.expr.pseudos.relative || function(el){return $(el).css("position")==="relative";},
|
230 |
+
static:$.expr.pseudos.static || function(el){return $(el).css("position")==="static";},
|
231 |
+
fixed:$.expr.pseudos.fixed || function(el){return $(el).css("position")==="fixed";},
|
232 |
//width based - e.g. :width(200), :width(>200), :width(>200):width(<300) etc.
|
233 |
+
width:$.expr.pseudos.width || function(a,i,m){
|
234 |
var val=m[3].replace("<","<").replace(">",">");
|
235 |
if(!val){return false;}
|
236 |
return val.substr(0,1)===">" ? $(a).width()>val.substr(1) : val.substr(0,1)==="<" ? $(a).width()<val.substr(1) : $(a).width()===parseInt(val);
|
237 |
},
|
238 |
//height based - e.g. :height(200), :height(>200), :height(>200):height(<300) etc.
|
239 |
+
height:$.expr.pseudos.height || function(a,i,m){
|
240 |
var val=m[3].replace("<","<").replace(">",">");
|
241 |
if(!val){return false;}
|
242 |
return val.substr(0,1)===">" ? $(a).height()>val.substr(1) : val.substr(0,1)==="<" ? $(a).height()<val.substr(1) : $(a).height()===parseInt(val);
|
js/jquery.malihu.PageScroll2id-unbind-defer.js
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($){
|
2 |
+
var _unbindUnrelatedClickEvents=function(evt,s){
|
3 |
+
for(var i=evt.click.length-1; i>=0; i--){
|
4 |
+
var handler=evt.click[i];
|
5 |
+
if(handler && handler.namespace != "mPS2id"){
|
6 |
+
if(handler.selector==='a[href*=#]'){
|
7 |
+
handler.selector='a[href*=#]:not(._mPS2id-h)';
|
8 |
+
}else if(handler.selector==='a[href*="#"]'){
|
9 |
+
handler.selector='a[href*="#"]:not(._mPS2id-h)';
|
10 |
+
}else if(handler.selector==='a[href*=#]:not([href=#])'){
|
11 |
+
handler.selector='a[href*=#]:not([href=#]):not(._mPS2id-h)';
|
12 |
+
}else if(handler.selector==='a[href*="#"]:not([href="#"])'){
|
13 |
+
handler.selector='a[href*="#"]:not([href="#"]):not(._mPS2id-h)';
|
14 |
+
}else if(handler.selector && handler.selector.indexOf("mobmenu")!==-1){
|
15 |
+
//special cases
|
16 |
+
s.off("click");
|
17 |
+
}else{
|
18 |
+
s.off("click",handler.handler);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
};
|
23 |
+
$(window).on("load",function(){ //win load
|
24 |
+
var selOpt=mPS2id_unbindScriptParams.unbindSelector,
|
25 |
+
sel=$(selOpt);
|
26 |
+
if(selOpt && sel.length){
|
27 |
+
setTimeout(function(){
|
28 |
+
var $events=sel.length ? $._data(sel[0],"events") : null,
|
29 |
+
$docEvents=sel.length ? $._data($(document)[0],"events") : null;
|
30 |
+
if($events) _unbindUnrelatedClickEvents($events,sel);
|
31 |
+
if($docEvents) _unbindUnrelatedClickEvents($docEvents,sel);
|
32 |
+
},300);
|
33 |
+
}
|
34 |
+
});
|
35 |
+
})(jQuery);
|
js/jquery.malihu.PageScroll2id.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/*
|
2 |
== Page scroll to id ==
|
3 |
-
Version: 1.6.
|
4 |
Plugin URI: http://manos.malihu.gr/page-scroll-to-id/
|
5 |
Author: malihu
|
6 |
Author URI: http://manos.malihu.gr
|
@@ -89,12 +89,15 @@ THE SOFTWARE.
|
|
89 |
/* set specific selector(s) that will be excluded from being handled by the plugin: String */
|
90 |
excludeSelectors:false,
|
91 |
/* enable encodeURI for links (enable if your links have href values with UTF-8 encoding): boolean */
|
92 |
-
encodeLinks:false
|
|
|
|
|
93 |
},
|
94 |
|
95 |
/* vars, constants */
|
96 |
|
97 |
selector,opt,_init,_trigger,_clicked,_target,_to,_axis,_offset,_dataOffset,_totalInstances=0,_liveTimer,_speed,
|
|
|
98 |
|
99 |
/*
|
100 |
---------------
|
@@ -146,9 +149,9 @@ THE SOFTWARE.
|
|
146 |
if(opt.clickEvents){
|
147 |
$(document)
|
148 |
|
149 |
-
.
|
150 |
|
151 |
-
.
|
152 |
if(functions._isDisabled.call(null)){
|
153 |
functions._removeClasses.call(null);
|
154 |
return;
|
@@ -176,9 +179,9 @@ THE SOFTWARE.
|
|
176 |
|
177 |
$(window)
|
178 |
|
179 |
-
.
|
180 |
|
181 |
-
.
|
182 |
if(functions._isDisabled.call(null)){
|
183 |
functions._removeClasses.call(null);
|
184 |
return;
|
@@ -241,8 +244,8 @@ THE SOFTWARE.
|
|
241 |
/* destroy method */
|
242 |
|
243 |
destroy:function(){
|
244 |
-
$(window).
|
245 |
-
$(document).
|
246 |
$("._"+pluginPfx+"-t").removeData(pluginPfx);
|
247 |
functions._removeClasses.call(null,true);
|
248 |
}
|
@@ -276,7 +279,7 @@ THE SOFTWARE.
|
|
276 |
}
|
277 |
hrefProp=(!hrefProp) ? href : hrefProp;
|
278 |
var str=(hrefProp.indexOf("#/")!==-1) ? hrefProp.split("#/")[0] : hrefProp.split("#")[0],
|
279 |
-
wloc
|
280 |
loc=wloc.toString().split("#")[0];
|
281 |
return href!=="#" && href.indexOf("#")!==-1 && (str==="" || decodeURIComponent(str)===decodeURIComponent(loc));
|
282 |
},
|
@@ -291,8 +294,8 @@ THE SOFTWARE.
|
|
291 |
if(opt.excludeSelectors && $this.is(opt.excludeSelectors)){ //excluded selectors
|
292 |
return;
|
293 |
}
|
294 |
-
var id=(href.indexOf("#/")!==-1) ? href.split("#/")[1] : href.split("#")[1]
|
295 |
-
t=
|
296 |
if(t.length>0){
|
297 |
if(opt.highlightByNextTarget){
|
298 |
if(t!==tp){
|
@@ -326,8 +329,8 @@ THE SOFTWARE.
|
|
326 |
/* finds the target element */
|
327 |
|
328 |
_findTarget:function(str){
|
329 |
-
var val=(str.indexOf("#/")!==-1) ? str.split("#/")[1] : str.split("#")[1]
|
330 |
-
el=
|
331 |
if(el.length<1 || el.css("position")==="fixed"){
|
332 |
if(val==="top"){
|
333 |
el=$("body");
|
@@ -400,7 +403,7 @@ THE SOFTWARE.
|
|
400 |
/* finds the element that should be highlighted */
|
401 |
|
402 |
_findHighlight:function(id){
|
403 |
-
var wLoc
|
404 |
loc=wLoc.toString().split("#")[0],
|
405 |
locPath=wLoc.pathname;
|
406 |
if(loc.indexOf("'")!==-1) loc=loc.replace("'","\\'");
|
@@ -611,7 +614,7 @@ THE SOFTWARE.
|
|
611 |
case "onStart":
|
612 |
//append hash to URL/address bar
|
613 |
if(opt.appendHash && window.history && window.history.pushState && _clicked && _clicked.length){
|
614 |
-
var
|
615 |
if(h!==window.location.hash) history.pushState("","",h);
|
616 |
}
|
617 |
opt.onStart.call(null,this[pluginPfx]);
|
1 |
/*
|
2 |
== Page scroll to id ==
|
3 |
+
Version: 1.6.8
|
4 |
Plugin URI: http://manos.malihu.gr/page-scroll-to-id/
|
5 |
Author: malihu
|
6 |
Author URI: http://manos.malihu.gr
|
89 |
/* set specific selector(s) that will be excluded from being handled by the plugin: String */
|
90 |
excludeSelectors:false,
|
91 |
/* enable encodeURI for links (enable if your links have href values with UTF-8 encoding): boolean */
|
92 |
+
encodeLinks:false,
|
93 |
+
/* enable to run the script inside iframe */
|
94 |
+
inIframe:false
|
95 |
},
|
96 |
|
97 |
/* vars, constants */
|
98 |
|
99 |
selector,opt,_init,_trigger,_clicked,_target,_to,_axis,_offset,_dataOffset,_totalInstances=0,_liveTimer,_speed,
|
100 |
+
specialChars=/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,
|
101 |
|
102 |
/*
|
103 |
---------------
|
149 |
if(opt.clickEvents){
|
150 |
$(document)
|
151 |
|
152 |
+
.off("."+pluginPfx)
|
153 |
|
154 |
+
.on("click."+pluginPfx,selector,function(e){
|
155 |
if(functions._isDisabled.call(null)){
|
156 |
functions._removeClasses.call(null);
|
157 |
return;
|
179 |
|
180 |
$(window)
|
181 |
|
182 |
+
.off("."+pluginPfx)
|
183 |
|
184 |
+
.on("scroll."+pluginPfx+" resize."+pluginPfx,function(){
|
185 |
if(functions._isDisabled.call(null)){
|
186 |
functions._removeClasses.call(null);
|
187 |
return;
|
244 |
/* destroy method */
|
245 |
|
246 |
destroy:function(){
|
247 |
+
$(window).off("."+pluginPfx);
|
248 |
+
$(document).off("."+pluginPfx).removeData(pluginPfx);
|
249 |
$("._"+pluginPfx+"-t").removeData(pluginPfx);
|
250 |
functions._removeClasses.call(null,true);
|
251 |
}
|
279 |
}
|
280 |
hrefProp=(!hrefProp) ? href : hrefProp;
|
281 |
var str=(hrefProp.indexOf("#/")!==-1) ? hrefProp.split("#/")[0] : hrefProp.split("#")[0],
|
282 |
+
wloc=!opt.inIframe && window.location !== window.parent.location ? window.parent.location : window.location,
|
283 |
loc=wloc.toString().split("#")[0];
|
284 |
return href!=="#" && href.indexOf("#")!==-1 && (str==="" || decodeURIComponent(str)===decodeURIComponent(loc));
|
285 |
},
|
294 |
if(opt.excludeSelectors && $this.is(opt.excludeSelectors)){ //excluded selectors
|
295 |
return;
|
296 |
}
|
297 |
+
var id=(href.indexOf("#/")!==-1) ? href.split("#/")[1] : href.substring(href.indexOf('#')+1), //we're not using str.split("#")[1] because we want only the first occurrence of # in case the id has # in its actual name
|
298 |
+
t=specialChars.test(id) ? $(document.getElementById(id)) : $("#"+id); //fix bug with special characters like %, ?, & etc. in selector
|
299 |
if(t.length>0){
|
300 |
if(opt.highlightByNextTarget){
|
301 |
if(t!==tp){
|
329 |
/* finds the target element */
|
330 |
|
331 |
_findTarget:function(str){
|
332 |
+
var val=(str.indexOf("#/")!==-1) ? str.split("#/")[1] : str.substring(str.indexOf('#')+1), //we're not using str.split("#")[1] because we want only the first occurrence of # in case the id has # in its actual name
|
333 |
+
el=specialChars.test(val) ? $(document.getElementById(val)) : $("#"+val); //fix bug with special characters like %, ?, & etc. in selector
|
334 |
if(el.length<1 || el.css("position")==="fixed"){
|
335 |
if(val==="top"){
|
336 |
el=$("body");
|
403 |
/* finds the element that should be highlighted */
|
404 |
|
405 |
_findHighlight:function(id){
|
406 |
+
var wLoc=!opt.inIframe && window.location !== window.parent.location ? window.parent.location : window.location,
|
407 |
loc=wLoc.toString().split("#")[0],
|
408 |
locPath=wLoc.pathname;
|
409 |
if(loc.indexOf("'")!==-1) loc=loc.replace("'","\\'");
|
614 |
case "onStart":
|
615 |
//append hash to URL/address bar
|
616 |
if(opt.appendHash && window.history && window.history.pushState && _clicked && _clicked.length){
|
617 |
+
var hval=_clicked.attr("href"),h="#"+(hval.substring(hval.indexOf('#')+1)); //we're not using hval.split("#")[1] because we want only the first occurrence of # in case the id has # in its actual name
|
618 |
if(h!==window.location.hash) history.pushState("","",h);
|
619 |
}
|
620 |
opt.onStart.call(null,this[pluginPfx]);
|
js/page-scroll-to-id.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
/* Page scroll to id - version 1.7.
|
2 |
-
!function(v,M,c,e){var n,x,s,a,l,i,o,r,u,h,t,d,p="mPageScroll2id",b="mPS2id",g={scrollSpeed:1e3,autoScrollSpeed:!0,scrollEasing:"easeInOutQuint",scrollingEasing:"easeOutQuint",pageEndSmoothScroll:!0,layout:"vertical",offset:0,highlightSelector:!1,clickedClass:b+"-clicked",targetClass:b+"-target",highlightClass:b+"-highlight",forceSingleHighlight:!1,keepHighlightUntilNext:!1,highlightByNextTarget:!1,disablePluginBelow:!1,clickEvents:!0,appendHash:!1,onStart:function(){},onComplete:function(){},defaultSelector:!1,live:!0,liveSelector:!1,excludeSelectors:!1,encodeLinks:!1},f=0,_={init:function(e){e=v.extend(!0,{},g,e);if(v(c).data(b,e),x=v(c).data(b),!this.selector){var t="__"+b;this.each(function(){var e=v(this);e.hasClass(t)||e.addClass(t)}),this.selector="."+t}x.liveSelector&&(this.selector+=","+x.liveSelector),n=n?n+","+this.selector:this.selector,x.defaultSelector&&("object"==typeof v(n)&&0!==v(n).length||(n=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id'],._ps2id")),x.clickEvents&&v(c).undelegate("."+b).delegate(n,"click."+b,function(e){if(w._isDisabled.call(null))w._removeClasses.call(null);else{var t=v(this),n=t.attr("href"),s=t.prop("href").baseVal||t.prop("href");x.excludeSelectors&&t.is(x.excludeSelectors)||n&&-1!==n.indexOf("#/")||(w._reset.call(null),h=t.data("ps2id-offset")||0,w._isValid.call(null,n,s)&&w._findTarget.call(null,n)&&(e.preventDefault(),a="selector",l=t,w._setClasses.call(null,!0),w._scrollTo.call(null)))}}),v(M).unbind("."+b).bind("scroll."+b+" resize."+b,function(){if(w._isDisabled.call(null))w._removeClasses.call(null);else{var a=v("._"+b+"-t");a.each(function(e){var t=v(this),n=t.attr("id"),s=w._findHighlight.call(null,n);w._setClasses.call(null,!1,t,s),e==a.length-1&&w._extendClasses.call(null)})}}),s=!0,w._setup.call(null),w._live.call(null)},scrollTo:function(e,t){if(w._isDisabled.call(null))w._removeClasses.call(null);else if(e&&void 0!==e){w._isInit.call(null);var n={layout:x.layout,offset:x.offset,clicked:!1};t=v.extend(!0,{},n,t);w._reset.call(null),r=t.layout,u=t.offset,e=-1!==e.indexOf("#")?e:"#"+e,w._isValid.call(null,e)&&w._findTarget.call(null,e)&&(a="scrollTo",(l=t.clicked)&&w._setClasses.call(null,!0),w._scrollTo.call(null))}},destroy:function(){v(M).unbind("."+b),v(c).undelegate("."+b).removeData(b),v("._"+b+"-t").removeData(b),w._removeClasses.call(null,!0)}},w={_isDisabled:function(){var e=M,t="inner",n=x.disablePluginBelow instanceof Array?[x.disablePluginBelow[0]||0,x.disablePluginBelow[1]||0]:[x.disablePluginBelow||0,0];return"innerWidth"in M||(t="client",e=c.documentElement||c.body),e[t+"Width"]<=n[0]||e[t+"Height"]<=n[1]},_isValid:function(e,t){if(e){var n=-1!==(t=t||e).indexOf("#/")?t.split("#/")[0]:t.split("#")[0],s=(M.location!==M.parent.location?M.parent.location:M.location).toString().split("#")[0];return"#"!==e&&-1!==e.indexOf("#")&&(""===n||decodeURIComponent(n)===decodeURIComponent(s))}},_setup:function(){var l=w._highlightSelector(),o=1,r=0;return v(l).each(function(){var e=v(this),t=e.attr("href"),n=e.prop("href").baseVal||e.prop("href");if(w._isValid.call(null,t,n)){if(x.excludeSelectors&&e.is(x.excludeSelectors))return;var s=-1!==t.indexOf("#/")?t.split("#/")[1]:t.split("#")[1],a=-1!==s.indexOf("%")?v(c.getElementById(s)):v("#"+s);if(0<a.length){x.highlightByNextTarget&&a!==r&&(r?r.data(b,{tn:a}):a.data(b,{tn:"0"}),r=a),a.hasClass("_"+b+"-t")||a.addClass("_"+b+"-t"),a.data(b,{i:o}),e.hasClass("_"+b+"-h")||e.addClass("_"+b+"-h");var i=w._findHighlight.call(null,s);w._setClasses.call(null,!1,a,i),f=o,++o==v(l).length&&w._extendClasses.call(null)}}})},_highlightSelector:function(){return x.highlightSelector&&""!==x.highlightSelector?x.highlightSelector:n},_findTarget:function(e){var t=-1!==e.indexOf("#/")?e.split("#/")[1]:e.split("#")[1],n=-1!==t.indexOf("%")?v(c.getElementById(t)):v("#"+t);if(n.length<1||"fixed"===n.css("position")){if("top"!==t)return;n=v("body")}return i=n,r||(r=x.layout),u=w._setOffset.call(null),(o=[(n.offset().top-u[0]).toString(),(n.offset().left-u[1]).toString()])[0]=o[0]<0?0:o[0],o[1]=o[1]<0?0:o[1],o},_setOffset:function(){var e,t,n,s;switch(u||(u=x.offset?x.offset:0),h&&(u=h),typeof u){case"object":case"string":0<(t=[(e=[u.y?u.y:u,u.x?u.x:u])[0]instanceof jQuery?e[0]:v(e[0]),e[1]instanceof jQuery?e[1]:v(e[1])])[0].length?(n=t[0].height(),"fixed"===t[0].css("position")&&(n+=t[0][0].offsetTop)):n=!isNaN(parseFloat(e[0]))&&isFinite(e[0])?parseInt(e[0]):0,0<t[1].length?(s=t[1].width(),"fixed"===t[1].css("position")&&(s+=t[1][0].offsetLeft)):s=!isNaN(parseFloat(e[1]))&&isFinite(e[1])?parseInt(e[1]):0;break;case"function":(e=u.call(null))instanceof Array?(n=e[0],s=e[1]):n=s=e;break;default:n=s=parseInt(u)}return[n,s]},_findHighlight:function(e){var t=M.location!==M.parent.location?M.parent.location:M.location,n=t.toString().split("#")[0],s=t.pathname;if(-1!==n.indexOf("'")&&(n=n.replace("'","\\'")),-1!==s.indexOf("'")&&(s=s.replace("'","\\'")),n=decodeURIComponent(n),s=decodeURIComponent(s),x.encodeLinks){var a=encodeURI(n).toLowerCase(),i=encodeURI(s).toLowerCase();return v("._"+b+"-h[href='#"+e+"'],._"+b+"-h[href='"+n+"#"+e+"'],._"+b+"-h[href='"+s+"#"+e+"'],._"+b+"-h[href='#/"+e+"'],._"+b+"-h[href='"+n+"#/"+e+"'],._"+b+"-h[href='"+s+"#/"+e+"'],._"+b+"-h[href='"+a+"#/"+e+"'],._"+b+"-h[href='"+a+"#"+e+"'],._"+b+"-h[href='"+i+"#/"+e+"'],._"+b+"-h[href='"+i+"#"+e+"']")}return v("._"+b+"-h[href='#"+e+"'],._"+b+"-h[href='"+n+"#"+e+"'],._"+b+"-h[href='"+s+"#"+e+"'],._"+b+"-h[href='#/"+e+"'],._"+b+"-h[href='"+n+"#/"+e+"'],._"+b+"-h[href='"+s+"#/"+e+"']")},_setClasses:function(e,t,n){var s=x.clickedClass,a=x.targetClass,i=x.highlightClass;e&&s&&""!==s?(v("."+s).removeClass(s),l.addClass(s)):t&&a&&""!==a&&n&&i&&""!==i&&(w._currentTarget.call(null,t)?(t.addClass(a),n.addClass(i)):(!x.keepHighlightUntilNext||1<v("."+i).length)&&(t.removeClass(a),n.removeClass(i)))},_extendClasses:function(){var e=x.targetClass,t=x.highlightClass,n=v("."+e),s=v("."+t),a=e+"-first",i=e+"-last",l=t+"-first",o=t+"-last";v("._"+b+"-t").removeClass(a+" "+i),v("._"+b+"-h").removeClass(l+" "+o),x.forceSingleHighlight?x.keepHighlightUntilNext&&1<n.length?(n.slice(0,1).removeClass(e),s.slice(0,1).removeClass(t)):(n.slice(1).removeClass(e),s.slice(1).removeClass(t)):(n.slice(0,1).addClass(a).end().slice(-1).addClass(i),s.slice(0,1).addClass(l).end().slice(-1).addClass(o))},_removeClasses:function(e){v("."+x.clickedClass).removeClass(x.clickedClass),v("."+x.targetClass).removeClass(x.targetClass+" "+x.targetClass+"-first "+x.targetClass+"-last"),v("."+x.highlightClass).removeClass(x.highlightClass+" "+x.highlightClass+"-first "+x.highlightClass+"-last"),e&&(v("._"+b+"-t").removeClass("_"+b+"-t"),v("._"+b+"-h").removeClass("_"+b+"-h"))},_currentTarget:function(e){if(e.data(b)){var t=x["target_"+e.data(b).i],n=e.data("ps2id-target"),s=n&&v(n)[0]?v(n)[0].getBoundingClientRect():e[0].getBoundingClientRect();if(void 0!==t){var a=e.offset().top,i=e.offset().left,l=t.from?t.from+a:a,o=t.to?t.to+a:a,r=t.fromX?t.fromX+i:i,c=t.toX?t.toX+i:i;return s.top>=o&&s.top<=l&&s.left>=c&&s.left<=r}var u=v(M).height(),h=v(M).width(),d=n?v(n).height():e.height(),p=n?v(n).width():e.width(),g=1+d/u,f=g,_=d<u?g*(u/d):g,w=1+p/h,S=w,m=p<h?w*(h/p):w,I=[s.top<=u/f,s.bottom>=u/_,s.left<=h/S,s.right>=h/m];if(x.highlightByNextTarget){var C=e.data(b).tn;if(C){var O=C[0].getBoundingClientRect();"vertical"===x.layout?I=[s.top<=u/2,O.top>u/2,1,1]:"horizontal"===x.layout&&(I=[1,1,s.left<=h/2,O.left>h/2])}}return I[0]&&I[1]&&I[2]&&I[3]}},_scrollTo:function(){d=w._scrollSpeed.call(null),o=x.pageEndSmoothScroll?w._pageEndSmoothScroll.call(null):o;var e=v("html,body"),t=x.autoScrollSpeed?w._autoScrollSpeed.call(null):d,n=e.is(":animated")?x.scrollingEasing:x.scrollEasing,s=v(M).scrollTop(),a=v(M).scrollLeft();switch(r){case"horizontal":a!=o[1]&&(w._callbacks.call(null,"onStart"),e.stop().animate({scrollLeft:o[1]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")}));break;case"auto":var i;if(s!=o[0]||a!=o[1])if(w._callbacks.call(null,"onStart"),navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/))e.stop().animate({pageYOffset:o[0],pageXOffset:o[1]},{duration:t,easing:n,step:function(e,t){"pageXOffset"==t.prop?i=e:"pageYOffset"==t.prop&&M.scrollTo(i,e)}}).promise().then(function(){w._callbacks.call(null,"onComplete")});else e.stop().animate({scrollTop:o[0],scrollLeft:o[1]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")});break;default:s!=o[0]&&(w._callbacks.call(null,"onStart"),e.stop().animate({scrollTop:o[0]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")}))}},_pageEndSmoothScroll:function(){var e=v(c).height(),t=v(c).width(),n=v(M).height(),s=v(M).width();return[e-o[0]<n?e-n:o[0],t-o[1]<s?t-s:o[1]]},_scrollSpeed:function(){var s=x.scrollSpeed;return l&&l.length&&l.add(l.parent()).each(function(){var e=v(this);if(e.attr("class")){var t=e.attr("class").split(" ");for(var n in t)if(String(t[n]).match(/^ps2id-speed-\d+$/)){s=t[n].split("ps2id-speed-")[1];break}}}),parseInt(s)},_autoScrollSpeed:function(){var e=v(M).scrollTop(),t=v(M).scrollLeft(),n=v(c).height(),s=v(c).width(),a=[d+d*Math.floor(Math.abs(o[0]-e)/n*100)/100,d+d*Math.floor(Math.abs(o[1]-t)/s*100)/100];return Math.max.apply(Math,a)},_callbacks:function(e){if(x)switch(this[b]={trigger:a,clicked:l,target:i,scrollTo:{y:o[0],x:o[1]}},e){case"onStart":if(x.appendHash&&M.history&&M.history.pushState&&l&&l.length){var t="#"+l.attr("href").split("#")[1];t!==M.location.hash&&history.pushState("","",t)}x.onStart.call(null,this[b]);break;case"onComplete":x.onComplete.call(null,this[b])}},_reset:function(){r=u=h=!1},_isInit:function(){s||_.init.apply(this)},_live:function(){t=setTimeout(function(){x.live?v(w._highlightSelector()).length!==f&&w._setup.call(null):t&&clearTimeout(t),w._live.call(null)},1e3)},_easing:function(){function t(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}v.easing.easeInQuad=v.easing.easeInQuad||function(e){return e*e},v.easing.easeOutQuad=v.easing.easeOutQuad||function(e){return 1-(1-e)*(1-e)},v.easing.easeInOutQuad=v.easing.easeInOutQuad||function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},v.easing.easeInCubic=v.easing.easeInCubic||function(e){return e*e*e},v.easing.easeOutCubic=v.easing.easeOutCubic||function(e){return 1-Math.pow(1-e,3)},v.easing.easeInOutCubic=v.easing.easeInOutCubic||function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},v.easing.easeInQuart=v.easing.easeInQuart||function(e){return e*e*e*e},v.easing.easeOutQuart=v.easing.easeOutQuart||function(e){return 1-Math.pow(1-e,4)},v.easing.easeInOutQuart=v.easing.easeInOutQuart||function(e){return e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2},v.easing.easeInQuint=v.easing.easeInQuint||function(e){return e*e*e*e*e},v.easing.easeOutQuint=v.easing.easeOutQuint||function(e){return 1-Math.pow(1-e,5)},v.easing.easeInOutQuint=v.easing.easeInOutQuint||function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2},v.easing.easeInExpo=v.easing.easeInExpo||function(e){return 0===e?0:Math.pow(2,10*e-10)},v.easing.easeOutExpo=v.easing.easeOutExpo||function(e){return 1===e?1:1-Math.pow(2,-10*e)},v.easing.easeInOutExpo=v.easing.easeInOutExpo||function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},v.easing.easeInSine=v.easing.easeInSine||function(e){return 1-Math.cos(e*Math.PI/2)},v.easing.easeOutSine=v.easing.easeOutSine||function(e){return Math.sin(e*Math.PI/2)},v.easing.easeInOutSine=v.easing.easeInOutSine||function(e){return-(Math.cos(Math.PI*e)-1)/2},v.easing.easeInCirc=v.easing.easeInCirc||function(e){return 1-Math.sqrt(1-Math.pow(e,2))},v.easing.easeOutCirc=v.easing.easeOutCirc||function(e){return Math.sqrt(1-Math.pow(e-1,2))},v.easing.easeInOutCirc=v.easing.easeInOutCirc||function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2},v.easing.easeInElastic=v.easing.easeInElastic||function(e){return 0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*(2*Math.PI/3))},v.easing.easeOutElastic=v.easing.easeOutElastic||function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*(2*Math.PI/3))+1},v.easing.easeInOutElastic=v.easing.easeInOutElastic||function(e){return 0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1},v.easing.easeInBack=v.easing.easeInBack||function(e){return 2.70158*e*e*e-1.70158*e*e},v.easing.easeOutBack=v.easing.easeOutBack||function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)},v.easing.easeInOutBack=v.easing.easeInOutBack||function(e){return e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+2.5949095)+2)/2},v.easing.easeInBounce=v.easing.easeInBounce||function(e){return 1-t(1-e)},v.easing.easeOutBounce=v.easing.easeOutBounce||t,v.easing.easeInOutBounce=v.easing.easeInOutBounce||function(e){return e<.5?(1-t(1-2*e))/2:(1+t(2*e-1))/2}}};w._easing.call(),v.fn[p]=function(e){return _[e]?_[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void v.error("Method "+e+" does not exist"):_.init.apply(this,arguments)},v[p]=function(e){return _[e]?_[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void v.error("Method "+e+" does not exist"):_.init.apply(this,arguments)},v[p].defaults=g}(jQuery,window,document),function(o){var r,c="mPS2id",u=mPS2id_params,h=u.shortcode_class,d=location.hash||null,p=function(e,t){try{o(e)}catch(e){return!1}return o(e).length&&(t||o("a[href*='"+e+"']").filter(function(){return 1==o(this).data(c+"Element")}).length)},g=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return{y:t[0]||"0",x:t[1]||"0"}},f=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return[t[0]||"0",t[1]||"0"]},_=function(e){"horizontal"!==e&&o(window).scrollTop(0),"vertical"!==e&&o(window).scrollLeft(0)},w=function(e,t){for(var n=e.click.length-1;0<=n;n--){var s=e.click[n];s&&"mPS2id"!=s.namespace&&("a[href*=#]"===s.selector?s.selector="a[href*=#]:not(._mPS2id-h)":'a[href*="#"]'===s.selector?s.selector='a[href*="#"]:not(._mPS2id-h)':"a[href*=#]:not([href=#])"===s.selector?s.selector="a[href*=#]:not([href=#]):not(._mPS2id-h)":'a[href*="#"]:not([href="#"])'===s.selector?s.selector='a[href*="#"]:not([href="#"]):not(._mPS2id-h)':s.selector&&-1!==s.selector.indexOf("mobmenu")?t.off("click"):t.off("click",s.handler))}},S="a[data-ps2id-api='true'][href*='#'],.ps2id > a[href*='#'],a.ps2id[href*='#']";function t(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}o(function(){for(var e=0;e<u.total_instances;e++){var t=o("[class*='ps2id-id-']");if(t.length&&t.each(function(){var e,t=o(this),n=t.attr("class").split(" ");if(!t.attr("id"))for(var s in n)if(String(n[s]).match(/^ps2id-id-\S+$/)){e=n[s].split("ps2id-id-")[1],o("#"+e).length||t.attr("id",e);break}}),"true"===u.instances[c+"_instance_"+e].scrollToHash&&d&&(o(u.instances[c+"_instance_"+e].selector+",."+h+","+S).not(u.instances[c+"_instance_"+e].excludeSelector).each(function(){o(this).data(c+"Element",!0)}),p(d,"true"===u.instances[c+"_instance_"+e].scrollToHashForAll))){var n="true"===u.instances[c+"_instance_"+e].scrollToHashRemoveUrlHash?window.location.href.replace(/#.*$/,""):window.location.href.replace(/#.*$/,"#");_(u.instances[c+"_instance_"+e].layout),window.history&&window.history.replaceState?window.history.replaceState("","",n):window.location.href=n}}o("html").css("scroll-behavior","auto"),window.twentytwenty&&window.twentytwenty.smoothScroll&&(window.twentytwenty.smoothScroll=null)}),o(window).on("load",function(){for(var e=0;e<u.total_instances;e++){0<=u.instances[c+"_instance_"+e].selector.indexOf("a[href*=#]:not([href=#])")&&console.log("ps2id selector issue: a[href*=#]:not([href=#]) selector needs quotes"),0<=u.instances[c+"_instance_"+e].excludeSelector.indexOf("a[href*=#]:not([href=#])")&&console.log("ps2id excluded selector issue: a[href*=#]:not([href=#]) selector needs quotes");var n=o(u.instances[c+"_instance_"+e].selector+",."+h+","+S),t=u.instances[c+"_instance_"+e].autoCorrectScroll,s=0,a=u.instances[c+"_instance_"+e].autoCorrectScrollExtend;if(window.ps2id_special_params&&(window.ps2id_special_params.highlightSelector&&(u.instances[c+"_instance_"+e].highlightSelector=window.ps2id_special_params.highlightSelector),window.ps2id_special_params.scrollSpeed&&(u.instances[c+"_instance_"+e].scrollSpeed=window.ps2id_special_params.scrollSpeed),window.ps2id_special_params.scrollEasing&&(u.instances[c+"_instance_"+e].scrollEasing=window.ps2id_special_params.scrollEasing),void 0!==window.ps2id_special_params.forceSingleHighlight&&(u.instances[c+"_instance_"+e].forceSingleHighlight=window.ps2id_special_params.forceSingleHighlight),void 0!==window.ps2id_special_params.keepHighlightUntilNext&&(u.instances[c+"_instance_"+e].keepHighlightUntilNext=window.ps2id_special_params.keepHighlightUntilNext),void 0!==window.ps2id_special_params.appendHash&&(u.instances[c+"_instance_"+e].appendHash=window.ps2id_special_params.appendHash),window.ps2id_special_params.layout&&(u.instances[c+"_instance_"+e].layout=window.ps2id_special_params.layout),window.ps2id_special_params.offset&&(u.instances[c+"_instance_"+e].offset=window.ps2id_special_params.offset)),n.mPageScroll2id({scrollSpeed:u.instances[c+"_instance_"+e].scrollSpeed,autoScrollSpeed:"true"===u.instances[c+"_instance_"+e].autoScrollSpeed,scrollEasing:"true"===u.instances[c+"_instance_"+e].forceScrollEasing?"ps2id_"+u.instances[c+"_instance_"+e].scrollEasing:u.instances[c+"_instance_"+e].scrollEasing,scrollingEasing:"true"===u.instances[c+"_instance_"+e].forceScrollEasing?"ps2id_"+u.instances[c+"_instance_"+e].scrollingEasing:u.instances[c+"_instance_"+e].scrollingEasing,pageEndSmoothScroll:"true"===u.instances[c+"_instance_"+e].pageEndSmoothScroll,layout:u.instances[c+"_instance_"+e].layout,offset:g(u.instances[c+"_instance_"+e].offset.toString()),highlightSelector:u.instances[c+"_instance_"+e].highlightSelector,clickedClass:u.instances[c+"_instance_"+e].clickedClass,targetClass:u.instances[c+"_instance_"+e].targetClass,highlightClass:u.instances[c+"_instance_"+e].highlightClass,forceSingleHighlight:"true"===u.instances[c+"_instance_"+e].forceSingleHighlight,keepHighlightUntilNext:"true"===u.instances[c+"_instance_"+e].keepHighlightUntilNext,highlightByNextTarget:"true"===u.instances[c+"_instance_"+e].highlightByNextTarget,disablePluginBelow:f(u.instances[c+"_instance_"+e].disablePluginBelow.toString()),appendHash:"true"===u.instances[c+"_instance_"+e].appendHash,onStart:function(){"true"===t&&"selector"===mPS2id.trigger&&s++,"true"===a&&(r=[mPS2id.target.offset().top,mPS2id.target.offset().left])},onComplete:function(){"true"===a?r[0]===mPS2id.target.offset().top&&r[1]===mPS2id.target.offset().left||("selector"===mPS2id.trigger&&mPS2id.clicked.length?mPS2id.clicked.trigger("click.mPS2id"):o.mPageScroll2id("scrollTo",mPS2id.target.attr("id"))):1==s&&(mPS2id.clicked.length&&mPS2id.clicked.trigger("click.mPS2id"),s=0)},excludeSelectors:u.instances[c+"_instance_"+e].excludeSelector,encodeLinks:"true"===u.instances[c+"_instance_"+e].encodeLinks,liveSelector:u.instances[c+"_instance_"+e].selector+",."+h+","+S}),"true"===u.instances[c+"_instance_"+e].scrollToHash&&d&&p(d,"true"===u.instances[c+"_instance_"+e].scrollToHashForAll)){_(u.instances[c+"_instance_"+e].layout);var i=u.instances[c+"_instance_"+e].scrollToHashUseElementData,l=o("a._mPS2id-h[href$='"+d+"'][data-ps2id-offset]:not([data-ps2id-offset=''])").last();setTimeout(function(){"true"===i&&l.length?l.trigger("click.mPS2id"):o.mPageScroll2id("scrollTo",d),-1!==window.location.href.indexOf("#")&&(window.history&&window.history.replaceState?window.history.replaceState("","",d):window.location.hash=d)},u.instances[c+"_instance_"+e].scrollToHashDelay)}"true"===u.instances[c+"_instance_"+e].unbindUnrelatedClickEvents&&setTimeout(function(){var e=n.length?o._data(n[0],"events"):null,t=n.length?o._data(o(document)[0],"events"):null;e&&w(e,n),t&&w(t,n)},300),"true"===u.instances[c+"_instance_"+e].normalizeAnchorPointTargets&&o("a._mPS2id-t[id]:empty").css({display:"inline-block","line-height":0,width:0,height:0,border:"none"}),"true"===u.instances[c+"_instance_"+e].stopScrollOnUserAction&&o(document).on("mousewheel DOMMouseScroll touchmove",function(){var e=o("html,body");e.is(":animated")&&e.stop()})}}),o.extend(o.expr[":"],{absolute:o.expr[":"].absolute||function(e){return"absolute"===o(e).css("position")},relative:o.expr[":"].relative||function(e){return"relative"===o(e).css("position")},static:o.expr[":"].static||function(e){return"static"===o(e).css("position")},fixed:o.expr[":"].fixed||function(e){return"fixed"===o(e).css("position")},width:o.expr[":"].width||function(e,t,n){var s=n[3].replace("<","<").replace(">",">");return!!s&&(">"===s.substr(0,1)?o(e).width()>s.substr(1):"<"===s.substr(0,1)?o(e).width()<s.substr(1):o(e).width()===parseInt(s))},height:o.expr[":"].height||function(e,t,n){var s=n[3].replace("<","<").replace(">",">");return!!s&&(">"===s.substr(0,1)?o(e).height()>s.substr(1):"<"===s.substr(0,1)?o(e).height()<s.substr(1):o(e).height()===parseInt(s))}}),o.easing.ps2id_easeInQuad=o.easing.ps2id_easeInQuad||function(e){return e*e},o.easing.ps2id_easeOutQuad=o.easing.ps2id_easeOutQuad||function(e){return 1-(1-e)*(1-e)},o.easing.ps2id_easeInOutQuad=o.easing.ps2id_easeInOutQuad||function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},o.easing.ps2id_easeInCubic=o.easing.ps2id_easeInCubic||function(e){return e*e*e},o.easing.ps2id_easeOutCubic=o.easing.ps2id_easeOutCubic||function(e){return 1-Math.pow(1-e,3)},o.easing.ps2id_easeInOutCubic=o.easing.ps2id_easeInOutCubic||function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},o.easing.ps2id_easeInQuart=o.easing.ps2id_easeInQuart||function(e){return e*e*e*e},o.easing.ps2id_easeOutQuart=o.easing.ps2id_easeOutQuart||function(e){return 1-Math.pow(1-e,4)},o.easing.ps2id_easeInOutQuart=o.easing.ps2id_easeInOutQuart||function(e){return e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2},o.easing.ps2id_easeInQuint=o.easing.ps2id_easeInQuint||function(e){return e*e*e*e*e},o.easing.ps2id_easeOutQuint=o.easing.ps2id_easeOutQuint||function(e){return 1-Math.pow(1-e,5)},o.easing.ps2id_easeInOutQuint=o.easing.ps2id_easeInOutQuint||function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2},o.easing.ps2id_easeInExpo=o.easing.ps2id_easeInExpo||function(e){return 0===e?0:Math.pow(2,10*e-10)},o.easing.ps2id_easeOutExpo=o.easing.ps2id_easeOutExpo||function(e){return 1===e?1:1-Math.pow(2,-10*e)},o.easing.ps2id_easeInOutExpo=o.easing.ps2id_easeInOutExpo||function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},o.easing.ps2id_easeInSine=o.easing.ps2id_easeInSine||function(e){return 1-Math.cos(e*Math.PI/2)},o.easing.ps2id_easeOutSine=o.easing.ps2id_easeOutSine||function(e){return Math.sin(e*Math.PI/2)},o.easing.ps2id_easeInOutSine=o.easing.ps2id_easeInOutSine||function(e){return-(Math.cos(Math.PI*e)-1)/2},o.easing.ps2id_easeInCirc=o.easing.ps2id_easeInCirc||function(e){return 1-Math.sqrt(1-Math.pow(e,2))},o.easing.ps2id_easeOutCirc=o.easing.ps2id_easeOutCirc||function(e){return Math.sqrt(1-Math.pow(e-1,2))},o.easing.ps2id_easeInOutCirc=o.easing.ps2id_easeInOutCirc||function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2},o.easing.ps2id_easeInElastic=o.easing.ps2id_easeInElastic||function(e){return 0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*(2*Math.PI/3))},o.easing.ps2id_easeOutElastic=o.easing.ps2id_easeOutElastic||function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*(2*Math.PI/3))+1},o.easing.ps2id_easeInOutElastic=o.easing.ps2id_easeInOutElastic||function(e){return 0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1},o.easing.ps2id_easeInBack=o.easing.ps2id_easeInBack||function(e){return 2.70158*e*e*e-1.70158*e*e},o.easing.ps2id_easeOutBack=o.easing.ps2id_easeOutBack||function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)},o.easing.ps2id_easeInOutBack=o.easing.ps2id_easeInOutBack||function(e){return e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+2.5949095)+2)/2},o.easing.ps2id_easeInBounce=o.easing.ps2id_easeInBounce||function(e){return 1-t(1-e)},o.easing.ps2id_easeOutBounce=o.easing.ps2id_easeOutBounce||t,o.easing.ps2id_easeInOutBounce=o.easing.ps2id_easeInOutBounce||function(e){return e<.5?(1-t(1-2*e))/2:(1+t(2*e-1))/2}}(jQuery);
|
1 |
+
/* Page scroll to id - version 1.7.3 */
|
2 |
+
!function(v,M,c,e){var n,x,s,i,l,a,o,r,u,h,t,d,p="mPageScroll2id",b="mPS2id",g={scrollSpeed:1e3,autoScrollSpeed:!0,scrollEasing:"easeInOutQuint",scrollingEasing:"easeOutQuint",pageEndSmoothScroll:!0,layout:"vertical",offset:0,highlightSelector:!1,clickedClass:b+"-clicked",targetClass:b+"-target",highlightClass:b+"-highlight",forceSingleHighlight:!1,keepHighlightUntilNext:!1,highlightByNextTarget:!1,disablePluginBelow:!1,clickEvents:!0,appendHash:!1,onStart:function(){},onComplete:function(){},defaultSelector:!1,live:!0,liveSelector:!1,excludeSelectors:!1,encodeLinks:!1,inIframe:!1},f=0,_=/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,w={init:function(e){e=v.extend(!0,{},g,e);if(v(c).data(b,e),x=v(c).data(b),!this.selector){var t="__"+b;this.each(function(){var e=v(this);e.hasClass(t)||e.addClass(t)}),this.selector="."+t}x.liveSelector&&(this.selector+=","+x.liveSelector),n=n?n+","+this.selector:this.selector,x.defaultSelector&&("object"==typeof v(n)&&0!==v(n).length||(n=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id'],._ps2id")),x.clickEvents&&v(c).off("."+b).on("click."+b,n,function(e){if(m._isDisabled.call(null))m._removeClasses.call(null);else{var t=v(this),n=t.attr("href"),s=t.prop("href").baseVal||t.prop("href");x.excludeSelectors&&t.is(x.excludeSelectors)||n&&-1!==n.indexOf("#/")||(m._reset.call(null),h=t.data("ps2id-offset")||0,m._isValid.call(null,n,s)&&m._findTarget.call(null,n)&&(e.preventDefault(),i="selector",l=t,m._setClasses.call(null,!0),m._scrollTo.call(null)))}}),v(M).off("."+b).on("scroll."+b+" resize."+b,function(){if(m._isDisabled.call(null))m._removeClasses.call(null);else{var i=v("._"+b+"-t");i.each(function(e){var t=v(this),n=t.attr("id"),s=m._findHighlight.call(null,n);m._setClasses.call(null,!1,t,s),e==i.length-1&&m._extendClasses.call(null)})}}),s=!0,m._setup.call(null),m._live.call(null)},scrollTo:function(e,t){if(m._isDisabled.call(null))m._removeClasses.call(null);else if(e&&void 0!==e){m._isInit.call(null);var n={layout:x.layout,offset:x.offset,clicked:!1};t=v.extend(!0,{},n,t);m._reset.call(null),r=t.layout,u=t.offset,e=-1!==e.indexOf("#")?e:"#"+e,m._isValid.call(null,e)&&m._findTarget.call(null,e)&&(i="scrollTo",(l=t.clicked)&&m._setClasses.call(null,!0),m._scrollTo.call(null))}},destroy:function(){v(M).off("."+b),v(c).off("."+b).removeData(b),v("._"+b+"-t").removeData(b),m._removeClasses.call(null,!0)}},m={_isDisabled:function(){var e=M,t="inner",n=x.disablePluginBelow instanceof Array?[x.disablePluginBelow[0]||0,x.disablePluginBelow[1]||0]:[x.disablePluginBelow||0,0];return"innerWidth"in M||(t="client",e=c.documentElement||c.body),e[t+"Width"]<=n[0]||e[t+"Height"]<=n[1]},_isValid:function(e,t){if(e){var n=-1!==(t=t||e).indexOf("#/")?t.split("#/")[0]:t.split("#")[0],s=(x.inIframe||M.location===M.parent.location?M.location:M.parent.location).toString().split("#")[0];return"#"!==e&&-1!==e.indexOf("#")&&(""===n||decodeURIComponent(n)===decodeURIComponent(s))}},_setup:function(){var l=m._highlightSelector(),o=1,r=0;return v(l).each(function(){var e=v(this),t=e.attr("href"),n=e.prop("href").baseVal||e.prop("href");if(m._isValid.call(null,t,n)){if(x.excludeSelectors&&e.is(x.excludeSelectors))return;var s=-1!==t.indexOf("#/")?t.split("#/")[1]:t.substring(t.indexOf("#")+1),i=_.test(s)?v(c.getElementById(s)):v("#"+s);if(0<i.length){x.highlightByNextTarget&&i!==r&&(r?r.data(b,{tn:i}):i.data(b,{tn:"0"}),r=i),i.hasClass("_"+b+"-t")||i.addClass("_"+b+"-t"),i.data(b,{i:o}),e.hasClass("_"+b+"-h")||e.addClass("_"+b+"-h");var a=m._findHighlight.call(null,s);m._setClasses.call(null,!1,i,a),f=o,++o==v(l).length&&m._extendClasses.call(null)}}})},_highlightSelector:function(){return x.highlightSelector&&""!==x.highlightSelector?x.highlightSelector:n},_findTarget:function(e){var t=-1!==e.indexOf("#/")?e.split("#/")[1]:e.substring(e.indexOf("#")+1),n=_.test(t)?v(c.getElementById(t)):v("#"+t);if(n.length<1||"fixed"===n.css("position")){if("top"!==t)return;n=v("body")}return a=n,r||(r=x.layout),u=m._setOffset.call(null),(o=[(n.offset().top-u[0]).toString(),(n.offset().left-u[1]).toString()])[0]=o[0]<0?0:o[0],o[1]=o[1]<0?0:o[1],o},_setOffset:function(){var e,t,n,s;switch(u||(u=x.offset?x.offset:0),h&&(u=h),typeof u){case"object":case"string":0<(t=[(e=[u.y?u.y:u,u.x?u.x:u])[0]instanceof jQuery?e[0]:v(e[0]),e[1]instanceof jQuery?e[1]:v(e[1])])[0].length?(n=t[0].height(),"fixed"===t[0].css("position")&&(n+=t[0][0].offsetTop)):n=!isNaN(parseFloat(e[0]))&&isFinite(e[0])?parseInt(e[0]):0,0<t[1].length?(s=t[1].width(),"fixed"===t[1].css("position")&&(s+=t[1][0].offsetLeft)):s=!isNaN(parseFloat(e[1]))&&isFinite(e[1])?parseInt(e[1]):0;break;case"function":(e=u.call(null))instanceof Array?(n=e[0],s=e[1]):n=s=e;break;default:n=s=parseInt(u)}return[n,s]},_findHighlight:function(e){var t=x.inIframe||M.location===M.parent.location?M.location:M.parent.location,n=t.toString().split("#")[0],s=t.pathname;if(-1!==n.indexOf("'")&&(n=n.replace("'","\\'")),-1!==s.indexOf("'")&&(s=s.replace("'","\\'")),n=decodeURIComponent(n),s=decodeURIComponent(s),x.encodeLinks){var i=encodeURI(n).toLowerCase(),a=encodeURI(s).toLowerCase();return v("._"+b+"-h[href='#"+e+"'],._"+b+"-h[href='"+n+"#"+e+"'],._"+b+"-h[href='"+s+"#"+e+"'],._"+b+"-h[href='#/"+e+"'],._"+b+"-h[href='"+n+"#/"+e+"'],._"+b+"-h[href='"+s+"#/"+e+"'],._"+b+"-h[href='"+i+"#/"+e+"'],._"+b+"-h[href='"+i+"#"+e+"'],._"+b+"-h[href='"+a+"#/"+e+"'],._"+b+"-h[href='"+a+"#"+e+"']")}return v("._"+b+"-h[href='#"+e+"'],._"+b+"-h[href='"+n+"#"+e+"'],._"+b+"-h[href='"+s+"#"+e+"'],._"+b+"-h[href='#/"+e+"'],._"+b+"-h[href='"+n+"#/"+e+"'],._"+b+"-h[href='"+s+"#/"+e+"']")},_setClasses:function(e,t,n){var s=x.clickedClass,i=x.targetClass,a=x.highlightClass;e&&s&&""!==s?(v("."+s).removeClass(s),l.addClass(s)):t&&i&&""!==i&&n&&a&&""!==a&&(m._currentTarget.call(null,t)?(t.addClass(i),n.addClass(a)):(!x.keepHighlightUntilNext||1<v("."+a).length)&&(t.removeClass(i),n.removeClass(a)))},_extendClasses:function(){var e=x.targetClass,t=x.highlightClass,n=v("."+e),s=v("."+t),i=e+"-first",a=e+"-last",l=t+"-first",o=t+"-last";v("._"+b+"-t").removeClass(i+" "+a),v("._"+b+"-h").removeClass(l+" "+o),x.forceSingleHighlight?x.keepHighlightUntilNext&&1<n.length?(n.slice(0,1).removeClass(e),s.slice(0,1).removeClass(t)):(n.slice(1).removeClass(e),s.slice(1).removeClass(t)):(n.slice(0,1).addClass(i).end().slice(-1).addClass(a),s.slice(0,1).addClass(l).end().slice(-1).addClass(o))},_removeClasses:function(e){v("."+x.clickedClass).removeClass(x.clickedClass),v("."+x.targetClass).removeClass(x.targetClass+" "+x.targetClass+"-first "+x.targetClass+"-last"),v("."+x.highlightClass).removeClass(x.highlightClass+" "+x.highlightClass+"-first "+x.highlightClass+"-last"),e&&(v("._"+b+"-t").removeClass("_"+b+"-t"),v("._"+b+"-h").removeClass("_"+b+"-h"))},_currentTarget:function(e){if(e.data(b)){var t=x["target_"+e.data(b).i],n=e.data("ps2id-target"),s=n&&v(n)[0]?v(n)[0].getBoundingClientRect():e[0].getBoundingClientRect();if(void 0!==t){var i=e.offset().top,a=e.offset().left,l=t.from?t.from+i:i,o=t.to?t.to+i:i,r=t.fromX?t.fromX+a:a,c=t.toX?t.toX+a:a;return s.top>=o&&s.top<=l&&s.left>=c&&s.left<=r}var u=v(M).height(),h=v(M).width(),d=n?v(n).height():e.height(),p=n?v(n).width():e.width(),g=1+d/u,f=g,_=d<u?g*(u/d):g,w=1+p/h,m=w,S=p<h?w*(h/p):w,I=[s.top<=u/f,s.bottom>=u/_,s.left<=h/m,s.right>=h/S];if(x.highlightByNextTarget){var C=e.data(b).tn;if(C){var O=C[0].getBoundingClientRect();"vertical"===x.layout?I=[s.top<=u/2,O.top>u/2,1,1]:"horizontal"===x.layout&&(I=[1,1,s.left<=h/2,O.left>h/2])}}return I[0]&&I[1]&&I[2]&&I[3]}},_scrollTo:function(){d=m._scrollSpeed.call(null),o=x.pageEndSmoothScroll?m._pageEndSmoothScroll.call(null):o;var e=v("html,body"),t=x.autoScrollSpeed?m._autoScrollSpeed.call(null):d,n=e.is(":animated")?x.scrollingEasing:x.scrollEasing,s=v(M).scrollTop(),i=v(M).scrollLeft();switch(r){case"horizontal":i!=o[1]&&(m._callbacks.call(null,"onStart"),e.stop().animate({scrollLeft:o[1]},t,n).promise().then(function(){m._callbacks.call(null,"onComplete")}));break;case"auto":var a;if(s!=o[0]||i!=o[1])if(m._callbacks.call(null,"onStart"),navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/))e.stop().animate({pageYOffset:o[0],pageXOffset:o[1]},{duration:t,easing:n,step:function(e,t){"pageXOffset"==t.prop?a=e:"pageYOffset"==t.prop&&M.scrollTo(a,e)}}).promise().then(function(){m._callbacks.call(null,"onComplete")});else e.stop().animate({scrollTop:o[0],scrollLeft:o[1]},t,n).promise().then(function(){m._callbacks.call(null,"onComplete")});break;default:s!=o[0]&&(m._callbacks.call(null,"onStart"),e.stop().animate({scrollTop:o[0]},t,n).promise().then(function(){m._callbacks.call(null,"onComplete")}))}},_pageEndSmoothScroll:function(){var e=v(c).height(),t=v(c).width(),n=v(M).height(),s=v(M).width();return[e-o[0]<n?e-n:o[0],t-o[1]<s?t-s:o[1]]},_scrollSpeed:function(){var s=x.scrollSpeed;return l&&l.length&&l.add(l.parent()).each(function(){var e=v(this);if(e.attr("class")){var t=e.attr("class").split(" ");for(var n in t)if(String(t[n]).match(/^ps2id-speed-\d+$/)){s=t[n].split("ps2id-speed-")[1];break}}}),parseInt(s)},_autoScrollSpeed:function(){var e=v(M).scrollTop(),t=v(M).scrollLeft(),n=v(c).height(),s=v(c).width(),i=[d+d*Math.floor(Math.abs(o[0]-e)/n*100)/100,d+d*Math.floor(Math.abs(o[1]-t)/s*100)/100];return Math.max.apply(Math,i)},_callbacks:function(e){if(x)switch(this[b]={trigger:i,clicked:l,target:a,scrollTo:{y:o[0],x:o[1]}},e){case"onStart":if(x.appendHash&&M.history&&M.history.pushState&&l&&l.length){var t=l.attr("href"),n="#"+t.substring(t.indexOf("#")+1);n!==M.location.hash&&history.pushState("","",n)}x.onStart.call(null,this[b]);break;case"onComplete":x.onComplete.call(null,this[b])}},_reset:function(){r=u=h=!1},_isInit:function(){s||w.init.apply(this)},_live:function(){t=setTimeout(function(){x.live?v(m._highlightSelector()).length!==f&&m._setup.call(null):t&&clearTimeout(t),m._live.call(null)},1e3)},_easing:function(){function t(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}v.easing.easeInQuad=v.easing.easeInQuad||function(e){return e*e},v.easing.easeOutQuad=v.easing.easeOutQuad||function(e){return 1-(1-e)*(1-e)},v.easing.easeInOutQuad=v.easing.easeInOutQuad||function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},v.easing.easeInCubic=v.easing.easeInCubic||function(e){return e*e*e},v.easing.easeOutCubic=v.easing.easeOutCubic||function(e){return 1-Math.pow(1-e,3)},v.easing.easeInOutCubic=v.easing.easeInOutCubic||function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},v.easing.easeInQuart=v.easing.easeInQuart||function(e){return e*e*e*e},v.easing.easeOutQuart=v.easing.easeOutQuart||function(e){return 1-Math.pow(1-e,4)},v.easing.easeInOutQuart=v.easing.easeInOutQuart||function(e){return e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2},v.easing.easeInQuint=v.easing.easeInQuint||function(e){return e*e*e*e*e},v.easing.easeOutQuint=v.easing.easeOutQuint||function(e){return 1-Math.pow(1-e,5)},v.easing.easeInOutQuint=v.easing.easeInOutQuint||function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2},v.easing.easeInExpo=v.easing.easeInExpo||function(e){return 0===e?0:Math.pow(2,10*e-10)},v.easing.easeOutExpo=v.easing.easeOutExpo||function(e){return 1===e?1:1-Math.pow(2,-10*e)},v.easing.easeInOutExpo=v.easing.easeInOutExpo||function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},v.easing.easeInSine=v.easing.easeInSine||function(e){return 1-Math.cos(e*Math.PI/2)},v.easing.easeOutSine=v.easing.easeOutSine||function(e){return Math.sin(e*Math.PI/2)},v.easing.easeInOutSine=v.easing.easeInOutSine||function(e){return-(Math.cos(Math.PI*e)-1)/2},v.easing.easeInCirc=v.easing.easeInCirc||function(e){return 1-Math.sqrt(1-Math.pow(e,2))},v.easing.easeOutCirc=v.easing.easeOutCirc||function(e){return Math.sqrt(1-Math.pow(e-1,2))},v.easing.easeInOutCirc=v.easing.easeInOutCirc||function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2},v.easing.easeInElastic=v.easing.easeInElastic||function(e){return 0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*(2*Math.PI/3))},v.easing.easeOutElastic=v.easing.easeOutElastic||function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*(2*Math.PI/3))+1},v.easing.easeInOutElastic=v.easing.easeInOutElastic||function(e){return 0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1},v.easing.easeInBack=v.easing.easeInBack||function(e){return 2.70158*e*e*e-1.70158*e*e},v.easing.easeOutBack=v.easing.easeOutBack||function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)},v.easing.easeInOutBack=v.easing.easeInOutBack||function(e){return e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+2.5949095)+2)/2},v.easing.easeInBounce=v.easing.easeInBounce||function(e){return 1-t(1-e)},v.easing.easeOutBounce=v.easing.easeOutBounce||t,v.easing.easeInOutBounce=v.easing.easeInOutBounce||function(e){return e<.5?(1-t(1-2*e))/2:(1+t(2*e-1))/2}}};m._easing.call(),v.fn[p]=function(e){return w[e]?w[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void v.error("Method "+e+" does not exist"):w.init.apply(this,arguments)},v[p]=function(e){return w[e]?w[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void v.error("Method "+e+" does not exist"):w.init.apply(this,arguments)},v[p].defaults=g}(jQuery,window,document),function(o){var r,c="mPS2id",u=mPS2id_params,h=u.shortcode_class,d=location.hash||null,s=/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,p=function(e,t){var n=e.substring(e.indexOf("#")+1);try{s.test(n)?o(document.getElementById(n)):o("#"+n)}catch(e){return!1}return(s.test(n)?o(document.getElementById(n)):o("#"+n)).length&&(t||o("a[href*='#"+n+"']").filter(function(){return 1==o(this).data(c+"Element")}).length)},g=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return{y:t[0]||"0",x:t[1]||"0"}},f=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return[t[0]||"0",t[1]||"0"]},_=function(e){"horizontal"!==e&&o(window).scrollTop(0),"vertical"!==e&&o(window).scrollLeft(0)},w=function(e,t){for(var n=e.click.length-1;0<=n;n--){var s=e.click[n];s&&"mPS2id"!=s.namespace&&("a[href*=#]"===s.selector?s.selector="a[href*=#]:not(._mPS2id-h)":'a[href*="#"]'===s.selector?s.selector='a[href*="#"]:not(._mPS2id-h)':"a[href*=#]:not([href=#])"===s.selector?s.selector="a[href*=#]:not([href=#]):not(._mPS2id-h)":'a[href*="#"]:not([href="#"])'===s.selector?s.selector='a[href*="#"]:not([href="#"]):not(._mPS2id-h)':s.selector&&-1!==s.selector.indexOf("mobmenu")?t.off("click"):t.off("click",s.handler))}},m="a[data-ps2id-api='true'][href*='#'],.ps2id > a[href*='#'],a.ps2id[href*='#']";function t(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}o(function(){for(var e=0;e<u.total_instances;e++){var t=o("[class*='ps2id-id-']");if(t.length&&t.each(function(){var e,t=o(this),n=t.attr("class").split(" ");if(!t.attr("id"))for(var s in n)if(String(n[s]).match(/^ps2id-id-\S+$/)){e=n[s].split("ps2id-id-")[1],o("#"+e).length||t.attr("id",e);break}}),"true"===u.instances[c+"_instance_"+e].scrollToHash&&d&&(o(u.instances[c+"_instance_"+e].selector+",."+h+","+m).not(u.instances[c+"_instance_"+e].excludeSelector).each(function(){o(this).data(c+"Element",!0)}),p(d,"true"===u.instances[c+"_instance_"+e].scrollToHashForAll))){var n="true"===u.instances[c+"_instance_"+e].scrollToHashRemoveUrlHash?window.location.href.replace(/#.*$/,""):window.location.href.replace(/#.*$/,"#");_(u.instances[c+"_instance_"+e].layout),window.history&&window.history.replaceState?window.history.replaceState("","",n):window.location.href=n}}o("html").css("scroll-behavior","auto"),window.twentytwenty&&window.twentytwenty.smoothScroll&&(window.twentytwenty.smoothScroll=null)}),o(window).on("load",function(){for(var e=0;e<u.total_instances;e++){0<=u.instances[c+"_instance_"+e].selector.indexOf("a[href*=#]:not([href=#])")&&console.log("ps2id selector issue: a[href*=#]:not([href=#]) selector needs quotes"),0<=u.instances[c+"_instance_"+e].excludeSelector.indexOf("a[href*=#]:not([href=#])")&&console.log("ps2id excluded selector issue: a[href*=#]:not([href=#]) selector needs quotes");var n=o(u.instances[c+"_instance_"+e].selector+",."+h+","+m),t=u.instances[c+"_instance_"+e].autoCorrectScroll,s=0,i=u.instances[c+"_instance_"+e].autoCorrectScrollExtend;if(window.ps2id_special_params&&(window.ps2id_special_params.highlightSelector&&(u.instances[c+"_instance_"+e].highlightSelector=window.ps2id_special_params.highlightSelector),window.ps2id_special_params.scrollSpeed&&(u.instances[c+"_instance_"+e].scrollSpeed=window.ps2id_special_params.scrollSpeed),window.ps2id_special_params.scrollEasing&&(u.instances[c+"_instance_"+e].scrollEasing=window.ps2id_special_params.scrollEasing),void 0!==window.ps2id_special_params.forceSingleHighlight&&(u.instances[c+"_instance_"+e].forceSingleHighlight=window.ps2id_special_params.forceSingleHighlight),void 0!==window.ps2id_special_params.keepHighlightUntilNext&&(u.instances[c+"_instance_"+e].keepHighlightUntilNext=window.ps2id_special_params.keepHighlightUntilNext),void 0!==window.ps2id_special_params.appendHash&&(u.instances[c+"_instance_"+e].appendHash=window.ps2id_special_params.appendHash),window.ps2id_special_params.layout&&(u.instances[c+"_instance_"+e].layout=window.ps2id_special_params.layout),window.ps2id_special_params.offset&&(u.instances[c+"_instance_"+e].offset=window.ps2id_special_params.offset)),n.mPageScroll2id({scrollSpeed:u.instances[c+"_instance_"+e].scrollSpeed,autoScrollSpeed:"true"===u.instances[c+"_instance_"+e].autoScrollSpeed,scrollEasing:"true"===u.instances[c+"_instance_"+e].forceScrollEasing?"ps2id_"+u.instances[c+"_instance_"+e].scrollEasing:u.instances[c+"_instance_"+e].scrollEasing,scrollingEasing:"true"===u.instances[c+"_instance_"+e].forceScrollEasing?"ps2id_"+u.instances[c+"_instance_"+e].scrollingEasing:u.instances[c+"_instance_"+e].scrollingEasing,pageEndSmoothScroll:"true"===u.instances[c+"_instance_"+e].pageEndSmoothScroll,layout:u.instances[c+"_instance_"+e].layout,offset:g(u.instances[c+"_instance_"+e].offset.toString()),highlightSelector:u.instances[c+"_instance_"+e].highlightSelector,clickedClass:u.instances[c+"_instance_"+e].clickedClass,targetClass:u.instances[c+"_instance_"+e].targetClass,highlightClass:u.instances[c+"_instance_"+e].highlightClass,forceSingleHighlight:"true"===u.instances[c+"_instance_"+e].forceSingleHighlight,keepHighlightUntilNext:"true"===u.instances[c+"_instance_"+e].keepHighlightUntilNext,highlightByNextTarget:"true"===u.instances[c+"_instance_"+e].highlightByNextTarget,disablePluginBelow:f(u.instances[c+"_instance_"+e].disablePluginBelow.toString()),appendHash:"true"===u.instances[c+"_instance_"+e].appendHash,onStart:function(){"true"===t&&"selector"===mPS2id.trigger&&s++,"true"===i&&(r=[mPS2id.target.offset().top,mPS2id.target.offset().left])},onComplete:function(){"true"===i?r[0]===mPS2id.target.offset().top&&r[1]===mPS2id.target.offset().left||("selector"===mPS2id.trigger&&mPS2id.clicked.length?mPS2id.clicked.trigger("click.mPS2id"):o.mPageScroll2id("scrollTo",mPS2id.target.attr("id"))):1==s&&(mPS2id.clicked.length&&mPS2id.clicked.trigger("click.mPS2id"),s=0)},excludeSelectors:u.instances[c+"_instance_"+e].excludeSelector,encodeLinks:"true"===u.instances[c+"_instance_"+e].encodeLinks,liveSelector:u.instances[c+"_instance_"+e].selector+",."+h+","+m}),"true"===u.instances[c+"_instance_"+e].scrollToHash&&d&&p(d,"true"===u.instances[c+"_instance_"+e].scrollToHashForAll)){_(u.instances[c+"_instance_"+e].layout);var a=u.instances[c+"_instance_"+e].scrollToHashUseElementData,l=o("a._mPS2id-h[href$='"+d+"'][data-ps2id-offset]:not([data-ps2id-offset=''])").last();setTimeout(function(){"true"===a&&l.length?l.trigger("click.mPS2id"):o.mPageScroll2id("scrollTo",d),-1!==window.location.href.indexOf("#")&&(window.history&&window.history.replaceState?window.history.replaceState("","",d):window.location.hash=d)},u.instances[c+"_instance_"+e].scrollToHashDelay)}"true"!==u.instances[c+"_instance_"+e].unbindUnrelatedClickEvents||u.instances[c+"_instance_"+e].unbindUnrelatedClickEventsSelector||setTimeout(function(){var e=n.length?o._data(n[0],"events"):null,t=n.length?o._data(o(document)[0],"events"):null;e&&w(e,n),t&&w(t,n)},300),"true"===u.instances[c+"_instance_"+e].normalizeAnchorPointTargets&&o("a._mPS2id-t[id]:empty").css({display:"inline-block","line-height":0,width:0,height:0,border:"none"}),"true"===u.instances[c+"_instance_"+e].stopScrollOnUserAction&&o(document).on("mousewheel DOMMouseScroll touchmove",function(){var e=o("html,body");e.is(":animated")&&e.stop()})}}),o.extend(o.expr.pseudos,{absolute:o.expr.pseudos.absolute||function(e){return"absolute"===o(e).css("position")},relative:o.expr.pseudos.relative||function(e){return"relative"===o(e).css("position")},static:o.expr.pseudos.static||function(e){return"static"===o(e).css("position")},fixed:o.expr.pseudos.fixed||function(e){return"fixed"===o(e).css("position")},width:o.expr.pseudos.width||function(e,t,n){var s=n[3].replace("<","<").replace(">",">");return!!s&&(">"===s.substr(0,1)?o(e).width()>s.substr(1):"<"===s.substr(0,1)?o(e).width()<s.substr(1):o(e).width()===parseInt(s))},height:o.expr.pseudos.height||function(e,t,n){var s=n[3].replace("<","<").replace(">",">");return!!s&&(">"===s.substr(0,1)?o(e).height()>s.substr(1):"<"===s.substr(0,1)?o(e).height()<s.substr(1):o(e).height()===parseInt(s))}}),o.easing.ps2id_easeInQuad=o.easing.ps2id_easeInQuad||function(e){return e*e},o.easing.ps2id_easeOutQuad=o.easing.ps2id_easeOutQuad||function(e){return 1-(1-e)*(1-e)},o.easing.ps2id_easeInOutQuad=o.easing.ps2id_easeInOutQuad||function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},o.easing.ps2id_easeInCubic=o.easing.ps2id_easeInCubic||function(e){return e*e*e},o.easing.ps2id_easeOutCubic=o.easing.ps2id_easeOutCubic||function(e){return 1-Math.pow(1-e,3)},o.easing.ps2id_easeInOutCubic=o.easing.ps2id_easeInOutCubic||function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},o.easing.ps2id_easeInQuart=o.easing.ps2id_easeInQuart||function(e){return e*e*e*e},o.easing.ps2id_easeOutQuart=o.easing.ps2id_easeOutQuart||function(e){return 1-Math.pow(1-e,4)},o.easing.ps2id_easeInOutQuart=o.easing.ps2id_easeInOutQuart||function(e){return e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2},o.easing.ps2id_easeInQuint=o.easing.ps2id_easeInQuint||function(e){return e*e*e*e*e},o.easing.ps2id_easeOutQuint=o.easing.ps2id_easeOutQuint||function(e){return 1-Math.pow(1-e,5)},o.easing.ps2id_easeInOutQuint=o.easing.ps2id_easeInOutQuint||function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2},o.easing.ps2id_easeInExpo=o.easing.ps2id_easeInExpo||function(e){return 0===e?0:Math.pow(2,10*e-10)},o.easing.ps2id_easeOutExpo=o.easing.ps2id_easeOutExpo||function(e){return 1===e?1:1-Math.pow(2,-10*e)},o.easing.ps2id_easeInOutExpo=o.easing.ps2id_easeInOutExpo||function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},o.easing.ps2id_easeInSine=o.easing.ps2id_easeInSine||function(e){return 1-Math.cos(e*Math.PI/2)},o.easing.ps2id_easeOutSine=o.easing.ps2id_easeOutSine||function(e){return Math.sin(e*Math.PI/2)},o.easing.ps2id_easeInOutSine=o.easing.ps2id_easeInOutSine||function(e){return-(Math.cos(Math.PI*e)-1)/2},o.easing.ps2id_easeInCirc=o.easing.ps2id_easeInCirc||function(e){return 1-Math.sqrt(1-Math.pow(e,2))},o.easing.ps2id_easeOutCirc=o.easing.ps2id_easeOutCirc||function(e){return Math.sqrt(1-Math.pow(e-1,2))},o.easing.ps2id_easeInOutCirc=o.easing.ps2id_easeInOutCirc||function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2},o.easing.ps2id_easeInElastic=o.easing.ps2id_easeInElastic||function(e){return 0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*(2*Math.PI/3))},o.easing.ps2id_easeOutElastic=o.easing.ps2id_easeOutElastic||function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*(2*Math.PI/3))+1},o.easing.ps2id_easeInOutElastic=o.easing.ps2id_easeInOutElastic||function(e){return 0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1},o.easing.ps2id_easeInBack=o.easing.ps2id_easeInBack||function(e){return 2.70158*e*e*e-1.70158*e*e},o.easing.ps2id_easeOutBack=o.easing.ps2id_easeOutBack||function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)},o.easing.ps2id_easeInOutBack=o.easing.ps2id_easeInOutBack||function(e){return e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+2.5949095)+2)/2},o.easing.ps2id_easeInBounce=o.easing.ps2id_easeInBounce||function(e){return 1-t(1-e)},o.easing.ps2id_easeOutBounce=o.easing.ps2id_easeOutBounce||t,o.easing.ps2id_easeInOutBounce=o.easing.ps2id_easeInOutBounce||function(e){return e<.5?(1-t(1-2*e))/2:(1+t(2*e-1))/2}}(jQuery);
|
malihu-pagescroll2id.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Page scroll to id
|
4 |
Plugin URI: http://manos.malihu.gr/page-scroll-to-id
|
5 |
Description: Page scroll to id is an easy-to-use jQuery plugin that enables animated (smooth) page scrolling to specific id within the document.
|
6 |
-
Version: 1.7.
|
7 |
Author: malihu
|
8 |
Author URI: http://manos.malihu.gr
|
9 |
License: MIT License (MIT)
|
@@ -47,7 +47,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
47 |
|
48 |
class malihuPageScroll2id{ // --edit--
|
49 |
|
50 |
-
protected $version='1.7.
|
51 |
protected $update_option=null;
|
52 |
|
53 |
protected $plugin_name='Page scroll to id'; // Plugin name --edit--
|
@@ -65,6 +65,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
65 |
protected $plugin_script='jquery.malihu.PageScroll2id.js'; // Plugin public script (main js plugin file) --edit--
|
66 |
protected $plugin_init_script='jquery.malihu.PageScroll2id-init.js'; // Plugin public initialization script --edit--
|
67 |
protected $plugin_production_script='page-scroll-to-id.min.js'; // Plugin public production script (main + init) --edit--
|
|
|
68 |
|
69 |
private function __construct(){
|
70 |
// Plugin requires PHP version 5.2 or higher
|
@@ -573,6 +574,18 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
573 |
if(isset($pl_i['dummyOffset']) && $pl_i['dummyOffset']['value']=='true'){
|
574 |
add_action('wp_footer', array($this, 'dummy_offset_element'), 99);
|
575 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
}
|
577 |
|
578 |
// WP Menu API menus HTML attributes fn
|
@@ -636,6 +649,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
636 |
$d20='true';
|
637 |
$d21='true';
|
638 |
$d23='false';
|
|
|
639 |
$d25='false';
|
640 |
$d31='false';
|
641 |
// Values
|
@@ -673,6 +687,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
673 |
$v20=(isset($_POST[$this->db_prefix.$i.'_adminDisplayWidgetsId'])) ? 'true' : 'false';
|
674 |
$v21=(isset($_POST[$this->db_prefix.$i.'_adminTinyMCEbuttons'])) ? 'true' : 'false';
|
675 |
$v23=(isset($_POST[$this->db_prefix.$i.'_unbindUnrelatedClickEvents'])) ? 'true' : 'false';
|
|
|
676 |
$v25=(isset($_POST[$this->db_prefix.$i.'_normalizeAnchorPointTargets'])) ? 'true' : 'false';
|
677 |
$v31=(isset($_POST[$this->db_prefix.$i.'_encodeLinks'])) ? 'true' : 'false';
|
678 |
break;
|
@@ -713,6 +728,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
713 |
$v20=(isset($j['adminDisplayWidgetsId'])) ? $j['adminDisplayWidgetsId']['value'] : $d20;
|
714 |
$v21=(isset($j['adminTinyMCEbuttons'])) ? $j['adminTinyMCEbuttons']['value'] : $d21;
|
715 |
$v23=(isset($j['unbindUnrelatedClickEvents'])) ? $j['unbindUnrelatedClickEvents']['value'] : $d23;
|
|
|
716 |
$v24=(isset($j['stopScrollOnUserAction'])) ? $j['stopScrollOnUserAction']['value'] : $d24;
|
717 |
$v25=(isset($j['normalizeAnchorPointTargets'])) ? $j['normalizeAnchorPointTargets']['value'] : $d25;
|
718 |
$v26=(isset($j['autoCorrectScroll'])) ? $j['autoCorrectScroll']['value'] : $d26;
|
@@ -755,6 +771,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
755 |
$v20=$d20;
|
756 |
$v21=$d21;
|
757 |
$v23=$d23;
|
|
|
758 |
$v25=$d25;
|
759 |
$v31=$d31;
|
760 |
}
|
@@ -1157,6 +1174,18 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
|
|
1157 |
'description' => 'Enable if another plugin or a theme script handles page scrolling and conflicts with "Page scroll to id" (removes other scripts js click events from the links)',
|
1158 |
'wrapper' => 'fieldset'
|
1159 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1160 |
'normalizeAnchorPointTargets' => array(
|
1161 |
'value' => $v25,
|
1162 |
'values' => null,
|
@@ -1198,11 +1227,8 @@ if(class_exists('malihuPageScroll2id')){ // --edit--
|
|
1198 |
// Widget class --edit--
|
1199 |
require_once(plugin_dir_path( __FILE__ ).'includes/class-malihu-pagescroll2id-widget.php');
|
1200 |
|
1201 |
-
//
|
1202 |
-
|
1203 |
-
// SEO notice class --edit--
|
1204 |
-
// See also admin.php and admin.css for settings page banner
|
1205 |
-
//require_once(plugin_dir_path( __FILE__ ).'includes/seo-admin-notice.php');
|
1206 |
|
1207 |
}
|
1208 |
?>
|
3 |
Plugin Name: Page scroll to id
|
4 |
Plugin URI: http://manos.malihu.gr/page-scroll-to-id
|
5 |
Description: Page scroll to id is an easy-to-use jQuery plugin that enables animated (smooth) page scrolling to specific id within the document.
|
6 |
+
Version: 1.7.3
|
7 |
Author: malihu
|
8 |
Author URI: http://manos.malihu.gr
|
9 |
License: MIT License (MIT)
|
47 |
|
48 |
class malihuPageScroll2id{ // --edit--
|
49 |
|
50 |
+
protected $version='1.7.3'; // Plugin version --edit--
|
51 |
protected $update_option=null;
|
52 |
|
53 |
protected $plugin_name='Page scroll to id'; // Plugin name --edit--
|
65 |
protected $plugin_script='jquery.malihu.PageScroll2id.js'; // Plugin public script (main js plugin file) --edit--
|
66 |
protected $plugin_init_script='jquery.malihu.PageScroll2id-init.js'; // Plugin public initialization script --edit--
|
67 |
protected $plugin_production_script='page-scroll-to-id.min.js'; // Plugin public production script (main + init) --edit--
|
68 |
+
protected $plugin_unbind_defer_script='jquery.malihu.PageScroll2id-unbind-defer.js'; // Plugin public special script --edit--
|
69 |
|
70 |
private function __construct(){
|
71 |
// Plugin requires PHP version 5.2 or higher
|
574 |
if(isset($pl_i['dummyOffset']) && $pl_i['dummyOffset']['value']=='true'){
|
575 |
add_action('wp_footer', array($this, 'dummy_offset_element'), 99);
|
576 |
}
|
577 |
+
// Unbind unrelated click events with specific selector
|
578 |
+
if(isset($pl_i['unbindUnrelatedClickEvents']) && $pl_i['unbindUnrelatedClickEvents']['value']=='true' && isset($pl_i['unbindUnrelatedClickEventsSelector']) && $pl_i['unbindUnrelatedClickEventsSelector']['value']!==''){
|
579 |
+
add_action('wp_enqueue_scripts', function() use ($pl_i) {
|
580 |
+
wp_register_script($this->plugin_slug.'-plugin-unbind-defer-script', plugins_url('js/'.$this->plugin_unbind_defer_script, __FILE__), array('jquery', $this->plugin_slug.'-plugin-script'), $this->version, 1);
|
581 |
+
wp_enqueue_script($this->plugin_slug.'-plugin-unbind-defer-script');
|
582 |
+
$params=array(
|
583 |
+
'unbindSelector' => $pl_i['unbindUnrelatedClickEventsSelector']['value'],
|
584 |
+
);
|
585 |
+
$loc_script=$this->plugin_slug.'-plugin-unbind-defer-script';
|
586 |
+
wp_localize_script($loc_script, $this->pl_pfx.'unbindScriptParams', $params);
|
587 |
+
}, 99);
|
588 |
+
}
|
589 |
}
|
590 |
|
591 |
// WP Menu API menus HTML attributes fn
|
649 |
$d20='true';
|
650 |
$d21='true';
|
651 |
$d23='false';
|
652 |
+
$d34='';
|
653 |
$d25='false';
|
654 |
$d31='false';
|
655 |
// Values
|
687 |
$v20=(isset($_POST[$this->db_prefix.$i.'_adminDisplayWidgetsId'])) ? 'true' : 'false';
|
688 |
$v21=(isset($_POST[$this->db_prefix.$i.'_adminTinyMCEbuttons'])) ? 'true' : 'false';
|
689 |
$v23=(isset($_POST[$this->db_prefix.$i.'_unbindUnrelatedClickEvents'])) ? 'true' : 'false';
|
690 |
+
$v34=$this->sanitize_input('text', $_POST[$this->db_prefix.$i.'_unbindUnrelatedClickEventsSelector'], $d34);
|
691 |
$v25=(isset($_POST[$this->db_prefix.$i.'_normalizeAnchorPointTargets'])) ? 'true' : 'false';
|
692 |
$v31=(isset($_POST[$this->db_prefix.$i.'_encodeLinks'])) ? 'true' : 'false';
|
693 |
break;
|
728 |
$v20=(isset($j['adminDisplayWidgetsId'])) ? $j['adminDisplayWidgetsId']['value'] : $d20;
|
729 |
$v21=(isset($j['adminTinyMCEbuttons'])) ? $j['adminTinyMCEbuttons']['value'] : $d21;
|
730 |
$v23=(isset($j['unbindUnrelatedClickEvents'])) ? $j['unbindUnrelatedClickEvents']['value'] : $d23;
|
731 |
+
$v34=(isset($j['unbindUnrelatedClickEventsSelector'])) ? $j['unbindUnrelatedClickEventsSelector']['value'] : $d34;
|
732 |
$v24=(isset($j['stopScrollOnUserAction'])) ? $j['stopScrollOnUserAction']['value'] : $d24;
|
733 |
$v25=(isset($j['normalizeAnchorPointTargets'])) ? $j['normalizeAnchorPointTargets']['value'] : $d25;
|
734 |
$v26=(isset($j['autoCorrectScroll'])) ? $j['autoCorrectScroll']['value'] : $d26;
|
771 |
$v20=$d20;
|
772 |
$v21=$d21;
|
773 |
$v23=$d23;
|
774 |
+
$v34=$d34;
|
775 |
$v25=$d25;
|
776 |
$v31=$d31;
|
777 |
}
|
1174 |
'description' => 'Enable if another plugin or a theme script handles page scrolling and conflicts with "Page scroll to id" (removes other scripts js click events from the links)',
|
1175 |
'wrapper' => 'fieldset'
|
1176 |
),
|
1177 |
+
'unbindUnrelatedClickEventsSelector' => array(
|
1178 |
+
'value' => $v34,
|
1179 |
+
'values' => null,
|
1180 |
+
'id' => $this->db_prefix.$i.'_unbindUnrelatedClickEventsSelector',
|
1181 |
+
'field_type' => 'text',
|
1182 |
+
'label' => '',
|
1183 |
+
'checkbox_label' => null,
|
1184 |
+
'radio_labels' => null,
|
1185 |
+
'field_info' => null,
|
1186 |
+
'description' => 'Prevent other scripts from handling plugin’s links selector(s)',
|
1187 |
+
'wrapper' => null
|
1188 |
+
),
|
1189 |
'normalizeAnchorPointTargets' => array(
|
1190 |
'value' => $v25,
|
1191 |
'values' => null,
|
1227 |
// Widget class --edit--
|
1228 |
require_once(plugin_dir_path( __FILE__ ).'includes/class-malihu-pagescroll2id-widget.php');
|
1229 |
|
1230 |
+
// plugin notice class (see also admin.php and admin.css for settings page banner) --edit--
|
1231 |
+
require_once(plugin_dir_path( __FILE__ ).'includes/ps2id-plugin-admin-notice.php');
|
|
|
|
|
|
|
1232 |
|
1233 |
}
|
1234 |
?>
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: malihu
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
|
4 |
Tags: page scrolling, page animation, smooth scroll, navigation, single-page navigation
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 1.7.
|
8 |
License: The MIT License (MIT)
|
9 |
License URI: http://opensource.org/licenses/MIT
|
10 |
|
@@ -100,6 +100,13 @@ Because it works and it already has a ton of features. The plugin has little dep
|
|
100 |
|
101 |
== Changelog ==
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
= 1.7.2 =
|
104 |
|
105 |
* Added an extended "Verify target position and readjust scrolling" option for lazy-load images, iframes, changes in document's length etc.
|
@@ -280,6 +287,10 @@ Because it works and it already has a ton of features. The plugin has little dep
|
|
280 |
|
281 |
== Upgrade Notice ==
|
282 |
|
|
|
|
|
|
|
|
|
283 |
= 1.7.2 =
|
284 |
|
285 |
Added an extended 'Verify target position and readjust scrolling' option (for lazy-load images, iframes etc.), added 'Force scroll type/easing' option, updated plugin's settings page, contextual help and notices.
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
|
4 |
Tags: page scrolling, page animation, smooth scroll, navigation, single-page navigation
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 5.8
|
7 |
+
Stable tag: 1.7.3
|
8 |
License: The MIT License (MIT)
|
9 |
License URI: http://opensource.org/licenses/MIT
|
10 |
|
100 |
|
101 |
== Changelog ==
|
102 |
|
103 |
+
= 1.7.3 =
|
104 |
+
|
105 |
+
* Fixed issue with target id attribute having special characters (like %, &, # etc.).
|
106 |
+
* Extended "Prevent other scripts from handling plugin’s links" option with special selector option field.
|
107 |
+
* Removed jQuery 1.x deprecated functions from plugin script (.bind, .delegate, .unbind etc. are replaced with .on, .off etc.).
|
108 |
+
* Updated plugin's contextual help and notices.
|
109 |
+
|
110 |
= 1.7.2 =
|
111 |
|
112 |
* Added an extended "Verify target position and readjust scrolling" option for lazy-load images, iframes, changes in document's length etc.
|
287 |
|
288 |
== Upgrade Notice ==
|
289 |
|
290 |
+
= 1.7.3 =
|
291 |
+
|
292 |
+
Fixed issue with target id attribute having special characters, extended "Prevent other scripts from handling plugin’s links" option with special selector option field, removed jQuery 1.x deprecated functions from plugin script, updated plugin's contextual help and notices.
|
293 |
+
|
294 |
= 1.7.2 =
|
295 |
|
296 |
Added an extended 'Verify target position and readjust scrolling' option (for lazy-load images, iframes etc.), added 'Force scroll type/easing' option, updated plugin's settings page, contextual help and notices.
|