b0d698992f021effccaf740f2868cd9427d27e16
[jquery.git] / build / docs / js / doc.js
1 var types = {
2         jQuery: "A jQuery object.",
3         Object: "A simple Javascript object. For example, it could be a String or a Number.",
4         String: "A string of characters.",
5         Number: "A numeric valid.",
6         Element: "The Javascript object representation of a DOM Element.",
7         Map: "A Javascript object that contains key/value pairs in the form of properties and values.",
8         "Array<Element>": "An Array of DOM Elements.",
9         "Array<String>": "An Array of strings.",
10         Function: "A reference to a Javascript function.",
11         XMLHttpRequest: "An XMLHttpRequest object (referencing a HTTP request).",
12         "<Content>": "A String (to generate HTML on-the-fly), a DOM Element, an Array of DOM Elements or a jQuery object"
13 };
14
15 $(document).ready(function(){
16         var tooltips = $("span.tooltip").each(function() {
17                 var type = this.innerHTML;
18                 if( type.indexOf("|") != -1 ) {
19                         var $this = $(this).empty();
20                         $.each(type.split("\|"), function(i, n) {
21                                 var title = types[n] && " title=\"" + types[n] + "\"" || "";
22                                 var pipe = i != 0 ? "|" : "";
23                                 $this.append( pipe + "<span class=\"tooltip\" " + title + ">" + n + "</span>" );
24                         });
25                 } else if ( types[ this.innerHTML ] )
26                         this.title = types[ this.innerHTML ];
27         })
28         tooltips.add($("span.tooltip", tooltips)).ToolTipDemo('#fff');
29
30         $("a.name").click(function(){
31                 $("div.more,div.short",this.parentNode.parentNode).toggle();
32                 return false;
33         });
34         
35         $("#docs").alphaPager(function(a){
36                 return $.fn.text.apply( [a.getElementsByTagName("span")[2]] ).replace(/^\$\./,"").substr(0,1).toUpperCase();
37         });
38 });