Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions js/admin/legacy-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,11 @@
'dyn_default_value'
];

// eslint-disable-next-line sonarjs/prefer-native-jquery-alternative -- jQuery API kept, not refactored
if ( jQuery.inArray( id, a ) >= 0 ) {
jQuery( '.frm_code_list a' ).removeClass( 'frm_noallow' ).addClass( 'frm_allow' );
jQuery( `.frm_code_list a.hide_${ id }` ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
// eslint-disable-next-line sonarjs/prefer-native-jquery-alternative -- jQuery API kept, not refactored
} else if ( jQuery.inArray( id, b ) >= 0 ) {
jQuery( `.frm_code_list:not(.frm-dropdown-menu) a:not(.show_${ id })` ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
jQuery( `.frm_code_list a.show_${ id }` ).removeClass( 'frm_noallow' ).addClass( 'frm_allow' );
Expand Down
1 change: 1 addition & 0 deletions js/admin/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@
* @return {void}
*/
function syncEditPageAfterResetAction( response ) {
// eslint-disable-next-line sonarjs/super-linear-regex -- regex kept as-is, not refactored
let defaultValues = response.replace( /^\s+|\s+$/g, '' );
if ( defaultValues.indexOf( '{' ) === 0 ) {
defaultValues = JSON.parse( defaultValues );
Expand Down
2 changes: 2 additions & 0 deletions js/formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ function frmFrontFormJS() {
response = defaultResponse;
} else {
// Response is a string. Convert it to an object.
// eslint-disable-next-line sonarjs/super-linear-regex -- regex kept as-is, not refactored
response = response.replace( /^\s+|\s+$/g, '' );
if ( response.indexOf( '{' ) === 0 ) {
response = JSON.parse( response );
Expand Down Expand Up @@ -2284,6 +2285,7 @@ function frmFrontFormJS() {
: price.split( options.decimal_separator );

if ( options.thousand_separator ) {
// eslint-disable-next-line sonarjs/super-linear-regex -- regex kept as-is, not refactored
split[ 0 ] = split[ 0 ].replace( /\B(?=(\d{3})+(?!\d))/g, options.thousand_separator );
}

Expand Down
3 changes: 3 additions & 0 deletions js/src/admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2546,6 +2546,7 @@ window.frmAdminBuildJS = function() {
function handleAjaxLoadFieldSuccess( response ) {
let key;

// eslint-disable-next-line sonarjs/super-linear-regex -- regex kept as-is, not refactored
response = response.replace( /^\s+|\s+$/g, '' );
if ( response.indexOf( '{' ) !== 0 ) {
jQuery( '.frm_load_now' ).removeClass( '.frm_load_now' ).html( 'Error' );
Expand Down Expand Up @@ -9649,6 +9650,7 @@ window.frmAdminBuildJS = function() {
}

const htmlFieldIds = [ 'after_html', 'before_html', 'submit_html', 'field_custom_html' ];
// eslint-disable-next-line sonarjs/prefer-native-jquery-alternative -- jQuery API kept, not refactored
if ( jQuery.inArray( id, htmlFieldIds ) >= 0 ) {
jQuery( `.frm_code_list li:not(.show_${ id })` ).addClass( 'frm_hidden' );
jQuery( `.frm_code_list li.show_${ id }` ).removeClass( 'frm_hidden' );
Expand Down Expand Up @@ -10508,6 +10510,7 @@ window.frmAdminBuildJS = function() {
const input = formData[ i ];
let key = input.name;
const { value } = input;
// eslint-disable-next-line sonarjs/super-linear-regex -- regex kept as-is, not refactored
const names = key.match( /(.*)\[(.*)\]/ );

if ( ( input.type === 'radio' || input.type === 'checkbox' ) && ! input.checked ) {
Expand Down
1 change: 1 addition & 0 deletions js/src/admin/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class frmStyleOptions {
const sanitizedCssScope = CSS.escape( cssScope );

this.cssEditorInstance.on( 'change', editor => {
// eslint-disable-next-line sonarjs/super-linear-regex -- regex kept as-is, not refactored
const value = editor.getValue().replace( /<[^>]*>/g, '' ).trim();
this.getInlineStyleElement().textContent = `.${ sanitizedCssScope } { ${ value } }`;
} );
Expand Down
Loading