[php] modal

Viewer

  1. <?php 
  2. $var = '  function wpcf_modal( data, print = false ){
  3.         var data = JSON.parse(data);
  4.         var html = \'<div class="wpneo-modal-wrapper"> \' +
  5.             \' <div class="wpneo-modal-content"> \' +
  6.             \'<div class="wpneo-modal-wrapper-head">\' +
  7.             \'<h4 id="wpcf_modal_title">Message</h4><a href="javascript:;" class="wpneo-modal-close">×</a>\';
  8.             if( print ){
  9.                 html += \'</div><span class="wpcf-print-button button">Print</span>\';
  10.             }
  11.             html += \'<div class="wpneo-modal-content-inner"><div id="wpcf_modal_message"></div></div></div></div>\';
  12.         if ($(\'.wpneo-modal-wrapper\').length == 0){
  13.             $(\'body\').append(html);
  14.             if (data.redirect){
  15.                 if ( $(\'#wpneo_crowdfunding_redirect_url\').length == 0 ){
  16.                     $(\'body\').append(\'<input type="hidden" id="wpneo_crowdfunding_redirect_url" value="\'+data.redirect+\'" />\');
  17.                 }
  18.             }
  19.         }
  20.         if (data.success == 1){
  21.             if(data.message){
  22.                 $(\'.wpneo-modal-wrapper #wpcf_modal_message\').html( data.message );
  23.             }
  24.             if(data.title){
  25.                 $(\'.wpneo-modal-wrapper #wpcf_modal_title\').html( data.title );
  26.             }
  27.             $(\'.wpneo-modal-wrapper\').css({\'display\': \'block\'});
  28.             if ( $(\'#wpneofrontenddata\').length > 0 ){
  29.                 $("#wpneofrontenddata")[0].reset();
  30.             }
  31.             return true;
  32.         }else {
  33.             $(\'.wpneo-modal-wrapper #wpcf_modal_message\').html(data.message);
  34.             $(\'.wpneo-modal-wrapper\').css({\'display\': \'block\'});
  35.             return false;
  36.         }
  37.     }
  38.     window.wpcf_modal = wpcf_modal; //make global function';

Editor

You can edit this paste and save as new:


File Description
  • modal
  • Paste Code
  • 09 Apr-2020
  • 1.77 Kb
You can Share it: