From f0aa0f8b53930789c5938a93140a34c02f0fddf9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 7 Dec 2010 02:08:30 +0100 Subject: [PATCH] no need for standardMethods anymore --- docs/api.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/api.js b/docs/api.js index 12c142db..127acdc5 100644 --- a/docs/api.js +++ b/docs/api.js @@ -205,9 +205,6 @@ function getDocsJSON() { return ret; function getDoc(key) { - var standardElement = new Ox.Element(); - var standardMethods = Ox.filter(Ox.keys(standardElement), function(m) { return typeof standardElement[m] === 'function' }); - //FIXME: eventually we want to document all Ox values and functions if (!/^[A-Z][a-z]/.test(key)) { return false @@ -219,7 +216,6 @@ function getDocsJSON() { 'functionString': functionString } } - var functionString = Ox[key].toString(); try { var o = new Ox[key](); } catch(err) { @@ -232,6 +228,7 @@ function getDocsJSON() { var opts = {}; if ('options' in o && typeof o['options'] == 'function') { var opts = o.options(); + //only inclue methods that are defined in the function var _methods = Ox.filter(Ox.keys(o), function(m) { return (functionString.indexOf('that.'+m+' =') > -1 && typeof o[m] === 'function')}); $.each(_methods, function(i, m) { methods[m] = o[m].toString() }); }