├── README.txt ├── build.xml ├── demos ├── jquery-1.2.6.min.js ├── jquery-1.3.min.js ├── jquery-ui-personalized-1.6rc6.min.js ├── jquery.json-1.3.min.js ├── markup │ ├── markup.css │ ├── markup.html │ └── markup.js └── theme │ ├── images │ ├── ui-bg_flat_100_805940_40x100.png │ ├── ui-bg_flat_100_E6D8CF_40x100.png │ ├── ui-bg_flat_25_E6A173_40x100.png │ ├── ui-bg_flat_65_E6D8CF_40x100.png │ ├── ui-bg_flat_70_E6D8CF_40x100.png │ ├── ui-bg_flat_75_805940_40x100.png │ ├── ui-bg_flat_75_aaaaaa_40x100.png │ ├── ui-bg_inset-soft_100_ffffff_1x100.png │ ├── ui-icons_000000_256x240.png │ ├── ui-icons_BF6930_256x240.png │ └── ui-icons_ffffff_256x240.png │ ├── ui.accordion.css │ ├── ui.all.css │ ├── ui.base.css │ ├── ui.core.css │ ├── ui.datepicker.css │ ├── ui.dialog.css │ ├── ui.progressbar.css │ ├── ui.resizable.css │ ├── ui.slider.css │ ├── ui.tabs.css │ └── ui.theme.css ├── jquery.cclicense.js ├── jquery.curie.js ├── jquery.datatype.js ├── jquery.hcard.foaf.js ├── jquery.hcard.vcard.js ├── jquery.microdata.js ├── jquery.rdf.js ├── jquery.rdf.json.js ├── jquery.rdf.turtle.js ├── jquery.rdf.xml.js ├── jquery.rdfa.js ├── jquery.rules.js ├── jquery.rules.rdfs.js ├── jquery.uri.js ├── jquery.xfn.foaf.js ├── jquery.xmlns.js ├── jquery ├── jquery-1.6.1.min.js ├── jquery.json.js └── tests │ └── qunit │ ├── qunit.css │ ├── qunit.js │ ├── testrunner.js │ └── testsuite.css ├── lib ├── jsdoc-toolkit │ ├── README.txt │ ├── app │ │ ├── frame.js │ │ ├── frame │ │ │ ├── Chain.js │ │ │ ├── Dumper.js │ │ │ ├── Hash.js │ │ │ ├── Link.js │ │ │ ├── Namespace.js │ │ │ ├── Opt.js │ │ │ ├── Reflection.js │ │ │ ├── String.js │ │ │ └── Testrun.js │ │ ├── handlers │ │ │ ├── FOODOC.js │ │ │ ├── XMLDOC.js │ │ │ └── XMLDOC │ │ │ │ ├── DomReader.js │ │ │ │ ├── XMLDoc.js │ │ │ │ └── XMLParse.js │ │ ├── lib │ │ │ ├── JSDOC.js │ │ │ └── JSDOC │ │ │ │ ├── DocComment.js │ │ │ │ ├── DocTag.js │ │ │ │ ├── JsDoc.js │ │ │ │ ├── JsPlate.js │ │ │ │ ├── Lang.js │ │ │ │ ├── Parser.js │ │ │ │ ├── PluginManager.js │ │ │ │ ├── Symbol.js │ │ │ │ ├── SymbolSet.js │ │ │ │ ├── TextStream.js │ │ │ │ ├── Token.js │ │ │ │ ├── TokenReader.js │ │ │ │ ├── TokenStream.js │ │ │ │ ├── Util.js │ │ │ │ └── Walker.js │ │ ├── main.js │ │ ├── plugins │ │ │ ├── commentSrcJson.js │ │ │ ├── frameworkPrototype.js │ │ │ ├── functionCall.js │ │ │ ├── publishSrcHilite.js │ │ │ ├── symbolLink.js │ │ │ ├── tagParamConfig.js │ │ │ └── tagSynonyms.js │ │ ├── run.js │ │ ├── t │ │ │ ├── TestDoc.js │ │ │ └── runner.js │ │ ├── test.js │ │ └── test │ │ │ ├── addon.js │ │ │ ├── anon_inner.js │ │ │ ├── augments.js │ │ │ ├── augments2.js │ │ │ ├── borrows.js │ │ │ ├── borrows2.js │ │ │ ├── config.js │ │ │ ├── constructs.js │ │ │ ├── encoding.js │ │ │ ├── encoding_other.js │ │ │ ├── event.js │ │ │ ├── exports.js │ │ │ ├── functions_anon.js │ │ │ ├── functions_nested.js │ │ │ ├── global.js │ │ │ ├── globals.js │ │ │ ├── ignore.js │ │ │ ├── inner.js │ │ │ ├── jsdoc_test.js │ │ │ ├── lend.js │ │ │ ├── memberof.js │ │ │ ├── memberof2.js │ │ │ ├── memberof3.js │ │ │ ├── memberof_constructor.js │ │ │ ├── module.js │ │ │ ├── multi_methods.js │ │ │ ├── name.js │ │ │ ├── namespace_nested.js │ │ │ ├── nocode.js │ │ │ ├── oblit_anon.js │ │ │ ├── overview.js │ │ │ ├── param_inline.js │ │ │ ├── params_optional.js │ │ │ ├── prototype.js │ │ │ ├── prototype_nested.js │ │ │ ├── prototype_oblit.js │ │ │ ├── prototype_oblit_constructor.js │ │ │ ├── public.js │ │ │ ├── scripts │ │ │ ├── code.js │ │ │ └── notcode.txt │ │ │ ├── shared.js │ │ │ ├── shared2.js │ │ │ ├── shortcuts.js │ │ │ ├── static_this.js │ │ │ ├── synonyms.js │ │ │ ├── tosource.js │ │ │ └── variable_redefine.js │ ├── changes.txt │ ├── conf │ │ └── sample.conf │ ├── java │ │ ├── build.xml │ │ ├── build_1.4.xml │ │ ├── classes │ │ │ └── js.jar │ │ └── src │ │ │ ├── JsDebugRun.java │ │ │ └── JsRun.java │ ├── jsdebug.jar │ ├── jsrun.jar │ ├── jsrun.sh │ └── templates │ │ └── jsdoc │ │ ├── allclasses.tmpl │ │ ├── allfiles.tmpl │ │ ├── class.tmpl │ │ ├── index.tmpl │ │ ├── publish.js │ │ ├── static │ │ ├── default.css │ │ ├── header.html │ │ └── index.html │ │ └── symbol.tmpl └── yui-compressor │ └── yuicompressor-2.4.2.jar ├── proxies └── proxy.php ├── tests ├── jquery.alltests.html ├── jquery.cclicense.html ├── jquery.cclicense.js ├── jquery.curie.js ├── jquery.datatype.js ├── jquery.hcard.foaf.html ├── jquery.hcard.foaf.js ├── jquery.hcard.vcard.html ├── jquery.hcard.vcard.js ├── jquery.microdata.js ├── jquery.rdf.js ├── jquery.rdf.turtle.js ├── jquery.rdfa.js ├── jquery.rules.js ├── jquery.uri.js ├── jquery.xfn.foaf.html ├── jquery.xfn.foaf.js ├── jquery.xmlns.js └── test.js └── version.txt /README.txt: -------------------------------------------------------------------------------- 1 | Running tests: 2 | 3 | open tests/jquery.alltets.html in a browser! 4 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /demos/jquery.json-1.3.min.js: -------------------------------------------------------------------------------- 1 | 2 | (function($){function toIntegersAtLease(n) 3 | {return n<10?'0'+n:n;} 4 | Date.prototype.toJSON=function(date) 5 | {return this.getUTCFullYear()+'-'+ 6 | toIntegersAtLease(this.getUTCMonth())+'-'+ 7 | toIntegersAtLease(this.getUTCDate());};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.quoteString=function(string) 8 | {if(escapeable.test(string)) 9 | {return'"'+string.replace(escapeable,function(a) 10 | {var c=meta[a];if(typeof c==='string'){return c;} 11 | c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';} 12 | return'"'+string+'"';};$.toJSON=function(o,compact) 13 | {var type=typeof(o);if(type=="undefined") 14 | return"undefined";else if(type=="number"||type=="boolean") 15 | return o+"";else if(o===null) 16 | return"null";if(type=="string") 17 | {return $.quoteString(o);} 18 | if(type=="object"&&typeof o.toJSON=="function") 19 | return o.toJSON(compact);if(type!="function"&&typeof(o.length)=="number") 20 | {var ret=[];for(var i=0;i ul { 40 | -webkit-border-radius: 15px; 41 | -moz-border-radius: 15px; 42 | } 43 | #summary ul { 44 | margin: 0; 45 | padding: 0; 46 | } 47 | #summary li { 48 | display: block; 49 | margin: 5px; 50 | -webkit-border-radius: 15px; 51 | -moz-border-radius: 15px; 52 | border: 1px #E6D8CF solid; 53 | } 54 | #summary h2, 55 | #summary h3 { 56 | margin: 0; 57 | padding: 0.2em 5% 0.1em; 58 | font-size: 1em; 59 | -webkit-border-radius: 15px; 60 | -moz-border-radius: 15px; 61 | cursor: pointer; 62 | } 63 | #summary .open h2, 64 | #summary .individuals li.open h3 { 65 | -webkit-border-bottom-left-radius: 0; 66 | -webkit-border-bottom-right-radius: 0; 67 | -moz-border-radius-bottomright: 0; 68 | -moz-border-radius-bottomleft: 0; 69 | } 70 | #summary h2 { 71 | background-color: #E6A173; 72 | } 73 | #summary h3 { 74 | background-color: #E6D8CF; 75 | font-weight: normal; 76 | } 77 | 78 | #summary .individuals, 79 | #summary .properties { 80 | display: none; 81 | } 82 | #summary li.open .individuals, 83 | #summary .individuals li.open .properties { 84 | display: block; 85 | } 86 | #summary .properties li { 87 | display: block; 88 | border: none; 89 | margin-left: 1em; 90 | font-size: 0.8em; 91 | } 92 | #summary .properties li.auto { 93 | color: #BF6930; 94 | } 95 | 96 | #summary abbr { 97 | font: Helvetica, Arial, sans-serif; 98 | border-bottom: none; 99 | color: #CCCCCC; 100 | margin-right: 0.5em; 101 | cursor: pointer; 102 | } 103 | 104 | #summary .link { 105 | cursor: pointer; 106 | } 107 | 108 | #actions { 109 | position: absolute; 110 | bottom: 0; 111 | left: 0; 112 | -webkit-border-radius: 15px; 113 | -moz-border-radius: 15px; 114 | border: 1px #E6D8CF solid; 115 | margin: 0.5em; 116 | padding: 0.5em 0.2em; 117 | } 118 | 119 | #actions li { 120 | display: inline; 121 | background-color: #E6D8CF; 122 | -webkit-border-radius: 15px; 123 | -moz-border-radius: 15px; 124 | border: 1px #E6D8CF solid; 125 | margin: 0; 126 | padding: 0.2em 0.5em; 127 | cursor: pointer; 128 | } 129 | 130 | #body { 131 | position: fixed; 132 | overflow: auto; 133 | left: 27%; 134 | height: 95%; 135 | width: 73%; 136 | } 137 | #content { 138 | position: absolute; 139 | height: 66%; 140 | overflow: auto; 141 | } 142 | #content span[typeof] { 143 | -webkit-border-radius: 0.5em; 144 | -moz-border-radius: 0.5em; 145 | padding: 0 0.2em; 146 | border-style: solid; 147 | border-width: 1px; 148 | border-color: #E6A173; 149 | } 150 | #content span[property^='foaf']:hover, 151 | #content span[property^='vcard']:hover, 152 | #content span[property^='biografr']:hover { 153 | color: #E6A173; 154 | } 155 | 156 | #content .highlight { 157 | background-color: #E6A173; 158 | } 159 | 160 | #meta { 161 | display: none; 162 | } 163 | 164 | #data { 165 | position: absolute; 166 | top: 66%; 167 | height: 33%; 168 | overflow: auto; 169 | width: 100%; 170 | } 171 | 172 | #data form { 173 | width: 80%; 174 | } 175 | 176 | #data input, 177 | #data textarea { 178 | width: 120%; 179 | font-size: 1em; 180 | } 181 | 182 | #data input.error { 183 | border: 2px solid #BF6930; 184 | } 185 | 186 | #error { 187 | position: absolute; 188 | right: 5%; 189 | top: 1.5em; 190 | background-color: white; 191 | color: #BF6930; 192 | font-weight: bold; 193 | padding: 0 0.5em; 194 | } 195 | 196 | #messages { 197 | width: 96%; 198 | position: relative; 199 | } 200 | 201 | #help, #response { 202 | margin-top: 0; 203 | width: 47%; 204 | padding-left: 0.5em; 205 | padding-right: 0.5em; 206 | } 207 | 208 | #help { 209 | float: left; 210 | } 211 | 212 | #response { 213 | float: right; 214 | text-align: right; 215 | font-size: 0.8em; 216 | line-height: 1.4em; 217 | background-color: #E6D8CF; 218 | border: 1px solid #E6A173; 219 | color: black; 220 | padding-top: 0.2em; 221 | } 222 | 223 | #answer { 224 | margin-top: 0; 225 | margin-bottom: 0; 226 | } 227 | 228 | kbd, #response, #answer { 229 | font-family: "Helvetica", "Arial", sans-serif; 230 | } -------------------------------------------------------------------------------- /demos/markup/markup.html: -------------------------------------------------------------------------------- 1 | 3 | 12 | 13 | 14 | Mark it up! 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 |
43 |
44 |
45 |

46 | Charles Robert Darwin was born in Shrewsbury, Shropshire, England on 12 February 1809 at his family home, the Mount. He was the fifth of six children of wealthy society doctor and financier Robert Darwin, and Susannah Darwin (née Wedgwood). He was the grandson of Erasmus Darwin on his father’s side, and of Josiah Wedgwood on his mother’s side. Both families were largely Unitarian, though the Wedgwoods were adopting Anglicanism. Robert Darwin, himself quietly a freethinker, made a nod toward convention by having baby Charles baptised in the Anglican Church. Nonetheless, Charles and his siblings attended the Unitarian chapel with their mother, and in 1817, Charles joined the day school, run by its preacher. In July of that year, when Charles was eight years old, his mother died. From September 1818, he joined his older brother Erasmus attending the nearby Anglican Shrewsbury School as a boarder. 47 |

48 |

49 | Darwin spent the summer of 1825 as an apprentice doctor, helping his father treat the poor of Shropshire. In the autumn, he went with Erasmus to the University of Edinburgh to study medicine, but was revolted by the brutality of surgery and neglected his medical studies. He learned taxidermy from John Edmonstone, a freed black slave who told him exciting tales of the South American rainforest. This experience gave him evidence that “Negroes and Europeans” were closely related despite superficial differences in appearance. 50 |

51 |
52 |
53 |
54 |

55 | Note: 56 | 57 | 58 |

59 |
60 |
61 |

62 | You can enter statements, such as:
63 | Erasmus Darwin was Robert Darwin's father
64 | or questions such as:
65 | Who were Charles Robert Darwin's parents? 66 |

67 |

68 | Confirmation will appear here. 69 |

70 |
71 |
72 |

73 | This is the answer! 74 |

75 |
76 |
77 | 89 |
90 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_100_805940_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_100_805940_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_100_E6D8CF_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_100_E6D8CF_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_25_E6A173_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_25_E6A173_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_65_E6D8CF_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_65_E6D8CF_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_70_E6D8CF_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_70_E6D8CF_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_75_805940_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_75_805940_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_flat_75_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_flat_75_aaaaaa_40x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-bg_inset-soft_100_ffffff_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-bg_inset-soft_100_ffffff_1x100.png -------------------------------------------------------------------------------- /demos/theme/images/ui-icons_000000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-icons_000000_256x240.png -------------------------------------------------------------------------------- /demos/theme/images/ui-icons_BF6930_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-icons_BF6930_256x240.png -------------------------------------------------------------------------------- /demos/theme/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/demos/theme/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /demos/theme/ui.accordion.css: -------------------------------------------------------------------------------- 1 | /* Accordion 2 | ----------------------------------*/ 3 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } 4 | .ui-accordion li {display: inline;} 5 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } 6 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } 7 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 8 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } 9 | .ui-accordion .ui-accordion-content-active { display: block; } -------------------------------------------------------------------------------- /demos/theme/ui.all.css: -------------------------------------------------------------------------------- 1 | @import "ui.base.css"; 2 | @import "ui.theme.css"; 3 | -------------------------------------------------------------------------------- /demos/theme/ui.base.css: -------------------------------------------------------------------------------- 1 | @import url("ui.core.css"); 2 | 3 | @import url("ui.accordion.css"); 4 | @import url("ui.datepicker.css"); 5 | @import url("ui.dialog.css"); 6 | @import url("ui.progressbar.css"); 7 | @import url("ui.resizable.css"); 8 | @import url("ui.slider.css"); 9 | @import url("ui.tabs.css"); 10 | -------------------------------------------------------------------------------- /demos/theme/ui.core.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 3 | * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about) 4 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 5 | */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { display: none; } 10 | .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } 11 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 12 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 13 | .ui-helper-clearfix { display: inline-block; } 14 | /* required comment for clearfix to work in Opera \*/ 15 | * html .ui-helper-clearfix { height:1%; } 16 | .ui-helper-clearfix { display:block; } 17 | /* end clearfix */ 18 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 19 | 20 | 21 | /* Interaction Cues 22 | ----------------------------------*/ 23 | .ui-state-disabled { cursor: default !important; } 24 | 25 | 26 | /* Icons 27 | ----------------------------------*/ 28 | 29 | /* states and images */ 30 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 31 | 32 | 33 | /* Misc visuals 34 | ----------------------------------*/ 35 | 36 | /* Overlays */ 37 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } -------------------------------------------------------------------------------- /demos/theme/ui.datepicker.css: -------------------------------------------------------------------------------- 1 | /* Datepicker 2 | ----------------------------------*/ 3 | .ui-datepicker { width: 17em; padding: .2em .2em 0; } 4 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 5 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 6 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 7 | .ui-datepicker .ui-datepicker-prev { left:2px; } 8 | .ui-datepicker .ui-datepicker-next { right:2px; } 9 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 10 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 11 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 12 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 13 | .ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } 14 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 15 | .ui-datepicker select.ui-datepicker-month, 16 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 17 | .ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } 18 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 19 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 20 | .ui-datepicker td { border: 0; padding: 1px; } 21 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 22 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 23 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 24 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 25 | 26 | /* with multiple calendars */ 27 | .ui-datepicker.ui-datepicker-multi { width:auto; } 28 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 29 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 30 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 31 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 32 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 33 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 34 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 35 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 36 | .ui-datepicker-row-break { clear:left; width:100%; } 37 | 38 | /* RTL support */ 39 | .ui-datepicker-rtl { direction: rtl; } 40 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 41 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 42 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 43 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 44 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 45 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 46 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 47 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 48 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 49 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 50 | 51 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 52 | .ui-datepicker-cover { 53 | display: none; /*sorry for IE5*/ 54 | display/**/: block; /*sorry for IE5*/ 55 | position: absolute; /*must have*/ 56 | z-index: -1; /*must have*/ 57 | filter: mask(); /*must have*/ 58 | top: -4px; /*must have*/ 59 | left: -4px; /*must have*/ 60 | width: 200px; /*must have*/ 61 | height: 200px; /*must have*/ 62 | } -------------------------------------------------------------------------------- /demos/theme/ui.dialog.css: -------------------------------------------------------------------------------- 1 | /* Dialog 2 | ----------------------------------*/ 3 | .ui-dialog { position: relative; padding: .2em; width: 300px; } 4 | .ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } 5 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } 6 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 7 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 8 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 9 | .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; } 10 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 11 | .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } 12 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 13 | .ui-draggable .ui-dialog-titlebar { cursor: move; } -------------------------------------------------------------------------------- /demos/theme/ui.progressbar.css: -------------------------------------------------------------------------------- 1 | /* Progressbar 2 | ----------------------------------*/ 3 | .ui-progressbar { height:2em; text-align: left; } 4 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -------------------------------------------------------------------------------- /demos/theme/ui.resizable.css: -------------------------------------------------------------------------------- 1 | /* Resizable 2 | ----------------------------------*/ 3 | .ui-resizable { position: relative;} 4 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 5 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 6 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } 7 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } 8 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } 9 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } 10 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 11 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 12 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 13 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} -------------------------------------------------------------------------------- /demos/theme/ui.slider.css: -------------------------------------------------------------------------------- 1 | /* Slider 2 | ----------------------------------*/ 3 | .ui-slider { position: relative; text-align: left; } 4 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 5 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: 1%; display: block; border: 0; } 6 | 7 | .ui-slider-horizontal { height: .8em; } 8 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 9 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 10 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 11 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 12 | 13 | .ui-slider-vertical { width: .8em; height: 100px; } 14 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 15 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 16 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 17 | .ui-slider-vertical .ui-slider-range-max { top: 0; } -------------------------------------------------------------------------------- /demos/theme/ui.tabs.css: -------------------------------------------------------------------------------- 1 | /* Tabs 2 | ----------------------------------*/ 3 | .ui-tabs {padding: .2em;} 4 | .ui-tabs .ui-tabs-nav { padding: .2em .2em 0 .2em; position: relative; } 5 | .ui-tabs .ui-tabs-nav li { float: left; border-bottom: 0 !important; margin: 0 .2em -1px 0; padding: 0; list-style: none; } 6 | .ui-tabs .ui-tabs-nav li a { display:block; text-decoration: none; padding: .5em 1em; } 7 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: .1em; border-bottom: 0; } 8 | .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border: 0; background: none; } 9 | .ui-tabs .ui-tabs-hide { display: none !important; } -------------------------------------------------------------------------------- /jquery.cclicense.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery CC License for rdfQuery @VERSION 3 | * 4 | * Copyright (c) 2008 Jeni Tennison 5 | * Licensed under the MIT (MIT-LICENSE.txt) 6 | * 7 | * Depends: 8 | * jquery.uri.js 9 | * jquery.xmlns.js 10 | * jquery.curie.js 11 | * jquery.datatype.js 12 | * jquery.rdf.js 13 | */ 14 | /*global jQuery */ 15 | (function ($) { 16 | 17 | var 18 | cc = $.uri("http://creativecommons.org/ns#"), 19 | work = $.rdf.resource('<' + $.uri.base() + '>'), 20 | ccLicenseClass = $.rdf.resource('<' + cc + 'License>'), 21 | ccWorkClass = $.rdf.resource('<' + cc + 'Work>'), 22 | ccLicenseProp = $.rdf.resource('<' + cc + 'license>'), 23 | licenseRegex = /(?:^|\s)(?:(\S+):)?license(?:\s|$)/, 24 | 25 | gleaner = function (options) { 26 | var rel = this.attr('rel'), 27 | href = this.attr('href'), 28 | license, 29 | m = licenseRegex.exec(rel); 30 | if (href !== undefined && m !== null && (m[1] === undefined || this.xmlns(m[1]) === cc)) { 31 | if (options && options.about !== undefined) { 32 | if (options.about === null) { 33 | return true; 34 | } else { 35 | return options.about === $.uri.base() || options.about === href; 36 | } 37 | } else if (options && options.type !== undefined) { 38 | if (options.type === null) { 39 | return true; 40 | } else { 41 | return options.type === ccLicenseClass.value || options.type === ccWorkClass.value; 42 | } 43 | } else { 44 | license = $.rdf.resource('<' + href + '>'); 45 | return [ 46 | $.rdf.triple(work, $.rdf.type, ccWorkClass), 47 | $.rdf.triple(license, $.rdf.type, ccLicenseClass), 48 | $.rdf.triple(work, ccLicenseProp, license) 49 | ]; 50 | } 51 | } 52 | return options === undefined ? [] : false; 53 | }; 54 | 55 | $.fn.cclicense = function (triple) { 56 | if (triple === undefined) { 57 | var triples = $.map($(this), function (elem) { 58 | return gleaner.call($(elem)); 59 | }); 60 | return $.rdf({ triples: triples }); 61 | } else { 62 | $(this) 63 | .filter('[href]') // only add to elements with href attributes 64 | .each(function () { 65 | var elem = $(this), 66 | rel = elem.attr('rel'); 67 | if (rel === undefined || rel === '') { 68 | elem.attr('rel', 'license'); 69 | } else if (!licenseRegex.test(rel)) { 70 | elem.attr('rel', rel + ' license'); 71 | } 72 | }); 73 | return this; 74 | } 75 | }; 76 | 77 | $.rdf.gleaners.push({ 78 | name: "cclicense", 79 | gleaner: gleaner 80 | }); 81 | 82 | })(jQuery); 83 | -------------------------------------------------------------------------------- /jquery.rdf.json.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery RDF @VERSION 3 | * 4 | * Copyright (c) 2008,2009 Jeni Tennison 5 | * Licensed under the MIT (MIT-LICENSE.txt) 6 | * 7 | * Depends: 8 | * jquery.uri.js 9 | * jquery.xmlns.js 10 | * jquery.datatype.js 11 | * jquery.curie.js 12 | * jquery.rdf.js 13 | * jquery.json.js 14 | */ 15 | /** 16 | * @fileOverview jQuery RDF/JSON parser 17 | * @author Jeni Tennison 18 | * @copyright (c) 2008,2009 Jeni Tennison 19 | * @license MIT license (MIT-LICENSE.txt) 20 | * @version 1.0 21 | */ 22 | /** 23 | * @exports $ as jQuery 24 | */ 25 | /** 26 | * @ignore 27 | */ 28 | (function ($) { 29 | 30 | $.rdf.parsers['application/json'] = { 31 | parse: $.secureEvalJSON, 32 | serialize: $.toJSON, 33 | triples: function (data) { 34 | var s, subject, p, property, o, object, i, opts, triples = []; 35 | for (s in data) { 36 | subject = (s.substring(0, 2) === '_:') ? $.rdf.blank(s) : $.rdf.resource('<' + s + '>'); 37 | for (p in data[s]) { 38 | property = $.rdf.resource('<' + p + '>'); 39 | for (i = 0; i < data[s][p].length; i += 1) { 40 | o = data[s][p][i]; 41 | if (o.type === 'uri') { 42 | object = $.rdf.resource('<' + o.value + '>'); 43 | } else if (o.type === 'bnode') { 44 | object = $.rdf.blank(o.value); 45 | } else { 46 | // o.type === 'literal' 47 | if (o.datatype !== undefined) { 48 | object = $.rdf.literal(o.value, { datatype: o.datatype }); 49 | } else { 50 | opts = {}; 51 | if (o.lang !== undefined) { 52 | opts.lang = o.lang; 53 | } 54 | object = $.rdf.literal('"' + o.value + '"', opts); 55 | } 56 | } 57 | triples.push($.rdf.triple(subject, property, object)); 58 | } 59 | } 60 | } 61 | return triples; 62 | }, 63 | dump: function (triples) { 64 | var e = {}, 65 | i, t, s, p; 66 | for (i = 0; i < triples.length; i += 1) { 67 | t = triples[i]; 68 | s = t.subject.value.toString(); 69 | p = t.property.value.toString(); 70 | if (e[s] === undefined) { 71 | e[s] = {}; 72 | } 73 | if (e[s][p] === undefined) { 74 | e[s][p] = []; 75 | } 76 | e[s][p].push(t.object.dump()); 77 | } 78 | return e; 79 | } 80 | }; 81 | 82 | })(jQuery); 83 | -------------------------------------------------------------------------------- /jquery.rules.rdfs.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery RDF Ontology @VERSION 3 | * 4 | * Copyright (c) 2009 Jeni Tennison 5 | * Licensed under the MIT (MIT-LICENSE.txt) 6 | * 7 | * Depends: 8 | * jquery.uri.js 9 | * jquery.xmlns.js 10 | * jquery.datatype.js 11 | * jquery.curie.js 12 | * jquery.rdf.js 13 | * jquery.rules.js 14 | */ 15 | /*global jQuery */ 16 | (function ($) { 17 | 18 | var 19 | nsRdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#", 20 | nsRdfs = "http://www.w3.org/2000/01/rdf-schema#"; 21 | 22 | $.rdf.ruleset.rdfs = $.rdf.ruleset() 23 | .prefix('rdf', nsRdf) 24 | .prefix('rdfs', nsRdfs) 25 | .add('?subject ?property ?object', '?property a rdf:Property') 26 | .add('?property rdfs:range ?class', 27 | ['?property a rdf:Property', '?class a rdfs:Class']) 28 | .add(['?property rdfs:range ?class', '?subject ?property ?object'], 29 | '?object a ?class') 30 | .add('?property rdfs:domain ?class', 31 | ['?property a rdf:Property', '?class a rdfs:Class']) 32 | .add(['?property rdfs:domain ?class', '?subject ?property ?object'], 33 | '?subject a ?class') 34 | .add('?instance a ?class', '?class a rdfs:Class') 35 | .add('?subclass rdfs:subClassOf ?class', 36 | ['?subclass a rdfs:Class', '?class a rdfs:Class']) 37 | .add(['?subclass rdfs:subClassOf ?class', '?instance a ?subclass'], 38 | '?instance a ?class') 39 | .add('?subproperty rdfs:subPropertyOf ?property', 40 | ['?subproperty a rdf:Property', '?property a rdf:Property']) 41 | .add(['?subproperty rdfs:subPropertyOf ?property', '?subject ?subproperty ?object'], 42 | '?subject ?property ?object') 43 | .add('?statement rdf:subject ?resource', '?statement a rdf:Statement') 44 | .add('?statement rdf:predicate ?property', 45 | ['?statement a rdf:Statement', '?property a rdf:Property']) 46 | .add('?statement rdf:object ?resource', '?statement a rdf:Statement') 47 | .add(['?statement rdf:subject ?subject', '?statement rdf:predicate ?property', '?statement rdf:object ?object'], 48 | '?subject ?property ?object') 49 | .add('?subject rdfs:isDefinedBy ?object', '?subject rdfs:seeAlso ?object') 50 | 51 | })(jQuery); 52 | -------------------------------------------------------------------------------- /jquery.xfn.foaf.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery XFN for rdfQuery @VERSION 3 | * 4 | * Copyright (c) 2008 Jeni Tennison, Libby Miller 5 | * Licensed under the MIT (MIT-LICENSE.txt) 6 | * 7 | * Depends: 8 | * jquery.uri.js 9 | * jquery.xmlns.js 10 | * jquery.curie.js 11 | * jquery.datatype.js 12 | * jquery.rdf.js 13 | */ 14 | /*global jQuery */ 15 | (function ($) { 16 | 17 | var 18 | foaf = $.uri("http://xmlns.com/foaf/0.1/"), 19 | work = $.rdf.resource('<' + $.uri.base() + '>'), 20 | foafPersonClass = $.rdf.resource('<' + foaf + 'Person>'), 21 | foafKnowsProp = $.rdf.resource('<' + foaf + 'knows>'), 22 | foafWeblogProp = $.rdf.resource('<' + foaf + 'weblog>'), 23 | person1Bnode = $.rdf.blank("[]"), 24 | meRegex = /(?:^|\s)me(?:\s|$)/, 25 | 26 | gleaner = function (options) { 27 | 28 | var rel = this.attr('rel'), 29 | href = this.attr('href'), 30 | m = meRegex.exec(rel), 31 | person2Bnode = $.rdf.blank("[]"); 32 | 33 | if (href !== undefined && m === null) { 34 | 35 | if (options && options.about !== undefined) { 36 | if (options.about === null) { 37 | return true; 38 | } else { 39 | return options.about === $.uri.base() || options.about === href; 40 | } 41 | } else if (options && options.type !== undefined) { 42 | if (options.type === null) { 43 | return true; 44 | } else { 45 | return options.type === foafPersonClass.uri; 46 | } 47 | } else { 48 | return [ 49 | $.rdf.triple(person1Bnode, $.rdf.type, foafPersonClass), 50 | $.rdf.triple(person1Bnode, foafWeblogProp, work), 51 | $.rdf.triple(person1Bnode, foafKnowsProp, person2Bnode), 52 | $.rdf.triple(person2Bnode, foafWeblogProp, '<' + href + '>'), 53 | $.rdf.triple(person2Bnode, $.rdf.type, foafPersonClass) 54 | 55 | ]; 56 | } 57 | } 58 | return options === undefined ? [] : false; 59 | }; 60 | 61 | 62 | 63 | $.fn.xfn = function (relationship) { 64 | //relationship e.g. 'friend' 'met' etc 65 | if (relationship === undefined) { 66 | var triples = $.map($(this), function (elem) { 67 | return gleaner.call($(elem)); 68 | }); 69 | return $.rdf({ triples: triples }); 70 | } else { 71 | $(this) 72 | .filter('[href]') // only add to elements with href attributes 73 | .each(function () { 74 | var elem = $(this), 75 | rel = elem.attr('rel'); 76 | if (rel === undefined || rel === '') { 77 | elem.attr('rel', relationship); 78 | } else if (!rel.toLowerCase().match(relationship.toLowerCase())) { 79 | elem.attr('rel', rel + ' ' + relationship); 80 | } 81 | }); 82 | return this; 83 | } 84 | }; 85 | 86 | $.rdf.gleaners.push({ 87 | name: "xfn.foaf", 88 | gleaner: gleaner 89 | }); 90 | 91 | })(jQuery); 92 | -------------------------------------------------------------------------------- /jquery/jquery.json.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery JSON Plugin 3 | * version: 2.1 (2009-08-14) 4 | * 5 | * This document is licensed as free software under the terms of the 6 | * MIT License: http://www.opensource.org/licenses/mit-license.php 7 | * 8 | * Brantley Harris wrote this plugin. It is based somewhat on the JSON.org 9 | * website's http://www.json.org/json2.js, which proclaims: 10 | * "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that 11 | * I uphold. 12 | * 13 | * It is also influenced heavily by MochiKit's serializeJSON, which is 14 | * copyrighted 2005 by Bob Ippolito. 15 | */ 16 | 17 | (function($) { 18 | /** jQuery.toJSON( json-serializble ) 19 | Converts the given argument into a JSON respresentation. 20 | 21 | If an object has a "toJSON" function, that will be used to get the representation. 22 | Non-integer/string keys are skipped in the object, as are keys that point to a function. 23 | 24 | json-serializble: 25 | The *thing* to be converted. 26 | **/ 27 | $.toJSON = function(o) 28 | { 29 | if (typeof(JSON) == 'object' && JSON.stringify) 30 | return JSON.stringify(o); 31 | 32 | var type = typeof(o); 33 | 34 | if (o === null) 35 | return "null"; 36 | 37 | if (type == "undefined") 38 | return undefined; 39 | 40 | if (type == "number" || type == "boolean") 41 | return o + ""; 42 | 43 | if (type == "string") 44 | return $.quoteString(o); 45 | 46 | if (type == 'object') 47 | { 48 | if (typeof o.toJSON == "function") 49 | return $.toJSON( o.toJSON() ); 50 | 51 | if (o.constructor === Date) 52 | { 53 | var month = o.getUTCMonth() + 1; 54 | if (month < 10) month = '0' + month; 55 | 56 | var day = o.getUTCDate(); 57 | if (day < 10) day = '0' + day; 58 | 59 | var year = o.getUTCFullYear(); 60 | 61 | var hours = o.getUTCHours(); 62 | if (hours < 10) hours = '0' + hours; 63 | 64 | var minutes = o.getUTCMinutes(); 65 | if (minutes < 10) minutes = '0' + minutes; 66 | 67 | var seconds = o.getUTCSeconds(); 68 | if (seconds < 10) seconds = '0' + seconds; 69 | 70 | var milli = o.getUTCMilliseconds(); 71 | if (milli < 100) milli = '0' + milli; 72 | if (milli < 10) milli = '0' + milli; 73 | 74 | return '"' + year + '-' + month + '-' + day + 'T' + 75 | hours + ':' + minutes + ':' + seconds + 76 | '.' + milli + 'Z"'; 77 | } 78 | 79 | if (o.constructor === Array) 80 | { 81 | var ret = []; 82 | for (var i = 0; i < o.length; i++) 83 | ret.push( $.toJSON(o[i]) || "null" ); 84 | 85 | return "[" + ret.join(",") + "]"; 86 | } 87 | 88 | var pairs = []; 89 | for (var k in o) { 90 | var name; 91 | var type = typeof k; 92 | 93 | if (type == "number") 94 | name = '"' + k + '"'; 95 | else if (type == "string") 96 | name = $.quoteString(k); 97 | else 98 | continue; //skip non-string or number keys 99 | 100 | if (typeof o[k] == "function") 101 | continue; //skip pairs where the value is a function. 102 | 103 | var val = $.toJSON(o[k]); 104 | 105 | pairs.push(name + ":" + val); 106 | } 107 | 108 | return "{" + pairs.join(", ") + "}"; 109 | } 110 | }; 111 | 112 | /** jQuery.evalJSON(src) 113 | Evaluates a given piece of json source. 114 | **/ 115 | $.evalJSON = function(src) 116 | { 117 | if (typeof(JSON) == 'object' && JSON.parse) 118 | return JSON.parse(src); 119 | return eval("(" + src + ")"); 120 | }; 121 | 122 | /** jQuery.secureEvalJSON(src) 123 | Evals JSON in a way that is *more* secure. 124 | **/ 125 | $.secureEvalJSON = function(src) 126 | { 127 | if (typeof(JSON) == 'object' && JSON.parse) 128 | return JSON.parse(src); 129 | 130 | var filtered = src; 131 | filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@'); 132 | filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); 133 | filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); 134 | 135 | if (/^[\],:{}\s]*$/.test(filtered)) 136 | return eval("(" + src + ")"); 137 | else 138 | throw new SyntaxError("Error parsing JSON, source is not valid."); 139 | }; 140 | 141 | /** jQuery.quoteString(string) 142 | Returns a string-repr of a string, escaping quotes intelligently. 143 | Mostly a support function for toJSON. 144 | 145 | Examples: 146 | >>> jQuery.quoteString("apple") 147 | "apple" 148 | 149 | >>> jQuery.quoteString('"Where are we going?", she asked.') 150 | "\"Where are we going?\", she asked." 151 | **/ 152 | $.quoteString = function(string) 153 | { 154 | if (string.match(_escapeable)) 155 | { 156 | return '"' + string.replace(_escapeable, function (a) 157 | { 158 | var c = _meta[a]; 159 | if (typeof c === 'string') return c; 160 | c = a.charCodeAt(); 161 | return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); 162 | }) + '"'; 163 | } 164 | return '"' + string + '"'; 165 | }; 166 | 167 | var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g; 168 | 169 | var _meta = { 170 | '\b': '\\b', 171 | '\t': '\\t', 172 | '\n': '\\n', 173 | '\f': '\\f', 174 | '\r': '\\r', 175 | '"' : '\\"', 176 | '\\': '\\\\' 177 | }; 178 | })(jQuery); -------------------------------------------------------------------------------- /jquery/tests/qunit/qunit.css: -------------------------------------------------------------------------------- 1 | /** Font Family and Sizes */ 2 | 3 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 4 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; 5 | } 6 | 7 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 8 | #qunit-tests { font-size: smaller; } 9 | 10 | 11 | /** Resets */ 12 | 13 | #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { 14 | margin: 0; 15 | padding: 0; 16 | } 17 | 18 | 19 | /** Header */ 20 | 21 | #qunit-header { 22 | padding: 0.5em 0 0.5em 1em; 23 | 24 | color: #8699a4; 25 | background-color: #0d3349; 26 | 27 | font-size: 1.5em; 28 | line-height: 1em; 29 | font-weight: normal; 30 | 31 | border-radius: 15px 15px 0 0; 32 | -moz-border-radius: 15px 15px 0 0; 33 | -webkit-border-top-right-radius: 15px; 34 | -webkit-border-top-left-radius: 15px; 35 | } 36 | 37 | #qunit-header a { 38 | text-decoration: none; 39 | color: #c2ccd1; 40 | } 41 | 42 | #qunit-header a:hover, 43 | #qunit-header a:focus { 44 | color: #fff; 45 | } 46 | 47 | #qunit-banner { 48 | height: 5px; 49 | } 50 | 51 | #qunit-testrunner-toolbar { 52 | padding: 0.5em 0 0.5em 2em; 53 | color: #5E740B; 54 | background-color: #eee; 55 | } 56 | 57 | #qunit-userAgent { 58 | padding: 0.5em 0 0.5em 2.5em; 59 | background-color: #2b81af; 60 | color: #fff; 61 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 62 | } 63 | 64 | 65 | /** Tests: Pass/Fail */ 66 | 67 | #qunit-tests { 68 | list-style-position: inside; 69 | } 70 | 71 | #qunit-tests li { 72 | padding: 0.4em 0.5em 0.4em 2.5em; 73 | border-bottom: 1px solid #fff; 74 | list-style-position: inside; 75 | } 76 | 77 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { 78 | display: none; 79 | } 80 | 81 | #qunit-tests li strong { 82 | cursor: pointer; 83 | } 84 | 85 | #qunit-tests li a { 86 | padding: 0.5em; 87 | color: #c2ccd1; 88 | text-decoration: none; 89 | } 90 | #qunit-tests li a:hover, 91 | #qunit-tests li a:focus { 92 | color: #000; 93 | } 94 | 95 | #qunit-tests ol { 96 | margin-top: 0.5em; 97 | padding: 0.5em; 98 | 99 | background-color: #fff; 100 | 101 | border-radius: 15px; 102 | -moz-border-radius: 15px; 103 | -webkit-border-radius: 15px; 104 | 105 | box-shadow: inset 0px 2px 13px #999; 106 | -moz-box-shadow: inset 0px 2px 13px #999; 107 | -webkit-box-shadow: inset 0px 2px 13px #999; 108 | } 109 | 110 | #qunit-tests table { 111 | border-collapse: collapse; 112 | margin-top: .2em; 113 | } 114 | 115 | #qunit-tests th { 116 | text-align: right; 117 | vertical-align: top; 118 | padding: 0 .5em 0 0; 119 | } 120 | 121 | #qunit-tests td { 122 | vertical-align: top; 123 | } 124 | 125 | #qunit-tests pre { 126 | margin: 0; 127 | white-space: pre-wrap; 128 | word-wrap: break-word; 129 | } 130 | 131 | #qunit-tests del { 132 | background-color: #e0f2be; 133 | color: #374e0c; 134 | text-decoration: none; 135 | } 136 | 137 | #qunit-tests ins { 138 | background-color: #ffcaca; 139 | color: #500; 140 | text-decoration: none; 141 | } 142 | 143 | /*** Test Counts */ 144 | 145 | #qunit-tests b.counts { color: black; } 146 | #qunit-tests b.passed { color: #5E740B; } 147 | #qunit-tests b.failed { color: #710909; } 148 | 149 | #qunit-tests li li { 150 | margin: 0.5em; 151 | padding: 0.4em 0.5em 0.4em 0.5em; 152 | background-color: #fff; 153 | border-bottom: none; 154 | list-style-position: inside; 155 | } 156 | 157 | /*** Passing Styles */ 158 | 159 | #qunit-tests li li.pass { 160 | color: #5E740B; 161 | background-color: #fff; 162 | border-left: 26px solid #C6E746; 163 | } 164 | 165 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 166 | #qunit-tests .pass .test-name { color: #366097; } 167 | 168 | #qunit-tests .pass .test-actual, 169 | #qunit-tests .pass .test-expected { color: #999999; } 170 | 171 | #qunit-banner.qunit-pass { background-color: #C6E746; } 172 | 173 | /*** Failing Styles */ 174 | 175 | #qunit-tests li li.fail { 176 | color: #710909; 177 | background-color: #fff; 178 | border-left: 26px solid #EE5757; 179 | } 180 | 181 | #qunit-tests > li:last-child { 182 | border-radius: 0 0 15px 15px; 183 | -moz-border-radius: 0 0 15px 15px; 184 | -webkit-border-bottom-right-radius: 15px; 185 | -webkit-border-bottom-left-radius: 15px; 186 | } 187 | 188 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 189 | #qunit-tests .fail .test-name, 190 | #qunit-tests .fail .module-name { color: #000000; } 191 | 192 | #qunit-tests .fail .test-actual { color: #EE5757; } 193 | #qunit-tests .fail .test-expected { color: green; } 194 | 195 | #qunit-banner.qunit-fail { background-color: #EE5757; } 196 | 197 | 198 | /** Result */ 199 | 200 | #qunit-testresult { 201 | padding: 0.5em 0.5em 0.5em 2.5em; 202 | 203 | color: #2b81af; 204 | background-color: #D2E0E6; 205 | 206 | border-bottom: 1px solid white; 207 | } 208 | 209 | /** Fixture */ 210 | 211 | #qunit-fixture { 212 | position: absolute; 213 | top: -10000px; 214 | left: -10000px; 215 | } 216 | -------------------------------------------------------------------------------- /jquery/tests/qunit/testsuite.css: -------------------------------------------------------------------------------- 1 | body, div, h1 { font-family: 'trebuchet ms', verdana, arial; margin: 0; padding: 0 } 2 | body {font-size: 10pt; } 3 | h1 { padding: 15px; font-size: large; background-color: #06b; color: white; } 4 | h1 a { color: white; } 5 | h2 { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal } 6 | 7 | .pass { color: green; } 8 | .fail { color: red; } 9 | p.result { margin-left: 1em; } 10 | 11 | #banner { height: 2em; border-bottom: 1px solid white; } 12 | h2.pass { background-color: green; } 13 | h2.fail { background-color: red; } 14 | 15 | div.testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; } 16 | 17 | ol#tests > li > strong { cursor:pointer; } 18 | 19 | div#fx-tests h4 { 20 | background: red; 21 | } 22 | 23 | div#fx-tests h4.pass { 24 | background: green; 25 | } 26 | 27 | div#fx-tests div.box { 28 | background: red url(data/cow.jpg) no-repeat; 29 | overflow: hidden; 30 | border: 2px solid #000; 31 | } 32 | 33 | div#fx-tests div.overflow { 34 | overflow: visible; 35 | } 36 | 37 | div.inline { 38 | display: inline; 39 | } 40 | 41 | div.autoheight { 42 | height: auto; 43 | } 44 | 45 | div.autowidth { 46 | width: auto; 47 | } 48 | 49 | div.autoopacity { 50 | opacity: auto; 51 | } 52 | 53 | div.largewidth { 54 | width: 100px; 55 | } 56 | 57 | div.largeheight { 58 | height: 100px; 59 | } 60 | 61 | div.largeopacity { 62 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); 63 | } 64 | 65 | div.medwidth { 66 | width: 50px; 67 | } 68 | 69 | div.medheight { 70 | height: 50px; 71 | } 72 | 73 | div.medopacity { 74 | opacity: 0.5; 75 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); 76 | } 77 | 78 | div.nowidth { 79 | width: 0px; 80 | } 81 | 82 | div.noheight { 83 | height: 0px; 84 | } 85 | 86 | div.noopacity { 87 | opacity: 0; 88 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); 89 | } 90 | 91 | div.hidden { 92 | display: none; 93 | } 94 | 95 | div#fx-tests div.widewidth { 96 | background-repeat: repeat-x; 97 | } 98 | 99 | div#fx-tests div.wideheight { 100 | background-repeat: repeat-y; 101 | } 102 | 103 | div#fx-tests div.widewidth.wideheight { 104 | background-repeat: repeat; 105 | } 106 | 107 | div#fx-tests div.noback { 108 | background-image: none; 109 | } 110 | 111 | div.chain, div.chain div { width: 100px; height: 20px; position: relative; float: left; } 112 | div.chain div { position: absolute; top: 0px; left: 0px; } 113 | 114 | div.chain.test { background: red; } 115 | div.chain.test div { background: green; } 116 | 117 | div.chain.out { background: green; } 118 | div.chain.out div { background: red; display: none; } 119 | 120 | div#show-tests * { display: none; } 121 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/app/frame/Chain.js: -------------------------------------------------------------------------------- 1 | /**@constructor*/ 2 | function ChainNode(object, link) { 3 | this.value = object; 4 | this.link = link; // describes this node's relationship to the previous node 5 | } 6 | 7 | /**@constructor*/ 8 | function Chain(valueLinks) { 9 | this.nodes = []; 10 | this.cursor = -1; 11 | 12 | if (valueLinks && valueLinks.length > 0) { 13 | this.push(valueLinks[0], "//"); 14 | for (var i = 1, l = valueLinks.length; i < l; i+=2) { 15 | this.push(valueLinks[i+1], valueLinks[i]); 16 | } 17 | } 18 | } 19 | 20 | Chain.prototype.push = function(o, link) { 21 | if (this.nodes.length > 0 && link) this.nodes.push(new ChainNode(o, link)); 22 | else this.nodes.push(new ChainNode(o)); 23 | } 24 | 25 | Chain.prototype.unshift = function(o, link) { 26 | if (this.nodes.length > 0 && link) this.nodes[0].link = link; 27 | this.nodes.unshift(new ChainNode(o)); 28 | this.cursor++; 29 | } 30 | 31 | Chain.prototype.get = function() { 32 | if (this.cursor < 0 || this.cursor > this.nodes.length-1) return null; 33 | return this.nodes[this.cursor]; 34 | } 35 | 36 | Chain.prototype.first = function() { 37 | this.cursor = 0; 38 | return this.get(); 39 | } 40 | 41 | Chain.prototype.last = function() { 42 | this.cursor = this.nodes.length-1; 43 | return this.get(); 44 | } 45 | 46 | Chain.prototype.next = function() { 47 | this.cursor++; 48 | return this.get(); 49 | } 50 | 51 | Chain.prototype.prev = function() { 52 | this.cursor--; 53 | return this.get(); 54 | } 55 | 56 | Chain.prototype.toString = function() { 57 | var string = ""; 58 | for (var i = 0, l = this.nodes.length; i < l; i++) { 59 | if (this.nodes[i].link) string += " -("+this.nodes[i].link+")-> "; 60 | string += this.nodes[i].value.toString(); 61 | } 62 | return string; 63 | } 64 | 65 | Chain.prototype.joinLeft = function() { 66 | var result = ""; 67 | for (var i = 0, l = this.cursor; i < l; i++) { 68 | if (result && this.nodes[i].link) result += this.nodes[i].link; 69 | result += this.nodes[i].value.toString(); 70 | } 71 | return result; 72 | } 73 | 74 | 75 | /* USAGE: 76 | 77 | var path = "one/two/three.four/five-six"; 78 | var pathChain = new Chain(path.split(/([\/.-])/)); 79 | print(pathChain); 80 | 81 | var lineage = new Chain(); 82 | lineage.push("Port"); 83 | lineage.push("Les", "son"); 84 | lineage.push("Dawn", "daughter"); 85 | lineage.unshift("Purdie", "son"); 86 | 87 | print(lineage); 88 | 89 | // walk left 90 | for (var node = lineage.last(); node !== null; node = lineage.prev()) { 91 | print("< "+node.value); 92 | } 93 | 94 | // walk right 95 | var node = lineage.first() 96 | while (node !== null) { 97 | print(node.value); 98 | node = lineage.next(); 99 | if (node && node.link) print("had a "+node.link+" named"); 100 | } 101 | 102 | */ -------------------------------------------------------------------------------- /lib/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 | }; -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | */ -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 = "aX11/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | */ -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | ); -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | ); -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | ); -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | ); -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | ); -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/app/test/encoding_other.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/lib/jsdoc-toolkit/app/test/encoding_other.js -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | })(); -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | /**#@-*/ -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | })(); -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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); -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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); -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/app/test/scripts/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | @class 3 | */ 4 | function thisiscode() { 5 | } -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/app/test/scripts/notcode.txt: -------------------------------------------------------------------------------- 1 | (This is not code) 2 | function foo(){{{{ 3 | ( 4 | ! 5 | @ -------------------------------------------------------------------------------- /lib/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. -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/app/test/shared2.js: -------------------------------------------------------------------------------- 1 | startOver = function(){ 2 | } -------------------------------------------------------------------------------- /lib/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 | // /**#=-*/ -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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) {} -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/java/classes/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/lib/jsdoc-toolkit/java/classes/js.jar -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/jsdebug.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/lib/jsdoc-toolkit/jsdebug.jar -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/jsrun.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/lib/jsdoc-toolkit/jsrun.jar -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 |
    6 | 7 |
  • {! 8 | if (thisClass.alias == "_global_") { 9 | output += ""+new Link().toClass(thisClass.alias)+""; 10 | } 11 | else { 12 | output += new Link().toClass(thisClass.alias); 13 | } 14 | !}
  • 15 |
    16 |
17 |
-------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | } -------------------------------------------------------------------------------- /lib/jsdoc-toolkit/templates/jsdoc/static/header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/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 | -------------------------------------------------------------------------------- /lib/yui-compressor/yuicompressor-2.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alohaeditor/rdfQuery/a4600efbab1fa8735b7922524b4b4831f3e16928/lib/yui-compressor/yuicompressor-2.4.2.jar -------------------------------------------------------------------------------- /proxies/proxy.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'method' => "GET", 10 | 'header' => "Accept: application/rdf+xml\r\n" 11 | ) 12 | ); 13 | $context = stream_context_create($opts); 14 | $response = request($url); 15 | header("Content-Type: text/javascript", true); 16 | if ($response['content']) { 17 | $content = $response['content']; 18 | $content = str_replace("\n", '\n', $content); 19 | $content = str_replace("'", "\\'", $content); 20 | echo('$.rdf.databank.load(\'' . $id . '\', \'' . $url . '\', function (xml) {'); 21 | echo(' var doc, parser;'); 22 | echo(' try {'); 23 | echo(' try {'); 24 | echo(' doc = new ActiveXObject(\'Microsoft.XMLDOM\');'); 25 | echo(' doc.async = \'false\';'); 26 | echo(' doc.loadXML(xml);'); 27 | echo(' } catch(e) {'); 28 | echo(' parser = new DOMParser();'); 29 | echo(' doc = parser.parseFromString(xml, \'text/xml\');'); 30 | echo(' }'); 31 | echo(' return doc;'); 32 | echo(' } catch (e) {'); 33 | echo(' return undefined;'); 34 | echo(' }'); 35 | echo('}(\''); 36 | echo($content); 37 | echo('\'), { proxy: \'' . $proxy . '\', depth: ' . $depth . '});'); 38 | } else { 39 | $status_code = $response['status_code']; 40 | $msg = $response['msg']; 41 | echo('$.rdf.databank.load(\'' . $id . '\', \'' . $url . '\', undefined, { status: ' . $status_code . ', message: \'' . $msg . '\' });'); 42 | } 43 | 44 | function request($url) { 45 | global $context; 46 | if (substr($url, 0, 4) == 'http') { 47 | $content = @file_get_contents($url, 0, $context); 48 | list($version, $status_code, $msg) = explode(' ', $http_response_header[0], 3); 49 | switch ($status_code) { 50 | case 200: 51 | return array('content' => $content); 52 | case 301: 53 | case 303: 54 | case 307: 55 | $url = null; 56 | foreach ($http_response_header as $header) { 57 | $match = preg_match('/^Location: (.+)/', $header, $matches); 58 | if ($match) { 59 | $url = $matches[1]; 60 | } 61 | } 62 | return request($url); 63 | default: 64 | return array( 65 | 'status_code' => $status_code, 66 | 'msg' => $msg 67 | ); 68 | } 69 | } else { 70 | return array(); 71 | } 72 | } 73 | return; 74 | ?> -------------------------------------------------------------------------------- /tests/jquery.alltests.html: -------------------------------------------------------------------------------- 1 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 41 | 42 | 43 | 44 | 45 | 46 |

rdfQuery tests - using QUnit

47 |

48 |
49 |

50 |
    51 | 52 |
    53 | 54 | 55 |
    56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /tests/jquery.cclicense.html: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |

    jQuery CC License plugin tests

    23 | 24 |

    25 | 26 |
      27 | 28 |
      29 | 30 | 31 | -------------------------------------------------------------------------------- /tests/jquery.curie.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.curie.js unit tests 3 | */ 4 | (function($){ 5 | 6 | var ns = { 7 | 8 | xhv: "http://www.w3.org/1999/xhtml/vocab#", 9 | dc: "http://purl.org/dc/elements/1.1/", 10 | foaf: "http://xmlns.com/foaf/0.1/", 11 | cc: "http://creativecommons.org/ns#" 12 | } 13 | 14 | module("CURIE resolution"); 15 | 16 | test("Two identical CURIEs", function() { 17 | var curie1 = $('html').curie('dc:creator'); 18 | var curie2 = $('html').curie('dc:creator'); 19 | ok(curie1 === curie2, "should equal each other"); 20 | }); 21 | 22 | test("CURIE on element with declaration", function() { 23 | equals($('html').curie('dc:creator'), ns.dc + 'creator'); 24 | }); 25 | 26 | test("CURIE on child element of declaration", function() { 27 | equals($('body').curie('dc:creator'), ns.dc + 'creator'); 28 | }); 29 | 30 | test("CURIE on descendant element of declaration", function() { 31 | equals($('#main').curie('dc:creator'), ns.dc + 'creator'); 32 | }); 33 | 34 | test("CURIE on element with other ancestor declaration", function() { 35 | equals($('body').curie('foaf:img'), ns.foaf + 'img'); 36 | }); 37 | 38 | test("CURIE on element without declaration for the prefix", function() { 39 | try { 40 | $('body').curie('lic:license'); 41 | ok(false, 'should give an error'); 42 | } catch (e) { 43 | ok(true, 'should give an error'); 44 | } 45 | }); 46 | 47 | test("CURIE with no prefix that is in the default set of prefix-less CURIEs for XHTML", function() { 48 | equals($('html').curie('alternate'), ns.xhv + 'alternate'); 49 | }); 50 | 51 | test("CURIE with no prefix that is not in the default set of prefix-less CURIEs for XHTML", function() { 52 | try { 53 | $('html').curie('foobar'); 54 | ok(false, 'should give an error'); 55 | } catch (e) { 56 | ok(true, 'should give an error'); 57 | } 58 | }); 59 | 60 | test("CURIE with no prefix and no colon when there is a default namespace", function() { 61 | var namespace = 'http://www.example.org/'; 62 | var opts = {reserved: [], reservedNamespace: null, defaultNamespace: namespace}; 63 | try { 64 | equals($('html').curie('foobar', opts), namespace + 'foobar'); 65 | } catch (e) { 66 | ok(false, 'should not give an error'); 67 | } 68 | }); 69 | 70 | test("CURIE with no prefix and no colon when there is no default namespace", function() { 71 | var opts = {reserved: [], reservedNamespace: null, defaultNamespace: null}; 72 | try { 73 | var curie = $('html').curie('foobar', opts); 74 | ok(false, 'should give an error'); 75 | } catch (e) { 76 | ok(true, 'should give an error'); 77 | } 78 | }); 79 | 80 | test("CURIE with no prefix (but with a colon) when there is a reserved namespace", function() { 81 | var namespace = 'http://www.example.org/'; 82 | var opts = {reserved: [], reservedNamespace: namespace, defaultNamespace: null}; 83 | try { 84 | equals($('html').curie(':foobar', opts), namespace + 'foobar'); 85 | } catch (e) { 86 | ok(false, 'should not give an error'); 87 | } 88 | }); 89 | 90 | test("CURIE with no prefix (but with a colon) when there is no reserved namespace", function() { 91 | var opts = {reserved: [], reservedNamespace: null, defaultNamespace: null}; 92 | try { 93 | var curie = $('html').curie('foobar', opts); 94 | ok(false, 'should give an error'); 95 | } catch (e) { 96 | ok(true, 'should give an error'); 97 | } 98 | }); 99 | 100 | module("Safe CURIE resolution"); 101 | 102 | test("CURIE in square brackets", function() { 103 | equals($('body').safeCurie('[dc:creator]'), ns.dc + 'creator'); 104 | }); 105 | 106 | test("absolute URI", function() { 107 | equals($('body').safeCurie(ns.dc + 'creator'), ns.dc + 'creator'); 108 | }); 109 | 110 | module("Generating CURIEs"); 111 | 112 | test("creating a CURIE from an appropriate namespace declaration", function() { 113 | equals($('body').createCurie(ns.foaf + 'img'), 'foaf:img'); 114 | }); 115 | 116 | test("creating a CURIE in the reserved namespace", function() { 117 | equals($('body').createCurie(ns.xhv+'foo'), ':foo'); 118 | }); 119 | 120 | test("creating a CURIE in the reserved namespace with a reserved local name", function(){ 121 | equals($('body').createCurie(ns.xhv+'cite'), 'cite'); 122 | }); 123 | 124 | })(jQuery); -------------------------------------------------------------------------------- /tests/jquery.datatype.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.datatypes.js unit tests 3 | */ 4 | (function($){ 5 | 6 | var xsdNs = "http://www.w3.org/2001/XMLSchema#"; 7 | 8 | module("Errors"); 9 | 10 | test("an unrecognised datatype", function() { 11 | try { 12 | var v = $.typedValue(' true ', 'http://www.w3.org/2001/XMLSchemaboolean'); // note missing # 13 | ok(true, 'it should not throw an error'); 14 | equals(v.representation, ' true '); 15 | equals(v.datatype, 'http://www.w3.org/2001/XMLSchemaboolean'); 16 | equals(v.value, 'true'); 17 | } catch (e) { 18 | ok(false, 'it should not throw an error'); 19 | } 20 | }); 21 | 22 | module("XML Schema datatypes"); 23 | 24 | test("a boolean value", function() { 25 | var v = $.typedValue('true', xsdNs + 'boolean'); 26 | equals(v.value, true); 27 | equals(v.representation, 'true'); 28 | equals(v.datatype, xsdNs + 'boolean'); 29 | }); 30 | 31 | test("a double value", function() { 32 | var v = $.typedValue('1.0e0', xsdNs + 'double'); 33 | equals(v.value, 1.0); 34 | equals(v.representation, '1.0e0'); 35 | equals(v.datatype, xsdNs + 'double'); 36 | }); 37 | 38 | test("an invalid duration", function() { 39 | try { 40 | var v = $.typedValue('P', xsdNs + 'duration'); 41 | ok(false, "should raise an error"); 42 | } catch (e) { 43 | if (e.name === 'InvalidValue') { 44 | ok(true, "should raise an error"); 45 | } else { 46 | throw e; 47 | } 48 | } 49 | }); 50 | 51 | test("a standard dateTime", function() { 52 | var v = $.typedValue('2008-10-05T21:02:00Z', xsdNs + 'dateTime'); 53 | equals(v.value, '2008-10-05T21:02:00Z'); 54 | equals(v.representation, '2008-10-05T21:02:00Z'); 55 | equals(v.datatype, xsdNs + 'dateTime'); 56 | }); 57 | 58 | test("a dateTime with a timezone", function() { 59 | var v = $.typedValue('2008-10-05T21:02:00-05:00', xsdNs + 'dateTime'); 60 | equals(v.value, '2008-10-05T21:02:00-05:00'); 61 | equals(v.representation, '2008-10-05T21:02:00-05:00'); 62 | equals(v.datatype, xsdNs + 'dateTime'); 63 | }); 64 | 65 | test("a dateTime with an invalid timezone", function() { 66 | try { 67 | $.typedValue('2008-10-05T21:02:00-15:00', xsdNs + 'dateTime'); 68 | ok(false, "should throw an error"); 69 | } catch (e) { 70 | equals(e.name, 'InvalidValue'); 71 | } 72 | }); 73 | 74 | test("a dateTime with a bad number of days in a month", function() { 75 | try { 76 | $.typedValue('2009-02-29T21:02:00', xsdNs + 'dateTime'); 77 | ok(false, "should be an error"); 78 | } catch (e) { 79 | if (e.name === 'InvalidValue') { 80 | ok(true, "should raise an error"); 81 | } else { 82 | throw e; 83 | } 84 | } 85 | }); 86 | 87 | test("a valid dateTime on a leap year", function() { 88 | try { 89 | $.typedValue('2008-02-29T21:02:00', xsdNs + 'dateTime'); 90 | ok(true, "should not be an error"); 91 | } catch (e) { 92 | if (e.name === 'InvalidValue') { 93 | ok(false, "should not raise an error"); 94 | } else { 95 | throw e; 96 | } 97 | } 98 | }); 99 | 100 | test("an invalid dateTime on a year divisible by 100", function() { 101 | try { 102 | $.typedValue('1990-02-29T21:02:00', xsdNs + 'dateTime'); 103 | ok(false, "should be an error"); 104 | } catch (e) { 105 | if (e.name === 'InvalidValue') { 106 | ok(true, "should raise an error"); 107 | } else { 108 | throw e; 109 | } 110 | } 111 | }); 112 | 113 | test("a valid dateTime on a leap year divisible by 400", function() { 114 | try { 115 | $.typedValue('2008-02-29T21:02:00', xsdNs + 'dateTime'); 116 | ok(true, "should not be an error"); 117 | } catch (e) { 118 | if (e.name === 'InvalidValue') { 119 | ok(false, "should not raise an error"); 120 | } else { 121 | throw e; 122 | } 123 | } 124 | }); 125 | 126 | test("a valid date with whitespace around it", function() { 127 | try { 128 | var date = $.typedValue(' 2009-07-13 ', xsdNs + 'date'); 129 | ok(true, "should not be an error"); 130 | equals(date.value, "2009-07-13"); 131 | } catch (e) { 132 | if (e.name === 'InvalidValue') { 133 | ok(false, "should not raise an error"); 134 | } else { 135 | throw e; 136 | } 137 | } 138 | }); 139 | 140 | })(jQuery); -------------------------------------------------------------------------------- /tests/jquery.hcard.foaf.html: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |

      jQuery hCard to foaf plugin tests

      24 | 25 |

      26 | 27 |
        28 | 29 |
        30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /tests/jquery.hcard.vcard.html: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |

        jQuery hCard to vcard plugin tests

        23 | 24 |

        25 | 26 |
          27 | 28 |
          29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tests/jquery.microdata.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.microdata.js unit tests 3 | */ 4 | (function($){ 5 | 6 | 7 | 8 | function setup(microdata) { 9 | $('#main').html(microdata); 10 | }; 11 | 12 | function testTriples (received, expected) { 13 | var i, triples = received.databank.triples(); 14 | equals(triples.length, expected.length, 'there should be ' + expected.length + ' triples'); 15 | if (triples.length >= expected.length) { 16 | for (i = 0; i < expected.length; i += 1) { 17 | equals(triples[i].toString(), expected[i].toString()); 18 | } 19 | for (i; i < triples.length; i += 1) { 20 | ok(false, 'also got ' + triples[i].toString()); 21 | } 22 | } else { 23 | for (i = 0; i < triples.length; i += 1) { 24 | equals(triples[i].toString(), expected[i].toString()); 25 | } 26 | for (i; i < expected.length; i += 1) { 27 | ok(false, 'did not get ' + expected[i].toString()); 28 | } 29 | } 30 | }; 31 | 32 | 33 | 34 | module("Parsing Tests"); 35 | 36 | test("Simple parsing test!", function () { 37 | var main = $('
          ' + 38 | '

          1

          ' + 39 | '

          2

          ' + 40 | '

          2

          ' + 41 | '

          test

          ' + 42 | '
          '); 43 | var rdf = main.microdata(); 44 | equals(rdf.databank.size(), 4); 45 | }); 46 | 47 | test("Complex parsing test, based on http://schema.org", function () { 48 | var main = $('
          ' + 49 | 'Jane Doe' + 50 | '' + 51 | 'Professor' + 52 | 'This here is a dummy that should not get processed!' + 53 | 'This here is a dummy that should get processed!' + 54 | '
          ' + 55 | ' ' + 56 | ' 20341 Whitworth Institute' + 57 | ' 405 N. Whitworth' + 58 | ' ' + 59 | ' Seattle,' + 60 | ' WA' + 61 | ' 98052' + 62 | '
          ' + 63 | '(425) 123-4567' + 64 | '' + 65 | ' jane-doe@xyz.edu' + 66 | 'Jane\'s home page:' + 67 | '' + 68 | 'Graduate students:' + 69 | '' + 70 | ' Alice Jones' + 71 | '' + 72 | ' Bob Smith' + 73 | '
          '); 74 | var rdf = main.microdata(); 75 | equals(rdf.databank.size(), 16); 76 | }); 77 | 78 | test("Most-Complex parsing test", function () { 79 | var main = $('
          ' + 80 | 'Jane Doe' + 81 | 'Jane Doe2' + 82 | 'Jane Doe' + 83 | '' + 84 | '
          ' + 85 | '
          ' + 86 | ' Outside the house is a mailbox. It has a leaflet inside.' + 87 | '
          The mailbox.
          ' + 88 | '
          ' + 89 | '
          ' + 90 | '

          All images licensed under the ' + 91 | 'MIT license' + 92 | '.

          ' + 93 | '
          '); 94 | var rdf = main.microdata(); 95 | equals(rdf.databank.size(), 12); 96 | }); 97 | 98 | module("Performance Tests"); 99 | 100 | test("multiple elements with about and property attributes", function () { 101 | var i, main = $('#main'); 102 | for (i = 0; i < 100; i += 1) { 103 | main.append('
          '+ 104 | '

          Person ' + i + '

          '); 105 | } 106 | var t1 = new Date(); 107 | main.microdata();//???? 108 | var t2 = new Date(); 109 | var d = t2 - t1; 110 | ok(d < 1000, "it should parse in less than a second: " + d); 111 | $('#main > *').remove(); 112 | $('#main').removeData('microdata.triples');//???????????? 113 | }); 114 | 115 | test("multiple elements with about, rel and resource attributes", function () { 116 | var i, main = $('#main'); 117 | for (i = 0; i < 100; i += 1) { 118 | main.append('
          '+ 119 | '

          '+ 120 | '

          Paragraph ' + i + '
          '+ 122 | '
          '); 123 | } 124 | var t1 = new Date(); 125 | main.microdata();//????? 126 | var t2 = new Date(); 127 | var d = t2 - t1; 128 | ok(d < 1000, "it should parse in less than a second: " + d); 129 | $('#main > *').remove(); 130 | $('#main').removeData('micordata.triples');//???????? 131 | }); 132 | 133 | module("RDF Gleaner"); 134 | 135 | test("Test 0001", function() { 136 | setup('
          '+ 137 | '

          This photo was taken by '+ 138 | '

          '+ 139 | '
          '); 140 | testTriples($('#main > p > span').rdf(), 141 | [$.rdf.triple(' dc:creator "Mark Birbeck" .', ns)]);//?????? 142 | $('#main > p').remove(); 143 | }); 144 | 145 | 146 | test("With a callback", function() { 147 | setup('
          '+ 148 | '

          This photo was taken by Mark Birbeck.

          '); 149 | testTriples( 150 | $('#main > p > a').rdf(function () { 151 | if (this.subject.value.toString() === 'http://www.blogger.com/profile/1109404') { 152 | return this; 153 | } 154 | }), 155 | [$.rdf.triple(' foaf:img ', ns)] 156 | ); 157 | $('#main > p').remove(); 158 | }); 159 | 160 | })(jQuery); -------------------------------------------------------------------------------- /tests/jquery.xfn.foaf.html: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |

          jQuery XFN plugin tests

          24 | 25 |

          26 | 27 |
            28 | 29 |
            30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /tests/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Test suite for automatic testing with Rhino. For launching 3 | * the test suite in a browser, open index.html instead. 4 | */ 5 | 6 | // init simulated browser environment 7 | load("lib/env-js/env.rhino.js"); 8 | 9 | window.onload = function(){ 10 | 11 | // Load jquery, juice and the test runner 12 | load("jquery/jquery-1.3.2.js"); 13 | load("jquery.uri.js"); 14 | load("jquery.xmlns.js"); 15 | load("jquery.datatype.js"); 16 | load("jquery.curie.js"); 17 | load("jquery.rdf.js"); 18 | load("jquery.rdfa.js"); 19 | 20 | load("lib/env-js/testrunner.js"); 21 | 22 | //var start = new Date().getTime(); 23 | 24 | // Load the tests 25 | load("tests/jquery.curie.js") 26 | 27 | 28 | //var end = new Date().getTime(); 29 | 30 | // Display the results 31 | results(); 32 | 33 | //print("\n\nTOTAL TIME : " + (end - start)/1000 + " SECONDS"); 34 | }; 35 | 36 | 37 | // load HTML page 38 | window.location = "tests/jquery.alltests.html"; 39 | -------------------------------------------------------------------------------- /version.txt: -------------------------------------------------------------------------------- 1 | 1.0 --------------------------------------------------------------------------------