Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jcropper

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jcropper - npm Package Compare versions

Comparing version 0.9.13 to 0.9.14

2

package.json

@@ -8,3 +8,3 @@ {

},
"version": "0.9.13",
"version": "0.9.14",
"private": false,

@@ -11,0 +11,0 @@ "license": "MIT",

/**
* jcropper.js v0.9.12
* jcropper.js v0.9.14
* jQuery Image Cropping Plugin - released under MIT License
* Author: Augustin deMayo <gus.demayo@gmail.com>
* https://bitbucket.org/istattic/jcropper
* Copyright (c) 2017 University of Nebraska IS&T Attic
* Original Author: Kelly Hallman <khallman@gmail.com>
* https://github.com/tapmodo/Jcropper
* Copyright (c) 2008-2013 Tapmodo Interactive LLC {{{
* https://github.com/tapmodo/Jcrop
* Copyright (c) 2008-2013 Tapmodo Interactive LLC
*

@@ -31,11 +32,8 @@ * Permission is hereby granted, free of charge, to any person

*
* }}}
*
*/
var color = require('./components/jquery-color.js')
(function($) {
$.Jcropper = function(obj, opt) {
var options = $.extend({}, $.Jcropper.defaults),
$.Jcrop = function(obj, opt) {
var options = $.extend({}, $.Jcrop.defaults),
docOffset,

@@ -138,3 +136,2 @@ _ua = navigator.userAgent.toLowerCase(),

lloc = pos;
Selection.update();

@@ -229,7 +226,7 @@ };

if (options.disabled) {
return;
return false;
}
if (!options.allowSelect) {
return;
return false;
}

@@ -320,3 +317,2 @@

boundy = $img.height(),
$div = $('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({

@@ -332,5 +328,3 @@ position: 'relative',

var $img2 = $('<div />'),
$img_holder = $('<div />')
.width('100%').height('100%').css({
$img_holder = $('<div />').width('100%').height('100%').css({
zIndex: 310,

@@ -340,8 +334,4 @@ position: 'absolute',

}),
$hdl_holder = $('<div />')
.width('100%').height('100%').css('zIndex', 320),
$sel = $('<div />')
.css({
$hdl_holder = $('<div />').width('100%').height('100%').css('zIndex', 320),
$sel = $('<div />').css({
position: 'absolute',

@@ -355,4 +345,3 @@ zIndex: 600

if (img_mode) {
$img2 = $('<img />')
.attr('src', $img.attr('src')).css(img_css).width(boundx).height(boundy),
$img2 = $('<img />').attr('src', $img.attr('src')).css(img_css).width(boundx).height(boundy),
$img_holder.append($img2);

@@ -415,2 +404,3 @@ }

}
return {

@@ -447,2 +437,3 @@ createDragger: function(ord) {

}());
var Coords = (function() {

@@ -501,3 +492,2 @@ var x1 = 0,

var c = getFixed();
switch (ord) {

@@ -575,2 +565,3 @@ case 'ne':

}
if (yy > y1) {

@@ -587,2 +578,3 @@ yy = y1 + (xx - x1) / aspect;

}
if (yy > y1) {

@@ -749,3 +741,2 @@ yy = y1 + (x1 - xx) / aspect;

});
shades.right.css({

@@ -798,4 +789,4 @@ height: px(h)

$img2.hide();
setBgColor(options.shadeColor || options.bgColor, 1);
setBgColor(options.shadeColor || options.bgColor, 1);
if (Selection.isAwake()) {

@@ -816,2 +807,3 @@ setOpacity(options.bgOpacity, 1);

enabled = false;
if (Selection.isAwake()) {

@@ -823,2 +815,3 @@ Selection.setBgOpacity(options.bgOpacity, 1, 1);

}
colorChangeMacro($div, 0, 1);

@@ -891,3 +884,3 @@ }

if (Touch.support) {
jq.bind('touchstart.jcropper', Touch.createDragger(ord));
jq.bind('touchstart.jcrop', Touch.createDragger(ord));
}

@@ -901,2 +894,3 @@

var hs = options.handleSize,
div = dragDiv(ord, hdep++).css({

@@ -914,3 +908,3 @@ opacity: options.handleOpacity

function insertDragbar(ord) {
return dragDiv(ord, hdep++).addClass('jcropper-dragbar');
return dragDiv(ord, hdep++).addClass('jcrop-dragbar');
}

@@ -926,5 +920,5 @@

function createBorders(li) //{{{
{
function createBorders(li) {
var cl, i;
for (i = 0; i < li.length; i++) {

@@ -945,2 +939,3 @@ switch (li[i]) {

}
borders[li[i]] = insertBorder(cl);

@@ -1078,4 +1073,4 @@ }

$(document).bind('touchstart.jcropper-ios', function(e) {
if ($(e.currentTarget).hasClass('jcropper-tracker')) e.stopPropagation();
$(document).bind('touchstart.jcrop-ios', function(e) {
if ($(e.currentTarget).hasClass('jcrop-tracker')) e.stopPropagation();
});

@@ -1090,3 +1085,3 @@

if (Touch.support) {
$track.bind('touchstart.jcropper', Touch.createDragger('move'));
$track.bind('touchstart.jcrop', Touch.createDragger('move'));
}

@@ -1130,10 +1125,11 @@

if (touch) {
if (touch)
$(document)
.bind('touchmove.jcropper', trackTouchMove)
.bind('touchend.jcropper', trackTouchEnd);
} else if (trackDoc) {
$(document).bind('mousemove.jcropper', trackMove)
.bind('mouseup.jcropper', trackUp);
}
.bind('touchmove.jcrop', trackTouchMove)
.bind('touchend.jcrop', trackTouchEnd);
else if (trackDoc)
$(document)
.bind('mousemove.jcrop', trackMove)
.bind('mouseup.jcrop', trackUp);
}

@@ -1146,3 +1142,3 @@

$(document).unbind('.jcropper');
$(document).unbind('.jcrop');
}

@@ -1161,3 +1157,2 @@

btndown = false;
onDone(mouseAbs(e));

@@ -1203,2 +1198,3 @@

$img.before($trk);
return {

@@ -1215,3 +1211,3 @@ activateHandlers: activateHandlers,

width: '12px'
}).addClass('jcropper-keymgr'),
}).addClass('jcrop-keymgr'),

@@ -1248,3 +1244,2 @@ $keywrap = $('<div />').css({

}
shift_down = e.shiftKey ? true : false;

@@ -1352,3 +1347,2 @@ var nudge = shift_down ? 10 : 1;

Selection.animMode(false);
if (typeof(callback) === 'function') {

@@ -1410,3 +1404,3 @@ callback.call(api);

$origimg.css('visibility', 'visible');
$(obj).removeData('Jcropper');
$(obj).removeData('Jcrop');
}

@@ -1492,2 +1486,3 @@

);
bgcolor = options.bgColor;

@@ -1515,3 +1510,3 @@ }

if (Touch.support) $trk.bind('touchstart.jcropper', Touch.newSelection);
if (Touch.support) $trk.bind('touchstart.jcrop', Touch.newSelection);
$hdl_holder.hide();

@@ -1556,14 +1551,16 @@ interfaceUpdate(true);

$origimg.data('Jcropper', api);
$origimg.data('Jcrop', api);
return api;
};
$.fn.Jcropper = function(options, callback) {
$.fn.Jcrop = function(options, callback) {
var api;
this.each(function() {
if ($(this).data('Jcropper')) {
if (options === 'api') return $(this).data('Jcropper');
else $(this).data('Jcropper').setOptions(options);
if ($(this).data('Jcrop')) {
if (options === 'api') return $(this).data('Jcrop');
else $(this).data('Jcrop').setOptions(options);
} else {
if (this.tagName == 'IMG') {
$.Jcropper.Loader(this, function() {
if (this.tagName == 'IMG')
$.Jcrop.Loader(this, function() {
$(this).css({

@@ -1574,6 +1571,6 @@ display: 'block',

api = $.Jcropper(this, options);
api = $.Jcrop(this, options);
if ($.isFunction(callback)) callback.call(api);
});
} else {
else {
$(this).css({

@@ -1584,3 +1581,3 @@ display: 'block',

api = $.Jcropper(this, options);
api = $.Jcrop(this, options);
if ($.isFunction(callback)) callback.call(api);

@@ -1594,3 +1591,3 @@ }

$.Jcropper.Loader = function(imgobj, success, error) {
$.Jcrop.Loader = function(imgobj, success, error) {
var $img = $(imgobj),

@@ -1618,3 +1615,3 @@ img = $img[0];

$.Jcropper.defaults = {
$.Jcrop.defaults = {
allowSelect: true,

@@ -1624,3 +1621,3 @@ allowMove: true,

trackDocument: true,
baseClass: 'jcropper',
baseClass: 'jcrop',
addClass: null,

@@ -1627,0 +1624,0 @@ bgColor: 'black',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc