[Pkg-javascript-commits] [less.js] 48/58: support variables passed to data-uri

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:28:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.3.0
in repository less.js.

commit b09f30e079eeddb922bcb61b10ec655cbcabebaf
Author: Luke Page <luke.a.page at gmail.com>
Date:   Mon Jan 26 20:17:27 2015 +0000

    support variables passed to data-uri
---
 lib/less/functions/data-uri.js | 5 +++--
 test/css/urls.css              | 1 +
 test/less/urls.less            | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js
index 798b5a7..35d9c56 100644
--- a/lib/less/functions/data-uri.js
+++ b/lib/less/functions/data-uri.js
@@ -16,8 +16,9 @@ module.exports = function(environment) {
 
         var mimetype = mimetypeNode && mimetypeNode.value;
         var filePath = filePathNode.value;
-        var currentDirectory = filePathNode.currentFileInfo.relativeUrls ?
-            filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath;
+	    var currentFileInfo = this.currentFileInfo;
+        var currentDirectory = currentFileInfo.relativeUrls ?
+            currentFileInfo.currentDirectory : currentFileInfo.entryPath;
 
         var fragmentStart = filePath.indexOf('#');
         var fragment = '';
diff --git a/test/css/urls.css b/test/css/urls.css
index fda916e..6503b4d 100644
--- a/test/css/urls.css
+++ b/test/css/urls.css
@@ -57,6 +57,7 @@
 }
 #data-uri {
   uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
+  background-image: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
   uri-fragment: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==#fragment");
 }
 #data-uri-guess {
diff --git a/test/less/urls.less b/test/less/urls.less
index 8ed07a1..0479d36 100644
--- a/test/less/urls.less
+++ b/test/less/urls.less
@@ -45,6 +45,8 @@
 
 #data-uri {
   uri: data-uri('image/jpeg;base64', '../data/image.jpg');
+  @var: replace('../data/replace.jpg', "replace", "image");
+  background-image: data-uri(@var);
   uri-fragment: data-uri('image/jpeg;base64', '../data/image.jpg#fragment');
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list