BLOG

  • Volver a la tierra: Zipaquirá, Tabio y Choachí

    window.tabbola_type = “article”;
    Comentario

    (function ($) {
    // // returns the value of a specified cookie
    function getCookie(cname) {
    var name = cname + “=”;

    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(‘;’);
    for (var i = 0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
    c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
    data = c.substring(name.length, c.length);
    return JSON.parse(data);
    }
    }
    return "";
    }
    function _read_cookie() {
    if(typeof window.register_services == 'undefined'){
    window.register_services = getCookie("_register_services");
    }
    }

    function can_update_comment(commentName){
    if(
    typeof window.register_services != 'undefined' &&
    window.register_services !== null && window.register_services != '' &&
    window.register_services.hasOwnProperty('name') &&
    window.register_services.name == commentName
    ){
    return true;
    }else{
    return false;
    }
    }

    function can_create_comment(){
    if(typeof window.register_services == 'undefined' || window.register_services == null || window.register_services == '') return 0;
    if( window.register_services.role != 1 ) return 2;
    return 1;
    }
    function _html_form_register(user_rol){
    html = '';
    html += '’+

    Este es un espacio para la construcción de ideas, y de opinión.

    ‘+

    Se busca crear un foro de convivencia y reflexión, no un escenario de ataques al pensamiento contrario

    ‘;
    if(user_rol == 1){
    html += ”+
    ‘Su correo no ha sido confirmado. para poder opinar en los contenidos de El Espectador debe confirmarlo haciendo click ‘+
    ‘AQUÍ’+
    ”;
    }else{
    html += ‘

    ‘+
    ”+
    Ingrese aquí‘+
    ”+
    ”;
    }
    return html;
    }

    function generate_popup(message) {
    return ”+
    ”+
    ”+
    ‘+
    ”+
    ”+
    ”+
    ”+
    ”+
    ‘Error message’+
    message +”+
    ”+
    ”+
    ”+
    ”;
    }
    function init(comments, canComment) {
    var canComment = can_create_comment();
    var html = “”;
    html += canComment == 2 ? _html_form_send(false) : _html_form_register(canComment);
    html += “”;
    $.each(comments.data, function (i, comment) {
    html += _html_comment(comment, canComment);
    });
    html += “”;
    html += “”;
    $(“.comment_list_822505″).html(html).slideToggle(200);
    _active_events();
    }

    function _html_comment(comment, canComment) {
    var html = ”;
    html += “”;
    html += “”;
    html += “

    ” + comment.name + ” ” + comment.create + “

    “;
    html += “”;
    html += “

    ” + comment.body + “

    “;
    html += “”;
    if(canComment == 2) html += “Responder”;
    if(can_update_comment(comment.name)) html += “Editar”;
    html += “”;
    html += “”;
    if (typeof comment.lchildren !== ‘undefined’ && comment.lchildren.length > 0) {

    $.each(comment.lchildren, function (i, cm) {
    html += _html_comment(cm, 0);
    });

    }
    html += “”;
    html += “”;
    return html;
    }

    function _html_form_send(cancel) {
    var html = ”;
    html = ”+

    Este es un espacio para la construcción de ideas, y de opinión.

    ‘+

    Se busca crear un foro de convivencia y reflexión, no un escenario de ataques al pensamiento contrario

    ‘+

    Máximo 1500 caracteres

    ‘+
    ”;
    if(cancel) html=”;
    html += ” +
    ” +
    ” +
    ‘Enviar’;
    html += cancel ?’Cancelar’ : ”;
    html +=” +
    ”;
    return html;
    }

    function _active_events() {

    $(“.btn-cancel”).off(“click”);
    $(“.btn-cancel”).on(“click”, function (event) {
    event.preventDefault();
    var p = $(this).parents(“.form-comment”).first();
    p.siblings(“.btns”).show();
    p.remove();
    });

    $(“.btn-send”).off(“click”);
    $(“.btn-send”).on(“click”, function (event) {
    event.preventDefault();
    var p = $(this).parents(“.form-comment”).first();
    p.children(“textarea”).removeAttr(‘style’);
    var text = p.children(“textarea”).val();
    var that = $(this);
    that.hide();
    if (text == “”) {
    $(“.comment_list_822505”).append(generate_popup(‘El campo Comentario es obligatorio.’));
    p.children(“textarea”).css({“border-color”: “red”, “border-width”:”2px”, “border-style”:”solid”});
    that.show();
    } else {
    var p_comment = $(this).parents(“.item-comment-chield”).first();
    var formData = new FormData();
    formData.append(“comment”, text);
    if( p_comment.hasClass(“update”) ){
    p_comment.find(‘.bts-form’).hide();
    var comment_id = p_comment.attr(“data-commentid”);
    // formData.append(“parentId”, comment_id);
    formData.append(“nid”, “822505”);
    $.ajax({
    url: “/ee-comments-services/comments/update/”+comment_id,
    type: ‘POST’,
    data: formData,
    cache: false,
    contentType: false,
    processData: false,
    success: function (response) {
    if (response.status == true) {
    p_comment.children(“.comment-body”).text(text);
    p_comment.children(“.form-comment”).remove();
    p_comment.children(“.btns”).show();
    p_comment.removeClass(“update”);
    } else {
    if(response.message){
    p_comment.children(“.comment-body”).append(generate_popup(response.message));
    }else{
    p_comment.children(“.comment-body”).append(generate_popup(‘No se pudo actualizar el comentario’));
    }
    p_comment.children(“.form-comment”).remove();
    p_comment.children(“.btns”).show();
    }
    that.show();
    }
    });
    }else{
    var cantComment = 0;
    if (p_comment.length == 0) {
    cantComment = can_create_comment();
    formData.append(“parentId”, “0”);
    console.log(‘este es nuevo’);
    } else {
    cantComment = 0;
    formData.append(“parentId”, p_comment.attr(“data-commentid”));
    console.log(‘esto es una respuesta’);
    }
    $.ajax({
    url: “/ee-comments-services/comments/create/822505”,
    type: ‘POST’,
    data: formData,
    cache: false,
    contentType: false,
    processData: false,
    success: function (response) {
    if (response.status == true) {
    var html_comment = _html_comment(response.data, cantComment);
    if (p_comment.length == 0) {
    p.find(“textarea”).val(“”);
    p.parents(“.super_box”).first().find(“.comments_box”).prepend(html_comment);
    } else {
    var btn = p.siblings(“.btns”);
    btn.show();
    p.remove();
    btn.siblings(“.lchildren”).append(html_comment);
    }
    _active_events();
    } else {
    var btn = p.siblings(“.btns”);
    if(response.message){
    console.log(response);
    $(“.comment_list_822505”).append(generate_popup(response.message));
    }else{
    $(“.comment_list_822505”).append(generate_popup(‘No se pudo guardar el comentario’));
    }
    }
    that.show();
    }
    });
    }

    }
    _active_events();
    });

    $(“.btn-responder”).off(“click”);
    $(“.btn-responder”).on(“click”, function (event) {
    event.preventDefault();
    var btn = $(this).parents(“.item-comment-chield”).first().children(“.btns”);
    btn.after(_html_form_send(true));
    btn.hide();
    _active_events();
    });

    $(“.btn-editar”).off(“click”);
    $(“.btn-editar”).on(“click”, function (event) {
    event.preventDefault();
    console.log(‘entro al editar’);
    var p = $(this).parents(“.item-comment-chield”).first();
    var btn = p.children(“.btns”);
    btn.after(_html_form_send(true));
    btn.hide();
    p.addClass(“update”);
    p.find(“textarea”).val(p.children(“.comment-body”).text());
    _active_events();
    });
    $(“.btn-send-notify-user-zone”).off(“click”);
    $(‘.btn-send-notify-user-zone’).click(function () {
    $.ajax({
    method: ‘GET’,
    url: ‘/register-services/user/confirm’,
    cache: false,
    contentType: false,
    processData: false,
    dataType: ‘json’,
    success: function (result) {
    if(result.status) $(‘.div-btn-send-notify’).append(generate_popup(result.message));
    },
    })
    })
    }
    var host = window.location.origin;
    _read_cookie();
    var urlcount = host + “/ee-comments-services/comments/count/” + “822505”;
    $.get(urlcount, function (response) {
    $(“.get_comments_822505”).children(‘span’).html(response.totalComments);
    });
    $(“.get_comments_822505”).on(‘click’, function (event) {
    event.preventDefault();
    var selector = $(“.comment_list_822505”);
    if( selector.hasClass( “push” )){
    selector.removeClass(“push”)
    }else{
    selector.addClass(“push”)

    }
    if( selector.hasClass( “response” )){
    selector.slideToggle(200);
    }else{
    selector.addClass(“response”)
    $.get(host + “/ee-comments-services/comments/read/” + “822505”, function (response) {
    init(response);
    });
    }

    });
    })(jQuery);
    Avistamiento de aves, recuperación de platos históricos y control biológico de plagas con insectos son algunas de las iniciativas que podrá descubrir en este recorrido a través de Cundinamarca, para reencontrarse con el campo.

    Read more »

  • DroneDJ: Yuneec Breeze 4K Giveaway

    DroneDJ: Yuneec Breeze 4K Giveaway

    Do you want a free drone? Of course, you do! At DroneDJ we get many products offered for review. Once we have tried and tested them, we like to give them away to our readers. This month we start with the Yuneec Breeze 4K Giveaway! Entering is free and easy. There are multiple ways to win. Subscribe to the DroneDJ YouTube channel, follow us on Twitter and subscribing to our DroneRise newsletter are just a few. Stay in touch and we will keep you updated with all the new and breaking drone news. Good luck with winning our drone giveaway and thanks for your support!

    more…

    The post DroneDJ: Yuneec Breeze 4K Giveaway appeared first on DroneDJ.

    Read more »

  • DJI Frank Wang Interview With WSJ And DJI Company Information

    DJI Frank Wang Interview With WSJ And DJI Company Information

    Terrific interview with DJI CEO Frank WangHere is an excellent interview with DJI CEO Frank Wang where he talks about the early days of DJI in 2010 right up to the present and how he sees DJI well into the future. DJI are the biggest of all the consumer drone companies with approximately 70% of the market. The interview with DJI…

    Read more »