Merge remote-tracking branch 'upstream/main'

This commit is contained in:
2026-08-26 09:31:34 +08:00
parent 9b8c4bfab6
commit 394eb0285d
34137 changed files with 3589424 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013 Dustin Diaz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+2
View File
@@ -0,0 +1,2 @@
boosh:
node make/build.js
+61
View File
@@ -0,0 +1,61 @@
## domReady
It's easy. Works like this:
``` js
domready(function () {
// dom is loaded!
})
```
-------------------------
## Deprecation Notice
Compatibility with `IE6`, `IE7`, and `IE8` has been fully dropped. If your application requires this level of support, please use the [`0.3.0`](https://github.com/ded/domready/tree/v0.3.0) release.
-------------------------
### Browser support
* IE9+
* Firefox 4+
* Safari 3+
* Chrome *
* Opera *
### Building
``` sh
npm install
make
open tests/test.html
```
### Including with Ender
Don't already have [Ender](http://enderjs.com)? Install it like this:
``` sh
npm install ender -g
```
Include domready in your package:
``` sh
ender add domready
```
Then use it like this
``` js
require('domready')(function () {
$('body').html('<p>boosh</p>')
})
// or
$(document).ready(function () {
$('body').html('<p>boosh</p>')
})
```
+19
View File
@@ -0,0 +1,19 @@
{
"name": "domready",
"repo": "ded/domready",
"description": "modern domready",
"version": "1.0.3",
"homepage": "https://github.com/ded/domready",
"author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)",
"keywords": [
"domready",
"dom"
],
"dependencies": {},
"development": {},
"license": "MIT",
"main": "ready.js",
"scripts": [
"ready.js"
]
}
+24
View File
@@ -0,0 +1,24 @@
require('smoosh').config({
"JAVASCRIPT": {
"DIST_DIR": "./"
, "ready": ['./src/ready.js']
}
, "JSHINT_OPTS": {
"boss": true
, "forin": false
, "curly": false
, "debug": false
, "devel": false
, "evil": false
, "regexp": false
, "undef": false
, "sub": true
, "white": false
, "indent": 2
, "asi": true
, "laxbreak": true
, "eqeqeq": false
, "eqnull": true
, "laxcomma": true
}
}).run().build().analyze()
+21
View File
@@ -0,0 +1,21 @@
{
"name": "domready",
"description": "modern domready",
"version": "1.0.8",
"homepage": "https://github.com/ded/domready",
"author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)",
"keywords": [
"ender",
"domready",
"dom"
],
"main": "./ready.js",
"ender": "./src/ender.js",
"repository": {
"type": "git",
"url": "https://github.com/ded/domready.git"
},
"devDependencies": {
"smoosh": ">=0.3.0"
}
}
+30
View File
@@ -0,0 +1,30 @@
/*!
* domready (c) Dustin Diaz 2014 - License MIT
*/
!function (name, definition) {
if (typeof module != 'undefined') module.exports = definition()
else if (typeof define == 'function' && typeof define.amd == 'object') define(definition)
else this[name] = definition()
}('domready', function () {
var fns = [], listener
, doc = document
, hack = doc.documentElement.doScroll
, domContentLoaded = 'DOMContentLoaded'
, loaded = (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState)
if (!loaded)
doc.addEventListener(domContentLoaded, listener = function () {
doc.removeEventListener(domContentLoaded, listener)
loaded = 1
while (listener = fns.shift()) listener()
})
return function (fn) {
loaded ? setTimeout(fn, 0) : fns.push(fn)
}
});
+4
View File
@@ -0,0 +1,4 @@
/*!
* domready (c) Dustin Diaz 2014 - License MIT
*/
!function(e,t){typeof module!="undefined"?module.exports=t():typeof define=="function"&&typeof define.amd=="object"?define(t):this[e]=t()}("domready",function(){var e=[],t,n=document,r=n.documentElement.doScroll,i="DOMContentLoaded",s=(r?/^loaded|^c/:/^loaded|^i|^c/).test(n.readyState);return s||n.addEventListener(i,t=function(){n.removeEventListener(i,t),s=1;while(t=e.shift())t()}),function(t){s?setTimeout(t,0):e.push(t)}})
+10
View File
@@ -0,0 +1,10 @@
!function ($) {
var ready = require('domready')
$.ender({domReady: ready})
$.ender({
ready: function (f) {
ready(f)
return this
}
}, true)
}(ender);
+30
View File
@@ -0,0 +1,30 @@
/*!
* domready (c) Dustin Diaz 2014 - License MIT
*/
!function (name, definition) {
if (typeof module != 'undefined') module.exports = definition()
else if (typeof define == 'function' && typeof define.amd == 'object') define(definition)
else this[name] = definition()
}('domready', function () {
var fns = [], listener
, doc = document
, hack = doc.documentElement.doScroll
, domContentLoaded = 'DOMContentLoaded'
, loaded = (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState)
if (!loaded)
doc.addEventListener(domContentLoaded, listener = function () {
doc.removeEventListener(domContentLoaded, listener)
loaded = 1
while (listener = fns.shift()) listener()
})
return function (fn) {
loaded ? setTimeout(fn, 0) : fns.push(fn)
}
});
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>domReady test</title>
<script src="../src/ready.js"></script>
<script type="text/javascript">
domready(function () {
document.getElementById('title').innerHTML = 'domready'
domready(function () {
document.getElementById('title').innerHTML += '✓'
})
})
</script>
</head>
<body>
<h1 id="title"></h1>
</body>
</html>