File tree Expand file tree Collapse file tree 6 files changed +15
-35
lines changed
plugins/system/stats/layouts Expand file tree Collapse file tree 6 files changed +15
-35
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,6 @@ Joomla = window.Joomla || {};
2525 const initStatsEvents = ( callback ) => {
2626 const messageContainer = document . getElementById ( 'system-message-container' ) ;
2727 const joomlaAlert = messageContainer . querySelector ( '.js-pstats-alert' ) ;
28- const detailsContainer = messageContainer . querySelector ( '#js-pstats-data-details' ) ;
29-
30- // Show details about the information being sent
31- document . addEventListener ( 'click' , ( event ) => {
32- if ( event . target . classList . contains ( 'js-pstats-btn-details' ) ) {
33- event . preventDefault ( ) ;
34- detailsContainer . classList . toggle ( 'd-none' ) ;
35- }
36- } ) ;
3728
3829 // Always allow
3930 document . addEventListener ( 'click' , ( event ) => {
Original file line number Diff line number Diff line change 77 'use strict' ;
88
99 // Selectors used by this script
10- const statsDataTogglerId = 'js-pstats-data-details-toggler' ;
11- const statsDataDetailsId = 'js-pstats-data-details' ;
1210 const resetId = 'js-pstats-reset-uid' ;
1311 const uniqueIdFieldId = 'jform_params_unique_id' ;
1412
15- const onToggle = ( event ) => {
16- event . preventDefault ( ) ;
17- const element = document . getElementById ( statsDataDetailsId ) ;
18-
19- if ( element ) {
20- element . classList . toggle ( 'd-none' ) ;
21- }
22- } ;
23-
2413 const onReset = ( event ) => {
2514 event . preventDefault ( ) ;
2615 document . getElementById ( uniqueIdFieldId ) . value = '' ;
2716 Joomla . submitbutton ( 'plugin.apply' ) ;
2817 } ;
2918
3019 const onBoot = ( ) => {
31- // Toggle stats details
32- const toggler = document . getElementById ( statsDataTogglerId ) ;
33- if ( toggler ) {
34- toggler . addEventListener ( 'click' , onToggle ) ;
35- }
36-
3720 // Reset the unique id
3821 const reset = document . getElementById ( resetId ) ;
3922 if ( reset ) {
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ const DefaultAllowlist = {
5353 select : [ 'name' ] ,
5454 textarea : [ 'name' ] ,
5555 option : [ 'value' , 'selected' ] ,
56+ details : [ 'open' ] ,
57+ summary : [ ] ,
5658} ;
5759
5860// Only define the Joomla namespace if not defined.
Original file line number Diff line number Diff line change 5050 */
5151?>
5252<?php if (count ($ statsData )) : ?>
53- <a href="#" id="js-pstats-data-details-toggler"><?php echo Text::_ ('PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT ' ); ?> </a>
54- <?php echo $ field ->render ('stats ' , compact ('statsData ' )); ?>
53+ <details>
54+ <summary>
55+ <?php echo Text::_ ('PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT ' ); ?>
56+ </summary>
57+ <?php echo $ field ->render ('stats ' , compact ('statsData ' )); ?>
58+ </details>
5559<?php endif ; ?>
Original file line number Diff line number Diff line change 3131 <p>
3232 <?php echo Text::_ ('PLG_SYSTEM_STATS_MSG_JOOMLA_WANTS_TO_SEND_DATA ' ); ?>
3333 </p>
34- <p >
35- <a href="#" class="js-pstats-btn-details alert-link"> <?php echo Text:: _ ( ' PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT ' ); ?> </a >
36- </p >
37- <?php
38- echo $ plugin ->render ('stats ' , compact ('statsData ' ));
39- ? >
34+ <details >
35+ <summary >
36+ <?php echo Text:: _ ( ' PLG_SYSTEM_STATS_MSG_WHAT_DATA_WILL_BE_SENT ' ); ? >
37+ </summary>
38+ <?php echo $ plugin ->render ('stats ' , compact ('statsData ' )); ?>
39+ </details >
4040 <p class="fw-bold"><?php echo Text::_ ('PLG_SYSTEM_STATS_MSG_ALLOW_SENDING_DATA ' ); ?> </p>
4141 <p class="actions">
4242 <button type="button" class="btn btn-primary js-pstats-btn-allow-never"><?php echo Text::_ ('PLG_SYSTEM_STATS_BTN_NEVER_SEND ' ); ?> </button>
Original file line number Diff line number Diff line change 2222
2323$ versionFields = ['php_version ' , 'db_version ' , 'cms_version ' ];
2424?>
25- <table class="table mb-3 d-none" id="js-pstats-data-details ">
25+ <table class="table mb-3">
2626 <caption class="visually-hidden">
2727 <?php echo Text::_ ('PLG_SYSTEM_STATS_STATISTICS ' ); ?>
2828 </caption>
You can’t perform that action at this time.
0 commit comments