Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added to index page and added line number anchors

  • Loading branch information...
commit a69cfeea6316d42fddbe01653ee5faeaeb924760 1 parent f3bdd8b
@padolsey authored
View
2  app/jsapi/jsapi.js
@@ -126,7 +126,7 @@ JSAPI.Request.prototype = {
lineNumbers = '';
while (++line <= end) {
- lineNumbers += line + '\n';
+ lineNumbers += '<a id="L' + line + '" href="#L' + line + '">' + line + '</a>\n';
}
this.response.setHeader('Content-Type', 'text/html');
View
4 app/libs.json
@@ -17,7 +17,7 @@
"dom_env": true,
"default_version": "1.6.4",
"versions": ["1", "1.1", "1.2", "1.3", "1.3.2", "1.4", "1.5", "1.6", "1.6.2", "1.6.4", "git"],
- "get_real_version": "v(\\d+\\.\\d+\\.(?:\\d+|pre))",
+ "get_real_version": "v(\\d+\\.\\d+(?:\\.\\d+|pre))",
"look_in": ["jQuery.fn", "jQuery"],
"documentation": {
"^(?:jQuery|\\$)\\.fn\\.(.+)": "http://api.jquery.com/$1",
@@ -73,7 +73,7 @@
"url": "http://ajax.googleapis.com/ajax/libs/yui/{VERSION}/build/yui/yui.js",
"dom_env": true,
"default_version": "3.3.0",
- "versions": ["3.3.0"],
+ "versions": ["3", "3.3", "3.3.0"],
"get_real_version": "version: (\\d+\\.\\d+\\.\\d+)",
"look_in": ["YUI"]
},
View
27 assets/main.css
@@ -49,6 +49,15 @@ h1 {
border-top-right-radius: 15px;
}
+#index {
+ width: 700px;
+ margin: 0 auto;
+}
+
+#index h1, #index h2 {
+ margin: 10px 0;
+}
+
h1 a, h1 span {
padding: 15px;
display: block;
@@ -72,10 +81,28 @@ pre {
margin: 0;
}
+#index pre, #index p {
+ padding: .6em;
+ margin: 0;
+}
+
+#donate {
+ color: #FFF;
+ background: #CC1B1B;
+}
+
pre#lines code {
+}
+
+pre#lines a {
+ text-decoration: none;
color: #666;
}
+pre#lines a:hover {
+ color: #FFF;
+}
+
#desc {
background: #EEE;
padding: 15px;
View
BIN  favicon.ico
Binary file not shown
View
37 index.html
@@ -3,34 +3,49 @@
<meta charset="utf-8" />
<title>JS API info: jQuery, Dojo, Mootools &amp; more...</title>
<link rel="stylesheet" type="text/css" href="/assets/main.css" />
-<body>
+<body id="index">
<h1><span>JSAPI.info</span></h1>
<p>JSAPI.info is a JavaScript library/framework source inspector. It was made with jQuery in mind, but will work with other libraries. Libs are added/configured in <a href="https://github.com/jamespadolsey/jsapi-info/blob/master/app/libs.json">libs.json</a>.</p>
- <p>It's pretty simple. All it shows you is the source of the method you specify. It will also give you the correct line numbers so you can easily find it in the source.</p>
+ <p>It's pretty simple. All it shows you is the source code of the method you specify. It will also give you the correct line numbers alongside so you can easily locate it in the library source.</p>
- <p>Source @ <a href="https://github.com/jamespadolsey/jsapi-info">Github</a>.</p>
+ <h2>URL format</h2>
+
+ <pre>
+ /LIBRARY[/VERSION]/METHOD
+ </pre>
+
+ <p>The limitations are defined for each library in <a href="https://github.com/jamespadolsey/jsapi-info/blob/master/app/libs.json">libs.json</a> (<em>github pull requests welcome</em>). jQuery, for example, will look for the method-name you specify in <code>jQuery</code>, <code>jQuery.fn</code> and in <code>window</code>, so you can use "jQuery.fn.append", "fn.append", or just "append".</p>
- <p>Demos (URLs are HACKABLE!):</p>
+ <h2>Available libraries:</h2>
<ul>
- <li><a href="/jquery/ajax">/jquery/1.6/ajax</a></li>
- <li><a href="/jquery/1.6.4/extend">/jquery/1.6.4/extend</a></li>
- <li><a href="/jquery/$.fn.css">/jquery/$.fn.css</a></li>
- <li><a href="/mootools/flatten">/mootools/flatten</a></li>
- <li><a href="/dojo/1/Color">/dojo/1/Color</a></li>
- <li><a href="/_/every">/_/every</a> (alias for <a href="/underscore/every">/underscore/every</a>)</li>
+ <li>jquery (e.g. <a href="/jquery/css">/jquery/css</a>)</li>
+ <li>mootools (e.g. <a href="/mootools/flatten">/mootools/Array.prototype.flatten</a>)</li>
+ <li>dojo (e.g. <a href="/dojo/1/Color">/dojo/1/Color</a>)</li>
+ <li>underscore (e.g. <a href="/_/every">/_/every</a>)</li>
+ <li>yui (e.g. <a href="/yui/3/namespace">/yui/3/namespace</a>)</li>
</ul>
<h2>How does it work?</h2>
- <p>It works by loading the library you specify into an instance of <a href="https://github.com/tmpvar/jsdom">jsdom</a>, and then evaluating the method you specify (in fully qualified form, e.g. <code>jQuery.fn.css</code>) within that instance. It then matches the <code>toString()</code> representation of that function (thanks V8!!) against the source of the library, thus determining its location. It's all operating under node.js, running via a beautiful configuration of nginx (primed to microcache!).</p>
+ <p>It works by loading the library you specify into an instance of <a href="https://github.com/tmpvar/jsdom">jsdom</a>, and then evaluating the method you specify (in fully qualified form, e.g. <code>jQuery.fn.css</code>) within that instance. It then matches the <code>toString()</code> representation of that function (thanks V8!!) against the source of the library, thus determining its location. It's all operating under node.js, running via a beautiful configuration of nginx (primed to microcache!) on a <a href="http://www.linode.com/">linode</a> box somewhere in London.</p>
+ <p>Source @ <a href="https://github.com/jamespadolsey/jsapi-info">Github</a>.</p>
<p>Brought to you by @<a href="http://twitter.com/padolsey">padolsey</a>.</p>
+ <h2 id="donate">Donations</h2>
+
+ <p>This service doesn't require donations. But you should think about:</p>
+
+ <ul>
+ <li><a href="http://plan-international.org/what-you-can-do/sponsor-a-child/sponsor">Sponsoring a child with Plan International</a></li>
+ <li><a href="http://www.supportunicef.org">Supporting Unicef</a></li>
+ </ul>
+
<script>
var _gaq = [['_setAccount', 'UA-3768993-10'], ['_trackPageview']];
Please sign in to comment.
Something went wrong with that request. Please try again.