http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/js/libs/lodash.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/lodash.js b/src/fauxton/assets/js/libs/lodash.js
index ccf632d..514eeb0 100644
--- a/src/fauxton/assets/js/libs/lodash.js
+++ b/src/fauxton/assets/js/libs/lodash.js
@@ -1,6 +1,6 @@
/**
* @license
- * Lo-Dash 1.1.1 (Custom Build) <http://lodash.com/>
+ * Lo-Dash 1.3.1 (Custom Build) <http://lodash.com/>
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
@@ -12,24 +12,18 @@
/** Used as a safe reference for `undefined` in pre ES5 environments */
var undefined;
- /** Detect free variable `exports` */
- var freeExports = typeof exports == 'object' && exports;
-
- /** Detect free variable `module` */
- var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
-
- /** Detect free variable `global` and use it as `window` */
- var freeGlobal = typeof global == 'object' && global;
- if (freeGlobal.global === freeGlobal) {
- window = freeGlobal;
- }
-
/** Used to generate unique IDs */
var idCounter = 0;
/** Used internally to indicate various things */
var indicatorObject = {};
+ /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
+ var keyPrefix = +new Date + '';
+
+ /** Used as the size when optimizations are enabled for large arrays */
+ var largeArraySize = 75;
+
/** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
@@ -67,6 +61,7 @@
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
+ errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
@@ -94,18 +89,112 @@
'\u2029': 'u2029'
};
+ /** Detect free variable `exports` */
+ var freeExports = objectTypes[typeof exports] && exports;
+
+ /** Detect free variable `module` */
+ var freeModule = objectTypes[typeof module] && module && module.exports == freeExports && module;
+
+ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
+ var freeGlobal = objectTypes[typeof global] && global;
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ window = freeGlobal;
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * A basic implementation of `_.indexOf` without support for binary searches
+ * or `fromIndex` constraints.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Mixed} value The value to search for.
+ * @param {Number} [fromIndex=0] The index to search from.
+ * @returns {Number} Returns the index of the matched value or `-1`.
+ */
+ function basicIndexOf(array, value, fromIndex) {
+ var index = (fromIndex || 0) - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Used by `sortBy` to compare transformed `collection` values, stable sorting
+ * them in ascending order.
+ *
+ * @private
+ * @param {Object} a The object to compare to `b`.
+ * @param {Object} b The object to compare to `a`.
+ * @returns {Number} Returns the sort order indicator of `1` or `-1`.
+ */
+ function compareAscending(a, b) {
+ var ai = a.index,
+ bi = b.index;
+
+ a = a.criteria;
+ b = b.criteria;
+
+ // ensure a stable sort in V8 and other engines
+ // http://code.google.com/p/v8/issues/detail?id=90
+ if (a !== b) {
+ if (a > b || typeof a == 'undefined') {
+ return 1;
+ }
+ if (a < b || typeof b == 'undefined') {
+ return -1;
+ }
+ }
+ return ai < bi ? -1 : 1;
+ }
+
+ /**
+ * Used by `template` to escape characters for inclusion in compiled
+ * string literals.
+ *
+ * @private
+ * @param {String} match The matched character to escape.
+ * @returns {String} Returns the escaped character.
+ */
+ function escapeStringChar(match) {
+ return '\\' + stringEscapes[match];
+ }
+
+ /**
+ * A no-operation function.
+ *
+ * @private
+ */
+ function noop() {
+ // no operation performed
+ }
+
/*--------------------------------------------------------------------------*/
- /** Used for `Array` and `Object` method references */
- var arrayRef = Array(),
- objectRef = Object();
+ /**
+ * Used for `Array` method references.
+ *
+ * Normally `Array.prototype` would suffice, however, using an array literal
+ * avoids issues in Narwhal.
+ */
+ var arrayRef = [];
+
+ /** Used for native method references */
+ var objectProto = Object.prototype,
+ stringProto = String.prototype;
/** Used to restore the original `_` reference in `noConflict` */
var oldDash = window._;
/** Used to detect if a method is native */
var reNative = RegExp('^' +
- String(objectRef.valueOf)
+ String(objectProto.valueOf)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/valueOf|for [^\]]+/g, '.+?') + '$'
);
@@ -115,21 +204,23 @@
clearTimeout = window.clearTimeout,
concat = arrayRef.concat,
floor = Math.floor,
- hasOwnProperty = objectRef.hasOwnProperty,
+ hasOwnProperty = objectProto.hasOwnProperty,
push = arrayRef.push,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
setTimeout = window.setTimeout,
- slice = arrayRef.slice,
- toString = objectRef.toString;
+ toString = objectProto.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */
- var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
+ var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
+ nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = window.isFinite,
nativeIsNaN = window.isNaN,
nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
nativeMax = Math.max,
nativeMin = Math.min,
- nativeRandom = Math.random;
+ nativeRandom = Math.random,
+ nativeSlice = arrayRef.slice;
/** Detect various environments */
var isIeOpera = reNative.test(window.attachEvent),
@@ -138,7 +229,7 @@
/*--------------------------------------------------------------------------*/
/**
- * Creates a `lodash` object, that wraps the given `value`, to enable method
+ * Creates a `lodash` object, which wraps the given `value`, to enable method
* chaining.
*
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
@@ -156,8 +247,8 @@
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
- * `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`,
- * `where`, `without`, `wrap`, and `zip`
+ * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
+ * `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -173,9 +264,30 @@
*
* @name _
* @constructor
+ * @alias chain
* @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(sum, num) {
+ * return sum + num;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(num) {
+ * return num * num;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
*/
function lodash(value) {
return (value instanceof lodash)
@@ -184,6 +296,19 @@
}
/**
+ * A fast path for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {Mixed} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns a `lodash` instance.
+ */
+ function lodashWrapper(value) {
+ this.__wrapped__ = value;
+ }
+ // ensure `new lodashWrapper` is an instance of `lodash`
+ lodashWrapper.prototype = lodash.prototype;
+
+ /**
* An object used to flag environments features.
*
* @static
@@ -196,14 +321,6 @@
var object = { '0': 1, 'length': 1 };
/**
- * Detect if `arguments` objects are `Object` objects (all but Opera < 10.5).
- *
- * @memberOf _.support
- * @type Boolean
- */
- support.argsObject = arguments.constructor == Object;
-
- /**
* Detect if `Function#bind` exists and is inferred to be fast (all but V8).
*
* @memberOf _.support
@@ -273,47 +390,6 @@
/*--------------------------------------------------------------------------*/
/**
- * Used by `_.max` and `_.min` as the default `callback` when a given
- * `collection` is a string value.
- *
- * @private
- * @param {String} value The character to inspect.
- * @returns {Number} Returns the code unit of given character.
- */
- function charAtCallback(value) {
- return value.charCodeAt(0);
- }
-
- /**
- * Used by `sortBy` to compare transformed `collection` values, stable sorting
- * them in ascending order.
- *
- * @private
- * @param {Object} a The object to compare to `b`.
- * @param {Object} b The object to compare to `a`.
- * @returns {Number} Returns the sort order indicator of `1` or `-1`.
- */
- function compareAscending(a, b) {
- var ai = a.index,
- bi = b.index;
-
- a = a.criteria;
- b = b.criteria;
-
- // ensure a stable sort in V8 and other engines
- // http://code.google.com/p/v8/issues/detail?id=90
- if (a !== b) {
- if (a > b || typeof a == 'undefined') {
- return 1;
- }
- if (a < b || typeof b == 'undefined') {
- return -1;
- }
- }
- return ai < bi ? -1 : 1;
- }
-
- /**
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the
* bound function.
@@ -354,14 +430,12 @@
}
if (partialArgs.length) {
args = args.length
- ? (args = slice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
+ ? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
: partialArgs;
}
if (this instanceof bound) {
// ensure `new bound` is an instance of `func`
- noop.prototype = func.prototype;
- thisBinding = new noop;
- noop.prototype = null;
+ thisBinding = createObject(func.prototype);
// mimic the constructor's `return` behavior
// http://es5.github.com/#x13.2.2
@@ -374,15 +448,25 @@
}
/**
- * Used by `template` to escape characters for inclusion in compiled
- * string literals.
+ * Creates a new object with the specified `prototype`.
*
* @private
- * @param {String} match The matched character to escape.
- * @returns {String} Returns the escaped character.
+ * @param {Object} prototype The prototype object.
+ * @returns {Object} Returns the new object.
*/
- function escapeStringChar(match) {
- return '\\' + stringEscapes[match];
+ function createObject(prototype) {
+ return isObject(prototype) ? nativeCreate(prototype) : {};
+ }
+ // fallback for browsers without `Object.create`
+ if (!nativeCreate) {
+ var createObject = function(prototype) {
+ if (isObject(prototype)) {
+ noop.prototype = prototype;
+ var result = new noop;
+ noop.prototype = null;
+ }
+ return result || {};
+ };
}
/**
@@ -397,25 +481,16 @@
}
/**
- * A fast path for creating `lodash` wrapper objects.
- *
- * @private
- * @param {Mixed} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns a `lodash` instance.
- */
- function lodashWrapper(value) {
- this.__wrapped__ = value;
- }
- // ensure `new lodashWrapper` is an instance of `lodash`
- lodashWrapper.prototype = lodash.prototype;
-
- /**
- * A no-operation function.
+ * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
+ * customized, this method returns the custom method, otherwise it returns
+ * the `basicIndexOf` function.
*
* @private
+ * @returns {Function} Returns the "indexOf" function.
*/
- function noop() {
- // no operation performed
+ function getIndexOf(array, value, fromIndex) {
+ var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result;
+ return result;
}
/**
@@ -474,13 +549,11 @@
* // => true
*/
var isArray = nativeIsArray || function(value) {
- // `instanceof` may cause a memory leak in IE 7 if `value` is a host object
- // http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
- return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
+ return value ? (typeof value == 'object' && toString.call(value) == arrayClass) : false;
};
/**
- * A fallback implementation of `Object.keys` that produces an array of the
+ * A fallback implementation of `Object.keys` which produces an array of the
* given object's own enumerable property names.
*
* @private
@@ -491,11 +564,10 @@
var shimKeys = function (object) {
var index, iterable = object, result = [];
if (!iterable) return result;
- if (!(objectTypes[typeof object])) return result;
-
+ if (!(objectTypes[typeof object])) return result;
for (index in iterable) {
- if (hasOwnProperty.call(iterable, index)) {
- result.push(index);
+ if (hasOwnProperty.call(iterable, index)) {
+ result.push(index);
}
}
return result
@@ -631,7 +703,7 @@
*/
function clone(value) {
return isObject(value)
- ? (isArray(value) ? slice.call(value) : assign({}, value))
+ ? (isArray(value) ? nativeSlice.call(value) : assign({}, value))
: value;
}
@@ -705,7 +777,6 @@
var index, iterable = collection, result = iterable;
if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result;
-
for (index in iterable) {
if (callback(iterable[index], index, collection) === indicatorObject) return result;
}
@@ -737,10 +808,9 @@
var index, iterable = collection, result = iterable;
if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result;
-
for (index in iterable) {
- if (hasOwnProperty.call(iterable, index)) {
- if (callback(iterable[index], index, collection) === indicatorObject) return result;
+ if (hasOwnProperty.call(iterable, index)) {
+ if (callback(iterable[index], index, collection) === indicatorObject) return result;
}
}
return result
@@ -847,7 +917,7 @@
* // => true
*/
function isDate(value) {
- return value instanceof Date || toString.call(value) == dateClass;
+ return value ? (typeof value == 'object' && toString.call(value) == dateClass) : false;
}
/**
@@ -1092,7 +1162,7 @@
// fallback for older versions of Chrome and Safari
if (isFunction(/x/)) {
isFunction = function(value) {
- return value instanceof Function || toString.call(value) == funcClass;
+ return typeof value == 'function' && toString.call(value) == funcClass;
};
}
@@ -1121,7 +1191,7 @@
// http://es5.github.com/#x8
// and avoid a V8 bug
// http://code.google.com/p/v8/issues/detail?id=2291
- return value ? objectTypes[typeof value] : false;
+ return !!(value && objectTypes[typeof value]);
}
/**
@@ -1206,7 +1276,7 @@
* // => true
*/
function isRegExp(value) {
- return value instanceof RegExp || toString.call(value) == regexpClass;
+ return !!(value && objectTypes[typeof value]) && toString.call(value) == regexpClass;
}
/**
@@ -1270,11 +1340,12 @@
* // => { 'name': 'moe' }
*/
function omit(object) {
- var props = concat.apply(arrayRef, arguments),
+ var indexOf = getIndexOf(),
+ props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = {};
forIn(object, function(value, key) {
- if (indexOf(props, key, 1) < 0) {
+ if (indexOf(props, key) < 0) {
result[key] = value;
}
});
@@ -1334,8 +1405,8 @@
* // => { 'name': 'moe' }
*/
function pick(object) {
- var index = 0,
- props = concat.apply(arrayRef, arguments),
+ var index = -1,
+ props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
length = props.length,
result = {};
@@ -1403,9 +1474,10 @@
* // => true
*/
function contains(collection, target) {
- var length = collection ? collection.length : 0,
+ var indexOf = getIndexOf(),
+ length = collection ? collection.length : 0,
result = false;
- if (typeof length == 'number') {
+ if (length && typeof length == 'number') {
result = indexOf(collection, target) > -1;
} else {
forOwn(collection, function(value) {
@@ -1599,7 +1671,7 @@
*
* @static
* @memberOf _
- * @alias detect
+ * @alias detect, findWhere
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per
@@ -1609,7 +1681,9 @@
* @returns {Mixed} Returns the found element, else `undefined`.
* @example
*
- * _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; });
+ * _.find([1, 2, 3, 4], function(num) {
+ * return num % 2 == 0;
+ * });
* // => 2
*
* var food = [
@@ -1651,6 +1725,29 @@
}
}
+ /**
+ * Examines each element in a `collection`, returning the first that
+ * has the given `properties`. When checking `properties`, this method
+ * performs a deep comparison between values to determine if they are
+ * equivalent to each other.
+ *
+ * @static
+ * @memberOf _
+ * @category Collections
+ * @param {Array|Object|String} collection The collection to iterate over.
+ * @param {Object} properties The object of property values to filter by.
+ * @returns {Mixed} Returns the found element, else `undefined`.
+ * @example
+ *
+ * var food = [
+ * { 'name': 'apple', 'organic': false, 'type': 'fruit' },
+ * { 'name': 'banana', 'organic': true, 'type': 'fruit' },
+ * { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
+ * ];
+ *
+ * _.findWhere(food, { 'type': 'vegetable' });
+ * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
+ */
function findWhere(object, properties) {
return where(object, properties, true);
}
@@ -1761,7 +1858,7 @@
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
function invoke(collection, methodName) {
- var args = slice.call(arguments, 2),
+ var args = nativeSlice.call(arguments, 2),
index = -1,
isFunc = typeof methodName == 'function',
length = collection ? collection.length : 0,
@@ -1999,7 +2096,7 @@
}
/**
- * Reduces a `collection` to a value that is the accumulated result of running
+ * Reduces a `collection` to a value which is the accumulated result of running
* each element in the `collection` through the `callback`, where each successive
* `callback` execution consumes the return value of the previous execution.
* If `accumulator` is not passed, the first element of the `collection` will be
@@ -2324,7 +2421,7 @@
*/
function toArray(collection) {
if (isArray(collection)) {
- return slice.call(collection);
+ return nativeSlice.call(collection);
}
if (collection && typeof collection.length == 'number') {
return map(collection);
@@ -2409,13 +2506,14 @@
*/
function difference(array) {
var index = -1,
+ indexOf = getIndexOf(),
length = array.length,
- flattened = concat.apply(arrayRef, arguments),
+ flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = [];
while (++index < length) {
var value = array[index];
- if (indexOf(flattened, value, length) < 0) {
+ if (indexOf(flattened, value) < 0) {
result.push(value);
}
}
@@ -2496,14 +2594,14 @@
return array[0];
}
}
- return slice.call(array, 0, nativeMin(nativeMax(0, n), length));
+ return nativeSlice.call(array, 0, nativeMin(nativeMax(0, n), length));
}
}
/**
* Flattens a nested array (the nesting can be to any depth). If `isShallow`
* is truthy, `array` will only be flattened a single level. If `callback`
- * is passed, each element of `array` is passed through a callback` before
+ * is passed, each element of `array` is passed through a `callback` before
* flattening. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
*
@@ -2517,7 +2615,7 @@
* @static
* @memberOf _
* @category Arrays
- * @param {Array} array The array to compact.
+ * @param {Array} array The array to flatten.
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create
@@ -2582,21 +2680,14 @@
* // => 2
*/
function indexOf(array, value, fromIndex) {
- var index = -1,
- length = array ? array.length : 0;
-
if (typeof fromIndex == 'number') {
- index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1;
+ var length = array ? array.length : 0;
+ fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);
} else if (fromIndex) {
- index = sortedIndex(array, value);
+ var index = sortedIndex(array, value);
return array[index] === value ? index : -1;
}
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
+ return array ? basicIndexOf(array, value, fromIndex) : -1;
}
/**
@@ -2671,7 +2762,7 @@
} else {
n = (callback == null || thisArg) ? 1 : callback || n;
}
- return slice.call(array, 0, nativeMin(nativeMax(0, length - n), length));
+ return nativeSlice.call(array, 0, nativeMin(nativeMax(0, length - n), length));
}
/**
@@ -2693,6 +2784,7 @@
var args = arguments,
argsLength = args.length,
index = -1,
+ indexOf = getIndexOf(),
length = array ? array.length : 0,
result = [];
@@ -2786,7 +2878,7 @@
return array[length - 1];
}
}
- return slice.call(array, nativeMax(0, length - n));
+ return nativeSlice.call(array, nativeMax(0, length - n));
}
}
@@ -2943,7 +3035,7 @@
} else {
n = (callback == null || thisArg) ? 1 : nativeMax(0, callback);
}
- return slice.call(array, n);
+ return nativeSlice.call(array, n);
}
/**
@@ -2963,7 +3055,7 @@
* @static
* @memberOf _
* @category Arrays
- * @param {Array} array The array to iterate over.
+ * @param {Array} array The array to inspect.
* @param {Mixed} value The value to evaluate.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create
@@ -3026,7 +3118,10 @@
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
* // => [1, 2, 3, 101, 10]
*/
- function union() {
+ function union(array) {
+ if (!isArray(array)) {
+ arguments[0] = array ? nativeSlice.call(array) : arrayRef;
+ }
return uniq(concat.apply(arrayRef, arguments));
}
@@ -3034,7 +3129,7 @@
* Creates a duplicate-value-free version of the `array` using strict equality
* for comparisons, i.e. `===`. If the `array` is already sorted, passing `true`
* for `isSorted` will run a faster algorithm. If `callback` is passed, each
- * element of `array` is passed through a callback` before uniqueness is computed.
+ * element of `array` is passed through the `callback` before uniqueness is computed.
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
@@ -3063,11 +3158,11 @@
* _.uniq([1, 1, 2, 2, 3], true);
* // => [1, 2, 3]
*
- * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); });
- * // => [1, 2, 3]
+ * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); });
+ * // => ['A', 'b', 'C']
*
- * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
- * // => [1, 2, 3]
+ * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math);
+ * // => [1, 2.5, 3]
*
* // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
@@ -3075,6 +3170,7 @@
*/
function uniq(array, isSorted, callback, thisArg) {
var index = -1,
+ indexOf = getIndexOf(),
length = array ? array.length : 0,
result = [],
seen = result;
@@ -3106,6 +3202,31 @@
}
/**
+ * The inverse of `_.zip`, this method splits groups of elements into arrays
+ * composed of elements from each group at their corresponding indexes.
+ *
+ * @static
+ * @memberOf _
+ * @category Arrays
+ * @param {Array} array The array to process.
+ * @returns {Array} Returns a new array of the composed arrays.
+ * @example
+ *
+ * _.unzip([['moe', 30, true], ['larry', 40, false]]);
+ * // => [['moe', 'larry'], [30, 40], [true, false]];
+ */
+ function unzip(array) {
+ var index = -1,
+ length = array ? max(pluck(array, 'length')) : 0,
+ result = Array(length < 0 ? 0 : length);
+
+ while (++index < length) {
+ result[index] = pluck(array, index);
+ }
+ return result;
+ }
+
+ /**
* Creates an array with all occurrences of the passed values removed using
* strict equality for comparisons, i.e. `===`.
*
@@ -3121,17 +3242,7 @@
* // => [2, 3, 4]
*/
function without(array) {
- var index = -1,
- length = array.length,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (indexOf(arguments, value, 1) < 0) {
- result.push(value);
- }
- }
- return result
+ return difference(array, nativeSlice.call(arguments, 1));
}
/**
@@ -3153,7 +3264,7 @@
function zip(array) {
var index = -1,
length = array ? max(pluck(arguments, 'length')) : 0,
- result = Array(length);
+ result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = pluck(arguments, index);
@@ -3257,7 +3368,7 @@
// (in V8 `Function#bind` is slower except when partially applied)
return support.fastBind || (nativeBind && arguments.length > 2)
? nativeBind.call.apply(nativeBind, arguments)
- : createBound(func, thisArg, slice.call(arguments, 2));
+ : createBound(func, thisArg, nativeSlice.call(arguments, 2));
}
/**
@@ -3284,8 +3395,8 @@
* // => alerts 'clicked docs', when the button is clicked
*/
function bindAll(object) {
- var funcs = concat.apply(arrayRef, arguments),
- index = funcs.length > 1 ? 0 : (funcs = functions(object), -1),
+ var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
+ index = -1,
length = funcs.length;
while (++index < length) {
@@ -3396,54 +3507,65 @@
return result;
};
}
- if (typeof thisArg != 'undefined') {
- if (argCount === 1) {
- return function(value) {
- return func.call(thisArg, value);
- };
- }
- if (argCount === 2) {
- return function(a, b) {
- return func.call(thisArg, a, b);
- };
- }
- if (argCount === 4) {
- return function(accumulator, value, index, collection) {
- return func.call(thisArg, accumulator, value, index, collection);
- };
- }
- return function(value, index, collection) {
- return func.call(thisArg, value, index, collection);
+ if (typeof thisArg == 'undefined') {
+ return func;
+ }
+ if (argCount === 1) {
+ return function(value) {
+ return func.call(thisArg, value);
};
}
- return func;
+ if (argCount === 2) {
+ return function(a, b) {
+ return func.call(thisArg, a, b);
+ };
+ }
+ if (argCount === 4) {
+ return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ }
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
}
/**
* Creates a function that will delay the execution of `func` until after
* `wait` milliseconds have elapsed since the last time it was invoked. Pass
- * `true` for `immediate` to cause debounce to invoke `func` on the leading,
- * instead of the trailing, edge of the `wait` timeout. Subsequent calls to
- * the debounced function will return the result of the last `func` call.
+ * an `options` object to indicate that `func` should be invoked on the leading
+ * and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
+ * function will return the result of the last `func` call.
+ *
+ * Note: If `leading` and `trailing` options are `true`, `func` will be called
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to debounce.
* @param {Number} wait The number of milliseconds to delay.
- * @param {Boolean} immediate A flag to indicate execution is on the leading
- * edge of the timeout.
+ * @param {Object} options The options object.
+ * [leading=false] A boolean to specify execution on the leading edge of the timeout.
+ * [maxWait] The maximum time `func` is allowed to be delayed before it's called.
+ * [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* var lazyLayout = _.debounce(calculateLayout, 300);
* jQuery(window).on('resize', lazyLayout);
+ *
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 200, {
+ * 'leading': true,
+ * 'trailing': false
+ * });
*/
function debounce(func, wait, immediate) {
var args,
result,
thisArg,
- timeoutId;
+ timeoutId = null;
function delayed() {
timeoutId = null;
@@ -3482,7 +3604,7 @@
* // returns from the function before `alert` is called
*/
function defer(func) {
- var args = slice.call(arguments, 1);
+ var args = nativeSlice.call(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1);
}
@@ -3504,7 +3626,7 @@
* // => 'logged later' (Appears after one second.)
*/
function delay(func, wait) {
- var args = slice.call(arguments, 2);
+ var args = nativeSlice.call(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait);
}
@@ -3513,7 +3635,8 @@
* passed, it will be used to determine the cache key for storing the result
* based on the arguments passed to the memoized function. By default, the first
* argument passed to the memoized function is used as the cache key. The `func`
- * is executed with the `this` binding of the memoized function.
+ * is executed with the `this` binding of the memoized function. The result
+ * cache is exposed as the `cache` property on the memoized function.
*
* @static
* @memberOf _
@@ -3530,7 +3653,7 @@
function memoize(func, resolver) {
var cache = {};
return function() {
- var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
+ var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
@@ -3590,33 +3713,44 @@
* // => 'hi moe'
*/
function partial(func) {
- return createBound(func, slice.call(arguments, 1));
+ return createBound(func, nativeSlice.call(arguments, 1));
}
/**
- * Creates a function that, when executed, will only call the `func`
- * function at most once per every `wait` milliseconds. If the throttled
- * function is invoked more than once during the `wait` timeout, `func` will
- * also be called on the trailing edge of the timeout. Subsequent calls to the
- * throttled function will return the result of the last `func` call.
+ * Creates a function that, when executed, will only call the `func` function
+ * at most once per every `wait` milliseconds. Pass an `options` object to
+ * indicate that `func` should be invoked on the leading and/or trailing edge
+ * of the `wait` timeout. Subsequent calls to the throttled function will
+ * return the result of the last `func` call.
+ *
+ * Note: If `leading` and `trailing` options are `true`, `func` will be called
+ * on the trailing edge of the timeout only if the the throttled function is
+ * invoked more than once during the `wait` timeout.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to throttle.
* @param {Number} wait The number of milliseconds to throttle executions to.
+ * @param {Object} options The options object.
+ * [leading=true] A boolean to specify execution on the leading edge of the timeout.
+ * [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* var throttled = _.throttle(updatePosition, 100);
* jQuery(window).on('scroll', throttled);
+ *
+ * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
+ * 'trailing': false
+ * }));
*/
function throttle(func, wait) {
var args,
result,
thisArg,
- timeoutId,
- lastCalled = 0;
+ lastCalled = 0,
+ timeoutId = null;
function trailingCall() {
lastCalled = new Date;
@@ -3693,7 +3827,7 @@
}
/**
- * This function returns the first argument passed to it.
+ * This method returns the first argument passed to it.
*
* @static
* @memberOf _
@@ -3793,8 +3927,13 @@
if (max == null) {
max = min;
min = 0;
+ } else {
+ max = +max || 0;
}
- return min + floor(nativeRandom() * ((+max || 0) - min + 1));
+ var rand = nativeRandom();
+ return (min % 1 || max % 1)
+ ? min + nativeMin(rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1))), max)
+ : min + floor(rand * (max - min + 1));
}
/**
@@ -3836,9 +3975,6 @@
* Note: In the development build, `_.template` utilizes sourceURLs for easier
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
*
- * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp`
- * build and using precompiled templates, or loading Lo-Dash in a sandbox.
- *
* For more information on precompiling templates see:
* http://lodash.com/#custom-builds
*
@@ -3849,7 +3985,7 @@
* @memberOf _
* @category Utilities
* @param {String} text The template text.
- * @param {Obect} data The data object used to populate the text.
+ * @param {Object} data The data object used to populate the text.
* @param {Object} options The options object.
* escape - The "escape" delimiter regexp.
* evaluate - The "evaluate" delimiter regexp.
@@ -3912,8 +4048,9 @@
* ');
*/
function template(text, data, options) {
+ var settings = lodash.templateSettings;
text || (text = '');
- options = defaults({}, options, lodash.templateSettings);
+ options = defaults({}, options, settings);
var index = 0,
source = "__p += '",
@@ -3998,7 +4135,7 @@
}
/**
- * The opposite of `_.escape`, this method converts the HTML entities
+ * The inverse of `_.escape`, this method converts the HTML entities
* `&`, `<`, `>`, `"`, and `'` in `string` to their
* corresponding characters.
*
@@ -4208,6 +4345,9 @@
lodash.tail = rest;
lodash.unique = uniq;
+ // add Underscore compat
+ lodash.chain = chain;
+
/*--------------------------------------------------------------------------*/
// add functions that return unwrapped values when chaining
@@ -4216,7 +4356,6 @@
lodash.escape = escape;
lodash.every = every;
lodash.find = find;
- lodash.findWhere = findWhere;
lodash.has = has;
lodash.identity = identity;
lodash.indexOf = indexOf;
@@ -4254,6 +4393,7 @@
lodash.all = every;
lodash.any = some;
lodash.detect = find;
+ lodash.findWhere = findWhere;
lodash.foldl = reduce;
lodash.foldr = reduceRight;
lodash.include = contains;
@@ -4271,8 +4411,6 @@
/*--------------------------------------------------------------------------*/
- lodash.chain = chain;
-
/**
* The semantic version number.
*
@@ -4280,7 +4418,7 @@
* @memberOf _
* @type String
*/
- lodash.VERSION = '1.1.1';
+ lodash.VERSION = '1.3.1';
// add functions to `lodash.prototype`
mixin(lodash);
@@ -4289,36 +4427,36 @@
lodash.prototype.chain = wrapperChain;
lodash.prototype.value = wrapperValueOf;
- // add `Array` mutator functions to the wrapper
- forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
- var func = arrayRef[methodName];
- lodash.prototype[methodName] = function() {
- var value = this.__wrapped__;
- func.apply(value, arguments);
-
- // avoid array-like object bugs with `Array#shift` and `Array#splice`
- // in Firefox < 10 and IE < 9
- if (!support.spliceObjects && value.length === 0) {
- delete value[0];
- }
- return this;
- };
- });
-
- // add `Array` accessor functions to the wrapper
- forEach(['concat', 'join', 'slice'], function(methodName) {
- var func = arrayRef[methodName];
- lodash.prototype[methodName] = function() {
- var value = this.__wrapped__,
- result = func.apply(value, arguments);
-
- if (this.__chain__) {
- result = new lodashWrapper(result);
- result.__chain__ = true;
- }
- return result;
- };
- });
+ // add `Array` mutator functions to the wrapper
+ forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
+ var func = arrayRef[methodName];
+ lodash.prototype[methodName] = function() {
+ var value = this.__wrapped__;
+ func.apply(value, arguments);
+
+ // avoid array-like object bugs with `Array#shift` and `Array#splice`
+ // in Firefox < 10 and IE < 9
+ if (!support.spliceObjects && value.length === 0) {
+ delete value[0];
+ }
+ return this;
+ };
+ });
+
+ // add `Array` accessor functions to the wrapper
+ forEach(['concat', 'join', 'slice'], function(methodName) {
+ var func = arrayRef[methodName];
+ lodash.prototype[methodName] = function() {
+ var value = this.__wrapped__,
+ result = func.apply(value, arguments);
+
+ if (this.__chain__) {
+ result = new lodashWrapper(result);
+ result.__chain__ = true;
+ }
+ return result;
+ };
+ });
/*--------------------------------------------------------------------------*/
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/js/libs/nv.d3.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/libs/nv.d3.js b/src/fauxton/assets/js/libs/nv.d3.js
index 62ca71e..936b406 100755
--- a/src/fauxton/assets/js/libs/nv.d3.js
+++ b/src/fauxton/assets/js/libs/nv.d3.js
@@ -1732,7 +1732,7 @@ nv.models.cumulativeLineChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -3384,7 +3384,7 @@ nv.models.historicalBarChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -3971,10 +3971,46 @@ nv.models.indentedTree = function() {
, color = nv.utils.defaultColor()
, align = true
, dispatch = d3.dispatch('legendClick', 'legendDblclick', 'legendMouseover', 'legendMouseout')
+ , svgComputedTextPadding = 28
+ , roundedRecRadius = 0
+ , legendBelowPadding = 20
;
//============================================================
+/*
+Rounded Rec Path:
+
+x: x-coordinate
+y: y-coordinate
+w: width
+h: height
+r: corner radius
+tl: top_left rounded?
+tr: top_right rounded?
+bl: bottom_left rounded?
+br: bottom_right rounded?
+*/
+
+function rounded_rect(x, y, w, h, r, tl, tr, bl, br) {
+ var retval;
+ retval = "M" + (x + r) + "," + y;
+ retval += "h" + (w - 2*r);
+ if (tr) { retval += "a" + r + "," + r + " 0 0 1 " + r + "," + r; }
+ else { retval += "h" + r; retval += "v" + r; }
+ retval += "v" + (h - 2*r);
+ if (br) { retval += "a" + r + "," + r + " 0 0 1 " + -r + "," + r; }
+ else { retval += "v" + r; retval += "h" + -r; }
+ retval += "h" + (2*r - w);
+ if (bl) { retval += "a" + r + "," + r + " 0 0 1 " + -r + "," + -r; }
+ else { retval += "h" + -r; retval += "v" + -r; }
+ retval += "v" + (2*r - h);
+ if (tl) { retval += "a" + r + "," + r + " 0 0 1 " + r + "," + -r; }
+ else { retval += "v" + -r; retval += "h" + r; }
+ retval += "z";
+ return retval;
+}
+
function chart(selection) {
selection.each(function(data) {
@@ -4009,13 +4045,15 @@ nv.models.indentedTree = function() {
.on('dblclick', function(d,i) {
dispatch.legendDblclick(d,i);
});
+
+ seriesEnter.append('path');
seriesEnter.append('circle')
.style('stroke-width', 2)
.attr('r', 5);
seriesEnter.append('text')
.attr('text-anchor', 'start')
- .attr('dy', '.32em')
- .attr('dx', '8');
+ .attr('dy', '.33em')
+ .attr('dx', '12');
series.classed('disabled', function(d) { return d.disabled });
series.exit().remove();
series.select('circle')
@@ -4030,11 +4068,13 @@ nv.models.indentedTree = function() {
if (align) {
var seriesWidths = [];
+
series.each(function(d,i) {
var legendText = d3.select(this).select('text');
var svgComputedTextLength = legendText.node().getComputedTextLength()
|| nv.utils.calcApproxTextWidth(legendText);
- seriesWidths.push(svgComputedTextLength + 28); // 28 is ~ the width of the circle plus some padding
+ seriesWidths.push(svgComputedTextLength + svgComputedTextPadding); //40 is for adding additional padding, TODO make value a property
+
});
//nv.log('Series Widths: ', JSON.stringify(seriesWidths));
@@ -4071,9 +4111,22 @@ nv.models.indentedTree = function() {
}
series
- .attr('transform', function(d, i) {
- return 'translate(' + xPositions[i % seriesPerRow] + ',' + (5 + Math.floor(i / seriesPerRow) * 20) + ')';
- });
+ .attr('transform', function(d, i) {
+ return 'translate(' + xPositions[i % seriesPerRow] + ',' + (5 + Math.floor(i / seriesPerRow) * 20) + ')';
+ }).select("path")
+ .attr("d", function(d, i) {
+
+ var addLeftCap = false;
+ var addRightCap = false;
+
+ if(i == 0){
+ addLeftCap = true;
+ }else if (i == seriesWidths.length-1){
+ addRightCap = true;
+ }
+
+ return rounded_rect(-14, -14, seriesWidths[i] , 28, roundedRecRadius, addLeftCap, addRightCap, addLeftCap, addRightCap);
+ });
//position legend as far right as possible within the total width
g.attr('transform', 'translate(' + (width - margin.right - legendWidth) + ',' + margin.top + ')');
@@ -4121,6 +4174,24 @@ nv.models.indentedTree = function() {
chart.dispatch = dispatch;
+ chart.svgComputedTextPadding = function(_) {
+ if (!arguments.length) return svgComputedTextPadding;
+ svgComputedTextPadding = _;
+ return chart;
+ };
+
+ chart.roundedRecRadius = function(_) {
+ if (!arguments.length) return roundedRecRadius;
+ roundedRecRadius = _;
+ return chart;
+ };
+
+ chart.legendBelowPadding = function(_) {
+ if (!arguments.length) return legendBelowPadding;
+ legendBelowPadding = _;
+ return chart;
+ };
+
chart.margin = function(_) {
if (!arguments.length) return margin;
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
@@ -4612,7 +4683,7 @@ nv.models.lineChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -5044,7 +5115,7 @@ nv.models.linePlusBarChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -5488,7 +5559,7 @@ nv.models.lineWithFocusChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight1 = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom - height2;
}
@@ -6104,7 +6175,7 @@ nv.models.linePlusBarWithFocusChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight1 = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom - height2;
}
@@ -7155,7 +7226,7 @@ nv.models.multiBarChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -8080,7 +8151,7 @@ nv.models.multiBarHorizontalChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -8483,7 +8554,7 @@ nv.models.multiChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -9337,9 +9408,9 @@ nv.models.pie = function() {
d.innerRadius = arcRadius + 15; // Set Inner Coordinate
var rotateAngle = (d.startAngle + d.endAngle) / 2 * (180 / Math.PI);
if ((d.startAngle+d.endAngle)/2 < Math.PI) {
- rotateAngle -= 90;
+ rotateAngle -= 90;
} else {
- rotateAngle += 90;
+ rotateAngle += 90;
}
return 'translate(' + labelsArc.centroid(d) + ') rotate(' + rotateAngle + ')';
} else {
@@ -9364,7 +9435,7 @@ nv.models.pie = function() {
slices.select(".nv-label").transition()
.attr('transform', function(d) {
- if (labelSunbeamLayout) {
+ if (labelSunbeamLayout) {
d.outerRadius = arcRadius + 10; // Set Outer Coordinate
d.innerRadius = arcRadius + 15; // Set Inner Coordinate
var rotateAngle = (d.startAngle + d.endAngle) / 2 * (180 / Math.PI);
@@ -9684,7 +9755,7 @@ nv.models.pieChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -10711,7 +10782,7 @@ nv.models.scatterChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -11330,7 +11401,7 @@ nv.models.scatterPlusLineChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -11820,7 +11891,7 @@ nv.models.sparkline = function() {
var yValues = data.map(function(d, i) { return getY(d,i); });
function pointIndex(index) {
if (index != -1) {
- var result = data[index];
+ var result = data[index];
result.pointIndex = index;
return result;
} else {
@@ -12544,9 +12615,9 @@ nv.models.stackedArea = function() {
};
chart.interpolate = function(_) {
- if (!arguments.length) return interpolate;
- interpolate = _;
- return interpolate;
+ if (!arguments.length) return interpolate;
+ interpolate = _;
+ return interpolate;
};
@@ -12712,7 +12783,7 @@ nv.models.stackedAreaChart = function() {
.call(legend);
if ( margin.top != legend.height()) {
- margin.top = legend.height();
+ margin.top = legend.height() + legend.legendBelowPadding();// added legend.legendBelowPadding to allow for more spacing
availableHeight = (height || parseInt(container.style('height')) || 400)
- margin.top - margin.bottom;
}
@@ -13045,4 +13116,4 @@ nv.models.stackedAreaChart = function() {
return chart;
}
-})();
\ No newline at end of file
+})();
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/js/plugins/backbone.layoutmanager.js
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/js/plugins/backbone.layoutmanager.js b/src/fauxton/assets/js/plugins/backbone.layoutmanager.js
index e578c94..aff39b3 100644
--- a/src/fauxton/assets/js/plugins/backbone.layoutmanager.js
+++ b/src/fauxton/assets/js/plugins/backbone.layoutmanager.js
@@ -1,5 +1,5 @@
/*!
- * backbone.layoutmanager.js v0.8.7
+ * backbone.layoutmanager.js v0.8.8
* Copyright 2013, Tim Branyen (@tbranyen)
* backbone.layoutmanager.js may be freely distributed under the MIT license.
*/
@@ -91,25 +91,29 @@ var LayoutManager = Backbone.View.extend({
// If the filter function is omitted it will return all subviews. If a
// String is passed instead, it will return the Views for that selector.
getViews: function(fn) {
- // Generate an array of all top level (no deeply nested) Views flattened.
- var views = _.chain(this.views).map(function(view) {
- return _.isArray(view) ? view : [view];
- }, this).flatten().value();
+ var views;
// If the filter argument is a String, then return a chained Version of the
- // elements.
+ // elements. The value at the specified filter may be undefined, a single
+ // view, or an array of views; in all cases, chain on a flat array.
if (typeof fn === "string") {
- return _.chain([this.views[fn]]).flatten();
+ views = this.views[fn] || [];
+ return _.chain([].concat(views));
}
+ // Generate an array of all top level (no deeply nested) Views flattened.
+ views = _.chain(this.views).map(function(view) {
+ return _.isArray(view) ? view : [view];
+ }, this).flatten();
+
// If the argument passed is an Object, then pass it to `_.where`.
if (typeof fn === "object") {
- return _.chain([_.where(views, fn)]).flatten();
+ return views.where(fn);
}
// If a filter function is provided, run it on all Views and return a
// wrapped chain. Otherwise, simply return a wrapped chain of all Views.
- return _.chain(typeof fn === "function" ? _.filter(views, fn) : views);
+ return typeof fn === "function" ? views.filter(fn) : views;
},
// Use this to remove Views, internally uses `getViews` so you can pass the
@@ -421,7 +425,7 @@ var LayoutManager = Backbone.View.extend({
// the DOM element.
function applyTemplate(rendered) {
// Actually put the rendered contents into the element.
- if (rendered) {
+ if (_.isString(rendered)) {
// If no container is specified, we must replace the content.
if (manager.noel) {
// Trim off the whitespace, since the contents are passed into `$()`.
@@ -609,6 +613,8 @@ var LayoutManager = Backbone.View.extend({
cleanViews: function(views) {
// Clear out all existing views.
_.each(aConcat.call([], views), function(view) {
+ var cleanup;
+
// Remove all custom events attached to this View.
view.unbind();
@@ -627,7 +633,10 @@ var LayoutManager = Backbone.View.extend({
// If a custom cleanup method was provided on the view, call it after
// the initial cleanup is done
- _.result(view.getAllOptions(), "cleanup");
+ cleanup = view.getAllOptions().cleanup;
+ if (_.isFunction(cleanup)) {
+ cleanup.call(view);
+ }
});
},
@@ -670,7 +679,8 @@ var LayoutManager = Backbone.View.extend({
views: {},
// Internal state object used to store whether or not a View has been
- // taken over by layout manager and if it has been rendered into the DOM.
+ // taken over by layout manager and if it has been rendered into the
+ // DOM.
__manager__: {},
// Add the ability to remove all Views.
@@ -773,7 +783,7 @@ var LayoutManager = Backbone.View.extend({
// Convenience assignment to make creating Layout's slightly shorter.
Backbone.Layout = LayoutManager;
// Tack on the version.
-LayoutManager.VERSION = "0.8.7";
+LayoutManager.VERSION = "0.8.8";
// Override _configure to provide extra functionality that is necessary in
// order for the render function reference to be bound during initialize.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/alerts.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/alerts.less b/src/fauxton/assets/less/bootstrap/alerts.less
index 9abb226..0116b19 100644
--- a/src/fauxton/assets/less/bootstrap/alerts.less
+++ b/src/fauxton/assets/less/bootstrap/alerts.less
@@ -13,6 +13,10 @@
background-color: @warningBackground;
border: 1px solid @warningBorder;
.border-radius(@baseBorderRadius);
+}
+.alert,
+.alert h4 {
+ // Specified for the h4 to prevent conflicts of changing @headingsColor
color: @warningText;
}
.alert h4 {
@@ -36,17 +40,27 @@
border-color: @successBorder;
color: @successText;
}
+.alert-success h4 {
+ color: @successText;
+}
.alert-danger,
.alert-error {
background-color: @errorBackground;
border-color: @errorBorder;
color: @errorText;
}
+.alert-danger h4,
+.alert-error h4 {
+ color: @errorText;
+}
.alert-info {
background-color: @infoBackground;
border-color: @infoBorder;
color: @infoText;
}
+.alert-info h4 {
+ color: @infoText;
+}
// Block alerts
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/bootstrap.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/bootstrap.less b/src/fauxton/assets/less/bootstrap/bootstrap.less
index 14bb3f0..d4ebf37 100644
--- a/src/fauxton/assets/less/bootstrap/bootstrap.less
+++ b/src/fauxton/assets/less/bootstrap/bootstrap.less
@@ -1,5 +1,5 @@
/*!
- * Bootstrap v2.2.1
+ * Bootstrap v2.3.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
@@ -8,13 +8,13 @@
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
-// CSS Reset
-@import "reset.less";
-
// Core variables and mixins
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";
+// CSS Reset
+@import "reset.less";
+
// Grid system and page structure
@import "scaffolding.less";
@import "grid.less";
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/breadcrumbs.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/breadcrumbs.less b/src/fauxton/assets/less/bootstrap/breadcrumbs.less
index 76fbe30..f753df6 100644
--- a/src/fauxton/assets/less/bootstrap/breadcrumbs.less
+++ b/src/fauxton/assets/less/bootstrap/breadcrumbs.less
@@ -9,16 +9,16 @@
list-style: none;
background-color: #f5f5f5;
.border-radius(@baseBorderRadius);
- li {
+ > li {
display: inline-block;
.ie7-inline-block();
text-shadow: 0 1px 0 @white;
+ > .divider {
+ padding: 0 5px;
+ color: #ccc;
+ }
}
- .divider {
- padding: 0 5px;
- color: #ccc;
- }
- .active {
+ > .active {
color: @grayLight;
}
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/button-groups.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/button-groups.less b/src/fauxton/assets/less/bootstrap/button-groups.less
index 46837e6..55cdc60 100644
--- a/src/fauxton/assets/less/bootstrap/button-groups.less
+++ b/src/fauxton/assets/less/bootstrap/button-groups.less
@@ -24,9 +24,9 @@
font-size: 0; // Hack to remove whitespace that results from using inline-block
margin-top: @baseLineHeight / 2;
margin-bottom: @baseLineHeight / 2;
- .btn + .btn,
- .btn-group + .btn,
- .btn + .btn-group {
+ > .btn + .btn,
+ > .btn-group + .btn,
+ > .btn + .btn-group {
margin-left: 5px;
}
}
@@ -40,59 +40,44 @@
margin-left: -1px;
}
.btn-group > .btn,
-.btn-group > .dropdown-menu {
+.btn-group > .dropdown-menu,
+.btn-group > .popover {
font-size: @baseFontSize; // redeclare as part 2 of font-size inline-block hack
}
// Reset fonts for other sizes
.btn-group > .btn-mini {
- font-size: 11px;
+ font-size: @fontSizeMini;
}
.btn-group > .btn-small {
- font-size: 12px;
+ font-size: @fontSizeSmall;
}
.btn-group > .btn-large {
- font-size: 16px;
+ font-size: @fontSizeLarge;
}
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
.btn-group > .btn:first-child {
margin-left: 0;
- -webkit-border-top-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
- border-top-left-radius: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
- border-bottom-left-radius: 4px;
+ .border-top-left-radius(@baseBorderRadius);
+ .border-bottom-left-radius(@baseBorderRadius);
}
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
.btn-group > .btn:last-child,
.btn-group > .dropdown-toggle {
- -webkit-border-top-right-radius: 4px;
- -moz-border-radius-topright: 4px;
- border-top-right-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- -moz-border-radius-bottomright: 4px;
- border-bottom-right-radius: 4px;
+ .border-top-right-radius(@baseBorderRadius);
+ .border-bottom-right-radius(@baseBorderRadius);
}
// Reset corners for large buttons
.btn-group > .btn.large:first-child {
margin-left: 0;
- -webkit-border-top-left-radius: 6px;
- -moz-border-radius-topleft: 6px;
- border-top-left-radius: 6px;
- -webkit-border-bottom-left-radius: 6px;
- -moz-border-radius-bottomleft: 6px;
- border-bottom-left-radius: 6px;
+ .border-top-left-radius(@borderRadiusLarge);
+ .border-bottom-left-radius(@borderRadiusLarge);
}
.btn-group > .btn.large:last-child,
.btn-group > .large.dropdown-toggle {
- -webkit-border-top-right-radius: 6px;
- -moz-border-radius-topright: 6px;
- border-top-right-radius: 6px;
- -webkit-border-bottom-right-radius: 6px;
- -moz-border-radius-bottomright: 6px;
- border-bottom-right-radius: 6px;
+ .border-top-right-radius(@borderRadiusLarge);
+ .border-bottom-right-radius(@borderRadiusLarge);
}
// On hover/focus/active, bring the proper btn to front
@@ -179,8 +164,6 @@
margin-left: 0;
}
// Carets in other button sizes
-.btn-mini .caret,
-.btn-small .caret,
.btn-large .caret {
margin-top: 6px;
}
@@ -189,6 +172,10 @@
border-right-width: 5px;
border-top-width: 5px;
}
+.btn-mini .caret,
+.btn-small .caret {
+ margin-top: 8px;
+}
// Upside down carets for .dropup
.dropup .btn-large .caret {
border-bottom-width: 5px;
@@ -218,25 +205,25 @@
display: inline-block; // makes buttons only take up the width they need
.ie7-inline-block();
}
-.btn-group-vertical .btn {
+.btn-group-vertical > .btn {
display: block;
float: none;
- width: 100%;
+ max-width: 100%;
.border-radius(0);
}
-.btn-group-vertical .btn + .btn {
+.btn-group-vertical > .btn + .btn {
margin-left: 0;
margin-top: -1px;
}
-.btn-group-vertical .btn:first-child {
- .border-radius(4px 4px 0 0);
+.btn-group-vertical > .btn:first-child {
+ .border-radius(@baseBorderRadius @baseBorderRadius 0 0);
}
-.btn-group-vertical .btn:last-child {
- .border-radius(0 0 4px 4px);
+.btn-group-vertical > .btn:last-child {
+ .border-radius(0 0 @baseBorderRadius @baseBorderRadius);
}
-.btn-group-vertical .btn-large:first-child {
- .border-radius(6px 6px 0 0);
+.btn-group-vertical > .btn-large:first-child {
+ .border-radius(@borderRadiusLarge @borderRadiusLarge 0 0);
}
-.btn-group-vertical .btn-large:last-child {
- .border-radius(0 0 6px 6px);
+.btn-group-vertical > .btn-large:last-child {
+ .border-radius(0 0 @borderRadiusLarge @borderRadiusLarge);
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/buttons.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/buttons.less b/src/fauxton/assets/less/bootstrap/buttons.less
index 63f2d86..4cd4d86 100644
--- a/src/fauxton/assets/less/bootstrap/buttons.less
+++ b/src/fauxton/assets/less/bootstrap/buttons.less
@@ -14,7 +14,6 @@
margin-bottom: 0; // For input.btn
font-size: @baseFontSize;
line-height: @baseLineHeight;
- *line-height: @baseLineHeight;
text-align: center;
vertical-align: middle;
cursor: pointer;
@@ -26,15 +25,14 @@
.ie7-restore-left-whitespace(); // Give IE7 some love
.box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
- // Hover state
- &:hover {
+ // Hover/focus state
+ &:hover,
+ &:focus {
color: @grayDark;
text-decoration: none;
- background-color: darken(@white, 10%);
- *background-color: darken(@white, 15%); /* Buttons in IE7 don't get borders, so darken on hover */
background-position: 0 -15px;
- // transition is only when going to hover, otherwise the background
+ // transition is only when going to hover/focus, otherwise the background
// behind the gradient (there for IE<=9 fallback) gets mismatched
.transition(background-position .1s linear);
}
@@ -47,8 +45,6 @@
// Active state
&.active,
&:active {
- background-color: darken(@white, 10%);
- background-color: darken(@white, 15%) e("\9");
background-image: none;
outline: 0;
.box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
@@ -58,7 +54,6 @@
&.disabled,
&[disabled] {
cursor: default;
- background-color: darken(@white, 10%);
background-image: none;
.opacity(65);
.box-shadow(none);
@@ -79,7 +74,7 @@
}
.btn-large [class^="icon-"],
.btn-large [class*=" icon-"] {
- margin-top: 2px;
+ margin-top: 4px;
}
// Small
@@ -92,6 +87,10 @@
.btn-small [class*=" icon-"] {
margin-top: 0;
}
+.btn-mini [class^="icon-"],
+.btn-mini [class*=" icon-"] {
+ margin-top: -1px;
+}
// Mini
.btn-mini {
@@ -143,11 +142,6 @@ input[type="button"] {
// Set the backgrounds
// -------------------------
-.btn {
- // reset here as of 2.0.3 due to Recess property order
- border-color: #c5c5c5;
- border-color: rgba(0,0,0,.15) rgba(0,0,0,.15) rgba(0,0,0,.25);
-}
.btn-primary {
.buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
}
@@ -221,12 +215,14 @@ input[type="submit"].btn {
color: @linkColor;
.border-radius(0);
}
-.btn-link:hover {
+.btn-link:hover,
+.btn-link:focus {
color: @linkColorHover;
text-decoration: underline;
background-color: transparent;
}
-.btn-link[disabled]:hover {
+.btn-link[disabled]:hover,
+.btn-link[disabled]:focus {
color: @grayDark;
text-decoration: none;
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/carousel.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/carousel.less b/src/fauxton/assets/less/bootstrap/carousel.less
index 33f98ac..55bc050 100644
--- a/src/fauxton/assets/less/bootstrap/carousel.less
+++ b/src/fauxton/assets/less/bootstrap/carousel.less
@@ -15,50 +15,51 @@
position: relative;
}
-.carousel {
+.carousel-inner {
- .item {
+ > .item {
display: none;
position: relative;
.transition(.6s ease-in-out left);
- }
- // Account for jankitude on images
- .item > img {
- display: block;
- line-height: 1;
+ // Account for jankitude on images
+ > img,
+ > a > img {
+ display: block;
+ line-height: 1;
+ }
}
- .active,
- .next,
- .prev { display: block; }
+ > .active,
+ > .next,
+ > .prev { display: block; }
- .active {
+ > .active {
left: 0;
}
- .next,
- .prev {
+ > .next,
+ > .prev {
position: absolute;
top: 0;
width: 100%;
}
- .next {
+ > .next {
left: 100%;
}
- .prev {
+ > .prev {
left: -100%;
}
- .next.left,
- .prev.right {
+ > .next.left,
+ > .prev.right {
left: 0;
}
- .active.left {
+ > .active.left {
left: -100%;
}
- .active.right {
+ > .active.right {
left: 100%;
}
@@ -97,14 +98,40 @@
right: 15px;
}
- // Hover state
- &:hover {
+ // Hover/focus state
+ &:hover,
+ &:focus {
color: @white;
text-decoration: none;
.opacity(90);
}
}
+// Carousel indicator pips
+// -----------------------------
+.carousel-indicators {
+ position: absolute;
+ top: 15px;
+ right: 15px;
+ z-index: 5;
+ margin: 0;
+ list-style: none;
+
+ li {
+ display: block;
+ float: left;
+ width: 10px;
+ height: 10px;
+ margin-left: 5px;
+ text-indent: -999px;
+ background-color: #ccc;
+ background-color: rgba(255,255,255,.25);
+ border-radius: 5px;
+ }
+ .active {
+ background-color: #fff;
+ }
+}
// Caption for text below images
// -----------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/close.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/close.less b/src/fauxton/assets/less/bootstrap/close.less
index c71a508..4c626bd 100644
--- a/src/fauxton/assets/less/bootstrap/close.less
+++ b/src/fauxton/assets/less/bootstrap/close.less
@@ -11,7 +11,8 @@
color: @black;
text-shadow: 0 1px 0 rgba(255,255,255,1);
.opacity(20);
- &:hover {
+ &:hover,
+ &:focus {
color: @black;
text-decoration: none;
cursor: pointer;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/code.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/code.less b/src/fauxton/assets/less/bootstrap/code.less
index 5495b15..266a926 100644
--- a/src/fauxton/assets/less/bootstrap/code.less
+++ b/src/fauxton/assets/less/bootstrap/code.less
@@ -19,6 +19,7 @@ code {
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
+ white-space: nowrap;
}
// Blocks of code
@@ -46,6 +47,8 @@ pre {
code {
padding: 0;
color: inherit;
+ white-space: pre;
+ white-space: pre-wrap;
background-color: transparent;
border: 0;
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/dropdowns.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/dropdowns.less b/src/fauxton/assets/less/bootstrap/dropdowns.less
index 26ca0f9..9e47b47 100644
--- a/src/fauxton/assets/less/bootstrap/dropdowns.less
+++ b/src/fauxton/assets/less/bootstrap/dropdowns.less
@@ -72,7 +72,7 @@
}
// Links within the dropdown menu
- li > a {
+ > li > a {
display: block;
padding: 3px 20px;
clear: both;
@@ -83,11 +83,12 @@
}
}
-// Hover state
+// Hover/Focus state
// -----------
-.dropdown-menu li > a:hover,
-.dropdown-menu li > a:focus,
-.dropdown-submenu:hover > a {
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus,
+.dropdown-submenu:hover > a,
+.dropdown-submenu:focus > a {
text-decoration: none;
color: @dropdownLinkColorHover;
#gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%));
@@ -95,8 +96,9 @@
// Active state
// ------------
-.dropdown-menu .active > a,
-.dropdown-menu .active > a:hover {
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
color: @dropdownLinkColorActive;
text-decoration: none;
outline: 0;
@@ -105,16 +107,19 @@
// Disabled state
// --------------
-// Gray out text and ensure the hover state remains gray
-.dropdown-menu .disabled > a,
-.dropdown-menu .disabled > a:hover {
+// Gray out text and ensure the hover/focus state remains gray
+.dropdown-menu > .disabled > a,
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
color: @grayLight;
}
-// Nuke hover effects
-.dropdown-menu .disabled > a:hover {
+// Nuke hover/focus effects
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none; // Remove CSS gradient
+ .reset-filter();
cursor: default;
}
@@ -130,6 +135,17 @@
}
}
+// Backdrop to catch body clicks on mobile, etc.
+// ---------------------------
+.dropdown-backdrop {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ z-index: @zindexDropdown - 10;
+}
+
// Right aligned dropdowns
// ---------------------------
.pull-right > .dropdown-menu {
@@ -168,9 +184,7 @@
left: 100%;
margin-top: -6px;
margin-left: -1px;
- -webkit-border-radius: 0 6px 6px 6px;
- -moz-border-radius: 0 6px 6px 6px;
- border-radius: 0 6px 6px 6px;
+ .border-radius(0 6px 6px 6px);
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
@@ -182,9 +196,7 @@
bottom: 0;
margin-top: 0;
margin-bottom: -2px;
- -webkit-border-radius: 5px 5px 5px 0;
- -moz-border-radius: 5px 5px 5px 0;
- border-radius: 5px 5px 5px 0;
+ .border-radius(5px 5px 5px 0);
}
// Caret to indicate there is a submenu
@@ -215,9 +227,7 @@
> .dropdown-menu {
left: -100%;
margin-left: 10px;
- -webkit-border-radius: 6px 0 6px 6px;
- -moz-border-radius: 6px 0 6px 6px;
- border-radius: 6px 0 6px 6px;
+ .border-radius(6px 0 6px 6px);
}
}
@@ -232,6 +242,7 @@
// Typeahead
// ---------
.typeahead {
+ z-index: 1051;
margin-top: 2px; // give it some space to breathe
.border-radius(@baseBorderRadius);
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/forms.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/forms.less b/src/fauxton/assets/less/bootstrap/forms.less
index e142f2a..06767bd 100644
--- a/src/fauxton/assets/less/bootstrap/forms.less
+++ b/src/fauxton/assets/less/bootstrap/forms.less
@@ -138,7 +138,6 @@ input[type="checkbox"] {
*margin-top: 0; /* IE7 */
margin-top: 1px \9; /* IE8-9 */
line-height: normal;
- cursor: pointer;
}
// Reset width of input images, buttons, radios, checkboxes
@@ -367,9 +366,9 @@ input[type="checkbox"][readonly] {
// HTML5 invalid states
// Shares styles with the .control-group.error above
-input:focus:required:invalid,
-textarea:focus:required:invalid,
-select:focus:required:invalid {
+input:focus:invalid,
+textarea:focus:invalid,
+select:focus:invalid {
color: #b94a48;
border-color: #ee5f5b;
&:focus {
@@ -423,7 +422,9 @@ select:focus:required:invalid {
// Allow us to put symbols and text within the input field for a cleaner look
.input-append,
.input-prepend {
- margin-bottom: 5px;
+ display: inline-block;
+ margin-bottom: @baseLineHeight / 2;
+ vertical-align: middle;
font-size: 0; // white space collapse hack
white-space: nowrap; // Prevent span and input from separating
@@ -431,7 +432,8 @@ select:focus:required:invalid {
input,
select,
.uneditable-input,
- .dropdown-menu {
+ .dropdown-menu,
+ .popover {
font-size: @baseFontSize;
}
@@ -463,7 +465,8 @@ select:focus:required:invalid {
border: 1px solid #ccc;
}
.add-on,
- .btn {
+ .btn,
+ .btn-group > .dropdown-toggle {
vertical-align: top;
.border-radius(0);
}
@@ -490,7 +493,7 @@ select:focus:required:invalid {
select,
.uneditable-input {
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
- + .btn-group .btn {
+ + .btn-group .btn:last-child {
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
}
}
@@ -500,7 +503,8 @@ select:focus:required:invalid {
margin-left: -1px;
}
.add-on:last-child,
- .btn:last-child {
+ .btn:last-child,
+ .btn-group:last-child > .dropdown-toggle {
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
}
}
@@ -671,7 +675,10 @@ legend + .control-group {
// And apply it only to .help-block instances that follow a form control
input,
select,
- textarea {
+ textarea,
+ .uneditable-input,
+ .input-prepend,
+ .input-append {
+ .help-block {
margin-top: @baseLineHeight / 2;
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/labels-badges.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/labels-badges.less b/src/fauxton/assets/less/bootstrap/labels-badges.less
index d118a01..bc321fe 100644
--- a/src/fauxton/assets/less/bootstrap/labels-badges.less
+++ b/src/fauxton/assets/less/bootstrap/labels-badges.less
@@ -27,10 +27,20 @@
.border-radius(9px);
}
-// Hover state, but only for links
+// Empty labels/badges collapse
+.label,
+.badge {
+ &:empty {
+ display: none;
+ }
+}
+
+// Hover/focus state, but only for links
a {
&.label:hover,
- &.badge:hover {
+ &.label:focus,
+ &.badge:hover,
+ &.badge:focus {
color: @white;
text-decoration: none;
cursor: pointer;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/media.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/media.less b/src/fauxton/assets/less/bootstrap/media.less
index 1decab7..e461e44 100644
--- a/src/fauxton/assets/less/bootstrap/media.less
+++ b/src/fauxton/assets/less/bootstrap/media.less
@@ -37,10 +37,10 @@
// Media image alignment
// -------------------------
-.media .pull-left {
+.media > .pull-left {
margin-right: 10px;
}
-.media .pull-right {
+.media > .pull-right {
margin-left: 10px;
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/mixins.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/mixins.less b/src/fauxton/assets/less/bootstrap/mixins.less
index 98aa2b8..92034a0 100644
--- a/src/fauxton/assets/less/bootstrap/mixins.less
+++ b/src/fauxton/assets/less/bootstrap/mixins.less
@@ -163,7 +163,7 @@
// Mixin for form field states
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
// Set the text color
- > label,
+ .control-label,
.help-block,
.help-inline {
color: @textColor;
@@ -268,6 +268,12 @@
-o-transition-delay: @transition-delay;
transition-delay: @transition-delay;
}
+.transition-duration(@transition-duration) {
+ -webkit-transition-duration: @transition-duration;
+ -moz-transition-duration: @transition-duration;
+ -o-transition-duration: @transition-duration;
+ transition-duration: @transition-duration;
+}
// Transformations
.rotate(@degrees) {
@@ -437,6 +443,17 @@
background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10
}
+ .horizontal-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
+ background-color: mix(@midColor, @endColor, 80%);
+ background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
+ background-image: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
+ background-image: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
+ background-image: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
+ background-image: linear-gradient(to right, @startColor, @midColor @colorStop, @endColor);
+ background-repeat: no-repeat;
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
+ }
+
.vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
background-color: mix(@midColor, @endColor, 80%);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
@@ -500,7 +517,7 @@
.reset-filter();
// in these cases the gradient won't cover the background, so we override
- &:hover, &:active, &.active, &.disabled, &[disabled] {
+ &:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
color: @textColor;
background-color: @endColor;
*background-color: darken(@endColor, 5%);
@@ -558,13 +575,13 @@
.core (@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~".span@{index}") { .span(@index); }
+ .span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
- (~".offset@{index}") { .offset(@index); }
+ .offset@{index} { .offset(@index); }
.offsetX(@index - 1);
}
.offsetX (0) {}
@@ -603,14 +620,14 @@
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~".span@{index}") { .span(@index); }
+ .span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
- (~'.offset@{index}') { .offset(@index); }
- (~'.offset@{index}:first-child') { .offsetFirstChild(@index); }
+ .offset@{index} { .offset(@index); }
+ .offset@{index}:first-child { .offsetFirstChild(@index); }
.offsetX(@index - 1);
}
.offsetX (0) {}
@@ -658,7 +675,7 @@
.input(@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
+ input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
@@ -682,5 +699,18 @@
.spanX (@gridColumns);
}
+}
+
+.customTransition(@prop, @delay, @a, @b, @c, @d){
+-webkit-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+ -moz-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+ -ms-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+ -o-transition: @prop, @delay cubic-bezier(@a, @b, @c, @d);
+ transition: @prop, @delay cubic-bezier(@a, @b, @c, @d); /* custom */
+-webkit-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+ -moz-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+ -ms-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+ -o-transition-timing-function: cubic-bezier(@a, @b, @c, @d);
+ transition-timing-function: cubic-bezier(@a, @b, @c, @d); /* custom */
}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/7d376196/src/fauxton/assets/less/bootstrap/modals.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/bootstrap/modals.less b/src/fauxton/assets/less/bootstrap/modals.less
index 90b8667..8e272d4 100644
--- a/src/fauxton/assets/less/bootstrap/modals.less
+++ b/src/fauxton/assets/less/bootstrap/modals.less
@@ -23,11 +23,11 @@
// Base modal
.modal {
position: fixed;
- top: 50%;
+ top: 10%;
left: 50%;
z-index: @zindexModal;
width: 560px;
- margin: -250px 0 0 -280px;
+ margin-left: -280px;
background-color: @white;
border: 1px solid #999;
border: 1px solid rgba(0,0,0,.3);
@@ -42,7 +42,7 @@
.transition(e('opacity .3s linear, top .3s ease-out'));
top: -25%;
}
- &.fade.in { top: 50%; }
+ &.fade.in { top: 10%; }
}
.modal-header {
padding: 9px 15px;
@@ -58,6 +58,7 @@
// Body (where all modal content resides)
.modal-body {
+ position: relative;
overflow-y: auto;
max-height: 400px;
padding: 15px;
|