mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-30 13:56:58 -04:00
remove some unneeded methods from minifiedjs
This commit is contained in:
+2
-316
@@ -1,8 +1,7 @@
|
||||
// minified.js config start -- use this comment to re-create a configuration in the Builder
|
||||
// - Only sections add, always, amdsupport, copyobj, dollardollar,
|
||||
// - each, eachobj, error, extend, filter, filterobj, find, format, formathtml,
|
||||
// - get, ht, html, isobject, keys, map, mapobj, objvalues, off, on, ready,
|
||||
// - request, select, set, template, trigger, underscore, wait.
|
||||
// - each, eachobj, error, extend, format, formathtml, get, ht, html, isobject,
|
||||
// - off, on, ready, request, select, set, template, trigger, underscore, wait.
|
||||
|
||||
|
||||
// WARNING! This file is autogenerated from minified-master.js and others.
|
||||
@@ -1550,177 +1549,6 @@ define('minified', function() {
|
||||
*/
|
||||
'each': listBind(each),
|
||||
|
||||
/*$
|
||||
* @id filter
|
||||
* @group LIST
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name .filter()
|
||||
* @altname _.filter()
|
||||
* @syntax list.filter(filterFunc)
|
||||
* @syntax list.filter(filterFunc, ctx)
|
||||
* @syntax list.filter(value)
|
||||
* @syntax _.filter(list, filterFunc)
|
||||
* @syntax _.filter(list, filterFunc, ctx)
|
||||
* @syntax _.filter(list, value)
|
||||
* @module WEB, UTIL
|
||||
* Creates a new ##list#Minified list## by taking an existing list and omitting certain elements from it. You
|
||||
* can either specify a callback function to approve those items that will be in the new list (all modules), or
|
||||
* you can pass a value to remove from the new list (Util module only).
|
||||
*
|
||||
* If the callback function returns true, the item is shallow-copied in the new list, otherwise it will be removed.
|
||||
* For values, a simple equality operation (<code>==</code>) will be used.
|
||||
*
|
||||
* @example Removing all instances of the number 10 from a list:
|
||||
* <pre>
|
||||
* var list = _([4, 10, 22, 7, 2, 19, 10]).filter(10);
|
||||
* </pre>
|
||||
*
|
||||
* @example Removing all numbers over 10 from a list:
|
||||
* <pre>
|
||||
* var list = _([4, 22, 7, 2, 19]).filter(function(item, index) {
|
||||
* return item <= 10;
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @example The previous example with a native array is input. Note that the result is always a ##list#Minified list##:
|
||||
* <pre>
|
||||
* var list = _.filter([4, 22, 7, 2, 19], function(item, index) {
|
||||
* return item <= 10;
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @example Creates a list of all unchecked checkboxes on a web page:
|
||||
* <pre>
|
||||
* var list = $('input').filter(function(item, index) {
|
||||
* return item.getAttribute('type') == 'checkbox' && item.checked;
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param list a list to filter. A list to use as input. Can be an array, a ##list#Minified list## or any other array-like structure with
|
||||
* <var>length</var> property.
|
||||
* @param filterFunc The filter callback <code>function(item, index)</code> that decides which elements to include:
|
||||
* <dl><dt>item</dt><dd>The current list element.</dd>
|
||||
* <dt>index</dt><dd>The second the zero-based index of the current element.</dd>
|
||||
* <dt class="this">this</dt><dd>The given context if not null. Otherwise the list.</dd>
|
||||
* <dt class="returnValue">(callback return value)</dt><dd><var>true</var> to include the item in the new list, <var>false</var> to omit it.</dd></dl>
|
||||
* @param ctx optional a context to pass to the callback as 'this'. Only supported in UTIL module.
|
||||
* @param value a value to remove from the list. It will be determined which elements to remove using <code>==</code>. Must not
|
||||
* be a function. Requires Util module.
|
||||
* @return the new, filtered ##list#list##
|
||||
*
|
||||
* @see ##only() offers selector-based filtering.
|
||||
*/
|
||||
'filter': listBindArray(filter),
|
||||
|
||||
/*$
|
||||
* @id map
|
||||
* @group LIST
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name .map()
|
||||
* @altname _.map()
|
||||
* @syntax list.map(mapFunc)
|
||||
* @syntax list.map(mapFunc, ctx)
|
||||
* @syntax _.map(list, mapFunc)
|
||||
* @syntax _.map(list, mapFunc, ctx)
|
||||
* @module UTIL
|
||||
* Creates a new ##list#Minified list## from the current list using the given callback function.
|
||||
* The callback is invoked once for each element of the current list. The callback results will be added to the result list.
|
||||
*
|
||||
* <var>map()</var> is a simpler version of ##collect(). Unlike <var>collect()</var>, it always creates lists of the same size as the input list, but
|
||||
* it is easier to use if the resulting list should contain nulls or nested list.
|
||||
*
|
||||
* @example Goes through a list of numbers and creates a new list with each value increased by 1:
|
||||
* <pre>
|
||||
* var inced = _(3, 7, 11, 5, 19, 3).map(function(number, index) {
|
||||
* return number + 1;
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @example The previous example with a native array is input. Note that the result is always a ##list#Minified list##:
|
||||
* <pre>
|
||||
* var inced = _.map([3, 7, 11, 5, 19, 3], function(number, index) {
|
||||
* return number + 1;
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param list a list to transform. Can be an array, a ##list#Minified list## or any other array-like structure with
|
||||
* <var>length</var> property.
|
||||
* @param mapFunc The callback <code>function(item, index)</code> to invoke for each item:
|
||||
* <dl><dt>item</dt><dd>The current list element.</dd><dt>index</dt><dd>The second the zero-based index of the current element.</dd>
|
||||
* <dt class="this">this</dt><dd>The given context if not null. Otherwise the list.</dd>
|
||||
* <dt class="returnValue">(callback return value)</dt><dd>This value will replace the original value in the new list.</dd></dl>
|
||||
* @param ctx optional a context to pass to the callback as 'this'.
|
||||
* @return the new ##list#list##
|
||||
*
|
||||
* @see ##collect() is a more powerful version of <var>map()</var>.
|
||||
*/
|
||||
'map': listBindArray(map),
|
||||
|
||||
/*$
|
||||
* @id find
|
||||
* @group LIST
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name .find()
|
||||
* @altname _.find()
|
||||
* @syntax list.find(findFunc)
|
||||
* @syntax list.find(element)
|
||||
* @syntax list.find(findFunc, startIndex)
|
||||
* @syntax list.find(element, startIndex)
|
||||
* @syntax _.find(list, findFunc)
|
||||
* @syntax _.find(list, element)
|
||||
* @syntax _.find(list, findFunc, startIndex)
|
||||
* @syntax _.find(list, element, startIndex)
|
||||
* @module WEB, UTIL
|
||||
* Finds a specific value in the list. There are two ways of calling <var>find()</var>:
|
||||
* <ol>
|
||||
* <li>With a value as argument. Then <var>find()</var> will search for the first occurrence of an identical value in the list,
|
||||
* using the '===' operator for comparisons, and return the index. If it is not found,
|
||||
* <var>find()</var> returns <var>undefined</var>.</li>
|
||||
* <li>With a callback function. <var>find()</var> will then call the given function for each list element until the function
|
||||
* returns a value that is not <var>null</var> or <var>undefined</var>. This value will be returned.</li>
|
||||
* </ol>
|
||||
*
|
||||
* <var>find()</var> can also be used as an alternative to ##each() if you need to abort the loop.
|
||||
*
|
||||
* @example Finds the first negative number in the list:
|
||||
* <pre>
|
||||
* var i = _(1, 2, -4, 5, 2, -1).find(function(value, index) { if (value < 0) return index; }); // returns 2
|
||||
* </pre>
|
||||
|
||||
* @example Finds the index of the first 5 in the array:
|
||||
* <pre>
|
||||
* var i = _.find([3, 6, 7, 6, 5, 4, 5], 5); // returns 4 (index of first 5)
|
||||
* </pre>
|
||||
*
|
||||
* @example Determines the position of the element with the id '#wanted' among all li elements:
|
||||
* <pre>
|
||||
* var elementIndex = $('li').find($$('#wanted'));
|
||||
* </pre>
|
||||
*
|
||||
* @example Goes through the elements to find the first div that has the class 'myClass', and returns this element:
|
||||
* <pre>
|
||||
* var myClassElement = $('div').find(function(e) { if ($(e).is('.myClass')) return e; });
|
||||
* </pre>
|
||||
*
|
||||
* @param list A list to use as input. Can be an array, a ##list#Minified list## or any other array-like structure with
|
||||
* <var>length</var> property.
|
||||
* @param findFunc The callback <code>function(item, index)</code> that will be invoked for every list item until it returns a non-null value:
|
||||
* <dl><dt>item</dt><dd>The current list element.</dd><dt>index</dt><dd>The second the zero-based index of the current element.</dd>
|
||||
* <dt class="this">this</dt><dd>This list.</dd>
|
||||
* <dt class="returnValue">(callback return value)</dt><dd>If the callback returns something other than <var>null</var> or
|
||||
* <var>undefined</var>, <var>find()</var> will return it directly. Otherwise it will continue. </dd></dl>
|
||||
* @param element the element to search for
|
||||
* @param startIndex optional the 0-based index of the first element to search.
|
||||
* @return if called with an element, either the element's index in the list or <var>undefined</var> if not found. If called with a callback function,
|
||||
* it returns either the value returned by the callback or <var>undefined</var>.
|
||||
*
|
||||
* @see ##findLast() is the equivalent to <var>find()</var> for the list's end.
|
||||
*/
|
||||
'find': listBind(find),
|
||||
|
||||
/*$
|
||||
* @stop
|
||||
*/
|
||||
@@ -2725,74 +2553,12 @@ define('minified', function() {
|
||||
|
||||
copyObj({
|
||||
///#snippet utilUnderscoreFuncs
|
||||
// @condblock filter
|
||||
'filter': funcArrayBind(filter),
|
||||
// @condend
|
||||
// @condblock map
|
||||
'map': funcArrayBind(map),
|
||||
// @condend
|
||||
// @condblock each
|
||||
'each': each,
|
||||
// @condend
|
||||
// @condblock each
|
||||
'toObject': toObject,
|
||||
// @condend
|
||||
// @condblock find
|
||||
'find': find,
|
||||
// @condend
|
||||
|
||||
/*$
|
||||
* @id keys
|
||||
* @group OBJECT
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name _.keys()
|
||||
* @syntax _.keys(obj)
|
||||
* @module UTIL
|
||||
* Creates a ##list#Minified list## containing all property names of the specified object. Only direct properies are
|
||||
* included, not inherited ones. The order of the keys in the list is undefined and runtime-specific.
|
||||
*
|
||||
* @example Using <var>keys()</var>:
|
||||
* <pre>var obj = {a: 2, b: 52};
|
||||
* var keys = _.keys(obj); // keys contains ['a', 'b'] now
|
||||
* </pre>
|
||||
*
|
||||
* @param object The object to gather keys from.
|
||||
* @return A Minified list containing the property names.
|
||||
*
|
||||
* @see ##_.values() returns the values of an object as a list.
|
||||
*/
|
||||
'keys': funcArrayBind(keys),
|
||||
|
||||
/*$
|
||||
* @id objvalues
|
||||
* @group OBJECT
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name _.values()
|
||||
* @syntax _.values(obj)
|
||||
* @module UTIL
|
||||
* Creates a ##list#Minified list## containing all property values of the specified object. Only direct properies are
|
||||
* included, not inherited ones. The order of the values in the list is undefined and runtime-specific.
|
||||
*
|
||||
* @example Using <var>values()</var>:
|
||||
* <pre>var obj = {a: 2, b: 52};
|
||||
* var values = _.values(obj); // keys contains [2, 52] now
|
||||
* </pre>
|
||||
*
|
||||
* @param object The object to gather values from.
|
||||
* @return A Minified list containing the property names.
|
||||
*
|
||||
* @see ##_.keys() retrieves the property names of an object as a list.
|
||||
*/
|
||||
'values': funcArrayBind(function(obj, keys) {
|
||||
var list = [];
|
||||
if (keys)
|
||||
each(keys, function(value) { list.push(obj[value]); });
|
||||
else
|
||||
eachObj(obj, function(key, value) { list.push(value); });
|
||||
return list;
|
||||
}),
|
||||
|
||||
/*$
|
||||
* @id copyobj
|
||||
@@ -2891,86 +2657,6 @@ define('minified', function() {
|
||||
*/
|
||||
'eachObj': eachObj,
|
||||
|
||||
/*$
|
||||
* @id mapobj
|
||||
* @group OBJECT
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name _.mapObj()
|
||||
* @syntax _.mapObj(obj, callback)
|
||||
* @syntax _.mapObj(obj, callback, ctx)
|
||||
* @module UTIL
|
||||
* Creates a new object with the same properties but different values using the given callback function. The function is called
|
||||
* for each property of the input object to provice a new value for the property.
|
||||
*
|
||||
* @example Increases the values of all properties.
|
||||
* <pre>
|
||||
* var r = _.mapObj({a: 1, b: 5, c: 2}, function(key, value) {
|
||||
* return value + 1;
|
||||
* });
|
||||
* // r is now {a: 2, b: 6, c: 2}
|
||||
* </pre>
|
||||
*
|
||||
* @param obj the object to use
|
||||
* @param callback The callback <code>function(key, value)</code> to invoke for each property.
|
||||
* <dl><dt>key</dt><dd>The name of the current property.</dd>
|
||||
* <dt>value</dt><dd>The value of the current property.</dd>
|
||||
* <dt class="this">this</dt><dd>The given context. If not set, the object itself.</dd>
|
||||
* <dt class="returnValue">(callback return value)</dt><dd>This value will replace the original value in the new object.</dd></dl>
|
||||
* @param ctx optional a context to pass to the callback as 'this'.
|
||||
* @return the new object
|
||||
*
|
||||
* @see ##_.filterObj() filters an object.
|
||||
* @see ##map() maps a list.
|
||||
*/
|
||||
'mapObj': function(obj, mapFunc, ctx) {
|
||||
var result = {};
|
||||
eachObj(obj, function(key, value) {
|
||||
result[key] = mapFunc.call(ctx || obj, key, value);
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
/*$
|
||||
* @id filterobj
|
||||
* @group OBJECT
|
||||
* @requires
|
||||
* @configurable default
|
||||
* @name _.filterObj()
|
||||
* @syntax _.filterObj(obj, filterFunc)
|
||||
* @syntax _.filterObj(obj, filterFunc, ctx)
|
||||
* @module UTIL
|
||||
* Creates a new object that contains only those properties of the input object that have been approved by the filter function.
|
||||
*
|
||||
* If the callback function returns true, the property and its value are shallow-copied in the new object, otherwise it will be removed.
|
||||
*
|
||||
* @example Removing all values over 10 from an object:
|
||||
* <pre>
|
||||
* var list = _.filterObj({a: 4, b: 22, c: 7, d: 2, e: 19}, function(key, value) {
|
||||
* return value <= 10;
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param obj the object to use
|
||||
* @param callback The callback <code>function(key, value)</code> to invoke for each property.
|
||||
* <dl><dt>key</dt><dd>The name of the current property.</dd>
|
||||
* <dt>value</dt><dd>The value of the current property.</dd>
|
||||
* <dt class="this">this</dt><dd>The given context. If not set, the object itself.</dd>
|
||||
* <dt class="returnValue">(callback return value)</dt><dd><var>true</var> to include the property in the new object, <var>false</var> to omit it.</dd></dl>
|
||||
* @param ctx optional a context to pass to the callback as 'this'.
|
||||
* @return the new object
|
||||
*
|
||||
* @see ##_.mapObj() can be used to modify the values og an object.
|
||||
*/
|
||||
'filterObj': function(obj, f, ctx) {
|
||||
var r = {};
|
||||
eachObj(obj, function(key, value) {
|
||||
if (f.call(ctx || obj, key, value))
|
||||
r[key] = value;
|
||||
});
|
||||
return r;
|
||||
},
|
||||
|
||||
/*$
|
||||
* @id isobject
|
||||
* @group TYPE
|
||||
|
||||
Reference in New Issue
Block a user