lanvige/requirejs
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
<!DOCTYPE html>
<html>
<head>
<title>Contributing to RequireJS</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2Fmain.css">
<link rel="icon" type="image/x-icon" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Ffavicon.png">
<!--[if IE]> <link rel="stylesheet" type="text/css" href="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2Fie.css" /> <![endif]-->
<link rel="stylesheet" type="text/css" href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://ajax.usesos.com/ajax/libs/dojo/1.4/dojox/highlight/resources/highlight.css" rel="nofollow">http://ajax.usesos.com/ajax/libs/dojo/1.4/dojox/highlight/resources/highlight.css">
<script type="text/javascript" src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://ajax.usesos.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script" rel="nofollow">http://ajax.usesos.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2Finit.js"></script>
<script src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://ajax.usesos.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"></script" rel="nofollow">http://ajax.usesos.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"></script>
<script type="text/javascript">
dojo.require("dojox.highlight");
dojo.require("dojox.highlight.languages.javascript");
dojo.require("dojox.highlight.languages.html");
dojo.ready(function() {
dojo.query("pre > code")
.forEach(function(node) {
if (node.innerHTML.indexOf("DOCTYPE") !== -1 || node.innerHTML.indexOf('<script') !== -1) {
dojo.addClass(node, "html");
} else {
dojo.addClass(node, "javascript");
}
})
.forEach(dojox.highlight.init);
});
</script>
</head>
<body>
<div id="grid"></div>
<div id="wrapper">
<div id="navBg"></div>
<div id="nav" class="mono">
<a class="homeImageLink" href="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2F"></a>
<h1>a javascript module loader</h1>
<ul>
<li class="hbox">
<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F..%2F">主页</a>
<span class="spacer boxFlex"></span>
<span class="icon home"></span>
</li>
</ul>
<ul>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fstart.html">开始</a>
<span class="spacer boxFlex"></span>
<span class="icon start"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fdownload.html">下载</a>
<span class="spacer boxFlex"></span>
<span class="icon download"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fapi.html">API</a>
<span class="spacer boxFlex"></span>
<span class="icon api"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Foptimization.html">优化</a>
<span class="spacer boxFlex"></span>
<span class="icon optimize"></span>
</li>
</ul>
<ul>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fjquery.html">结合jQuery一起使用</a>
<span class="spacer boxFlex"></span>
<span class="icon script"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fnode.html">结合Node一起使用</a>
<span class="spacer boxFlex"></span>
<span class="icon script"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fdojo.html">结合Dojo一起使用</a>
<span class="spacer boxFlex"></span>
<span class="icon script"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fcommonjs.html">CommonJS备注</a>
<span class="spacer boxFlex"></span>
<span class="icon script"></span>
</li>
</ul>
<ul>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Ffaq.html">FAQs</a>
<span class="spacer boxFlex"></span>
<span class="icon question"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Ferrors.html">常见错误</a>
<span class="spacer boxFlex"></span>
<span class="icon question"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fplugins.html">写一个插件</a>
<span class="spacer boxFlex"></span>
<span class="icon api"></span>
</li>
</ul>
<ul>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fwhy.html">为什么需要Web模块化</a>
<span class="spacer boxFlex"></span>
<span class="icon question"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fwhyamd.html">为什么需要AMD</a>
<span class="spacer boxFlex"></span>
<span class="icon question"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Frequirements.html">需求</a>
<span class="spacer boxFlex"></span>
<span class="icon requirement"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fhistory.html">历史版本</a>
<span class="spacer boxFlex"></span>
<span class="icon history"></span>
</li>
</ul>
<ul>
<li class="hbox">
<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://groups.google.com/group/requirejs">需要帮助</a" rel="nofollow">http://groups.google.com/group/requirejs">需要帮助</a>
<span class="spacer boxFlex"></span>
<span class="icon help"></span>
</li>
<li class="hbox">
<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://tagneto.blogspot.com">作者博客</a" rel="nofollow">http://tagneto.blogspot.com">作者博客</a>
<span class="spacer boxFlex"></span>
<span class="icon blog"></span>
</li>
<li class="hbox">
<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://twitter.com/jrburke">Twitter</a" rel="nofollow">http://twitter.com/jrburke">Twitter</a>
<span class="spacer boxFlex"></span>
<span class="icon twitter"></span>
</li>
</ul>
<ul>
<li class="hbox">
<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://github.com/jrburke/requirejs">GitHub</a">http://github.com/jrburke/requirejs">GitHub</a>
<span class="spacer boxFlex"></span>
<span class="icon git"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fcontributing.html">贡献</a>
<span class="spacer boxFlex"></span>
<span class="icon fork"></span>
</li>
<li class="hbox">
<a class="local" href="proxy.php?url=https%3A%2F%2Fgithub.com%2Ftranslate.html">中文翻译</a>
<span class="spacer boxFlex"></span>
<span class="icon fork"></span>
</li>
</ul>
<ul>
<li class="version">1.0.3 文档</li>
</ul>
</div>
<div id="content"><div id="directory" class="section">
<h1>Contributing to RequireJS</h1>
<ul class="index mono">
<li class="hbox"><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%23whycla">Why a CLA?</a><span class="spacer boxFlex"></span><span class="sect">§ 1</span></li>
<li class="hbox"><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%23codestyle">Code style</a><span class="spacer boxFlex"></span><span class="sect">§ 2</span></li>
</ul>
<span class="note">Note: <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://github.com/jrburke/requirejs">The">http://github.com/jrburke/requirejs">The source for RequireJS is available on GitHub</a></span>
<p>For something that is bigger than a one or two line fix:</p>
<ol style="color:#222;">
<li><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://help.github.com/forking/">Create">http://help.github.com/forking/">Create your own fork of the code</a></li>
<li>Do the changes in your fork</li>
<li>If you like the change and think the project could use it:
<ol style="color:#222;list-style-type:disc;">
<li>Be sure you have followed <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%23codestyle">the code style for the project</a>.</li>
<li>Sign a <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://www.dojofoundation.org/about/cla/">Contributor" rel="nofollow">http://www.dojofoundation.org/about/cla/">Contributor License Agreement, CLA, with the Dojo Foundation</a> and send it to them.</li>
<li>Send a pull request indicating that you have a CLA on file.</li>
</ol></li>
</ol>
<p>For one or two line fixes, you can use the <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://github.com/jrburke/requirejs/issues">RequireJS">http://github.com/jrburke/requirejs/issues">RequireJS GitHub Issues page</a> to indicate the problem. You can also do the full fork/pull request as mentioned above, but a CLA is not needed for one or two line fixes.</p>
<p>For discussions on code changes/additions/requests use the <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://groups.google.com/group/requirejs">RequireJS" rel="nofollow">http://groups.google.com/group/requirejs">RequireJS Group</a>.</p>
</div>
<div class="section">
<h2><a name="#whycla">Why a CLA?</a><span class="sectionMark">§ 1</span></h2>
<p>CLAs are common with open source projects, with the Apache projects probably being the most well known. The goal is to allow RequireJS to be used in as many projects as possible, and for some companies, using only CLA-approved code is the best option.</p>
<p>You still own the copyright on your contribution, the CLA just gives the most flexibility for licensing, and assures the lineage of the intellectual property. You should only submit patches for your own intellectual property, and not the intellectual property of others.</p>
<p>Additional reading that may be helpful:</p>
<ul>
<li><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://en.wikipedia.org/wiki/Contributor_License_Agreement">Wikipedia" rel="nofollow">http://en.wikipedia.org/wiki/Contributor_License_Agreement">Wikipedia on CLAs</a></li>
</ul>
</div>
<div class="section">
<h2><a name="codestyle">Code Style</a><span class="sectionMark">§ 2</span></h2>
<p><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://jslint.com/">JSLint</a" rel="nofollow">http://jslint.com/">JSLint</a> is used for checking code style. It is also useful for avoiding some errors. The default settings on JSLint should be fine to use, in particular, 4 spaces for indentation, do not use tabs.</p>
<p>camelCase should be used for all variables and file names. Avoid the use of underscores as word separators. This extends to things like CSS class names, IDs in test HTML documents, everything.</p>
<p>Some exceptions to JSLint can be indicated at the top of each JS file, but they should be avoided when possible. Two common exceptions you may see in the source:</p>
<ul>
<li><strong>nomen: false</strong>, allow underscore at the beginning of some property/variable/function names.</li>
<li><strong>plusplus: false</strong>, but only to allow for loops with an incrementing ++ value. Other uses of ++ should be avoided.</li>
</ul>
</div>
</div>
<div id="footer" class="mono">
<span class="line">Latest Release: <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fdocs%2Fdownload.html">1.0.3</a></span>
<span class="line">Open source: <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://github.com/jrburke/requirejs/blob/master/LICENSE">new">https://github.com/jrburke/requirejs/blob/master/LICENSE">new BSD or MIT licensed</a></span>
<span class="line">web design by <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://andychung.ca">Andy" rel="nofollow">http://andychung.ca">Andy Chung</a> © 2011</span>
<span class="line">中文翻译<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"http://lanvige.com">ET" rel="nofollow">http://lanvige.com">ET Team</a> © 2012</span>
</div>
</div>
</body>
</html>