diff --git a/docs/docco.css b/docs/docco.css index 76e818b38..03ba910d2 100644 --- a/docs/docco.css +++ b/docs/docco.css @@ -1,8 +1,8 @@ /*--------------------- Layout and Typography ----------------------------*/ body { font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; - font-size: 16px; - line-height: 24px; + font-size: 15px; + line-height: 22px; color: #252519; margin: 0; padding: 0; } @@ -72,8 +72,8 @@ table td { outline: 0; } td.docs, th.docs { - max-width: 500px; - min-width: 500px; + max-width: 450px; + min-width: 450px; min-height: 5px; padding: 10px 25px 1px 50px; vertical-align: top; diff --git a/docs/underscore.html b/docs/underscore.html index 3ca0ca8e0..2cca5f476 100644 --- a/docs/underscore.html +++ b/docs/underscore.html @@ -55,15 +55,15 @@ or foldl. Delegates to ECMAScript 5's native memo = iterator.call(context, memo, value, index, list); }); return memo; - };

The right-associative version of reduce, also known as foldr. Uses -Delegates to ECMAScript 5's native reduceRight if available.

  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
+  };

The right-associative version of reduce, also known as foldr. +Delegates to ECMAScript 5's native reduceRight if available.

  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
     if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
       if (context) iterator = _.bind(iterator, context);
       return obj.reduceRight(iterator, memo);
     }
     var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse();
     return _.reduce(reversed, iterator, memo, context);
-  };

Return the first value which passes a truth test.

  _.detect = function(obj, iterator, context) {
+  };

Return the first value which passes a truth test. Aliased as detect.

  _.find = _.detect = function(obj, iterator, context) {
     var result;
     each(obj, function(value, index, list) {
       if (iterator.call(context, value, index, list)) {
@@ -74,7 +74,7 @@ Delegates to ECMAScript 5's native reduceRight if available.

return result; };

Return all the elements that pass a truth test. Delegates to ECMAScript 5's native filter if available. -Aliased as select

  _.filter = _.select = function(obj, iterator, context) {
+Aliased as select.

  _.filter = _.select = function(obj, iterator, context) {
     if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
     var results = [];
     each(obj, function(value, index, list) {
@@ -207,7 +207,7 @@ an index go together.

var results = new Array(length); for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); return results; - };

If the browser doesn't supply us with indexOf (I'm looking at you, MSIE), + };

If the browser doesn't supply us with indexOf (I'm looking at you, MSIE), we need this function. Return the position of the first occurence of an item in an array, or -1 if the item is not included in the array. Delegates to ECMAScript 5's native indexOf if available.

  _.indexOf = function(array, item) {
diff --git a/test/objects.js b/test/objects.js
index fc9c93d42..4f7ee02e0 100644
--- a/test/objects.js
+++ b/test/objects.js
@@ -12,7 +12,7 @@ $(document).ready(function() {
 
   test("objects: functions", function() {
     var expected = ["all", "any", "bind", "bindAll", "breakLoop", "clone", "compact",
-    "compose", "contains", "defer", "delay", "detect", "each", "every", "extend", "filter", "first",
+    "compose", "contains", "defer", "delay", "detect", "each", "every", "extend", "filter", "find", "first",
     "flatten", "foldl", "foldr", "forEach", "functions", "head", "identity", "include",
     "indexOf", "inject", "intersect", "invoke", "isArguments", "isArray", "isBoolean", "isDate", "isElement", "isEmpty", "isEqual",
     "isFunction", "isNaN", "isNull", "isNumber", "isRegExp", "isString", "isUndefined", "keys", "last", "lastIndexOf", "map", "max",
diff --git a/test/utility.js b/test/utility.js
index 066f8ba67..db87a4d08 100644
--- a/test/utility.js
+++ b/test/utility.js
@@ -108,8 +108,8 @@ $(document).ready(function() {
     equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'.");
 
     _.templateSettings = {
-      evaluate    : /<%([\s\S]+?)%>/g,
-      interpolate : /<%=([\s\S]+?)%>/g
+      evaluate    : /<\?([\s\S]+?)\?>/g,
+      interpolate : /<\?=([\s\S]+?)\?>/g
     };
 
     var customWithSpecialChars = _.template("
"); diff --git a/underscore.js b/underscore.js index 72dbd1d16..9dce73ef0 100644 --- a/underscore.js +++ b/underscore.js @@ -103,8 +103,8 @@ return memo; }; - // The right-associative version of reduce, also known as `foldr`. Uses - // Delegates to **ECMAScript 5**'s native reduceRight if available. + // The right-associative version of reduce, also known as `foldr`. + // Delegates to **ECMAScript 5**'s native `reduceRight` if available. _.reduceRight = _.foldr = function(obj, iterator, memo, context) { if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { if (context) iterator = _.bind(iterator, context); @@ -114,8 +114,8 @@ return _.reduce(reversed, iterator, memo, context); }; - // Return the first value which passes a truth test. - _.detect = function(obj, iterator, context) { + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, iterator, context) { var result; each(obj, function(value, index, list) { if (iterator.call(context, value, index, list)) { @@ -128,7 +128,7 @@ // Return all the elements that pass a truth test. // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select` + // Aliased as `select`. _.filter = _.select = function(obj, iterator, context) { if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); var results = []; @@ -330,7 +330,7 @@ return results; }; - // If the browser doesn't supply us with indexOf (I'm looking at you, MSIE), + // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), // we need this function. Return the position of the first occurence of an // item in an array, or -1 if the item is not included in the array. // Delegates to **ECMAScript 5**'s native `indexOf` if available.