Changeset 3067718
- Timestamp:
- 04/09/2024 01:56:16 PM (2 years ago)
- Location:
- site-search-one/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (1 diff)
-
admin/class-site-search-one-tokens.php (modified) (2 diffs)
-
changelog.txt (modified) (1 diff)
-
public/ss1-searchpage-iframe.php (modified) (1 diff)
-
site-search-one.php (modified) (2 diffs)
-
templates/site-search-one-searchpage-bs5.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
site-search-one/trunk/README.txt
r3066955 r3067718 76 76 == Changelog == 77 77 78 = 2.0.0.35 25 (2024-04-08) =78 = 2.0.0.3535 (2024-04-09) = 79 79 80 * Fix: Bug when WP Dark Mode not installed. 80 * Enhancement: Improved scroll behaviour when navigating search result pages. 81 * Enhancement: Improved error handling when displaying search page. -
site-search-one/trunk/admin/class-site-search-one-tokens.php
r2860974 r3067718 90 90 * @return string|null 91 91 */ 92 public static function issue_token( $attempt = 1 ) {92 public static function issue_token( $attempt = 1, $allow_retry = true ) { 93 93 //phpcs:disable WordPress.DB.DirectDatabaseQuery 94 94 //phpcs:disable WordPress.DB.PreparedSQL.NotPrepared … … 109 109 } else { 110 110 // Ran out of tokens. Attempt to get more if this is 1st attempt. 111 if ( 1 === $attempt ) {111 if ( 1 === $attempt && $allow_retry === true ) { 112 112 Site_Search_One_Debugging::log( 'SS1-WARNING Ran out of tokens - Cron not running?' ); 113 113 self::request_more_tokens(); -
site-search-one/trunk/changelog.txt
r3066955 r3067718 1 1 == Changelog == 2 3 = 2.0.0.3525 (2024-04-08) = 4 5 * Fix: Bug when WP Dark Mode not installed. 2 6 3 7 = 2.0.0.3523 (2024-04-08) = -
site-search-one/trunk/public/ss1-searchpage-iframe.php
r3066955 r3067718 182 182 183 183 if (event.data) { 184 if (event.data.action === 'SS1-Scroll-To-Top-Of-SearchPage') { 185 186 let iframeOffset = $('#ss1-search-page').offset().top; 187 let adminBarHeight = 0; 188 if ( $('#wpadminbar').length ) { 189 // admin bar on page. This can overlap and hide the result count. 190 adminBarHeight = $('#wpadminbar').height(); 191 } 192 let resultsOffset = event.data.resultsOffset; 193 194 let totalOffset = iframeOffset + resultsOffset - adminBarHeight; 195 196 window.scrollTo({ 197 top: totalOffset, 198 behavior: 'instant' 199 }); 200 } 184 201 if (event.data.action === 'SS1-HV-Overlay-Show') { 185 202 // Show the hitviewer. -
site-search-one/trunk/site-search-one.php
r3066955 r3067718 16 16 * Plugin URI: https://sitesearchone.com 17 17 * Description: WordPress Site Search Powered by dtSearch 18 * Version: 2.0.0.35 2518 * Version: 2.0.0.3535 19 19 * Author: ElectronArt Design Ltd 20 20 * Author URI: https://profiles.wordpress.org/electronart/ … … 42 42 * Plugin Build Number 43 43 */ 44 define( 'SITE_SEARCH_ONE_BUILD', '35 25' );44 define( 'SITE_SEARCH_ONE_BUILD', '3535' ); 45 45 46 46 /** -
site-search-one/trunk/templates/site-search-one-searchpage-bs5.php
r2953321 r3067718 70 70 71 71 require_once plugin_dir_path( __FILE__ ) . '../admin/class-site-search-one-tokens.php'; 72 $token = Site_Search_One_Tokens::issue_token(); 73 if ( $sp_post_id && $token ) { 72 $token = Site_Search_One_Tokens::issue_token( 1, false ); 73 if ($token === null) { 74 $token = 'invalid'; // At least allow search page to load. Fetch a valid token after initial load. 75 } 76 if ( $sp_post_id ) { 74 77 // Page is set correctly. We now proceed to fetch what Categories should be shown on this page. 75 78 require_once plugin_dir_path( __FILE__ ) . '../admin/class-site-search-one-search-page.php'; … … 2230 2233 current_page = parseInt($(this).attr('data-page')); 2231 2234 display_results(false); 2235 request_scroll_to_first_results(); 2232 2236 return false; 2233 2237 }); … … 2257 2261 current_page++; 2258 2262 display_results(false); 2263 request_scroll_to_first_results(); 2259 2264 }).attr('href','javascript:void(0);'); 2260 2265 … … 2263 2268 current_page = last_page; 2264 2269 display_results(false); 2270 request_scroll_to_first_results(); 2265 2271 }).attr('href','javascript:void(0);'); 2266 2272 … … 2268 2274 current_page--; 2269 2275 display_results(false); 2276 request_scroll_to_first_results(); 2270 2277 }).attr('href','javascript:void(0);'); 2271 2278 … … 2273 2280 current_page = 1; 2274 2281 display_results(false); 2282 request_scroll_to_first_results(); 2275 2283 }).attr('href','javascript:void(0);'); 2276 2284 //endregion … … 2306 2314 } 2307 2315 ); 2316 } 2317 2318 // Called during page changes. 2319 function request_scroll_to_first_results() { 2320 let topOffset = $('#info-display').offset().top; 2321 window.parent.postMessage({ 2322 'action': 'SS1-Scroll-To-Top-Of-SearchPage', 2323 'resultsOffset': topOffset 2324 }, "*"); 2308 2325 } 2309 2326
Note: See TracChangeset
for help on using the changeset viewer.