Skip to content

Commit

Permalink
Built Zepto and modified make
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonrt committed Oct 11, 2015
1 parent 4739d91 commit ce11cad
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
36 changes: 35 additions & 1 deletion dist/zepto.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Zepto 1.1.6 - umd-head zepto event ajax form ie data fx_methods fx touch umd-tail - zeptojs.com/license */
/* Zepto 1.1.6 - umd-head zepto event ajax form ie data fx_methods fx touch polyfill-jquery umd-tail - zeptojs.com/license */
;(function (factory)
{
'use strict';
Expand Down Expand Up @@ -2027,5 +2027,39 @@ window.$ === undefined && (window.$ = Zepto)
})
})(Zepto)

(function($) {
// Add inner and outer width to zepto (adapted from https://gist.github.com/alanhogan/3935463)
var ioDim = function(dimension, includeBorder) {
return function (includeMargin) {
var sides, size, elem;
if (this) {
elem = this;
size = elem[dimension]();
sides = {
width: ["left", "right"],
height: ["top", "bottom"]
};
sides[dimension].forEach(function(side) {
size += parseInt(elem.css("padding-" + side), 10);
if (includeBorder) {
size += parseInt(elem.css("border-" + side + "-width"), 10);
}
if (includeMargin) {
size += parseInt(elem.css("margin-" + side), 10);
}
});
return size;
} else {
return null;
}
}
};
["width", "height"].forEach(function(dimension) {
var Dimension = dimension.substr(0,1).toUpperCase() + dimension.substr(1);
$.fn["inner" + Dimension] = ioDim(dimension, false);
$.fn["outer" + Dimension] = ioDim(dimension, true);
});
})(Zepto);

return Zepto;
}));
Binary file modified dist/zepto.min.gz
Binary file not shown.
5 changes: 3 additions & 2 deletions dist/zepto.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion make
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ target.dist = ->
target.build = ->
cd __dirname
mkdir '-p', 'dist'
modules = (env['MODULES'] || 'umd-head zepto event ajax form ie data fx_methods fx touch umd-tail').split(' ')
modules = (env['MODULES'] || 'umd-head zepto event ajax form ie data fx_methods fx touch polyfill-jquery umd-tail').split(' ')
module_files = ( "src/#{module}.js" for module in modules )
intro = "/* Zepto #{describe_version()} - #{modules.join(' ')} - zeptojs.com/license */\n"
dist = (intro + cat(module_files).replace(/^\/[\/*].*$/mg, '')).replace(/\n{3,}/g, "\n\n")
Expand Down

0 comments on commit ce11cad

Please sign in to comment.