<commit_before>/**
 * jquery.imageCursorZoom
 * jQuery Plugin
 *
 * @author <EMAIL>
 * @since 2015.09.10
 * @see https://github.com/bitofsky/jquery.imagecursorzoom
 * @license MIT
 * @version 1.0
 */
"use strict";(function(window,$,define){$.imageCursorZoom=imageCursorZoom;$.fn.imageCursorZoom=function(option){return this.on('click.imageCursorZoom',function(){imageCursorZoom(this,option);});};function imageCursorZoom(elm,option){var opt=$.extend(true,{parent:'BODY',src:function(){return this.src;},onerror:function(src){window.open(src);}},option),src=typeof opt.src=='function'?opt.src.call(elm):opt.src,$parent=$(typeof opt.parent=='function'?opt.parent.call(elm):opt.parent),$wrapper=$('<div/>'),$clone=$('<img/>').attr('src',src).css({width:'auto',height:'auto',transition:opt.transition}),parentWidth=0,parentHeight=0,isBody=$parent[0]===$('BODY')[0],scrollTop=isBody?Math.max($('BODY').scrollTop(),$(window).scrollTop()):$parent.scrollTop(),scrollLeft=isBody?Math.max($('BODY').scrollLeft(),$(window).scrollLeft()):$parent.scrollLeft(),overflowX=$parent[0].style.overflowX,overflowY=$parent[0].style.overflowY,position=$parent[0].style.position;try{(isBody?$(window):$parent).on('resize',onResize).trigger('resize');}catch(e){opt.onerror(src);return;}if(!isBody)$parent.css('position','relative');$parent.css({'overflow-x':'hidden','overflow-y':'hidden'});$wrapper.on('mousemove.imageCursorZoom',function(event){moveImage(event.pageX,event.pageY);}).on('click.imageCursorZoom',destroy).css({overflow:'hidden',position:'absolute',left:scrollLeft,top:scrollTop,background:'white',width:'100%',height:'100%','z-index':9999}).append($clone).appendTo($parent);var clientWidth=$clone[0].clientWidth||$clone.width(),clientHeight=$clone[0].clientHeight||$clone.height();moveImage(0,0);function moveImage(mouseX,mouseY){var posX=getPx(mouseX,scrollLeft,parentWidth,clientWidth),posY=getPx(mouseY,scrollTop,parentHeight,clientHeight);$clone.css('transform','translate('+posX+'px, '+posY+'px)');}function getPx(pos,scroll,pSize,cSize){var x,ratio,px;x=pos-scroll,ratio=(x/pSize)>1?1:(x/pSize),ratio=ratio>1?1:ratio;px=(pSize-cSize)*ratio,px=px>0?0:px;px=cSize<pSize?((pSize-cSize)/2):px;return px;}function onResize(event){parentWidth=+$(this).width();parentHeight=+$(this).height();}function destroy(){$clone.remove();$wrapper.remove();$parent[0].style.overflowX=overflowX;$parent[0].style.overflowY=overflowY;$parent[0].style.position=position;}}if(define&&define.amd)define('imageCursorZoom',[],function(){return imageCursorZoom;});})(this,this.jQuery,this.define);<commit_msg>Update jquery.imagecursorzoom.min.js<commit_after>/**
 * jquery.imageCursorZoom
 * jQuery Plugin
 *
 * @author <EMAIL>
 * @since 2015.09.10
 * @see https://github.com/bitofsky/jquery.imagecursorzoom
 * @license MIT
 * @version 1.0
 */
"use strict";(function(window,$,define){$.imageCursorZoom=imageCursorZoom;$.fn.imageCursorZoom=function(option){return this.on('click.imageCursorZoom',function(){imageCursorZoom(this,option);});};function imageCursorZoom(elm,option){var clientWidth=elm.clientWidth,clientHeight=elm.clientHeight;var opt=$.extend(true,{parent:'BODY',src:function(){return this.src;},onerror:function(src){window.open(src);},ondestroy:null},option),src=typeof opt.src=='function'?opt.src.call(elm):opt.src,$parent=$(typeof opt.parent=='function'?opt.parent.call(elm):opt.parent),$wrapper=$('<div/>'),$clone=$('<img/>').on('load',imageLoaded).on('error',imageFailed).attr('src',src).css({visibility:'hidden',width:'auto',height:'auto',transition:opt.transition}),parentWidth=0,parentHeight=0,isBody=$parent[0]===$('BODY')[0],scrollTop=isBody?Math.max($('BODY').scrollTop(),$(window).scrollTop()):$parent.scrollTop(),scrollLeft=isBody?Math.max($('BODY').scrollLeft(),$(window).scrollLeft()):$parent.scrollLeft(),overflowX=$parent[0].style.overflowX,overflowY=$parent[0].style.overflowY,position=$parent[0].style.position;try{(isBody?$(window):$parent).on('resize',onResize).trigger('resize');}catch(e){opt.onerror(src);return;}if(!isBody)$parent.css('position','relative');$parent.css({'overflow-x':'hidden','overflow-y':'hidden'});$wrapper.on('mousemove.imageCursorZoom',function(event){moveImage(event.pageX,event.pageY);}).on('click.imageCursorZoom',destroy).css({overflow:'hidden',position:'absolute',left:scrollLeft,top:scrollTop,background:'white',width:'100%',height:'100%','z-index':9999}).append($clone).appendTo($parent);function imageFailed(){moveImage(0,0);$clone.attr('src',elm.src);created();}function imageLoaded(){clientWidth=this.clientWidth||$clone.width();clientHeight=this.clientHeight||$clone.height();created();}function created(){moveImage(0,0);$clone.css({visibility:'visible'});if(typeof opt.oncreate==='function'){opt.oncreate.call(elm,$clone,$wrapper);}}function moveImage(mouseX,mouseY){var posX=getPx(mouseX,scrollLeft,parentWidth,clientWidth),posY=getPx(mouseY,scrollTop,parentHeight,clientHeight);$clone.css('transform','translate('+posX+'px, '+posY+'px)');}function getPx(pos,scroll,pSize,cSize){var x,ratio,px;x=pos-scroll,ratio=(x/pSize)>1?1:(x/pSize),ratio=ratio>1?1:ratio;px=(pSize-cSize)*ratio,px=cSize<pSize?((pSize-cSize)/2):px;px=cSize>pSize&&px>0?0:px;return px;}function onResize(event){parentWidth=+$(this).width();parentHeight=+$(this).height();}function destroy(){$clone.remove();$wrapper.remove();$parent[0].style.overflowX=overflowX;$parent[0].style.overflowY=overflowY;$parent[0].style.position=position;if(typeof opt.ondestroy==='function'){opt.ondestroy.call(elm);}}}if(define&&define.amd)define('imageCursorZoom',[],function(){return imageCursorZoom;});})(this,this.jQuery,this.define);
{'fraction_non_alphanumeric': 0.2356597407210087, 'fraction_numerical': 0.01456224471674658, 'mean_word_length': 17.962962962962962, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1344796', 'n_tokens_mistral': 1903, 'n_tokens_neox': 1849, 'n_words': 69}