[Pkg-javascript-commits] [less.js] 105/285: Merge remote-tracking branch 'origin/master' into 2_0_0

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


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

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

commit f2bc59f63bfad361bbcae611ecda0f17f1897dfa
Merge: d9c42e2 2942b9d
Author: Luke Page <luke.a.page at gmail.com>
Date:   Fri Sep 5 23:31:42 2014 +0100

    Merge remote-tracking branch 'origin/master' into 2_0_0
    
    Conflicts:
    	CHANGELOG.md
    	lib/less/index.js
    	lib/less/parser/parser.js
    	lib/less/tree/dimension.js

 CHANGELOG.md              |   13 +
 bower.json                |    4 +-
 dist/less-1.7.5.js        | 8008 ++++++++++++++++++++++++++++++++++++++
 dist/less-1.7.5.min.js    |   16 +
 dist/less-rhino-1.7.5.js  | 9383 +++++++++++++++++++++++++++++++++++++++++++++
 dist/lessc-rhino-1.7.5.js |  449 +++
 lib/less/parser/parser.js |    2 +-
 lib/less/tree/unit.js     |    2 +-
 package.json              |    4 +-
 test/css/functions.css    |    2 +
 test/less/functions.less  |    2 +
 11 files changed, 17879 insertions(+), 6 deletions(-)

diff --cc CHANGELOG.md
index a77138c,d574b6b..04a708c
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -1,15 -1,16 +1,28 @@@
 +#2.0.0
 +
 +2014-??-??
 +
 + - no longer including old versions of less in the repo or npm
 + - not including test and gradle files in npm (Note: TODO may need to move some test framework into lib for core plugins)
 + - colours now output in the format they are added unless compressing, so yellow will output yellow, not its hex counterpart
 + - better parsing - better comment support (TODO) and comments in brackets can now contain comments including quotes.
 +TODO
 + - Environment Support
 + - Finalised Plugin Support 
 +
+ # 1.7.5
+ 
+ 2014-09-03
+ 
+  - Allow comments in keyframe (complete comment support coming in 2.0)
+  - pass options to parser from less.render
+  - Support /deep/ combinator
+  - handle fragments in data-uri's
+  - float @charsets to the top correctly
+  - updates to some dependencies
+  - Fix interpolated import in media query
+  - A few other various small corrections
 -
++ 
  # 1.7.4
  
  2014-07-27
diff --cc lib/less/parser/parser.js
index 9e62b9f,9d9f437..5f513e1
--- a/lib/less/parser/parser.js
+++ b/lib/less/parser/parser.js
@@@ -455,7 -981,7 +455,7 @@@ var Parser = function Parser(env, impor
                          return;
                      }
  
-                     var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/);
 -                    value = $re(/^([+-]?\d*\.?\d+)(%|[a-zA-Z]+)?/);
++                    var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/i);
                      if (value) {
                          return new(tree.Dimension)(value[1], value[2]);
                      }
diff --cc lib/less/tree/unit.js
index 9589498,0000000..b0f7740
mode 100644,000000..100644
--- a/lib/less/tree/unit.js
+++ b/lib/less/tree/unit.js
@@@ -1,126 -1,0 +1,126 @@@
 +var Node = require("./node.js"),
 +    unitConversions = require("../data/unit-conversions.js");
 +
 +var Unit = function (numerator, denominator, backupUnit) {
 +    this.numerator = numerator ? numerator.slice(0).sort() : [];
 +    this.denominator = denominator ? denominator.slice(0).sort() : [];
 +    this.backupUnit = backupUnit;
 +};
 +
 +Unit.prototype = new Node();
 +Unit.prototype.type = "Unit";
 +Unit.prototype.clone = function () {
 +    return new Unit(this.numerator.slice(0), this.denominator.slice(0), this.backupUnit);
 +};
 +Unit.prototype.genCSS = function (env, output) {
 +    if (this.numerator.length >= 1) {
 +        output.add(this.numerator[0]);
 +    } else
 +    if (this.denominator.length >= 1) {
 +        output.add(this.denominator[0]);
 +    } else
 +    if ((!env || !env.strictUnits) && this.backupUnit) {
 +        output.add(this.backupUnit);
 +    }
 +};
 +Unit.prototype.toString = function () {
 +    var i, returnStr = this.numerator.join("*");
 +    for (i = 0; i < this.denominator.length; i++) {
 +        returnStr += "/" + this.denominator[i];
 +    }
 +    return returnStr;
 +};
 +Unit.prototype.compare = function (other) {
 +    return this.is(other.toString()) ? 0 : -1;
 +};
 +Unit.prototype.is = function (unitString) {
-     return this.toString() === unitString;
++    return this.toString().toUpperCase() === unitString.toUpperCase();
 +};
 +Unit.prototype.isLength = function () {
 +    return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/));
 +};
 +Unit.prototype.isEmpty = function () {
 +    return this.numerator.length === 0 && this.denominator.length === 0;
 +};
 +Unit.prototype.isSingular = function() {
 +    return this.numerator.length <= 1 && this.denominator.length === 0;
 +};
 +Unit.prototype.map = function(callback) {
 +    var i;
 +
 +    for (i = 0; i < this.numerator.length; i++) {
 +        this.numerator[i] = callback(this.numerator[i], false);
 +    }
 +
 +    for (i = 0; i < this.denominator.length; i++) {
 +        this.denominator[i] = callback(this.denominator[i], true);
 +    }
 +};
 +Unit.prototype.usedUnits = function() {
 +    var group, result = {}, mapUnit;
 +
 +    mapUnit = function (atomicUnit) {
 +        /*jshint loopfunc:true */
 +        if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {
 +            result[groupName] = atomicUnit;
 +        }
 +
 +        return atomicUnit;
 +    };
 +
 +    for (var groupName in unitConversions) {
 +        if (unitConversions.hasOwnProperty(groupName)) {
 +            group = unitConversions[groupName];
 +
 +            this.map(mapUnit);
 +        }
 +    }
 +
 +    return result;
 +};
 +Unit.prototype.cancel = function () {
 +    var counter = {}, atomicUnit, i, backup;
 +
 +    for (i = 0; i < this.numerator.length; i++) {
 +        atomicUnit = this.numerator[i];
 +        if (!backup) {
 +            backup = atomicUnit;
 +        }
 +        counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;
 +    }
 +
 +    for (i = 0; i < this.denominator.length; i++) {
 +        atomicUnit = this.denominator[i];
 +        if (!backup) {
 +            backup = atomicUnit;
 +        }
 +        counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;
 +    }
 +
 +    this.numerator = [];
 +    this.denominator = [];
 +
 +    for (atomicUnit in counter) {
 +        if (counter.hasOwnProperty(atomicUnit)) {
 +            var count = counter[atomicUnit];
 +
 +            if (count > 0) {
 +                for (i = 0; i < count; i++) {
 +                    this.numerator.push(atomicUnit);
 +                }
 +            } else if (count < 0) {
 +                for (i = 0; i < -count; i++) {
 +                    this.denominator.push(atomicUnit);
 +                }
 +            }
 +        }
 +    }
 +
 +    if (this.numerator.length === 0 && this.denominator.length === 0 && backup) {
 +        this.backupUnit = backup;
 +    }
 +
 +    this.numerator.sort();
 +    this.denominator.sort();
 +};
 +module.exports = Unit;
diff --cc package.json
index 01e4f67,7dcc3d3..b2c383f
--- a/package.json
+++ b/package.json
@@@ -31,10 -31,10 +31,10 @@@
      "test": "./test"
    },
    "jam": {
-     "main": "./dist/less-1.6.3.js"
+     "main": "./dist/less-1.7.5.js"
    },
    "engines": {
 -    "node": ">=0.8.0"
 +    "node": ">=0.10.0"
    },
    "scripts": {
      "test": "grunt test"

-- 
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