quentonc-jsdoc_helper 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. data/History.txt +13 -0
  2. data/README.rdoc +64 -0
  3. data/Rakefile +46 -0
  4. data/TODO.rdoc +5 -0
  5. data/bin/jsdoc_helper +8 -0
  6. data/ext/jsdoc-toolkit/README.txt +146 -0
  7. data/ext/jsdoc-toolkit/app/frame/Chain.js +102 -0
  8. data/ext/jsdoc-toolkit/app/frame/Dumper.js +144 -0
  9. data/ext/jsdoc-toolkit/app/frame/Hash.js +84 -0
  10. data/ext/jsdoc-toolkit/app/frame/Link.js +148 -0
  11. data/ext/jsdoc-toolkit/app/frame/Namespace.js +10 -0
  12. data/ext/jsdoc-toolkit/app/frame/Opt.js +134 -0
  13. data/ext/jsdoc-toolkit/app/frame/Reflection.js +26 -0
  14. data/ext/jsdoc-toolkit/app/frame/String.js +93 -0
  15. data/ext/jsdoc-toolkit/app/frame/Testrun.js +129 -0
  16. data/ext/jsdoc-toolkit/app/frame.js +33 -0
  17. data/ext/jsdoc-toolkit/app/handlers/FOODOC.js +26 -0
  18. data/ext/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +159 -0
  19. data/ext/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +16 -0
  20. data/ext/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +292 -0
  21. data/ext/jsdoc-toolkit/app/handlers/XMLDOC.js +26 -0
  22. data/ext/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +200 -0
  23. data/ext/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +294 -0
  24. data/ext/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +126 -0
  25. data/ext/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +109 -0
  26. data/ext/jsdoc-toolkit/app/lib/JSDOC/Lang.js +144 -0
  27. data/ext/jsdoc-toolkit/app/lib/JSDOC/Parser.js +107 -0
  28. data/ext/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +33 -0
  29. data/ext/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +643 -0
  30. data/ext/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +229 -0
  31. data/ext/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +41 -0
  32. data/ext/jsdoc-toolkit/app/lib/JSDOC/Token.js +18 -0
  33. data/ext/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +332 -0
  34. data/ext/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +133 -0
  35. data/ext/jsdoc-toolkit/app/lib/JSDOC/Util.js +32 -0
  36. data/ext/jsdoc-toolkit/app/lib/JSDOC/Walker.js +459 -0
  37. data/ext/jsdoc-toolkit/app/lib/JSDOC.js +101 -0
  38. data/ext/jsdoc-toolkit/app/main.js +111 -0
  39. data/ext/jsdoc-toolkit/app/plugins/commentSrcJson.js +20 -0
  40. data/ext/jsdoc-toolkit/app/plugins/frameworkPrototype.js +16 -0
  41. data/ext/jsdoc-toolkit/app/plugins/functionCall.js +10 -0
  42. data/ext/jsdoc-toolkit/app/plugins/publishSrcHilite.js +62 -0
  43. data/ext/jsdoc-toolkit/app/plugins/symbolLink.js +9 -0
  44. data/ext/jsdoc-toolkit/app/plugins/tagParamConfig.js +31 -0
  45. data/ext/jsdoc-toolkit/app/plugins/tagSynonyms.js +43 -0
  46. data/ext/jsdoc-toolkit/app/run.js +348 -0
  47. data/ext/jsdoc-toolkit/app/t/TestDoc.js +144 -0
  48. data/ext/jsdoc-toolkit/app/t/runner.js +13 -0
  49. data/ext/jsdoc-toolkit/app/test/addon.js +24 -0
  50. data/ext/jsdoc-toolkit/app/test/anon_inner.js +14 -0
  51. data/ext/jsdoc-toolkit/app/test/augments.js +31 -0
  52. data/ext/jsdoc-toolkit/app/test/augments2.js +26 -0
  53. data/ext/jsdoc-toolkit/app/test/borrows.js +41 -0
  54. data/ext/jsdoc-toolkit/app/test/borrows2.js +23 -0
  55. data/ext/jsdoc-toolkit/app/test/config.js +22 -0
  56. data/ext/jsdoc-toolkit/app/test/constructs.js +18 -0
  57. data/ext/jsdoc-toolkit/app/test/encoding.js +10 -0
  58. data/ext/jsdoc-toolkit/app/test/encoding_other.js +12 -0
  59. data/ext/jsdoc-toolkit/app/test/event.js +54 -0
  60. data/ext/jsdoc-toolkit/app/test/functions_anon.js +39 -0
  61. data/ext/jsdoc-toolkit/app/test/functions_nested.js +33 -0
  62. data/ext/jsdoc-toolkit/app/test/global.js +13 -0
  63. data/ext/jsdoc-toolkit/app/test/globals.js +25 -0
  64. data/ext/jsdoc-toolkit/app/test/ignore.js +10 -0
  65. data/ext/jsdoc-toolkit/app/test/inner.js +16 -0
  66. data/ext/jsdoc-toolkit/app/test/jsdoc_test.js +477 -0
  67. data/ext/jsdoc-toolkit/app/test/lend.js +33 -0
  68. data/ext/jsdoc-toolkit/app/test/memberof.js +19 -0
  69. data/ext/jsdoc-toolkit/app/test/memberof_constructor.js +17 -0
  70. data/ext/jsdoc-toolkit/app/test/name.js +19 -0
  71. data/ext/jsdoc-toolkit/app/test/namespace_nested.js +23 -0
  72. data/ext/jsdoc-toolkit/app/test/nocode.js +13 -0
  73. data/ext/jsdoc-toolkit/app/test/oblit_anon.js +20 -0
  74. data/ext/jsdoc-toolkit/app/test/overview.js +20 -0
  75. data/ext/jsdoc-toolkit/app/test/param_inline.js +37 -0
  76. data/ext/jsdoc-toolkit/app/test/params_optional.js +8 -0
  77. data/ext/jsdoc-toolkit/app/test/prototype.js +17 -0
  78. data/ext/jsdoc-toolkit/app/test/prototype_nested.js +9 -0
  79. data/ext/jsdoc-toolkit/app/test/prototype_oblit.js +13 -0
  80. data/ext/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +24 -0
  81. data/ext/jsdoc-toolkit/app/test/public.js +10 -0
  82. data/ext/jsdoc-toolkit/app/test/shared.js +42 -0
  83. data/ext/jsdoc-toolkit/app/test/shared2.js +2 -0
  84. data/ext/jsdoc-toolkit/app/test/shortcuts.js +22 -0
  85. data/ext/jsdoc-toolkit/app/test/static_this.js +13 -0
  86. data/ext/jsdoc-toolkit/app/test/synonyms.js +31 -0
  87. data/ext/jsdoc-toolkit/app/test/tosource.js +23 -0
  88. data/ext/jsdoc-toolkit/app/test/variable_redefine.js +14 -0
  89. data/ext/jsdoc-toolkit/app/test.js +307 -0
  90. data/ext/jsdoc-toolkit/changes.txt +75 -0
  91. data/ext/jsdoc-toolkit/conf/sample.conf +31 -0
  92. data/ext/jsdoc-toolkit/java/build.xml +36 -0
  93. data/ext/jsdoc-toolkit/java/build_1.4.xml +36 -0
  94. data/ext/jsdoc-toolkit/java/classes/js.jar +0 -0
  95. data/ext/jsdoc-toolkit/java/src/JsDebugRun.java +21 -0
  96. data/ext/jsdoc-toolkit/java/src/JsRun.java +21 -0
  97. data/ext/jsdoc-toolkit/jsdebug.jar +0 -0
  98. data/ext/jsdoc-toolkit/jsrun.jar +0 -0
  99. data/ext/jsdoc-toolkit/out/jsdoc/files.html +216 -0
  100. data/ext/jsdoc-toolkit/out/jsdoc/index.html +210 -0
  101. data/ext/jsdoc-toolkit/out/jsdoc/symbols/_global_.html +306 -0
  102. data/ext/jsdoc-toolkit/out/jsdoc/symbols/src/lib_test.js.html +13 -0
  103. data/ext/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +17 -0
  104. data/ext/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +56 -0
  105. data/ext/jsdoc-toolkit/templates/jsdoc/class.tmpl +646 -0
  106. data/ext/jsdoc-toolkit/templates/jsdoc/index.tmpl +39 -0
  107. data/ext/jsdoc-toolkit/templates/jsdoc/publish.js +184 -0
  108. data/ext/jsdoc-toolkit/templates/jsdoc/static/default.css +162 -0
  109. data/ext/jsdoc-toolkit/templates/jsdoc/static/header.html +2 -0
  110. data/ext/jsdoc-toolkit/templates/jsdoc/static/index.html +19 -0
  111. data/ext/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +35 -0
  112. data/features/doing_rake_jsdoc.feature +74 -0
  113. data/features/step_definitions/jsdoc_helper_steps.rb +48 -0
  114. data/features/support/env.rb +11 -0
  115. data/features/support/file_helper.rb +68 -0
  116. data/features/writing_the_rakefile.feature +36 -0
  117. data/jsdoc_helper.gemspec +41 -0
  118. data/lib/jsdoc_helper/rake/task/runner.rb +85 -0
  119. data/lib/jsdoc_helper/rake/task.rb +43 -0
  120. data/lib/jsdoc_helper.rb +50 -0
  121. data/spec/jsdoc_helper/jsdoc_helper_spec.rb +4 -0
  122. data/spec/jsdoc_helper/rake/task/runner_spec.rb +45 -0
  123. data/spec/jsdoc_helper/support/file_helper_spec.rb +93 -0
  124. data/spec/spec_helper.rb +25 -0
  125. data/test/ext/jsdoc-toolkit/README.txt +146 -0
  126. data/test/ext/jsdoc-toolkit/app/frame/Chain.js +102 -0
  127. data/test/ext/jsdoc-toolkit/app/frame/Dumper.js +144 -0
  128. data/test/ext/jsdoc-toolkit/app/frame/Hash.js +84 -0
  129. data/test/ext/jsdoc-toolkit/app/frame/Link.js +148 -0
  130. data/test/ext/jsdoc-toolkit/app/frame/Namespace.js +10 -0
  131. data/test/ext/jsdoc-toolkit/app/frame/Opt.js +134 -0
  132. data/test/ext/jsdoc-toolkit/app/frame/Reflection.js +26 -0
  133. data/test/ext/jsdoc-toolkit/app/frame/String.js +93 -0
  134. data/test/ext/jsdoc-toolkit/app/frame/Testrun.js +129 -0
  135. data/test/ext/jsdoc-toolkit/app/frame.js +33 -0
  136. data/test/ext/jsdoc-toolkit/app/handlers/FOODOC.js +26 -0
  137. data/test/ext/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +159 -0
  138. data/test/ext/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +16 -0
  139. data/test/ext/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +292 -0
  140. data/test/ext/jsdoc-toolkit/app/handlers/XMLDOC.js +26 -0
  141. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +200 -0
  142. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +294 -0
  143. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +126 -0
  144. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +109 -0
  145. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/Lang.js +144 -0
  146. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/Parser.js +107 -0
  147. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +33 -0
  148. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +643 -0
  149. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +229 -0
  150. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +41 -0
  151. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/Token.js +18 -0
  152. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +332 -0
  153. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +133 -0
  154. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/Util.js +32 -0
  155. data/test/ext/jsdoc-toolkit/app/lib/JSDOC/Walker.js +459 -0
  156. data/test/ext/jsdoc-toolkit/app/lib/JSDOC.js +101 -0
  157. data/test/ext/jsdoc-toolkit/app/main.js +111 -0
  158. data/test/ext/jsdoc-toolkit/app/plugins/commentSrcJson.js +20 -0
  159. data/test/ext/jsdoc-toolkit/app/plugins/frameworkPrototype.js +16 -0
  160. data/test/ext/jsdoc-toolkit/app/plugins/functionCall.js +10 -0
  161. data/test/ext/jsdoc-toolkit/app/plugins/publishSrcHilite.js +62 -0
  162. data/test/ext/jsdoc-toolkit/app/plugins/symbolLink.js +9 -0
  163. data/test/ext/jsdoc-toolkit/app/plugins/tagParamConfig.js +31 -0
  164. data/test/ext/jsdoc-toolkit/app/plugins/tagSynonyms.js +43 -0
  165. data/test/ext/jsdoc-toolkit/app/run.js +348 -0
  166. data/test/ext/jsdoc-toolkit/app/t/TestDoc.js +144 -0
  167. data/test/ext/jsdoc-toolkit/app/t/runner.js +13 -0
  168. data/test/ext/jsdoc-toolkit/app/test/addon.js +24 -0
  169. data/test/ext/jsdoc-toolkit/app/test/anon_inner.js +14 -0
  170. data/test/ext/jsdoc-toolkit/app/test/augments.js +31 -0
  171. data/test/ext/jsdoc-toolkit/app/test/augments2.js +26 -0
  172. data/test/ext/jsdoc-toolkit/app/test/borrows.js +41 -0
  173. data/test/ext/jsdoc-toolkit/app/test/borrows2.js +23 -0
  174. data/test/ext/jsdoc-toolkit/app/test/config.js +22 -0
  175. data/test/ext/jsdoc-toolkit/app/test/constructs.js +18 -0
  176. data/test/ext/jsdoc-toolkit/app/test/encoding.js +10 -0
  177. data/test/ext/jsdoc-toolkit/app/test/encoding_other.js +12 -0
  178. data/test/ext/jsdoc-toolkit/app/test/event.js +54 -0
  179. data/test/ext/jsdoc-toolkit/app/test/functions_anon.js +39 -0
  180. data/test/ext/jsdoc-toolkit/app/test/functions_nested.js +33 -0
  181. data/test/ext/jsdoc-toolkit/app/test/global.js +13 -0
  182. data/test/ext/jsdoc-toolkit/app/test/globals.js +25 -0
  183. data/test/ext/jsdoc-toolkit/app/test/ignore.js +10 -0
  184. data/test/ext/jsdoc-toolkit/app/test/inner.js +16 -0
  185. data/test/ext/jsdoc-toolkit/app/test/jsdoc_test.js +477 -0
  186. data/test/ext/jsdoc-toolkit/app/test/lend.js +33 -0
  187. data/test/ext/jsdoc-toolkit/app/test/memberof.js +19 -0
  188. data/test/ext/jsdoc-toolkit/app/test/memberof_constructor.js +17 -0
  189. data/test/ext/jsdoc-toolkit/app/test/name.js +19 -0
  190. data/test/ext/jsdoc-toolkit/app/test/namespace_nested.js +23 -0
  191. data/test/ext/jsdoc-toolkit/app/test/nocode.js +13 -0
  192. data/test/ext/jsdoc-toolkit/app/test/oblit_anon.js +20 -0
  193. data/test/ext/jsdoc-toolkit/app/test/overview.js +20 -0
  194. data/test/ext/jsdoc-toolkit/app/test/param_inline.js +37 -0
  195. data/test/ext/jsdoc-toolkit/app/test/params_optional.js +8 -0
  196. data/test/ext/jsdoc-toolkit/app/test/prototype.js +17 -0
  197. data/test/ext/jsdoc-toolkit/app/test/prototype_nested.js +9 -0
  198. data/test/ext/jsdoc-toolkit/app/test/prototype_oblit.js +13 -0
  199. data/test/ext/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +24 -0
  200. data/test/ext/jsdoc-toolkit/app/test/public.js +10 -0
  201. data/test/ext/jsdoc-toolkit/app/test/shared.js +42 -0
  202. data/test/ext/jsdoc-toolkit/app/test/shared2.js +2 -0
  203. data/test/ext/jsdoc-toolkit/app/test/shortcuts.js +22 -0
  204. data/test/ext/jsdoc-toolkit/app/test/static_this.js +13 -0
  205. data/test/ext/jsdoc-toolkit/app/test/synonyms.js +31 -0
  206. data/test/ext/jsdoc-toolkit/app/test/tosource.js +23 -0
  207. data/test/ext/jsdoc-toolkit/app/test/variable_redefine.js +14 -0
  208. data/test/ext/jsdoc-toolkit/app/test.js +307 -0
  209. data/test/ext/jsdoc-toolkit/changes.txt +75 -0
  210. data/test/ext/jsdoc-toolkit/conf/sample.conf +31 -0
  211. data/test/ext/jsdoc-toolkit/java/build.xml +36 -0
  212. data/test/ext/jsdoc-toolkit/java/build_1.4.xml +36 -0
  213. data/test/ext/jsdoc-toolkit/java/classes/js.jar +0 -0
  214. data/test/ext/jsdoc-toolkit/java/src/JsDebugRun.java +21 -0
  215. data/test/ext/jsdoc-toolkit/java/src/JsRun.java +21 -0
  216. data/test/ext/jsdoc-toolkit/jsdebug.jar +0 -0
  217. data/test/ext/jsdoc-toolkit/jsrun.jar +0 -0
  218. data/test/ext/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +17 -0
  219. data/test/ext/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +56 -0
  220. data/test/ext/jsdoc-toolkit/templates/jsdoc/class.tmpl +646 -0
  221. data/test/ext/jsdoc-toolkit/templates/jsdoc/index.tmpl +39 -0
  222. data/test/ext/jsdoc-toolkit/templates/jsdoc/publish.js +184 -0
  223. data/test/ext/jsdoc-toolkit/templates/jsdoc/static/default.css +162 -0
  224. data/test/ext/jsdoc-toolkit/templates/jsdoc/static/header.html +2 -0
  225. data/test/ext/jsdoc-toolkit/templates/jsdoc/static/index.html +19 -0
  226. data/test/ext/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +35 -0
  227. data/test/lib/test1.js +0 -0
  228. data/test/lib/test2.js +0 -0
  229. metadata +294 -0
@@ -0,0 +1,10 @@
1
+
2
+ /**
3
+ * @Constructor
4
+ * @desc 配置文件
5
+ * @class 什么也不返回
6
+ */
7
+ function Test(conf) {
8
+ // do something;
9
+ }
10
+
@@ -0,0 +1,12 @@
1
+
2
+ /**
3
+ * @Constructor
4
+ * @desc ����
5
+ * @class ����������������� �����������
6
+ */
7
+ function Test(conf) {
8
+ // do something;
9
+ }
10
+
11
+ // run with commanline option -e=iso-8859-5
12
+
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @name Kitchen
3
+ * @constructor
4
+ * @fires Bakery#event:donutOrdered
5
+ */
6
+
7
+ /**
8
+ * Fired when some cake is eaten.
9
+ * @name Kitchen#event:cakeEaten
10
+ * @function
11
+ * @param {Number} pieces The number of pieces eaten.
12
+ */
13
+
14
+ /**
15
+ * Find out if cake was eaten.
16
+ * @name Kitchen#cakeEaten
17
+ * @function
18
+ * @param {Boolean} wasEaten
19
+ */
20
+
21
+ /**
22
+ * @name getDesert
23
+ * @function
24
+ * @fires Kitchen#event:cakeEaten
25
+ */
26
+
27
+ /**
28
+ * @name Bakery
29
+ * @constructor
30
+ * @extends Kitchen
31
+ */
32
+
33
+ /**
34
+ * Fired when a donut order is made.
35
+ * @name Bakery#event:donutOrdered
36
+ * @event
37
+ * @param {Event} e The event object.
38
+ * @param {String} [e.topping] Optional sprinkles.
39
+ */
40
+
41
+ /**
42
+ * @constructor
43
+ * @borrows Bakery#event:donutOrdered as this.event:cakeOrdered
44
+ */
45
+ function CakeShop() {
46
+ }
47
+
48
+ /** @event */
49
+ CakeShop.prototype.icingReady = function(isPink) {
50
+ }
51
+
52
+ /** @event */
53
+ function amHungry(/**Boolean*/enoughToEatAHorse) {
54
+ }
@@ -0,0 +1,39 @@
1
+ /** an anonymous constructor executed inline */
2
+ a = new function() {
3
+ /** a.b*/
4
+ this.b = 1;
5
+ /** a.f */
6
+ this.f = function() {
7
+ /** a.c */
8
+ this.c = 2;
9
+ }
10
+ }
11
+
12
+
13
+ /**
14
+ named function executed inline
15
+ */
16
+ bar1 = function Zoola1() {
17
+ /** property of global */
18
+ this.g = 1;
19
+ }();
20
+
21
+ /**
22
+ named constructor executed inline
23
+ */
24
+ bar2 = new function Zoola2() {
25
+ /** property of bar */
26
+ this.p = 1;
27
+ };
28
+
29
+ /** module pattern */
30
+ module = (function () {
31
+ /** won't appear in documentation */
32
+ var priv = 1;
33
+
34
+ /** @scope module */
35
+ return {
36
+ /** will appear as a property of module */
37
+ pub: 1
38
+ }
39
+ })();
@@ -0,0 +1,33 @@
1
+ /** @constructor */
2
+ function Zop() {
3
+ }
4
+
5
+ /**
6
+ @class
7
+ */
8
+ Foo = function(id) {
9
+ // this is a bit twisted, but if you call Foo() you will then
10
+ // modify Foo(). This is kinda, sorta non-insane, because you
11
+ // would have to call Foo() 100% of the time to use Foo's methods
12
+ Foo.prototype.methodOne = function(bar) {
13
+ alert(bar);
14
+ };
15
+
16
+ // same again
17
+ Foo.prototype.methodTwo = function(bar2) {
18
+ alert(bar2);
19
+ };
20
+
21
+ // and these are only executed if the enclosing function is actually called
22
+ // and who knows if that will ever happen?
23
+ Bar = function(pez) {
24
+ alert(pez);
25
+ };
26
+ Zop.prototype.zap = function(p){
27
+ alert(p);
28
+ };
29
+
30
+ // but this is only visible inside Foo
31
+ function inner() {
32
+ }
33
+ };
@@ -0,0 +1,13 @@
1
+ /** ecks */
2
+ var x = [1, 2, 4];
3
+
4
+ var y = {
5
+ foo: function(){
6
+ }
7
+ }
8
+
9
+ bar = function() {
10
+ }
11
+
12
+ function zop() {
13
+ }
@@ -0,0 +1,25 @@
1
+ function example(/**Circle*/a, b) {
2
+ /** a global defined in function */
3
+ var number = a;
4
+
5
+ var hideNumber = function(){
6
+ }
7
+
8
+ setNumber = function(){
9
+ }
10
+ alert('You have chosen: ' + b);
11
+ }
12
+
13
+ function initPage() {
14
+ var supported = document.createElement && document.getElementsByTagName;
15
+ if (!supported) return;
16
+ // start of DOM script
17
+ var x = document.getElementById('writeroot');
18
+ // etc.
19
+ }
20
+
21
+ /** an example var */
22
+ var document = new Document(x, y);
23
+
24
+ var getNumber = function(){
25
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A test constructor.
3
+ * @constructor
4
+ * @ignore
5
+ */
6
+ function Ignored() {
7
+ /** a method */
8
+ this.bar = function() {
9
+ }
10
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @constructor
3
+ */
4
+ function Outer() {
5
+ /**
6
+ * @constructor
7
+ */
8
+ function Inner(name) {
9
+ /** The name of this. */
10
+ this.name = name;
11
+ }
12
+
13
+ this.open = function(name) {
14
+ return (new Inner(name));
15
+ }
16
+ }
@@ -0,0 +1,477 @@
1
+ /**
2
+ * @fileoverview This file is to be used for testing the JSDoc parser
3
+ * It is not intended to be an example of good JavaScript OO-programming,
4
+ * nor is it intended to fulfill any specific purpose apart from
5
+ * demonstrating the functionality of the
6
+ * <a href='http://sourceforge.net/projects/jsdoc'>JSDoc</a> parser
7
+ *
8
+ * @author Gabriel Reid gab_reid@users.sourceforge.net
9
+ * @version 0.1
10
+ */
11
+
12
+
13
+ /**
14
+ * Construct a new Shape object.
15
+ * @class This is the basic Shape class.
16
+ * It can be considered an abstract class, even though no such thing
17
+ * really existing in JavaScript
18
+ * @constructor
19
+ * @throws MemoryException if there is no more memory
20
+ * @throws GeneralShapeException rarely (if ever)
21
+ * @return {Shape|Coordinate} A new shape.
22
+ */
23
+ function Shape(){
24
+
25
+ /**
26
+ * This is an example of a function that is not given as a property
27
+ * of a prototype, but instead it is assigned within a constructor.
28
+ * For inner functions like this to be picked up by the parser, the
29
+ * function that acts as a constructor <b>must</b> be denoted with
30
+ * the <b>&#64;constructor</b> tag in its comment.
31
+ * @type String
32
+ */
33
+ this.getClassName = function(){
34
+ return "Shape";
35
+ }
36
+
37
+ /**
38
+ * This is an inner method, just used here as an example
39
+ * @since version 0.5
40
+ * @author Sue Smart
41
+ */
42
+ function addReference(){
43
+ // Do nothing...
44
+ }
45
+
46
+ }
47
+
48
+ /**
49
+ * Create a new Hexagon instance.
50
+ * @extends Shape
51
+ * @class Hexagon is a class that is a <i>logical</i> sublcass of
52
+ * {@link Shape} (thanks to the <code>&#64;extends</code> tag), but in
53
+ * reality it is completely unrelated to Shape.
54
+ * @param {int} sideLength The length of one side for the new Hexagon
55
+ * @example
56
+ * var h = new Hexagon(2);
57
+ * @example
58
+ * if (hasHex) {
59
+ * hex = new Hexagon(5);
60
+ * color = hex.getColor();
61
+ * }
62
+ */
63
+ function Hexagon(sideLength) {
64
+ }
65
+
66
+
67
+ /**
68
+ * This is an unattached (static) function that adds two integers together.
69
+ * @param {int} One The first number to add
70
+ * @param {int} Two The second number to add
71
+ * @author Gabriel Reid
72
+ * @deprecated So you shouldn't use it anymore!
73
+ */
74
+ function Add(One, Two){
75
+ return One + Two;
76
+ }
77
+
78
+
79
+ /**
80
+ * The color of this shape
81
+ * @type Color
82
+ */
83
+ Shape.prototype.color = null;
84
+
85
+ /**
86
+ * The border of this shape.
87
+ * @field
88
+ * @type int
89
+ */
90
+ Shape.prototype.border = function(){return border;};
91
+
92
+ /*
93
+ * These are all the instance method implementations for Shape
94
+ */
95
+
96
+ /**
97
+ * Get the coordinates of this shape. It is assumed that we're always talking
98
+ * about shapes in a 2D location here.
99
+ * @requires The {@link Shape} class
100
+ * @returns A Coordinate object representing the location of this Shape
101
+ * @type Coordinate[]
102
+ */
103
+ Shape.prototype.getCoords = function(){
104
+ return this.coords;
105
+ }
106
+
107
+ /**
108
+ * Get the color of this shape.
109
+ * @see #setColor
110
+ * @see The <a href="http://example.com">Color</a> library.
111
+ * @link Shape
112
+ * @type Color
113
+ */
114
+ Shape.prototype.getColor = function(){
115
+ return this.color;
116
+ }
117
+
118
+ /**
119
+ * Set the coordinates for this Shape
120
+ * @param {Coordinate} coordinates The coordinates to set for this Shape
121
+ */
122
+ Shape.prototype.setCoords = function(coordinates){
123
+ this.coords = coordinates;
124
+ }
125
+
126
+ /**
127
+ * Set the color for this Shape
128
+ * @param {Color} color The color to set for this Shape
129
+ * @param other There is no other param, but it can still be documented if
130
+ * optional parameters are used
131
+ * @throws NonExistantColorException (no, not really!)
132
+ * @see #getColor
133
+ */
134
+ Shape.prototype.setColor = function(color){
135
+ this.color = color;
136
+ }
137
+
138
+ /**
139
+ * Clone this shape
140
+ * @returns A copy of this shape
141
+ * @type Shape
142
+ * @author Gabriel Reid
143
+ */
144
+ Shape.prototype.clone = function(){
145
+ return new Shape();
146
+ }
147
+
148
+ /**
149
+ * Create a new Rectangle instance.
150
+ * @class A basic rectangle class, inherits from Shape.
151
+ * This class could be considered a concrete implementation class
152
+ * @constructor
153
+ * @param {int} width The optional width for this Rectangle
154
+ * @param {int} height Thie optional height for this Rectangle
155
+ * @author Gabriel Reid
156
+ * @see Shape is the base class for this
157
+ * @augments Shape
158
+ * @hilited
159
+ */
160
+ function Rectangle(width, // This is the width
161
+ height // This is the height
162
+ ){
163
+ if (width){
164
+ this.width = width;
165
+ if (height){
166
+ this.height = height;
167
+ }
168
+ }
169
+ }
170
+
171
+
172
+ /* Inherit from Shape */
173
+ Rectangle.prototype = new Shape();
174
+
175
+ /**
176
+ * Value to represent the width of the Rectangle.
177
+ * <br>Text in <b>bold</b> and <i>italic</i> and a
178
+ * link to <a href="http://sf.net">SourceForge</a>
179
+ * @private
180
+ * @type int
181
+ */
182
+ Rectangle.prototype.width = 0;
183
+
184
+ /**
185
+ * Value to represent the height of the Rectangle
186
+ * @private
187
+ * @type int
188
+ */
189
+ Rectangle.prototype.height = 0;
190
+
191
+ /**
192
+ * Get the type of this object.
193
+ * @type String
194
+ */
195
+ Rectangle.prototype.getClassName= function(){
196
+ return "Rectangle";
197
+ }
198
+
199
+ /**
200
+ * Get the value of the width for the Rectangle
201
+ * @type int
202
+ * @see Rectangle#setWidth
203
+ */
204
+ Rectangle.prototype.getWidth = function(){
205
+ return this.width;
206
+ }
207
+
208
+ /**
209
+ * Get the value of the height for the Rectangle.
210
+ * Another getter is the {@link Shape#getColor} method in the
211
+ * {@link Shape} base class.
212
+ * @return The height of this Rectangle
213
+ * @type int
214
+ * @see Rectangle#setHeight
215
+ */
216
+ Rectangle.prototype.getHeight = function(){
217
+ return this.height;
218
+ }
219
+
220
+ /**
221
+ * Set the width value for this Rectangle.
222
+ * @param {int} width The width value to be set
223
+ * @see #setWidth
224
+ */
225
+ Rectangle.prototype.setWidth = function(width){
226
+ this.width = width;
227
+ }
228
+
229
+ /**
230
+ * Set the height value for this Rectangle.
231
+ * @param {int} height The height value to be set
232
+ * @see #getHeight
233
+ */
234
+ Rectangle.prototype.setHeight = function(height){
235
+ this.height = height;
236
+ }
237
+
238
+ /**
239
+ * Get the value for the total area of this Rectangle
240
+ * @return total area of this Rectangle
241
+ * @type int
242
+ */
243
+ Rectangle.prototype.getArea = function(){
244
+ return width * height;
245
+ }
246
+
247
+
248
+ /**
249
+ * Create a new Square instance.
250
+ * @class A Square is a subclass of {@link Rectangle}
251
+ * @param {int} width The optional width for this Rectangle
252
+ * @param {int} height The optional height for this Rectangle
253
+ * @augments Rectangle
254
+ */
255
+ function Square(width, height){
256
+ if (width){
257
+ this.width = width;
258
+ if (height){
259
+ this.height = height;
260
+ }
261
+ }
262
+
263
+ }
264
+
265
+ /* Square is a subclass of Rectangle */
266
+ Square.prototype = new Rectangle();
267
+
268
+ /**
269
+ * Set the width value for this Shape.
270
+ * @param {int} width The width value to be set
271
+ * @see #getWidth
272
+ */
273
+ Square.prototype.setWidth = function(width){
274
+ this.width = this.height = width;
275
+ }
276
+
277
+ /**
278
+ * Set the height value for this Shape
279
+ * Sets the {@link Rectangle#height} attribute in the Rectangle.
280
+ * @param {int} height The height value to be set
281
+ */
282
+ Square.prototype.setHeight = function(height){
283
+ this.height = this.width = height;
284
+ }
285
+
286
+
287
+ /**
288
+ * Create a new Circle instance based on a radius.
289
+ * @class Circle class is another subclass of Shape
290
+ * @extends Shape
291
+ * @param {int} radius The optional radius of this {@link Circle }
292
+ * @mixin Square.prototype.setWidth as this.setDiameter
293
+ */
294
+ function Circle(radius){
295
+ if (radius) {
296
+ /** The radius of the this Circle. */
297
+ this.radius = radius;
298
+ }
299
+ }
300
+
301
+ /* Circle inherits from {@link Shape} */
302
+ Circle.prototype = new Shape();
303
+
304
+ /**
305
+ * The radius value for this Circle
306
+ * @private
307
+ * @type int
308
+ */
309
+ Circle.prototype.radius = 0;
310
+
311
+ /**
312
+ * A very simple class (static) field that is also a constant
313
+ * @final
314
+ * @type float
315
+ */
316
+ Circle.PI = 3.14;
317
+
318
+ /**
319
+ * Get the radius value for this Circle
320
+ * @type int
321
+ * @see #setRadius
322
+ */
323
+ Circle.prototype.getRadius = function(){
324
+ return this.radius;
325
+ }
326
+
327
+ /**
328
+ * Set the radius value for this Circle
329
+ * @param {int} radius The {@link Circle#radius} value to set
330
+ * @see #getRadius
331
+ */
332
+ Circle.prototype.setRadius = function(radius){
333
+ this.radius = radius;
334
+ }
335
+
336
+ /**
337
+ * An example of a class (static) method that acts as a factory for Circle
338
+ * objects. Given a radius value, this method creates a new Circle.
339
+ * @param {int} radius The radius value to use for the new Circle.
340
+ * @type Circle
341
+ */
342
+ Circle.createCircle = function(radius){
343
+ return new Circle(radius);
344
+ }
345
+
346
+
347
+ /**
348
+ * Create a new Coordinate instance based on x and y grid data.
349
+ * @class Coordinate is a class that can encapsulate location information.
350
+ * @param {int} [x=0] The optional x portion of the Coordinate
351
+ * @param {int} [y=0] The optinal y portion of the Coordinate
352
+ */
353
+ function Coordinate(x, y){
354
+ if (x){
355
+ this.x = x;
356
+ if (y){
357
+ this.y = y;
358
+ }
359
+ }
360
+ }
361
+
362
+ /**
363
+ * The x portion of the Coordinate
364
+ * @type int
365
+ * @see #getX
366
+ * @see #setX
367
+ */
368
+ Coordinate.prototype.x = 0;
369
+
370
+ /**
371
+ * The y portion of the Coordinate
372
+ * @type int
373
+ * @see #getY
374
+ * @see #setY
375
+ */
376
+ Coordinate.prototype.y = 0;
377
+
378
+ /**
379
+ * Gets the x portion of the Coordinate.
380
+ * @type int
381
+ * @see #setX
382
+ */
383
+ Coordinate.prototype.getX = function(){
384
+ return this.x;
385
+ }
386
+
387
+ /**
388
+ * Get the y portion of the Coordinate.
389
+ * @type int
390
+ * @see #setY
391
+ */
392
+ Coordinate.prototype.getY = function(){
393
+ return this.y;
394
+ }
395
+
396
+ /**
397
+ * Sets the x portion of the Coordinate.
398
+ * @param {int} x The x value to set
399
+ * @see #getX
400
+ */
401
+ Coordinate.prototype.setX = function(x){
402
+ this.x = x;
403
+ }
404
+
405
+ /**
406
+ * Sets the y portion of the Coordinate.
407
+ * @param {int} y The y value to set
408
+ * @see #getY
409
+ */
410
+ Coordinate.prototype.setY = function(y){
411
+ this.y = y;
412
+ }
413
+
414
+ /**
415
+ * @class This class exists to demonstrate the assignment of a class prototype
416
+ * as an anonymous block.
417
+ */
418
+ function ShapeFactory(){
419
+ }
420
+
421
+ ShapeFactory.prototype = {
422
+ /**
423
+ * Creates a new {@link Shape} instance.
424
+ * @return A new {@link Shape}
425
+ * @type Shape
426
+ */
427
+ createShape: function(){
428
+ return new Shape();
429
+ }
430
+ }
431
+
432
+ /**
433
+ * An example of a singleton class
434
+ * @param ... Arguments represent {@link coordinate}s in the shape.
435
+ * @constructor
436
+ */
437
+ MySingletonShapeFactory = function(){
438
+
439
+ /**
440
+ * Get the next {@link Shape}
441
+ * @type Shape
442
+ * @return A new {@link Shape}
443
+ */
444
+ this.getShape = function(){
445
+ return null;
446
+ }
447
+
448
+ }
449
+
450
+
451
+ /**
452
+ * Create a new Foo instance.
453
+ * @class This is the Foo class. It exists to demonstrate 'nested' classes.
454
+ * @constructor
455
+ * @see Foo.Bar
456
+ */
457
+ function Foo(){}
458
+
459
+ /**
460
+ * Creates a new instance of Bar.
461
+ * @class This class exists to demonstrate 'nested' classes.
462
+ * @constructor
463
+ * @see Foo.Bar
464
+ */
465
+ function Bar(){}
466
+
467
+ /**
468
+ * Nested class
469
+ * @constructor
470
+ */
471
+ Foo.Bar = function(){
472
+ /** The x. */ this.x = 2;
473
+ }
474
+
475
+ Foo.Bar.prototype = new Bar();
476
+ /** The y. */
477
+ Foo.Bar.prototype.y = '3';