xpcomcore-rubygem 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/README.markdown +14 -0
  2. data/Rakefile +13 -11
  3. data/VERSION +1 -1
  4. data/bin/xpcomcore +7 -0
  5. data/lib/xpcomcore-rubygem.rb +9 -0
  6. data/lib/xpcomcore-rubygem/commands.rb +54 -0
  7. data/lib/xpcomcore-rubygem/commands/generate.rb +23 -0
  8. data/lib/xpcomcore-rubygem/commands/generate/application.rb +63 -0
  9. data/lib/xpcomcore-rubygem/commands/generate/jeweler_builder_command.rb +108 -0
  10. data/lib/xpcomcore-rubygem/commands/generate/library.rb +25 -0
  11. data/lib/xpcomcore-rubygem/commands/generate/template_helpers.rb +78 -0
  12. data/lib/xpcomcore-rubygem/commands/launch.rb +129 -0
  13. data/templates/application/application.ini.erb +12 -0
  14. data/templates/application/chrome/chrome.manifest.erb +1 -0
  15. data/templates/application/chrome/content/xul/main_window.xul.erb +6 -0
  16. data/{extension → templates/application}/components/bootstrapper.js +1 -1
  17. data/templates/application/defaults/preferences/prefs.js.erb +7 -0
  18. data/templates/shared/jsdoc_doc_task.erb +7 -0
  19. data/templates/shared/xultestrunner_test_task.erb +7 -0
  20. data/xpcomcore-rubygem.gemspec +48 -136
  21. data/xpcomcore/Rakefile +42 -19
  22. data/xpcomcore/bootstrapper.js +1 -3
  23. data/xpcomcore/{VERSION.yml → build_properties.yml} +3 -0
  24. data/xpcomcore/components/XPCOMCore.js +0 -2
  25. data/xpcomcore/doc/files.html +10 -10
  26. data/xpcomcore/doc/index.html +17 -17
  27. data/xpcomcore/doc/symbols/_global_.html +10 -9
  28. data/xpcomcore/doc/symbols/{Error.html → error.html} +10 -9
  29. data/xpcomcore/doc/symbols/{File.html → file.html} +13 -12
  30. data/xpcomcore/doc/symbols/{File.NoSuchFileError.html → file.nosuchfileerror.html} +13 -12
  31. data/xpcomcore/doc/symbols/{Kernel.html → kernel.html} +48 -47
  32. data/xpcomcore/doc/symbols/{LoadError.html → loaderror.html} +13 -12
  33. data/xpcomcore/doc/symbols/{SelfConceptError.html → selfconcepterror.html} +13 -12
  34. data/xpcomcore/doc/symbols/{Sys.html → sys.html} +12 -11
  35. data/xpcomcore/doc/symbols/{XPCBuiltins.html → xpcbuiltins.html} +11 -10
  36. metadata +61 -135
  37. data/README.rdoc +0 -18
  38. data/bin/xpcomcore-firefox +0 -4
  39. data/bin/xpcomcore-rubygem-install +0 -205
  40. data/extension/README.txt +0 -1
  41. data/extension/install.rdf +0 -16
  42. data/xpcomcore/etc/jsdoc-toolkit/README.txt +0 -186
  43. data/xpcomcore/etc/jsdoc-toolkit/app/frame.js +0 -33
  44. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +0 -102
  45. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +0 -144
  46. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +0 -84
  47. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +0 -153
  48. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +0 -10
  49. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +0 -134
  50. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +0 -26
  51. data/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +0 -93
  52. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +0 -129
  53. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +0 -26
  54. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +0 -26
  55. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +0 -159
  56. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +0 -16
  57. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +0 -292
  58. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +0 -104
  59. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +0 -200
  60. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +0 -294
  61. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +0 -126
  62. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +0 -109
  63. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +0 -144
  64. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +0 -145
  65. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +0 -33
  66. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +0 -645
  67. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +0 -241
  68. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +0 -41
  69. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +0 -18
  70. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +0 -332
  71. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +0 -133
  72. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +0 -32
  73. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +0 -474
  74. data/xpcomcore/etc/jsdoc-toolkit/app/main.js +0 -111
  75. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +0 -20
  76. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +0 -16
  77. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +0 -10
  78. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +0 -62
  79. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +0 -10
  80. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +0 -31
  81. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +0 -43
  82. data/xpcomcore/etc/jsdoc-toolkit/app/run.js +0 -348
  83. data/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +0 -144
  84. data/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +0 -13
  85. data/xpcomcore/etc/jsdoc-toolkit/app/test.js +0 -325
  86. data/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +0 -24
  87. data/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +0 -14
  88. data/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +0 -31
  89. data/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +0 -26
  90. data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +0 -46
  91. data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +0 -23
  92. data/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +0 -22
  93. data/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +0 -18
  94. data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +0 -10
  95. data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +0 -12
  96. data/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +0 -54
  97. data/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +0 -14
  98. data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +0 -39
  99. data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +0 -33
  100. data/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +0 -13
  101. data/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +0 -25
  102. data/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +0 -10
  103. data/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +0 -16
  104. data/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +0 -477
  105. data/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +0 -33
  106. data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +0 -19
  107. data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +0 -17
  108. data/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +0 -17
  109. data/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +0 -19
  110. data/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +0 -23
  111. data/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +0 -13
  112. data/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +0 -20
  113. data/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +0 -20
  114. data/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +0 -37
  115. data/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +0 -8
  116. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +0 -17
  117. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +0 -9
  118. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +0 -13
  119. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +0 -24
  120. data/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +0 -10
  121. data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +0 -5
  122. data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +0 -5
  123. data/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +0 -42
  124. data/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +0 -2
  125. data/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +0 -22
  126. data/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +0 -13
  127. data/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +0 -31
  128. data/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +0 -23
  129. data/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +0 -14
  130. data/xpcomcore/etc/jsdoc-toolkit/changes.txt +0 -96
  131. data/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +0 -31
  132. data/xpcomcore/etc/jsdoc-toolkit/java/build.xml +0 -36
  133. data/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +0 -36
  134. data/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
  135. data/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +0 -21
  136. data/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +0 -21
  137. data/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
  138. data/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
  139. data/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +0 -52
  140. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +0 -17
  141. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +0 -56
  142. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +0 -646
  143. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +0 -39
  144. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +0 -200
  145. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +0 -162
  146. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +0 -2
  147. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +0 -19
  148. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +0 -35
@@ -1,102 +0,0 @@
1
- /**@constructor*/
2
- function ChainNode(object, link) {
3
- this.value = object;
4
- this.link = link; // describes this node's relationship to the previous node
5
- }
6
-
7
- /**@constructor*/
8
- function Chain(valueLinks) {
9
- this.nodes = [];
10
- this.cursor = -1;
11
-
12
- if (valueLinks && valueLinks.length > 0) {
13
- this.push(valueLinks[0], "//");
14
- for (var i = 1, l = valueLinks.length; i < l; i+=2) {
15
- this.push(valueLinks[i+1], valueLinks[i]);
16
- }
17
- }
18
- }
19
-
20
- Chain.prototype.push = function(o, link) {
21
- if (this.nodes.length > 0 && link) this.nodes.push(new ChainNode(o, link));
22
- else this.nodes.push(new ChainNode(o));
23
- }
24
-
25
- Chain.prototype.unshift = function(o, link) {
26
- if (this.nodes.length > 0 && link) this.nodes[0].link = link;
27
- this.nodes.unshift(new ChainNode(o));
28
- this.cursor++;
29
- }
30
-
31
- Chain.prototype.get = function() {
32
- if (this.cursor < 0 || this.cursor > this.nodes.length-1) return null;
33
- return this.nodes[this.cursor];
34
- }
35
-
36
- Chain.prototype.first = function() {
37
- this.cursor = 0;
38
- return this.get();
39
- }
40
-
41
- Chain.prototype.last = function() {
42
- this.cursor = this.nodes.length-1;
43
- return this.get();
44
- }
45
-
46
- Chain.prototype.next = function() {
47
- this.cursor++;
48
- return this.get();
49
- }
50
-
51
- Chain.prototype.prev = function() {
52
- this.cursor--;
53
- return this.get();
54
- }
55
-
56
- Chain.prototype.toString = function() {
57
- var string = "";
58
- for (var i = 0, l = this.nodes.length; i < l; i++) {
59
- if (this.nodes[i].link) string += " -("+this.nodes[i].link+")-> ";
60
- string += this.nodes[i].value.toString();
61
- }
62
- return string;
63
- }
64
-
65
- Chain.prototype.joinLeft = function() {
66
- var result = "";
67
- for (var i = 0, l = this.cursor; i < l; i++) {
68
- if (result && this.nodes[i].link) result += this.nodes[i].link;
69
- result += this.nodes[i].value.toString();
70
- }
71
- return result;
72
- }
73
-
74
-
75
- /* USAGE:
76
-
77
- var path = "one/two/three.four/five-six";
78
- var pathChain = new Chain(path.split(/([\/.-])/));
79
- print(pathChain);
80
-
81
- var lineage = new Chain();
82
- lineage.push("Port");
83
- lineage.push("Les", "son");
84
- lineage.push("Dawn", "daughter");
85
- lineage.unshift("Purdie", "son");
86
-
87
- print(lineage);
88
-
89
- // walk left
90
- for (var node = lineage.last(); node !== null; node = lineage.prev()) {
91
- print("< "+node.value);
92
- }
93
-
94
- // walk right
95
- var node = lineage.first()
96
- while (node !== null) {
97
- print(node.value);
98
- node = lineage.next();
99
- if (node && node.link) print("had a "+node.link+" named");
100
- }
101
-
102
- */
@@ -1,144 +0,0 @@
1
- /**
2
- * @class
3
- <pre>
4
- This is a lightly modified version of Kevin Jones' JavaScript
5
- library Data.Dump. To download the original visit:
6
- <a href="http://openjsan.org/doc/k/ke/kevinj/Data/Dump/">http://openjsan.org/doc/k/ke/kevinj/Data/Dump/</a>
7
-
8
- AUTHORS
9
-
10
- The Data.Dump JavaScript module is written by Kevin Jones
11
- (kevinj@cpan.org), based on Data::Dump by Gisle Aas (gisle@aas.no),
12
- based on Data::Dumper by Gurusamy Sarathy (gsar@umich.edu).
13
-
14
- COPYRIGHT
15
-
16
- Copyright 2007 Kevin Jones. Copyright 1998-2000,2003-2004 Gisle Aas.
17
- Copyright 1996-1998 Gurusamy Sarathy.
18
-
19
- This program is free software; you can redistribute it and/or modify
20
- it under the terms of the Perl Artistic License
21
-
22
- See http://www.perl.com/perl/misc/Artistic.html
23
- </pre>
24
- * @static
25
- */
26
- Dumper = {
27
- /** @param [...] The objects to dump. */
28
- dump: function () {
29
- if (arguments.length > 1)
30
- return this._dump(arguments);
31
- else if (arguments.length == 1)
32
- return this._dump(arguments[0]);
33
- else
34
- return "()";
35
- },
36
-
37
- _dump: function (obj) {
38
- if (typeof obj == 'undefined') return 'undefined';
39
- var out;
40
- if (obj.serialize) { return obj.serialize(); }
41
- var type = this._typeof(obj);
42
- if (obj.circularReference) obj.circularReference++;
43
- switch (type) {
44
- case 'circular':
45
- out = "{ //circularReference\n}";
46
- break;
47
- case 'object':
48
- var pairs = new Array;
49
-
50
- for (var prop in obj) {
51
- if (prop != "circularReference" && obj.hasOwnProperty(prop)) { //hide inherited properties
52
- pairs.push(prop + ': ' + this._dump(obj[prop]));
53
- }
54
- }
55
-
56
- out = '{' + this._format_list(pairs) + '}';
57
- break;
58
-
59
- case 'string':
60
- for (var prop in Dumper.ESC) {
61
- if (Dumper.ESC.hasOwnProperty(prop)) {
62
- obj = obj.replace(prop, Dumper.ESC[prop]);
63
- }
64
- }
65
-
66
- // Escape UTF-8 Strings
67
- if (obj.match(/^[\x00-\x7f]*$/)) {
68
- out = '"' + obj.replace(/\"/g, "\\\"").replace(/([\n\r]+)/g, "\\$1") + '"';
69
- }
70
- else {
71
- out = "unescape('"+escape(obj)+"')";
72
- }
73
- break;
74
-
75
- case 'array':
76
- var elems = new Array;
77
-
78
- for (var i=0; i<obj.length; i++) {
79
- elems.push( this._dump(obj[i]) );
80
- }
81
-
82
- out = '[' + this._format_list(elems) + ']';
83
- break;
84
-
85
- case 'date':
86
- // firefox returns GMT strings from toUTCString()...
87
- var utc_string = obj.toUTCString().replace(/GMT/,'UTC');
88
- out = 'new Date("' + utc_string + '")';
89
- break;
90
-
91
- case 'element':
92
- // DOM element
93
- out = this._dump_dom(obj);
94
- break;
95
-
96
- default:
97
- out = obj;
98
- }
99
-
100
- out = String(out).replace(/\n/g, '\n ');
101
- out = out.replace(/\n (.*)$/,"\n$1");
102
-
103
- return out;
104
- },
105
-
106
- _format_list: function (list) {
107
- if (!list.length) return '';
108
- var nl = list.toString().length > 60 ? '\n' : ' ';
109
- return nl + list.join(',' + nl) + nl;
110
- },
111
-
112
- _typeof: function (obj) {
113
- if (obj && obj.circularReference && obj.circularReference > 1) return 'circular';
114
- if (Array.prototype.isPrototypeOf(obj)) return 'array';
115
- if (Date.prototype.isPrototypeOf(obj)) return 'date';
116
- if (typeof obj.nodeType != 'undefined') return 'element';
117
- return typeof(obj);
118
- },
119
-
120
- _dump_dom: function (obj) {
121
- return '"' + Dumper.nodeTypes[obj.nodeType] + '"';
122
- }
123
- };
124
-
125
- Dumper.ESC = {
126
- "\t": "\\t",
127
- "\n": "\\n",
128
- "\f": "\\f"
129
- };
130
-
131
- Dumper.nodeTypes = {
132
- 1: "ELEMENT_NODE",
133
- 2: "ATTRIBUTE_NODE",
134
- 3: "TEXT_NODE",
135
- 4: "CDATA_SECTION_NODE",
136
- 5: "ENTITY_REFERENCE_NODE",
137
- 6: "ENTITY_NODE",
138
- 7: "PROCESSING_INSTRUCTION_NODE",
139
- 8: "COMMENT_NODE",
140
- 9: "DOCUMENT_NODE",
141
- 10: "DOCUMENT_TYPE_NODE",
142
- 11: "DOCUMENT_FRAGMENT_NODE",
143
- 12: "NOTATION_NODE"
144
- };
@@ -1,84 +0,0 @@
1
- /**
2
- @constructor
3
- @example
4
- var _index = new Hash();
5
- _index.set("a", "apple");
6
- _index.set("b", "blue");
7
- _index.set("c", "coffee");
8
-
9
- for (var p = _index.first(); p; p = _index.next()) {
10
- print(p.key+" is for "+p.value);
11
- }
12
-
13
- */
14
- var Hash = function() {
15
- this._map = {};
16
- this._keys = [];
17
- this._vals = [];
18
- this.reset();
19
- }
20
-
21
- Hash.prototype.set = function(k, v) {
22
- if (k != "") {
23
- this._keys.push(k);
24
- this._map["="+k] = this._vals.length;
25
- this._vals.push(v);
26
- }
27
- }
28
-
29
- Hash.prototype.replace = function(k, k2, v) {
30
- if (k == k2) return;
31
-
32
- var offset = this._map["="+k];
33
- this._keys[offset] = k2;
34
- if (typeof v != "undefined") this._vals[offset] = v;
35
- this._map["="+k2] = offset;
36
- delete(this._map["="+k]);
37
- }
38
-
39
- Hash.prototype.drop = function(k) {
40
- if (k != "") {
41
- var offset = this._map["="+k];
42
- this._keys.splice(offset, 1);
43
- this._vals.splice(offset, 1);
44
- delete(this._map["="+k]);
45
- for (var p in this._map) {
46
- if (this._map[p] >= offset) this._map[p]--;
47
- }
48
- if (this._cursor >= offset && this._cursor > 0) this._cursor--;
49
- }
50
- }
51
-
52
- Hash.prototype.get = function(k) {
53
- if (k != "") {
54
- return this._vals[this._map["="+k]];
55
- }
56
- }
57
-
58
- Hash.prototype.keys = function() {
59
- return this._keys;
60
- }
61
-
62
- Hash.prototype.hasKey = function(k) {
63
- if (k != "") {
64
- return (typeof this._map["="+k] != "undefined");
65
- }
66
- }
67
-
68
- Hash.prototype.values = function() {
69
- return this._vals;
70
- }
71
-
72
- Hash.prototype.reset = function() {
73
- this._cursor = 0;
74
- }
75
-
76
- Hash.prototype.first = function() {
77
- this.reset();
78
- return this.next();
79
- }
80
-
81
- Hash.prototype.next = function() {
82
- if (this._cursor++ < this._keys.length)
83
- return {key: this._keys[this._cursor-1], value: this._vals[this._cursor-1]};
84
- }
@@ -1,153 +0,0 @@
1
- /** Handle the creation of HTML links to documented symbols.
2
- @constructor
3
- */
4
- function Link() {
5
- this.alias = "";
6
- this.src = "";
7
- this.file = "";
8
- this.text = "";
9
- this.innerName = "";
10
- this.classLink = false;
11
- this.targetName = "";
12
-
13
- this.target = function(targetName) {
14
- if (defined(targetName)) this.targetName = targetName;
15
- return this;
16
- }
17
- this.inner = function(inner) {
18
- if (defined(inner)) this.innerName = inner;
19
- return this;
20
- }
21
- this.withText = function(text) {
22
- if (defined(text)) this.text = text;
23
- return this;
24
- }
25
- this.toSrc = function(filename) {
26
- if (defined(filename)) this.src = filename;
27
- return this;
28
- }
29
- this.toSymbol = function(alias) {
30
- if (defined(alias)) this.alias = new String(alias);
31
- return this;
32
- }
33
- this.toClass = function(alias) {
34
- this.classLink = true;
35
- return this.toSymbol(alias);
36
- }
37
- this.toFile = function(file) {
38
- if (defined(file)) this.file = file;
39
- return this;
40
- }
41
-
42
- this.toString = function() {
43
- var linkString;
44
- var thisLink = this;
45
-
46
- if (this.alias) {
47
- linkString = this.alias.replace(/(^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-])/i,
48
- function(match, prematch, symbolName, postmatch) {
49
- var symbolNames = symbolName.split("|");
50
- var links = [];
51
- for (var i = 0, l = symbolNames.length; i < l; i++) {
52
- thisLink.alias = symbolNames[i];
53
- links.push(thisLink._makeSymbolLink(symbolNames[i]));
54
- }
55
- return prematch+links.join("|")+postmatch;
56
- }
57
- );
58
- }
59
- else if (this.src) {
60
- linkString = thisLink._makeSrcLink(this.src);
61
- }
62
- else if (this.file) {
63
- linkString = thisLink._makeFileLink(this.file);
64
- }
65
-
66
- return linkString;
67
- }
68
- }
69
-
70
- /** prefixed for hashes */
71
- Link.hashPrefix = "";
72
-
73
- /** Appended to the front of relative link paths. */
74
- Link.base = "";
75
-
76
- Link.symbolNameToLinkName = function(symbol) {
77
- var linker = "";
78
- if (symbol.isStatic) linker = ".";
79
- else if (symbol.isInner) linker = "-";
80
-
81
- return Link.hashPrefix+linker+symbol.name;
82
- }
83
-
84
- /** Create a link to another symbol. */
85
- Link.prototype._makeSymbolLink = function(alias) {
86
- var linkBase = Link.base+publish.conf.symbolsDir;
87
- var linkTo = Link.symbolSet.getSymbol(alias);
88
- var linkPath;
89
- var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
90
-
91
- // is it an internal link?
92
- if (alias.charAt(0) == "#") var linkPath = alias;
93
-
94
- // if there is no symbol by that name just return the name unaltered
95
- else if (!linkTo) return this.text || alias;
96
-
97
- // it's a symbol in another file
98
- else {
99
- if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property
100
- if (linkTo.isEvent) {
101
- linkPath =
102
- (Link.filemap)? Link.filemap[linkTo.memberOf]
103
- :
104
- escape(linkTo.memberOf) || "_global_";
105
- linkPath += publish.conf.ext + "#event:" + Link.symbolNameToLinkName(linkTo);
106
- }
107
- else {
108
- linkPath =
109
- (Link.filemap)? Link.filemap[linkTo.memberOf]
110
- :
111
- escape(linkTo.memberOf) || "_global_";
112
- linkPath += publish.conf.ext + "#" + Link.symbolNameToLinkName(linkTo);
113
- }
114
- }
115
- else {
116
- linkPath = (Link.filemap)? Link.filemap[linkTo.alias] : escape(linkTo.alias);
117
- linkPath += publish.conf.ext;// + (this.classLink? "":"#" + Link.hashPrefix + "constructor");
118
- }
119
- linkPath = linkBase + linkPath
120
- }
121
-
122
- var linkText = this.text || alias;
123
-
124
- var link = {linkPath: linkPath, linkText: linkText, linkInner: (this.innerName? "#"+this.innerName : "")};
125
-
126
- if (typeof JSDOC.PluginManager != "undefined") {
127
- JSDOC.PluginManager.run("onSymbolLink", link);
128
- }
129
-
130
- return "<a href=\""+link.linkPath+link.linkInner+"\""+target+">"+link.linkText+"</a>";
131
- }
132
-
133
- /** Create a link to a source file. */
134
- Link.prototype._makeSrcLink = function(srcFilePath) {
135
- var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
136
-
137
- // transform filepath into a filename
138
- var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "_");
139
- var outFilePath = Link.base + publish.conf.srcDir + srcFile + publish.conf.ext;
140
-
141
- if (!this.text) this.text = FilePath.fileName(srcFilePath);
142
- return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
143
- }
144
-
145
- /** Create a link to a source file. */
146
- Link.prototype._makeFileLink = function(filePath) {
147
- var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
148
-
149
- var outFilePath = Link.base + filePath;
150
-
151
- if (!this.text) this.text = filePath;
152
- return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
153
- }