Changeset 2322940
- Timestamp:
- 06/12/2020 11:22:26 AM (6 years ago)
- Location:
- scrolltotop/trunk
- Files:
-
- 7 edited
-
assets/js/scripts.js (modified) (1 diff)
-
assets/js/scripts.min.js (modified) (1 diff)
-
includes/scrolltotop-admin.php (modified) (47 diffs)
-
includes/scrolltotop-functions.php (modified) (1 diff)
-
languages/scrolltotop.pot (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
scrolltotop.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
scrolltotop/trunk/assets/js/scripts.js
r2188887 r2322940 1 (function ($) {1 (function ($) { 2 2 3 3 "use strict"; 4 4 5 var stt_loaded = false, 6 stt_scrollPosition = 0, 7 stt_scrolledByClick = false, 8 stt_containerBlock = $("#scrollToTop"), 9 stt_mode = stt_containerBlock.hasClass('stt-bar') ? 0 : 1, 10 stt_back = typeof sttBack !== "undefined" ? sttBack : true, 11 stt_containerArrow = stt_containerBlock.find('i'), 12 stt_containerCaption = stt_containerBlock.find('u'), 13 stt_pos = typeof sttPos !== "undefined" ? sttPos : 0, 14 stt_sticky = typeof sttStickyContainer !== "undefined" ? $(sttStickyContainer) : false, 15 stt_offset = typeof sttOffset !== "undefined" ? sttOffset : 1, 16 stt_instant_load = typeof sttOnload !== "undefined" ? sttOnload : true, 17 stt_advanced_bg = stt_containerBlock.find('.stt-advanced-bg'), 18 stt_advanced_bg_container = stt_containerBlock.find('.stt-advanced-bg'), 19 stt_advanced_bg_sticky = typeof sttAdvancedBgSticky !== "undefined" ? sttAdvancedBgSticky : false, 20 stt_bar_sticky = typeof sttBarSticky !== "undefined" ? sttBarSticky : false; 5 $(document).ready(function () { 21 6 22 function stt_visibility_update() { 23 if (stt_containerBlock.length) { 24 if ($(window).scrollTop() >= stt_offset || stt_offset == 0) { 25 if (!stt_loaded && stt_instant_load) stt_containerBlock.addClass('stt-notransition'); 26 stt_containerBlock.stop().addClass('stt-visible').removeClass('stt-hidden'); 27 } else if (stt_mode === 0 && !stt_scrolledByClick || stt_mode === 1) { 28 stt_containerBlock.stop().addClass('stt-hidden').removeClass('stt-visible stt-notransition'); 7 let stt_scrollToPosition = typeof sttScrollToValue !== "undefined" ? sttScrollToValue : 0; 8 if (typeof sttScrollToElement !== "undefined") { 9 const $scrollToElement = $(sttScrollToElement); 10 11 if ($scrollToElement.length) { 12 stt_scrollToPosition = $scrollToElement.offset().top; 13 } 14 } 15 16 let st = $(window).scrollTop(), 17 stt_loaded = false, 18 stt_scrollPosition = 0, 19 stt_scrolledByClick = false, 20 stt_containerBlock = $("#scrollToTop"), 21 stt_mode = stt_containerBlock.hasClass('stt-bar') ? 0 : 1, 22 stt_back = typeof sttBack !== "undefined" ? sttBack : true, 23 stt_containerArrow = stt_containerBlock.find('i'), 24 stt_containerCaption = stt_containerBlock.find('u'), 25 stt_pos = typeof sttPos !== "undefined" ? sttPos : 0, 26 stt_sticky = typeof sttStickyContainer !== "undefined" ? $(sttStickyContainer) : false, 27 stt_offset = typeof sttOffset !== "undefined" ? sttOffset : 1, 28 stt_instant_load = typeof sttOnload !== "undefined" ? sttOnload : true, 29 stt_advanced_bg = stt_containerBlock.find('.stt-advanced-bg'), 30 stt_advanced_bg_container = stt_containerBlock.find('.stt-advanced-bg'), 31 stt_advanced_bg_sticky = typeof sttAdvancedBgSticky !== "undefined" ? sttAdvancedBgSticky : false, 32 stt_bar_sticky = typeof sttBarSticky !== "undefined" ? sttBarSticky : false; 33 34 if (stt_scrollToPosition > stt_offset) { 35 stt_offset = stt_scrollToPosition + 1; 36 } 37 38 stt_containerBlock.addClass('js-enabled'); 39 stt_visibility_update(); 40 stt_loaded = true; 41 42 function stt_visibility_update() { 43 if (stt_containerBlock.length) { 44 if (st >= stt_offset || stt_offset <= stt_scrollToPosition) { 45 if (!stt_loaded && stt_instant_load) stt_containerBlock.addClass('stt-notransition'); 46 stt_containerBlock.stop().addClass('stt-visible').removeClass('stt-hidden'); 47 } else if (stt_mode === 0 && !stt_scrolledByClick || stt_mode === 1) { 48 stt_containerBlock.stop().addClass('stt-hidden').removeClass('stt-visible stt-notransition'); 49 } 50 51 if (stt_sticky && stt_sticky.length && (stt_advanced_bg.length && stt_advanced_bg_container.length && stt_advanced_bg_sticky || stt_bar_sticky) && stt_pos !== null) { 52 var stt_sticky_object; 53 if (stt_bar_sticky && stt_pos === 0) { 54 stt_sticky_object = stt_containerBlock; 55 } else if (stt_advanced_bg_sticky) { 56 stt_sticky_object = stt_advanced_bg; 57 } 58 59 if (stt_pos === 1) { 60 if (stt_mode === 0) { 61 stt_sticky_object.width($(window).width() - stt_containerBlock.css('right').replace(/\D/g, '') - (stt_sticky.offset().left + stt_sticky.outerWidth())); 62 } else if (stt_mode === 1) { 63 stt_sticky_object.width($(window).width() - (stt_sticky.offset().left + stt_sticky.outerWidth())); 64 } 65 } else { 66 if (stt_mode === 0) { 67 stt_sticky_object.width(stt_sticky.offset().left - stt_containerBlock.offset().left); 68 } else if (stt_mode === 1) { 69 stt_sticky_object.width(stt_sticky.offset().left); 70 } 71 } 72 } 73 } 74 } 75 76 stt_containerBlock.click(function (e) { 77 e.preventDefault(); 78 79 if (stt_mode === 0) { 80 if (stt_scrollPosition === 0 && st > stt_scrollToPosition && stt_back) { 81 stt_scrollPosition = st; 82 $("html, body").animate({ 83 scrollTop: stt_scrollToPosition 84 }, 0); 85 stt_containerArrow.removeClass('icon-up').addClass('icon-down'); 86 stt_containerCaption.hide(); 87 stt_scrolledByClick = true; 88 } else { 89 $("html, body").animate({ 90 scrollTop: stt_scrollPosition 91 }, 0); 92 stt_containerArrow.removeClass('icon-down').addClass('icon-up'); 93 stt_containerCaption.show(); 94 stt_scrollPosition = stt_scrollToPosition; 95 } 96 } else if (stt_mode === 1) { 97 let sttMultipier = 200, 98 sttWinHeight = $(window).height(), 99 sttDocHeight = $(document).height(), 100 sttProportion = Math.floor(sttDocHeight / sttWinHeight), 101 sttDuration = sttProportion * sttMultipier, 102 sttDurationRange = { 103 min: 200, 104 max: 1000 105 }; 106 107 if (sttDuration < sttDurationRange.min) { 108 sttDuration = sttDurationRange.min; 109 } 110 111 if (sttDuration > sttDurationRange.max) { 112 sttDuration = sttDurationRange.max; 113 } 114 115 $('html, body').animate({ 116 scrollTop: stt_scrollToPosition 117 }, sttDuration); 29 118 } 30 119 31 if (stt_sticky && stt_sticky.length && (stt_advanced_bg.length && stt_advanced_bg_container.length && stt_advanced_bg_sticky || stt_bar_sticky) && stt_pos !== null) { 32 var stt_sticky_object; 33 if (stt_bar_sticky && stt_pos === 0) { 34 stt_sticky_object = stt_containerBlock; 35 } else if (stt_advanced_bg_sticky) { 36 stt_sticky_object = stt_advanced_bg; 37 } 120 }); 38 121 39 if (stt_pos === 1) { 40 if (stt_mode === 0) { 41 stt_sticky_object.width($(window).width() - stt_containerBlock.css('right').replace(/\D/g, '') - (stt_sticky.offset().left + stt_sticky.outerWidth())); 42 } else if (stt_mode === 1) { 43 stt_sticky_object.width($(window).width() - (stt_sticky.offset().left + stt_sticky.outerWidth())); 44 } 45 } else { 46 if (stt_mode === 0) { 47 stt_sticky_object.width(stt_sticky.offset().left - stt_containerBlock.offset().left); 48 } else if (stt_mode === 1) { 49 stt_sticky_object.width(stt_sticky.offset().left); 50 } 51 } 52 } 53 } 54 } 122 $(window).scroll(function () { 123 st = $(window).scrollTop(); 55 124 56 stt_containerBlock.click(function(e) { 57 e.preventDefault(); 125 stt_visibility_update(); 58 126 59 if (stt_mode === 0) { 60 if (stt_scrollPosition == 0 && $(window).scrollTop() != 0 && stt_back) { 61 stt_scrollPosition = $(window).scrollTop(); 62 $("html, body").animate({ 63 scrollTop: 0 64 }, 0); 65 stt_containerArrow.removeClass('icon-up').addClass('icon-down'); 66 stt_containerCaption.hide(); 67 stt_scrolledByClick = true; 68 } else { 69 $("html, body").animate({ 70 scrollTop: stt_scrollPosition 71 }, 0); 127 if (stt_scrolledByClick && st !== stt_scrollToPosition) { 128 stt_scrolledByClick = false; 129 stt_scrollPosition = 0; 72 130 stt_containerArrow.removeClass('icon-down').addClass('icon-up'); 73 131 stt_containerCaption.show(); 74 stt_scrollPosition = 0;75 132 } 76 } else if (stt_mode === 1) { 77 var sttMultipier = 200, 78 sttWinHeight = $(window).height(), 79 sttDocHeight = $(document).height(), 80 sttProportion = Math.floor(sttDocHeight / sttWinHeight), 81 sttDuration = sttProportion * sttMultipier, 82 sttDurationRange = { 83 min: 200, 84 max: 1000 85 }; 133 }); 86 134 87 if (sttDuration < sttDurationRange.min) {88 sttDuration = sttDurationRange.min;89 }135 $(window).resize(function () { 136 stt_visibility_update(); 137 }); 90 138 91 if (sttDuration > sttDurationRange.max) { 92 sttDuration = sttDurationRange.max; 93 } 94 95 $('html, body').animate({ 96 scrollTop: 0 97 }, sttDuration); 98 } 139 $('html, body').bind('scroll DOMMouseScroll mousewheel keyup', function () { 140 $('html, body').stop(); 141 }); 99 142 100 143 }); 101 144 102 $(document).ready(function() {103 stt_containerBlock.addClass('js-enabled');104 stt_visibility_update();105 stt_loaded = true;106 });107 108 $(window).scroll(function() {109 stt_visibility_update();110 111 if (stt_scrolledByClick && $(window).scrollTop() != 0) {112 stt_scrolledByClick = false;113 stt_scrollPosition = 0;114 stt_containerArrow.removeClass('icon-down').addClass('icon-up');115 stt_containerCaption.show();116 }117 });118 119 $(window).resize(function() {120 stt_visibility_update();121 });122 123 $('html, body').bind('scroll DOMMouseScroll mousewheel keyup', function(e) {124 $('html, body').stop();125 });126 127 145 })(jQuery); -
scrolltotop/trunk/assets/js/scripts.min.js
r2188887 r2322940 1 !function( i){"use strict";var o=!1,l=0,a=!1,e=i("#scrollToTop"),f=e.hasClass("stt-bar")?0:1,c="undefined"==typeof sttBack||sttBack,r=e.find("i"),h=e.find("u"),s="undefined"!=typeof sttPos?sttPos:0,n="undefined"!=typeof sttStickyContainer&&i(sttStickyContainer),d="undefined"!=typeof sttOffset?sttOffset:1,w="undefined"==typeof sttOnload||sttOnload,u=e.find(".stt-advanced-bg"),p=e.find(".stt-advanced-bg"),y="undefined"!=typeof sttAdvancedBgSticky&&sttAdvancedBgSticky,m="undefined"!=typeof sttBarSticky&&sttBarSticky;function t(){var t;e.length&&(i(window).scrollTop()>=d||0==d?(!o&&w&&e.addClass("stt-notransition"),e.stop().addClass("stt-visible").removeClass("stt-hidden")):(0!=f||a)&&1!=f||e.stop().addClass("stt-hidden").removeClass("stt-visible stt-notransition"),n&&n.length&&(u.length&&p.length&&y||m)&&null!==s&&(m&&0===s?t=e:y&&(t=u),1===s?0==f?t.width(i(window).width()-e.css("right").replace(/\D/g,"")-(n.offset().left+n.outerWidth())):1==f&&t.width(i(window).width()-(n.offset().left+n.outerWidth())):0==f?t.width(n.offset().left-e.offset().left):1==f&&t.width(n.offset().left)))}e.click(function(t){if(t.preventDefault(),0==f)0==l&&0!=i(window).scrollTop()&&c?(l=i(window).scrollTop(),i("html, body").animate({scrollTop:0},0),r.removeClass("icon-up").addClass("icon-down"),h.hide(),a=!0):(i("html, body").animate({scrollTop:l},0),r.removeClass("icon-down").addClass("icon-up"),h.show(),l=0);else if(1==f){var o=i(window).height(),e=i(document).height(),s=200*Math.floor(e/o),n=200,d=1e3;s<n&&(s=n),d<s&&(s=d),i("html, body").animate({scrollTop:0},s)}}),i(document).ready(function(){e.addClass("js-enabled"),t(),o=!0}),i(window).scroll(function(){t(),a&&0!=i(window).scrollTop()&&(a=!1,l=0,r.removeClass("icon-down").addClass("icon-up"),h.show())}),i(window).resize(function(){t()}),i("html, body").bind("scroll DOMMouseScroll mousewheel keyup",function(t){i("html, body").stop()})}(jQuery);1 !function(t){"use strict";t(document).ready(function(){let e="undefined"!=typeof sttScrollToValue?sttScrollToValue:0;if("undefined"!=typeof sttScrollToElement){const o=t(sttScrollToElement);o.length&&(e=o.offset().top)}let o=t(window).scrollTop(),s=!1,n=0,d=!1,i=t("#scrollToTop"),l=i.hasClass("stt-bar")?0:1,a="undefined"==typeof sttBack||sttBack,f=i.find("i"),c=i.find("u"),r="undefined"!=typeof sttPos?sttPos:0,u="undefined"!=typeof sttStickyContainer&&t(sttStickyContainer),h="undefined"!=typeof sttOffset?sttOffset:1,w="undefined"==typeof sttOnload||sttOnload,p=i.find(".stt-advanced-bg"),m=i.find(".stt-advanced-bg"),y="undefined"!=typeof sttAdvancedBgSticky&&sttAdvancedBgSticky,C="undefined"!=typeof sttBarSticky&&sttBarSticky;function g(){var n;i.length&&(o>=h||h<=e?(!s&&w&&i.addClass("stt-notransition"),i.stop().addClass("stt-visible").removeClass("stt-hidden")):(0===l&&!d||1===l)&&i.stop().addClass("stt-hidden").removeClass("stt-visible stt-notransition"),u&&u.length&&(p.length&&m.length&&y||C)&&null!==r&&(C&&0===r?n=i:y&&(n=p),1===r?0===l?n.width(t(window).width()-i.css("right").replace(/\D/g,"")-(u.offset().left+u.outerWidth())):1===l&&n.width(t(window).width()-(u.offset().left+u.outerWidth())):0===l?n.width(u.offset().left-i.offset().left):1===l&&n.width(u.offset().left)))}e>h&&(h=e+1),i.addClass("js-enabled"),g(),s=!0,i.click(function(s){if(s.preventDefault(),0===l)0===n&&o>e&&a?(n=o,t("html, body").animate({scrollTop:e},0),f.removeClass("icon-up").addClass("icon-down"),c.hide(),d=!0):(t("html, body").animate({scrollTop:n},0),f.removeClass("icon-down").addClass("icon-up"),c.show(),n=e);else if(1===l){let o=200,s=t(window).height(),n=t(document).height(),d=Math.floor(n/s)*o,i={min:200,max:1e3};d<i.min&&(d=i.min),d>i.max&&(d=i.max),t("html, body").animate({scrollTop:e},d)}}),t(window).scroll(function(){o=t(window).scrollTop(),g(),d&&o!==e&&(d=!1,n=0,f.removeClass("icon-down").addClass("icon-up"),c.show())}),t(window).resize(function(){g()}),t("html, body").bind("scroll DOMMouseScroll mousewheel keyup",function(){t("html, body").stop()})})}(jQuery); -
scrolltotop/trunk/includes/scrolltotop-admin.php
r2309158 r2322940 34 34 35 35 <h2 class="scrolltotop-title"><?php esc_html_e( 'scrollToTop Settings', 'scrolltotop' ); ?> <span 36 class="scrolltotop-version">v<? php echo $global_scrolltotop_version;?></span></h2>36 class="scrolltotop-version">v<?= $global_scrolltotop_version ?></span></h2> 37 37 38 38 <section class="plugin-settings" role="main"> … … 68 68 add_settings_section( 'stt_general', esc_html__( 'General Settings', 'scrolltotop' ), '__return_false', 'scrolltotop' ); 69 69 add_settings_field( 'stt_mode', esc_html__( 'Mode', 'scrolltotop' ), 'stt_mode_field', 'scrolltotop', 'stt_general' ); 70 add_settings_field( 'stt_scroll_offset', esc_html__( 'Scroll offset', 'scrolltotop' ), 'stt_scroll_offset_field', 'scrolltotop', 'stt_general' ); 71 72 // bar settings 70 add_settings_field( 'stt_scroll_offset', esc_html__( 'Scroll offset', 'scrolltotop' ), 'stt_scroll_offset_field', 'scrolltotop', 'stt_general' ); 71 add_settings_field( 'stt_scroll_to', esc_html__( 'Scroll to value/element', 'scrolltotop' ), 'stt_scroll_to_field', 'scrolltotop', 'stt_general' ); 72 73 // bar settings 73 74 add_settings_section( 'stt_bar_settings', esc_html__( 'Bar Settings', 'scrolltotop' ), '__return_false', 'scrolltotop' ); 74 75 add_settings_field( 'stt_bar_position', esc_html__( 'Position', 'scrolltotop' ), 'stt_bar_position_field', 'scrolltotop', 'stt_bar_settings' ); … … 178 179 ?> 179 180 <input name="scrolltotop_plugin_settings[stt_bar_top_offset]" type="number" min="0" id="stt_bar_top_offset" 180 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>181 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 181 182 <?php 182 183 } … … 187 188 188 189 <input name="scrolltotop_plugin_settings[stt_bar_horizontal_offset]" type="number" min="0" 189 id="stt_bar_horizontal_offset" value="<? php echo (int) $settings;?>"190 id="stt_bar_horizontal_offset" value="<?= (int) $settings ?>" 190 191 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 191 192 … … 220 221 <?php esc_html_e( "Width:", 'scrolltotop' ); ?> <input 221 222 name="scrolltotop_plugin_settings[stt_advanced_background_width]" type="number" min="0" 222 id="stt_advanced_background_width" value="<? php echo (int) $settings;?>"223 id="stt_advanced_background_width" value="<?= (int) $settings ?>" 223 224 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 224 225 </label> … … 238 239 <label class="stt_margin_top_15px"><?php esc_html_e( "Hide advanced background if user's screen is less than", 'scrolltotop' ); ?> 239 240 <input name="scrolltotop_plugin_settings[stt_advanced_background_hide]" type="number" min="0" 240 id="stt_advanced_background_hide" value="<? php echo (int) $settings;?>"241 id="stt_advanced_background_hide" value="<?= (int) $settings ?>" 241 242 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 242 243 </label> … … 251 252 <label><?php esc_html_e( 'Show scrollToTop after scrolling', 'scrolltotop' ); ?> 252 253 <input name="scrolltotop_plugin_settings[stt_scroll_offset]" type="number" min="0" id="stt_scroll_offset" 253 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>254 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 254 255 </label> 255 256 <p class="description"><?php esc_html_e( '0 – is always visible', 'scrolltotop' ); ?></p> 256 257 <?php 258 } 259 260 function stt_scroll_to_field() { 261 $settings = scrolltotop_get_plugin_settings( 'stt_scroll_to' ); 262 ?> 263 <label> 264 <input name="scrolltotop_plugin_settings[stt_scroll_to]" type="text" id="stt_scroll_to" 265 value="<?= $settings ?>" /> 266 </label> 267 <p class="description"><?php _e( 'Can be number of pixels (without <code>px</code>) or jQuery selectors like: <code>#example</code>, <code>.example:first</code>', 'scrolltotop' ); ?></p> 268 <?php 257 269 } 258 270 … … 261 273 ?> 262 274 <input name="scrolltotop_plugin_settings[stt_bar_text]" type="text" placeholder="Scroll to Top" id="stt_bar_text" 263 value="<? php echo $settings;?>"/>275 value="<?= $settings ?>"/> 264 276 <?php 265 277 } … … 269 281 ?> 270 282 <input name="scrolltotop_plugin_settings[stt_bar_text_distance]" type="number" min="0" id="stt_bar_text_distance" 271 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>283 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 272 284 <?php 273 285 } … … 277 289 ?> 278 290 <input name="scrolltotop_plugin_settings[stt_bar_fade_duration]" type="number" min="0" step="100" max="1000" 279 id="stt_bar_fade_duration" value="<? php echo (int) $settings;?>"291 id="stt_bar_fade_duration" value="<?= (int) $settings ?>" 280 292 class="small-text"/> <?php esc_html_e( 'ms', 'scrolltotop' ); ?> 281 293 <p class="description"><?php esc_html_e( '0 – disable fade effect', 'scrolltotop' ); ?></p> … … 330 342 ?> 331 343 <input name="scrolltotop_plugin_settings[stt_bar_width]" type="number" id="stt_bar_width" 332 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>344 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 333 345 334 346 <?php $settings = scrolltotop_get_plugin_settings( 'stt_bar_sticky' ); ?> … … 345 357 ?> 346 358 <input name="scrolltotop_plugin_settings[stt_bar_opacity]" type="number" min="5" max="100" step="5" 347 id="stt_bar_opacity" value="<? php echo (int) $settings;?>" class="small-text"/> %359 id="stt_bar_opacity" value="<?= (int) $settings ?>" class="small-text"/> % 348 360 <?php 349 361 } … … 452 464 ?> 453 465 <input name="scrolltotop_plugin_settings[stt_bar_arrow_rotate_speed]" type="number" min="0" step="50" 454 id="stt_bar_arrow_rotate_speed" value="<? php echo (int) $settings;?>"466 id="stt_bar_arrow_rotate_speed" value="<?= (int) $settings ?>" 455 467 class="small-text"/> <?php esc_html_e( 'ms', 'scrolltotop' ); ?> 456 468 <p class="description"><?php esc_html_e( '0 – instant rotate', 'scrolltotop' ); ?></p> … … 465 477 <input type="text" class="color-picker" data-alpha="true" data-default-color="rgba( 0,0,0,0.2 )" 466 478 name="scrolltotop_plugin_settings[stt_bar_background_color]" id="stt_bar_background_color" 467 value="<? php echo sanitize_text_field( $settings );?>"/>479 value="<?= sanitize_text_field( $settings ) ?>"/> 468 480 <p class="description"><?php esc_html_e( 'Normal', 'scrolltotop' ); ?></p> 469 481 </fieldset> … … 475 487 <input type="text" class="color-picker" data-alpha="true" data-default-color="rgba( 0,0,0,0.3 )" 476 488 name="scrolltotop_plugin_settings[stt_bar_background_color_on_hover]" 477 id="stt_bar_background_color_on_hover" value="<? php echo sanitize_text_field( $settings );?>"/>489 id="stt_bar_background_color_on_hover" value="<?= sanitize_text_field( $settings ) ?>"/> 478 490 <p class="description"><?php esc_html_e( 'On hover', 'scrolltotop' ); ?></p> 479 491 </fieldset> … … 485 497 ?> 486 498 <input name="scrolltotop_plugin_settings[stt_bar_hover_transition]" type="number" min="0" step="50" 487 id="stt_bar_hover_transition" value="<? php echo (int) $settings;?>"499 id="stt_bar_hover_transition" value="<?= (int) $settings ?>" 488 500 class="small-text"/> <?php esc_html_e( 'ms', 'scrolltotop' ); ?> 489 501 <p class="description"><?php esc_html_e( '0 – disable smooth effect', 'scrolltotop' ); ?></p> … … 495 507 ?> 496 508 <input name="scrolltotop_plugin_settings[stt_bar_text_offset]" type="number" min="0" id="stt_bar_text_offset" 497 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>509 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 498 510 <?php 499 511 } … … 506 518 <input type="text" class="color-picker" data-alpha="true" data-default-color="#000000" 507 519 name="scrolltotop_plugin_settings[stt_bar_color]" id="stt_bar_color" 508 value="<? php echo $settings;?>"/>520 value="<?= $settings ?>"/> 509 521 </p> 510 522 </fieldset> … … 516 528 ?> 517 529 <input name="scrolltotop_plugin_settings[stt_bar_arrow_size]" type="number" min="0" max="100" 518 id="stt_bar_arrow_size" value="<? php echo (int) $settings;?>"530 id="stt_bar_arrow_size" value="<?= (int) $settings ?>" 519 531 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 520 532 <p class="description"><?php esc_html_e( "0 – don't show the arrow", 'scrolltotop' ); ?></p> … … 526 538 ?> 527 539 <input name="scrolltotop_plugin_settings[stt_bar_caption_size]" type="number" min="0" max="30" 528 id="stt_bar_caption_size" value="<? php echo (int) $settings;?>"540 id="stt_bar_caption_size" value="<?= (int) $settings ?>" 529 541 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 530 542 <?php … … 557 569 <input name="scrolltotop_plugin_settings[stt_bar_caption_font]" type="text" 558 570 placeholder=""Arial", sans-serif" id="stt_bar_caption_font" 559 value="<? php echo esc_attr( $settings );?>"/>571 value="<?= esc_attr( $settings ) ?>"/> 560 572 <?php 561 573 } … … 565 577 ?> 566 578 <input name="scrolltotop_plugin_settings[stt_sticky_container]" type="text" id="stt_sticky_container" 567 value="<? php echo esc_attr( $settings );?>"/>568 <p class="description"><?php esc_html_e( "Usually this is #primary, #wrapper, #secondary, #sidebar or #content", 'scrolltotop' ); ?></p>579 value="<?= esc_attr( $settings ) ?>"/> 580 <p class="description"><?php _e( "Usually this is <code>#primary</code>, <code>#wrapper</code>, <code>#secondary</code>, <code>#sidebar</code> or <code>#content</code>", 'scrolltotop' ); ?></p> 569 581 <?php 570 582 } … … 617 629 <textarea name="scrolltotop_plugin_settings[stt_custom_css]" id="stt_custom_css" 618 630 placeholder="#scrollToTop { border-right: 1px solid #bbbbbb; }" id="stt_custom_css" cols="50" 619 rows="12"><? php echo $settings;?></textarea>631 rows="12"><?= $settings ?></textarea> 620 632 <?php 621 633 } … … 626 638 <label><?php esc_html_e( "Set width to", 'scrolltotop' ); ?> 627 639 <input name="scrolltotop_plugin_settings[stt_bar_make_smaller_width]" type="number" min="0" step="5" 628 id="stt_bar_make_smaller_width" value="<? php echo (int) $settings;?>"640 id="stt_bar_make_smaller_width" value="<?= (int) $settings ?>" 629 641 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?></label> 630 642 … … 634 646 <?php esc_html_e( "if user's screen is less than", 'scrolltotop' ); ?> 635 647 <input name="scrolltotop_plugin_settings[stt_bar_make_smaller_screen]" type="number" min="0" 636 id="stt_bar_make_smaller_screen" value="<? php echo (int) $settings;?>"648 id="stt_bar_make_smaller_screen" value="<?= (int) $settings ?>" 637 649 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 638 650 </label> … … 647 659 <?php esc_html_e( "Set padding to", 'scrolltotop' ); ?> 648 660 <input name="scrolltotop_plugin_settings[stt_button_make_smaller_padding]" type="number" min="0" 649 id="stt_button_make_smaller_padding" value="<? php echo (int) $settings;?>"661 id="stt_button_make_smaller_padding" value="<?= (int) $settings ?>" 650 662 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 651 663 </label> … … 656 668 <?php esc_html_e( "and arrow size to", 'scrolltotop' ); ?> 657 669 <input name="scrolltotop_plugin_settings[stt_button_make_smaller_arrow_size]" type="number" min="0" 658 id="stt_button_make_smaller_arrow_size" value="<? php echo (int) $settings;?>"670 id="stt_button_make_smaller_arrow_size" value="<?= (int) $settings ?>" 659 671 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 660 672 </label> … … 665 677 <?php esc_html_e( "if user's screen is less than", 'scrolltotop' ); ?> 666 678 <input name="scrolltotop_plugin_settings[stt_button_make_smaller_screen]" type="number" min="0" 667 id="stt_button_make_smaller_screen" value="<? php echo (int) $settings;?>"679 id="stt_button_make_smaller_screen" value="<?= (int) $settings ?>" 668 680 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 669 681 </label> … … 678 690 <?php esc_html_e( "Hide if user's screen is less than", 'scrolltotop' ); ?> 679 691 <input name="scrolltotop_plugin_settings[stt_bar_hide]" type="number" min="0" id="stt_bar_hide" 680 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>692 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 681 693 </label> 682 694 … … 689 701 id="stt_bar_transform_to_button" 690 702 value="1" <?php checked( 1, $settings ); ?> /><?php esc_html_e( "Transform into button instead of hide", 'scrolltotop' ); ?> 691 <span class="stt-new"><? php echo esc_html__( 'NEW', 'scrolltotop' );?></span>703 <span class="stt-new"><?= esc_html__( 'NEW', 'scrolltotop' ) ?></span> 692 704 </label> 693 705 <?php … … 698 710 ?> 699 711 <input name="scrolltotop_plugin_settings[stt_bar_transformed_size]" type="number" min="0" 700 id="stt_bar_transformed_size" value="<? php echo (int) $settings;?>"712 id="stt_bar_transformed_size" value="<?= (int) $settings ?>" 701 713 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 702 714 <?php … … 749 761 ?> 750 762 <input name="scrolltotop_plugin_settings[stt_bar_transformed_vertical_offset]" type="number" min="0" 751 id="stt_bar_transformed_vertical_offset" value="<? php echo (int) $settings;?>"763 id="stt_bar_transformed_vertical_offset" value="<?= (int) $settings ?>" 752 764 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 753 765 <?php … … 758 770 ?> 759 771 <input name="scrolltotop_plugin_settings[stt_bar_transformed_horizontal_offset]" type="number" min="0" 760 id="stt_bar_transformed_horizontal_offset" value="<? php echo (int) $settings;?>"772 id="stt_bar_transformed_horizontal_offset" value="<?= (int) $settings ?>" 761 773 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 762 774 <?php … … 767 779 ?> 768 780 <input name="scrolltotop_plugin_settings[stt_bar_transformed_border_radius]" type="text" 769 id="stt_bar_transformed_border_radius" value="<? php echo $settings;?>" class="small-text"/>781 id="stt_bar_transformed_border_radius" value="<?= $settings ?>" class="small-text"/> 770 782 <?php 771 783 } … … 777 789 <?php esc_html_e( "Hide if user's screen is less than", 'scrolltotop' ); ?> 778 790 <input name="scrolltotop_plugin_settings[stt_button_hide]" type="number" min="0" id="stt_button_hide" 779 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>791 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 780 792 </label> 781 793 … … 809 821 ?> 810 822 <input name="scrolltotop_plugin_settings[stt_button_padding]" type="number" min="0" id="stt_button_padding" 811 value="<? php echo (int) $settings;?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?>823 value="<?= (int) $settings ?>" class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 812 824 <?php 813 825 } … … 817 829 ?> 818 830 <input name="scrolltotop_plugin_settings[stt_button_opacity]" type="number" min="5" max="100" step="5" 819 id="stt_button_opacity" value="<? php echo (int) $settings;?>" class="small-text"/> %831 id="stt_button_opacity" value="<?= (int) $settings ?>" class="small-text"/> % 820 832 <?php 821 833 } … … 825 837 ?> 826 838 <input name="scrolltotop_plugin_settings[stt_button_horizontal_offset]" type="number" min="0" 827 id="stt_button_horizontal_offset" value="<? php echo (int) $settings;?>"839 id="stt_button_horizontal_offset" value="<?= (int) $settings ?>" 828 840 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 829 841 <?php … … 834 846 ?> 835 847 <input name="scrolltotop_plugin_settings[stt_button_vertical_offset]" type="number" min="0" 836 id="stt_button_vertical_offset" value="<? php echo (int) $settings;?>"848 id="stt_button_vertical_offset" value="<?= (int) $settings ?>" 837 849 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 838 850 <?php … … 843 855 ?> 844 856 <input name="scrolltotop_plugin_settings[stt_button_border_radius]" type="text" id="stt_button_border_radius" 845 value="<? php echo $settings;?>" class="small-text"/>857 value="<?= $settings ?>" class="small-text"/> 846 858 <?php 847 859 } … … 853 865 <input type="text" class="color-picker" data-alpha="true" data-default-color="#f44336" 854 866 name="scrolltotop_plugin_settings[stt_button_background_color]" id="stt_button_background_color" 855 value="<? php echo sanitize_text_field( $settings );?>"/>867 value="<?= sanitize_text_field( $settings ) ?>"/> 856 868 <p class="description"><?php esc_html_e( 'Normal', 'scrolltotop' ); ?></p> 857 869 </fieldset> … … 862 874 <input type="text" class="color-picker" data-alpha="true" data-default-color="#ff1744" 863 875 name="scrolltotop_plugin_settings[stt_button_background_color_on_hover]" 864 id="stt_button_background_color_on_hover" value="<? php echo sanitize_text_field( $settings );?>"/>876 id="stt_button_background_color_on_hover" value="<?= sanitize_text_field( $settings ) ?>"/> 865 877 <p class="description"><?php esc_html_e( 'On hover', 'scrolltotop' ); ?></p> 866 878 </fieldset> … … 885 897 <?php esc_html_e( 'Speed:', 'scrolltotop' ); ?> 886 898 <input name="scrolltotop_plugin_settings[stt_button_animation_speed]" type="number" min="1" max="1000" 887 id="stt_button_animation_speed" value="<? php echo (int) $settings;?>"899 id="stt_button_animation_speed" value="<?= (int) $settings ?>" 888 900 class="small-text"/> <?php esc_html_e( 'ms', 'scrolltotop' ); ?> 889 901 </label> … … 903 915 ?> 904 916 <input name="scrolltotop_plugin_settings[stt_button_hover_transition]" type="number" min="0" step="50" 905 id="stt_button_hover_transition" value="<? php echo (int) $settings;?>"917 id="stt_button_hover_transition" value="<?= (int) $settings ?>" 906 918 class="small-text"/> <?php esc_html_e( 'ms', 'scrolltotop' ); ?> 907 919 <p class="description"><?php esc_html_e( '0 – disable smooth effect', 'scrolltotop' ); ?></p> … … 916 928 <input type="text" class="color-picker" data-alpha="true" data-default-color="#ffffff" 917 929 name="scrolltotop_plugin_settings[stt_button_arrow_color]" id="stt_button_arrow_color" 918 value="<? php echo $settings;?>"/>930 value="<?= $settings ?>"/> 919 931 </p> 920 932 </fieldset> … … 926 938 ?> 927 939 <input name="scrolltotop_plugin_settings[stt_button_arrow_size]" type="number" min="5" max="100" 928 id="stt_button_arrow_size" value="<? php echo (int) $settings;?>"940 id="stt_button_arrow_size" value="<?= (int) $settings ?>" 929 941 class="small-text"/> <?php esc_html_e( 'px', 'scrolltotop' ); ?> 930 942 <?php … … 1159 1171 $settings['stt_bar_horizontal_offset'] = absint( $settings['stt_bar_horizontal_offset'] ); 1160 1172 $settings['stt_scroll_offset'] = absint( $settings['stt_scroll_offset'] ); 1173 $settings['stt_scroll_to'] = is_numeric( substr( $settings['stt_scroll_to'], 0, 1 ) ) ? absint( $settings['stt_scroll_to'] ) : preg_replace( '/(px|em|%)$/m', '', trim( sanitize_text_field( $settings['stt_scroll_to'] ) ) ); 1161 1174 $settings['stt_bar_fade_duration'] = absint( $settings['stt_bar_fade_duration'] ); 1162 1175 $settings['stt_bar_opacity'] = absint( $settings['stt_bar_opacity'] ); -
scrolltotop/trunk/includes/scrolltotop-functions.php
r2309158 r2322940 16 16 'stt_bar_horizontal_offset' => 0, 17 17 'stt_scroll_offset' => 1, 18 'stt_scroll_to' => 0, 18 19 'stt_bar_text' => '', 19 20 'stt_bar_text_distance' => '', -
scrolltotop/trunk/languages/scrolltotop.pot
r2133306 r2322940 8 8 "Project-Id-Version: scrollToTop\n" 9 9 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/scrolltotop/\n" 10 "POT-Creation-Date: 20 19-08-03 14:22+0300\n"11 "PO-Revision-Date: 2019-08-03 14:23+0300\n"10 "POT-Creation-Date: 2020-06-12 10:54+0000\n" 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: Roman Sarvarov <[email protected]>\n" 13 13 "Language-Team: \n" … … 16 16 "Content-Type: text/plain; charset=UTF-8\n" 17 17 "Content-Transfer-Encoding: 8bit\n" 18 "Plural-Forms: \n"19 "X-Generator: Eazy Po 0.9.5.3\n"20 21 #: scrolltotop.php:5 3818 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 19 "X-Generator: Loco https://localise.biz/" 20 21 #: scrolltotop.php:516 22 22 #, php-format 23 23 msgid "" 24 "Do you want the same scroll up %s on your WordPress blog? This site uses "24 "Do you want the same scroll up %s on your WordPress site? This site uses " 25 25 "free scrollToTop plugin" 26 26 msgstr "" 27 27 28 #: scrolltotop.php:5 3828 #: scrolltotop.php:516 29 29 msgid "bar" 30 30 msgstr "" 31 31 32 #: scrolltotop.php:5 3832 #: scrolltotop.php:516 33 33 msgid "button" 34 34 msgstr "" 35 35 36 #: scrolltotop.php:5 6736 #: scrolltotop.php:544 37 37 msgid "Settings" 38 38 msgstr "" 39 39 40 #: includes/scrolltotop-admin.php: 6 includes/scrolltotop-admin.php:3840 #: includes/scrolltotop-admin.php:5 includes/scrolltotop-admin.php:35 41 41 msgid "scrollToTop Settings" 42 42 msgstr "" … … 54 54 msgstr "" 55 55 56 #: includes/scrolltotop-admin.php:73 56 #: includes/scrolltotop-admin.php:71 57 msgid "Scroll to value/element" 58 msgstr "" 59 60 #: includes/scrolltotop-admin.php:74 57 61 msgid "Bar Settings" 58 62 msgstr "" 59 63 60 #: includes/scrolltotop-admin.php:7 4 includes/scrolltotop-admin.php:10764 #: includes/scrolltotop-admin.php:75 includes/scrolltotop-admin.php:108 61 65 msgid "Position" 62 66 msgstr "" 63 67 64 #: includes/scrolltotop-admin.php:7 568 #: includes/scrolltotop-admin.php:76 65 69 msgid "Element position" 66 70 msgstr "" 67 71 68 #: includes/scrolltotop-admin.php:7 672 #: includes/scrolltotop-admin.php:77 69 73 msgid "Width" 70 74 msgstr "" 71 75 72 #: includes/scrolltotop-admin.php:7 7 includes/scrolltotop-admin.php:10976 #: includes/scrolltotop-admin.php:78 includes/scrolltotop-admin.php:110 73 77 msgid "Opacity" 74 78 msgstr "" 75 79 76 #: includes/scrolltotop-admin.php:7 880 #: includes/scrolltotop-admin.php:79 77 81 msgid "Top offset" 78 82 msgstr "" 79 83 80 #: includes/scrolltotop-admin.php: 79 includes/scrolltotop-admin.php:11084 #: includes/scrolltotop-admin.php:80 includes/scrolltotop-admin.php:111 81 85 msgid "Horizontal offset" 82 86 msgstr "" 83 87 84 #: includes/scrolltotop-admin.php:8 0 includes/scrolltotop-admin.php:11288 #: includes/scrolltotop-admin.php:81 includes/scrolltotop-admin.php:113 85 89 msgid "Arrow icon" 86 90 msgstr "" 87 91 88 #: includes/scrolltotop-admin.php:8 1 includes/scrolltotop-admin.php:11692 #: includes/scrolltotop-admin.php:82 includes/scrolltotop-admin.php:117 89 93 msgid "Background color & opacity" 90 94 msgstr "" 91 95 92 #: includes/scrolltotop-admin.php:8 296 #: includes/scrolltotop-admin.php:83 93 97 msgid "Text" 94 98 msgstr "" 95 99 96 #: includes/scrolltotop-admin.php:8 3100 #: includes/scrolltotop-admin.php:84 97 101 msgid "Distance between text & arrow" 98 102 msgstr "" 99 103 100 #: includes/scrolltotop-admin.php:8 4104 #: includes/scrolltotop-admin.php:85 101 105 msgid "Fade effect duration" 102 106 msgstr "" 103 107 104 #: includes/scrolltotop-admin.php:8 5108 #: includes/scrolltotop-admin.php:86 105 109 msgid "Back to bottom" 106 110 msgstr "" 107 111 108 #: includes/scrolltotop-admin.php:8 6112 #: includes/scrolltotop-admin.php:87 109 113 msgid "Arrow rotate speed" 110 114 msgstr "" 111 115 112 #: includes/scrolltotop-admin.php:8 7 includes/scrolltotop-admin.php:118116 #: includes/scrolltotop-admin.php:88 includes/scrolltotop-admin.php:119 113 117 msgid "Smooth hover duration" 114 118 msgstr "" 115 119 116 #: includes/scrolltotop-admin.php:8 8120 #: includes/scrolltotop-admin.php:89 117 121 msgid "Elements offset" 118 122 msgstr "" 119 123 120 #: includes/scrolltotop-admin.php: 89124 #: includes/scrolltotop-admin.php:90 121 125 msgid "Elements color & opacity" 122 126 msgstr "" 123 127 124 #: includes/scrolltotop-admin.php:9 0 includes/scrolltotop-admin.php:115128 #: includes/scrolltotop-admin.php:91 includes/scrolltotop-admin.php:116 125 129 msgid "Arrow size" 126 130 msgstr "" 127 131 128 #: includes/scrolltotop-admin.php:9 1132 #: includes/scrolltotop-admin.php:92 129 133 msgid "Text size" 130 134 msgstr "" 131 135 132 #: includes/scrolltotop-admin.php:9 2136 #: includes/scrolltotop-admin.php:93 133 137 msgid "Text position" 134 138 msgstr "" 135 139 136 #: includes/scrolltotop-admin.php:9 3140 #: includes/scrolltotop-admin.php:94 137 141 msgid "Text font" 138 142 msgstr "" 139 143 140 #: includes/scrolltotop-admin.php:9 4 includes/scrolltotop-admin.php:119144 #: includes/scrolltotop-admin.php:95 includes/scrolltotop-admin.php:120 141 145 msgid "Make smaller" 142 146 msgstr "" 143 147 144 #: includes/scrolltotop-admin.php:9 5 includes/scrolltotop-admin.php:120148 #: includes/scrolltotop-admin.php:96 includes/scrolltotop-admin.php:121 145 149 msgid "Hide on small devices" 146 150 msgstr "" 147 151 148 #: includes/scrolltotop-admin.php:9 8152 #: includes/scrolltotop-admin.php:99 149 153 msgid "Transformed bar size" 150 154 msgstr "" 151 155 152 #: includes/scrolltotop-admin.php: 99156 #: includes/scrolltotop-admin.php:100 153 157 msgid "Transformed bar horizontal position" 154 158 msgstr "" 155 159 156 #: includes/scrolltotop-admin.php:10 0160 #: includes/scrolltotop-admin.php:101 157 161 msgid "Transformed bar horizontal offset" 158 162 msgstr "" 159 163 160 #: includes/scrolltotop-admin.php:10 1164 #: includes/scrolltotop-admin.php:102 161 165 msgid "Transformed bar vertical position" 162 166 msgstr "" 163 167 164 #: includes/scrolltotop-admin.php:10 2168 #: includes/scrolltotop-admin.php:103 165 169 msgid "Transformed bar vertical offset" 166 170 msgstr "" 167 171 168 #: includes/scrolltotop-admin.php:10 3172 #: includes/scrolltotop-admin.php:104 169 173 msgid "Transformed bar border radius" 170 174 msgstr "" 171 175 172 #: includes/scrolltotop-admin.php:10 6176 #: includes/scrolltotop-admin.php:107 173 177 msgid "Button Settings" 174 178 msgstr "" 175 179 176 #: includes/scrolltotop-admin.php:10 8180 #: includes/scrolltotop-admin.php:109 177 181 msgid "Padding" 178 182 msgstr "" 179 183 180 #: includes/scrolltotop-admin.php:11 1184 #: includes/scrolltotop-admin.php:112 181 185 msgid "Vertical offset" 182 186 msgstr "" 183 187 184 #: includes/scrolltotop-admin.php:11 3188 #: includes/scrolltotop-admin.php:114 185 189 msgid "Border radius" 186 190 msgstr "" 187 191 188 #: includes/scrolltotop-admin.php:11 4192 #: includes/scrolltotop-admin.php:115 189 193 msgid "Arrow color & opacity" 190 194 msgstr "" 191 195 192 #: includes/scrolltotop-admin.php:11 7196 #: includes/scrolltotop-admin.php:118 193 197 msgid "Animation" 194 198 msgstr "" 195 199 196 #: includes/scrolltotop-admin.php:12 3200 #: includes/scrolltotop-admin.php:124 197 201 msgid "Advanced Settings" 198 202 msgstr "" 199 203 200 #: includes/scrolltotop-admin.php:12 4204 #: includes/scrolltotop-admin.php:125 201 205 msgid "Sticky container" 202 206 msgstr "" 203 207 204 #: includes/scrolltotop-admin.php:12 5208 #: includes/scrolltotop-admin.php:126 205 209 msgid "Script loading" 206 210 msgstr "" 207 211 208 #: includes/scrolltotop-admin.php:12 6212 #: includes/scrolltotop-admin.php:127 209 213 msgid "Advanced background" 210 214 msgstr "" 211 215 212 #: includes/scrolltotop-admin.php:12 7216 #: includes/scrolltotop-admin.php:128 213 217 msgid "Load scrollToTop CSS files?" 214 218 msgstr "" 215 219 216 #: includes/scrolltotop-admin.php:12 8220 #: includes/scrolltotop-admin.php:129 217 221 msgid "Load scrollToTop inline CSS?" 218 222 msgstr "" 219 223 220 #: includes/scrolltotop-admin.php:1 29224 #: includes/scrolltotop-admin.php:130 221 225 msgid "Custom CSS styles" 222 226 msgstr "" 223 227 224 #: includes/scrolltotop-admin.php:141 includes/scrolltotop-admin.php:7 96225 #: includes/scrolltotop-admin.php:8 67228 #: includes/scrolltotop-admin.php:141 includes/scrolltotop-admin.php:746 229 #: includes/scrolltotop-admin.php:806 226 230 msgid "Left" 227 231 msgstr "" 228 232 229 #: includes/scrolltotop-admin.php:147 includes/scrolltotop-admin.php: 802230 #: includes/scrolltotop-admin.php:8 73233 #: includes/scrolltotop-admin.php:147 includes/scrolltotop-admin.php:752 234 #: includes/scrolltotop-admin.php:812 231 235 msgid "Right" 232 236 msgstr "" 233 237 234 #: includes/scrolltotop-admin.php:16 4 includes/scrolltotop-admin.php:772238 #: includes/scrolltotop-admin.php:163 includes/scrolltotop-admin.php:725 235 239 msgid "Top" 236 240 msgstr "" 237 241 238 #: includes/scrolltotop-admin.php:1 70 includes/scrolltotop-admin.php:778242 #: includes/scrolltotop-admin.php:169 includes/scrolltotop-admin.php:731 239 243 msgid "Bottom" 240 244 msgstr "" 241 245 242 #: includes/scrolltotop-admin.php:18 4 includes/scrolltotop-admin.php:195243 #: includes/scrolltotop-admin.php:22 9 includes/scrolltotop-admin.php:249244 #: includes/scrolltotop-admin.php:2 64 includes/scrolltotop-admin.php:286245 #: includes/scrolltotop-admin.php:3 56 includes/scrolltotop-admin.php:536246 #: includes/scrolltotop-admin.php:5 62 includes/scrolltotop-admin.php:574247 #: includes/scrolltotop-admin.php:6 87 includes/scrolltotop-admin.php:691248 #: includes/scrolltotop-admin.php: 705 includes/scrolltotop-admin.php:712249 #: includes/scrolltotop-admin.php: 720 includes/scrolltotop-admin.php:734250 #: includes/scrolltotop-admin.php:7 57 includes/scrolltotop-admin.php:816251 #: includes/scrolltotop-admin.php: 827 includes/scrolltotop-admin.php:850252 #: includes/scrolltotop-admin.php:8 87 includes/scrolltotop-admin.php:909253 #: includes/scrolltotop-admin.php: 920 includes/scrolltotop-admin.php:1031246 #: includes/scrolltotop-admin.php:181 includes/scrolltotop-admin.php:191 247 #: includes/scrolltotop-admin.php:224 includes/scrolltotop-admin.php:242 248 #: includes/scrolltotop-admin.php:254 includes/scrolltotop-admin.php:283 249 #: includes/scrolltotop-admin.php:344 includes/scrolltotop-admin.php:509 250 #: includes/scrolltotop-admin.php:531 includes/scrolltotop-admin.php:541 251 #: includes/scrolltotop-admin.php:641 includes/scrolltotop-admin.php:649 252 #: includes/scrolltotop-admin.php:662 includes/scrolltotop-admin.php:671 253 #: includes/scrolltotop-admin.php:680 includes/scrolltotop-admin.php:692 254 #: includes/scrolltotop-admin.php:713 includes/scrolltotop-admin.php:764 255 #: includes/scrolltotop-admin.php:773 includes/scrolltotop-admin.php:791 256 #: includes/scrolltotop-admin.php:823 includes/scrolltotop-admin.php:840 257 #: includes/scrolltotop-admin.php:849 includes/scrolltotop-admin.php:941 254 258 msgid "px" 255 259 msgstr "" 256 260 257 #: includes/scrolltotop-admin.php:20 9261 #: includes/scrolltotop-admin.php:204 258 262 msgid "Bar" 259 263 msgstr "" 260 264 261 #: includes/scrolltotop-admin.php:21 5265 #: includes/scrolltotop-admin.php:210 262 266 msgid "Button" 263 267 msgstr "" 264 268 265 #: includes/scrolltotop-admin.php:22 9269 #: includes/scrolltotop-admin.php:221 266 270 msgid "Width:" 267 271 msgstr "" 268 272 269 #: includes/scrolltotop-admin.php:2 32273 #: includes/scrolltotop-admin.php:227 270 274 msgid "0 – disable advanced background" 271 275 msgstr "" 272 276 273 #: includes/scrolltotop-admin.php:2 40 includes/scrolltotop-admin.php:364277 #: includes/scrolltotop-admin.php:234 includes/scrolltotop-admin.php:350 274 278 msgid "Enable sticky width" 275 279 msgstr "" 276 280 277 #: includes/scrolltotop-admin.php:2 47281 #: includes/scrolltotop-admin.php:239 278 282 msgid "Hide advanced background if user's screen is less than" 279 283 msgstr "" 280 284 281 #: includes/scrolltotop-admin.php:2 52 includes/scrolltotop-admin.php:737282 #: includes/scrolltotop-admin.php: 853285 #: includes/scrolltotop-admin.php:245 includes/scrolltotop-admin.php:695 286 #: includes/scrolltotop-admin.php:794 283 287 msgid "0 – don't hide" 284 288 msgstr "" 285 289 286 #: includes/scrolltotop-admin.php:2 62290 #: includes/scrolltotop-admin.php:252 287 291 msgid "Show scrollToTop after scrolling" 288 292 msgstr "" 289 293 290 #: includes/scrolltotop-admin.php:2 66294 #: includes/scrolltotop-admin.php:256 291 295 msgid "0 – is always visible" 292 296 msgstr "" 293 297 294 #: includes/scrolltotop-admin.php:296 includes/scrolltotop-admin.php:487 295 #: includes/scrolltotop-admin.php:525 includes/scrolltotop-admin.php:985 296 #: includes/scrolltotop-admin.php:1005 298 #: includes/scrolltotop-admin.php:267 299 msgid "" 300 "Can be number of pixels (without <code>px</code>) or jQuery selectors like: " 301 "<code>#example</code>, <code>.example:first</code>" 302 msgstr "" 303 304 #: includes/scrolltotop-admin.php:292 includes/scrolltotop-admin.php:467 305 #: includes/scrolltotop-admin.php:500 includes/scrolltotop-admin.php:900 306 #: includes/scrolltotop-admin.php:918 297 307 msgid "ms" 298 308 msgstr "" 299 309 300 #: includes/scrolltotop-admin.php:29 7310 #: includes/scrolltotop-admin.php:293 301 311 msgid "0 – disable fade effect" 302 312 msgstr "" 303 313 304 #: includes/scrolltotop-admin.php:30 4314 #: includes/scrolltotop-admin.php:300 305 315 msgid "Disable fade effect on page load" 306 316 msgstr "" 307 317 308 #: includes/scrolltotop-admin.php:31 9 includes/scrolltotop-admin.php:633309 #: includes/scrolltotop-admin.php:6 56318 #: includes/scrolltotop-admin.php:313 includes/scrolltotop-admin.php:592 319 #: includes/scrolltotop-admin.php:613 310 320 msgid "Yes" 311 321 msgstr "" 312 322 313 #: includes/scrolltotop-admin.php:3 25 includes/scrolltotop-admin.php:639314 #: includes/scrolltotop-admin.php:6 62323 #: includes/scrolltotop-admin.php:319 includes/scrolltotop-admin.php:598 324 #: includes/scrolltotop-admin.php:619 315 325 msgid "No" 316 326 msgstr "" 317 327 318 #: includes/scrolltotop-admin.php:3 40 includes/scrolltotop-admin.php:501319 #: includes/scrolltotop-admin.php: 945328 #: includes/scrolltotop-admin.php:330 includes/scrolltotop-admin.php:480 329 #: includes/scrolltotop-admin.php:868 320 330 msgid "Normal" 321 331 msgstr "" 322 332 323 #: includes/scrolltotop-admin.php:3 42333 #: includes/scrolltotop-admin.php:331 324 334 msgid "Async" 325 335 msgstr "" 326 336 327 #: includes/scrolltotop-admin.php:3 44337 #: includes/scrolltotop-admin.php:332 328 338 msgid "Defer" 329 339 msgstr "" 330 340 331 #: includes/scrolltotop-admin.php:3 46341 #: includes/scrolltotop-admin.php:335 332 342 msgid "Warning!" 333 343 msgstr "" 334 344 335 #: includes/scrolltotop-admin.php:3 46345 #: includes/scrolltotop-admin.php:335 336 346 msgid "Don't change this unless you know what you're doing" 337 347 msgstr "" 338 348 339 #: includes/scrolltotop-admin.php:4 88349 #: includes/scrolltotop-admin.php:468 340 350 msgid "0 – instant rotate" 341 351 msgstr "" 342 352 343 #: includes/scrolltotop-admin.php: 512 includes/scrolltotop-admin.php:956353 #: includes/scrolltotop-admin.php:490 includes/scrolltotop-admin.php:877 344 354 msgid "On hover" 345 355 msgstr "" 346 356 347 #: includes/scrolltotop-admin.php:5 26 includes/scrolltotop-admin.php:1006357 #: includes/scrolltotop-admin.php:501 includes/scrolltotop-admin.php:919 348 358 msgid "0 – disable smooth effect" 349 359 msgstr "" 350 360 351 #: includes/scrolltotop-admin.php:5 63361 #: includes/scrolltotop-admin.php:532 352 362 msgid "0 – don't show the arrow" 353 363 msgstr "" 354 364 355 #: includes/scrolltotop-admin.php:5 89365 #: includes/scrolltotop-admin.php:553 356 366 msgid "Under the arrow" 357 367 msgstr "" 358 368 359 #: includes/scrolltotop-admin.php:5 95369 #: includes/scrolltotop-admin.php:559 360 370 msgid "To the right of the arrow" 361 371 msgstr "" 362 372 363 #: includes/scrolltotop-admin.php:620 364 msgid "Usually this is #primary, #wrapper, #secondary, #sidebar or #content" 365 msgstr "" 366 367 #: includes/scrolltotop-admin.php:685 373 #: includes/scrolltotop-admin.php:580 374 msgid "" 375 "Usually this is <code>#primary</code>, <code>#wrapper</code>, <code>" 376 "#secondary</code>, <code>#sidebar</code> or <code>#content</code>" 377 msgstr "" 378 379 #: includes/scrolltotop-admin.php:638 368 380 msgid "Set width to" 369 381 msgstr "" 370 382 371 #: includes/scrolltotop-admin.php:6 89 includes/scrolltotop-admin.php:718383 #: includes/scrolltotop-admin.php:646 includes/scrolltotop-admin.php:677 372 384 msgid "if user's screen is less than" 373 385 msgstr "" 374 386 375 #: includes/scrolltotop-admin.php:6 93387 #: includes/scrolltotop-admin.php:651 376 388 msgid "0 – don't make bar smaller" 377 389 msgstr "" 378 390 391 #: includes/scrolltotop-admin.php:659 392 msgid "Set padding to" 393 msgstr "" 394 395 #: includes/scrolltotop-admin.php:668 396 msgid "and arrow size to" 397 msgstr "" 398 399 #: includes/scrolltotop-admin.php:682 400 msgid "0 – don't make button smaller" 401 msgstr "" 402 403 #: includes/scrolltotop-admin.php:690 includes/scrolltotop-admin.php:789 404 msgid "Hide if user's screen is less than" 405 msgstr "" 406 407 #: includes/scrolltotop-admin.php:702 408 msgid "Transform into button instead of hide" 409 msgstr "" 410 379 411 #: includes/scrolltotop-admin.php:703 380 msgid "Set padding to"381 msgstr ""382 383 #: includes/scrolltotop-admin.php:710384 msgid "and arrow size to"385 msgstr ""386 387 #: includes/scrolltotop-admin.php:722388 msgid "0 – don't make button smaller"389 msgstr ""390 391 #: includes/scrolltotop-admin.php:732 includes/scrolltotop-admin.php:848392 msgid "Hide if user's screen is less than"393 msgstr ""394 395 #: includes/scrolltotop-admin.php:745396 msgid "Transform into button instead of hide"397 msgstr ""398 399 #: includes/scrolltotop-admin.php:745400 412 msgid "NEW" 401 413 msgstr "" 402 414 403 #: includes/scrolltotop-admin.php: 968415 #: includes/scrolltotop-admin.php:886 404 416 msgid "Effect:" 405 417 msgstr "" 406 418 407 #: includes/scrolltotop-admin.php: 971419 #: includes/scrolltotop-admin.php:888 408 420 msgid "None" 409 421 msgstr "" 410 422 411 #: includes/scrolltotop-admin.php: 973423 #: includes/scrolltotop-admin.php:889 412 424 msgid "Slide" 413 425 msgstr "" 414 426 415 #: includes/scrolltotop-admin.php: 975427 #: includes/scrolltotop-admin.php:890 416 428 msgid "Fade" 417 429 msgstr "" 418 430 419 #: includes/scrolltotop-admin.php: 983431 #: includes/scrolltotop-admin.php:897 420 432 msgid "Speed:" 421 433 msgstr "" 422 434 423 #: includes/scrolltotop-admin.php:9 93435 #: includes/scrolltotop-admin.php:908 424 436 msgid "Disable animation on page load" 425 437 msgstr "" 438 439 #: includes/scrolltotop-admin-sidebar.php:19 440 msgid "Displays cool back to top button or bar" 441 msgstr "" 442 443 #: includes/scrolltotop-admin-sidebar.php:24 444 msgid "Make all your images and iframes lazy" 445 msgstr "" 446 447 #: includes/scrolltotop-admin-sidebar.php:30 448 msgid "Like the plugin? Support the developer." 449 msgstr "" 450 451 #: includes/scrolltotop-admin-sidebar.php:43 452 msgid "Even 1 dollar will make me happy :)" 453 msgstr "" 454 455 #: includes/scrolltotop-admin-sidebar.php:53 456 msgid "Rate the plugin or ask a question" 457 msgstr "" 458 459 #: includes/scrolltotop-admin-sidebar.php:61 460 msgid "Check out other plugins:" 461 msgstr "" 462 463 #. Name of the plugin 464 msgid "scrollToTop" 465 msgstr "" 466 467 #. Description of the plugin 468 msgid "" 469 "Create your own back to top button or full-height bar and simple customize " 470 "it as you want. You don't need any knowledge in HTML, CSS or JS: the plug-in " 471 "has many settings which you can change in just one click." 472 msgstr "" 473 474 #. Author of the plugin 475 msgid "Roman Sarvarov" 476 msgstr "" 477 478 #. Author URI of the plugin 479 msgid "https://about.me/sarvaroff" 480 msgstr "" -
scrolltotop/trunk/readme.txt
r2309158 r2322940 5 5 Tags: scroll to top, back to top, scroll, to top, scroll up, bar, button 6 6 Requires at least: 3.0.1 7 Tested up to: 5.4. 18 Stable tag: 1.1 47 Tested up to: 5.4.2 8 Stable tag: 1.15 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 62 62 63 63 == Changelog == 64 65 = 1.15 = 66 * Wrap all js to `$(document).ready(/* ... */)` to make plugin work, if its scripts loaded after creating container 67 * Add new options "scroll to value/element", what can set top scroll position (it was `0` always before) 64 68 65 69 = 1.14 = -
scrolltotop/trunk/scrolltotop.php
r2309158 r2322940 5 5 Author: Roman Sarvarov 6 6 Author URI: https://about.me/sarvaroff 7 Version: 1.1 47 Version: 1.15 8 8 Text Domain: scrolltotop 9 9 Domain Path: /languages/ … … 29 29 */ 30 30 31 $global_scrolltotop_version = 1.1 4;31 $global_scrolltotop_version = 1.15; 32 32 $global_scrolltotop_dir_url = parse_url( plugin_dir_url( __FILE__ ), PHP_URL_PATH ); 33 33 $global_scrolltotop_base = plugin_basename( __FILE__ ); … … 68 68 $inline_scripts = 'var '; 69 69 $inline_scripts_array = array(); 70 70 71 if ( $settings['stt_sticky_container'] && ( (int) $settings['stt_bar_sticky'] === 1 || (int) $settings['stt_advanced_background_sticky'] === 1 ) ) { 71 72 $inline_scripts_array['sttStickyContainer'] = $settings['stt_sticky_container']; 72 73 73 74 if ( (int) $settings['stt_bar_sticky'] === 1 && (int) $settings['stt_advanced_background_sticky'] === 0 ) { 74 $inline_scripts_array['sttBarSticky'] = 'true';75 $inline_scripts_array['sttBarSticky'] = 1; 75 76 } 76 77 } 78 77 79 if ( ! empty( (int) $settings['stt_advanced_background_width'] ) || (int) $settings['stt_advanced_background_sticky'] === 1 ) { 78 $inline_scripts_array['sttAdvancedBg'] = 'true';80 $inline_scripts_array['sttAdvancedBg'] = 1; 79 81 80 82 if ( (int) $settings['stt_advanced_background_sticky'] === 1 && $settings['stt_sticky_container'] ) { 81 $inline_scripts_array['sttAdvancedBgSticky'] = 'true';83 $inline_scripts_array['sttAdvancedBgSticky'] = 1; 82 84 } 83 85 } 84 $inline_scripts_array['sttOffset'] = (int) $settings['stt_scroll_offset']; 86 87 if ( $settings['stt_scroll_to'] ) { 88 if ( is_numeric($settings['stt_scroll_to']) ) { 89 $inline_scripts_array['sttScrollToValue'] = (int) $settings['stt_scroll_to']; 90 } else { 91 $inline_scripts_array['sttScrollToElement'] = $settings['stt_scroll_to']; 92 } 93 } 94 95 $inline_scripts_array['sttOffset'] = (int) $settings['stt_scroll_offset']; 96 85 97 if ( (int) $settings['stt_mode'] === 0 ) { 86 98 $inline_scripts_array['sttPos'] = (int) $settings['stt_bar_position']; 87 $inline_scripts_array['sttBack'] = ( (int) $settings['stt_bar_allow_back'] == 0 ? 'true' : 'false');88 $inline_scripts_array['sttOnload'] = ( (int) $settings['stt_bar_animation_on_load'] === 1 ? 'true' : 'false' );99 $inline_scripts_array['sttBack'] = !( (int) $settings['stt_bar_allow_back'] ); 100 $inline_scripts_array['sttOnload'] = (int) $settings['stt_bar_animation_on_load']; 89 101 } else { 90 102 $inline_scripts_array['sttPos'] = (int) $settings['stt_button_position']; 91 $inline_scripts_array['sttOnload'] = ( (int) $settings['stt_button_animation_on_load'] === 1 ? 'true' : 'false' );103 $inline_scripts_array['sttOnload'] = (int) $settings['stt_button_animation_on_load']; 92 104 } 93 105 … … 97 109 $inline_scripts .= ',' . PHP_EOL . ' '; 98 110 } 99 $inline_scripts .= $script . ' = ' . $value; 111 112 $inline_scripts .= $script . ' = ' . (is_string($value) ? '"' . $value . '"' : $value); 100 113 ++ $inline_scripts_row; 101 114 } 115 102 116 $inline_scripts .= ';'; 103 117 … … 229 243 230 244 $selector = '@media only screen and (max-width:' . (int) $settings['stt_bar_hide'] . 'px)'; 231 $scrolltotop_dynamic_css_array[ $selector ] = array();245 $scrolltotop_dynamic_css_array[ $selector] = array(); 232 246 233 247 if ( (int) $settings['stt_bar_transform_to_button'] === 1 ) {
Note: See TracChangeset
for help on using the changeset viewer.