Comentarios en: Fuerte temblor deja pueblos destruidos y cientos de damnificados en el Valle del Colca, Arequipa http://arellanojuan.com/fuerte-temblor-deja-pueblos-destruidos-y-cientos-de-damnificados-en-el-valle-del-colca-arequipa/ Blog de Juan Arellano Valdivia Sat, 29 Dec 2018 19:47:09 +0000 hourly 1 https://wordpress.org/?v=4.4.20 Por: Tremors Hit Southern Peru, Leaving Thousands Without a Home · Global Voices @soynadieorg – Soynadie Photo Press http://arellanojuan.com/fuerte-temblor-deja-pueblos-destruidos-y-cientos-de-damnificados-en-el-valle-del-colca-arequipa/#comment-13609 Thu, 09 Feb 2017 08:55:55 +0000 http://arellanojuan.com/?p=8771#comment-13609 […] This text is an adaptation of a blog post published in “Globalizado,” Juan Arellano’s blog. […]

]]>
Por: Tremors Hit Southern Peru, Leaving Thousands Without a Home · Global Voices http://arellanojuan.com/fuerte-temblor-deja-pueblos-destruidos-y-cientos-de-damnificados-en-el-valle-del-colca-arequipa/#comment-12524 Tue, 23 Aug 2016 13:26:42 +0000 http://arellanojuan.com/?p=8771#comment-12524 […] This text is an adaptation of a blog post published in “Globalizado,” Juan Arellano's blog. Share this: twitter facebook reddit googleplusEmail Print version  Written byJuan Arellano Translated byAllie jQuery(document).ready(function($){ /** * Initialize attempt counter variable to */ var attemptCounter = 0; /** * Add blind toggle to the trigger to slide the box out on click */ $(".email-share-form-trigger").click(function(){ // Load form if it doesn't exist yet // Also handles toggling so that it slides AFTER content is loaded if ( 0 == $("#email-share-form").length ) { gvEsfAjaxLoadForm(); // Otherwise just toggle the box (only used if form was already loaded) } else { $("#email-share-wrapper").toggle('blind'); } }); /** * Use AJAX to load the email form * * Depends on gv_esf_ajax_load_form() php function being hooked correctly */ function gvEsfAjaxLoadForm() { // Prepare ajax data with form fields to autofill var ajaxData = { action: 'gv_email_share_form_load', post_id: '582973', form_url: '/2016/08/23/tremors-hit-southern-peru-leaving-thousands-without-a-home/', from_name: '', from_email: '' } // Show the loading icon $('.esf-loading-icon').show(); // Send ajax request $.ajax({ type: 'POST', url: 'https://globalvoices.org/wp-admin/admin-ajax.php', data: ajaxData, success: function(response) { // Insert response (presumed to be HTML of form) into wrapper $('#email-share-wrapper').append(response); // Add click event for AJAX sending to submit button $('#gv_esf_ajaxsubmit').click(function(){ gvEsfAjaxSend(); }); // Toggle slide the box $("#email-share-wrapper").toggle('blind'); // Get the current scroll distance from the top of the window // var windowtop = $(window).scrollTop(); // Fetch vertical position of container div // jquery ref http://api.jquery.com/offset/ // var offsettop = $('#email-share-form-contents').offset().top; // Use container because it results in better position, can be changed to anything var offsettop = $('#email-share-wrapper').offset().top; console.log(offsettop); // Scroll to the top of the container div window.scrollTo(0, offsettop); // Debug values // $('#email-share-form-contents').append("offset().top = "+offsettop+" window.scrolltop="+windowtop); // Hide the loading icon $('.esf-loading-icon').hide(); $('.animated-form-close-button').click(function(){ $("#email-share-wrapper").toggle('blind'); return false; }); } }); } /** * ESF – Send AJAX request to send email from form * * Prepares and sends form data to WordPress AJAX where it will * be handled and a reply with errors/sucess messages sent back. */ function gvEsfAjaxSend() { var ajaxData = { action: 'gv_email_share_form_send', gv_esf_post_id: $('#gv_esf_post_id').val(), gv_esf_to_3Rt8: $('#gv_esf_to_3Rt8').val(), gv_esf_from_R8h5i: $('#gv_esf_from_R8h5i').val(), gv_esf_from_Y4b8: $('#gv_esf_from_Y4b8').val(), gv_esf_from_0u5Rd: $('#gv_esf_from_0u5Rd').val(), email: $('#email').val(), email_address: $('#email_address').val(), gv_esf_email_type: $('#gv_esf_email_type').val(), gv_esf_message: $('#gv_esf_message').val(), gv_esf_counter: $('#gv_esf_counter').val() } // Show the loading icon $('#esf-sending-icon').show(); $.ajax({ type: 'POST', url: 'https://globalvoices.org/wp-admin/admin-ajax.php', data: ajaxData, success: gvEsfAjaxSendResponseHandler }); } /** * Handle JSON response returned by Form AJAX Request. * * Should be called in gvEsfAjaxSend() as success of ajax request. */ function gvEsfAjaxSendResponseHandler(jsonResponse) { var output = ''; // Make sure we recieved a response if (!jsonResponse) { output += ' […]

]]>