fis-spriter-csssprites
Advanced tools
Comparing version 0.3.8 to 0.3.9
@@ -10,3 +10,2 @@ /** | ||
var cssParser = require('./libs/cssParser.js'); | ||
var util = require('./libs/util.js'); | ||
var imgGen; | ||
@@ -62,5 +61,5 @@ try { | ||
var images = {}; | ||
fis.util.map(ret.src, function (subpath, item) { | ||
if (item.isImage()) { | ||
images[util.getUrl(item, file, opt)] = item; | ||
fis.util.map(ret.src, function (subpath, file) { | ||
if (file.isImage()) { | ||
images[file.getUrl(opt.hash, opt.domain)] = file; | ||
} | ||
@@ -75,2 +74,2 @@ }); | ||
return content; | ||
} | ||
} |
@@ -8,3 +8,2 @@ /* | ||
var Image = require('images'); | ||
var util = require('./util.js'); | ||
@@ -17,3 +16,3 @@ module.exports = function(file, index, list, images, ret, settings, opt) { | ||
function Generator(file, index, list, images, ret, settings, opt) { | ||
var default_settings = { | ||
@@ -39,3 +38,3 @@ 'margin': 3, | ||
//如果layout不支持的类型,默认为linear | ||
var layouts = ['matrix', 'linear']; | ||
var layouts = ['matrix', 'linear']; | ||
if (layouts.indexOf(settings.layout) == -1) { | ||
@@ -79,3 +78,3 @@ settings.layout = 'linear'; | ||
bg.image_ = image_; | ||
var scale_ = bg.size[0] / image_.size().width; | ||
@@ -119,3 +118,3 @@ | ||
}, | ||
after: function (image, arr_selector, direct, scale, list) { | ||
after: function (image, arr_selector, direct, scale) { | ||
var ext = '_' + direct + '.png'; | ||
@@ -135,9 +134,3 @@ var size = image.size(); | ||
this.ret.pkg[this.file.subpathNoExt + ext] = image_file; | ||
// 记录这些图片已经被打包到其他文件上了。 | ||
list.forEach(function(image) { | ||
var map = image.map = image.map || {}; | ||
map.cssspritePkg = image_file.getId(); | ||
}); | ||
function unique(arr) { | ||
@@ -149,3 +142,3 @@ var map = {}; | ||
} | ||
var imageUrl = util.getUrl(image_file, this.file, this.opt); | ||
if (this.settings.ie_bug_fix) { | ||
@@ -162,3 +155,3 @@ var MAX = this.settings.max_selectores || 30; //max 36 | ||
+ (scale ? 'background-size: ' + (size.width * scale) + 'px ' + (size.height * scale) + 'px;': '') | ||
+ 'background-image: url(' + imageUrl + ')}'; | ||
+ 'background-image: url(' + image_file.getUrl(this.opt.hash, this.opt.domain) + image_file.hash + ')}'; | ||
} | ||
@@ -169,3 +162,3 @@ } else { | ||
+ (scale ? 'background-size: ' + (size.width * scale) + 'px ' + (size.height * scale) + 'px;': '') | ||
+ 'background-image: url(' + imageUrl + ')}'; | ||
+ 'background-image: url(' + image_file.getUrl(this.opt.hash, this.opt.domain) + image_file.hash + ')}'; | ||
} | ||
@@ -262,3 +255,3 @@ | ||
this.after(image, cls, direct, null, list); | ||
this.after(image, cls, direct); | ||
}, | ||
@@ -405,4 +398,4 @@ zFill: function(list, scale) { | ||
} | ||
this.after(image, cls, 'z', scale, list); | ||
this.after(image, cls, 'z', scale); | ||
} | ||
}; |
{ | ||
"name": "fis-spriter-csssprites", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "基于fis的csssprite,支持repeat-x,repeat-x,background-position", | ||
@@ -14,6 +14,6 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "https://github.com/fis-dev/fis-spriter-csssprites.git" | ||
"url": "git+https://github.com/fis-dev/fis-spriter-csssprites.git" | ||
}, | ||
"dependencies": { | ||
"images": "2.1.11" | ||
"images": "2.1.5" | ||
}, | ||
@@ -31,7 +31,37 @@ "keywords": [ | ||
], | ||
"author": "xiangshouding <xiangshouding@baidu.com>", | ||
"author": { | ||
"name": "xiangshouding", | ||
"email": "xiangshouding@baidu.com" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/fis-dev/fis-spriter-csssprites/issues" | ||
} | ||
}, | ||
"gitHead": "09baa28fa200daacc75f8cc2b91f73ac1ea034bf", | ||
"homepage": "https://github.com/fis-dev/fis-spriter-csssprites#readme", | ||
"_id": "fis-spriter-csssprites@0.3.0", | ||
"_shasum": "4f69bb2163764e905d8c71af31fc26f5c4148c7f", | ||
"_from": "fis-spriter-csssprites@0.3.0", | ||
"_npmVersion": "2.9.0", | ||
"_nodeVersion": "2.0.1", | ||
"_npmUser": { | ||
"name": "fansekey", | ||
"email": "fansekey@gmail.com" | ||
}, | ||
"dist": { | ||
"shasum": "4f69bb2163764e905d8c71af31fc26f5c4148c7f", | ||
"tarball": "http://registry.npmjs.org/fis-spriter-csssprites/-/fis-spriter-csssprites-0.3.0.tgz" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "fansekey", | ||
"email": "fansekey@gmail.com" | ||
}, | ||
{ | ||
"name": "fis-dev", | ||
"email": "longyun_zh@163.com" | ||
} | ||
], | ||
"_resolved": "https://registry.npmjs.org/fis-spriter-csssprites/-/fis-spriter-csssprites-0.3.0.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
32696
2
8
682
+ Addedimages@2.1.5(transitive)
- Removedimages@2.1.11(transitive)
Updatedimages@2.1.5