better approach for handling retina icons
40
node_modules/architect-build/build.js
generated
vendored
@ -161,6 +161,8 @@ function compileLess(opts, sources, callback) {
|
||||
var cache = opts.cache;
|
||||
if (cache && !cache.less)
|
||||
cache.less = Object.create(null);
|
||||
if (cache && !cache.images)
|
||||
cache.images = Object.create(null);
|
||||
|
||||
var libs = opts.lessLibs;
|
||||
less.forEach(function(file) {
|
||||
@ -175,9 +177,15 @@ function compileLess(opts, sources, callback) {
|
||||
}
|
||||
|
||||
var staticPrefix = plugin.staticPrefix || libs.staticPrefix;
|
||||
var id = file.pkg.id.replace(/^[^!]+!/, "");
|
||||
// Complete paths, but not subdirectories like foo/images/bar.png
|
||||
var lessCode = file.code.replace(/(["(])(images|icons)\//g, "$1" + staticPrefix + "/$2/");
|
||||
code.push("ß{" + lessPathLib(staticPrefix) + lessCode + "}");
|
||||
code.push(
|
||||
"/* @file " + id + " */\nß{"
|
||||
+ lessPathLib(staticPrefix)
|
||||
+ lessCode
|
||||
+ "}"
|
||||
);
|
||||
});
|
||||
|
||||
var ctx = {
|
||||
@ -193,12 +201,38 @@ function compileLess(opts, sources, callback) {
|
||||
|
||||
toCss(tree, imports, options, function(err, css) {
|
||||
if (err) return callback(err);
|
||||
|
||||
callback(null, { code: css.replace(/ß /g, "").replace(/^ +/gm, "\t") });
|
||||
css = css.replace(/ß /g, "").replace(/^ +/gm, "\t");
|
||||
css = checkImages(css, cache);
|
||||
callback(null, { code: css });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function checkImages(css, cache) {
|
||||
var images = cache && cache.images || Object.create(null);
|
||||
var root = __dirname + "/../../";
|
||||
var t = Date.now();
|
||||
css = css.replace(/(url\(['"]?\/static\/)([^"')]+)/g, function(_, prefix, imagePath) {
|
||||
var dir = path.dirname(imagePath);
|
||||
var name = path.basename(imagePath);
|
||||
try {
|
||||
if (!images[dir])
|
||||
images[dir] = fs.readdirSync(root + dir);
|
||||
} catch(e) {
|
||||
images[dir] = [];
|
||||
}
|
||||
if (images[dir].indexOf(name) != -1)
|
||||
return prefix + imagePath;
|
||||
var name1 = name.replace("@1x", "");
|
||||
if (images[dir].indexOf(name1) != -1)
|
||||
return prefix + dir + name1;
|
||||
|
||||
console.log("missing image:" + imagePath);
|
||||
return prefix + undefined + imagePath;
|
||||
});
|
||||
console.log(t- Date.now());
|
||||
return css
|
||||
}
|
||||
|
||||
function addCssPrefixes(css) {
|
||||
return css.replace(/\b(user-select|font-smoothing)\b([^;\n]+);?/g, function(_, prop, value, index, string) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "c9",
|
||||
"description": "New Cloud9 Client",
|
||||
"version": "3.1.4072",
|
||||
"version": "3.1.5000",
|
||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||
"private": true,
|
||||
"main": "bin/c9",
|
||||
@ -56,4 +56,4 @@
|
||||
"msgpack-js",
|
||||
"c9"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
skin = "btn-statusbar-icon"
|
||||
skinset = "c9statusbar"
|
||||
height = "23"
|
||||
icon = "pref-ico.png"
|
||||
icon = "true"
|
||||
submenudir = "up" />
|
||||
</a:bar>
|
||||
</a:application>
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
|
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 647 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 399 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
@ -8,12 +8,5 @@
|
||||
}
|
||||
|
||||
.console .console_close_btn {
|
||||
background-image: url("@{icon-path}/@{button-console-close}");
|
||||
}
|
||||
|
||||
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx) {
|
||||
.console .console_close_btn {
|
||||
background-image: url("@{icon-path}/@{button-console-close-retina}");
|
||||
background-size: 22px 66px;
|
||||
}
|
||||
.image-2x("@{icon-path}/@{button-console-close}", 22px, 66px);
|
||||
}
|
||||
@ -18,10 +18,10 @@
|
||||
}
|
||||
|
||||
.btnquicksearchnav.btnquicksearchnavLeft .lbl span {
|
||||
background-image: url("@{icon-path}/@{find-next-image}");
|
||||
.image-2x("@{icon-path}/@{find-next-image}", 20px, 100px);
|
||||
}
|
||||
.btnquicksearchnav.btnquicksearchnavRight .lbl span {
|
||||
background-image: url("@{icon-path}/@{find-previous-image}");
|
||||
.image-2x("@{icon-path}/@{find-previous-image}", 20px, 100px);
|
||||
}
|
||||
|
||||
.findInRangeMarker {
|
||||
|
||||
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 426 B |
|
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
|
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 597 B After Width: | Height: | Size: 597 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 196 B |
|
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 951 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 199 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 197 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 843 B After Width: | Height: | Size: 843 B |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 371 B |
|
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 709 B |
|
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 887 B After Width: | Height: | Size: 887 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 654 B |
|
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 615 B After Width: | Height: | Size: 615 B |
|
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |