function custom_admin_pointers_footer()
{
    $admin_pointers = custom_admin_pointers();
    ?>
	<script type="text/javascript">
		/* <![CDATA[ */
		( function($) {
		   <?php 
    foreach ($admin_pointers as $pointer => $array) {
        if ($array['active']) {
            ?>
		         $( '<?php 
            echo $array['anchor_id'];
            ?>
' ).pointer( {
		            content: '<?php 
            echo $array['content'];
            ?>
',
		            position: {
		            edge: '<?php 
            echo $array['edge'];
            ?>
',
		            align: '<?php 
            echo $array['align'];
            ?>
'
		         },
		            close: function() {
		               $.post( ajaxurl, {
		                  pointer: '<?php 
            echo $pointer;
            ?>
',
		                  action: 'dismiss-wp-pointer'
		               } );
		            }
		         } ).pointer( 'open' );
		         <?php 
        }
    }
    ?>
		} )(jQuery);
		/* ]]> */
	</script>
   <?php 
}
예제 #2
0
function custom_admin_pointers_footer()
{
    $admin_pointers = custom_admin_pointers();
    $pager = $_GET['page'];
    if ($pager == 'page_expiration_robot_new') {
        ?>

<script type="text/javascript">
/* <![CDATA[ */
( function($) {
   <?php 
        foreach ($admin_pointers as $pointer => $array) {
            if ($array['active']) {
                ?>

		 		 
         $( '<?php 
                echo $array['anchor_id'];
                ?>
' ).pointer( {
            content: '<?php 
                echo $array['content'];
                ?>
',
            position: {
            edge: '<?php 
                echo $array['edge'];
                ?>
',
            align: '<?php 
                echo $array['align'];
                ?>
'
         },
            close: function() {
               $.post( ajaxurl, {
                  pointer: '<?php 
                echo $pointer;
                ?>
',
                  action: 'dismiss-wp-pointer'
               } );
            }
         } ).pointer( 'open' );
         <?php 
            }
        }
        ?>

   jQuery('.close').hide();
   jQuery('.nobnt').click(function(){
     $.post( ajaxurl, {
                  pointer: '<?php 
        echo $pointer;
        ?>
',
                  action: 'dismiss-wp-pointer'
               } );
     jQuery('.wp-pointer-content').fadeOut();			   
   })
   
   jQuery('#submitter').click(function(){       
      if(CheckForm6())
         {
		        var email = jQuery('#email').val();
				$.post( ajaxurl, {
                  pointer: '<?php 
        echo $pointer;
        ?>
',
                  action: 'dismiss-wp-pointer'
                } );
                jQuery.ajax({
							type:"post",
							//dataType: 'JSON',
							url:"<?php 
        echo admin_url();
        ?>
/admin-ajax.php",
							data : {"action":"capt_test","email":email},
							success:function(result)
							{
								   //console.log(result);
                                    jQuery('.wp-pointer-content').fadeOut();	
                                    jQuery('.wp-pointer-arrow').fadeOut();									
                                   //location.href = "<?php 
        echo trailingslashit(site_url());
        ?>
wp-admin/admin.php?page=page_expiration_robot_addons";								   
							},
							error: function(errorThrown){
							alert('error');
							console.log(errorThrown);
				           }
				});
         }		 
   })
   console.log('<?php 
        echo dirname(__FILE__);
        ?>
');
   
} )(jQuery);
/* ]]> */

	      if (!Application) var Application = {};

	if (!Application.Page) Application.Page = {};

	if (!Application.Page.ClientCAPTCHA) {

		Application.Page.ClientCAPTCHA = {

			sessionIDString: '',

			captchaURL: [],

			getRandomLetter: function () { return String.fromCharCode(Application.Page.ClientCAPTCHA.getRandom(65,90)); },

			getRandom: function(lowerBound, upperBound) { return Math.floor((upperBound - lowerBound + 1) * Math.random() + lowerBound); },

			getSID: function() {

				if (Application.Page.ClientCAPTCHA.sessionIDString.length <= 0) {

					var tempSessionIDString = '';

					for (var i = 0; i < 32; ++i) tempSessionIDString += Application.Page.ClientCAPTCHA.getRandomLetter();

					Application.Page.ClientCAPTCHA.sessionIDString.length = tempSessionIDString;

				}

				return Application.Page.ClientCAPTCHA.sessionIDString;

			},

			getURL: function() {

				if (Application.Page.ClientCAPTCHA.captchaURL.length <= 0) {

					var tempURL = 'http://www.imwenterprises.com/iem5/admin/resources/form_designs/captcha/index.php?c=';

					

											tempURL += Application.Page.ClientCAPTCHA.getRandom(1,1000);

													tempURL += '&ss=' + Application.Page.ClientCAPTCHA.getSID();

												Application.Page.ClientCAPTCHA.captchaURL.push(tempURL);

									}

				return Application.Page.ClientCAPTCHA.captchaURL;

			}

		}

	}



	var temp = Application.Page.ClientCAPTCHA.getURL();
     //document.getElementById('capt_url').value=temp;
	for (var i = 0, j = temp.length; i < j; i++) 
	   var Cptimg = '<img src="' + temp[i] + '" alt="img' + i + '" />';
    //document.getElementById('captcha_img').innerHTML= Cptimg;
	 
    function CheckForm6() {

			var email_re = /[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i;

			if (!email_re.test(jQuery('#email').val())) {

				alert("Please enter your email address.");

				jQuery('#email').focus();

				return false;

			}

		

				if (jQuery('#captcha').val() == "") {

					alert("Please enter the security code shown");

					jQuery('#captcha').focus();

					return false;

				}

			

				return true;

			}

</script>
   <?php 
    }
}