├── .gitignore ├── vendor └── jsdoc-toolkit │ ├── jsdoc-toolkit │ ├── app │ ├── test │ │ ├── shared2.js │ │ ├── scripts │ │ │ ├── code.js │ │ │ └── notcode.txt │ │ ├── encoding_other.js │ │ ├── public.js │ │ ├── encoding.js │ │ ├── prototype_nested.js │ │ ├── global.js │ │ ├── ignore.js │ │ ├── nocode.js │ │ ├── anon_inner.js │ │ ├── params_optional.js │ │ ├── prototype_oblit.js │ │ ├── static_this.js │ │ ├── variable_redefine.js │ │ ├── inner.js │ │ ├── exports.js │ │ ├── oblit_anon.js │ │ ├── prototype.js │ │ ├── name.js │ │ ├── module.js │ │ ├── memberof_constructor.js │ │ ├── memberof3.js │ │ ├── shortcuts.js │ │ ├── namespace_nested.js │ │ ├── borrows2.js │ │ ├── memberof.js │ │ ├── tosource.js │ │ ├── augments2.js │ │ ├── constructs.js │ │ ├── addon.js │ │ ├── augments.js │ │ ├── overview.js │ │ ├── prototype_oblit_constructor.js │ │ ├── synonyms.js │ │ ├── config.js │ │ ├── globals.js │ │ ├── lend.js │ │ ├── memberof2.js │ │ ├── multi_methods.js │ │ ├── shared.js │ │ ├── functions_anon.js │ │ ├── param_inline.js │ │ ├── functions_nested.js │ │ ├── borrows.js │ │ └── event.js │ ├── frame │ │ ├── Namespace.js │ │ ├── Reflection.js │ │ ├── Hash.js │ │ ├── String.js │ │ ├── Chain.js │ │ ├── Opt.js │ │ ├── Testrun.js │ │ ├── Dumper.js │ │ └── Link.js │ ├── plugins │ │ ├── symbolLink.js │ │ ├── functionCall.js │ │ ├── commentSrcJson.js │ │ ├── frameworkPrototype.js │ │ ├── tagParamConfig.js │ │ ├── tagSynonyms.js │ │ └── publishSrcHilite.js │ ├── t │ │ ├── runner.js │ │ └── TestDoc.js │ ├── lib │ │ ├── JSDOC │ │ │ ├── Token.js │ │ │ ├── TextStream.js │ │ │ ├── Util.js │ │ │ ├── PluginManager.js │ │ │ ├── TokenStream.js │ │ │ ├── Lang.js │ │ │ ├── JsPlate.js │ │ │ ├── JsDoc.js │ │ │ ├── Parser.js │ │ │ ├── DocComment.js │ │ │ ├── SymbolSet.js │ │ │ ├── TokenReader.js │ │ │ └── DocTag.js │ │ └── JSDOC.js │ ├── handlers │ │ ├── XMLDOC │ │ │ ├── XMLDoc.js │ │ │ ├── DomReader.js │ │ │ └── XMLParse.js │ │ ├── XMLDOC.js │ │ └── FOODOC.js │ ├── frame.js │ ├── main.js │ └── run.js │ ├── templates │ └── jsdoc │ │ ├── static │ │ ├── header.html │ │ ├── index.html │ │ └── default.css │ │ ├── allclasses.tmpl │ │ ├── symbol.tmpl │ │ ├── index.tmpl │ │ ├── allfiles.tmpl │ │ └── publish.js │ ├── jsrun.jar │ ├── jsdebug.jar │ ├── java │ ├── classes │ │ └── js.jar │ ├── src │ │ ├── JsRun.java │ │ └── JsDebugRun.java │ ├── build.xml │ └── build_1.4.xml │ ├── conf │ └── sample.conf │ ├── jsrun.sh │ ├── README.txt │ └── changes.txt ├── monit.txt ├── install.sh ├── server.js ├── package.json ├── engine.js ├── worker.js └── config.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/jsdoc-toolkit: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/shared2.js: -------------------------------------------------------------------------------- 1 | startOver = function(){ 2 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/static/header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/scripts/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | @class 3 | */ 4 | function thisiscode() { 5 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/scripts/notcode.txt: -------------------------------------------------------------------------------- 1 | (This is not code) 2 | function foo(){{{{ 3 | ( 4 | ! 5 | @ -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/jsrun.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/documentor-worker/master/vendor/jsdoc-toolkit/jsrun.jar -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/jsdebug.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/documentor-worker/master/vendor/jsdoc-toolkit/jsdebug.jar -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/java/classes/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/documentor-worker/master/vendor/jsdoc-toolkit/java/classes/js.jar -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/encoding_other.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/documentor-worker/master/vendor/jsdoc-toolkit/app/test/encoding_other.js -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/public.js: -------------------------------------------------------------------------------- 1 | /**@constructor*/ 2 | function Foo() { 3 | /** 4 | @public 5 | @static 6 | @field 7 | */ 8 | var bar = function(x) { 9 | } 10 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/encoding.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @Constructor 4 | * @desc 配置文件 5 | * @class 什么也不返回 6 | */ 7 | function Test(conf) { 8 | // do something; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/prototype_nested.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Word() { 3 | } 4 | 5 | Word.prototype.reverse = function() { 6 | } 7 | 8 | Word.prototype.reverse.utf8 = function() { 9 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/global.js: -------------------------------------------------------------------------------- 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 | } 14 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/ignore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A test constructor. 3 | * @constructor 4 | * @ignore 5 | */ 6 | function Ignored() { 7 | /** a method */ 8 | this.bar = function() { 9 | } 10 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/nocode.js: -------------------------------------------------------------------------------- 1 | /**#nocode+*/ 2 | /** 3 | @name star 4 | @function 5 | */ 6 | function blahblah() { 7 | 8 | } 9 | /**#nocode-*/ 10 | 11 | function yaddayadda() { 12 | 13 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Namespace.js: -------------------------------------------------------------------------------- 1 | _global_ = this; 2 | 3 | function Namespace(name, f) { 4 | var n = name.split("."); 5 | for (var o = _global_, i = 0, l = n.length; i < l; i++) { 6 | o = o[n[i]] = o[n[i]] || {}; 7 | } 8 | 9 | if (f) f(); 10 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/anon_inner.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name bar 3 | * @namespace 4 | */ 5 | 6 | new function() { 7 | /** 8 | * @name bar-foo 9 | * @function 10 | * @param {number} x 11 | */ 12 | function foo(x) { 13 | } 14 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/params_optional.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @param {Page[]} pages 4 | * @param {number} [id] Specifies the id, if applicable. 5 | * @param {String} [title = This is untitled.] Specifies the title. 6 | */ 7 | function Document(pages, id, title){ 8 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/prototype_oblit.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Article() { 3 | } 4 | 5 | Article.prototype = { 6 | /** instance get title */ 7 | getTitle: function(){ 8 | } 9 | } 10 | 11 | /** static get title */ 12 | Article.getTitle = function(){ 13 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/static_this.js: -------------------------------------------------------------------------------- 1 | /** the parent */ 2 | var box = {}; 3 | 4 | /** @namespace */ 5 | box.holder = {} 6 | 7 | box.holder.foo = function() { 8 | /** the counter */ 9 | this.counter = 1; 10 | } 11 | 12 | box.holder.foo(); 13 | print(box.holder.counter); 14 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/variable_redefine.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Foo() { 3 | var bar = 1; 4 | bar = 2; // redefining a private 5 | 6 | this.baz = 1; 7 | baz = 2; // global 8 | 9 | /** a private */ 10 | var blap = { 11 | /** in here */ 12 | tada: 1 13 | } 14 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/inner.js: -------------------------------------------------------------------------------- 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 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/symbolLink.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.symbolLink", 3 | { 4 | onSymbolLink: function(link) { 5 | // modify link.linkPath (the href part of the link) 6 | // or link.linkText (the text displayed) 7 | // or link.linkInner (the #name part of the link) 8 | } 9 | } 10 | ); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/exports.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | var mxn = {}; 3 | 4 | (function(){ 5 | /** @exports Map as mxn.Map */ 6 | var Map = 7 | /** @constructor */ 8 | mxn.Map = function() { 9 | }; 10 | 11 | /** A method. */ 12 | Map.prototype.doThings = function() { 13 | }; 14 | })(); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/functionCall.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.functionCall", 3 | { 4 | onFunctionCall: function(functionCall) { 5 | if (functionCall.name == "dojo.define" && functionCall.arg1) { 6 | functionCall.doc = "/** @lends "+eval(functionCall.arg1)+".prototype */"; 7 | } 8 | } 9 | } 10 | ); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/oblit_anon.js: -------------------------------------------------------------------------------- 1 | /** the options */ 2 | opt = Opt.get( 3 | arguments, 4 | { 5 | d: "directory", 6 | c: "conf", 7 | "D[]": "define" 8 | } 9 | ); 10 | 11 | /** configuration */ 12 | opt.conf = { 13 | /** keep */ 14 | keep: true, 15 | /** base */ 16 | base: getBase(this, {p: properties}) 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /monit.txt: -------------------------------------------------------------------------------- 1 | check host server with address 127.0.0.1 2 | start program = "/usr/local/bin/node /home/openbirdie/docs/server.js" 3 | as uid openbirdie and gid openbirdie 4 | stop program = "/usr/bin/pkill -f 'node /home/openbirdie/docs/server.js'" 5 | as uid root and gid root 6 | if failed port 9031 7 | with timeout 10 seconds 8 | then restart -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/prototype.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Article() { 3 | } 4 | 5 | Article.prototype.init = function(title) { 6 | /** the instance title */ 7 | this.title = title; 8 | 9 | /** the static counter */ 10 | Article.counter = 1; 11 | } 12 | 13 | a = new Article(); 14 | a.Init("my title"); 15 | 16 | print(a.title); 17 | print(Article.counter); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/name.js: -------------------------------------------------------------------------------- 1 | /** 2 | @name Response 3 | @class 4 | */ 5 | 6 | Response.prototype = { 7 | /** 8 | @name Response#text 9 | @function 10 | @description 11 | Gets the body of the response as plain text 12 | @returns {String} 13 | Response as text 14 | */ 15 | 16 | text: function() { 17 | return this.nativeResponse.responseText; 18 | } 19 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/module.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | myProject = myProject || {}; 3 | 4 | /** @namespace */ 5 | myProject.myModule = (function () { 6 | /** describe myPrivateVar here */ 7 | var myPrivateVar = ""; 8 | 9 | var myPrivateMethod = function () { 10 | } 11 | 12 | /** @scope myProject.myModule */ 13 | return { 14 | myPublicMethod: function () { 15 | } 16 | }; 17 | })(); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/memberof_constructor.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Circle(){} 3 | 4 | /** 5 | @constructor 6 | @memberOf Circle# 7 | */ 8 | Circle.prototype.Tangent = function(){}; 9 | 10 | // renaming Circle#Tangent to Circle#Circle#Tangent 11 | 12 | /** 13 | @memberOf Circle#Tangent# 14 | */ 15 | Circle.prototype.Tangent.prototype.getDiameter = function(){}; 16 | 17 | 18 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/memberof3.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Foo 3 | * @class 4 | */ 5 | 6 | /**#@+ 7 | * @memberOf Foo# 8 | * @field 9 | */ 10 | 11 | /** 12 | * @name bar 13 | * @type Object[] 14 | */ 15 | 16 | /**#@-*/ 17 | 18 | /** 19 | * @name Foo2 20 | * @class 21 | */ 22 | 23 | /**#@+ 24 | * @memberOf Foo2# 25 | * @field 26 | */ 27 | 28 | /** 29 | * @name bar 30 | * @type Object[] 31 | */ 32 | 33 | /**#@-*/ -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/shortcuts.js: -------------------------------------------------------------------------------- 1 | // /**#=+ 2 | // * { 3 | // * 'D': 'Date.prototype', 4 | // * '$N': 'Number' 5 | // * } 6 | // */ 7 | // var D = Date.prototype, 8 | // $N = Number; 9 | // 10 | // D.locale = function(){ 11 | // }; 12 | // 13 | // /** 14 | // @return {string} The cardinal number string. 15 | // */ 16 | // $N.nth = function(n){ 17 | // }; 18 | // 19 | // LOAD.file = function(){ 20 | // } 21 | // 22 | // /**#=-*/ -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/t/runner.js: -------------------------------------------------------------------------------- 1 | // try: java -jar ../../jsrun.jar runner.js 2 | 3 | load("TestDoc.js"); 4 | 5 | TestDoc.prove("../frame/Opt.js"); 6 | TestDoc.prove("../lib/JSDOC.js"); 7 | TestDoc.prove("../frame/String.js"); 8 | TestDoc.prove("../lib/JSDOC/DocTag.js"); 9 | TestDoc.prove("../lib/JSDOC/DocComment.js"); 10 | TestDoc.prove("../lib/JSDOC/TokenReader.js"); 11 | TestDoc.prove("../lib/JSDOC/Symbol.js"); 12 | 13 | TestDoc.report(); 14 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/namespace_nested.js: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace This is the first namespace. 3 | */ 4 | ns1 = {}; 5 | 6 | /** 7 | This is the second namespace. 8 | @namespace 9 | */ 10 | ns1.ns2 = {}; 11 | 12 | /** 13 | This part of ns1.ns2 14 | @constructor 15 | */ 16 | ns1.ns2.Function1 = function() { 17 | }; 18 | 19 | ns1.staticFunction = function() { 20 | }; 21 | 22 | /** A static field in a namespace. */ 23 | ns1.ns2.staticField = 1; 24 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/borrows2.js: -------------------------------------------------------------------------------- 1 | // testing circular borrows 2 | 3 | /** 4 | @class 5 | @borrows Bar#zop as this.my_zop 6 | */ 7 | function Foo() { 8 | /** this is a zip. */ 9 | this.zip = function() {} 10 | 11 | this.my_zop = new Bar().zop; 12 | } 13 | 14 | /** 15 | @class 16 | @borrows Foo#zip as this.my_zip 17 | */ 18 | function Bar() { 19 | /** this is a zop. */ 20 | this.zop = function() {} 21 | 22 | this.my_zip = new Foo().zip; 23 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/memberof.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | pack = function() { 3 | this.init = function(){} 4 | function config(){} 5 | } 6 | 7 | pack.build = function(task) {}; 8 | 9 | /** @memberOf pack */ 10 | pack.install = function() {} 11 | 12 | /** @memberOf pack */ 13 | pack.install.overwrite = function() {} 14 | 15 | /** @memberOf pack */ 16 | clean = function() {} 17 | 18 | /** @memberOf pack-config */ 19 | install = function() {}; 20 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/tosource.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {Object} object 3 | * @return {string} 4 | */ 5 | function valueOf(object) {} 6 | 7 | /** 8 | * @param {Object} object 9 | * @return {string} 10 | */ 11 | function toString(object) {} 12 | 13 | /** 14 | * @param {Object} object 15 | * @return {string} 16 | */ 17 | function toSource(object) {} 18 | 19 | /** 20 | * @param {Object} object 21 | * @return {string} 22 | */ 23 | function constructor(object) {} -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/augments2.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | function LibraryItem() { 5 | this.reserve = function() { 6 | } 7 | } 8 | 9 | /** 10 | @constructor 11 | */ 12 | function Junkmail() { 13 | this.annoy = function() { 14 | } 15 | } 16 | 17 | /** 18 | @inherits Junkmail.prototype.annoy as pester 19 | @augments ThreeColumnPage 20 | @augments LibraryItem 21 | @constructor 22 | */ 23 | function NewsletterPage() { 24 | this.getHeadline = function() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/Token.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @constructor 5 | */ 6 | JSDOC.Token = function(data, type, name) { 7 | this.data = data; 8 | this.type = type; 9 | this.name = name; 10 | } 11 | 12 | JSDOC.Token.prototype.toString = function() { 13 | return "<"+this.type+" name=\""+this.name+"\">"+this.data+""; 14 | } 15 | 16 | JSDOC.Token.prototype.is = function(what) { 17 | return this.name === what || this.type === what; 18 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/constructs.js: -------------------------------------------------------------------------------- 1 | var Person = makeClass( 2 | /** 3 | @scope Person 4 | */ 5 | { 6 | /** 7 | This is just another way to define a constructor. 8 | @constructs 9 | @param {string} name The name of the person. 10 | */ 11 | initialize: function(name) { 12 | this.name = name; 13 | }, 14 | say: function(message) { 15 | return this.name + " says: " + message; 16 | } 17 | } 18 | ); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/addon.js: -------------------------------------------------------------------------------- 1 | String.prototype.reverse = function() { 2 | } 3 | 4 | String.prototype.reverse.utf8 = function() { 5 | } 6 | 7 | Function.count = function() { 8 | } 9 | 10 | /** @memberOf Function */ 11 | Function.count.reset = function() { 12 | } 13 | 14 | /** @memberOf Function */ 15 | count.getValue = function() { 16 | } 17 | 18 | /** @memberOf Function.prototype */ 19 | getSig = function() { 20 | } 21 | 22 | /** @memberOf Function.prototype */ 23 | Function.prototype.getProps = function() { 24 | } 25 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/augments.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | function Layout(p) { 5 | this.init = function(p) { 6 | } 7 | 8 | this.getId = function() { 9 | } 10 | 11 | /** @type Page */ 12 | this.orientation = "landscape"; 13 | } 14 | 15 | /** 16 | @constructor 17 | @augments Layout 18 | */ 19 | function Page() { 20 | this.reset = function(b) { 21 | } 22 | } 23 | 24 | /** 25 | @extends Page 26 | @constructor 27 | */ 28 | function ThreeColumnPage() { 29 | this.init = function(resetCode) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/overview.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @overview This "library" contains a 3 | * lot of classes and functions. 4 | * @example 5 |
 6 | 	var x (x < 1);
 7 | 	alert("This 'is' \"code\"");
 8 |  
9 | * @name My Cool Library 10 | * @author Joe Smith jsmith@company.com 11 | * @version 0.1 12 | */ 13 | 14 | /** 15 | * Gets the current foo 16 | * @param {String} fooId The unique identifier for the foo. 17 | * @return {Object} Returns the current foo. 18 | */ 19 | function getFoo(fooID){ 20 | } -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | # SVN 2 | yum install subversion 3 | 4 | # S3CMD 5 | wget http://s3tools.org/repo/RHEL_6/s3tools.repo -o /etc/yum.repos.d/s3tools.repo 6 | yum install -y s3cmd 7 | # s3cmd sync --acl-public --delete-removed ~/prototype-docs/ s3://docs.node.ee/proto/ 8 | 9 | # Install PHP + phpdoc 10 | yum -y install php php-pear php-cli php-common 11 | pear update-channels 12 | pear install PhpDocumentor 13 | 14 | # Install Ruby 15 | yum install -y ruby-devel rubygems 16 | 17 | # Install PDOC + JSDuck 18 | gem install json rdiscount pdoc jsduck 19 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl: -------------------------------------------------------------------------------- 1 |
{+new Link().toFile("index.html").withText("Class Index")+} 2 | | {+new Link().toFile("files.html").withText("File Index")+}
3 |
4 |

Classes

5 | 17 |
-------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/prototype_oblit_constructor.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | function Article() { 3 | } 4 | 5 | Article.prototype = { 6 | /** @constructor */ 7 | Title: function(title) { 8 | /** the value of the Title instance */ 9 | this.title = title; 10 | }, 11 | 12 | init: function(pages) { 13 | /** the value of the pages of the Article instance */ 14 | this.pages = pages; 15 | } 16 | } 17 | 18 | f = new Article(); 19 | f.init("one two three"); 20 | 21 | t = new f.Title("my title"); 22 | 23 | print(f.pages); 24 | print(t.title); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js: -------------------------------------------------------------------------------- 1 | LOG.inform("XMLDOC.symbolize loaded"); 2 | 3 | /** 4 | * Convert the source file to a set of symbols 5 | */ 6 | XMLDOC.symbolize = function(srcFile, src) { 7 | 8 | LOG.inform("Symbolizing file '" + srcFile + "'"); 9 | 10 | // XML files already have a defined structure, so we don't need to 11 | // do anything but parse them. The DOM reader can create a symbol 12 | // table from the parsed XML. 13 | var dr = new XMLDOC.DomReader(XMLDOC.Parser.parse(src)); 14 | return dr.getSymbols(srcFile); 15 | 16 | }; 17 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/commentSrcJson.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.commentSrcJson", 3 | { 4 | onDocCommentSrc: function(comment) { 5 | var json; 6 | if (/^\s*@json\b/.test(comment)) { 7 | comment.src = new String(comment.src).replace("@json", ""); 8 | 9 | eval("json = "+comment.src); 10 | var tagged = ""; 11 | for (var i in json) { 12 | var tag = json[i]; 13 | // todo handle cases where tag is an object 14 | tagged += "@"+i+" "+tag+"\n"; 15 | } 16 | comment.src = tagged; 17 | } 18 | } 19 | } 20 | ); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/frameworkPrototype.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.frameworkPrototype", 3 | { 4 | onPrototypeClassCreate: function(classCreator) { 5 | var desc = ""; 6 | if (classCreator.comment) { 7 | desc = classCreator.comment; 8 | } 9 | var insert = desc+"/** @name "+classCreator.name+"\n@constructor\n@scope "+classCreator.name+".prototype */" 10 | 11 | insert = insert.replace(/\*\/\/\*\*/g, "\n"); 12 | /*DEBUG*///print("insert is "+insert); 13 | classCreator.addComment.data = insert; 14 | } 15 | } 16 | ); 17 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/synonyms.js: -------------------------------------------------------------------------------- 1 | /** 2 | @class 3 | @inherits Bar#zop as #my_zop 4 | */ 5 | function Foo() { 6 | /** this is a zip. */ 7 | this.zip = function() {} 8 | 9 | /** from Bar */ 10 | this.my_zop = new Bar().zop; 11 | } 12 | 13 | /** 14 | @class 15 | @borrows Foo#zip as this.my_zip 16 | */ 17 | function Bar() { 18 | /** this is a zop. */ 19 | this.zop = function() {} 20 | 21 | /** from Foo */ 22 | this.my_zip = new Foo().zip; 23 | } 24 | 25 | /** @namespace */ 26 | var myObject = { 27 | /** 28 | @type function 29 | */ 30 | myFunc: getFunction() 31 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/handlers/XMLDOC.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the main container for the XMLDOC handler. 3 | * @namespace 4 | * @author Brett Fattori (bfattori@fry.com) 5 | * @version $Revision: 498 $ 6 | */ 7 | XMLDOC = { 8 | 9 | }; 10 | 11 | /** The current version string of this application. */ 12 | XMLDOC.VERSION = "1.0"; 13 | 14 | /** Include the library necessary to handle XML files */ 15 | IO.includeDir("handlers/XMLDOC/"); 16 | 17 | /** 18 | * @type Symbol[] 19 | */ 20 | XMLDOC.handle = function(srcFile, src) { 21 | 22 | }; 23 | 24 | XMLDOC.publish = function(symbolgroup) { 25 | 26 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | * @param person The person. 4 | * @param {string} person.name The person's name. 5 | * @config {integer} age The person's age. 6 | * @config [id=1] Optional id number to use. 7 | * @param connection 8 | */ 9 | function Contact(person, connection) { 10 | 11 | } 12 | 13 | /** 14 | * @constructor 15 | * @param persons 16 | * @config {string} Father The paternal person. 17 | * @config {string} Mother The maternal person. 18 | * @config {string[]} Children And the rest. 19 | */ 20 | function Family(/**Object*/persons) { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/handlers/FOODOC.js: -------------------------------------------------------------------------------- 1 | /** 2 | This is the main container for the FOODOC handler. 3 | @namespace 4 | */ 5 | FOODOC = { 6 | }; 7 | 8 | /** The current version string of this application. */ 9 | FOODOC.VERSION = "1.0"; 10 | 11 | FOODOC.handle = function(srcFile, src) { 12 | LOG.inform("Handling file '" + srcFile + "'"); 13 | 14 | return [ 15 | new JSDOC.Symbol( 16 | "foo", 17 | [], 18 | "VIRTUAL", 19 | new JSDOC.DocComment("/** This is a foo. */") 20 | ) 21 | ]; 22 | }; 23 | 24 | FOODOC.publish = function(symbolgroup) { 25 | LOG.inform("Publishing symbolgroup."); 26 | }; 27 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/globals.js: -------------------------------------------------------------------------------- 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 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/lend.js: -------------------------------------------------------------------------------- 1 | /** @class */ 2 | var Person = Class.create( 3 | /** 4 | @lends Person.prototype 5 | */ 6 | { 7 | initialize: function(name) { 8 | this.name = name; 9 | }, 10 | say: function(message) { 11 | return this.name + ': ' + message; 12 | } 13 | } 14 | ); 15 | 16 | /** @lends Person.prototype */ 17 | { 18 | /** like say but more musical */ 19 | sing: function(song) { 20 | } 21 | } 22 | 23 | /** @lends Person */ 24 | { 25 | getCount: function() { 26 | } 27 | } 28 | 29 | /** @lends Unknown.prototype */ 30 | { 31 | notok: function() { 32 | } 33 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/memberof2.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | */ 4 | function Foo() { 5 | /** 6 | @memberOf Foo.prototype 7 | */ 8 | function bar(a, b) { 9 | } 10 | 11 | /** 12 | @memberOf Foo 13 | */ 14 | var zip = function(p, q) { 15 | } 16 | 17 | /** 18 | @memberOf Foo 19 | */ 20 | function zop( x,y ) { 21 | } 22 | 23 | /** 24 | @memberOf Foo 25 | @constructor 26 | */ 27 | function Fiz() { 28 | /** A method of Foo#Fiz. */ 29 | this.fipple = function(fop){} 30 | } 31 | } 32 | 33 | /** 34 | @memberOf Foo# 35 | */ 36 | var blat = function() { 37 | 38 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/multi_methods.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | Get the entire flavor. 4 | @name flavor^3 5 | @function 6 | @returns {Object} The entire flavor hash. 7 | */ 8 | /** 9 | Get a named flavor. 10 | @name flavor^2 11 | @function 12 | @param {String} name The name of the flavor to get. 13 | @returns {String} The value of that flavor. 14 | */ 15 | /** 16 | Set the flavor. 17 | @param {String} name The name of the flavor to set. 18 | @param {String} value The value of the flavor. 19 | @returns {String} The value of that flavor. 20 | */ 21 | function flavor(name, value) { 22 | if (arguments.length > 1) flavor[name] = value; 23 | else if (arguments.length == 1) return flavor[name]; 24 | else return flavor; 25 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/shared.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Builtin object. 4 | * @class 5 | * @name Array 6 | */ 7 | 8 | /**#@+ 9 | * Extension to builtin array. 10 | * @memberOf Array 11 | * @method 12 | */ 13 | 14 | /** 15 | * @returns Boolen if some array members... 16 | */ 17 | Array.prototype.some = function(){}; 18 | 19 | /** 20 | * Change every element of an array. 21 | * @returns Filtered array copy. 22 | */ 23 | Array.prototype.filter = function(){}; 24 | 25 | /**#@-*/ 26 | 27 | 28 | /** 29 | * A first in, first out data structure. 30 | * @constructor 31 | */ 32 | Queue = function(){}; 33 | 34 | /**#@+ 35 | * Extension to Queue. 36 | * @memberOf Queue 37 | */ 38 | 39 | rewind = function(){ 40 | } 41 | 42 | // should close automatically here. -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/static/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Generated Javascript Documentation 7 | 8 | 9 | 10 | 11 | 12 | <body> 13 | <p> 14 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 15 | </p> 16 | </body> 17 | 18 | 19 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/functions_anon.js: -------------------------------------------------------------------------------- 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 | })(); 40 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/param_inline.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | @param columns The number of columns. 4 | */ 5 | function Layout(/**int*/columns){ 6 | /** 7 | @param [id] The id of the element. 8 | @param elName The name of the element. 9 | */ 10 | this.getElement = function( 11 | /** string */ elName, 12 | /** number|string */ id 13 | ) { 14 | }; 15 | 16 | /** 17 | @constructor 18 | */ 19 | this.Canvas = function(top, left, /**int*/width, height) { 20 | /** Is it initiated yet? */ 21 | this.initiated = true; 22 | } 23 | 24 | this.rotate = function(/**nothing*/) { 25 | } 26 | 27 | /** 28 | @param x 29 | @param y 30 | @param {zoppler} z*/ 31 | this.init = function(x, y, /**abbler*/z) { 32 | /** The xyz. */ 33 | this.xyz = x+y+z; 34 | this.getXyz = function() { 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Reflection.js: -------------------------------------------------------------------------------- 1 | /**@constructor*/ 2 | function Reflection(obj) { 3 | this.obj = obj; 4 | } 5 | 6 | Reflection.prototype.getConstructorName = function() { 7 | if (this.obj.constructor.name) return this.obj.constructor.name; 8 | var src = this.obj.constructor.toSource(); 9 | var name = src.substring(name.indexOf("function")+8, src.indexOf('(')).replace(/ /g,''); 10 | return name; 11 | } 12 | 13 | Reflection.prototype.getMethod = function(name) { 14 | for (var p in this.obj) { 15 | if (p == name && typeof(this.obj[p]) == "function") return this.obj[p]; 16 | } 17 | return null; 18 | } 19 | 20 | Reflection.prototype.getParameterNames = function() { 21 | var src = this.obj.toSource(); 22 | src = src.substring( 23 | src.indexOf("(", 8)+1, src.indexOf(")") 24 | ); 25 | return src.split(/, ?/); 26 | } 27 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var cluster = require('cluster'), 2 | numCPUs = 1; 3 | 4 | if (cluster.isMaster) { 5 | // Fork workers. 6 | for (var i = 0; i < numCPUs; i++) { 7 | forkChild(); 8 | } 9 | 10 | cluster.on('death', function(worker) { 11 | console.log('Worker ' + worker.pid + ' died'); 12 | forkChild(); 13 | }); 14 | 15 | var http = require('http'); 16 | http.createServer(function (req, res) { 17 | res.writeHead(200, {'Content-Type': 'text/plain'}); 18 | res.end('Hi there! Documentor is running smoothly with '+numCPUs+' workers\n'); 19 | }).listen(9031); 20 | console.log('Web server running on port 9031'); 21 | 22 | }else{ 23 | require("./worker"); 24 | } 25 | 26 | function forkChild(){ 27 | var fork = cluster.fork(); 28 | console.log("Created worker " + fork.pid); 29 | }; -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/java/src/JsRun.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A trivial bootstrap class that simply adds the path to the 3 | * .js file as an argument to the Rhino call. This little hack 4 | * allows the code in the .js file to have access to it's own 5 | * path via the Rhino arguments object. This is necessary to 6 | * allow the .js code to find resource files in a location 7 | * relative to itself. 8 | * 9 | * USAGE: java -jar jsrun.jar path/to/file.js 10 | */ 11 | public class JsRun { 12 | public static void main(String[] args) { 13 | String[] jsargs = {"-j="+args[0]}; 14 | 15 | String[] allArgs = new String[jsargs.length + args.length]; 16 | System.arraycopy(args, 0, allArgs, 0, args.length); 17 | System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length); 18 | 19 | org.mozilla.javascript.tools.shell.Main.main(allArgs); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/java/src/JsDebugRun.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A trivial bootstrap class that simply adds the path to the 3 | * .js file as an argument to the Rhino call. This little hack 4 | * allows the code in the .js file to have access to it's own 5 | * path via the Rhino arguments object. This is necessary to 6 | * allow the .js code to find resource files in a location 7 | * relative to itself. 8 | * 9 | * USAGE: java -jar jsdebug.jar path/to/file.js 10 | */ 11 | public class JsDebugRun { 12 | public static void main(String[] args) { 13 | String[] jsargs = {"-j="+args[0]}; 14 | 15 | String[] allArgs = new String[jsargs.length + args.length]; 16 | System.arraycopy(args, 0, allArgs, 0, args.length); 17 | System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length); 18 | 19 | org.mozilla.javascript.tools.debugger.Main.main(allArgs); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/functions_nested.js: -------------------------------------------------------------------------------- 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 | }; 34 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/tagParamConfig.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.tagParamConfig", 3 | { 4 | onDocCommentTags: function(comment) { 5 | var currentParam = null; 6 | var tags = comment.tags; 7 | for (var i = 0, l = tags.length; i < l; i++) { 8 | 9 | if (tags[i].title == "param") { 10 | if (tags[i].name.indexOf(".") == -1) { 11 | currentParam = i; 12 | } 13 | } 14 | else if (tags[i].title == "config") { 15 | tags[i].title = "param"; 16 | if (currentParam == null) { 17 | tags[i].name = "arguments"+"."+tags[i].name; 18 | } 19 | else if (tags[i].name.indexOf(tags[currentParam].name+".") != 0) { 20 | tags[i].name = tags[currentParam].name+"."+tags[i].name; 21 | } 22 | currentParam != null 23 | //tags[currentParam].properties.push(tags[i]); 24 | } 25 | else { 26 | currentParam = null; 27 | } 28 | } 29 | } 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/borrows.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | function Layout(p) { 5 | /** initilize 1 */ 6 | this.init = function(p) { 7 | } 8 | 9 | /** get the id */ 10 | this.getId = function() { 11 | } 12 | 13 | /** @type string */ 14 | this.orientation = "landscape"; 15 | 16 | function getInnerElements(elementSecretId){ 17 | } 18 | } 19 | 20 | /** A static method. */ 21 | Layout.units = function() { 22 | } 23 | 24 | /** 25 | @constructor 26 | @borrows Layout#orientation 27 | @borrows Layout-getInnerElements 28 | @borrows Layout.units 29 | */ 30 | function Page() { 31 | /** reset the page */ 32 | this.reset = function(b) { 33 | } 34 | } 35 | 36 | /** 37 | @constructor 38 | @borrows Layout.prototype.orientation as this.orientation 39 | @borrows Layout.prototype.init as #init 40 | @inherits Page.prototype.reset as #reset 41 | */ 42 | function ThreeColumnPage() { 43 | /** initilize 2 */ 44 | this.init = function(p) { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame.js: -------------------------------------------------------------------------------- 1 | IO.include("frame/Opt.js"); 2 | IO.include("frame/Chain.js"); 3 | IO.include("frame/Link.js"); 4 | IO.include("frame/String.js"); 5 | IO.include("frame/Hash.js"); 6 | IO.include("frame/Namespace.js"); 7 | //IO.include("frame/Reflection.js"); 8 | 9 | /** A few helper functions to make life a little easier. */ 10 | 11 | function defined(o) { 12 | return (o !== undefined); 13 | } 14 | 15 | function copy(o) { // todo check for circular refs 16 | if (o == null || typeof(o) != 'object') return o; 17 | var c = new o.constructor(); 18 | for(var p in o) c[p] = copy(o[p]); 19 | return c; 20 | } 21 | 22 | function isUnique(arr) { 23 | var l = arr.length; 24 | for(var i = 0; i < l; i++ ) { 25 | if (arr.lastIndexOf(arr[i]) > i) return false; 26 | } 27 | return true; 28 | } 29 | 30 | /** Returns the given string with all regex meta characters backslashed. */ 31 | RegExp.escapeMeta = function(str) { 32 | return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1"); 33 | } 34 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/TextStream.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | @constructor 4 | */ 5 | JSDOC.TextStream = function(text) { 6 | if (typeof(text) == "undefined") text = ""; 7 | text = ""+text; 8 | this.text = text; 9 | this.cursor = 0; 10 | } 11 | 12 | JSDOC.TextStream.prototype.look = function(n) { 13 | if (typeof n == "undefined") n = 0; 14 | 15 | if (this.cursor+n < 0 || this.cursor+n >= this.text.length) { 16 | var result = new String(""); 17 | result.eof = true; 18 | return result; 19 | } 20 | return this.text.charAt(this.cursor+n); 21 | } 22 | 23 | JSDOC.TextStream.prototype.next = function(n) { 24 | if (typeof n == "undefined") n = 1; 25 | if (n < 1) return null; 26 | 27 | var pulled = ""; 28 | for (var i = 0; i < n; i++) { 29 | if (this.cursor+i < this.text.length) { 30 | pulled += this.text.charAt(this.cursor+i); 31 | } 32 | else { 33 | var result = new String(""); 34 | result.eof = true; 35 | return result; 36 | } 37 | } 38 | 39 | this.cursor += n; 40 | return pulled; 41 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/conf/sample.conf: -------------------------------------------------------------------------------- 1 | /* 2 | This is an example of one way you could set up a configuration file to more 3 | conveniently define some commandline options. You might like to do this if 4 | you frequently reuse the same options. Note that you don't need to define 5 | every option in this file, you can combine a configuration file with 6 | additional options on the commandline if your wish. 7 | 8 | You would include this configuration file by running JsDoc Toolkit like so: 9 | java -jar jsrun.jar app/run.js -c=conf/sample.conf 10 | 11 | */ 12 | 13 | { 14 | // source files to use 15 | _: ['app/test/jsdoc_test.js'], 16 | 17 | // document all functions, even uncommented ones 18 | a: true, 19 | 20 | // including those marked @private 21 | p: true, 22 | 23 | // some extra variables I want to include 24 | D: {generatedBy: "Michael Mathews", copyright: "2008"}, 25 | 26 | // use this directory as the output directory 27 | d: "docs", 28 | 29 | // use this template 30 | t: "templates/jsdoc" 31 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "documentor-worker", 3 | "description": "Documentation parsing worker for Gearman", 4 | "version": "0.1.0", 5 | "author" : "Andris Reinman", 6 | "maintainers":[ 7 | { 8 | "name":"andris", 9 | "email":"andris@node.ee" 10 | } 11 | ], 12 | "homepage": "http://github.com/andris9/documentor-worker", 13 | "repository" : { 14 | "type" : "git", 15 | "url" : "http://github.com/andris9/documentor-worker.git" 16 | }, 17 | "scripts":{ 18 | "test": "nodeunit test/" 19 | }, 20 | "main" : "./lib/documentor-worker", 21 | "licenses" : [ 22 | { 23 | "type": "MIT", 24 | "url": "http://github.com/andris9/documentor-worker/blob/master/LICENSE" 25 | } 26 | ], 27 | "dependencies": { 28 | "node-gearman": "*" 29 | }, 30 | "devDependencies": { 31 | "nodeunit": "*" 32 | }, 33 | "engine": { 34 | "node": ">=0.6" 35 | }, 36 | "keywords": ["documentation"] 37 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/Util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | * @deprecated Use {@link FilePath} instead. 4 | */ 5 | JSDOC.Util = { 6 | } 7 | 8 | /** 9 | * @deprecated Use {@link FilePath.fileName} instead. 10 | */ 11 | JSDOC.Util.fileName = function(path) { 12 | LOG.warn("JSDOC.Util.fileName is deprecated. Use FilePath.fileName instead."); 13 | var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0); 14 | return path.substring(nameStart); 15 | } 16 | 17 | /** 18 | * @deprecated Use {@link FilePath.fileExtension} instead. 19 | */ 20 | JSDOC.Util.fileExtension = function(filename) { 21 | LOG.warn("JSDOC.Util.fileExtension is deprecated. Use FilePath.fileExtension instead."); 22 | return filename.split(".").pop().toLowerCase(); 23 | }; 24 | 25 | /** 26 | * @deprecated Use {@link FilePath.dir} instead. 27 | */ 28 | JSDOC.Util.dir = function(path) { 29 | LOG.warn("JSDOC.Util.dir is deprecated. Use FilePath.dir instead."); 30 | var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0); 31 | return path.substring(0, nameStart-1); 32 | } 33 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/test/event.js: -------------------------------------------------------------------------------- 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 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/symbol.tmpl: -------------------------------------------------------------------------------- 1 | 2 | {+data.name+} 3 | {+data.memberOf+} 4 | {+data.isStatic+} 5 | {+data.isa+} 6 | {+data.desc+} 7 | {+data.classDesc+} 8 | 9 | 10 | 11 | {+method.name+} 12 | {+method.memberOf+} 13 | {+method.isStatic+} 14 | {+method.desc+} 15 | 16 | 17 | {+param.type+} 18 | {+param.name+} 19 | {+param.desc+} 20 | {+param.defaultValue+} 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {+property.name+} 29 | {+property.memberOf+} 30 | {+property.isStatic+} 31 | {+property.desc+} 32 | {+property.type+} 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace Holds functionality related to running plugins. 3 | */ 4 | JSDOC.PluginManager = { 5 | } 6 | 7 | /** 8 | @param name A unique name that identifies that plugin. 9 | @param handlers A collection of named functions. The names correspond to hooks in the core code. 10 | */ 11 | JSDOC.PluginManager.registerPlugin = function(/**String*/name, /**Object*/handlers) { 12 | if (!defined(JSDOC.PluginManager.plugins)) 13 | /** The collection of all plugins. Requires a unique name for each. 14 | */ 15 | JSDOC.PluginManager.plugins = {}; 16 | 17 | 18 | JSDOC.PluginManager.plugins[name] = handlers; 19 | } 20 | 21 | /** 22 | @param hook The name of the hook that is being caught. 23 | @param target Any object. This will be passed as the only argument to the handler whose 24 | name matches the hook name. Handlers cannot return a value, so must modify the target 25 | object to have an effect. 26 | */ 27 | JSDOC.PluginManager.run = function(/**String*/hook, /**Mixed*/target) { 28 | for (var name in JSDOC.PluginManager.plugins) { 29 | if (defined(JSDOC.PluginManager.plugins[name][hook])) { 30 | JSDOC.PluginManager.plugins[name][hook](target); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/java/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/index.tmpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | JsDoc Reference - Index 8 | 9 | 10 | 13 | 14 | 15 | 16 | {+include("static/header.html")+} 17 | 18 |
19 | {+publish.classesIndex+} 20 |
21 | 22 |
23 |

Class Index

24 | 25 | 26 |
27 |

{+(new Link().toSymbol(thisClass.alias))+}

28 | {+resolveLinks(summarize(thisClass.classDesc))+} 29 |
30 |
31 |
32 | 33 |
34 |
35 | ©{+JSDOC.opt.D.copyright+}
36 | Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} 37 |
38 | 39 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/java/build_1.4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/tagSynonyms.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.tagSynonyms", 3 | { 4 | onDocCommentSrc: function(comment) { 5 | comment.src = comment.src.replace(/@methodOf\b/i, "@function\n@memberOf"); 6 | comment.src = comment.src.replace(/@fieldOf\b/i, "@field\n@memberOf"); 7 | }, 8 | 9 | onDocCommentTags: function(comment) { 10 | for (var i = 0, l = comment.tags.length; i < l; i++) { 11 | var title = comment.tags[i].title.toLowerCase(); 12 | var syn; 13 | if ((syn = JSDOC.tagSynonyms.synonyms["="+title])) { 14 | comment.tags[i].title = syn; 15 | } 16 | } 17 | } 18 | } 19 | ); 20 | 21 | new Namespace( 22 | "JSDOC.tagSynonyms", 23 | function() { 24 | JSDOC.tagSynonyms.synonyms = { 25 | "=member": "memberOf", 26 | "=memberof": "memberOf", 27 | "=description": "desc", 28 | "=exception": "throws", 29 | "=argument": "param", 30 | "=returns": "return", 31 | "=classdescription": "class", 32 | "=fileoverview": "overview", 33 | "=extends": "augments", 34 | "=base": "augments", 35 | "=projectdescription": "overview", 36 | "=classdescription": "class", 37 | "=link": "see", 38 | "=borrows": "inherits", 39 | "=scope": "lends", 40 | "=construct": "constructor" 41 | } 42 | } 43 | ); -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/jsrun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | # launcher script for jsdoc 4 | # Author: Avi Deitcher 5 | # 6 | # This program is released under the MIT License as follows: 7 | 8 | # Copyright (c) 2008-2009 Atomic Inc 9 | # 10 | #Permission is hereby granted, free of charge, to any person 11 | #obtaining a copy of this software and associated documentation 12 | #files (the "Software"), to deal in the Software without 13 | #restriction, including without limitation the rights to use, 14 | #copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | #copies of the Software, and to permit persons to whom the 16 | #Software is furnished to do so, subject to the following 17 | #conditions: 18 | ## 19 | #The above copyright notice and this permission notice shall be 20 | #included in all copies or substantial portions of the Software. 21 | # 22 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | #EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 24 | #OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 | #NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 26 | #HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 27 | #WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | #FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | #OTHER DEALINGS IN THE SOFTWARE. 30 | # 31 | 32 | 33 | if [[ -n "$JSDOCDIR" ]]; then 34 | _DOCDIR="-Djsdoc.dir=$JSDOCDIR" 35 | _APPDIR="$JSDOCDIR/app" 36 | _BASEDIR="$JSDOCDIR" 37 | else 38 | _DOCDIR="" 39 | _APPDIR="./app" 40 | _BASEDIR="." 41 | fi 42 | 43 | if [[ -n "$JSDOCTEMPLATEDIR" ]]; then 44 | _TDIR="-Djsdoc.template.dir=$JSDOCTEMPLATEDIR" 45 | else 46 | _TDIR="" 47 | fi 48 | 49 | CMD="java $_DOCDIR $_TDIR -jar $_BASEDIR/jsrun.jar $_APPDIR/run.js $@" 50 | echo $CMD 51 | $CMD 52 | 53 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/plugins/publishSrcHilite.js: -------------------------------------------------------------------------------- 1 | JSDOC.PluginManager.registerPlugin( 2 | "JSDOC.publishSrcHilite", 3 | { 4 | onPublishSrc: function(src) { 5 | if (src.path in JsHilite.cache) { 6 | return; // already generated src code 7 | } 8 | else JsHilite.cache[src.path] = true; 9 | 10 | try { 11 | var sourceCode = IO.readFile(src.path); 12 | } 13 | catch(e) { 14 | print(e.message); 15 | quit(); 16 | } 17 | 18 | var hiliter = new JsHilite(sourceCode, src.charset); 19 | src.hilited = hiliter.hilite(); 20 | } 21 | } 22 | ); 23 | 24 | function JsHilite(src, charset) { 25 | 26 | var tr = new JSDOC.TokenReader(); 27 | 28 | tr.keepComments = true; 29 | tr.keepDocs = true; 30 | tr.keepWhite = true; 31 | 32 | this.tokens = tr.tokenize(new JSDOC.TextStream(src)); 33 | 34 | // TODO is redefining toString() the best way? 35 | JSDOC.Token.prototype.toString = function() { 36 | return ""+this.data.replace(/"; 37 | } 38 | 39 | if (!charset) charset = "utf-8"; 40 | 41 | this.header = ' '+ 42 | "
";
50 | 	this.footer = "
"; 51 | this.showLinenumbers = true; 52 | } 53 | 54 | JsHilite.cache = {}; 55 | 56 | JsHilite.prototype.hilite = function() { 57 | var hilited = this.tokens.join(""); 58 | var line = 1; 59 | if (this.showLinenumbers) hilited = hilited.replace(/(^|\n)/g, function(m){return m+""+((line<10)? " ":"")+((line<100)? " ":"")+(line++)+" "}); 60 | 61 | return this.header+hilited+this.footer; 62 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Hash.js: -------------------------------------------------------------------------------- 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 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | {! Link.base = ""; /* all generated links will be relative to this */ !} 7 | JsDoc Reference - File Index 8 | 9 | 10 | 13 | 14 | 15 | 16 | {+include("static/header.html")+} 17 | 18 |
19 | {+publish.classesIndex+} 20 |
21 | 22 |
23 |

File Index

24 | 25 | 26 |
27 |

{+new Link().toSrc(item.alias).withText(item.name)+}

28 | {+resolveLinks(item.desc)+} 29 |
30 | 31 |
Author:
32 |
{+item.author+}
33 |
34 | 35 |
Version:
36 |
{+item.version+}
37 |
38 | {! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !} 39 | 40 |
Location:
41 | 42 |
{+location+}
43 |
44 |
45 |
46 |
47 |
48 |
49 | 50 |
51 |
52 | ©{+JSDOC.opt.D.copyright+}
53 | Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} 54 |
55 | 56 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/String.js: -------------------------------------------------------------------------------- 1 | /** 2 | @name String 3 | @class Additions to the core string object. 4 | */ 5 | 6 | /** @author Steven Levithan, released as public domain. */ 7 | String.prototype.trim = function() { 8 | var str = this.replace(/^\s+/, ''); 9 | for (var i = str.length - 1; i >= 0; i--) { 10 | if (/\S/.test(str.charAt(i))) { 11 | str = str.substring(0, i + 1); 12 | break; 13 | } 14 | } 15 | return str; 16 | } 17 | /*t: 18 | plan(6, "Testing String.prototype.trim."); 19 | 20 | var s = " a bc ".trim(); 21 | is(s, "a bc", "multiple spaces front and back are trimmed."); 22 | 23 | s = "a bc\n\n".trim(); 24 | is(s, "a bc", "newlines only in back are trimmed."); 25 | 26 | s = "\ta bc".trim(); 27 | is(s, "a bc", "tabs only in front are trimmed."); 28 | 29 | s = "\n \t".trim(); 30 | is(s, "", "an all-space string is trimmed to empty."); 31 | 32 | s = "a b\nc".trim(); 33 | is(s, "a b\nc", "a string with no spaces in front or back is trimmed to itself."); 34 | 35 | s = "".trim(); 36 | is(s, "", "an empty string is trimmed to empty."); 37 | 38 | */ 39 | 40 | String.prototype.balance = function(open, close) { 41 | var i = 0; 42 | while (this.charAt(i) != open) { 43 | if (i == this.length) return [-1, -1]; 44 | i++; 45 | } 46 | 47 | var j = i+1; 48 | var balance = 1; 49 | while (j < this.length) { 50 | if (this.charAt(j) == open) balance++; 51 | if (this.charAt(j) == close) balance--; 52 | if (balance == 0) break; 53 | j++; 54 | if (j == this.length) return [-1, -1]; 55 | } 56 | 57 | return [i, j]; 58 | } 59 | /*t: 60 | plan(16, "Testing String.prototype.balance."); 61 | 62 | var s = "{abc}".balance("{","}"); 63 | is(s[0], 0, "opener in first is found."); 64 | is(s[1], 4, "closer in last is found."); 65 | 66 | s = "ab{c}de".balance("{","}"); 67 | is(s[0], 2, "opener in middle is found."); 68 | is(s[1], 4, "closer in middle is found."); 69 | 70 | s = "a{b{c}de}f".balance("{","}"); 71 | is(s[0], 1, "nested opener is found."); 72 | is(s[1], 8, "nested closer is found."); 73 | 74 | s = "{}".balance("{","}"); 75 | is(s[0], 0, "opener with no content is found."); 76 | is(s[1], 1, "closer with no content is found."); 77 | 78 | s = "".balance("{","}"); 79 | is(s[0], -1, "empty string opener is -1."); 80 | is(s[1], -1, "empty string closer is -1."); 81 | 82 | s = "{abc".balance("{","}"); 83 | is(s[0], -1, "opener with no closer returns -1."); 84 | is(s[1], -1, "no closer returns -1."); 85 | 86 | s = "abc".balance("{","}"); 87 | is(s[0], -1, "no opener or closer returns -1 for opener."); 88 | is(s[1], -1, "no opener or closer returns -1 for closer."); 89 | 90 | s = "a 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 | */ -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/static/default.css: -------------------------------------------------------------------------------- 1 | /* default.css */ 2 | body 3 | { 4 | font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; 5 | width: 800px; 6 | } 7 | 8 | .header 9 | { 10 | clear: both; 11 | background-color: #ccc; 12 | padding: 8px; 13 | } 14 | 15 | h1 16 | { 17 | font-size: 150%; 18 | font-weight: bold; 19 | padding: 0; 20 | margin: 1em 0 0 .3em; 21 | } 22 | 23 | hr 24 | { 25 | border: none 0; 26 | border-top: 1px solid #7F8FB1; 27 | height: 1px; 28 | } 29 | 30 | pre.code 31 | { 32 | display: block; 33 | padding: 8px; 34 | border: 1px dashed #ccc; 35 | } 36 | 37 | #index 38 | { 39 | margin-top: 24px; 40 | float: left; 41 | width: 160px; 42 | position: absolute; 43 | left: 8px; 44 | background-color: #F3F3F3; 45 | padding: 8px; 46 | } 47 | 48 | #content 49 | { 50 | margin-left: 190px; 51 | width: 600px; 52 | } 53 | 54 | .classList 55 | { 56 | list-style-type: none; 57 | padding: 0; 58 | margin: 0 0 0 8px; 59 | font-family: arial, sans-serif; 60 | font-size: 1em; 61 | overflow: auto; 62 | } 63 | 64 | .classList li 65 | { 66 | padding: 0; 67 | margin: 0 0 8px 0; 68 | } 69 | 70 | .summaryTable { width: 100%; } 71 | 72 | h1.classTitle 73 | { 74 | font-size:170%; 75 | line-height:130%; 76 | } 77 | 78 | h2 { font-size: 110%; } 79 | caption, div.sectionTitle 80 | { 81 | background-color: #7F8FB1; 82 | color: #fff; 83 | font-size:130%; 84 | text-align: left; 85 | padding: 2px 6px 2px 6px; 86 | border: 1px #7F8FB1 solid; 87 | } 88 | 89 | div.sectionTitle { margin-bottom: 8px; } 90 | .summaryTable thead { display: none; } 91 | 92 | .summaryTable td 93 | { 94 | vertical-align: top; 95 | padding: 4px; 96 | border-bottom: 1px #7F8FB1 solid; 97 | border-right: 1px #7F8FB1 solid; 98 | } 99 | 100 | /*col#summaryAttributes {}*/ 101 | .summaryTable td.attributes 102 | { 103 | border-left: 1px #7F8FB1 solid; 104 | width: 140px; 105 | text-align: right; 106 | } 107 | 108 | td.attributes, .fixedFont 109 | { 110 | line-height: 15px; 111 | color: #002EBE; 112 | font-family: "Courier New",Courier,monospace; 113 | font-size: 13px; 114 | } 115 | 116 | .summaryTable td.nameDescription 117 | { 118 | text-align: left; 119 | font-size: 13px; 120 | line-height: 15px; 121 | } 122 | 123 | .summaryTable td.nameDescription, .description 124 | { 125 | line-height: 15px; 126 | padding: 4px; 127 | padding-left: 4px; 128 | } 129 | 130 | .summaryTable { margin-bottom: 8px; } 131 | 132 | ul.inheritsList 133 | { 134 | list-style: square; 135 | margin-left: 20px; 136 | padding-left: 0; 137 | } 138 | 139 | .detailList { 140 | margin-left: 20px; 141 | line-height: 15px; 142 | } 143 | .detailList dt { margin-left: 20px; } 144 | 145 | .detailList .heading 146 | { 147 | font-weight: bold; 148 | padding-bottom: 6px; 149 | margin-left: 0; 150 | } 151 | 152 | .light, td.attributes, .light a:link, .light a:visited 153 | { 154 | color: #777; 155 | font-style: italic; 156 | } 157 | 158 | .fineprint 159 | { 160 | text-align: right; 161 | font-size: 10px; 162 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @constructor 5 | */ 6 | JSDOC.TokenStream = function(tokens) { 7 | this.tokens = (tokens || []); 8 | this.rewind(); 9 | } 10 | 11 | /** 12 | @constructor 13 | @private 14 | */ 15 | function VoidToken(/**String*/type) { 16 | this.toString = function() {return ""}; 17 | this.is = function(){return false;} 18 | } 19 | 20 | JSDOC.TokenStream.prototype.rewind = function() { 21 | this.cursor = -1; 22 | } 23 | 24 | /** 25 | @type JSDOC.Token 26 | */ 27 | JSDOC.TokenStream.prototype.look = function(/**Number*/n, /**Boolean*/considerWhitespace) { 28 | if (typeof n == "undefined") n = 0; 29 | 30 | if (considerWhitespace == true) { 31 | if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {}; 32 | return this.tokens[this.cursor+n]; 33 | } 34 | else { 35 | var count = 0; 36 | var i = this.cursor; 37 | 38 | while (true) { 39 | if (i < 0) return new JSDOC.Token("", "VOID", "START_OF_STREAM"); 40 | else if (i > this.tokens.length) return new JSDOC.Token("", "VOID", "END_OF_STREAM"); 41 | 42 | if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) { 43 | if (n < 0) i--; else i++; 44 | continue; 45 | } 46 | 47 | if (count == Math.abs(n)) { 48 | return this.tokens[i]; 49 | } 50 | count++; 51 | (n < 0)? i-- : i++; 52 | } 53 | 54 | return new JSDOC.Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object 55 | } 56 | } 57 | 58 | /** 59 | @type JSDOC.Token|JSDOC.Token[] 60 | */ 61 | JSDOC.TokenStream.prototype.next = function(/**Number*/howMany) { 62 | if (typeof howMany == "undefined") howMany = 1; 63 | if (howMany < 1) return null; 64 | var got = []; 65 | 66 | for (var i = 1; i <= howMany; i++) { 67 | if (this.cursor+i >= this.tokens.length) { 68 | return null; 69 | } 70 | got.push(this.tokens[this.cursor+i]); 71 | } 72 | this.cursor += howMany; 73 | 74 | if (howMany == 1) { 75 | return got[0]; 76 | } 77 | else return got; 78 | } 79 | 80 | /** 81 | @type JSDOC.Token[] 82 | */ 83 | JSDOC.TokenStream.prototype.balance = function(/**String*/start, /**String*/stop) { 84 | if (!stop) stop = JSDOC.Lang.matching(start); 85 | 86 | var depth = 0; 87 | var got = []; 88 | var started = false; 89 | 90 | while ((token = this.look())) { 91 | if (token.is(start)) { 92 | depth++; 93 | started = true; 94 | } 95 | 96 | if (started) { 97 | got.push(token); 98 | } 99 | 100 | if (token.is(stop)) { 101 | depth--; 102 | if (depth == 0) return got; 103 | } 104 | if (!this.next()) break; 105 | } 106 | } 107 | 108 | JSDOC.TokenStream.prototype.getMatchingToken = function(/**String*/start, /**String*/stop) { 109 | var depth = 0; 110 | var cursor = this.cursor; 111 | 112 | if (!start) { 113 | start = JSDOC.Lang.matching(stop); 114 | depth = 1; 115 | } 116 | if (!stop) stop = JSDOC.Lang.matching(start); 117 | 118 | while ((token = this.tokens[cursor])) { 119 | if (token.is(start)) { 120 | depth++; 121 | } 122 | 123 | if (token.is(stop) && cursor) { 124 | depth--; 125 | if (depth == 0) return this.tokens[cursor]; 126 | } 127 | cursor++; 128 | } 129 | } 130 | 131 | JSDOC.TokenStream.prototype.insertAhead = function(/**JSDOC.Token*/token) { 132 | this.tokens.splice(this.cursor+1, 0, token); 133 | } -------------------------------------------------------------------------------- /engine.js: -------------------------------------------------------------------------------- 1 | var config = require("./config.json"); 2 | 3 | module.exports.spawnEngine = spawnEngine; 4 | 5 | function spawnEngine(engineName, options){ 6 | options = options || {}; 7 | engineName = engineName || ""; 8 | 9 | var engineData = config.engines[engineName], 10 | engineOptions = {}, 11 | engineCmdParams; 12 | 13 | if(!engineData){ 14 | return null; 15 | } 16 | 17 | // copy default and passed option variables 18 | if(engineData.vars){ 19 | Object.keys(engineData.vars).forEach(function(key){ 20 | engineOptions[key] = engineData.vars[key]; 21 | }); 22 | } 23 | 24 | Object.keys(options).forEach(function(key){ 25 | engineOptions[key.toUpperCase()] = options[key]; 26 | }); 27 | 28 | return { 29 | cmd: engineData.cmd.main, 30 | params: generateCmdParams(engineData.cmd.params, engineOptions) 31 | }; 32 | } 33 | 34 | 35 | function generateCmdParams(params, vars){ 36 | params = params || []; 37 | vars = vars || {}; 38 | 39 | var keys = Object.keys(vars), 40 | done, loopcounter=0, 41 | curparams = []; 42 | 43 | // copy params 44 | curparams = params.map(function(elm){return (elm || "").toString().trim();}); 45 | 46 | // remove empty params 47 | Object.keys(vars).forEach(function(key){ 48 | if(!vars[key] || (Array.isArray(vars[key]) && !vars[key].length)){ 49 | 50 | for(var i = curparams.length-1; i>=0; i--){ 51 | curparams[i] = curparams[i].replace(new RegExp("\\$"+key,"g"), "").trim(); 52 | if(!curparams[i]){ 53 | curparams.splice(i, 1); 54 | } 55 | } 56 | 57 | } 58 | }); 59 | 60 | // loop until all keys have been replaced or max threshold of 10 loops is passed 61 | done = false; 62 | loopcounter = 10; 63 | while(!done && loopcounter--){ 64 | 65 | // replace variables 66 | curparams = replaceParamVars(curparams, vars) 67 | 68 | // check if should rerun 69 | done = true; 70 | curparams.forEach(function(param){ 71 | keys.forEach(function(key){ 72 | if(param.match(new RegExp("\\$"+key))){ 73 | done = false; 74 | } 75 | }); 76 | }); 77 | 78 | } 79 | 80 | return curparams; 81 | } 82 | 83 | function replaceParamVars(params, vars){ 84 | var output = [], 85 | keys = Object.keys(vars), 86 | curparams, 87 | param; 88 | 89 | while(param = params.shift()){ 90 | curparams = []; 91 | 92 | keys.forEach(function(key){ 93 | 94 | if(param.match(new RegExp("\\$"+key))){ 95 | 96 | if(Array.isArray(vars[key])){ 97 | for(var i = vars[key].length-1; i>=0; i--){ 98 | curparams.unshift(param.replace(new RegExp("\\$"+key,"g"), vars[key][i])); 99 | }; 100 | }else{ 101 | curparams.push(param.replace(new RegExp("\\$"+key,"g"), vars[key])); 102 | } 103 | 104 | } 105 | 106 | }); 107 | 108 | if(!curparams.length){ 109 | curparams.push(param); 110 | } 111 | 112 | output = output.concat(curparams); 113 | }; 114 | 115 | return output; 116 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @version $Id: main.js 818 2009-11-08 14:51:41Z micmath $ 3 | */ 4 | 5 | function main() { 6 | IO.include("lib/JSDOC.js"); 7 | IO.includeDir("plugins/"); 8 | 9 | // process the options 10 | 11 | // the -c option: options are defined in a configuration file 12 | if (JSDOC.opt.c) { 13 | eval("JSDOC.conf = " + IO.readFile(JSDOC.opt.c)); 14 | 15 | LOG.inform("Using configuration file at '"+JSDOC.opt.c+"'."); 16 | 17 | for (var c in JSDOC.conf) { 18 | if (c !== "D" && !defined(JSDOC.opt[c])) { // commandline overrules config file 19 | JSDOC.opt[c] = JSDOC.conf[c]; 20 | } 21 | } 22 | 23 | if (typeof JSDOC.conf["_"] != "undefined") { 24 | JSDOC.opt["_"] = JSDOC.opt["_"].concat(JSDOC.conf["_"]); 25 | } 26 | 27 | LOG.inform("With configuration: "); 28 | for (var o in JSDOC.opt) { 29 | LOG.inform(" "+o+": "+JSDOC.opt[o]); 30 | } 31 | } 32 | 33 | // be verbose 34 | if (JSDOC.opt.v) LOG.verbose = true; 35 | 36 | // send log messages to a file 37 | if (JSDOC.opt.o) LOG.out = IO.open(JSDOC.opt.o); 38 | 39 | // run the unit tests 40 | if (JSDOC.opt.T) { 41 | LOG.inform("JsDoc Toolkit running in test mode at "+new Date()+"."); 42 | IO.include("frame/Testrun.js"); 43 | IO.include("test.js"); 44 | } 45 | else { 46 | // a template must be defined and must be a directory path 47 | if (!JSDOC.opt.t && System.getProperty("jsdoc.template.dir")) { 48 | JSDOC.opt.t = System.getProperty("jsdoc.template.dir"); 49 | } 50 | if (JSDOC.opt.t && SYS.slash != JSDOC.opt.t.slice(-1)) { 51 | JSDOC.opt.t += SYS.slash; 52 | } 53 | 54 | // verbose messages about the options we were given 55 | LOG.inform("JsDoc Toolkit main() running at "+new Date()+"."); 56 | LOG.inform("With options: "); 57 | for (var o in JSDOC.opt) { 58 | LOG.inform(" "+o+": "+JSDOC.opt[o]); 59 | } 60 | 61 | // initialize and build a symbolSet from your code 62 | JSDOC.JsDoc(); 63 | 64 | // debugger's option: dump the entire symbolSet produced from your code 65 | if (JSDOC.opt.Z) { 66 | LOG.warn("So you want to see the data structure, eh? This might hang if you have circular refs..."); 67 | IO.include("frame/Dumper.js"); 68 | var symbols = JSDOC.JsDoc.symbolSet.toArray(); 69 | for (var i = 0, l = symbols.length; i < l; i++) { 70 | var symbol = symbols[i]; 71 | print("// symbol: " + symbol.alias); 72 | print(symbol.serialize()); 73 | } 74 | } 75 | else { 76 | if (typeof JSDOC.opt.t != "undefined") { 77 | try { 78 | // a file named "publish.js" must exist in the template directory 79 | load(JSDOC.opt.t+"publish.js"); 80 | 81 | // and must define a function named "publish" 82 | if (!publish) { 83 | LOG.warn("No publish() function is defined in that template so nothing to do."); 84 | } 85 | else { 86 | // which will be called with the symbolSet produced from your code 87 | publish(JSDOC.JsDoc.symbolSet); 88 | } 89 | } 90 | catch(e) { 91 | LOG.warn("Sorry, that doesn't seem to be a valid template: "+JSDOC.opt.t+"publish.js : "+e); 92 | } 93 | } 94 | else { 95 | LOG.warn("No template given. Might as well read the usage notes."); 96 | JSDOC.usage(); 97 | } 98 | } 99 | } 100 | 101 | // notify of any warnings 102 | if (!JSDOC.opt.q && LOG.warnings.length) { 103 | print(LOG.warnings.length+" warning"+(LOG.warnings.length != 1? "s":"")+"."); 104 | } 105 | 106 | // stop sending log messages to a file 107 | if (LOG.out) { 108 | LOG.out.flush(); 109 | LOG.out.close(); 110 | } 111 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Opt.js: -------------------------------------------------------------------------------- 1 | /** @namespace */ 2 | Opt = { 3 | /** 4 | * Get commandline option values. 5 | * @param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"] 6 | * @param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}. 7 | * @return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true} 8 | */ 9 | get: function(args, optNames) { 10 | var opt = {"_": []}; // the unnamed option allows multiple values 11 | for (var i = 0; i < args.length; i++) { 12 | var arg = new String(args[i]); 13 | var name; 14 | var value; 15 | if (arg.charAt(0) == "-") { 16 | if (arg.charAt(1) == "-") { // it's a longname like --foo 17 | arg = arg.substring(2); 18 | var m = arg.split("="); 19 | name = m.shift(); 20 | value = m.shift(); 21 | if (typeof value == "undefined") value = true; 22 | 23 | for (var n in optNames) { // convert it to a shortname 24 | if (name == optNames[n]) { 25 | name = n; 26 | } 27 | } 28 | } 29 | else { // it's a shortname like -f 30 | arg = arg.substring(1); 31 | var m = arg.split("="); 32 | name = m.shift(); 33 | value = m.shift(); 34 | if (typeof value == "undefined") value = true; 35 | 36 | for (var n in optNames) { // find the matching key 37 | if (name == n || name+'[]' == n) { 38 | name = n; 39 | break; 40 | } 41 | } 42 | } 43 | if (name.match(/(.+)\[\]$/)) { // it's an array type like n[] 44 | name = RegExp.$1; 45 | if (!opt[name]) opt[name] = []; 46 | } 47 | 48 | if (opt[name] && opt[name].push) { 49 | opt[name].push(value); 50 | } 51 | else { 52 | opt[name] = value; 53 | } 54 | } 55 | else { // not associated with any optname 56 | opt._.push(args[i]); 57 | } 58 | } 59 | return opt; 60 | } 61 | } 62 | 63 | /*t: 64 | plan(11, "Testing Opt."); 65 | 66 | is( 67 | typeof Opt, 68 | "object", 69 | "Opt is an object." 70 | ); 71 | 72 | is( 73 | typeof Opt.get, 74 | "function", 75 | "Opt.get is a function." 76 | ); 77 | 78 | var optNames = {a:"accept", b:"backtrace", c:"class", d:"debug", "e[]":"exceptions"}; 79 | var t_options = Opt.get(["-a=xml", "-b", "--class=new", "--debug", "-e=one", "-e=two", "foo", "bar"], optNames); 80 | 81 | is( 82 | t_options.a, 83 | "xml", 84 | "an option defined with a short name can be accessed by its short name." 85 | ); 86 | 87 | is( 88 | t_options.b, 89 | true, 90 | "an option defined with a short name and no value are true." 91 | ); 92 | 93 | is( 94 | t_options.c, 95 | "new", 96 | "an option defined with a long name can be accessed by its short name." 97 | ); 98 | 99 | is( 100 | t_options.d, 101 | true, 102 | "an option defined with a long name and no value are true." 103 | ); 104 | 105 | is( 106 | typeof t_options.e, 107 | "object", 108 | "an option that can accept multiple values is defined." 109 | ); 110 | 111 | is( 112 | t_options.e.length, 113 | 2, 114 | "an option that can accept multiple values can have more than one value." 115 | ); 116 | 117 | is( 118 | t_options.e[1], 119 | "two", 120 | "an option that can accept multiple values can be accessed as an array." 121 | ); 122 | 123 | is( 124 | typeof t_options._, 125 | "object", 126 | "the property '_' is defined for unnamed options." 127 | ); 128 | 129 | is( 130 | t_options._[0], 131 | "foo", 132 | "the property '_' can be accessed as an array." 133 | ); 134 | */ -------------------------------------------------------------------------------- /worker.js: -------------------------------------------------------------------------------- 1 | var Gearman = require("node-gearman"), 2 | Documentor = require("./gendoc").Documentor, 3 | 4 | gearmanHost = process.env.GEARMAN_SERVER || "localhost", 5 | gearmanPort = process.env.GEARMAN_PORT || "4730", 6 | 7 | gearmanClient = new Gearman(gearmanHost, gearmanPort), 8 | 9 | initialConnectTimeout = 15, // seconds 10 | nextTimeout = initialConnectTimeout; 11 | 12 | process.on('uncaughtException', function (err) { 13 | console.log("uncaughtException"); 14 | console.log(err.message); 15 | console.log(err.stack); 16 | try{ 17 | gearmanClient.close(); 18 | }catch(E){} 19 | process.exit(2); 20 | }); 21 | 22 | //Connect to the server 23 | console.log("Connecting to gearman"); 24 | gearmanClient.on("connect", function(){ 25 | console.log("Connected to gearman server"); 26 | nextTimeout = initialConnectTimeout; // reset timer 27 | }); 28 | 29 | //Connection to the server is closed, reconnect 30 | gearmanClient.on("close", function(){ 31 | console.log("Lost connection to gearman server, reconnecting in " + nextTimeout + "sec"); 32 | setTimeout(function(){ 33 | console.log("Reconnecting..."); 34 | 35 | // try to reconnect 36 | gearmanClient.connect(); 37 | 38 | // workers are removed on connection close, readd 39 | registerWorker(); 40 | 41 | nextTimeout *= 2; // if the connection still fails, wait 2x last interval 42 | }, nextTimeout * 1000); 43 | }); 44 | 45 | registerWorker(); 46 | 47 | function registerWorker(){ 48 | gearmanClient.registerWorker("documentor", documentor); 49 | } 50 | 51 | function documentor(payload, worker){ 52 | var repo = (payload || "").toString("utf-8").trim(), 53 | repoData, 54 | time = Date.now(), 55 | options = { 56 | checkoutDirectory: "/tmp/checkout-"+time, 57 | destination: "/tmp/gendoc-"+time, 58 | bucketName: process.env.BUCKET_NAME || "docs.openbirdie.com" 59 | }, 60 | aborted = false, 61 | timeout = setTimeout(function(){ 62 | aborted = true; 63 | worker.write(new Buffer("
Process timeout
", "utf-8")); 64 | worker.error(); 65 | process.nextTick(process.exit.bind(process, 1));; 66 | }, 15 * 60 * 1000); 67 | 68 | 69 | try{ 70 | repoData = JSON.parse(repo); 71 | if(repoData.repo){ 72 | repo = repoData.repo; 73 | Object.keys(repoData).forEach(function(key){ 74 | if(key == "repo") return; 75 | options[key] = repoData[key]; 76 | }); 77 | } 78 | }catch(E){} 79 | 80 | console.log("Incoming job "+repo); 81 | 82 | var docs = new Documentor(repo, options); 83 | 84 | docs.on("data", function(data){ 85 | if(aborted)return; 86 | worker.write(data); 87 | }); 88 | 89 | docs.on("error", function(error){ 90 | if(aborted)return; 91 | clearTimeout(timeout); 92 | worker.write(new Buffer("
"+ error.message + "
", "utf-8")); 93 | process.nextTick(worker.error.bind(worker)); 94 | }); 95 | 96 | docs.on("end", function(url){ 97 | if(aborted)return; 98 | clearTimeout(timeout); 99 | worker.write(new Buffer("
Documentation generated successfully to "+url+"
", "utf-8")); 100 | process.nextTick(worker.end.bind(worker)); 101 | }); 102 | 103 | worker.write(new Buffer("
Generating documentation
", "utf-8")); 104 | docs.generateDocs(); 105 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/Lang.js: -------------------------------------------------------------------------------- 1 | /** 2 | @namespace 3 | */ 4 | JSDOC.Lang = { 5 | } 6 | 7 | JSDOC.Lang.isBuiltin = function(name) { 8 | return (JSDOC.Lang.isBuiltin.coreObjects.indexOf(name) > -1); 9 | } 10 | JSDOC.Lang.isBuiltin.coreObjects = ['_global_', 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String']; 11 | 12 | JSDOC.Lang.whitespace = function(ch) { 13 | return JSDOC.Lang.whitespace.names[ch]; 14 | } 15 | JSDOC.Lang.whitespace.names = { 16 | " ": "SPACE", 17 | "\f": "FORMFEED", 18 | "\t": "TAB", 19 | "\u0009": "UNICODE_TAB", 20 | "\u000A": "UNICODE_NBR", 21 | "\u0008": "VERTICAL_TAB" 22 | }; 23 | 24 | JSDOC.Lang.newline = function(ch) { 25 | return JSDOC.Lang.newline.names[ch]; 26 | } 27 | JSDOC.Lang.newline.names = { 28 | "\n": "NEWLINE", 29 | "\r": "RETURN", 30 | "\u000A": "UNICODE_LF", 31 | "\u000D": "UNICODE_CR", 32 | "\u2029": "UNICODE_PS", 33 | "\u2028": "UNICODE_LS" 34 | }; 35 | 36 | JSDOC.Lang.keyword = function(word) { 37 | return JSDOC.Lang.keyword.names["="+word]; 38 | } 39 | JSDOC.Lang.keyword.names = { 40 | "=break": "BREAK", 41 | "=case": "CASE", 42 | "=catch": "CATCH", 43 | "=const": "VAR", 44 | "=continue": "CONTINUE", 45 | "=default": "DEFAULT", 46 | "=delete": "DELETE", 47 | "=do": "DO", 48 | "=else": "ELSE", 49 | "=false": "FALSE", 50 | "=finally": "FINALLY", 51 | "=for": "FOR", 52 | "=function": "FUNCTION", 53 | "=if": "IF", 54 | "=in": "IN", 55 | "=instanceof": "INSTANCEOF", 56 | "=new": "NEW", 57 | "=null": "NULL", 58 | "=return": "RETURN", 59 | "=switch": "SWITCH", 60 | "=this": "THIS", 61 | "=throw": "THROW", 62 | "=true": "TRUE", 63 | "=try": "TRY", 64 | "=typeof": "TYPEOF", 65 | "=void": "VOID", 66 | "=while": "WHILE", 67 | "=with": "WITH", 68 | "=var": "VAR" 69 | }; 70 | 71 | JSDOC.Lang.punc = function(ch) { 72 | return JSDOC.Lang.punc.names[ch]; 73 | } 74 | JSDOC.Lang.punc.names = { 75 | ";": "SEMICOLON", 76 | ",": "COMMA", 77 | "?": "HOOK", 78 | ":": "COLON", 79 | "||": "OR", 80 | "&&": "AND", 81 | "|": "BITWISE_OR", 82 | "^": "BITWISE_XOR", 83 | "&": "BITWISE_AND", 84 | "===": "STRICT_EQ", 85 | "==": "EQ", 86 | "=": "ASSIGN", 87 | "!==": "STRICT_NE", 88 | "!=": "NE", 89 | "<<": "LSH", 90 | "<=": "LE", 91 | "<": "LT", 92 | ">>>": "URSH", 93 | ">>": "RSH", 94 | ">=": "GE", 95 | ">": "GT", 96 | "++": "INCREMENT", 97 | "--": "DECREMENT", 98 | "+": "PLUS", 99 | "-": "MINUS", 100 | "*": "MUL", 101 | "/": "DIV", 102 | "%": "MOD", 103 | "!": "NOT", 104 | "~": "BITWISE_NOT", 105 | ".": "DOT", 106 | "[": "LEFT_BRACKET", 107 | "]": "RIGHT_BRACKET", 108 | "{": "LEFT_CURLY", 109 | "}": "RIGHT_CURLY", 110 | "(": "LEFT_PAREN", 111 | ")": "RIGHT_PAREN" 112 | }; 113 | 114 | JSDOC.Lang.matching = function(name) { 115 | return JSDOC.Lang.matching.names[name]; 116 | } 117 | JSDOC.Lang.matching.names = { 118 | "LEFT_PAREN": "RIGHT_PAREN", 119 | "RIGHT_PAREN": "LEFT_PAREN", 120 | "LEFT_CURLY": "RIGHT_CURLY", 121 | "RIGHT_CURLY": "LEFT_CURLY", 122 | "LEFT_BRACE": "RIGHT_BRACE", 123 | "RIGHT_BRACE": "LEFT_BRACE" 124 | } 125 | 126 | JSDOC.Lang.isNumber = function(str) { 127 | return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str); 128 | } 129 | 130 | JSDOC.Lang.isHexDec = function(str) { 131 | return /^0x[0-9A-F]+$/i.test(str); 132 | } 133 | 134 | JSDOC.Lang.isWordChar = function(str) { 135 | return /^[a-zA-Z0-9$_.]+$/.test(str); 136 | } 137 | 138 | JSDOC.Lang.isSpace = function(str) { 139 | return (typeof JSDOC.Lang.whitespace(str) != "undefined"); 140 | } 141 | 142 | JSDOC.Lang.isNewline = function(str) { 143 | return (typeof JSDOC.Lang.newline(str) != "undefined"); 144 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC.js: -------------------------------------------------------------------------------- 1 | /** 2 | @overview 3 | @date $Date: 2010-06-13 22:02:44 +0100 (Sun, 13 Jun 2010) $ 4 | @version $Revision: 837 $ 5 | @location $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/lib/JSDOC.js $ 6 | @name JSDOC.js 7 | */ 8 | 9 | /** 10 | This is the main container for the JSDOC application. 11 | @namespace 12 | */ 13 | JSDOC = { 14 | }; 15 | 16 | /** 17 | @requires Opt 18 | */ 19 | if (typeof arguments == "undefined") arguments = []; 20 | JSDOC.opt = Opt.get( 21 | arguments, 22 | { 23 | a: "allfunctions", 24 | c: "conf", 25 | d: "directory", 26 | "D[]": "define", 27 | e: "encoding", 28 | "E[]": "exclude", 29 | h: "help", 30 | m: "multiple", 31 | n: "nocode", 32 | o: "out", 33 | p: "private", 34 | q: "quiet", 35 | r: "recurse", 36 | S: "securemodules", 37 | s: "suppress", 38 | t: "template", 39 | T: "testmode", 40 | u: "unique", 41 | v: "verbose", 42 | x: "ext" 43 | } 44 | ); 45 | 46 | /** The current version string of this application. */ 47 | JSDOC.VERSION = "2.4.0"; 48 | 49 | /** Print out usage information and quit. */ 50 | JSDOC.usage = function() { 51 | print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] ..."); 52 | print(""); 53 | print("OPTIONS:"); 54 | print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n"); 55 | print(" -c or --conf\n Load a configuration file.\n"); 56 | print(" -d= or --directory=\n Output to this directory (defaults to \"out\").\n"); 57 | print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n"); 58 | print(" -e= or --encoding=\n Use this encoding to read and write files.\n"); 59 | print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n"); 60 | print(" -h or --help\n Show this message and exit.\n"); 61 | print(" -m or --multiples\n Don't warn about symbols being documented more than once.\n"); 62 | print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n"); 63 | print(" -o= or --out=\n Print log messages to a file (defaults to stdout).\n"); 64 | print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\n"); 65 | print(" -q or --quiet\n Do not output any messages, not even warnings.\n"); 66 | print(" -r= or --recurse=\n Descend into src directories.\n"); 67 | print(" -s or --suppress\n Suppress source code output.\n"); 68 | print(" -S or --securemodules\n Use Secure Modules mode to parse source code.\n"); 69 | print(" -t= or --template=\n Required. Use this template to format the output.\n"); 70 | print(" -T or --test\n Run all unit tests and exit.\n"); 71 | print(" -u or --unique\n Force file names to be unique, but not based on symbol names.\n"); 72 | print(" -v or --verbose\n Provide verbose feedback about what is happening.\n"); 73 | print(" -x=[,EXT]... or --ext=[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n"); 74 | 75 | quit(); 76 | } 77 | 78 | /*t: 79 | plan(4, "Testing JSDOC namespace."); 80 | 81 | is( 82 | typeof JSDOC, 83 | "object", 84 | "JSDOC.usage is a function." 85 | ); 86 | 87 | is( 88 | typeof JSDOC.VERSION, 89 | "string", 90 | "JSDOC.VERSION is a string." 91 | ); 92 | 93 | is( 94 | typeof JSDOC.usage, 95 | "function", 96 | "JSDOC.usage is a function." 97 | ); 98 | 99 | is( 100 | typeof JSDOC.opt, 101 | "object", 102 | "JSDOC.opt is a object." 103 | ); 104 | */ 105 | 106 | if (this.IO) IO.includeDir("lib/JSDOC/"); 107 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | */ 4 | JSDOC.JsPlate = function(templateFile) { 5 | if (templateFile) this.template = IO.readFile(templateFile); 6 | 7 | this.templateFile = templateFile; 8 | this.code = ""; 9 | this.parse(); 10 | } 11 | 12 | JSDOC.JsPlate.prototype.parse = function() { 13 | this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, ""); 14 | this.code = "var output=\u001e"+this.template; 15 | 16 | this.code = this.code.replace( 17 | //gi, 18 | function (match, eachName, inName) { 19 | return "\u001e;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=\u001e"; 20 | } 21 | ); 22 | this.code = this.code.replace(//g, "\u001e;\rif ($1) { output+=\u001e"); 23 | this.code = this.code.replace(//g, "\u001e;}\relse if ($1) { output+=\u001e"); 24 | this.code = this.code.replace(//g, "\u001e;}\relse { output+=\u001e"); 25 | this.code = this.code.replace(/<\/(if|for)>/g, "\u001e;\r};\routput+=\u001e"); 26 | this.code = this.code.replace( 27 | /\{\+\s*([\s\S]+?)\s*\+\}/gi, 28 | function (match, code) { 29 | code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code 30 | code = code.replace(/(\r?\n)/g, " "); 31 | return "\u001e+ ("+code+") +\u001e"; 32 | } 33 | ); 34 | this.code = this.code.replace( 35 | /\{!\s*([\s\S]+?)\s*!\}/gi, 36 | function (match, code) { 37 | code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code 38 | code = code.replace(/(\n)/g, " "); 39 | return "\u001e; "+code+";\routput+=\u001e"; 40 | } 41 | ); 42 | this.code = this.code+"\u001e;"; 43 | 44 | this.code = this.code.replace(/(\r?\n)/g, "\\n"); 45 | this.code = this.code.replace(/"/g, "\\\""); 46 | this.code = this.code.replace(/\u001e/g, "\""); 47 | } 48 | 49 | JSDOC.JsPlate.prototype.toCode = function() { 50 | return this.code; 51 | } 52 | 53 | JSDOC.JsPlate.keys = function(obj) { 54 | var keys = []; 55 | if (obj.constructor.toString().indexOf("Array") > -1) { 56 | for (var i = 0; i < obj.length; i++) { 57 | keys.push(i); 58 | } 59 | } 60 | else { 61 | for (var i in obj) { 62 | keys.push(i); 63 | } 64 | } 65 | return keys; 66 | }; 67 | 68 | JSDOC.JsPlate.values = function(obj) { 69 | var values = []; 70 | if (obj.constructor.toString().indexOf("Array") > -1) { 71 | for (var i = 0; i < obj.length; i++) { 72 | values.push(obj[i]); 73 | } 74 | } 75 | else { 76 | for (var i in obj) { 77 | values.push(obj[i]); 78 | } 79 | } 80 | return values; 81 | }; 82 | 83 | JSDOC.JsPlate.prototype.process = function(data, compact) { 84 | var keys = JSDOC.JsPlate.keys; 85 | var values = JSDOC.JsPlate.values; 86 | 87 | try { 88 | eval(this.code); 89 | } 90 | catch (e) { 91 | print(">> There was an error evaluating the compiled code from template: "+this.templateFile); 92 | print(" The error was on line "+e.lineNumber+" "+e.name+": "+e.message); 93 | var lines = this.code.split("\r"); 94 | if (e.lineNumber-2 >= 0) print("line "+(e.lineNumber-1)+": "+lines[e.lineNumber-2]); 95 | print("line "+e.lineNumber+": "+lines[e.lineNumber-1]); 96 | print(""); 97 | } 98 | 99 | if (compact) { // patch by mcbain.asm 100 | // Remove lines that contain only space-characters, usually left by lines in the template 101 | // which originally only contained JSPlate tags or code. This makes it easier to write 102 | // non-tricky templates which still put out nice code (not bloated with extra lines). 103 | // Lines purposely left blank (just a line ending) are left alone. 104 | output = output.replace(/\s+?(\r?)\n/g, "$1\n"); 105 | } 106 | 107 | /*debug*///print(this.code); 108 | return output; 109 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Testrun.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview 3 | * @name JsTestrun 4 | * @author Michael Mathews micmath@gmail.com 5 | * @url $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/frame/Testrun.js $ 6 | * @revision $Id: Testrun.js 418 2008-01-15 21:40:33Z micmath $ 7 | * @license X11/MIT License 8 | * (See the accompanying README file for full details.) 9 | */ 10 | 11 | /** 12 | Yet another unit testing tool for JavaScript. 13 | @author Michael Mathews micmath@gmail.com 14 | @param {object} testCases Properties are testcase names, values are functions to execute as tests. 15 | */ 16 | function testrun(testCases) { 17 | var ran = 0; 18 | for (t in testCases) { 19 | var result = testCases[t](); 20 | ran++; 21 | } 22 | 23 | return testrun.reportOut+"-------------------------------\n"+((testrun.fails>0)? ":( Failed "+testrun.fails+"/" : ":) Passed all ")+testrun.count+" test"+((testrun.count == 1)? "":"s")+".\n"; 24 | } 25 | 26 | 27 | testrun.count = 0; 28 | testrun.current = null; 29 | testrun.passes = 0; 30 | testrun.fails = 0; 31 | testrun.reportOut = ""; 32 | 33 | /** @private */ 34 | testrun.report = function(text) { 35 | testrun.reportOut += text+"\n"; 36 | } 37 | 38 | /** 39 | Check if test evaluates to true. 40 | @param {string} test To be evaluated. 41 | @param {string} message Optional. To be displayed in the report. 42 | @return {boolean} True if the string test evaluates to true. 43 | */ 44 | ok = function(test, message) { 45 | testrun.count++; 46 | 47 | var result; 48 | try { 49 | result = eval(test); 50 | 51 | if (result) { 52 | testrun.passes++; 53 | testrun.report(" OK "+testrun.count+" - "+((message != null)? message : "")); 54 | } 55 | else { 56 | testrun.fails++; 57 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 58 | } 59 | } 60 | catch(e) { 61 | testrun.fails++ 62 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 63 | 64 | } 65 | } 66 | 67 | /** 68 | Check if test is same as expected. 69 | @param {string} test To be evaluated. 70 | @param {string} expected 71 | @param {string} message Optional. To be displayed in the report. 72 | @return {boolean} True if (test == expected). Note that the comparison is not a strict equality check. 73 | */ 74 | is = function(test, expected, message) { 75 | testrun.count++; 76 | 77 | var result; 78 | try { 79 | result = eval(test); 80 | 81 | if (result == expected) { 82 | testrun.passes++ 83 | testrun.report(" OK "+testrun.count+" - "+((message != null)? message : "")); 84 | } 85 | else { 86 | testrun.fails++ 87 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 88 | testrun.report("expected: "+expected); 89 | testrun.report(" got: "+result); 90 | } 91 | } 92 | catch(e) { 93 | testrun.fails++ 94 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 95 | testrun.report("expected: "+expected); 96 | testrun.report(" got: "+result);} 97 | } 98 | 99 | /** 100 | Check if test matches pattern. 101 | @param {string} test To be evaluated. 102 | @param {string} pattern Used to create a RegExp. 103 | @param {string} message Optional. To be displayed in the report. 104 | @return {boolean} True if test matches pattern. 105 | */ 106 | like = function(test, pattern, message) { 107 | testrun.count++; 108 | 109 | var result; 110 | try { 111 | result = eval(test); 112 | var rgx = new RegExp(pattern); 113 | 114 | if (rgx.test(result)) { 115 | testrun.passes++ 116 | testrun.report(" OK "+testrun.count+" - "+((message != null)? message : "")); 117 | } 118 | else { 119 | testrun.fails++ 120 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 121 | testrun.report(" this: "+result); 122 | testrun.report("is not like: "+pattern); 123 | } 124 | } 125 | catch(e) { 126 | testrun.fails++ 127 | testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : "")); 128 | } 129 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Dumper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @class 3 |
  4 | This is a lightly modified version of Kevin Jones' JavaScript
  5 | library Data.Dump. To download the original visit:
  6 |     http://openjsan.org/doc/k/ke/kevinj/Data/Dump/
  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 | 
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 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 | }; -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js: -------------------------------------------------------------------------------- 1 | /** 2 | @constructor 3 | @param [opt] Used to override the commandline options. Useful for testing. 4 | @version $Id: JsDoc.js 831 2010-03-09 14:24:56Z micmath $ 5 | */ 6 | JSDOC.JsDoc = function(/**object*/ opt) { 7 | if (opt) { 8 | JSDOC.opt = opt; 9 | } 10 | 11 | if (JSDOC.opt.h) { 12 | JSDOC.usage(); 13 | quit(); 14 | } 15 | 16 | // defend against options that are not sane 17 | if (JSDOC.opt._.length == 0) { 18 | LOG.warn("No source files to work on. Nothing to do."); 19 | quit(); 20 | } 21 | if (JSDOC.opt.t === true || JSDOC.opt.d === true) { 22 | JSDOC.usage(); 23 | } 24 | 25 | if (typeof JSDOC.opt.d == "string") { 26 | if (!JSDOC.opt.d.charAt(JSDOC.opt.d.length-1).match(/[\\\/]/)) { 27 | JSDOC.opt.d = JSDOC.opt.d+"/"; 28 | } 29 | LOG.inform("Output directory set to '"+JSDOC.opt.d+"'."); 30 | IO.mkPath(JSDOC.opt.d); 31 | } 32 | if (JSDOC.opt.e) IO.setEncoding(JSDOC.opt.e); 33 | 34 | // the -r option: scan source directories recursively 35 | if (typeof JSDOC.opt.r == "boolean") JSDOC.opt.r = 10; 36 | else if (!isNaN(parseInt(JSDOC.opt.r))) JSDOC.opt.r = parseInt(JSDOC.opt.r); 37 | else JSDOC.opt.r = 1; 38 | 39 | // the -D option: define user variables 40 | var D = {}; 41 | if (JSDOC.opt.D) { 42 | for (var i = 0; i < JSDOC.opt.D.length; i++) { 43 | var param = JSDOC.opt.D[i]; 44 | // remove first and last character if both == " 45 | if ( 46 | param.length > 1 47 | && param.charAt(0) == '"' 48 | && param.charAt(param.length-1) == '"' 49 | ) { 50 | param = param.substr(1, param.length-2); 51 | } 52 | var defineParts = param.split(":"); 53 | if (defineParts && defineParts.length > 1) { 54 | for ( var dpIdx = 2; dpIdx < defineParts.length; dpIdx++ ) { 55 | defineParts[1] += ':' + defineParts[dpIdx]; 56 | } 57 | D[defineParts[0]] = defineParts[1]; 58 | } 59 | } 60 | } 61 | JSDOC.opt.D = D; 62 | // combine any conf file D options with the commandline D options 63 | if (defined(JSDOC.conf)) for (var c in JSDOC.conf.D) { 64 | if (!defined(JSDOC.opt.D[c])) { 65 | JSDOC.opt.D[c] = JSDOC.conf.D[c]; 66 | } 67 | } 68 | 69 | // Give plugins a chance to initialize 70 | if (defined(JSDOC.PluginManager)) { 71 | JSDOC.PluginManager.run("onInit", JSDOC.opt); 72 | } 73 | 74 | JSDOC.opt.srcFiles = JSDOC.JsDoc._getSrcFiles(); 75 | JSDOC.JsDoc._parseSrcFiles(); 76 | JSDOC.JsDoc.symbolSet = JSDOC.Parser.symbols; 77 | } 78 | 79 | /** 80 | Retrieve source file list. 81 | @returns {String[]} The pathnames of the files to be parsed. 82 | */ 83 | JSDOC.JsDoc._getSrcFiles = function() { 84 | JSDOC.JsDoc.srcFiles = []; 85 | 86 | var ext = ["js"]; 87 | if (JSDOC.opt.x) { 88 | ext = JSDOC.opt.x.split(",").map(function($) {return $.toLowerCase()}); 89 | } 90 | 91 | for (var i = 0; i < JSDOC.opt._.length; i++) { 92 | JSDOC.JsDoc.srcFiles = JSDOC.JsDoc.srcFiles.concat( 93 | IO.ls(JSDOC.opt._[i], JSDOC.opt.r).filter( 94 | function($) { 95 | var thisExt = $.split(".").pop().toLowerCase(); 96 | 97 | if (JSDOC.opt.E) { 98 | for(var n = 0; n < JSDOC.opt.E.length; n++) { 99 | if ($.match(new RegExp(JSDOC.opt.E[n]))) { 100 | LOG.inform("Excluding " + $); 101 | return false; // if the file matches the regex then it's excluded. 102 | } 103 | } 104 | } 105 | 106 | return (ext.indexOf(thisExt) > -1); // we're only interested in files with certain extensions 107 | } 108 | ) 109 | ); 110 | } 111 | 112 | return JSDOC.JsDoc.srcFiles; 113 | } 114 | 115 | JSDOC.JsDoc._parseSrcFiles = function() { 116 | JSDOC.Parser.init(); 117 | for (var i = 0, l = JSDOC.JsDoc.srcFiles.length; i < l; i++) { 118 | var srcFile = JSDOC.JsDoc.srcFiles[i]; 119 | 120 | if (JSDOC.opt.v) LOG.inform("Parsing file: " + srcFile); 121 | 122 | try { 123 | var src = IO.readFile(srcFile); 124 | } 125 | catch(e) { 126 | LOG.warn("Can't read source file '"+srcFile+"': "+e.message); 127 | } 128 | 129 | var tr = new JSDOC.TokenReader(); 130 | var ts = new JSDOC.TokenStream(tr.tokenize(new JSDOC.TextStream(src))); 131 | 132 | JSDOC.Parser.parse(ts, srcFile); 133 | 134 | } 135 | JSDOC.Parser.finish(); 136 | 137 | if (JSDOC.PluginManager) { 138 | JSDOC.PluginManager.run("onFinishedParsing", JSDOC.Parser.symbols); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/t/TestDoc.js: -------------------------------------------------------------------------------- 1 | var TestDoc = { 2 | fails: 0, 3 | plans: 0, 4 | passes: 0, 5 | results: [] 6 | }; 7 | 8 | TestDoc.record = function(result) { 9 | TestDoc.results.push(result); 10 | if (typeof result.verdict == "boolean") { 11 | if (result.verdict === false) TestDoc.fails++; 12 | if (result.verdict === true) TestDoc.passes++; 13 | } 14 | } 15 | 16 | TestDoc.prove = function(filePath) { 17 | if (typeof document != "undefined" && typeof document.write != "undefined") { 18 | if (TestDoc.console) print = function(s) { TestDoc.console.appendChild(document.createTextNode(s+"\n")); } 19 | else print = function(s) { document.write(s+"
"); } 20 | } 21 | TestDoc.run(TestDoc.readFile(filePath)); 22 | } 23 | 24 | TestDoc.run = function(src) { 25 | try { eval(src); } catch(e) { print("# ERROR! "+e); } 26 | 27 | var chunks = src.split(/\/\*t:/); 28 | 29 | var run = function(chunk) { 30 | // local shortcuts 31 | var is = TestDoc.assertEquals; 32 | var isnt = TestDoc.assertNotEquals; 33 | var plan = TestDoc.plan; 34 | var requires = TestDoc.requires; 35 | 36 | try { eval(chunk); } catch(e) { print("# ERROR! "+e); } 37 | } 38 | for (var start = -1, end = 0; (start = src.indexOf("/*t:", end)) > end; start = end) { 39 | run( 40 | src.substring( 41 | start+4, 42 | (end = src.indexOf("*/", start)) 43 | ) 44 | ); 45 | } 46 | } 47 | 48 | TestDoc.Result = function(verdict, message) { 49 | this.verdict = verdict; 50 | this.message = message; 51 | } 52 | 53 | TestDoc.Result.prototype.toString = function() { 54 | if (typeof this.verdict == "boolean") { 55 | return (this.verdict? "ok" : "not ok") + " " + (++TestDoc.report.counter) + " - " + this.message; 56 | } 57 | 58 | return "# " + this.message; 59 | } 60 | 61 | TestDoc.requires = function(file) { 62 | if (!TestDoc.requires.loaded[file]) { 63 | load(file); 64 | TestDoc.requires.loaded[file] = true; 65 | } 66 | } 67 | TestDoc.requires.loaded = {}; 68 | 69 | TestDoc.report = function() { 70 | TestDoc.report.counter = 0; 71 | print("1.."+TestDoc.plans); 72 | for (var i = 0; i < TestDoc.results.length; i++) { 73 | print(TestDoc.results[i]); 74 | } 75 | print("----------------------------------------"); 76 | if (TestDoc.fails == 0 && TestDoc.passes == TestDoc.plans) { 77 | print("All tests successful."); 78 | } 79 | else { 80 | print("Failed " + TestDoc.fails + "/" + TestDoc.plans + " tests, "+((TestDoc.plans == 0)? 0 : Math.round(TestDoc.passes/(TestDoc.passes+TestDoc.fails)*10000)/100)+"% okay. Planned to run "+TestDoc.plans+", did run "+(TestDoc.passes+TestDoc.fails)+".") 81 | } 82 | } 83 | 84 | TestDoc.plan = function(n, message) { 85 | TestDoc.plans += n; 86 | TestDoc.record(new TestDoc.Result(null, message+" ("+n+" tests)")); 87 | } 88 | 89 | TestDoc.assertEquals = function(a, b, message) { 90 | var result = (a == b); 91 | if (!result) message += "\n#\n# " + a + " does not equal " + b + "\n#"; 92 | TestDoc.record(new TestDoc.Result(result, message)); 93 | } 94 | 95 | TestDoc.assertNotEquals = function(a, b, message) { 96 | var result = (a != b); 97 | if (!result) message += "\n#\n# " + a + " equals " + b + "\n#"; 98 | TestDoc.record(new TestDoc.Result(result, message)); 99 | } 100 | 101 | TestDoc.readFile = (function(){ 102 | // rhino 103 | if (typeof readFile == "function") { 104 | return function(url) { 105 | var text = readFile(url); 106 | return text || ""; 107 | } 108 | } 109 | 110 | // a web browser 111 | else { 112 | return function(url) { 113 | var httpRequest; 114 | 115 | if (window.XMLHttpRequest) { // Mozilla, Safari, etc 116 | httpRequest = new XMLHttpRequest(); 117 | } 118 | else if (window.ActiveXObject) { // IE 119 | try { 120 | httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); 121 | } 122 | catch (e) { 123 | try { 124 | httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); 125 | } 126 | catch (e) { 127 | } 128 | } 129 | } 130 | 131 | if (!httpRequest) { throw "Cannot create HTTP Request."; } 132 | 133 | httpRequest.open('GET', url, false); 134 | httpRequest.send(''); 135 | if (httpRequest.readyState == 4) { 136 | if (httpRequest.status >= 400) { 137 | throw "The HTTP Request returned an error code: "+httpRequest.status; 138 | } 139 | } 140 | 141 | return httpRequest.responseText || ""; 142 | } 143 | } 144 | })(); 145 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js: -------------------------------------------------------------------------------- 1 | LOG.inform("XMLDOC.DomReader loaded"); 2 | 3 | XMLDOC.DomReader = function(root) { 4 | 5 | this.dom = root; 6 | 7 | /** 8 | * The current node the reader is on 9 | */ 10 | this.node = root; 11 | 12 | /** 13 | * Get the current node the reader is on 14 | * @type XMLDOC.Parser.node 15 | */ 16 | XMLDOC.DomReader.prototype.getNode = function() { 17 | return this.node; 18 | }; 19 | 20 | /** 21 | * Set the node the reader should be positioned on. 22 | * @param node {XMLDOC.Parser.node} 23 | */ 24 | XMLDOC.DomReader.prototype.setNode = function(node) { 25 | this.node = node; 26 | }; 27 | 28 | /** 29 | * A helper method to make sure the current node will 30 | * never return null, unless null is passed as the root. 31 | * @param step {String} An expression to evaluate - should return a node or null 32 | */ 33 | XMLDOC.DomReader.prototype.navigate = function(step) { 34 | var n; 35 | if ((n = step) != null) 36 | { 37 | this.node = n; 38 | return this.node; 39 | } 40 | return null; 41 | }; 42 | 43 | /** 44 | * Get the root node of the current node's document. 45 | */ 46 | XMLDOC.DomReader.prototype.root = function() { 47 | this.navigate(this.dom); 48 | }; 49 | 50 | /** 51 | * Get the parent of the current node. 52 | */ 53 | XMLDOC.DomReader.prototype.parent = function() { 54 | return this.navigate(this.node.parentNode()); 55 | }; 56 | 57 | /** 58 | * Get the first child of the current node. 59 | */ 60 | XMLDOC.DomReader.prototype.firstChild = function() { 61 | return this.navigate(this.node.firstChild()); 62 | }; 63 | 64 | /** 65 | * Get the last child of the current node. 66 | */ 67 | XMLDOC.DomReader.prototype.lastChild = function() { 68 | return this.navigate(this.node.lastChild()); 69 | }; 70 | 71 | /** 72 | * Get the next sibling of the current node. 73 | */ 74 | XMLDOC.DomReader.prototype.nextSibling = function() { 75 | return this.navigate(this.node.nextSibling()); 76 | }; 77 | 78 | /** 79 | * Get the previous sibling of the current node. 80 | */ 81 | XMLDOC.DomReader.prototype.prevSibling = function() { 82 | return this.navigate(this.node.prevSibling()); 83 | }; 84 | 85 | //=============================================================================================== 86 | // Support methods 87 | 88 | /** 89 | * Walk the tree starting with the current node, calling the plug-in for 90 | * each node visited. Each time the plug-in is called, the DomReader 91 | * is passed as the only parameter. Use the {@link XMLDOC.DomReader#getNode} method 92 | * to access the current node. This method uses a depth first traversal pattern. 93 | * 94 | * @param srcFile {String} The source file being evaluated 95 | */ 96 | XMLDOC.DomReader.prototype.getSymbols = function(srcFile) 97 | { 98 | XMLDOC.DomReader.symbols = []; 99 | XMLDOC.DomReader.currentFile = srcFile; 100 | JSDOC.Symbol.srcFile = (srcFile || ""); 101 | 102 | if (defined(JSDOC.PluginManager)) { 103 | JSDOC.PluginManager.run("onDomGetSymbols", this); 104 | } 105 | 106 | return XMLDOC.DomReader.symbols; 107 | }; 108 | 109 | /** 110 | * Find the node with the given name using a depth first traversal. 111 | * Does not modify the DomReader's current node. 112 | * 113 | * @param name {String} The name of the node to find 114 | * @return the node that was found, or null if not found 115 | */ 116 | XMLDOC.DomReader.prototype.findNode = function(name) 117 | { 118 | var findNode = null; 119 | 120 | // Start at the current node and move into the subtree, 121 | // looking for the node with the given name 122 | function deeper(node, find) 123 | { 124 | var look = null; 125 | 126 | if (node) { 127 | if (node.name == find) 128 | { 129 | return node; 130 | } 131 | 132 | if (node.firstChild()) 133 | { 134 | look = deeper(node.firstChild(), find); 135 | } 136 | 137 | if (!look && node.nextSibling()) 138 | { 139 | look = deeper(node.nextSibling(), find); 140 | } 141 | } 142 | 143 | return look; 144 | } 145 | 146 | return deeper(this.getNode().firstChild(), name); 147 | }; 148 | 149 | /** 150 | * Find the next node with the given name using a depth first traversal. 151 | * 152 | * @param name {String} The name of the node to find 153 | */ 154 | XMLDOC.DomReader.prototype.findPreviousNode = function(name) 155 | { 156 | }; 157 | 158 | }; 159 | 160 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/Parser.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @namespace 5 | @requires JSDOC.Walker 6 | @requires JSDOC.Symbol 7 | @requires JSDOC.DocComment 8 | */ 9 | JSDOC.Parser = { 10 | conf: { 11 | ignoreCode: JSDOC.opt.n, 12 | ignoreAnonymous: true, // factory: true 13 | treatUnderscoredAsPrivate: true, // factory: true 14 | explain: false // factory: false 15 | }, 16 | 17 | addSymbol: function(symbol) { 18 | 19 | if (JSDOC.Parser.rename) { 20 | for (var n in JSDOC.Parser.rename) { 21 | if (symbol.alias.indexOf(n) == 0) { 22 | if (symbol.name == symbol.alias) { 23 | symbol.name = symbol.name.replace(n, JSDOC.Parser.rename[n]); 24 | } 25 | symbol.alias = symbol.alias.replace(n, JSDOC.Parser.rename[n]); 26 | } 27 | } 28 | } 29 | 30 | if (JSDOC.opt.S) { 31 | if (typeof JSDOC.Parser.secureModules == "undefined") JSDOC.Parser.secureModules = {}; 32 | if (/^exports\./.test(symbol.alias)) { 33 | symbol.srcFile.match(/(^|[\\\/])([^\\\/]+)\.js/i); 34 | var fileNS = RegExp.$2; 35 | 36 | // need to create the namespace associated with this file first 37 | if (!JSDOC.Parser.secureModules[fileNS]) { 38 | JSDOC.Parser.secureModules[fileNS] = 1; 39 | var nsSymbol = new JSDOC.Symbol(fileNS, [], "GLOBAL", new JSDOC.DocComment("")); 40 | nsSymbol.isNamespace = true; 41 | nsSymbol.srcFile = ""; 42 | nsSymbol.isPrivate = false; 43 | nsSymbol.srcFile = symbol.srcFile; 44 | nsSymbol.desc = (JSDOC.Parser.symbols.getSymbol(symbol.srcFile) || {desc: ""}).desc; 45 | JSDOC.Parser.addSymbol(nsSymbol); 46 | } 47 | 48 | symbol.alias = symbol.alias.replace(/^exports\./, fileNS + '.'); 49 | symbol.name = symbol.name.replace(/^exports\./, ''); 50 | symbol.memberOf = fileNS; 51 | symbol.isStatic = true; 52 | } 53 | } 54 | 55 | // if a symbol alias is documented more than once the first one with the user docs wins 56 | if (JSDOC.Parser.symbols.hasSymbol(symbol.alias)) { 57 | var oldSymbol = JSDOC.Parser.symbols.getSymbol(symbol.alias); 58 | if (oldSymbol.comment.isUserComment) { 59 | if (JSDOC.opt.m) return; 60 | if (symbol.comment.isUserComment) { // old and new are both documented 61 | LOG.warn("The symbol '"+symbol.alias+"' is documented more than once."); 62 | return; 63 | } 64 | else { // old is documented but new isn't 65 | return; 66 | } 67 | } 68 | } 69 | 70 | // we don't document anonymous things 71 | if (JSDOC.Parser.conf.ignoreAnonymous && symbol.name.match(/\$anonymous\b/)) return; 72 | 73 | // uderscored things may be treated as if they were marked private, this cascades 74 | if (JSDOC.Parser.conf.treatUnderscoredAsPrivate && symbol.name.match(/[.#-]_[^.#-]+$/)) { 75 | if (!symbol.comment.getTag("public").length > 0) symbol.isPrivate = true; 76 | } 77 | 78 | // -p flag is required to document private things 79 | if (!JSDOC.opt.p && symbol.isPrivate) return; // issue #161 fixed by mcbain.asm 80 | 81 | // ignored things are not documented, this doesn't cascade 82 | if (symbol.isIgnored) return; 83 | JSDOC.Parser.symbols.addSymbol(symbol); 84 | }, 85 | 86 | addBuiltin: function(name) { 87 | var builtin = new JSDOC.Symbol(name, [], "CONSTRUCTOR", new JSDOC.DocComment("")); 88 | builtin.isNamespace = true; 89 | builtin.srcFile = ""; 90 | builtin.isPrivate = false; 91 | JSDOC.Parser.addSymbol(builtin); 92 | return builtin; 93 | }, 94 | 95 | init: function() { 96 | JSDOC.Parser.symbols = new JSDOC.SymbolSet(); 97 | JSDOC.Parser.walker = new JSDOC.Walker(); 98 | }, 99 | 100 | finish: function() { 101 | JSDOC.Parser.symbols.relate(); 102 | 103 | // make a litle report about what was found 104 | if (JSDOC.Parser.conf.explain) { 105 | var symbols = JSDOC.Parser.symbols.toArray(); 106 | var srcFile = ""; 107 | for (var i = 0, l = symbols.length; i < l; i++) { 108 | var symbol = symbols[i]; 109 | if (srcFile != symbol.srcFile) { 110 | srcFile = symbol.srcFile; 111 | print("\n"+srcFile+"\n-------------------"); 112 | } 113 | print(i+":\n alias => "+symbol.alias + "\n name => "+symbol.name+ "\n isa => "+symbol.isa + "\n memberOf => " + symbol.memberOf + "\n isStatic => " + symbol.isStatic + ", isInner => " + symbol.isInner+ ", isPrivate => " + symbol.isPrivate); 114 | } 115 | print("-------------------\n"); 116 | } 117 | } 118 | } 119 | 120 | JSDOC.Parser.parse = function(/**JSDOC.TokenStream*/ts, /**String*/srcFile) { 121 | JSDOC.Symbol.srcFile = (srcFile || ""); 122 | JSDOC.DocComment.shared = ""; // shared comments don't cross file boundaries 123 | 124 | if (!JSDOC.Parser.walker) JSDOC.Parser.init(); 125 | JSDOC.Parser.walker.walk(ts); // adds to our symbols 126 | 127 | // filter symbols by option 128 | for (var p = JSDOC.Parser.symbols._index.first(); p; p = JSDOC.Parser.symbols._index.next()) { 129 | var symbol = p.value; 130 | 131 | if (!symbol) continue; 132 | 133 | if (symbol.is("FILE") || symbol.is("GLOBAL")) { 134 | continue; 135 | } 136 | else if (!JSDOC.opt.a && !symbol.comment.isUserComment) { 137 | JSDOC.Parser.symbols.deleteSymbol(symbol.alias); 138 | } 139 | 140 | if (/#$/.test(symbol.alias)) { // we don't document prototypes 141 | JSDOC.Parser.symbols.deleteSymbol(symbol.alias); 142 | } 143 | } 144 | 145 | return JSDOC.Parser.symbols.toArray(); 146 | } 147 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/frame/Link.js: -------------------------------------------------------------------------------- 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 | ns = ""; 79 | 80 | if (symbol.isStatic) linker = "."; 81 | else if (symbol.isInner) linker = "-"; 82 | 83 | if (symbol.isEvent && !/^event:/.test(symbol.name)) { 84 | ns = "event:"; 85 | } 86 | return Link.hashPrefix+linker+ns+symbol.name; 87 | } 88 | 89 | Link.getSymbol= function(alias) { 90 | var symbol= Link.symbolSet.getSymbol(alias); 91 | 92 | if (symbol) 93 | return symbol; 94 | 95 | if ('#'!==alias.charAt(0) || !Link.currentSymbol) 96 | return null; 97 | 98 | // resolve relative name 99 | var container= Link.currentSymbol; 100 | 101 | while (container) 102 | { 103 | symbol= Link.symbolSet.getSymbol(container.alias + alias); 104 | if (symbol) 105 | return symbol; 106 | 107 | // No superclass 108 | if (!container.augments.length) 109 | return null; 110 | 111 | container= Link.symbolSet.getSymbol(container.augments[0].desc); 112 | } 113 | 114 | return null; 115 | } 116 | 117 | /** Create a link to another symbol. */ 118 | Link.prototype._makeSymbolLink = function(alias) { 119 | var linkBase = Link.base+publish.conf.symbolsDir; 120 | var linkTo = Link.getSymbol(alias); 121 | var linkPath; 122 | var target = (this.targetName)? " target=\""+this.targetName+"\"" : ""; 123 | 124 | // if there is no symbol by that name just return the name unaltered 125 | if (!linkTo) 126 | return this.text || alias; 127 | 128 | // it's a symbol in another file 129 | else { 130 | if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property 131 | linkPath= (Link.filemap) ? Link.filemap[linkTo.memberOf] : 132 | escape(linkTo.memberOf) || "_global_"; 133 | linkPath += publish.conf.ext + "#" + Link.symbolNameToLinkName(linkTo); 134 | } 135 | else { 136 | linkPath = (Link.filemap)? Link.filemap[linkTo.alias] : escape(linkTo.alias); 137 | linkPath += publish.conf.ext;// + (this.classLink? "":"#" + Link.hashPrefix + "constructor"); 138 | } 139 | linkPath = linkBase + linkPath 140 | } 141 | 142 | var linkText= this.text || alias; 143 | 144 | var link = {linkPath: linkPath, linkText: linkText, linkInner: (this.innerName? "#"+this.innerName : "")}; 145 | 146 | if (typeof JSDOC.PluginManager != "undefined") { 147 | JSDOC.PluginManager.run("onSymbolLink", link); 148 | } 149 | 150 | return ""+link.linkText+""; 151 | } 152 | 153 | /** Create a link to a source file. */ 154 | Link.prototype._makeSrcLink = function(srcFilePath) { 155 | var target = (this.targetName)? " target=\""+this.targetName+"\"" : ""; 156 | 157 | // transform filepath into a filename 158 | var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "_"); 159 | var outFilePath = Link.base + publish.conf.srcDir + srcFile + publish.conf.ext; 160 | 161 | if (!this.text) this.text = FilePath.fileName(srcFilePath); 162 | return ""+this.text+""; 163 | } 164 | 165 | /** Create a link to a source file. */ 166 | Link.prototype._makeFileLink = function(filePath) { 167 | var target = (this.targetName)? " target=\""+this.targetName+"\"" : ""; 168 | 169 | var outFilePath = Link.base + filePath; 170 | 171 | if (!this.text) this.text = filePath; 172 | return ""+this.text+""; 173 | } -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines":{ 3 | 4 | "jsdoc-toolkit":{ 5 | "vars":{ 6 | "DOCDIR": "-Djsdoc.dir=$BASEDIR", 7 | "APPDIR": "$BASEDIR/app", 8 | "BASEDIR": "$VENDOR/jsdoc-toolkit", 9 | "TDIR": "-Djsdoc.template.dir=$BASEDIR/templates/jsdoc" 10 | }, 11 | "cmd": { 12 | 13 | "main": "java", 14 | 15 | "params": [ 16 | "$DOCDIR", 17 | "$TDIR", 18 | "-jar", 19 | "$BASEDIR/jsrun.jar", 20 | "$APPDIR/run.js", 21 | "-v", 22 | "-e=UTF-8", 23 | "-d=$DESTINATION", 24 | "$SOURCE", 25 | "$DEFAULTS" 26 | ], 27 | 28 | "default-params": { 29 | "-p": true, 30 | "-r": "10" 31 | } 32 | }, 33 | 34 | "allowed-params":[ 35 | "-a", 36 | "--allfunctions", 37 | "-E", 38 | "--exclude", 39 | "-n", 40 | "--nocode", 41 | "-p", 42 | "--private", 43 | "-r", 44 | "--recurse", 45 | "-u", 46 | "--unique", 47 | "-x", 48 | "--ext" 49 | ], 50 | 51 | "param-alias":{ 52 | "--allfunctions":"-a", 53 | "--exclude": "-E", 54 | "--recurse": "-r", 55 | "--nocode": "-n", 56 | "--private": "-p", 57 | "--unique": "-u", 58 | "--ext": "-x" 59 | }, 60 | 61 | "params-format":{ 62 | "short": ["%key%", "%value%"], 63 | "full": "%key%=%value%" 64 | } 65 | }, 66 | 67 | "phpDocumentor": { 68 | 69 | "vars": {}, 70 | 71 | "cmd": { 72 | "main": "phpdoc", 73 | "params": [ 74 | "--directory", 75 | "$SOURCE", 76 | "-t", 77 | "$DESTINATION" 78 | ], 79 | 80 | "default-params": { 81 | "-o": "HTML:Smarty:PHP" 82 | } 83 | }, 84 | 85 | "allowed-params": [ 86 | "-ed", 87 | "--examplesdir", 88 | "-i", 89 | "--ignore", 90 | "-is", 91 | "--ignoresymlinks", 92 | "-it", 93 | "--ignore-tags", 94 | "-dh", 95 | "--hidden", 96 | "-ue", 97 | "--undocumentedelements", 98 | "-ti", 99 | "--title", 100 | "-pp", 101 | "--parseprivate", 102 | "-po", 103 | "--packageoutput", 104 | "-dn", 105 | "--defaultpackagename", 106 | "-dc", 107 | "--defaultcategoryname", 108 | "-o", 109 | "--output", 110 | "-s", 111 | "--sourcecode", 112 | "-j", 113 | "--javadocdesc", 114 | "-p", 115 | "--pear", 116 | "-ric", 117 | "--readmeinstallchangelog" 118 | ], 119 | 120 | "param-alias": { 121 | "--examplesdir": "-ed", 122 | "--ignore": "-i", 123 | "--ignoresymlinks": "-is", 124 | "--ignore-tags": "-it", 125 | "--hidden": "-dh", 126 | "--undocumentedelements": "-ue", 127 | "--title": "-ti", 128 | "--parseprivate": "-pp", 129 | "--packageoutput": "-po", 130 | "--defaultpackagename": "-dn", 131 | "--defaultcategoryname": "-dc", 132 | "--output": "-o", 133 | "--sourcecode": "-s", 134 | "--javadocdesc": "-j", 135 | "--pear": "-p", 136 | "--readmeinstallchangelog": "-ric" 137 | }, 138 | 139 | "params-filter": { 140 | "-ed": "chroot", 141 | "--examplesdir": "chroot" 142 | } 143 | }, 144 | 145 | "pdoc": { 146 | "vars": {}, 147 | 148 | "cmd": { 149 | "main": "pdoc", 150 | "params": [ 151 | "-o", 152 | "$DESTINATION", 153 | "-d", 154 | "$SOURCE" 155 | ] 156 | } 157 | }, 158 | 159 | "jsduck": { 160 | "vars": {}, 161 | 162 | "cmd": { 163 | "main": "jsduck", 164 | "params": [ 165 | "$SOURCE", 166 | "-v", 167 | "-p 0", 168 | "--output", 169 | "$DESTINATION", 170 | "$DEFAULTS" 171 | ] 172 | }, 173 | 174 | "params-format":{ 175 | "short": ["%key%", "%value%"], 176 | "full": "%key%=%value%" 177 | }, 178 | 179 | "allowed-params": [ 180 | "--ignore-global", 181 | "--external", 182 | "--builtin-classes", 183 | "--title", 184 | "--footer", 185 | "--head-html", 186 | "--welcome", 187 | "--stats", 188 | "--categories", 189 | "--pretty-json", 190 | "--images", 191 | "--link", 192 | "--img", 193 | "--warnings", 194 | "--extjs-path", 195 | "--touch-examples-ui", 196 | "--ext-namespaces" 197 | ], 198 | 199 | "params-filter": { 200 | "--welcome": "chroot", 201 | "--images": "chroot", 202 | "--categories": "chroot", 203 | "--extjs-path": "chroot" 204 | } 205 | } 206 | } 207 | } -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/DocComment.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | Create a new DocComment. This takes a raw documentation comment, 5 | and wraps it in useful accessors. 6 | @class Represents a documentation comment object. 7 | */ 8 | JSDOC.DocComment = function(/**String*/comment) { 9 | this.init(); 10 | if (typeof comment != "undefined") { 11 | this.parse(comment); 12 | } 13 | } 14 | 15 | JSDOC.DocComment.prototype.init = function() { 16 | this.isUserComment = true; 17 | this.src = ""; 18 | this.meta = ""; 19 | this.tagTexts = []; 20 | this.tags = []; 21 | } 22 | 23 | /** 24 | @requires JSDOC.DocTag 25 | */ 26 | JSDOC.DocComment.prototype.parse = function(/**String*/comment) { 27 | if (comment == "") { 28 | comment = "/** @desc */"; 29 | this.isUserComment = false; 30 | } 31 | 32 | this.src = JSDOC.DocComment.unwrapComment(comment); 33 | 34 | this.meta = ""; 35 | if (this.src.indexOf("#") == 0) { 36 | this.src.match(/#(.+[+-])([\s\S]*)$/); 37 | if (RegExp.$1) this.meta = RegExp.$1; 38 | if (RegExp.$2) this.src = RegExp.$2; 39 | } 40 | 41 | if (typeof JSDOC.PluginManager != "undefined") { 42 | JSDOC.PluginManager.run("onDocCommentSrc", this); 43 | } 44 | 45 | this.fixDesc(); 46 | 47 | this.src = JSDOC.DocComment.shared+"\n"+this.src; 48 | 49 | this.tagTexts = 50 | this.src 51 | .split(/(^|[\r\n])\s*@/) 52 | .filter(function($){return $.match(/\S/)}); 53 | 54 | /** 55 | The tags found in the comment. 56 | @type JSDOC.DocTag[] 57 | */ 58 | this.tags = this.tagTexts.map(function($){return new JSDOC.DocTag($)}); 59 | 60 | if (typeof JSDOC.PluginManager != "undefined") { 61 | JSDOC.PluginManager.run("onDocCommentTags", this); 62 | } 63 | } 64 | 65 | /*t: 66 | plan(5, "testing JSDOC.DocComment"); 67 | requires("../frame/String.js"); 68 | requires("../lib/JSDOC/DocTag.js"); 69 | 70 | var com = new JSDOC.DocComment("/**@foo some\n* comment here*"+"/"); 71 | is(com.tagTexts[0], "foo some\ncomment here", "first tag text is found."); 72 | is(com.tags[0].title, "foo", "the title is found in a comment with one tag."); 73 | 74 | var com = new JSDOC.DocComment("/** @foo first\n* @bar second*"+"/"); 75 | is(com.getTag("bar").length, 1, "getTag() returns one tag by that title."); 76 | 77 | JSDOC.DocComment.shared = "@author John Smith"; 78 | var com = new JSDOC.DocComment("/**@foo some\n* comment here*"+"/"); 79 | is(com.tags[0].title, "author", "shared comment is added."); 80 | is(com.tags[1].title, "foo", "shared comment is added to existing tag."); 81 | */ 82 | 83 | /** 84 | If no @desc tag is provided, this function will add it. 85 | */ 86 | JSDOC.DocComment.prototype.fixDesc = function() { 87 | if (this.meta && this.meta != "@+") return; 88 | if (/^\s*[^@\s]/.test(this.src)) { 89 | this.src = "@desc "+this.src; 90 | } 91 | } 92 | 93 | /*t: 94 | plan(5, "testing JSDOC.DocComment#fixDesc"); 95 | 96 | var com = new JSDOC.DocComment(); 97 | 98 | com.src = "this is a desc\n@author foo"; 99 | com.fixDesc(); 100 | is(com.src, "@desc this is a desc\n@author foo", "if no @desc tag is provided one is added."); 101 | 102 | com.src = "x"; 103 | com.fixDesc(); 104 | is(com.src, "@desc x", "if no @desc tag is provided one is added to a single character."); 105 | 106 | com.src = "\nx"; 107 | com.fixDesc(); 108 | is(com.src, "@desc \nx", "if no @desc tag is provided one is added to return and character."); 109 | 110 | com.src = " "; 111 | com.fixDesc(); 112 | is(com.src, " ", "if no @desc tag is provided one is not added to just whitespace."); 113 | 114 | com.src = ""; 115 | com.fixDesc(); 116 | is(com.src, "", "if no @desc tag is provided one is not added to empty."); 117 | */ 118 | 119 | /** 120 | Remove slash-star comment wrapper from a raw comment string. 121 | @type String 122 | */ 123 | JSDOC.DocComment.unwrapComment = function(/**String*/comment) { 124 | if (!comment) return ""; 125 | var unwrapped = comment.replace(/(^\/\*\*|\*\/$)/g, "").replace(/^\s*\* ?/gm, ""); 126 | return unwrapped; 127 | } 128 | 129 | /*t: 130 | plan(5, "testing JSDOC.DocComment.unwrapComment"); 131 | 132 | var com = "/**x*"+"/"; 133 | var unwrapped = JSDOC.DocComment.unwrapComment(com); 134 | is(unwrapped, "x", "a single character jsdoc is found."); 135 | 136 | com = "/***x*"+"/"; 137 | unwrapped = JSDOC.DocComment.unwrapComment(com); 138 | is(unwrapped, "x", "three stars are allowed in the opener."); 139 | 140 | com = "/****x*"+"/"; 141 | unwrapped = JSDOC.DocComment.unwrapComment(com); 142 | is(unwrapped, "*x", "fourth star in the opener is kept."); 143 | 144 | com = "/**x\n * y\n*"+"/"; 145 | unwrapped = JSDOC.DocComment.unwrapComment(com); 146 | is(unwrapped, "x\ny\n", "leading stars and spaces are trimmed."); 147 | 148 | com = "/**x\n * y\n*"+"/"; 149 | unwrapped = JSDOC.DocComment.unwrapComment(com); 150 | is(unwrapped, "x\n y\n", "only first space after leading stars are trimmed."); 151 | */ 152 | 153 | /** 154 | Provides a printable version of the comment. 155 | @type String 156 | */ 157 | JSDOC.DocComment.prototype.toString = function() { 158 | return this.src; 159 | } 160 | 161 | /*t: 162 | plan(1, "testing JSDOC.DocComment#fixDesc"); 163 | var com = new JSDOC.DocComment(); 164 | com.src = "foo"; 165 | is(""+com, "foo", "stringifying a comment returns the unwrapped src."); 166 | */ 167 | 168 | /** 169 | Given the title of a tag, returns all tags that have that title. 170 | @type JSDOC.DocTag[] 171 | */ 172 | JSDOC.DocComment.prototype.getTag = function(/**String*/tagTitle) { 173 | return this.tags.filter(function($){return $.title == tagTitle}); 174 | } 175 | 176 | JSDOC.DocComment.prototype.deleteTag = function(/**String*/tagTitle) { 177 | this.tags = this.tags.filter(function($){return $.title != tagTitle}) 178 | } 179 | 180 | /*t: 181 | plan(1, "testing JSDOC.DocComment#getTag"); 182 | requires("../frame/String.js"); 183 | requires("../lib/JSDOC/DocTag.js"); 184 | 185 | var com = new JSDOC.DocComment("/**@foo some\n* @bar\n* @bar*"+"/"); 186 | is(com.getTag("bar").length, 2, "getTag returns expected number of tags."); 187 | */ 188 | 189 | /** 190 | Used to store the currently shared tag text. 191 | */ 192 | JSDOC.DocComment.shared = ""; 193 | 194 | /*t: 195 | plan(2, "testing JSDOC.DocComment.shared"); 196 | requires("../frame/String.js"); 197 | requires("../lib/JSDOC/DocTag.js"); 198 | 199 | JSDOC.DocComment.shared = "@author Michael"; 200 | 201 | var com = new JSDOC.DocComment("/**@foo\n* @foo*"+"/"); 202 | is(com.getTag("author").length, 1, "getTag returns shared tag."); 203 | is(com.getTag("foo").length, 2, "getTag returns unshared tags too."); 204 | */ -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/templates/jsdoc/publish.js: -------------------------------------------------------------------------------- 1 | /** Called automatically by JsDoc Toolkit. */ 2 | function publish(symbolSet) { 3 | publish.conf = { // trailing slash expected for dirs 4 | ext: ".html", 5 | outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/", 6 | templatesDir: JSDOC.opt.t || SYS.pwd+"../templates/jsdoc/", 7 | symbolsDir: "symbols/", 8 | srcDir: "symbols/src/" 9 | }; 10 | 11 | // is source output is suppressed, just display the links to the source file 12 | if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) { 13 | Link.prototype._makeSrcLink = function(srcFilePath) { 14 | return "<"+srcFilePath+">"; 15 | } 16 | } 17 | 18 | // create the folders and subfolders to hold the output 19 | IO.mkPath((publish.conf.outDir+"symbols/src").split("/")); 20 | 21 | // used to allow Link to check the details of things being linked to 22 | Link.symbolSet = symbolSet; 23 | 24 | // create the required templates 25 | try { 26 | var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl"); 27 | var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl"); 28 | } 29 | catch(e) { 30 | print("Couldn't create the required templates: "+e); 31 | quit(); 32 | } 33 | 34 | // some ustility filters 35 | function hasNoParent($) {return ($.memberOf == "")} 36 | function isaFile($) {return ($.is("FILE"))} 37 | function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)} 38 | 39 | // get an array version of the symbolset, useful for filtering 40 | var symbols = symbolSet.toArray(); 41 | 42 | // create the hilited source code files 43 | var files = JSDOC.opt.srcFiles; 44 | for (var i = 0, l = files.length; i < l; i++) { 45 | var file = files[i]; 46 | var srcDir = publish.conf.outDir + "symbols/src/"; 47 | makeSrcFile(file, srcDir); 48 | } 49 | 50 | // get a list of all the classes in the symbolset 51 | var classes = symbols.filter(isaClass).sort(makeSortby("alias")); 52 | 53 | // create a filemap in which outfiles must be to be named uniquely, ignoring case 54 | if (JSDOC.opt.u) { 55 | var filemapCounts = {}; 56 | Link.filemap = {}; 57 | for (var i = 0, l = classes.length; i < l; i++) { 58 | var lcAlias = classes[i].alias.toLowerCase(); 59 | 60 | if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1; 61 | else filemapCounts[lcAlias]++; 62 | 63 | Link.filemap[classes[i].alias] = 64 | (filemapCounts[lcAlias] > 1)? 65 | lcAlias+"_"+filemapCounts[lcAlias] : lcAlias; 66 | } 67 | } 68 | 69 | // create a class index, displayed in the left-hand column of every class page 70 | Link.base = "../"; 71 | publish.classesIndex = classesTemplate.process(classes); // kept in memory 72 | 73 | // create each of the class pages 74 | for (var i = 0, l = classes.length; i < l; i++) { 75 | var symbol = classes[i]; 76 | 77 | symbol.events = symbol.getEvents(); // 1 order matters 78 | symbol.methods = symbol.getMethods(); // 2 79 | 80 | Link.currentSymbol= symbol; 81 | var output = ""; 82 | output = classTemplate.process(symbol); 83 | 84 | IO.saveFile(publish.conf.outDir+"symbols/", ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output); 85 | } 86 | 87 | // regenerate the index with different relative links, used in the index pages 88 | Link.base = ""; 89 | publish.classesIndex = classesTemplate.process(classes); 90 | 91 | // create the class index page 92 | try { 93 | var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl"); 94 | } 95 | catch(e) { print(e.message); quit(); } 96 | 97 | var classesIndex = classesindexTemplate.process(classes); 98 | IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex); 99 | classesindexTemplate = classesIndex = classes = null; 100 | 101 | // create the file index page 102 | try { 103 | var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl"); 104 | } 105 | catch(e) { print(e.message); quit(); } 106 | 107 | var documentedFiles = symbols.filter(isaFile); // files that have file-level docs 108 | var allFiles = []; // not all files have file-level docs, but we need to list every one 109 | 110 | for (var i = 0; i < files.length; i++) { 111 | allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */"))); 112 | } 113 | 114 | for (var i = 0; i < documentedFiles.length; i++) { 115 | var offset = files.indexOf(documentedFiles[i].alias); 116 | allFiles[offset] = documentedFiles[i]; 117 | } 118 | 119 | allFiles = allFiles.sort(makeSortby("name")); 120 | 121 | // output the file index page 122 | var filesIndex = fileindexTemplate.process(allFiles); 123 | IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex); 124 | fileindexTemplate = filesIndex = files = null; 125 | } 126 | 127 | 128 | /** Just the first sentence (up to a full stop). Should not break on dotted variable names. */ 129 | function summarize(desc) { 130 | if (typeof desc != "undefined") 131 | return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc; 132 | } 133 | 134 | /** Make a symbol sorter by some attribute. */ 135 | function makeSortby(attribute) { 136 | return function(a, b) { 137 | if (a[attribute] != undefined && b[attribute] != undefined) { 138 | a = a[attribute].toLowerCase(); 139 | b = b[attribute].toLowerCase(); 140 | if (a < b) return -1; 141 | if (a > b) return 1; 142 | return 0; 143 | } 144 | } 145 | } 146 | 147 | /** Pull in the contents of an external file at the given path. */ 148 | function include(path) { 149 | var path = publish.conf.templatesDir+path; 150 | return IO.readFile(path); 151 | } 152 | 153 | /** Turn a raw source file into a code-hilited page in the docs. */ 154 | function makeSrcFile(path, srcDir, name) { 155 | if (JSDOC.opt.s) return; 156 | 157 | if (!name) { 158 | name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_"); 159 | name = name.replace(/\:/g, "_"); 160 | } 161 | 162 | var src = {path: path, name:name, charset: IO.encoding, hilited: ""}; 163 | 164 | if (defined(JSDOC.PluginManager)) { 165 | JSDOC.PluginManager.run("onPublishSrc", src); 166 | } 167 | 168 | if (src.hilited) { 169 | IO.saveFile(srcDir, name+publish.conf.ext, src.hilited); 170 | } 171 | } 172 | 173 | /** Build output for displaying function parameters. */ 174 | function makeSignature(params) { 175 | if (!params) return "()"; 176 | var signature = "(" 177 | + 178 | params.filter( 179 | function($) { 180 | return $.name.indexOf(".") == -1; // don't show config params in signature 181 | } 182 | ).map( 183 | function($) { 184 | return $.name; 185 | } 186 | ).join(", ") 187 | + 188 | ")"; 189 | return signature; 190 | } 191 | 192 | /** Find symbol {@link ...} strings in text and turn into html links */ 193 | function resolveLinks(str, from) { 194 | str = str.replace(/\{@link ([^} ]+) ?\}/gi, 195 | function(match, symbolName) { 196 | return new Link().toSymbol(symbolName); 197 | } 198 | ); 199 | 200 | return str; 201 | } 202 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/README.txt: -------------------------------------------------------------------------------- 1 | ====================================================================== 2 | 3 | DESCRIPTION: 4 | 5 | This is the source code for JsDoc Toolkit, an automatic documentation 6 | generation tool for JavaScript. It is written in JavaScript and is run 7 | from a command line (or terminal) using Java and Mozilla's Rhino 8 | JavaScript runtime engine. 9 | 10 | Using this tool you can automatically turn JavaDoc-like comments in 11 | your JavaScript source code into published output files, such as HTML 12 | or XML. 13 | 14 | For more information, to report a bug, or to browse the technical 15 | documentation for this tool please visit the official JsDoc Toolkit 16 | project homepage at http://code.google.com/p/jsdoc-toolkit/ 17 | 18 | For the most up-to-date documentation on JsDoc Toolkit see the 19 | official wiki at http://code.google.com/p/jsdoc-toolkit/w/list 20 | 21 | ====================================================================== 22 | 23 | REQUIREMENTS: 24 | 25 | JsDoc Toolkit is known to work with: 26 | java version "1.6.0_03" 27 | Java(TM) SE Runtime Environment (build 1.6.0_03-b05) 28 | on Windows XP, 29 | and java version "1.5.0_19" 30 | Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304) 31 | on Mac OS X 10.5. 32 | 33 | Other versions of java may or may not work with JsDoc Toolkit. 34 | 35 | ====================================================================== 36 | 37 | USAGE: 38 | 39 | Running JsDoc Toolkit requires you to have Java installed on your 40 | computer. For more information see http://www.java.com/getjava/ 41 | 42 | Before running the JsDoc Toolkit app you should change your current 43 | working directory to the jsdoc-toolkit folder. Then follow the 44 | examples below, or as shown on the project wiki. 45 | 46 | On a computer running Windows a valid command line to run JsDoc 47 | Toolkit might look like this: 48 | 49 | > java -jar jsrun.jar app\run.js -a -t=templates\jsdoc mycode.js 50 | 51 | On Mac OS X or Linux the same command would look like this: 52 | 53 | $ java -jar jsrun.jar app/run.js -a -t=templates/jsdoc mycode.js 54 | 55 | The above assumes your current working directory contains jsrun.jar, 56 | the "app" and "templates" subdirectories from the standard JsDoc 57 | Toolkit distribution and that the relative path to the code you wish 58 | to document is "mycode.js". 59 | 60 | The output documentation files will be saved to a new directory named 61 | "out" (by default) in the current directory, or if you specify a 62 | -d=somewhere_else option, to the somewhere_else directory. 63 | 64 | For help (usage notes) enter this on the command line: 65 | 66 | $ java -jar jsrun.jar app/run.js --help 67 | 68 | More information about the various command line options used by JsDoc 69 | Toolkit are available on the project wiki. 70 | 71 | ====================================================================== 72 | 73 | RUNNING VIA SHELL SCRIPT 74 | 75 | Avi Deitcher has contributed the file jsrun.sh with the following usage notes: 76 | 77 | A script to simplify running jsdoc from the command-line, especially when 78 | running from within a development or build environment such as ant. 79 | 80 | Normally, to run jsdoc, you need a command-line as the following: 81 | java -Djsdoc.dir=/some/long/dir/path/to/jsdoc -jar 82 | /some/long/dir/path/to/jsdoc/jsrun.jar /some/long/dir/path/to/jsdoc/app/run.js 83 | -t=template -r=4 /some/long/dir/path/to/my/src/code 84 | 85 | This can get tedious to redo time and again, and difficult to use from within a build environment. 86 | 87 | To simplify the process, jsrun.sh will automatically run this path, as well as passing through any arguments. 88 | 89 | Usage: jsrun.sh 90 | 91 | All will be passed through. 92 | Additionally, jsrun.sh will take the following actions: 93 | 1) If the environment variable JSDOCDIR is set, it will add 94 | "-Djsdoc.dir=$JSDOCDIR" to the command-line 95 | 2) If the environment variable JSDOCTEMPLATEDIR is set, it will add 96 | "-Djsdoc.template.dir=$JSDOCTEMPLATEDIR" to the command-line 97 | 3) java with the appropriate path to jsrun.jar and run.js will be instantiated 98 | 99 | If not variables are set, it is assumed that the path to jsrun.jar and app/ is in the current working directory. 100 | 101 | Example: 102 | # jsrun.sh ./src/ 103 | Assuming JSDOCDIR=/some/path/to/my/jsdoc will cause the following command to 104 | execute: 105 | java -Djsdoc.dir=/some/path/to/my/jsdoc -jar /some/path/to/my/jsdoc/jsrun.jar 106 | /some/path/to/my/jsdoc/app/run.js ./src/ 107 | 108 | ====================================================================== 109 | 110 | TESTING: 111 | 112 | To run the suite of unit tests included with JsDoc Toolkit enter this 113 | on the command line: 114 | 115 | $ java -jar jsrun.jar app/run.js -T 116 | 117 | To see a dump of the internal data structure that JsDoc Toolkit has 118 | built from your source files use this command: 119 | 120 | $ java -jar jsrun.jar app/run.js mycode.js -Z 121 | 122 | ====================================================================== 123 | 124 | LICENSE: 125 | 126 | JSDoc.pm 127 | 128 | This project is based on the JSDoc.pm tool, created by Michael 129 | Mathews and Gabriel Reid. More information on JsDoc.pm can 130 | be found on the JSDoc.pm homepage: http://jsdoc.sourceforge.net/ 131 | 132 | Complete documentation on JsDoc Toolkit can be found on the project 133 | wiki at http://code.google.com/p/jsdoc-toolkit/w/list 134 | 135 | Rhino 136 | 137 | Rhino (JavaScript in Java) is open source and licensed by Mozilla 138 | under the MPL 1.1 or later/GPL 2.0 or later licenses, the text of 139 | which is available at http://www.mozilla.org/MPL/ 140 | 141 | You can obtain the source code for Rhino from the Mozilla web site at 142 | http://www.mozilla.org/rhino/download.html 143 | 144 | JsDoc Toolkit is a larger work that uses the Rhino JavaScript engine 145 | but is not derived from it in any way. The Rhino library is used 146 | without modification and without any claims whatsoever. 147 | 148 | The Rhino Debugger 149 | 150 | You can obtain more information about the Rhino Debugger from the 151 | Mozilla web site at http://www.mozilla.org/rhino/debugger.html 152 | 153 | JsDoc Toolkit is a larger work that uses the Rhino Debugger but 154 | is not derived from it in any way. The Rhino Debugger is used 155 | without modification and without any claims whatsoever. 156 | 157 | JsDoc Toolkit 158 | 159 | All code specific to JsDoc Toolkit are free, open source and licensed 160 | for use under the X11/MIT License. 161 | 162 | JsDoc Toolkit is Copyright (c)2009 Michael Mathews 163 | 164 | This program is free software; you can redistribute it and/or 165 | modify it under the terms below. 166 | 167 | Permission is hereby granted, free of charge, to any person obtaining 168 | a copy of this software and associated documentation files (the 169 | "Software"), to deal in the Software without restriction, including 170 | without limitation the rights to use, copy, modify, merge, publish, 171 | distribute, sublicense, and/or sell copies of the Software, and to 172 | permit persons to whom the Software is furnished to do so, subject to 173 | the following conditions: The above copyright notice and this 174 | permission notice must be included in all copies or substantial 175 | portions of the Software. 176 | 177 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 178 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 179 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 180 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 181 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 182 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 183 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 184 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/changes.txt: -------------------------------------------------------------------------------- 1 | == 2.4.0 == 2 | 3 | * Fixed bug that added mutiple symbols with the same name to docs. 4 | * Added support for the -m option to suppress warnings for multiple docs. 5 | * Added patch by brownsea42 to support quoted user variables on the command line. ( issue #281 ) 6 | * Fixed bug that sometimes caused links to events to be incorrect. ( issue #292 ) 7 | 8 | == 2.3.3 == 9 | 10 | * Fixed bug that made all fields declared with the @property tag static. ( issue #262 ) 11 | * Minor fix to better handle trailing slash on path to template (from jwmetrocat). ( issue #237 ) 12 | * Fix for @memberOf when applied to inner members. ( issue #264 ) 13 | * Fix for @memberOf when applied to symbols documented with @name. ( issue #260 ) 14 | * Applied patch from kunhualqk, fix for bug where @link to borrowed member did not resolve to parent class. ( issue #218 ) 15 | * Fix for @requires not linking back to the required class 16 | * Added experimental support for @constructs to have an argument, the class name, when applied to a function assignment. 17 | 18 | == 2.3.2 == 19 | 20 | * Minor update to the usage notes and corrected the version number displayed in the output. 21 | 22 | == 2.3.1 == 23 | 24 | * Fixed HTML typo in allfiles template. ( issue #228 ) 25 | * Modified template to display version information for classes. 26 | * Modified template to better support multiple methods with the same name. 27 | * Fixed bug that caused template to error when backtick characters appeared around class names. 28 | 29 | == 2.3.0 == 30 | 31 | * Added option -u, --unique to avoid bug that causes multiple symbols with names that differ only by case to overwrite each others output on case-insensitive filesystems. ( issue #162 ) 32 | * Fixed bug where {@links} in @deprecated tags did not resolve. ( issue #220 ) 33 | * Fixed bug that caused parens around a function to make it to be unrecognized. ( issue #213 ) 34 | * Fixed bug prevented explicit links to named anchors from working (thanks katgao.pku). ( issue #215 ) 35 | * Fixed bug that prevented full description from appearing in file overview. ( issue #224 ) 36 | 37 | == 2.2.1 == 38 | 39 | * Fixed bug with class template, where sorting of methods was accidentally removed (thanks dezfowler). 40 | * Added missing test files for the @exports unit tests. 41 | 42 | == 2.2.0 == 43 | 44 | * Fixed bug that caused exception when given a folder containing non-js files, even with the x commandline option set to "js". ( issue #193 ) 45 | * Fixed typo in index template [patch submitted by olle]. ( issue #198 ) 46 | * Modified @borrows tag experimentally to allow for missing "as ..." clause. 47 | * Added support for the @exports tag, to allow one symbol to be documented as another. 48 | * Added support for the -S option to document code following the Secure Modules pattern. 49 | 50 | == 2.1.0 == 51 | 52 | * Added support for the @event tag. 53 | * Fixed bug that prevented the : character from appearing in symbol names. 54 | * Fixed bug that prevented underscored symbols marked with @public being tagged as private. (issue #184 ) 55 | * Fixed bug that randomly affected the @memberOf tag when the name of the symbol did not include the parent name. 56 | * Fixed bug that prevented templates that were not in the jsdoc-toolkit folder from being found. ( issue #176 ) 57 | * Added ability to check for trailing slash on template path. ( issue #177 ) 58 | * Modified classDesc so that it no longer is appended with the constructor desc. 59 | * Fixed call to plugin onDocCommentSrc. 60 | * Added missing support for inline doc comments for function return types. ( issue #189 ) 61 | * Added command line option -q, --quiet. 62 | * Added command line option -E, --exclude. ( issue #143 ) 63 | * Added 2 more hooks for plugins. ( issue #163 ) 64 | * Added support for extending built-ins. ( issue #160 ) 65 | * Added "compact" option to JSDOC.JsPlate.prototype.process. ( issue #159 ) 66 | * @augments no longer documents static members as inherited. ( issue #138 ) 67 | * @link to a class now goes to the page for that class, not the constructor. ( issue #178 ) 68 | * Warnings of mismatched curly brace now include filename. ( issue #166 ) 69 | * Fixed bug affecting template paths loaded via a configuration file when the trailing slash is missing. ( issue #191 ) 70 | * Minor optimizations. 71 | 72 | == 2.0.2 == 73 | 74 | * Fixed bug that sometimes caused an example of division in the source code to be interpretted as a regex by the JsDoc Toolkit analyzer. ( issue #158 ) 75 | * Fixed a bug that prevented private variables marked as @public from appearing in the documentation. ( issue #161 ) 76 | * Fixed bug that prevented variable names with underscored properties from appearing in summaries. ( issue #173 ) 77 | 78 | == 2.0.1 == 79 | 80 | * Fixed bug that prevented @fileOverview tag from being recognized. 81 | * Added support for @fieldOf as a synonym for @field plus @memberOf. 82 | * Added support for @name tag in a @fileOverview comment to control the displayed name of the file. 83 | * Added support for multiple @example tags. ( issue #152 ) 84 | * Modified style sheet of jsdoc template to make more readable. ( issue #151 ) 85 | * Fixed bug that prevented @since documentation from displaying correctly when it appeared in a class. ( issue #150 ) 86 | * Fixed bug that caused inhertited properties to sometimes not resolve correctly. ( issue #144 ) 87 | * Modified so that trailing whitespace in @example is always trimmed. ( issue #153 ) 88 | * Added support for elseif to JsPlate. (hat tip to fredck) 89 | * Added support for @location urls in the @overview comment to the jsdoc template. 90 | 91 | == Changes From Versions 1.4.0 to 2.0.0 == 92 | 93 | * Upgraded included version of Rhino from 1.6 to 1.7R1. 94 | * Removed circular references in parsed documentation objects. 95 | * Improved inheritance handling, now properties and events can be inherited same as methods. 96 | * Improved handling of cross-file relationships, now having two related objects in separate files is not a problem. 97 | * Improved ability to recognize membership of previously defined objects. 98 | * Added ability to redefine parsing behavior with plugins. 99 | * @methodOf is a synonym for @function and @memberOf. 100 | * Added @default to document default values of members that are objects. 101 | * Added ability to parse and refer to inner functions. 102 | * Fixed bug that appeared when calling a method to set properties of the instance referred to by "this". 103 | * Added ability to automatically create links to other symbols. 104 | * New "jsdoc" template now produces fully W3C valid XHTML. 105 | * Inline parameter type hint comments are now documented. 106 | * Fixed error: Locally scoped variables (declared with var) no longer appear as global. 107 | * It is now possible to run JsDoc Toolkit from any directory. 108 | * Added support for inline {@link ...} tags. 109 | * Added support for the -H command-line option to allow for custom content handlers. 110 | * Tag names @inherits and @scope changed to @borrows and @lends. 111 | ? Combining @constructor in a doclet with @lends now supported. 112 | * Multiple @lend tags now supported. 113 | * Added support for the @constructs tag, used inside a @lends block. 114 | * Added support for the @constant tag. 115 | * Fixed bug that prevented the use of [] as a default value. 116 | * Added support for the @field tag. 117 | * Added support for the @public tag (applied to inner functions). 118 | * @namespace tag can now be applied to functions, not just object literals. 119 | * Added support for the -s command line option to suppress source code output. 120 | * Added new unit test framework. 121 | * Underscored symbols are now treated as if they have a @private tag by default. 122 | * Improved support for anonymous constructors. 123 | * Added support for the nocode meta tag. 124 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js: -------------------------------------------------------------------------------- 1 | /** @constructor */ 2 | JSDOC.SymbolSet = function() { 3 | this.init(); 4 | } 5 | 6 | JSDOC.SymbolSet.prototype.init = function() { 7 | this._index = new Hash(); 8 | } 9 | 10 | JSDOC.SymbolSet.prototype.keys = function() { 11 | return this._index.keys(); 12 | } 13 | 14 | JSDOC.SymbolSet.prototype.hasSymbol = function(alias) { 15 | return this._index.hasKey(alias); 16 | } 17 | 18 | JSDOC.SymbolSet.prototype.addSymbol = function(symbol) { 19 | if (JSDOC.opt.a && this.hasSymbol(symbol.alias)) { 20 | LOG.warn("Overwriting symbol documentation for: " + symbol.alias + "."); 21 | this.deleteSymbol(symbol.alias); 22 | } 23 | this._index.set(symbol.alias, symbol); 24 | } 25 | 26 | JSDOC.SymbolSet.prototype.getSymbol = function(alias) { 27 | if (this.hasSymbol(alias)) return this._index.get(alias); 28 | } 29 | 30 | JSDOC.SymbolSet.prototype.getSymbolByName = function(name) { 31 | for (var p = this._index.first(); p; p = this._index.next()) { 32 | var symbol = p.value; 33 | if (symbol.name == name) return symbol; 34 | } 35 | } 36 | 37 | JSDOC.SymbolSet.prototype.toArray = function() { 38 | return this._index.values(); 39 | } 40 | 41 | JSDOC.SymbolSet.prototype.deleteSymbol = function(alias) { 42 | if (!this.hasSymbol(alias)) return; 43 | this._index.drop(alias); 44 | } 45 | 46 | JSDOC.SymbolSet.prototype.renameSymbol = function(oldName, newName) { 47 | // todo: should check if oldname or newname already exist 48 | this._index.replace(oldName, newName); 49 | this._index.get(newName).alias = newName; 50 | return newName; 51 | } 52 | 53 | JSDOC.SymbolSet.prototype.relate = function() { 54 | this.resolveBorrows(); 55 | this.resolveMemberOf(); 56 | this.resolveAugments(); 57 | } 58 | 59 | JSDOC.SymbolSet.prototype.resolveBorrows = function() { 60 | for (var p = this._index.first(); p; p = this._index.next()) { 61 | var symbol = p.value; 62 | if (symbol.is("FILE") || symbol.is("GLOBAL")) continue; 63 | 64 | var borrows = symbol.inherits; 65 | for (var i = 0; i < borrows.length; i++) { 66 | 67 | if (/#$/.test(borrows[i].alias)) { 68 | LOG.warn("Attempted to borrow entire instance of "+borrows[i].alias+" but that feature is not yet implemented."); 69 | return; 70 | } 71 | var borrowed = this.getSymbol(borrows[i].alias); 72 | 73 | if (!borrowed) { 74 | LOG.warn("Can't borrow undocumented "+borrows[i].alias+"."); 75 | continue; 76 | } 77 | 78 | if (borrows[i].as == borrowed.alias) { 79 | var assumedName = borrowed.name.split(/([#.-])/).pop(); 80 | borrows[i].as = symbol.name+RegExp.$1+assumedName; 81 | LOG.inform("Assuming borrowed as name is "+borrows[i].as+" but that feature is experimental."); 82 | } 83 | 84 | var borrowAsName = borrows[i].as; 85 | var borrowAsAlias = borrowAsName; 86 | if (!borrowAsName) { 87 | LOG.warn("Malformed @borrow, 'as' is required."); 88 | continue; 89 | } 90 | 91 | if (borrowAsName.length > symbol.alias.length && borrowAsName.indexOf(symbol.alias) == 0) { 92 | borrowAsName = borrowAsName.replace(borrowed.alias, "") 93 | } 94 | else { 95 | var joiner = ""; 96 | if (borrowAsName.charAt(0) != "#") joiner = "."; 97 | borrowAsAlias = borrowed.alias + joiner + borrowAsName; 98 | } 99 | 100 | borrowAsName = borrowAsName.replace(/^[#.]/, ""); 101 | 102 | if (this.hasSymbol(borrowAsAlias)) continue; 103 | 104 | var clone = borrowed.clone(); 105 | clone.name = borrowAsName; 106 | clone.alias = borrowAsAlias; 107 | this.addSymbol(clone); 108 | } 109 | } 110 | } 111 | 112 | JSDOC.SymbolSet.prototype.resolveMemberOf = function() { 113 | for (var p = this._index.first(); p; p = this._index.next()) { 114 | var symbol = p.value; 115 | 116 | if (symbol.is("FILE") || symbol.is("GLOBAL")) continue; 117 | 118 | // the memberOf value was provided in the @memberOf tag 119 | else if (symbol.memberOf) { 120 | // like foo.bar is a memberOf foo 121 | if (symbol.alias.indexOf(symbol.memberOf) == 0) { 122 | var memberMatch = new RegExp("^("+symbol.memberOf+")[.#-]?(.+)$"); 123 | var aliasParts = symbol.alias.match(memberMatch); 124 | 125 | if (aliasParts) { 126 | symbol.memberOf = aliasParts[1]; 127 | symbol.name = aliasParts[2]; 128 | } 129 | 130 | var nameParts = symbol.name.match(memberMatch); 131 | 132 | if (nameParts) { 133 | symbol.name = nameParts[2]; 134 | } 135 | } 136 | // like bar is a memberOf foo 137 | else { 138 | var joiner = symbol.memberOf.charAt(symbol.memberOf.length-1); 139 | if (!/[.#-]/.test(joiner)) symbol.memberOf += "."; 140 | this.renameSymbol(symbol.alias, symbol.memberOf + symbol.name); 141 | } 142 | } 143 | // the memberOf must be calculated 144 | else { 145 | var parts = symbol.alias.match(/^(.*[.#-])([^.#-]+)$/); 146 | 147 | if (parts) { 148 | symbol.memberOf = parts[1]; 149 | symbol.name = parts[2]; 150 | } 151 | } 152 | 153 | // set isStatic, isInner 154 | if (symbol.memberOf) { 155 | switch (symbol.memberOf.charAt(symbol.memberOf.length-1)) { 156 | case '#' : 157 | symbol.isStatic = false; 158 | symbol.isInner = false; 159 | break; 160 | case '.' : 161 | symbol.isStatic = true; 162 | symbol.isInner = false; 163 | break; 164 | case '-' : 165 | symbol.isStatic = false; 166 | symbol.isInner = true; 167 | break; 168 | default: // memberOf ends in none of the above 169 | symbol.isStatic = true; 170 | break; 171 | } 172 | } 173 | 174 | // unowned methods and fields belong to the global object 175 | if (!symbol.is("CONSTRUCTOR") && !symbol.isNamespace && symbol.memberOf == "") { 176 | symbol.memberOf = "_global_"; 177 | } 178 | 179 | // clean up 180 | if (symbol.memberOf.match(/[.#-]$/)) { 181 | symbol.memberOf = symbol.memberOf.substr(0, symbol.memberOf.length-1); 182 | } 183 | // add to parent's methods or properties list 184 | if (symbol.memberOf) { 185 | 186 | var container = this.getSymbol(symbol.memberOf); 187 | if (!container) { 188 | if (JSDOC.Lang.isBuiltin(symbol.memberOf)) container = JSDOC.Parser.addBuiltin(symbol.memberOf); 189 | else { 190 | LOG.warn("Trying to document "+symbol.name +" as a member of undocumented symbol "+symbol.memberOf+"."); 191 | } 192 | } 193 | 194 | if (container) container.addMember(symbol); 195 | } 196 | } 197 | } 198 | 199 | JSDOC.SymbolSet.prototype.resolveAugments = function() { 200 | for (var p = this._index.first(); p; p = this._index.next()) { 201 | var symbol = p.value; 202 | 203 | if (symbol.alias == "_global_" || symbol.is("FILE")) continue; 204 | JSDOC.SymbolSet.prototype.walk.apply(this, [symbol]); 205 | } 206 | } 207 | 208 | JSDOC.SymbolSet.prototype.walk = function(symbol) { 209 | var augments = symbol.augments; 210 | for(var i = 0; i < augments.length; i++) { 211 | var contributer = this.getSymbol(augments[i]); 212 | if (!contributer && JSDOC.Lang.isBuiltin(''+augments[i])) { 213 | contributer = new JSDOC.Symbol("_global_."+augments[i], [], augments[i], new JSDOC.DocComment("Built in.")); 214 | contributer.isNamespace = true; 215 | contributer.srcFile = ""; 216 | contributer.isPrivate = false; 217 | JSDOC.Parser.addSymbol(contributer); 218 | } 219 | 220 | if (contributer) { 221 | if (contributer.augments.length) { 222 | JSDOC.SymbolSet.prototype.walk.apply(this, [contributer]); 223 | } 224 | 225 | symbol.inheritsFrom.push(contributer.alias); 226 | //if (!isUnique(symbol.inheritsFrom)) { 227 | // LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once."); 228 | //} 229 | //else { 230 | var cmethods = contributer.methods; 231 | var cproperties = contributer.properties; 232 | 233 | for (var ci = 0, cl = cmethods.length; ci < cl; ci++) { 234 | if (!cmethods[ci].isStatic) symbol.inherit(cmethods[ci]); 235 | } 236 | for (var ci = 0, cl = cproperties.length; ci < cl; ci++) { 237 | if (!cproperties[ci].isStatic) symbol.inherit(cproperties[ci]); 238 | } 239 | //} 240 | } 241 | else LOG.warn("Can't augment contributer: "+augments[i]+", not found."); 242 | } 243 | } 244 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/run.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview 3 | * A bootstrap script that creates some basic required objects 4 | * for loading other scripts. 5 | * @author Michael Mathews, micmath@gmail.com 6 | * @version $Id: run.js 756 2009-01-07 21:32:58Z micmath $ 7 | */ 8 | 9 | /** 10 | * @namespace Keep track of any messages from the running script. 11 | */ 12 | LOG = { 13 | warn: function(msg, e) { 14 | if (JSDOC.opt.q) return; 15 | if (e) msg = e.fileName+", line "+e.lineNumber+": "+msg; 16 | 17 | msg = ">> WARNING: "+msg; 18 | LOG.warnings.push(msg); 19 | if (LOG.out) LOG.out.write(msg+"\n"); 20 | else print(msg); 21 | }, 22 | 23 | inform: function(msg) { 24 | if (JSDOC.opt.q) return; 25 | msg = " > "+msg; 26 | if (LOG.out) LOG.out.write(msg+"\n"); 27 | else if (typeof LOG.verbose != "undefined" && LOG.verbose) print(msg); 28 | } 29 | }; 30 | LOG.warnings = []; 31 | LOG.verbose = false 32 | LOG.out = undefined; 33 | 34 | /** 35 | * @class Manipulate a filepath. 36 | */ 37 | function FilePath(absPath, separator) { 38 | this.slash = separator || "/"; 39 | this.root = this.slash; 40 | this.path = []; 41 | this.file = ""; 42 | 43 | var parts = absPath.split(/[\\\/]/); 44 | if (parts) { 45 | if (parts.length) this.root = parts.shift() + this.slash; 46 | if (parts.length) this.file = parts.pop() 47 | if (parts.length) this.path = parts; 48 | } 49 | 50 | this.path = this.resolvePath(); 51 | } 52 | 53 | /** Collapse any dot-dot or dot items in a filepath. */ 54 | FilePath.prototype.resolvePath = function() { 55 | var resolvedPath = []; 56 | for (var i = 0; i < this.path.length; i++) { 57 | if (this.path[i] == "..") resolvedPath.pop(); 58 | else if (this.path[i] != ".") resolvedPath.push(this.path[i]); 59 | } 60 | return resolvedPath; 61 | } 62 | 63 | /** Trim off the filename. */ 64 | FilePath.prototype.toDir = function() { 65 | if (this.file) this.file = ""; 66 | return this; 67 | } 68 | 69 | /** Go up a directory. */ 70 | FilePath.prototype.upDir = function() { 71 | this.toDir(); 72 | if (this.path.length) this.path.pop(); 73 | return this; 74 | } 75 | 76 | FilePath.prototype.toString = function() { 77 | return this.root 78 | + this.path.join(this.slash) 79 | + ((this.path.length > 0)? this.slash : "") 80 | + this.file; 81 | } 82 | 83 | /** 84 | * Turn a path into just the name of the file. 85 | */ 86 | FilePath.fileName = function(path) { 87 | var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0); 88 | return path.substring(nameStart); 89 | } 90 | 91 | /** 92 | * Get the extension of a filename 93 | */ 94 | FilePath.fileExtension = function(filename) { 95 | return filename.split(".").pop().toLowerCase(); 96 | }; 97 | 98 | /** 99 | * Turn a path into just the directory part. 100 | */ 101 | FilePath.dir = function(path) { 102 | var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0); 103 | return path.substring(0, nameStart-1); 104 | } 105 | 106 | 107 | importClass(java.lang.System); 108 | 109 | /** 110 | * @namespace A collection of information about your system. 111 | */ 112 | SYS = { 113 | /** 114 | * Information about your operating system: arch, name, version. 115 | * @type string 116 | */ 117 | os: [ 118 | new String(System.getProperty("os.arch")), 119 | new String(System.getProperty("os.name")), 120 | new String(System.getProperty("os.version")) 121 | ].join(", "), 122 | 123 | /** 124 | * Which way does your slash lean. 125 | * @type string 126 | */ 127 | slash: System.getProperty("file.separator")||"/", 128 | 129 | /** 130 | * The path to the working directory where you ran java. 131 | * @type string 132 | */ 133 | userDir: new String(System.getProperty("user.dir")), 134 | 135 | /** 136 | * Where is Java's home folder. 137 | * @type string 138 | */ 139 | javaHome: new String(System.getProperty("java.home")), 140 | 141 | /** 142 | * The absolute path to the directory containing this script. 143 | * @type string 144 | */ 145 | pwd: undefined 146 | }; 147 | 148 | // jsrun appends an argument, with the path to here. 149 | if (arguments[arguments.length-1].match(/^-j=(.+)/)) { 150 | if (RegExp.$1.charAt(0) == SYS.slash || RegExp.$1.charAt(1) == ":") { // absolute path to here 151 | SYS.pwd = new FilePath(RegExp.$1).toDir().toString(); 152 | } 153 | else { // relative path to here 154 | SYS.pwd = new FilePath(SYS.userDir + SYS.slash + RegExp.$1).toDir().toString(); 155 | } 156 | arguments.pop(); 157 | } 158 | else { 159 | print("The run.js script requires you use jsrun.jar."); 160 | quit(); 161 | } 162 | 163 | // shortcut 164 | var File = Packages.java.io.File; 165 | 166 | /** 167 | * @namespace A collection of functions that deal with reading a writing to disk. 168 | */ 169 | IO = { 170 | 171 | /** 172 | * Create a new file in the given directory, with the given name and contents. 173 | */ 174 | saveFile: function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) { 175 | var out = new Packages.java.io.PrintWriter( 176 | new Packages.java.io.OutputStreamWriter( 177 | new Packages.java.io.FileOutputStream(outDir+SYS.slash+fileName), 178 | IO.encoding 179 | ) 180 | ); 181 | out.write(content); 182 | out.flush(); 183 | out.close(); 184 | }, 185 | 186 | /** 187 | * @type string 188 | */ 189 | readFile: function(/**string*/ path) { 190 | if (!IO.exists(path)) { 191 | throw "File doesn't exist there: "+path; 192 | } 193 | return readFile(path, IO.encoding); 194 | }, 195 | 196 | /** 197 | * @param inFile 198 | * @param outDir 199 | * @param [fileName=The original filename] 200 | */ 201 | copyFile: function(/**string*/ inFile, /**string*/ outDir, /**string*/ fileName) { 202 | if (fileName == null) fileName = FilePath.fileName(inFile); 203 | 204 | var inFile = new File(inFile); 205 | var outFile = new File(outDir+SYS.slash+fileName); 206 | 207 | var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096); 208 | var bos = new Packages.java.io.BufferedOutputStream(new Packages.java.io.FileOutputStream(outFile), 4096); 209 | var theChar; 210 | while ((theChar = bis.read()) != -1) { 211 | bos.write(theChar); 212 | } 213 | bos.close(); 214 | bis.close(); 215 | }, 216 | 217 | /** 218 | * Creates a series of nested directories. 219 | */ 220 | mkPath: function(/**Array*/ path) { 221 | if (path.constructor != Array) path = path.split(/[\\\/]/); 222 | var make = ""; 223 | for (var i = 0, l = path.length; i < l; i++) { 224 | make += path[i] + SYS.slash; 225 | if (! IO.exists(make)) { 226 | IO.makeDir(make); 227 | } 228 | } 229 | }, 230 | 231 | /** 232 | * Creates a directory at the given path. 233 | */ 234 | makeDir: function(/**string*/ path) { 235 | (new File(path)).mkdir(); 236 | }, 237 | 238 | /** 239 | * @type string[] 240 | * @param dir The starting directory to look in. 241 | * @param [recurse=1] How many levels deep to scan. 242 | * @returns An array of all the paths to files in the given dir. 243 | */ 244 | ls: function(/**string*/ dir, /**number*/ recurse, _allFiles, _path) { 245 | if (_path === undefined) { // initially 246 | var _allFiles = []; 247 | var _path = [dir]; 248 | } 249 | if (_path.length == 0) return _allFiles; 250 | if (recurse === undefined) recurse = 1; 251 | 252 | dir = new File(dir); 253 | if (!dir.directory) return [String(dir)]; 254 | var files = dir.list(); 255 | 256 | for (var f = 0; f < files.length; f++) { 257 | var file = String(files[f]); 258 | if (file.match(/^\.[^\.\/\\]/)) continue; // skip dot files 259 | 260 | if ((new File(_path.join(SYS.slash)+SYS.slash+file)).list()) { // it's a directory 261 | _path.push(file); 262 | if (_path.length-1 < recurse) IO.ls(_path.join(SYS.slash), recurse, _allFiles, _path); 263 | _path.pop(); 264 | } 265 | else { 266 | _allFiles.push((_path.join(SYS.slash)+SYS.slash+file).replace(SYS.slash+SYS.slash, SYS.slash)); 267 | } 268 | } 269 | 270 | return _allFiles; 271 | }, 272 | 273 | /** 274 | * @type boolean 275 | */ 276 | exists: function(/**string*/ path) { 277 | file = new File(path); 278 | 279 | if (file.isDirectory()){ 280 | return true; 281 | } 282 | if (!file.exists()){ 283 | return false; 284 | } 285 | if (!file.canRead()){ 286 | return false; 287 | } 288 | return true; 289 | }, 290 | 291 | /** 292 | * 293 | */ 294 | open: function(/**string*/ path, /**string*/ append) { 295 | var append = true; 296 | var outFile = new File(path); 297 | var out = new Packages.java.io.PrintWriter( 298 | new Packages.java.io.OutputStreamWriter( 299 | new Packages.java.io.FileOutputStream(outFile, append), 300 | IO.encoding 301 | ) 302 | ); 303 | return out; 304 | }, 305 | 306 | /** 307 | * Sets {@link IO.encoding}. 308 | * Encoding is used when reading and writing text to files, 309 | * and in the meta tags of HTML output. 310 | */ 311 | setEncoding: function(/**string*/ encoding) { 312 | if (/ISO-8859-([0-9]+)/i.test(encoding)) { 313 | IO.encoding = "ISO8859_"+RegExp.$1; 314 | } 315 | else { 316 | IO.encoding = encoding; 317 | } 318 | }, 319 | 320 | /** 321 | * @default "utf-8" 322 | * @private 323 | */ 324 | encoding: "utf-8", 325 | 326 | /** 327 | * Load the given script. 328 | */ 329 | include: function(relativePath) { 330 | load(SYS.pwd+relativePath); 331 | }, 332 | 333 | /** 334 | * Loads all scripts from the given directory path. 335 | */ 336 | includeDir: function(path) { 337 | if (!path) return; 338 | 339 | for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++) 340 | if (/\.js$/i.test(lib[i])) load(lib[i]); 341 | } 342 | } 343 | 344 | // now run the application 345 | IO.include("frame.js"); 346 | IO.include("main.js"); 347 | 348 | main(); 349 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js: -------------------------------------------------------------------------------- 1 | LOG.inform("XMLDOC.Parser loaded"); 2 | 3 | /** 4 | * XML Parser object. Returns an {@link #XMLDOC.Parser.node} which is 5 | * the root element of the parsed document. 6 | *

7 | * By default, this parser will only handle well formed XML. To 8 | * allow the parser to handle HTML, set the XMLDOC.Parser.strictMode 9 | * variable to false before calling XMLDOC.Parser.parse(). 10 | *

11 | * Note: If you pass poorly formed XML, it will cause the parser to throw 12 | * an exception. 13 | * 14 | * @author Brett Fattori (bfattori@fry.com) 15 | * @author $Author: micmath $ 16 | * @version $Revision: 497 $ 17 | */ 18 | XMLDOC.Parser = {}; 19 | 20 | /** 21 | * Strict mode setting. Setting this to false allows HTML-style source to 22 | * be parsed. Normally, well formed XML has defined end tags, or empty tags 23 | * are properly formed. Default: true 24 | * @type Boolean 25 | */ 26 | XMLDOC.Parser.strictMode = true; 27 | 28 | /** 29 | * A node in an XML Document. Node types are ROOT, ELEMENT, COMMENT, PI, and TEXT. 30 | * @param parent {XMLDOC.Parser.node} The parent node 31 | * @param name {String} The node name 32 | * @param type {String} One of the types 33 | */ 34 | XMLDOC.Parser.node = function(parent, name, type) 35 | { 36 | this.name = name; 37 | this.type = type || "ELEMENT"; 38 | this.parent = parent; 39 | this.charData = ""; 40 | this.attrs = {}; 41 | this.nodes = []; 42 | this.cPtr = 0; 43 | 44 | XMLDOC.Parser.node.prototype.getAttributeNames = function() { 45 | var a = []; 46 | for (var o in this.attrs) 47 | { 48 | a.push(o); 49 | } 50 | 51 | return a; 52 | }; 53 | 54 | XMLDOC.Parser.node.prototype.getAttribute = function(attr) { 55 | return this.attrs[attr]; 56 | }; 57 | 58 | XMLDOC.Parser.node.prototype.setAttribute = function(attr, val) { 59 | this.attrs[attr] = val; 60 | }; 61 | 62 | XMLDOC.Parser.node.prototype.getChild = function(idx) { 63 | return this.nodes[idx]; 64 | }; 65 | 66 | XMLDOC.Parser.node.prototype.parentNode = function() { 67 | return this.parent; 68 | }; 69 | 70 | XMLDOC.Parser.node.prototype.firstChild = function() { 71 | return this.nodes[0]; 72 | }; 73 | 74 | XMLDOC.Parser.node.prototype.lastChild = function() { 75 | return this.nodes[this.nodes.length - 1]; 76 | }; 77 | 78 | XMLDOC.Parser.node.prototype.nextSibling = function() { 79 | var p = this.parent; 80 | if (p && (p.nodes.indexOf(this) + 1 != p.nodes.length)) 81 | { 82 | return p.getChild(p.nodes.indexOf(this) + 1); 83 | } 84 | return null; 85 | }; 86 | 87 | XMLDOC.Parser.node.prototype.prevSibling = function() { 88 | var p = this.parent; 89 | if (p && (p.nodes.indexOf(this) - 1 >= 0)) 90 | { 91 | return p.getChild(p.nodes.indexOf(this) - 1); 92 | } 93 | return null; 94 | }; 95 | }; 96 | 97 | /** 98 | * Parse an XML Document from the specified source. The XML should be 99 | * well formed, unless strict mode is disabled, then the parser will 100 | * handle HTML-style XML documents. 101 | * @param src {String} The source to parse 102 | */ 103 | XMLDOC.Parser.parse = function(src) 104 | { 105 | var A = []; 106 | 107 | // Normailize whitespace 108 | A = src.split("\r\n"); 109 | src = A.join("\n"); 110 | A = src.split("\r"); 111 | src = A.join("\n"); 112 | 113 | // Remove XML and DOCTYPE specifier 114 | src.replace(/<\?XML .*\?>/i, ""); 115 | src.replace(//i, ""); 116 | 117 | // The document is the root node and cannot be modified or removed 118 | var doc = new XMLDOC.Parser.node(null, "ROOT", "DOCUMENT"); 119 | 120 | // Let's break it down 121 | XMLDOC.Parser.eat(doc, src); 122 | 123 | return doc; 124 | }; 125 | 126 | /** 127 | * The XML fragment processing routine. This method is private and should not be called 128 | * directly. 129 | * @param parentNode {XMLDOC.Parser.node} The node which is the parent of this fragment 130 | * @param src {String} The source within the fragment to process 131 | * @private 132 | */ 133 | XMLDOC.Parser.eat = function(parentNode, src) 134 | { 135 | // A simple tag def 136 | var reTag = new RegExp("<(!|)(\\?|--|)((.|\\s)*?)\\2>","g"); 137 | 138 | // Special tag types 139 | var reCommentTag = //; 140 | var rePITag = /<\?((.|\s)*?)\?>/; 141 | 142 | // A start tag (with potential empty marker) 143 | var reStartTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*)\4)*(\/)?>/; 144 | 145 | // An empty HTML style tag (not proper XML, but we'll accept it so we can process HTML) 146 | var reHTMLEmptyTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*)\4)*>/; 147 | 148 | // Fully enclosing tag with nested tags 149 | var reEnclosingTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*?)\4)*>((.|\s)*?)<\/\1>/; 150 | 151 | // Breaks down attributes 152 | var reAttributes = new RegExp(" +([\\w_\\-]*)=(\"|')(.*?)\\2","g"); 153 | 154 | // Find us a tag 155 | var tag; 156 | while ((tag = reTag.exec(src)) != null) 157 | { 158 | if (tag.index > 0) 159 | { 160 | // The next tag has some text before it 161 | var text = src.substring(0, tag.index).replace(/^[ \t\n]+((.|\n)*?)[ \t\n]+$/, "$1"); 162 | 163 | if (text.length > 0 && (text != "\n")) 164 | { 165 | var txtnode = new XMLDOC.Parser.node(parentNode, "", "TEXT"); 166 | txtnode.charData = text; 167 | 168 | // Append the new text node 169 | parentNode.nodes.push(txtnode); 170 | } 171 | 172 | // Reset the lastIndex of reTag 173 | reTag.lastIndex -= src.substring(0, tag.index).length; 174 | 175 | // Eat the text 176 | src = src.substring(tag.index); 177 | } 178 | 179 | if (reCommentTag.test(tag[0])) 180 | { 181 | // Is this a comment? 182 | var comment = new XMLDOC.Parser.node(parentNode, "", "COMMENT"); 183 | comment.charData = reCommentTag.exec(tag[0])[1]; 184 | 185 | // Append the comment 186 | parentNode.nodes.push(comment); 187 | 188 | // Move the lastIndex of reTag 189 | reTag.lastIndex -= tag[0].length; 190 | 191 | // Eat the tag 192 | src = src.replace(reCommentTag, ""); 193 | } 194 | else if (rePITag.test(tag[0])) 195 | { 196 | // Is this a processing instruction? 197 | var pi = new XMLDOC.Parser.node(parentNode, "", "PI"); 198 | pi.charData = rePITag.exec(tag[0])[1]; 199 | 200 | // Append the processing instruction 201 | parentNode.nodes.push(pi); 202 | 203 | // Move the lastIndex of reTag 204 | reTag.lastIndex -= tag[0].length; 205 | 206 | // Eat the tag 207 | src = src.replace(rePITag, ""); 208 | } 209 | else if (reStartTag.test(tag[0])) 210 | { 211 | // Break it down 212 | var e = reStartTag.exec(tag[0]); 213 | var elem = new XMLDOC.Parser.node(parentNode, e[1], "ELEMENT"); 214 | 215 | // Get attributes from the tag 216 | var a; 217 | while ((a = reAttributes.exec(e[2])) != null ) 218 | { 219 | elem.attrs[a[1]] = a[3]; 220 | } 221 | 222 | // Is this an empty XML-style tag? 223 | if (e[6] == "/") 224 | { 225 | // Append the empty element 226 | parentNode.nodes.push(elem); 227 | 228 | // Move the lastIndex of reTag (include the start tag length) 229 | reTag.lastIndex -= e[0].length; 230 | 231 | // Eat the tag 232 | src = src.replace(reStartTag, ""); 233 | } 234 | else 235 | { 236 | // Check for malformed XML tags 237 | var htmlParsed = false; 238 | var htmlStartTag = reHTMLEmptyTag.exec(src); 239 | 240 | // See if there isn't an end tag within this block 241 | var reHTMLEndTag = new RegExp(""); 242 | var htmlEndTag = reHTMLEndTag.exec(src); 243 | 244 | if (XMLDOC.Parser.strictMode && htmlEndTag == null) 245 | { 246 | // Poorly formed XML fails in strict mode 247 | var err = new Error("Malformed XML passed to XMLDOC.Parser... Error contains malformed 'src'"); 248 | err.src = src; 249 | throw err; 250 | } 251 | else if (htmlEndTag == null) 252 | { 253 | // This is an HTML-style empty tag, store the element for it in non-strict mode 254 | parentNode.nodes.push(elem); 255 | 256 | // Eat the tag 257 | src = src.replace(reHTMLEmptyTag, ""); 258 | htmlParsed = true; 259 | } 260 | 261 | // If we didn't parse HTML-style, it must be an enclosing tag 262 | if (!htmlParsed) 263 | { 264 | var enc = reEnclosingTag.exec(src); 265 | 266 | // Go deeper into the document 267 | XMLDOC.Parser.eat(elem, enc[6]); 268 | 269 | // Append the new element node 270 | parentNode.nodes.push(elem); 271 | 272 | // Eat the tag 273 | src = src.replace(reEnclosingTag, ""); 274 | } 275 | } 276 | 277 | // Reset the lastIndex of reTag 278 | reTag.lastIndex = 0; 279 | } 280 | } 281 | 282 | // No tag was found... append the text if there is any 283 | src = src.replace(/^[ \t\n]+((.|\n)*?)[ \t\n]+$/, "$1"); 284 | if (src.length > 0 && (src != "\n")) 285 | { 286 | var txtNode = new XMLDOC.Parser.node(parentNode, "", "TEXT"); 287 | txtNode.charData = src; 288 | 289 | // Append the new text node 290 | parentNode.nodes.push(txtNode); 291 | } 292 | }; 293 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @class Search a {@link JSDOC.TextStream} for language tokens. 5 | */ 6 | JSDOC.TokenReader = function() { 7 | this.keepDocs = true; 8 | this.keepWhite = false; 9 | this.keepComments = false; 10 | } 11 | 12 | /** 13 | @type {JSDOC.Token[]} 14 | */ 15 | JSDOC.TokenReader.prototype.tokenize = function(/**JSDOC.TextStream*/stream) { 16 | var tokens = []; 17 | /**@ignore*/ tokens.last = function() { return tokens[tokens.length-1]; } 18 | /**@ignore*/ tokens.lastSym = function() { 19 | for (var i = tokens.length-1; i >= 0; i--) { 20 | if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i]; 21 | } 22 | } 23 | 24 | while (!stream.look().eof) { 25 | if (this.read_mlcomment(stream, tokens)) continue; 26 | if (this.read_slcomment(stream, tokens)) continue; 27 | if (this.read_dbquote(stream, tokens)) continue; 28 | if (this.read_snquote(stream, tokens)) continue; 29 | if (this.read_regx(stream, tokens)) continue; 30 | if (this.read_numb(stream, tokens)) continue; 31 | if (this.read_punc(stream, tokens)) continue; 32 | if (this.read_newline(stream, tokens)) continue; 33 | if (this.read_space(stream, tokens)) continue; 34 | if (this.read_word(stream, tokens)) continue; 35 | 36 | // if execution reaches here then an error has happened 37 | tokens.push(new JSDOC.Token(stream.next(), "TOKN", "UNKNOWN_TOKEN")); 38 | } 39 | return tokens; 40 | } 41 | 42 | /** 43 | @returns {Boolean} Was the token found? 44 | */ 45 | JSDOC.TokenReader.prototype.read_word = function(/**JSDOC.TokenStream*/stream, tokens) { 46 | var found = ""; 47 | while (!stream.look().eof && JSDOC.Lang.isWordChar(stream.look())) { 48 | found += stream.next(); 49 | } 50 | 51 | if (found === "") { 52 | return false; 53 | } 54 | else { 55 | var name; 56 | if ((name = JSDOC.Lang.keyword(found))) tokens.push(new JSDOC.Token(found, "KEYW", name)); 57 | else tokens.push(new JSDOC.Token(found, "NAME", "NAME")); 58 | return true; 59 | } 60 | } 61 | 62 | /** 63 | @returns {Boolean} Was the token found? 64 | */ 65 | JSDOC.TokenReader.prototype.read_punc = function(/**JSDOC.TokenStream*/stream, tokens) { 66 | var found = ""; 67 | var name; 68 | while (!stream.look().eof && JSDOC.Lang.punc(found+stream.look())) { 69 | found += stream.next(); 70 | } 71 | 72 | if (found === "") { 73 | return false; 74 | } 75 | else { 76 | tokens.push(new JSDOC.Token(found, "PUNC", JSDOC.Lang.punc(found))); 77 | return true; 78 | } 79 | } 80 | 81 | /** 82 | @returns {Boolean} Was the token found? 83 | */ 84 | JSDOC.TokenReader.prototype.read_space = function(/**JSDOC.TokenStream*/stream, tokens) { 85 | var found = ""; 86 | 87 | while (!stream.look().eof && JSDOC.Lang.isSpace(stream.look())) { 88 | found += stream.next(); 89 | } 90 | 91 | if (found === "") { 92 | return false; 93 | } 94 | else { 95 | if (this.collapseWhite) found = " "; 96 | if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "SPACE")); 97 | return true; 98 | } 99 | } 100 | 101 | /** 102 | @returns {Boolean} Was the token found? 103 | */ 104 | JSDOC.TokenReader.prototype.read_newline = function(/**JSDOC.TokenStream*/stream, tokens) { 105 | var found = ""; 106 | 107 | while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look())) { 108 | found += stream.next(); 109 | } 110 | 111 | if (found === "") { 112 | return false; 113 | } 114 | else { 115 | if (this.collapseWhite) found = "\n"; 116 | if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "NEWLINE")); 117 | return true; 118 | } 119 | } 120 | 121 | /** 122 | @returns {Boolean} Was the token found? 123 | */ 124 | JSDOC.TokenReader.prototype.read_mlcomment = function(/**JSDOC.TokenStream*/stream, tokens) { 125 | if (stream.look() == "/" && stream.look(1) == "*") { 126 | var found = stream.next(2); 127 | 128 | while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) { 129 | found += stream.next(); 130 | } 131 | 132 | // to start doclet we allow /** or /*** but not /**/ or /**** 133 | if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new JSDOC.Token(found, "COMM", "JSDOC")); 134 | else if (this.keepComments) tokens.push(new JSDOC.Token(found, "COMM", "MULTI_LINE_COMM")); 135 | return true; 136 | } 137 | return false; 138 | } 139 | 140 | /** 141 | @returns {Boolean} Was the token found? 142 | */ 143 | JSDOC.TokenReader.prototype.read_slcomment = function(/**JSDOC.TokenStream*/stream, tokens) { 144 | var found; 145 | if ( 146 | (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2))) 147 | || 148 | (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4))) 149 | ) { 150 | 151 | while (!stream.look().eof && !JSDOC.Lang.isNewline(stream.look())) { 152 | found += stream.next(); 153 | } 154 | 155 | if (this.keepComments) { 156 | tokens.push(new JSDOC.Token(found, "COMM", "SINGLE_LINE_COMM")); 157 | } 158 | return true; 159 | } 160 | return false; 161 | } 162 | 163 | /** 164 | @returns {Boolean} Was the token found? 165 | */ 166 | JSDOC.TokenReader.prototype.read_dbquote = function(/**JSDOC.TokenStream*/stream, tokens) { 167 | if (stream.look() == "\"") { 168 | // find terminator 169 | var string = stream.next(); 170 | 171 | while (!stream.look().eof) { 172 | if (stream.look() == "\\") { 173 | if (JSDOC.Lang.isNewline(stream.look(1))) { 174 | do { 175 | stream.next(); 176 | } while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look())); 177 | string += "\\\n"; 178 | } 179 | else { 180 | string += stream.next(2); 181 | } 182 | } 183 | else if (stream.look() == "\"") { 184 | string += stream.next(); 185 | tokens.push(new JSDOC.Token(string, "STRN", "DOUBLE_QUOTE")); 186 | return true; 187 | } 188 | else { 189 | string += stream.next(); 190 | } 191 | } 192 | } 193 | return false; // error! unterminated string 194 | } 195 | 196 | /** 197 | @returns {Boolean} Was the token found? 198 | */ 199 | JSDOC.TokenReader.prototype.read_snquote = function(/**JSDOC.TokenStream*/stream, tokens) { 200 | if (stream.look() == "'") { 201 | // find terminator 202 | var string = stream.next(); 203 | 204 | while (!stream.look().eof) { 205 | if (stream.look() == "\\") { // escape sequence 206 | string += stream.next(2); 207 | } 208 | else if (stream.look() == "'") { 209 | string += stream.next(); 210 | tokens.push(new JSDOC.Token(string, "STRN", "SINGLE_QUOTE")); 211 | return true; 212 | } 213 | else { 214 | string += stream.next(); 215 | } 216 | } 217 | } 218 | return false; // error! unterminated string 219 | } 220 | 221 | /** 222 | @returns {Boolean} Was the token found? 223 | */ 224 | JSDOC.TokenReader.prototype.read_numb = function(/**JSDOC.TokenStream*/stream, tokens) { 225 | if (stream.look() === "0" && stream.look(1) == "x") { 226 | return this.read_hex(stream, tokens); 227 | } 228 | 229 | var found = ""; 230 | 231 | while (!stream.look().eof && JSDOC.Lang.isNumber(found+stream.look())){ 232 | found += stream.next(); 233 | } 234 | 235 | if (found === "") { 236 | return false; 237 | } 238 | else { 239 | if (/^0[0-7]/.test(found)) tokens.push(new JSDOC.Token(found, "NUMB", "OCTAL")); 240 | else tokens.push(new JSDOC.Token(found, "NUMB", "DECIMAL")); 241 | return true; 242 | } 243 | } 244 | /*t: 245 | requires("../lib/JSDOC/TextStream.js"); 246 | requires("../lib/JSDOC/Token.js"); 247 | requires("../lib/JSDOC/Lang.js"); 248 | 249 | plan(3, "testing JSDOC.TokenReader.prototype.read_numb"); 250 | 251 | //// setup 252 | var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}"; 253 | var tr = new JSDOC.TokenReader(); 254 | var tokens = tr.tokenize(new JSDOC.TextStream(src)); 255 | 256 | var hexToken, octToken, decToken; 257 | for (var i = 0; i < tokens.length; i++) { 258 | if (tokens[i].name == "HEX_DEC") hexToken = tokens[i]; 259 | if (tokens[i].name == "OCTAL") octToken = tokens[i]; 260 | if (tokens[i].name == "DECIMAL") decToken = tokens[i]; 261 | } 262 | //// 263 | 264 | is(decToken.data, "8.0", "decimal number is found in source."); 265 | is(hexToken.data, "0x20", "hexdec number is found in source (issue #99)."); 266 | is(octToken.data, "0777", "octal number is found in source."); 267 | */ 268 | 269 | /** 270 | @returns {Boolean} Was the token found? 271 | */ 272 | JSDOC.TokenReader.prototype.read_hex = function(/**JSDOC.TokenStream*/stream, tokens) { 273 | var found = stream.next(2); 274 | 275 | while (!stream.look().eof) { 276 | if (JSDOC.Lang.isHexDec(found) && !JSDOC.Lang.isHexDec(found+stream.look())) { // done 277 | tokens.push(new JSDOC.Token(found, "NUMB", "HEX_DEC")); 278 | return true; 279 | } 280 | else { 281 | found += stream.next(); 282 | } 283 | } 284 | return false; 285 | } 286 | 287 | /** 288 | @returns {Boolean} Was the token found? 289 | */ 290 | JSDOC.TokenReader.prototype.read_regx = function(/**JSDOC.TokenStream*/stream, tokens) { 291 | var last; 292 | if ( 293 | stream.look() == "/" 294 | && 295 | ( 296 | 297 | ( 298 | !(last = tokens.lastSym()) // there is no last, the regex is the first symbol 299 | || 300 | ( 301 | !last.is("NUMB") 302 | && !last.is("NAME") 303 | && !last.is("RIGHT_PAREN") 304 | && !last.is("RIGHT_BRACKET") 305 | ) 306 | ) 307 | ) 308 | ) { 309 | var regex = stream.next(); 310 | 311 | while (!stream.look().eof) { 312 | if (stream.look() == "\\") { // escape sequence 313 | regex += stream.next(2); 314 | } 315 | else if (stream.look() == "/") { 316 | regex += stream.next(); 317 | 318 | while (/[gmi]/.test(stream.look())) { 319 | regex += stream.next(); 320 | } 321 | 322 | tokens.push(new JSDOC.Token(regex, "REGX", "REGX")); 323 | return true; 324 | } 325 | else { 326 | regex += stream.next(); 327 | } 328 | } 329 | // error: unterminated regex 330 | } 331 | return false; 332 | } 333 | -------------------------------------------------------------------------------- /vendor/jsdoc-toolkit/app/lib/JSDOC/DocTag.js: -------------------------------------------------------------------------------- 1 | if (typeof JSDOC == "undefined") JSDOC = {}; 2 | 3 | /** 4 | @constructor 5 | */ 6 | JSDOC.DocTag = function(src) { 7 | this.init(); 8 | if (typeof src != "undefined") { 9 | this.parse(src); 10 | } 11 | } 12 | 13 | /** 14 | Create and initialize the properties of this. 15 | */ 16 | JSDOC.DocTag.prototype.init = function() { 17 | this.title = ""; 18 | this.type = ""; 19 | this.name = ""; 20 | this.isOptional = false; 21 | this.defaultValue = ""; 22 | this.desc = ""; 23 | 24 | return this; 25 | } 26 | 27 | /** 28 | Populate the properties of this from the given tag src. 29 | @param {string} src 30 | */ 31 | JSDOC.DocTag.prototype.parse = function(src) { 32 | if (typeof src != "string") throw "src must be a string not "+(typeof src); 33 | 34 | try { 35 | src = this.nibbleTitle(src); 36 | if (JSDOC.PluginManager) { 37 | JSDOC.PluginManager.run("onDocTagSynonym", this); 38 | } 39 | 40 | src = this.nibbleType(src); 41 | 42 | // only some tags are allowed to have names. 43 | if (this.title == "param" || this.title == "property" || this.title == "config") { // @config is deprecated 44 | src = this.nibbleName(src); 45 | } 46 | } 47 | catch(e) { 48 | if (LOG) LOG.warn(e); 49 | else throw e; 50 | } 51 | this.desc = src; // whatever is left 52 | 53 | // example tags need to have whitespace preserved 54 | if (this.title != "example") this.desc = this.desc.trim(); 55 | 56 | if (JSDOC.PluginManager) { 57 | JSDOC.PluginManager.run("onDocTag", this); 58 | } 59 | } 60 | 61 | /** 62 | Automatically called when this is stringified. 63 | */ 64 | JSDOC.DocTag.prototype.toString = function() { 65 | return this.desc; 66 | } 67 | 68 | /*t: 69 | plan(1, "testing JSDOC.DocTag#toString"); 70 | 71 | var tag = new JSDOC.DocTag("param {object} date A valid date."); 72 | is(""+tag, "A valid date.", "stringifying a tag returns the desc."); 73 | */ 74 | 75 | /** 76 | Find and shift off the title of a tag. 77 | @param {string} src 78 | @return src 79 | */ 80 | JSDOC.DocTag.prototype.nibbleTitle = function(src) { 81 | if (typeof src != "string") throw "src must be a string not "+(typeof src); 82 | 83 | var parts = src.match(/^\s*(\S+)(?:\s([\s\S]*))?$/); 84 | 85 | if (parts && parts[1]) this.title = parts[1]; 86 | if (parts && parts[2]) src = parts[2]; 87 | else src = ""; 88 | 89 | return src; 90 | } 91 | 92 | /*t: 93 | plan(8, "testing JSDOC.DocTag#nibbleTitle"); 94 | 95 | var tag = new JSDOC.DocTag(); 96 | 97 | tag.init().nibbleTitle("aTitleGoesHere"); 98 | is(tag.title, "aTitleGoesHere", "a title can be found in a single-word string."); 99 | 100 | var src = tag.init().nibbleTitle("aTitleGoesHere and the rest"); 101 | is(tag.title, "aTitleGoesHere", "a title can be found in a multi-word string."); 102 | is(src, "and the rest", "the rest is returned when the title is nibbled off."); 103 | 104 | src = tag.init().nibbleTitle(""); 105 | is(tag.title, "", "given an empty string the title is empty."); 106 | is(src, "", "the rest is empty when the tag is empty."); 107 | 108 | var src = tag.init().nibbleTitle(" aTitleGoesHere\n a description"); 109 | is(tag.title, "aTitleGoesHere", "leading and trailing spaces are not part of the title."); 110 | is(src, " a description", "leading spaces (less one) are part of the description."); 111 | 112 | tag.init().nibbleTitle("a.Title::Goes_Here foo"); 113 | is(tag.title, "a.Title::Goes_Here", "titles with punctuation are allowed."); 114 | */ 115 | 116 | /** 117 | Find and shift off the type of a tag. 118 | @requires frame/String.js 119 | @param {string} src 120 | @return src 121 | */ 122 | JSDOC.DocTag.prototype.nibbleType = function(src) { 123 | if (typeof src != "string") throw "src must be a string not "+(typeof src); 124 | 125 | if (src.match(/^\s*\{/)) { 126 | var typeRange = src.balance("{", "}"); 127 | if (typeRange[1] == -1) { 128 | throw "Malformed comment tag ignored. Tag type requires an opening { and a closing }: "+src; 129 | } 130 | this.type = src.substring(typeRange[0]+1, typeRange[1]).trim(); 131 | this.type = this.type.replace(/\s*,\s*/g, "|"); // multiples can be separated by , or | 132 | src = src.substring(typeRange[1]+1); 133 | } 134 | 135 | return src; 136 | } 137 | 138 | /*t: 139 | plan(5, "testing JSDOC.DocTag.parser.nibbleType"); 140 | requires("../frame/String.js"); 141 | 142 | var tag = new JSDOC.DocTag(); 143 | 144 | tag.init().nibbleType("{String[]} aliases"); 145 | is(tag.type, "String[]", "type can have non-alpha characters."); 146 | 147 | tag.init().nibbleType("{ aTypeGoesHere } etc etc"); 148 | is(tag.type, "aTypeGoesHere", "type is trimmed."); 149 | 150 | tag.init().nibbleType("{ oneType, twoType ,\n threeType } etc etc"); 151 | is(tag.type, "oneType|twoType|threeType", "multiple types can be separated by commas."); 152 | 153 | var error; 154 | try { tag.init().nibbleType("{widget foo"); } 155 | catch(e) { error = e; } 156 | is(typeof error, "string", "malformed tag type throws error."); 157 | isnt(error.indexOf("Malformed"), -1, "error message tells tag is malformed."); 158 | */ 159 | 160 | /** 161 | Find and shift off the name of a tag. 162 | @requires frame/String.js 163 | @param {string} src 164 | @return src 165 | */ 166 | JSDOC.DocTag.prototype.nibbleName = function(src) { 167 | if (typeof src != "string") throw "src must be a string not "+(typeof src); 168 | 169 | src = src.trim(); 170 | 171 | // is optional? 172 | if (src.charAt(0) == "[") { 173 | var nameRange = src.balance("[", "]"); 174 | if (nameRange[1] == -1) { 175 | throw "Malformed comment tag ignored. Tag optional name requires an opening [ and a closing ]: "+src; 176 | } 177 | this.name = src.substring(nameRange[0]+1, nameRange[1]).trim(); 178 | this.isOptional = true; 179 | 180 | src = src.substring(nameRange[1]+1); 181 | 182 | // has default value? 183 | var nameAndValue = this.name.split("="); 184 | if (nameAndValue.length) { 185 | this.name = nameAndValue.shift().trim(); 186 | this.defaultValue = nameAndValue.join("="); 187 | } 188 | } 189 | else { 190 | var parts = src.match(/^(\S+)(?:\s([\s\S]*))?$/); 191 | if (parts) { 192 | if (parts[1]) this.name = parts[1]; 193 | if (parts[2]) src = parts[2].trim(); 194 | else src = ""; 195 | } 196 | } 197 | 198 | return src; 199 | } 200 | 201 | /*t: 202 | requires("../frame/String.js"); 203 | plan(9, "testing JSDOC.DocTag.parser.nibbleName"); 204 | 205 | var tag = new JSDOC.DocTag(); 206 | 207 | tag.init().nibbleName("[foo] This is a description."); 208 | is(tag.isOptional, true, "isOptional syntax is detected."); 209 | is(tag.name, "foo", "optional param name is found."); 210 | 211 | tag.init().nibbleName("[foo] This is a description."); 212 | is(tag.isOptional, true, "isOptional syntax is detected when no type."); 213 | is(tag.name, "foo", "optional param name is found when no type."); 214 | 215 | tag.init().nibbleName("[foo=7] This is a description."); 216 | is(tag.name, "foo", "optional param name is found when default value."); 217 | is(tag.defaultValue, 7, "optional param default value is found when default value."); 218 | 219 | //tag.init().nibbleName("[foo= a value] This is a description."); 220 | //is(tag.defaultValue, " a value", "optional param default value is found when default value has spaces (issue #112)."); 221 | 222 | tag.init().nibbleName("[foo=[]] This is a description."); 223 | is(tag.defaultValue, "[]", "optional param default value is found when default value is [] (issue #95)."); 224 | 225 | tag.init().nibbleName("[foo=a=b] This is a description."); 226 | is(tag.name, "foo", "optional param name is found when default value is a=b."); 227 | is(tag.defaultValue, "a=b", "optional param default value is found when default value is a=b.") 228 | */ 229 | 230 | /*t: 231 | plan(32, "Testing JSDOC.DocTag.parser."); 232 | requires("../frame/String.js"); 233 | 234 | var tag = new JSDOC.DocTag(); 235 | 236 | is(typeof tag, "object", "JSDOC.DocTag.parser with an empty string returns an object."); 237 | is(typeof tag.title, "string", "returned object has a string property 'title'."); 238 | is(typeof tag.type, "string", "returned object has a string property 'type'."); 239 | is(typeof tag.name, "string", "returned object has a string property 'name'."); 240 | is(typeof tag.defaultValue, "string", "returned object has a string property 'defaultValue'."); 241 | is(typeof tag.isOptional, "boolean", "returned object has a boolean property 'isOptional'."); 242 | is(typeof tag.desc, "string", "returned object has a string property 'desc'."); 243 | 244 | tag = new JSDOC.DocTag("param {widget} foo"); 245 | is(tag.title, "param", "param title is found."); 246 | is(tag.name, "foo", "param name is found when desc is missing."); 247 | is(tag.desc, "", "param desc is empty when missing."); 248 | 249 | tag = new JSDOC.DocTag("param {object} date A valid date."); 250 | is(tag.name, "date", "param name is found with a type."); 251 | is(tag.type, "object", "param type is found."); 252 | is(tag.desc, "A valid date.", "param desc is found with a type."); 253 | 254 | tag = new JSDOC.DocTag("param aName a description goes\n here."); 255 | is(tag.name, "aName", "param name is found without a type."); 256 | is(tag.desc, "a description goes\n here.", "param desc is found without a type."); 257 | 258 | tag = new JSDOC.DocTag("param {widget}"); 259 | is(tag.name, "", "param name is empty when it is not given."); 260 | 261 | tag = new JSDOC.DocTag("param {widget} [foo] This is a description."); 262 | is(tag.name, "foo", "optional param name is found."); 263 | 264 | tag = new JSDOC.DocTag("return {aType} This is a description."); 265 | is(tag.type, "aType", "when return tag has no name, type is found."); 266 | is(tag.desc, "This is a description.", "when return tag has no name, desc is found."); 267 | 268 | tag = new JSDOC.DocTag("author Joe Coder "); 269 | is(tag.title, "author", "author tag has a title."); 270 | is(tag.type, "", "the author tag has no type."); 271 | is(tag.name, "", "the author tag has no name."); 272 | is(tag.desc, "Joe Coder ", "author tag has desc."); 273 | 274 | tag = new JSDOC.DocTag("private \t\n "); 275 | is(tag.title, "private", "private tag has a title."); 276 | is(tag.type, "", "the private tag has no type."); 277 | is(tag.name, "", "the private tag has no name."); 278 | is(tag.desc, "", "private tag has no desc."); 279 | 280 | tag = new JSDOC.DocTag("example\n example(code);\n more();"); 281 | is(tag.desc, " example(code);\n more();", "leading whitespace (less one) in examples code is preserved."); 282 | 283 | tag = new JSDOC.DocTag("param theName \n"); 284 | is(tag.name, "theName", "name only is found."); 285 | 286 | tag = new JSDOC.DocTag("type theDesc \n"); 287 | is(tag.desc, "theDesc", "desc only is found."); 288 | 289 | tag = new JSDOC.DocTag("type {theType} \n"); 290 | is(tag.type, "theType", "type only is found."); 291 | 292 | tag = new JSDOC.DocTag(""); 293 | is(tag.title, "", "title is empty when tag is empty."); 294 | */ --------------------------------------------------------------------------------