root / trunk / web / dojo / dojox / help / console.js @ 12
History | View | Annotate | Download (1.48 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.help.console"]){ |
||
9 | dojo._hasResource["dojox.help.console"]=true; |
||
10 | dojo.provide("dojox.help.console");
|
||
11 | dojo.require("dojox.help._base");
|
||
12 | dojo.mixin(dojox.help,{_plainText:function(_1){ |
||
13 | return _1.replace(/(<[^>]*>|&[^;]{2,6};)/g,""); |
||
14 | },_displayLocated:function(_2){ |
||
15 | var _3={};
|
||
16 | dojo.forEach(_2,function(_4){
|
||
17 | _3[_4[0]]=dojo.isMoz?{toString:function(){ |
||
18 | return "Click to view"; |
||
19 | },item:_4[1]}:_4[1]; |
||
20 | }); |
||
21 | },_displayHelp:function(_5,_6){ |
||
22 | if(_5){
|
||
23 | var _7="Help for: "+_6.name; |
||
24 | var _8=""; |
||
25 | for(var i=0;i<_7.length;i++){ |
||
26 | _8+="=";
|
||
27 | } |
||
28 | }else{
|
||
29 | if(!_6){
|
||
30 | }else{
|
||
31 | var _9=false; |
||
32 | for(var _a in _6){ |
||
33 | var _b=_6[_a];
|
||
34 | if(_a=="returns"&&_6.type!="Function"&&_6.type!="Constructor"){ |
||
35 | continue;
|
||
36 | } |
||
37 | if(_b&&(!dojo.isArray(_b)||_b.length)){
|
||
38 | _9=true;
|
||
39 | _b=dojo.isString(_b)?dojox.help._plainText(_b):_b; |
||
40 | if(_a=="returns"){ |
||
41 | var _c=dojo.map(_b.types||[],"return item.title;").join("|"); |
||
42 | if(_b.summary){
|
||
43 | if(_c){
|
||
44 | _c+=": ";
|
||
45 | } |
||
46 | _c+=dojox.help._plainText(_b.summary); |
||
47 | } |
||
48 | }else{
|
||
49 | if(_a=="parameters"){ |
||
50 | for(var j=0,_d;_d=_b[j];j++){ |
||
51 | var _e=dojo.map(_d.types,"return item.title").join("|"); |
||
52 | var _f=""; |
||
53 | if(_d.optional){
|
||
54 | _f+="Optional. ";
|
||
55 | } |
||
56 | if(_d.repating){
|
||
57 | _f+="Repeating. ";
|
||
58 | } |
||
59 | _f+=dojox.help._plainText(_d.summary); |
||
60 | if(_f){
|
||
61 | _f=" - "+_f;
|
||
62 | for(var k=0;k<_d.name.length;k++){ |
||
63 | _f=" "+_f;
|
||
64 | } |
||
65 | } |
||
66 | } |
||
67 | }else{
|
||
68 | } |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 | if(!_9){
|
||
73 | } |
||
74 | } |
||
75 | } |
||
76 | }}); |
||
77 | dojox.help.init(); |
||
78 | } |