Changeset 3338735
- Timestamp:
- 08/04/2025 06:19:45 AM (7 months ago)
- Location:
- democracy-poll
- Files:
-
- 8 edited
- 1 copied
-
tags/6.1.1 (copied) (copied from democracy-poll/trunk)
-
tags/6.1.1/classes/Poll_Renderer.php (modified) (5 diffs)
-
tags/6.1.1/democracy.php (modified) (1 diff)
-
tags/6.1.1/js/democracy.js (modified) (3 diffs)
-
tags/6.1.1/readme.txt (modified) (1 diff)
-
trunk/classes/Poll_Renderer.php (modified) (5 diffs)
-
trunk/democracy.php (modified) (1 diff)
-
trunk/js/democracy.js (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
democracy-poll/tags/6.1.1/classes/Poll_Renderer.php
r3330963 r3338735 100 100 // never use a poll caching mechanism in admin 101 101 if( ! $this->in_archive && ! is_admin() && plugin()->is_cachegear_on ){ 102 $html .= ' 103 <!--noindex--> 104 <div class="dem-cache-screens" style="display:none;" data-opt_logs="' . (int) options()->keep_logs . '">'; 105 106 $saved_voted_for = $poll->voted_for; 107 $poll->voted_for = ''; 108 $this->for_cache = true; 109 110 // voted screen 111 if( ! $this->not_show_results ){ 112 $html .= self::minify_html( $this->get_screen_basis( 'voted' ) ); 113 } 114 115 // vote screen 116 if( $poll->open ){ 117 $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) ); 118 } 119 120 $this->for_cache = false; 121 $poll->voted_for = $saved_voted_for; 122 123 $html .= ' 124 </div> 125 <!--/noindex-->'; 102 $html .= $this->get_cache_screens(); 126 103 } 127 104 … … 131 108 132 109 return Poll_Utils::get_minified_styles_once() . $html; 110 } 111 112 protected function get_cache_screens(): string { 113 $poll = $this->poll; // simplify 114 115 $saved_voted_for = $poll->voted_for; 116 $poll->voted_for = ''; 117 $this->for_cache = true; 118 119 $html = ''; 120 // voted screen 121 if( ! $this->not_show_results ){ 122 $html .= self::minify_html( $this->get_screen_basis( 'voted' ) ); 123 } 124 125 // vote screen 126 if( $poll->open ){ 127 $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) ); 128 } 129 130 $this->for_cache = false; 131 $poll->voted_for = $saved_voted_for; 132 133 $is_keep_logs = options()->keep_logs ? 1 : 0; 134 return <<<HTML 135 <!--noindex--> 136 <div class="dem-cache-screens" style="display:none;" data-opt_logs="$is_keep_logs">$html</div> 137 <!--/noindex--> 138 HTML; 133 139 } 134 140 … … 503 509 public static function voted_notice_html( $msg = '' ): string { 504 510 $js = <<<'JS' 505 let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none' ; };511 let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none' } 506 512 JS; 507 513 … … 513 519 </div> 514 520 HTML, 515 [ '{JS}' => $js, '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ]521 [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ] 516 522 ); 517 523 } … … 523 529 </div> 524 530 HTML, 525 [ '{JS}' => $js, '{MESSAGE}' => $msg ]531 [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => $msg ] 526 532 ); 527 533 } -
democracy-poll/tags/6.1.1/democracy.php
r3330963 r3338735 14 14 * Requires PHP: 7.4 15 15 * 16 * Version: 6.1. 016 * Version: 6.1.1 17 17 */ 18 18 -
democracy-poll/tags/6.1.1/js/democracy.js
r3330963 r3338735 290 290 // устанавливает ответы пользователя в блоке результатов/голосования 291 291 Dem.cacheSetAnswrs = function( $screen, answrs ){ 292 293 292 var aids = answrs.split( /,/ ) 294 293 … … 310 309 $screen.find( '.dem-vote-link' ).remove() 311 310 } 312 313 311 // если голосование 314 312 else { … … 337 335 $screen.find( '.dem-revote-button-wrap' ).show() 338 336 } 339 340 } 341 337 } 342 338 } 343 339 344 340 jQuery.fn.demCacheInit = function(){ 345 346 341 return this.each( function(){ 347 348 342 var $the = jQuery( this ) 349 343 -
democracy-poll/tags/6.1.1/readme.txt
r3330963 r3338735 120 120 121 121 == Upgrade Notice == 122 123 = 6.1.1 = 124 - FIX: esc_attr() added for inline js to fix possible bugs on some servers. 122 125 123 126 = 6.1.0 = -
democracy-poll/trunk/classes/Poll_Renderer.php
r3330963 r3338735 100 100 // never use a poll caching mechanism in admin 101 101 if( ! $this->in_archive && ! is_admin() && plugin()->is_cachegear_on ){ 102 $html .= ' 103 <!--noindex--> 104 <div class="dem-cache-screens" style="display:none;" data-opt_logs="' . (int) options()->keep_logs . '">'; 105 106 $saved_voted_for = $poll->voted_for; 107 $poll->voted_for = ''; 108 $this->for_cache = true; 109 110 // voted screen 111 if( ! $this->not_show_results ){ 112 $html .= self::minify_html( $this->get_screen_basis( 'voted' ) ); 113 } 114 115 // vote screen 116 if( $poll->open ){ 117 $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) ); 118 } 119 120 $this->for_cache = false; 121 $poll->voted_for = $saved_voted_for; 122 123 $html .= ' 124 </div> 125 <!--/noindex-->'; 102 $html .= $this->get_cache_screens(); 126 103 } 127 104 … … 131 108 132 109 return Poll_Utils::get_minified_styles_once() . $html; 110 } 111 112 protected function get_cache_screens(): string { 113 $poll = $this->poll; // simplify 114 115 $saved_voted_for = $poll->voted_for; 116 $poll->voted_for = ''; 117 $this->for_cache = true; 118 119 $html = ''; 120 // voted screen 121 if( ! $this->not_show_results ){ 122 $html .= self::minify_html( $this->get_screen_basis( 'voted' ) ); 123 } 124 125 // vote screen 126 if( $poll->open ){ 127 $html .= self::minify_html( $this->get_screen_basis( 'force_vote' ) ); 128 } 129 130 $this->for_cache = false; 131 $poll->voted_for = $saved_voted_for; 132 133 $is_keep_logs = options()->keep_logs ? 1 : 0; 134 return <<<HTML 135 <!--noindex--> 136 <div class="dem-cache-screens" style="display:none;" data-opt_logs="$is_keep_logs">$html</div> 137 <!--/noindex--> 138 HTML; 133 139 } 134 140 … … 503 509 public static function voted_notice_html( $msg = '' ): string { 504 510 $js = <<<'JS' 505 let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none' ; };511 let el = this.parentElement; el.animate([{ opacity:1 }, { opacity:0 }], { duration:300 }).onfinish = () => { el.style.display = 'none' } 506 512 JS; 507 513 … … 513 519 </div> 514 520 HTML, 515 [ '{JS}' => $js, '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ]521 [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => _x( 'You or your IP had already vote.', 'front', 'democracy-poll' ) ] 516 522 ); 517 523 } … … 523 529 </div> 524 530 HTML, 525 [ '{JS}' => $js, '{MESSAGE}' => $msg ]531 [ '{JS}' => esc_attr( $js ), '{MESSAGE}' => $msg ] 526 532 ); 527 533 } -
democracy-poll/trunk/democracy.php
r3330963 r3338735 14 14 * Requires PHP: 7.4 15 15 * 16 * Version: 6.1. 016 * Version: 6.1.1 17 17 */ 18 18 -
democracy-poll/trunk/js/democracy.js
r3330963 r3338735 290 290 // устанавливает ответы пользователя в блоке результатов/голосования 291 291 Dem.cacheSetAnswrs = function( $screen, answrs ){ 292 293 292 var aids = answrs.split( /,/ ) 294 293 … … 310 309 $screen.find( '.dem-vote-link' ).remove() 311 310 } 312 313 311 // если голосование 314 312 else { … … 337 335 $screen.find( '.dem-revote-button-wrap' ).show() 338 336 } 339 340 } 341 337 } 342 338 } 343 339 344 340 jQuery.fn.demCacheInit = function(){ 345 346 341 return this.each( function(){ 347 348 342 var $the = jQuery( this ) 349 343 -
democracy-poll/trunk/readme.txt
r3330963 r3338735 120 120 121 121 == Upgrade Notice == 122 123 = 6.1.1 = 124 - FIX: esc_attr() added for inline js to fix possible bugs on some servers. 122 125 123 126 = 6.1.0 =
Note: See TracChangeset
for help on using the changeset viewer.