first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

1
node_modules/jQuery/.npmignore generated vendored Normal file
View File

@ -0,0 +1 @@
/node_modules/

22
node_modules/jQuery/LICENSE-MIT generated vendored Normal file
View File

@ -0,0 +1,22 @@
Copyright (c) 2012 James Morrin
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.

53
node_modules/jQuery/README.md generated vendored Normal file
View File

@ -0,0 +1,53 @@
node-jQuery
====
A stupid-simple wrapper over jQuery for Node.JS (server). Currently 1.7.2.
Node.JS
---
npm install jQuery
var $ = require('jQuery');
Examples
---
$("<h1>test passes</h1>").appendTo("body");
console.log($("body").html());
In Node.JS you may also create separate window instances
var jsdom = require('jsdom').jsdom
, myWindow = jsdom().createWindow()
, $ = require('jQuery')
, jq = require('jQuery').create()
, jQuery = require('jQuery').create(myWindow)
;
$("<h1>test passes</h1>").appendTo("body");
console.log($("body").html());
jq("<h2>other test passes</h2>").appendTo("body");
console.log(jq("body").html());
jQuery("<h3>third test passes</h3>").appendTo("body");
console.log(jQuery("body").html());
Output:
<h1>test passes</h1>
<h2>other test passes</h2>
<h3>third test passes</h3>
JSONP Example
----
var $ = require('jQuery');
$.getJSON('http://twitter.com/status/user_timeline/treason.json?count=10&callback=?',function(data) {
console.log(data);
});

100
node_modules/jQuery/grunt.js generated vendored Normal file
View File

@ -0,0 +1,100 @@
module.exports = function(grunt) {
var exec = require('child_process').exec,
http = require('http'),
fs = require('fs'),
host = 'ajax.googleapis.com',
jqPath = '/ajax/libs/jquery/1.7.2/jquery.js';
grunt.registerTask('build', 'builds query module for us in nodje', function() {
var tmpDir = './tmp', distDir = './lib',
done = this.async(), wrapper;
function buildjQuery(jq) {
wrapper = fs.readFileSync('./src/wrapper.js', 'utf8');
wrapper = wrapper.replace('//JQUERY_SOURCE', jq);
fs.writeFileSync('./lib/node-jquery.js', wrapper);
done();
}
function writejQuery() {
var data = '',
req = http.request({
host: host,
port: 80,
path: jqPath,
method: 'GET'
}, function(res) {
res.setEncoding('utf8');
res.on('data', function(chunk) {
data += chunk;
});
res.on('end', function() {
fs.writeFileSync(tmpDir+'/jquery.js', data);
buildjQuery(data);
});
});
req.write('data\n');
req.write('data\n');
req.end();
}
function getjQuery() {
var jq = null;
try {
jq = fs.readFileSync(tmpDir+'/jquery.js', 'utf8');
buildjQuery(jq);
} catch (e) {
writejQuery();
}
}
exec('mkdir '+tmpDir+' && mkdir '+distDir, getjQuery);
});
grunt.registerTask('clean', 'removes dist and tmp directories', function() {
var done = this.async();
exec('rm -rf ./tmp && rm -rf ./lib', function() {
done();
});
});
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
test: {
files: ['test/*.js']
},
lint: {
files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
},
watch: {
files: '<config:lint.files>',
tasks: 'default'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true
},
globals: {
exports: true
}
}
});
// Default task.
grunt.registerTask('default', 'build test');
};

9437
node_modules/jQuery/lib/node-jquery.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

47
node_modules/jQuery/package.json generated vendored Normal file
View File

@ -0,0 +1,47 @@
{
"name": "jQuery",
"description": "jQuery: The Write Less, Do More, JavaScript Library (packaged for Node.JS)",
"version": "1.7.4",
"url": "http://jquery.com",
"homepage": "https://github.com/coolaj86/node-jquery",
"author": {
"name": "James Morrin",
"email": "treasonx@gmail.com"
},
"repository": {
"type": "git",
"url": "git://github.com/coolaj86/node-jquery.git"
},
"bugs": {
"url": "https://github.com/coolaj86/node-jquery/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/coolaj86/node-jquery/blob/master/LICENSE-MIT"
}
],
"main": "lib/node-jquery",
"engines": {
"node": ">=0.6"
},
"scripts": {
"test": "grunt test"
},
"__dependencies": {
"jsdom": "~0.2.14",
"htmlparser": "1.7.6",
"xmlhttprequest": "~1.4.2",
"location": "0.0.1",
"navigator": "~1.0.1"
},
"__devDependencies": {
"grunt": "~0.3.8",
"nodeunit": "~0.7.4"
},
"keywords": [
"util",
"dom",
"jquery"
]
}

33
node_modules/jQuery/src/wrapper.js generated vendored Normal file
View File

@ -0,0 +1,33 @@
(function () {
function create(window) {
if(window == null ) {
window = require('jsdom').jsdom().createWindow();
// assume window is a jsdom instance...
// jsdom includes an incomplete version of XMLHttpRequest
window.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
// trick jQuery into thinking CORS is supported (should be in node-XMLHttpRequest)
window.XMLHttpRequest.prototype.withCredentials = false;
if(window.location == null) {
window.location = require('location');
}
if(window.navigator == null) {
window.navigator = require('navigator');
}
}
var location = window.location,
navigator = window.navigator,
XMLHttpRequest = window.XMLHttpRequest;
//JQUERY_SOURCE
window.jQuery.noConflict();
return window.jQuery;
}
module.exports = create('undefined' === typeof window ? undefined : window);
module.exports.create = create;
}());

1007
node_modules/jQuery/test/core.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

124
node_modules/jQuery/test/css.js generated vendored Normal file
View File

@ -0,0 +1,124 @@
var testCase = require('nodeunit').testCase,
static_document = require('fs').readFileSync('test/fixtures/css.html', 'utf8');
// need to be global as helpers access these variables
window = document = jQuery = $ = null;
var helpers = require('./helpers/helper'),
q = helpers.query_ids;
module.exports = testCase({
setUp: function (callback) {
jQuery = $ = helpers.recreate_doc(static_document);
callback();
},
tearDown: function (callback) {
// clean up
callback();
},
"css(String|Hash)": function(test) {
test.expect(18);
//test.equals( jQuery('#main').css("display"), 'block', 'Check for css property "display"');
test.ok( jQuery('#nothiddendiv').is(':visible'), 'Modifying CSS display: Assert element is visible');
jQuery('#nothiddendiv').css({display: 'none'});
test.ok( !jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is hidden');
jQuery('#nothiddendiv').css({display: 'block'});
test.ok( jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is visible');
var div = jQuery( "<div>" );
// These should be "auto" (or some better value)
// temporarily provide "0px" for backwards compat
test.equals( div.css("width"), "0px", "Width on disconnected node." );
test.equals( div.css("height"), "0px", "Height on disconnected node." );
div.css({ width: 4, height: 4 });
test.equals( div.css("width"), "4px", "Width on disconnected node." );
test.equals( div.css("height"), "4px", "Height on disconnected node." );
var div2 = jQuery( "<div style='display:none;'><input type='text' style='height:20px;'/><textarea style='height:20px;'/><div style='height:20px;'></div></div>").appendTo("body");
test.equals( div2.find("input").css("height"), "20px", "Height on hidden input." );
test.equals( div2.find("textarea").css("height"), "20px", "Height on hidden textarea." );
test.equals( div2.find("div").css("height"), "20px", "Height on hidden textarea." );
div2.remove();
// handle negative numbers by ignoring #1599, #4216
jQuery('#nothiddendiv').css({ 'width': 1, 'height': 1 });
var width = parseFloat(jQuery('#nothiddendiv').css('width')), height = parseFloat(jQuery('#nothiddendiv').css('height'));
jQuery('#nothiddendiv').css({ width: -1, height: -1 });
//test.equals( parseFloat(jQuery('#nothiddendiv').css('width')), width, 'Test negative width ignored')
//test.equals( parseFloat(jQuery('#nothiddendiv').css('height')), height, 'Test negative height ignored')
test.equals( jQuery('<div style="display: none;">').css('display'), 'none', 'Styles on disconnected nodes');
//jQuery('#floatTest').css('float', 'right');
//test.equals( jQuery('#floatTest').css('float'), 'right', 'Modified CSS float using "float": Assert float is right');
//jQuery('#floatTest').css({'font-size': '30px'});
//test.equals( jQuery('#floatTest').css('font-size'), '30px', 'Modified CSS font-size: Assert font-size is 30px');
/*jQuery.each("0,0.25,0.5,0.75,1".split(','), function(i, n) {
jQuery('#foo').css({opacity: n});
test.equals( jQuery('#foo').css('opacity'), parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a String" );
jQuery('#foo').css({opacity: parseFloat(n)});
test.equals( jQuery('#foo').css('opacity'), parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a Number" );
});*/
jQuery('#foo').css({opacity: ''});
test.equals( jQuery('#foo').css('opacity'), '1', "Assert opacity is 1 when set to an empty String" );
//test.equals( jQuery('#empty').css('opacity'), '0', "Assert opacity is accessible via filter property set in stylesheet in IE" );
//jQuery('#empty').css({ opacity: '1' });
//test.equals( jQuery('#empty').css('opacity'), '1', "Assert opacity is taken from style attribute when set vs stylesheet in IE with filters" );
var div = jQuery('#nothiddendiv'), child = jQuery('#nothiddendivchild');
//test.equals( parseInt(div.css("fontSize")), 16, "Verify fontSize px set." );
//test.equals( parseInt(div.css("font-size")), 16, "Verify fontSize px set." );
//test.equals( parseInt(child.css("fontSize")), 16, "Verify fontSize px set." );
//test.equals( parseInt(child.css("font-size")), 16, "Verify fontSize px set." );
child.css("height", "100%");
test.equals( child[0].style.height, "100%", "Make sure the height is being set correctly." );
child.attr("class", "em");
//test.equals( parseInt(child.css("fontSize")), 32, "Verify fontSize em set." );
// Have to verify this as the result depends upon the browser's CSS
// support for font-size percentages
child.attr("class", "prct");
var prctval = parseInt(child.css("fontSize")), checkval = 0;
if ( prctval === 16 || prctval === 24 ) {
checkval = prctval;
}
//test.equals( prctval, checkval, "Verify fontSize % set." );
test.equals( typeof child.css("width"), "string", "Make sure that a string width is returned from css('width')." );
var old = child[0].style.height;
// Test NaN
child.css("height", parseFloat("zoo"));
test.equals( child[0].style.height, old, "Make sure height isn't changed on NaN." );
// Test null
child.css("height", null);
test.equals( child[0].style.height, old, "Make sure height isn't changed on null." );
old = child[0].style.fontSize;
// Test NaN
child.css("font-size", parseFloat("zoo"));
test.equals( child[0].style.fontSize, old, "Make sure font-size isn't changed on NaN." );
// Test null
child.css("font-size", null);
test.equals( child[0].style.fontSize, old, "Make sure font-size isn't changed on null." );
test.done();
}
});

31
node_modules/jQuery/test/fixtures/core.html generated vendored Normal file
View File

@ -0,0 +1,31 @@
<html>
<head>
<title>jQuery Test Suite</title>
</head>
<body>
<div id="main">
<p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
<p id="ap">
Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
<a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>:
<a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
</p>
<div id="foo">
<p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
<p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
<p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
</div>
<p id="first">Try them out:</p>
<form id="form" action="formaction">
<input id="input1" name="PWD" type="password" value="" />
<input id="input2" name="T1" type="text" />
</form>
<item jid="2345" subscription="both" name="test val" gr:t="B" gr:w="41" gr:mc="161" gr:emc="2"/>
</div>
</body>
</html>

3
node_modules/jQuery/test/fixtures/css.css generated vendored Normal file
View File

@ -0,0 +1,3 @@
#nothiddendiv { font-size: 16px; }
#nothiddendivchild.em { font-size: 2em; }
#nothiddendivchild.prct { font-size: 150%; }

42
node_modules/jQuery/test/fixtures/css.html generated vendored Normal file
View File

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<title>jQuery Test Suite</title>
<style type="text/css" media="screen">
#nothiddendiv { font-size: 16px; }
#nothiddendivchild.em { font-size: 2em; }
#nothiddendivchild.prct { font-size: 150%; }
</style>
</head>
<body id="body">
<!-- Test HTML -->
<div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
<div id="nothiddendivchild"></div>
</div>
<div id="main">
<p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
<p id="ap">
Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
<a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>:
<a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
</p>
<div id="foo">
<p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
<p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
<p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
</div>
<p id="first">Try them out:</p>
<form id="form" action="formaction">
<input name="PWD" type="password" value="" />
<input name="T1" type="text" />
</form>
</div>
</body>
</html>

24
node_modules/jQuery/test/helpers/helper.js generated vendored Normal file
View File

@ -0,0 +1,24 @@
/**
* Returns an array of elements with the given IDs, eg.
* @example q("main", "foo", "bar")
* @result [<div id="main">, <span id="foo">, <input id="bar">]
*/
var query_ids = function() {
var r = [];
for ( var i = 0; i < arguments.length; i++ ) {
r.push( document.getElementById( arguments[i] ) );
}
return r;
};
var recreate_doc = function(html) {
document = require('jsdom').jsdom(html);
window = document.createWindow();
return require(process.cwd() + '/lib/node-jquery').create(window);
};
exports.query_ids = query_ids;
exports.recreate_doc = recreate_doc;

9404
node_modules/jQuery/tmp/jquery.js generated vendored Normal file

File diff suppressed because it is too large Load Diff