Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / HelpSource / Overviews / Methods.html
blobb97acf814a86a4abd43c11a104673ab4bc11ab28
1 <html>
2 <head>
3 <title>Methods</title>
4 <link rel='stylesheet' href='../scdoc.css' type='text/css' />
5 <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
6 <script src="../docmap.js" type="text/javascript"></script>
7 <script src="../scdoc.js" type="text/javascript"></script>
8 <style>
9 .method_item {
10 margin-top: 1em;
13 .method_doc {
14 margin-bottom: 0.2em;
15 margin-left: 2em;
17 div.met_subclasses {
18 font-size: 9pt;
19 color: #777;
20 margin-left: 3em;
21 text-align: left;
23 div.met_subclasses a {
24 color: #444;
26 div.met_subclasses a.seemore {
27 margin-left: 0.2em;
28 color: #558;
31 .method_name {
32 font-family: Andale Mono, monospace;
33 font-size: 9.5pt;
35 #method_note {
36 font-size: 9pt;
37 color: #777;
38 border-top: 1px solid #ddd;
39 text-align: center;
40 margin-top: 2em;
42 #total_count {
43 font-size: 9pt;
44 color: #777;
46 .searchlink {
47 background: #eed;
48 text-align: center;
49 font-size: 9pt;
50 padding: 0.25em;
51 margin: 0.25em 0;
53 </style>
54 <noscript>
55 <p>The method index needs JavaScript.
56 </noscript>
58 <script type="text/javascript">
59 var methods;
60 var subclassCache = {};
62 function buildMethodList() {
63 methods = {};
64 for(var k in docmap) {
65 var doc = docmap[k];
66 var mets = doc.methods;
67 if(mets) {
68 for(var j=0;j<mets.length;j++) {
69 var m = mets[j];
70 var mname = m.slice(2);
71 var pfx = m[1];
72 var undoc = m[0]=="?";
73 if(!methods.hasOwnProperty(mname))
74 methods[mname] = [];
75 methods[mname].push({doc:doc,pfx:pfx,undoc:undoc});
80 function getSubClasses(doc) {
81 var a = [];
82 if(doc.subclasses) {
83 for(var i=0;i<doc.subclasses.length;i++) {
84 var x = doc.subclasses[i];
85 var v = docmap["Classes/"+x];
86 a.push(x);
87 if(v)
88 a = a.concat(getSubClasses(v));
91 return a;
94 function showMethod(mname, node) {
95 var div = document.createElement("div");
96 div.className = "method_item";
97 var x = document.createElement("div");
98 x.className = "method_name";
99 x.appendChild(document.createTextNode(mname));
100 div.appendChild(x);
102 var x = methods[mname].sort(function(a,b) {
103 a = a.pfx + a.doc.title;
104 b = b.pfx + b.doc.title;
105 if(a<b) return -1;
106 else
107 if(a>b) return +1;
108 else
109 return 0;
112 for(var i=0;i<x.length;i++) {
113 var m = x[i];
114 var v = m.doc;
116 var div2 = document.createElement("div");
117 div2.className = "method_doc";
118 div.appendChild(div2);
120 var p = m.pfx;
121 if(p==".") p=" ";
122 div2.appendChild(document.createTextNode(p+" "));
123 var a = document.createElement("a");
124 a.setAttribute("href",helpRoot+"/"+v.path+".html#"+m.pfx+mname);
125 a.innerHTML = v.title;
126 if(m.undoc)
127 a.className = "undoc";
128 div2.appendChild(a);
129 div2.appendChild(document.createTextNode(" - "+v.summary+" "));
130 var n = document.createElement("span");
131 n.className = "soft";
132 var res = "["+v.path.split("/")[0];
133 if(v.installed=="extension")
134 res += " +";
135 else if(v.installed=="missing")
136 res += " - missing!";
137 n.innerHTML = res+"]";
138 div2.appendChild(n);
140 if(v.path=="Classes/Object") {
141 var n = document.createElement("div");
142 n.className = "met_subclasses";
143 n.appendChild(document.createTextNode("Inherited by: All classes"));
144 div2.appendChild(n);
145 } else {
146 if(v.subclasses && v.subclasses.length>0) {
147 var n;
148 if(subclassCache[v.path]) {
149 n = subclassCache[v.path].cloneNode(true);
150 } else {
151 var subs = getSubClasses(v);
152 n = document.createElement("div");
153 var m = n;
154 n.className = "met_subclasses";
155 n.appendChild(document.createTextNode("Inherited by: "));
156 for(var j=0;j<subs.length;j++) {
157 var a = document.createElement("a");
158 a.setAttribute("href", helpRoot+"/Classes/"+subs[j]+".html");
159 if(j==10 && subs.length > 14) {
160 m = document.createElement("span");
161 m.className = "hiddenspan";
162 m.style.display = "none";
163 n.appendChild(m);
164 var a2 = document.createElement("a");
165 a2.setAttribute("href","#");
166 a2.className = "seemore";
167 a2.innerHTML = "&hellip; see "+(subs.length-10)+" more";
168 n.appendChild(document.createTextNode(" "));
169 n.appendChild(a2);
171 if(j>0)
172 m.appendChild(document.createTextNode(", "));
173 a.innerHTML = subs[j];
174 m.appendChild(a);
176 subclassCache[v.path] = n;
178 (function() {
179 var a = n.getElementsByClassName("seemore")[0];
180 if(a) {
181 var m = n.getElementsByClassName("hiddenspan")[0];
182 a.onclick = function() {
183 m.style.display = "";
184 a.parentNode.removeChild(a);
185 return false;
188 })();
189 div2.appendChild(n);
194 node.appendChild(div);
197 function did_load() {
198 var hash = unescape(window.location.hash.slice(1));
200 helpRoot=".."; fixTOC();
202 buildMethodList();
204 showmethods();
207 function showmethods() {
208 var hash = unescape(window.location.hash.slice(1));
209 var res = document.getElementById("methods");
210 res.innerHTML = "";
212 var section = undefined;
213 if(/^section_/.test(hash))
214 section = hash[8];
215 else if(hash) {
216 var div = document.createElement("p");
217 div.className = "searchlink";
218 div.appendChild(document.createTextNode("Do you want to "));
219 var a = document.createElement("a");
220 a.setAttribute("href","../Search.html#"+hash);
221 a.appendChild(document.createTextNode("search for '"+hash+"'"));
222 div.appendChild(a);
223 div.appendChild(document.createTextNode(" instead?"));
224 res.appendChild(div);
225 document.getElementById("total_count").innerHTML = "Showing single method:";
226 document.getElementById("method_note").innerHTML = "";
227 if(methods[hash]) {
228 showMethod(hash,res);
229 return;
231 var div = document.createElement("p");
232 div.appendChild(document.createTextNode("Method not found: "+hash));
233 res.appendChild(div);
234 window.location = "../Search.html#"+hash;
235 return;
238 var cap = undefined;
239 var div = document.createElement("p");
240 div.className = "jump";
241 div.innerHTML = "Show section: ";
243 var mets = [];
244 for(var k in methods) {
245 mets.push(k);
247 mets = mets.sort();
249 for(var i=0;i<mets.length;i++) {
250 var k = mets[i];
251 if(cap != k[0]) {
252 cap = k[0];
253 if(section == undefined)
254 section = cap;
255 var a = document.createElement("a");
256 a.setAttribute("href","#section_"+cap);
257 a.innerHTML=cap.toUpperCase();
258 div.appendChild(a);
259 div.appendChild(document.createTextNode(" "));
262 res.appendChild(div);
264 var x = document.createElement("h2");
265 x.innerHTML = section.toUpperCase();
266 res.appendChild(x);
268 var count = 0;
269 for(var i = 0; i<mets.length;i++) {
270 var k = mets[i];
271 if(k[0]==section) {
272 showMethod(k, res);
273 count++;
276 document.getElementById("total_count").innerHTML = count + " methods (" + mets.length + " total)";
279 window.onhashchange = showmethods;
280 </script>
282 </head>
283 <ul id="menubar"></ul>
285 <body onload="did_load()">
286 <div class='contents'>
287 <div class='header'>
288 <div id='label'>SuperCollider OVERVIEWS</div>
289 <h1>Methods</h1>
290 <div id='summary'>Alphabetical index of all methods</div>
291 </div>
292 <div id="total_count"></div>
293 <div id='methods'>
294 Generating method index, please wait...
295 </div>
296 <div id='method_note'>
297 You can show a specific method by appending '#NAME' to this page url, where NAME is the name of the method.
298 </div>
299 </div>
300 </body>
301 </html>