Parse olx.js and convert types into typedef properties
This commit is contained in:
committed by
Tim Schaub
parent
9e33672503
commit
04a33220a8
@@ -13,7 +13,8 @@
|
|||||||
"src/googx/dom/fullscreen.js"
|
"src/googx/dom/fullscreen.js"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"src"
|
"src",
|
||||||
|
"externs/olx.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|||||||
@@ -58,18 +58,8 @@ exports.handlers = {
|
|||||||
|
|
||||||
newDoclet: function(e) {
|
newDoclet: function(e) {
|
||||||
var i, ii, j, jj;
|
var i, ii, j, jj;
|
||||||
if (e.doclet.meta.filename == "objectliterals.jsdoc" && e.doclet.properties) {
|
if (e.doclet.meta.filename == "olx.js" && e.doclet.longname != 'olx') {
|
||||||
for (i = 0, ii = e.doclet.properties.length; i < ii; ++i) {
|
api.push(e.doclet.longname);
|
||||||
if (e.doclet.properties[i].type && e.doclet.properties[i].type.names) {
|
|
||||||
for (j = 0, jj = e.doclet.properties[i].type.names.length; j < jj; ++j) {
|
|
||||||
if (e.doclet.properties[i].type.names[j].indexOf('ol') == 0) {
|
|
||||||
if (api.indexOf(e.doclet.properties[i].type.names[j]) === -1) {
|
|
||||||
api.push(e.doclet.properties[i].type.names[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (api.indexOf(e.doclet.longname) > -1) {
|
if (api.indexOf(e.doclet.longname) > -1) {
|
||||||
var names, name;
|
var names, name;
|
||||||
@@ -102,6 +92,18 @@ exports.handlers = {
|
|||||||
parseComplete: function(e) {
|
parseComplete: function(e) {
|
||||||
for (var j = e.doclets.length - 1; j >= 0; --j) {
|
for (var j = e.doclets.length - 1; j >= 0; --j) {
|
||||||
var doclet = e.doclets[j];
|
var doclet = e.doclets[j];
|
||||||
|
if (doclet.meta.filename == 'olx.js' && doclet.kind == 'typedef') {
|
||||||
|
for (var i = e.doclets.length - 1; i >= 0; --i) {
|
||||||
|
var propertyDoclet = e.doclets[i];
|
||||||
|
if (propertyDoclet.memberof == doclet.longname) {
|
||||||
|
if (!doclet.properties) {
|
||||||
|
doclet.properties = [];
|
||||||
|
}
|
||||||
|
doclet.properties.unshift(propertyDoclet);
|
||||||
|
e.doclets.splice(i, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (doclet.kind == 'namespace' || doclet.kind == 'event' || doclet.fires) {
|
if (doclet.kind == 'namespace' || doclet.kind == 'event' || doclet.fires) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user