Skip to content

Commit

Permalink
Recompile with Coffeescript 1.6.1 and add source map support to Cakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingice committed Mar 6, 2013
1 parent df24c10 commit bfb5722
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 42 deletions.
9 changes: 7 additions & 2 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ coffeeFiles = [

# Core library
"core/caman"
#"core/camaninstance"

# Everything else
"core/analyze"
Expand Down Expand Up @@ -114,7 +113,8 @@ task 'build', 'Compile and minify all CoffeeScript source files', ->
finishListener 'js', -> invoke 'minify'
invoke 'compile'

task 'compile', 'Compile all CoffeeScript source files', ->
option '-m', '--map', 'Compile with source maps'
task 'compile', 'Compile all CoffeeScript source files', (options) ->
util.log "Building #{targetCoreJS} and #{targetFullJS}"
contents = []
remaining = coffeeFiles.length
Expand All @@ -133,6 +133,11 @@ task 'compile', 'Compile all CoffeeScript source files', ->
core = contents.join("\n\n")
full = core + "\n\n" + getPlugins()

if options.map
util.log "Source map support enabled"
coffeeCoreOpts = "-m #{coffeeCoreOpts}"
coffeeFullOpts = "-m #{coffeeFullOpts}"

fs.writeFile "#{targetCoffee}.coffee", core, "utf8", (err) ->
util.log err if err

Expand Down
25 changes: 14 additions & 11 deletions dist/caman.full.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Generated by CoffeeScript 1.4.0
//@ sourceMappingURL=caman.full.map
// Generated by CoffeeScript 1.6.1
(function() {
var $, Analyze, Blender, Calculate, Caman, CamanParser, Canvas, Convert, Event, Fiber, Filter, IO, Image, Layer, Log, Logger, PixelInfo, Plugin, Renderer, Root, Store, Util, fs, slice, vignetteFilters,
__hasProp = {}.hasOwnProperty,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
_this = this,
__slice = [].slice;

slice = Array.prototype.slice;
Expand Down Expand Up @@ -799,7 +800,7 @@
}
if (bezier.length < end[0] + 1) {
for (i = _j = 0, _ref = end[0]; 0 <= _ref ? _j <= _ref : _j >= _ref; i = 0 <= _ref ? ++_j : --_j) {
if (!(bezier[i] != null)) {
if (bezier[i] == null) {
leftCoord = [i - 1, bezier[i - 1]];
for (j = _k = i, _ref1 = end[0]; i <= _ref1 ? _k <= _ref1 : _k >= _ref1; j = i <= _ref1 ? ++_k : --_k) {
if (bezier[j] != null) {
Expand All @@ -811,7 +812,7 @@
}
}
}
if (!(bezier[end[0]] != null)) {
if (bezier[end[0]] == null) {
bezier[end[0]] = bezier[end[0] - 1];
}
return bezier;
Expand Down Expand Up @@ -1412,7 +1413,7 @@
result.r = Util.clampRGB(result.r);
result.g = Util.clampRGB(result.g);
result.b = Util.clampRGB(result.b);
if (!(result.a != null)) {
if (result.a == null) {
result.a = rgbaLayer.a;
}
parentData[i] = rgbaParent.r - ((rgbaParent.r - result.r) * (this.options.opacity * (result.a / 255)));
Expand Down Expand Up @@ -1563,9 +1564,11 @@
Renderer.Blocks = Caman.NodeJS ? require('os').cpus().length : 4;

function Renderer(c) {
var _this = this;
this.c = c;
this.processNext = __bind(this.processNext, this);

this.processNext = function() {
return Renderer.prototype.processNext.apply(_this, arguments);
};
this.renderQueue = [];
this.modPixelData = null;
}
Expand Down Expand Up @@ -1679,7 +1682,7 @@
data.b = this.c.pixelData[i + 2];
data.a = this.c.pixelData[i + 3];
res = this.currentJob.processFn.call(pixelInfo, data);
if (!(res.a != null)) {
if (res.a == null) {
res.a = data.a;
}
this.c.pixelData[i] = Util.clampRGB(res.r);
Expand Down Expand Up @@ -2242,13 +2245,13 @@
if (newDims == null) {
newDims = null;
}
if (newDims === null || (!(newDims.width != null) && !(newDims.height != null))) {
if (newDims === null || ((newDims.width == null) && (newDims.height == null))) {
Log.error("Invalid or missing dimensions given for resize");
return;
}
if (!(newDims.width != null)) {
if (newDims.width == null) {
newDims.width = this.canvas.width * newDims.height / this.canvas.height;
} else if (!(newDims.height != null)) {
} else if (newDims.height == null) {
newDims.height = this.canvas.height * newDims.width / this.canvas.width;
}
if (typeof exports !== "undefined" && exports !== null) {
Expand Down
10 changes: 10 additions & 0 deletions dist/caman.full.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/caman.full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/caman.full.pack.js

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions dist/caman.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Generated by CoffeeScript 1.4.0
//@ sourceMappingURL=caman.map
// Generated by CoffeeScript 1.6.1
(function() {
var $, Analyze, Blender, Calculate, Caman, CamanParser, Canvas, Convert, Event, Fiber, Filter, IO, Image, Layer, Log, Logger, PixelInfo, Plugin, Renderer, Root, Store, Util, fs, slice,
__hasProp = {}.hasOwnProperty,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
_this = this,
__slice = [].slice;

slice = Array.prototype.slice;
Expand Down Expand Up @@ -799,7 +800,7 @@
}
if (bezier.length < end[0] + 1) {
for (i = _j = 0, _ref = end[0]; 0 <= _ref ? _j <= _ref : _j >= _ref; i = 0 <= _ref ? ++_j : --_j) {
if (!(bezier[i] != null)) {
if (bezier[i] == null) {
leftCoord = [i - 1, bezier[i - 1]];
for (j = _k = i, _ref1 = end[0]; i <= _ref1 ? _k <= _ref1 : _k >= _ref1; j = i <= _ref1 ? ++_k : --_k) {
if (bezier[j] != null) {
Expand All @@ -811,7 +812,7 @@
}
}
}
if (!(bezier[end[0]] != null)) {
if (bezier[end[0]] == null) {
bezier[end[0]] = bezier[end[0] - 1];
}
return bezier;
Expand Down Expand Up @@ -1412,7 +1413,7 @@
result.r = Util.clampRGB(result.r);
result.g = Util.clampRGB(result.g);
result.b = Util.clampRGB(result.b);
if (!(result.a != null)) {
if (result.a == null) {
result.a = rgbaLayer.a;
}
parentData[i] = rgbaParent.r - ((rgbaParent.r - result.r) * (this.options.opacity * (result.a / 255)));
Expand Down Expand Up @@ -1563,9 +1564,11 @@
Renderer.Blocks = Caman.NodeJS ? require('os').cpus().length : 4;

function Renderer(c) {
var _this = this;
this.c = c;
this.processNext = __bind(this.processNext, this);

this.processNext = function() {
return Renderer.prototype.processNext.apply(_this, arguments);
};
this.renderQueue = [];
this.modPixelData = null;
}
Expand Down Expand Up @@ -1679,7 +1682,7 @@
data.b = this.c.pixelData[i + 2];
data.a = this.c.pixelData[i + 3];
res = this.currentJob.processFn.call(pixelInfo, data);
if (!(res.a != null)) {
if (res.a == null) {
res.a = data.a;
}
this.c.pixelData[i] = Util.clampRGB(res.r);
Expand Down Expand Up @@ -2242,13 +2245,13 @@
if (newDims == null) {
newDims = null;
}
if (newDims === null || (!(newDims.width != null) && !(newDims.height != null))) {
if (newDims === null || ((newDims.width == null) && (newDims.height == null))) {
Log.error("Invalid or missing dimensions given for resize");
return;
}
if (!(newDims.width != null)) {
if (newDims.width == null) {
newDims.width = this.canvas.width * newDims.height / this.canvas.height;
} else if (!(newDims.height != null)) {
} else if (newDims.height == null) {
newDims.height = this.canvas.height * newDims.width / this.canvas.width;
}
if (typeof exports !== "undefined" && exports !== null) {
Expand Down
10 changes: 10 additions & 0 deletions dist/caman.map

Large diffs are not rendered by default.

Loading

0 comments on commit bfb5722

Please sign in to comment.