Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
Simplify prototype assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Fengyuan Chen committed Dec 23, 2015
1 parent b9831d4 commit 4745588
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 32 deletions.
3 changes: 1 addition & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ var scripts = {
'src/js/variables.js',
'src/js/utilities.js',
'src/js/cropper.js',
'src/js/load.js',
'src/js/init.js',
'src/js/build.js',
'src/js/render.js',
'src/js/preview.js',
'src/js/bind.js',
'src/js/handlers.js',
'src/js/change.js',
'src/js/methods.js',
'src/js/prototype.js',
'src/js/defaults.js',
'src/js/template.js',
'src/js/plugin.js',
Expand Down
4 changes: 1 addition & 3 deletions src/js/bind.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$.extend(prototype, {
bind: function () {
var options = this.options;
var $this = this.$element;
Expand Down Expand Up @@ -85,5 +84,4 @@
if (options.responsive) {
$window.off(EVENT_RESIZE, this._resize);
}
}
});
},
4 changes: 1 addition & 3 deletions src/js/build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$.extend(prototype, {
build: function () {
var options = this.options;
var $this = this.$element;
Expand Down Expand Up @@ -116,5 +115,4 @@

this.$cropper.remove();
this.$cropper = null;
}
});
},
4 changes: 1 addition & 3 deletions src/js/change.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$.extend(prototype, {
change: function (shiftKey, originalEvent) {
var options = this.options;
var aspectRatio = options.aspectRatio;
Expand Down Expand Up @@ -400,5 +399,4 @@
// Override
this.startX = this.endX;
this.startY = this.endY;
}
});
},
4 changes: 1 addition & 3 deletions src/js/handlers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$.extend(prototype, {
resize: function () {
var restore = this.options.restore;
var $container = this.$container;
Expand Down Expand Up @@ -204,5 +203,4 @@
action: action
});
}
}
});
},
7 changes: 4 additions & 3 deletions src/js/load.js → src/js/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$.extend(prototype, {
Cropper.prototype = {
constructor: Cropper,

init: function () {
var $this = this.$element;
var url;
Expand Down Expand Up @@ -205,5 +207,4 @@
stop: function () {
this.$clone.remove();
this.$clone = null;
}
});
},
4 changes: 1 addition & 3 deletions src/js/methods.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
$.extend(prototype, {

// Show the crop box manually
crop: function () {
if (!this.isBuilt || this.isDisabled) {
Expand Down Expand Up @@ -745,4 +743,4 @@
}
}
}
});
};
4 changes: 1 addition & 3 deletions src/js/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$.extend(prototype, {
initPreview: function () {
var crossOrigin = getCrossOrigin(this.crossOrigin);
var url = crossOrigin ? this.crossOriginUrl : this.url;
Expand Down Expand Up @@ -96,5 +95,4 @@
transform: getTransform(image)
});
});
}
});
},
1 change: 0 additions & 1 deletion src/js/prototype.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/js/render.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$.extend(prototype, {
render: function () {
this.initContainer();
this.initCanvas();
Expand Down Expand Up @@ -464,5 +463,4 @@
this.trigger(EVENT_CROP, this.getData());
}, this));
}
}
});
},
6 changes: 1 addition & 5 deletions src/js/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,5 @@
var round = Math.round;
var floor = Math.floor;

// Prototype
var prototype = {
version: '@VERSION'
};

// Utilities
var fromCharCode = String.fromCharCode;

0 comments on commit 4745588

Please sign in to comment.