mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
91 lines
2.5 KiB
HTML
91 lines
2.5 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Underscore Test Suite</title>
|
|
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
|
<style>
|
|
iframe {
|
|
display: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="qunit"></div>
|
|
<div id="qunit-fixture">
|
|
<div id="map-test">
|
|
<div id="id1"></div>
|
|
<div id="id2"></div>
|
|
</div>
|
|
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
|
|
</div>
|
|
<script src="../vendor/jquery/jquery.js"></script>
|
|
<script src="../vendor/platform.js/platform.js"></script>
|
|
<script>
|
|
// avoid syntax errors for `QUnit.throws` in older Firefoxes
|
|
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
|
|
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
|
|
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
|
|
);
|
|
</script>
|
|
<script src="test-ui.js"></script>
|
|
<script>
|
|
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
|
</script>
|
|
<script>
|
|
if (!_.chain) {
|
|
_.mixin = function(object) {
|
|
_.forEach(_.functions(object), function(methodName) {
|
|
var func = _[methodName] = object[methodName];
|
|
_.prototype[methodName] = function() {
|
|
var args = [this.__wrapped__];
|
|
args.push.apply(args, arguments);
|
|
|
|
var result = func.apply(_, args);
|
|
if (this.__chain__) {
|
|
result = new _(result);
|
|
result.__chain__ = true;
|
|
}
|
|
return result;
|
|
};
|
|
});
|
|
};
|
|
|
|
_.mixin(_);
|
|
|
|
_.chain = function(value) {
|
|
value = new _(value);
|
|
value.__chain__ = true;
|
|
return value;
|
|
};
|
|
|
|
_.prototype.chain = function() {
|
|
this.__chain__ = true;
|
|
return this;
|
|
};
|
|
|
|
_.prototype.concat = _.wrap(_.prototype.concat, function(func) {
|
|
var result = func.apply(this, Array.prototype.slice.call(arguments, 1));
|
|
if (this.__chain__) {
|
|
result = new _(result);
|
|
result.__chain__ = true;
|
|
}
|
|
return result;
|
|
});
|
|
}
|
|
</script>
|
|
<script src="../vendor/underscore/test/collections.js"></script>
|
|
<script src="../vendor/underscore/test/arrays.js"></script>
|
|
<script src="../vendor/underscore/test/functions.js"></script>
|
|
<script src="../vendor/underscore/test/objects.js"></script>
|
|
<script src="../vendor/underscore/test/utility.js"></script>
|
|
<script src="../vendor/underscore/test/chaining.js"></script>
|
|
<script type="text/html" id="template">
|
|
<%
|
|
// a comment
|
|
if (data) { data += 12345; }; %>
|
|
<li><%= data %></li>
|
|
</script>
|
|
</body>
|
|
</html>
|