PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | js/admin/embed.js +11 -11 6.28 → trunk View file →
@@ -117,9 +117,9 @@
117 117
118 118 function offsetModalY( $modal, amount ) {
119 119 const position = {
120 120 my: 'top',
121 - at: 'top+' + amount,
121 + at: `top+${ amount }`,
122 122 of: window
123 123 };
124 124 $modal.dialog( 'option', 'position', position );
125 125 }
@@ -196,9 +196,9 @@
196 196 dropdownWrapper.innerHTML = response.html;
197 197 content.append( dropdownWrapper );
198 198
199 199 if ( 'form' === state.type ) {
200 - editPageUrl = response.edit_page_url + '&frmForm=' + state.objectId;
200 + editPageUrl = `${ response.edit_page_url }&frmForm=${ state.objectId }`;
201 201 } else {
202 202 const hookName = 'frm_embed_edit_page_url';
203 203 const hookArgs = {
204 204 objectId: state.objectId,
@@ -228,9 +228,9 @@
228 228 content.insertBefore( error, title.nextElementSibling );
229 229 return;
230 230 }
231 231
232 - window.location.href = editPageUrl.replace( 'post=0', 'post=' + pageId );
232 + window.location.href = editPageUrl.replace( 'post=0', `post=${ pageId }` );
233 233 }
234 234 }
235 235 }
236 236 },
@@ -260,9 +260,9 @@
260 260 type: 'POST',
261 261 url: ajaxurl,
262 262 data,
263 263 dataType: 'json',
264 - success: function( response ) {
264 + success( response ) {
265 265 if ( 'object' === typeof response && 'string' === typeof response.redirect ) {
266 266 window.location.href = response.redirect;
267 267 }
268 268 }
@@ -383,15 +383,15 @@
383 383
384 384 let examples = [
385 385 {
386 386 label: __( 'WordPress shortcode', 'formidable' ),
387 - example: '[formidable id=' + formId + ']',
387 + example: `[formidable id=${ formId }]`,
388 388 link: 'https://formidableforms.com/knowledgebase/publish-a-form/#kb-insert-the-shortcode-manually',
389 389 linkLabel: __( 'How to use shortcodes in WordPress', 'formidable' )
390 390 },
391 391 {
392 392 label: __( 'Use PHP code', 'formidable' ),
393 - example: '<?php echo FrmFormsController::get_form_shortcode( array( \'id\' => ' + formId + ' ) ); ?>'
393 + example: `<?php echo FrmFormsController::get_form_shortcode( array( 'id' => ${ formId } ) ); ?>`
394 394 }
395 395 ];
396 396
397 397 const filterArgs = { formId, formKey };
@@ -403,9 +403,9 @@
403 403 function getEmbedExample( { label, example, link, linkLabel } ) {
404 404 const unique = getAutoId();
405 405
406 406 const labelElement = getLabel( label );
407 - labelElement.id = 'frm_embed_example_label_' + unique;
407 + labelElement.id = `frm_embed_example_label_${ unique }`;
408 408
409 409 const element = div();
410 410 element.append( labelElement );
411 411
@@ -416,15 +416,15 @@
416 416 exampleElement = tag( 'input' );
417 417 exampleElement.type = 'text';
418 418 }
419 419
420 - exampleElement.id = 'frm_embed_example_' + unique;
420 + exampleElement.id = `frm_embed_example_${ unique }`;
421 421 exampleElement.className = 'frm_embed_example';
422 422 exampleElement.value = example;
423 423 exampleElement.readOnly = true;
424 424 exampleElement.setAttribute( 'tabindex', -1 );
425 425
426 - if ( 'undefined' !== typeof link && 'undefined' !== typeof linkLabel ) {
426 + if ( link !== undefined && linkLabel !== undefined ) {
427 427 const linkElement = tag( 'a' );
428 428 linkElement.href = link;
429 429 linkElement.textContent = linkLabel;
430 430 linkElement.setAttribute( 'target', '_blank' );
@@ -443,9 +443,9 @@
443 443 }
444 444
445 445 function getCopyIcon( label ) {
446 446 const icon = svg( { href: '#frm_clone_icon' } );
447 - icon.id = 'frm_copy_embed_' + getAutoId();
447 + icon.id = `frm_copy_embed_${ getAutoId() }`;
448 448 icon.setAttribute( 'tabindex', 0 );
449 449 icon.setAttribute( 'role', 'button' );
450 450 /* translators: %s: Example type (ie. WordPress shortcode, API Form script) */
451 451 icon.setAttribute( 'aria-label', sprintf( __( 'Copy %s', 'formidable' ), label ) );
@@ -486,9 +486,9 @@
486 486 }
487 487
488 488 function speak( message ) {
489 489 const element = document.createElement( 'div' );
490 - const id = 'speak-' + getAutoId();
490 + const id = `speak-${ getAutoId() }`;
491 491
492 492 element.setAttribute( 'aria-live', 'assertive' );
493 493 element.setAttribute( 'id', id );
494 494 element.className = 'frm_screen_reader frm_hidden';