sproutcore 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/License.txt +20 -0
- data/Manifest.txt +269 -0
- data/README.txt +67 -0
- data/Rakefile +4 -0
- data/app_generators/sproutcore/USAGE +5 -0
- data/app_generators/sproutcore/sproutcore_generator.rb +66 -0
- data/app_generators/sproutcore/templates/README +77 -0
- data/app_generators/sproutcore/templates/environment.yml +4 -0
- data/bin/sc-build +145 -0
- data/bin/sc-gen +24 -0
- data/bin/sc-server +63 -0
- data/bin/sproutcore +21 -0
- data/clients/sc_docs/controllers/docs.js +118 -0
- data/clients/sc_docs/core.js +19 -0
- data/clients/sc_docs/english.lproj/body.css +159 -0
- data/clients/sc_docs/english.lproj/body.rhtml +33 -0
- data/clients/sc_docs/english.lproj/controls.css +0 -0
- data/clients/sc_docs/english.lproj/icons/small/next.png +0 -0
- data/clients/sc_docs/english.lproj/icons/small/reset.png +0 -0
- data/clients/sc_docs/english.lproj/images/gradients.png +0 -0
- data/clients/sc_docs/english.lproj/images/indicator.gif +0 -0
- data/clients/sc_docs/english.lproj/images/toolbar.png +0 -0
- data/clients/sc_docs/english.lproj/no_docs.rhtml +7 -0
- data/clients/sc_docs/english.lproj/strings.js +14 -0
- data/clients/sc_docs/english.lproj/warning.rhtml +6 -0
- data/clients/sc_docs/fixtures/doc.js +11 -0
- data/clients/sc_docs/main.js +21 -0
- data/clients/sc_docs/models/doc.js +9 -0
- data/clients/sc_docs/tests/controllers/docs.rhtml +21 -0
- data/clients/sc_docs/tests/models/doc.rhtml +21 -0
- data/clients/sc_docs/tests/views/doc_frame.rhtml +21 -0
- data/clients/sc_docs/tests/views/doc_label_view.rhtml +21 -0
- data/clients/sc_docs/views/doc_frame.js +33 -0
- data/clients/sc_docs/views/doc_label.js +20 -0
- data/clients/sc_test_runner/controllers/runner.js +175 -0
- data/clients/sc_test_runner/core.js +19 -0
- data/clients/sc_test_runner/english.lproj/body.css +151 -0
- data/clients/sc_test_runner/english.lproj/body.rhtml +35 -0
- data/clients/sc_test_runner/english.lproj/controls.css +0 -0
- data/clients/sc_test_runner/english.lproj/icons/small/next.png +0 -0
- data/clients/sc_test_runner/english.lproj/icons/small/reset.png +0 -0
- data/clients/sc_test_runner/english.lproj/images/gradients.png +0 -0
- data/clients/sc_test_runner/english.lproj/images/indicator.gif +0 -0
- data/clients/sc_test_runner/english.lproj/images/toolbar.png +0 -0
- data/clients/sc_test_runner/english.lproj/no_tests.rhtml +6 -0
- data/clients/sc_test_runner/english.lproj/strings.js +14 -0
- data/clients/sc_test_runner/english.lproj/warning.rhtml +6 -0
- data/clients/sc_test_runner/fixtures/test.js +12 -0
- data/clients/sc_test_runner/main.js +26 -0
- data/clients/sc_test_runner/models/test.js +11 -0
- data/clients/sc_test_runner/views/runner_frame.js +72 -0
- data/clients/sc_test_runner/views/test_label.js +20 -0
- data/config/hoe.rb +70 -0
- data/config/requirements.rb +17 -0
- data/environment.yml +9 -0
- data/frameworks/prototype/prototype.js +4186 -0
- data/frameworks/sproutcore/Core.js +378 -0
- data/frameworks/sproutcore/README +3 -0
- data/frameworks/sproutcore/controllers/array.js +236 -0
- data/frameworks/sproutcore/controllers/collection.js +305 -0
- data/frameworks/sproutcore/controllers/controller.js +323 -0
- data/frameworks/sproutcore/controllers/object.js +372 -0
- data/frameworks/sproutcore/drag/drag.js +549 -0
- data/frameworks/sproutcore/drag/drag_data_source.js +32 -0
- data/frameworks/sproutcore/drag/drag_source.js +64 -0
- data/frameworks/sproutcore/drag/drop_target.js +153 -0
- data/frameworks/sproutcore/english.lproj/blank.gif +0 -0
- data/frameworks/sproutcore/english.lproj/buttons.css +589 -0
- data/frameworks/sproutcore/english.lproj/buttons.png +0 -0
- data/frameworks/sproutcore/english.lproj/inline_text_editor.css +21 -0
- data/frameworks/sproutcore/english.lproj/menu.css +121 -0
- data/frameworks/sproutcore/english.lproj/panels/background-fat.jpg +0 -0
- data/frameworks/sproutcore/english.lproj/panels/background-thin.jpg +0 -0
- data/frameworks/sproutcore/english.lproj/panels/bottom-edge.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/bottom-left-corner.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/bottom-right-corner.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/left-edge.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/overlay.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/right-edge.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/top-edge.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/top-left-corner.png +0 -0
- data/frameworks/sproutcore/english.lproj/panels/top-right-corner.png +0 -0
- data/frameworks/sproutcore/english.lproj/panes.css +155 -0
- data/frameworks/sproutcore/english.lproj/picker.css +22 -0
- data/frameworks/sproutcore/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/english.lproj/tab.css +23 -0
- data/frameworks/sproutcore/english.lproj/tests.css +67 -0
- data/frameworks/sproutcore/english.lproj/theme.css +77 -0
- data/frameworks/sproutcore/foundation/animator.js +670 -0
- data/frameworks/sproutcore/foundation/application.js +199 -0
- data/frameworks/sproutcore/foundation/array.js +348 -0
- data/frameworks/sproutcore/foundation/benchmark.js +211 -0
- data/frameworks/sproutcore/foundation/binding.js +384 -0
- data/frameworks/sproutcore/foundation/date.js +357 -0
- data/frameworks/sproutcore/foundation/error.js +39 -0
- data/frameworks/sproutcore/foundation/input_manager.js +153 -0
- data/frameworks/sproutcore/foundation/json.js +296 -0
- data/frameworks/sproutcore/foundation/mock.js +42 -0
- data/frameworks/sproutcore/foundation/node_descriptor.js +56 -0
- data/frameworks/sproutcore/foundation/object.js +777 -0
- data/frameworks/sproutcore/foundation/observable.js +451 -0
- data/frameworks/sproutcore/foundation/page.js +63 -0
- data/frameworks/sproutcore/foundation/path_module.js +413 -0
- data/frameworks/sproutcore/foundation/responder.js +310 -0
- data/frameworks/sproutcore/foundation/routes.js +371 -0
- data/frameworks/sproutcore/foundation/run_loop.js +21 -0
- data/frameworks/sproutcore/foundation/server.js +491 -0
- data/frameworks/sproutcore/foundation/set.js +96 -0
- data/frameworks/sproutcore/foundation/string.js +149 -0
- data/frameworks/sproutcore/foundation/undo_manager.js +186 -0
- data/frameworks/sproutcore/foundation/unittest.js +622 -0
- data/frameworks/sproutcore/foundation/utils.js +61 -0
- data/frameworks/sproutcore/globals/panels.js +182 -0
- data/frameworks/sproutcore/globals/popups.js +60 -0
- data/frameworks/sproutcore/globals/window.js +381 -0
- data/frameworks/sproutcore/lib/index.rhtml +66 -0
- data/frameworks/sproutcore/models/collection.js +395 -0
- data/frameworks/sproutcore/models/record.js +622 -0
- data/frameworks/sproutcore/models/store.js +295 -0
- data/frameworks/sproutcore/panes/dialog.js +16 -0
- data/frameworks/sproutcore/panes/manager.js +164 -0
- data/frameworks/sproutcore/panes/menu.js +45 -0
- data/frameworks/sproutcore/panes/overlay.js +231 -0
- data/frameworks/sproutcore/panes/pane.js +90 -0
- data/frameworks/sproutcore/panes/panel.js +19 -0
- data/frameworks/sproutcore/panes/picker.js +45 -0
- data/frameworks/sproutcore/tests/controllers/array.rhtml +86 -0
- data/frameworks/sproutcore/tests/controllers/controller.rhtml +273 -0
- data/frameworks/sproutcore/tests/controllers/object.rhtml +327 -0
- data/frameworks/sproutcore/tests/foundation/application.rhtml +125 -0
- data/frameworks/sproutcore/tests/foundation/array.rhtml +221 -0
- data/frameworks/sproutcore/tests/foundation/object.rhtml +69 -0
- data/frameworks/sproutcore/tests/globals/window.rhtml +45 -0
- data/frameworks/sproutcore/tests/panes/pane.rhtml +88 -0
- data/frameworks/sproutcore/tests/views/collection.rhtml +137 -0
- data/frameworks/sproutcore/tests/views/popup_button.rhtml +115 -0
- data/frameworks/sproutcore/tests/views/text_field.rhtml +37 -0
- data/frameworks/sproutcore/validators/credit_card.js +92 -0
- data/frameworks/sproutcore/validators/date.js +36 -0
- data/frameworks/sproutcore/validators/email.js +29 -0
- data/frameworks/sproutcore/validators/not_empty.js +24 -0
- data/frameworks/sproutcore/validators/number.js +55 -0
- data/frameworks/sproutcore/validators/password.js +78 -0
- data/frameworks/sproutcore/validators/validator.js +304 -0
- data/frameworks/sproutcore/views/button.js +425 -0
- data/frameworks/sproutcore/views/checkbox_field.js +30 -0
- data/frameworks/sproutcore/views/collection.js +1521 -0
- data/frameworks/sproutcore/views/container.js +62 -0
- data/frameworks/sproutcore/views/error_explanation.js +45 -0
- data/frameworks/sproutcore/views/field.js +214 -0
- data/frameworks/sproutcore/views/filter_button.js +29 -0
- data/frameworks/sproutcore/views/form.js +591 -0
- data/frameworks/sproutcore/views/image.js +141 -0
- data/frameworks/sproutcore/views/inline_text_editor.js +96 -0
- data/frameworks/sproutcore/views/label.js +176 -0
- data/frameworks/sproutcore/views/menu_item.js +90 -0
- data/frameworks/sproutcore/views/pagination.js +54 -0
- data/frameworks/sproutcore/views/popup_button.js +86 -0
- data/frameworks/sproutcore/views/popup_menu.js +137 -0
- data/frameworks/sproutcore/views/progress.js +100 -0
- data/frameworks/sproutcore/views/radio_field.js +107 -0
- data/frameworks/sproutcore/views/radio_group.js +48 -0
- data/frameworks/sproutcore/views/segmented.js +80 -0
- data/frameworks/sproutcore/views/select_field.js +272 -0
- data/frameworks/sproutcore/views/spinner.js +11 -0
- data/frameworks/sproutcore/views/tab.js +126 -0
- data/frameworks/sproutcore/views/text_field.js +179 -0
- data/frameworks/sproutcore/views/textarea_field.js +14 -0
- data/frameworks/sproutcore/views/toolbar.js +29 -0
- data/frameworks/sproutcore/views/view.js +1389 -0
- data/frameworks/sproutcore/views/workspace.js +170 -0
- data/generators/client/README +3 -0
- data/generators/client/USAGE +12 -0
- data/generators/client/client_generator.rb +53 -0
- data/generators/client/templates/core.js +19 -0
- data/generators/client/templates/english.lproj/body.css +0 -0
- data/generators/client/templates/english.lproj/body.rhtml +3 -0
- data/generators/client/templates/english.lproj/controls.css +0 -0
- data/generators/client/templates/english.lproj/strings.js +14 -0
- data/generators/client/templates/main.js +37 -0
- data/generators/controller/USAGE +16 -0
- data/generators/controller/controller_generator.rb +51 -0
- data/generators/controller/templates/controller.js +21 -0
- data/generators/controller/templates/test.rhtml +21 -0
- data/generators/framework/README +7 -0
- data/generators/framework/USAGE +12 -0
- data/generators/framework/framework_generator.rb +53 -0
- data/generators/framework/templates/core.js +20 -0
- data/generators/framework/templates/english.lproj/body.css +0 -0
- data/generators/framework/templates/english.lproj/body.rhtml +3 -0
- data/generators/framework/templates/english.lproj/controls.css +0 -0
- data/generators/framework/templates/english.lproj/strings.js +14 -0
- data/generators/language/USAGE +16 -0
- data/generators/language/language_generator.rb +47 -0
- data/generators/language/templates/strings.js +10 -0
- data/generators/model/USAGE +24 -0
- data/generators/model/model_generator.rb +55 -0
- data/generators/model/templates/fixture.js +11 -0
- data/generators/model/templates/model.js +20 -0
- data/generators/model/templates/test.rhtml +21 -0
- data/generators/test/USAGE +16 -0
- data/generators/test/templates/test.rhtml +21 -0
- data/generators/test/test_generator.rb +47 -0
- data/generators/view/USAGE +16 -0
- data/generators/view/templates/test.rhtml +21 -0
- data/generators/view/templates/view.js +20 -0
- data/generators/view/view_generator.rb +51 -0
- data/jsdoc/README.txt +119 -0
- data/jsdoc/app/DocFile.js +137 -0
- data/jsdoc/app/DocTag.js +110 -0
- data/jsdoc/app/Doclet.js +63 -0
- data/jsdoc/app/Dumper.js +143 -0
- data/jsdoc/app/JsDoc.js +103 -0
- data/jsdoc/app/JsHilite.js +45 -0
- data/jsdoc/app/JsIO.js +163 -0
- data/jsdoc/app/JsParse.js +385 -0
- data/jsdoc/app/JsPlate.js +130 -0
- data/jsdoc/app/JsTestrun.js +129 -0
- data/jsdoc/app/JsToke.js +564 -0
- data/jsdoc/app/Symbol.js +298 -0
- data/jsdoc/app/Transformer.js +14 -0
- data/jsdoc/app/Util.js +97 -0
- data/jsdoc/app/js.jar +0 -0
- data/jsdoc/app/run.js +144 -0
- data/jsdoc/plugins/min.js +316 -0
- data/jsdoc/plugins/strip.js +20 -0
- data/jsdoc/templates/sproutcore/class.tmpl +438 -0
- data/jsdoc/templates/sproutcore/default.css +241 -0
- data/jsdoc/templates/sproutcore/index.html +13 -0
- data/jsdoc/templates/sproutcore/index.tmpl +21 -0
- data/jsdoc/templates/sproutcore/prototype.js +4186 -0
- data/jsdoc/templates/sproutcore/publish.js +236 -0
- data/jsdoc/templates/sproutcore/splash.html +7 -0
- data/lib/sproutcore/build_tools/html_builder.rb +88 -0
- data/lib/sproutcore/build_tools/resource_builder.rb +194 -0
- data/lib/sproutcore/build_tools.rb +44 -0
- data/lib/sproutcore/bundle.rb +517 -0
- data/lib/sproutcore/bundle_manifest.rb +397 -0
- data/lib/sproutcore/generator_helper.rb +170 -0
- data/lib/sproutcore/helpers/capture_helper.rb +42 -0
- data/lib/sproutcore/helpers/static_helper.rb +80 -0
- data/lib/sproutcore/helpers/tag_helper.rb +110 -0
- data/lib/sproutcore/helpers/text_helper.rb +336 -0
- data/lib/sproutcore/helpers.rb +3 -0
- data/lib/sproutcore/jsdoc.rb +40 -0
- data/lib/sproutcore/jsmin.rb +247 -0
- data/lib/sproutcore/library.rb +258 -0
- data/lib/sproutcore/merb/bundle_controller.rb +179 -0
- data/lib/sproutcore/merb/router.rb +43 -0
- data/lib/sproutcore/merb.rb +27 -0
- data/lib/sproutcore/version.rb +9 -0
- data/lib/sproutcore/view_helpers/button_views.rb +302 -0
- data/lib/sproutcore/view_helpers/core_views.rb +284 -0
- data/lib/sproutcore/view_helpers/form_views.rb +258 -0
- data/lib/sproutcore/view_helpers/menu_views.rb +94 -0
- data/lib/sproutcore/view_helpers.rb +628 -0
- data/lib/sproutcore.rb +30 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/sproutcore_spec.rb +11 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/rspec.rake +21 -0
- data/tasks/website.rake +17 -0
- metadata +365 -0
data/jsdoc/app/Symbol.js
ADDED
@@ -0,0 +1,298 @@
|
|
1
|
+
/**
|
2
|
+
* @fileOverview
|
3
|
+
* @name Symbol
|
4
|
+
* @author Michael Mathews micmath@gmail.com
|
5
|
+
* @url $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-1.4.0b/app/Symbol.js $
|
6
|
+
* @revision $Id: Symbol.js 340 2007-11-14 23:24:27Z micmath $
|
7
|
+
* @license <a href="http://en.wikipedia.org/wiki/MIT_License">X11/MIT License</a>
|
8
|
+
* (See the accompanying README file for full details.)
|
9
|
+
*/
|
10
|
+
|
11
|
+
SYM = {
|
12
|
+
OBJECT: "OBJECT",
|
13
|
+
FUNCTION: "FUNCTION",
|
14
|
+
CONSTRUCTOR: "CONSTRUCTOR",
|
15
|
+
VIRTUAL: "VIRTUAL",
|
16
|
+
EVENT: "EVENT"
|
17
|
+
};
|
18
|
+
|
19
|
+
/**
|
20
|
+
@class Represents an atomic unit of code.
|
21
|
+
@constructor
|
22
|
+
*/
|
23
|
+
function Symbol(name, params, isa, comment) {
|
24
|
+
if (isa == "META") {
|
25
|
+
if (comment.indexOf("/**#@+") == 0) { // start of shared doclet
|
26
|
+
Symbol.shared = Doclet.unwrapComment(comment.replace("/**#@+", "/**"));
|
27
|
+
}
|
28
|
+
else if (comment.indexOf("/**#@-") == 0) { // end of shared doclet
|
29
|
+
Symbol.shared = "";
|
30
|
+
}
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
comment = Symbol.shared+"\n"+Doclet.unwrapComment(comment);
|
34
|
+
|
35
|
+
this.name = name;
|
36
|
+
this.params = (params || []);
|
37
|
+
this.isa = (isa || SYM.OBJECT);
|
38
|
+
this.type = "";
|
39
|
+
this.alias = name;
|
40
|
+
this.desc = "";
|
41
|
+
this.classDesc = "";
|
42
|
+
this.memberof = "";
|
43
|
+
this.since = "";
|
44
|
+
this.version = "";
|
45
|
+
this.deprecated = "";
|
46
|
+
this.augments = [];
|
47
|
+
this.inherits = [];
|
48
|
+
this._inheritsFrom = [];
|
49
|
+
this.properties = [];
|
50
|
+
this.methods = [];
|
51
|
+
this.file = {};
|
52
|
+
this.returns = [];
|
53
|
+
this.exceptions = [];
|
54
|
+
this.events = [];
|
55
|
+
this.doc = new Doclet(comment);
|
56
|
+
this.see = [];
|
57
|
+
|
58
|
+
// move certain data out of the tags and into the Symbol
|
59
|
+
var overviews;
|
60
|
+
if ((overviews = this.doc.getTag("overview")) && overviews.length) {
|
61
|
+
var libraries;
|
62
|
+
if ((libraries = this.doc.getTag("name")) && libraries.length) {
|
63
|
+
this.name = libraries[0].desc;
|
64
|
+
this.doc._dropTag("name");
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
this.name = Util.fileName(this.alias)
|
68
|
+
}
|
69
|
+
|
70
|
+
this.desc = overviews[0].desc;
|
71
|
+
this.doc._dropTag("overview");
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
|
75
|
+
var since;
|
76
|
+
if ((since = this.doc.getTag("since")) && since.length) {
|
77
|
+
this.since = since[0].desc;
|
78
|
+
}
|
79
|
+
|
80
|
+
var version;
|
81
|
+
if ((version = this.doc.getTag("version")) && version.length) {
|
82
|
+
this.version = version[0].desc;
|
83
|
+
}
|
84
|
+
|
85
|
+
var deprecated;
|
86
|
+
if ((deprecated = this.doc.getTag("deprecated")) && deprecated.length) {
|
87
|
+
this.deprecated = deprecated[0];
|
88
|
+
this.doc._dropTag("deprecated");
|
89
|
+
}
|
90
|
+
|
91
|
+
var see;
|
92
|
+
if ((see = this.doc.getTag("see")) && version.length) {
|
93
|
+
this.see = see;
|
94
|
+
this.doc._dropTag("see");
|
95
|
+
}
|
96
|
+
|
97
|
+
var descs;
|
98
|
+
if ((descs = this.doc.getTag("desc")) && descs.length) {
|
99
|
+
this.desc = descs.join("\n"); // multiple descriptions are concatenated into one
|
100
|
+
this.doc._dropTag("desc");
|
101
|
+
}
|
102
|
+
|
103
|
+
var params;
|
104
|
+
if ((params = this.doc.getTag("param")) && params.length) { // user defined params override those defined by parser
|
105
|
+
this.params = params;
|
106
|
+
this.doc._dropTag("param");
|
107
|
+
}
|
108
|
+
else { // promote parser params into DocTag objects
|
109
|
+
for (var i = 0; i < this.params.length; i++) {
|
110
|
+
this.params[i] = new DocTag("param "+this.params[i]);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
var constructors;
|
115
|
+
if ((constructors = this.doc.getTag("constructor")) && constructors.length) {
|
116
|
+
this.isa = SYM.CONSTRUCTOR;
|
117
|
+
this.doc._dropTag("constructor");
|
118
|
+
}
|
119
|
+
|
120
|
+
var functions;
|
121
|
+
if ((functions = this.doc.getTag("function")) && functions.length) {
|
122
|
+
this.isa = SYM.FUNCTION;
|
123
|
+
this.doc._dropTag("function");
|
124
|
+
}
|
125
|
+
|
126
|
+
var events;
|
127
|
+
if ((events = this.doc.getTag("event")) && events.length) {
|
128
|
+
this.isa = SYM.EVENT;
|
129
|
+
this.doc._dropTag("event");
|
130
|
+
}
|
131
|
+
|
132
|
+
var methods;
|
133
|
+
if ((functions = this.doc.getTag("method")) && functions.length) {
|
134
|
+
this.isa = SYM.FUNCTION;
|
135
|
+
this.doc._dropTag("method");
|
136
|
+
}
|
137
|
+
|
138
|
+
var names;
|
139
|
+
if ((names = this.doc.getTag("name")) && names.length) {
|
140
|
+
this.name = names[0].desc;
|
141
|
+
this.doc._dropTag("name");
|
142
|
+
}
|
143
|
+
|
144
|
+
var properties;
|
145
|
+
if ((properties = this.doc.getTag("property")) && properties.length) {
|
146
|
+
for (var i = 0; i < properties.length; i++) {
|
147
|
+
properties[i].alias = this.alias+"."+properties[i].name;
|
148
|
+
this.properties.push(properties[i]);
|
149
|
+
}
|
150
|
+
this.doc._dropTag("property");
|
151
|
+
}
|
152
|
+
|
153
|
+
var returns;
|
154
|
+
if ((returns = this.doc.getTag("return")) && returns.length) {
|
155
|
+
for (var i = 0; i < returns.length; i++) {
|
156
|
+
this.returns.push(returns[i]);
|
157
|
+
}
|
158
|
+
this.doc._dropTag("return");
|
159
|
+
}
|
160
|
+
|
161
|
+
var exceptions;
|
162
|
+
if ((exceptions = this.doc.getTag("throws")) && exceptions.length) {
|
163
|
+
for (var i = 0; i < exceptions.length; i++) {
|
164
|
+
this.exceptions.push(exceptions[i]);
|
165
|
+
}
|
166
|
+
this.doc._dropTag("throws");
|
167
|
+
}
|
168
|
+
|
169
|
+
if (this.is("VIRTUAL")) this.isa = SYM.OBJECT;
|
170
|
+
|
171
|
+
var types;
|
172
|
+
if ((types = this.doc.getTag("type")) && types.length) {
|
173
|
+
if (this.is("OBJECT"))
|
174
|
+
this.type = (types[0].desc || ""); // multiple type tags are ignored
|
175
|
+
this.doc._dropTag("type");
|
176
|
+
}
|
177
|
+
|
178
|
+
if (this.doc.getTag("static").length > 0) {
|
179
|
+
this.isStatic = true;
|
180
|
+
this.doc._dropTag("static");
|
181
|
+
}
|
182
|
+
|
183
|
+
if (this.doc.getTag("private").length > 0) {
|
184
|
+
this.isPrivate = true;
|
185
|
+
this.doc._dropTag("private");
|
186
|
+
}
|
187
|
+
|
188
|
+
var classes;
|
189
|
+
if ((classes = this.doc.getTag("class")) && classes.length) {
|
190
|
+
if (this.doc.getTag("static").length > 0) this.isStatic = true;
|
191
|
+
this.isa = "CONSTRUCTOR"; // a class tag implies a conctuctor doclet
|
192
|
+
|
193
|
+
this.classDesc += "\n"+classes[0].desc; // multiple class tags are concatenated
|
194
|
+
//this.doc._dropTag("class");
|
195
|
+
}
|
196
|
+
|
197
|
+
var inherits;
|
198
|
+
if ((inherits = this.doc.getTag("inherits")) && inherits.length) {
|
199
|
+
for (var i = 0; i < inherits.length; i++) {
|
200
|
+
this.inherits.push(inherits[i].desc);
|
201
|
+
}
|
202
|
+
this.doc._dropTag("inherits");
|
203
|
+
}
|
204
|
+
|
205
|
+
var augments;
|
206
|
+
if ((augments = this.doc.getTag("augments")) && augments.length) {
|
207
|
+
for (var i = 0; i < augments.length; i++) {
|
208
|
+
this.augments.push(augments[i].desc);
|
209
|
+
}
|
210
|
+
this.doc._dropTag("augments");
|
211
|
+
}
|
212
|
+
|
213
|
+
Symbol.index[this.alias] = this;
|
214
|
+
}
|
215
|
+
}
|
216
|
+
Symbol.shared = ""; // holds shared doclets
|
217
|
+
Symbol.index = {};
|
218
|
+
|
219
|
+
Symbol.prototype.is = function(what) {
|
220
|
+
return this.isa === SYM[what];
|
221
|
+
}
|
222
|
+
|
223
|
+
/** Generate a comma separated list of the parameters. */
|
224
|
+
Symbol.prototype.signature = function() {
|
225
|
+
var result = [];
|
226
|
+
for (var i = 0; i < this.params.length; i++) {
|
227
|
+
if (this.params[i].name.indexOf(".") == -1) // config information does not appear in the signature
|
228
|
+
result.push(this.params[i].name);
|
229
|
+
}
|
230
|
+
return result.join(", ");
|
231
|
+
}
|
232
|
+
|
233
|
+
Symbol.prototype.hasMethod = function(name) {
|
234
|
+
for (var i = 0; i < this.methods.length; i++) {
|
235
|
+
if (this.methods[i].name == name) return true
|
236
|
+
}
|
237
|
+
return false;
|
238
|
+
}
|
239
|
+
|
240
|
+
Symbol.prototype.hasEvent = function(name) {
|
241
|
+
for (var i = 0; i < this.events.length; i++) {
|
242
|
+
if (this.events[i].name == name) return true
|
243
|
+
}
|
244
|
+
return false;
|
245
|
+
}
|
246
|
+
|
247
|
+
Symbol.prototype.hasProperty = function(name) {
|
248
|
+
for (var i = 0; i < this.properties.length; i++) {
|
249
|
+
if (this.properties[i].name == name) return true
|
250
|
+
}
|
251
|
+
return false;
|
252
|
+
}
|
253
|
+
|
254
|
+
Array.prototype.isUnique = function() {
|
255
|
+
var l = this.length;
|
256
|
+
for(var i = 0; i < l; i++ ) {
|
257
|
+
if (this.lastIndexOf(this[i]) > i) return false;
|
258
|
+
}
|
259
|
+
return true;
|
260
|
+
};
|
261
|
+
|
262
|
+
Symbol.prototype.getInheritedMethods = function(r) {
|
263
|
+
var inherited = [];
|
264
|
+
for(var i = 0; i < this.inherits.length; i++) {
|
265
|
+
inherited.push(this.file.fileGroup.getSymbol(this.inherits[i]));
|
266
|
+
}
|
267
|
+
var result = this.methods.concat(inherited);
|
268
|
+
for(var i = 0; i < this.augments.length; i++) {
|
269
|
+
var contributer = this.file.fileGroup.getSymbol(this.augments[i]);
|
270
|
+
if (contributer) {
|
271
|
+
this._inheritsFrom.push(contributer.alias);
|
272
|
+
|
273
|
+
if (!this._inheritsFrom.isUnique()) {
|
274
|
+
LOG.warn("Circular reference: "+this.alias+" inherits from the same symbol more than once.");
|
275
|
+
}
|
276
|
+
else {
|
277
|
+
result = result.concat(contributer.getInheritedMethods(true));
|
278
|
+
this._inheritsFrom = [];
|
279
|
+
}
|
280
|
+
}
|
281
|
+
}
|
282
|
+
// remove overridden
|
283
|
+
for (var i = 0; i < result.length; i++) {
|
284
|
+
var j = i;
|
285
|
+
while (++j < result.length) {
|
286
|
+
if (result[j].name == result[i].name) result.splice(j, 1);
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
if (!r) { // not recursing
|
291
|
+
var s = this;
|
292
|
+
function notLocal(element, index, array) {
|
293
|
+
return (!s.hasMethod(element.name));
|
294
|
+
}
|
295
|
+
result = result.filter(notLocal);
|
296
|
+
}
|
297
|
+
return result;
|
298
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/** @class Use a style sheet to transform XML. Requires Rhino. */
|
2
|
+
function Transformer(xsl) { //like: var t = new Transformer("data/teststyle.xsl");
|
3
|
+
var xsltFile = new Packages.java.io.File(xsl);
|
4
|
+
var xsltSource = new Packages.javax.xml.transform.stream.StreamSource(xsltFile);
|
5
|
+
this.transformer = Packages.javax.xml.transform.TransformerFactory.newInstance().newTransformer(xsltSource);
|
6
|
+
}
|
7
|
+
|
8
|
+
Transformer.prototype.transform = function(xml, out) { //like: t.transform("data/testdata.xml", "data/testout.txt");
|
9
|
+
var xmlFile = new Packages.java.io.File(xml);
|
10
|
+
var resFile = new Packages.java.io.File(out);
|
11
|
+
var xmlSource = new Packages.javax.xml.transform.stream.StreamSource(xmlFile);
|
12
|
+
var result = new Packages.javax.xml.transform.stream.StreamResult(resFile);
|
13
|
+
this.transformer.transform(xmlSource, result);
|
14
|
+
}
|
data/jsdoc/app/Util.js
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
/**
|
2
|
+
* @fileOverview
|
3
|
+
* @name Util
|
4
|
+
* @author Michael Mathews micmath@gmail.com
|
5
|
+
* @url $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-1.4.0b/app/Util.js $
|
6
|
+
* @revision $Id: Util.js 244 2007-09-23 09:42:21Z micmath $
|
7
|
+
* @license <a href="http://en.wikipedia.org/wiki/MIT_License">X11/MIT License</a>
|
8
|
+
* (See the accompanying README file for full details.)
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @class Various utility methods used by JsDoc.
|
13
|
+
* @static
|
14
|
+
*/
|
15
|
+
Util = {
|
16
|
+
/**
|
17
|
+
* Turn a path into just the name of the file.
|
18
|
+
* @static
|
19
|
+
* @param {string} path
|
20
|
+
* @return {string} The fileName portion of the path.
|
21
|
+
*/
|
22
|
+
fileName: function(path) {
|
23
|
+
var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
|
24
|
+
return path.substring(nameStart);
|
25
|
+
},
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Turn a path into just the directory part.
|
29
|
+
* @static
|
30
|
+
* @param {string} path
|
31
|
+
* @return {string} The directory part of the path.
|
32
|
+
*/
|
33
|
+
dir: function(path) {
|
34
|
+
var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
|
35
|
+
return path.substring(0, nameStart-1);
|
36
|
+
},
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Get commandline option values.
|
40
|
+
* @static
|
41
|
+
* @param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"]
|
42
|
+
* @param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}.
|
43
|
+
* @return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true}
|
44
|
+
*/
|
45
|
+
getOptions: function(args, optNames) {
|
46
|
+
var opt = {"_": []}; // the unnamed option allows multiple values
|
47
|
+
for (var i = 0; i < args.length; i++) {
|
48
|
+
var arg = new String(args[i]);
|
49
|
+
var name;
|
50
|
+
var value;
|
51
|
+
if (arg.charAt(0) == "-") {
|
52
|
+
if (arg.charAt(1) == "-") { // it's a longname like --foo
|
53
|
+
arg = arg.substring(2);
|
54
|
+
var m = arg.split("=");
|
55
|
+
name = m.shift();
|
56
|
+
value = m.shift();
|
57
|
+
if (typeof value == "undefined") value = true;
|
58
|
+
|
59
|
+
for (var n in optNames) { // convert it to a shortname
|
60
|
+
if (name == optNames[n]) {
|
61
|
+
name = n;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
else { // it's a shortname like -f
|
66
|
+
arg = arg.substring(1);
|
67
|
+
var m = arg.split("=");
|
68
|
+
name = m.shift();
|
69
|
+
value = m.shift();
|
70
|
+
if (typeof value == "undefined") value = true;
|
71
|
+
|
72
|
+
for (var n in optNames) { // find the matching key
|
73
|
+
if (name == n || name+'[]' == n) {
|
74
|
+
name = n;
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
if (name.match(/(.+)\[\]$/)) { // it's an array type like n[]
|
80
|
+
name = RegExp.$1;
|
81
|
+
if (!opt[name]) opt[name] = [];
|
82
|
+
}
|
83
|
+
|
84
|
+
if (opt[name] && opt[name].push) {
|
85
|
+
opt[name].push(value);
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
opt[name] = value;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
else { // not associated with any optname
|
92
|
+
opt._.push(args[i]);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
return opt;
|
96
|
+
}
|
97
|
+
}
|
data/jsdoc/app/js.jar
ADDED
Binary file
|
data/jsdoc/app/run.js
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
var VERBOSE = false;
|
2
|
+
try {
|
3
|
+
importClass(java.lang.System);
|
4
|
+
}
|
5
|
+
catch (e) {
|
6
|
+
throw "RuntimeException: The class java.lang.System is required to run this script.";
|
7
|
+
}
|
8
|
+
|
9
|
+
var __DIR__ = (System.getProperty("jsdoc.dir")||System.getProperty("user.dir"))+Packages.java.io.File.separator;
|
10
|
+
|
11
|
+
/** Load required libraries. */
|
12
|
+
function require(lib) {
|
13
|
+
var libDirs = ['', __DIR__, __DIR__+'app/', __DIR__+'../'];
|
14
|
+
var libErrors = [];
|
15
|
+
for(var i = 0; i < libDirs.length; i++) {
|
16
|
+
try {
|
17
|
+
var file = new Packages.java.io.File(libDirs[i]+lib);
|
18
|
+
if(!file.exists()) {
|
19
|
+
libErrors.push('Could not find: ['+(libDirs[i]+lib)+']');
|
20
|
+
}
|
21
|
+
else {
|
22
|
+
if (VERBOSE) print("Loading: ["+(libDirs[i]+lib)+"] ...");
|
23
|
+
load(libDirs[i]+lib);
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
catch (e) {
|
28
|
+
libErrors.push('Error loading: ['+(libDirs[i]+lib)+']');
|
29
|
+
}
|
30
|
+
}
|
31
|
+
for(var i=0; i < libErrors.length; i++) {
|
32
|
+
print("ERROR: ["+libErrors[i]+"]");
|
33
|
+
}
|
34
|
+
quit();
|
35
|
+
}
|
36
|
+
|
37
|
+
require("app/JsDoc.js");
|
38
|
+
require("app/Util.js");
|
39
|
+
|
40
|
+
JsDoc.opt = Util.getOptions(arguments, {d:'directory', t:'template', r:'recurse', x:'ext', p:'private', a:'allfunctions', A:'Allfunctions', e:'encoding', o:'out', h:'help', 'D[]':'define'});
|
41
|
+
VERBOSE = JsDoc.opt.v;
|
42
|
+
|
43
|
+
require("app/JsIO.js");
|
44
|
+
require("app/Symbol.js");
|
45
|
+
require("app/JsToke.js");
|
46
|
+
require("app/JsParse.js");
|
47
|
+
require("app/DocTag.js");
|
48
|
+
require("app/Doclet.js");
|
49
|
+
require("app/DocFile.js");
|
50
|
+
require("app/JsPlate.js");
|
51
|
+
|
52
|
+
/** The main function. Called automatically. */
|
53
|
+
function Main() {
|
54
|
+
if (JsDoc.opt.o) LOG.out = IO.open(JsDoc.opt.o, true);
|
55
|
+
if (!JsDoc.opt.e) JsDoc.opt.e = "utf-8";
|
56
|
+
IO.setEncoding(JsDoc.opt.e);
|
57
|
+
|
58
|
+
if (JsDoc.opt.c) {
|
59
|
+
eval('conf = '+IO.readFile(JsDoc.opt.c));
|
60
|
+
|
61
|
+
for (var c in conf) {
|
62
|
+
if (c !== "D") {
|
63
|
+
JsDoc.opt[c] = conf[c];
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
if (JsDoc.opt.h || JsDoc.opt._.length == 0 || JsDoc.opt.t === true) JsDoc.usage();
|
68
|
+
|
69
|
+
var ext = ["js"];
|
70
|
+
if (JsDoc.opt.x) ext = JsDoc.opt.x.split(",").map(function(x) {return x.toLowerCase()});
|
71
|
+
|
72
|
+
if (typeof(JsDoc.opt.r) == "boolean") JsDoc.opt.r = 10;
|
73
|
+
else if (!isNaN(parseInt(JsDoc.opt.r))) JsDoc.opt.r = parseInt(JsDoc.opt.r);
|
74
|
+
else JsDoc.opt.r = 1;
|
75
|
+
|
76
|
+
if (JsDoc.opt.d === true || JsDoc.opt.t === true) { // like when a user enters: -d mydir
|
77
|
+
LOG.warn("Option malformed.");
|
78
|
+
JsDoc.usage();
|
79
|
+
}
|
80
|
+
else if (!JsDoc.opt.d) {
|
81
|
+
JsDoc.opt.d = "js_docs_out";
|
82
|
+
}
|
83
|
+
|
84
|
+
JsDoc.opt.d += (JsDoc.opt.d.indexOf(IO.FileSeparator) == JsDoc.opt.d.length-1)?
|
85
|
+
"" : IO.FileSeparator;
|
86
|
+
LOG.inform("Creating output directory: "+JsDoc.opt.d);
|
87
|
+
IO.makeDir(JsDoc.opt.d);
|
88
|
+
|
89
|
+
LOG.inform("Scanning for source files: recursion set to "+JsDoc.opt.r+" subdir"+((JsDoc.opt.r==1)?"":"s")+".");
|
90
|
+
function isJs(element, index, array) {
|
91
|
+
var thisExt = element.split(".").pop().toLowerCase();
|
92
|
+
return (ext.indexOf(thisExt) > -1); // we're only interested in files with certain extensions
|
93
|
+
}
|
94
|
+
var srcFiles = [];
|
95
|
+
for (var d = 0; d < JsDoc.opt._.length; d++) {
|
96
|
+
srcFiles = srcFiles.concat(
|
97
|
+
IO.ls(JsDoc.opt._[d], JsDoc.opt.r).filter(isJs)
|
98
|
+
);
|
99
|
+
}
|
100
|
+
|
101
|
+
LOG.inform(srcFiles.length+" source file"+((srcFiles ==1)?"":"s")+" found:\n\t"+srcFiles.join("\n\t"));
|
102
|
+
var fileGroup = JsDoc.parse(srcFiles, JsDoc.opt);
|
103
|
+
|
104
|
+
var D = {};
|
105
|
+
if (JsDoc.opt.D) {
|
106
|
+
for (var i = 0; i < JsDoc.opt.D.length; i++) {
|
107
|
+
var defineParts = JsDoc.opt.D[i].split(":", 2);
|
108
|
+
D[defineParts[0]] = defineParts[1];
|
109
|
+
}
|
110
|
+
JsDoc.opt.D = D;
|
111
|
+
}
|
112
|
+
else {
|
113
|
+
JsDoc.opt.D = {};
|
114
|
+
}
|
115
|
+
|
116
|
+
// combine any conf file D options with the commandline D options
|
117
|
+
if (typeof conf != "undefined") for (var c in conf.D) {
|
118
|
+
if (typeof JsDoc.opt.D[c] == "undefined") {
|
119
|
+
JsDoc.opt.D[c] = conf.D[c];
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
if (JsDoc.opt.t && IO.exists(JsDoc.opt.t)) {
|
124
|
+
JsDoc.opt.t += (JsDoc.opt.t.indexOf(IO.FileSeparator)==JsDoc.opt.t.length-1)?
|
125
|
+
"" : IO.FileSeparator;
|
126
|
+
LOG.inform("Loading template: "+JsDoc.opt.t+"publish.js");
|
127
|
+
require(JsDoc.opt.t+"publish.js");
|
128
|
+
|
129
|
+
LOG.inform("Publishing all files...");
|
130
|
+
publish(fileGroup, JsDoc.opt);
|
131
|
+
LOG.inform("Finished.");
|
132
|
+
}
|
133
|
+
else {
|
134
|
+
LOG.warn("Use the -t option to specify a template for formatting.");
|
135
|
+
LOG.warn("Dumping results to stdout.");
|
136
|
+
require("app/Dumper.js");
|
137
|
+
print(Dumper.dump(fileGroup));
|
138
|
+
}
|
139
|
+
|
140
|
+
if (LOG.out) LOG.out.close();
|
141
|
+
if (LOG.warnings.length > 0) print(LOG.warnings.length+" warnings.");
|
142
|
+
}
|
143
|
+
|
144
|
+
Main();
|