{"size": 1011, "ext": "js", "max_stars_repo_path": "app/javascript/packs/clickzoom.js", "max_stars_repo_name": "happychriss/r6DBServer", "max_stars_repo_stars_event_min_datetime": "2018-01-13T16:09:16.000Z", "max_stars_repo_stars_event_max_datetime": "2020-10-25T17:53:05.000Z", "max_issues_repo_path": "app/javascript/packs/clickzoom.js", "max_issues_repo_name": "happychriss/r6DBServer", "max_issues_repo_issues_event_min_datetime": "2020-06-08T19:41:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T01:17:59.000Z", "max_forks_repo_path": "app/javascript/packs/clickzoom.js", "max_forks_repo_name": "happychriss/r6DBServer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 11, "max_forks_count": null, "avg_line_length": 21.9782608696, "max_line_length": 144, "alphanum_fraction": 0.5450049456}
/* Required markup sample

 <div class='preview'>
 <img src="small.jpg" alt="" bigpic='big.jpg'>
 <div/>

 <%=link_to(image_tag(doc.get_image_path+'s.jpg', :class => 'zoom'),edit_sort_path(doc.id), :bigjpg=>doc.get_image_path+'.jpg', :id=>count_id)%>
 */

clickzoom = function() {

    $("#container").on('click','.clickzoom',function(e) {

        if ($(this).hasClass('no_clickzoom')){
            $(this).removeClass('no_clickzoom');
            return
        }

        if ($("#click_zoom").length!=0){
            $("#click_zoom").remove();
        } else {

        var big_image_name = $(this).attr('bigjpg');
        var newImg = new Image();
        newImg.src =big_image_name;
        newImg.id='click_zoom';


        new_window = $("#container").append(newImg);

        e.stopPropagation();

        new_window.on('click',function() {
            $("#click_zoom").remove();
        })
        }

    });
};


// starting the script on page load
$(document).ready(function() {
    clickzoom();
});
