Skip to content
Browse files

2009 -> 2010

  • Loading branch information...
1 parent 99e77a8 commit cf62eebf2d16d2584d7ebd087df9b39e4780cdb2 Adam Moore committed Jan 6, 2010
Showing with 86 additions and 26 deletions.
  1. +1 −1 bin/const.py
  2. +1 −1 bin/yuidoc.py
  3. +56 −7 bin/yuidoc_generate.py
  4. +1 −1 bin/yuidoc_highlight.py
  5. +1 −1 bin/yuidoc_parse.py
  6. +1 −1 license.txt
  7. +21 −13 template/assets/ac-js
  8. +4 −1 template/main.tmpl
View
2 bin/const.py
@@ -1,5 +1,5 @@
'''
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.html
version: 1.0.0b1
View
2 bin/yuidoc.py
@@ -3,7 +3,7 @@
# vim: et sw=4 ts=4
'''
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.html
version: 1.0.0b1
View
63 bin/yuidoc_generate.py
@@ -3,7 +3,7 @@
# vim: et sw=4 ts=4
'''
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.html
version: 1.0.0b1
@@ -103,6 +103,8 @@ def _mkdir(newdir):
self.classnames = ""
self.filenames = ""
self.allprops = []
+ self.allprops_ext = []
+
def cleanseStr(self, strg):
cleanregex= re.compile(r"[^\w\-]")
@@ -274,6 +276,31 @@ def allprop_sort(x, y):
cy = pat.sub('', cy)
return cmp(cx, cy)
+ def completeProp(main, ext):
+ data = main.copy()
+ if DESCRIPTION in ext:
+ data[DESCRIPTION] = ext[DESCRIPTION]
+ else:
+ data[DESCRIPTION] = ''
+
+ if PARAMS in ext:
+ params = ext[PARAMS]
+ count = 0
+ result = []
+ itemtemplate = '%s <%s> %s'
+ for p in params:
+ if count > 0:
+ result.append(', ')
+ result.append(itemtemplate % (p[NAME] or 'unknown', p[TYPE] or 'Object', p[DESCRIPTION] or ''))
+ count+=1
+
+ data[PARAMS] = ''.join(result)
+ else:
+ data[PARAMS] = ''
+
+ return data
+
+
log.info("-------------------------------------------------------")
# copy the json file
@@ -391,14 +418,21 @@ def allprop_sort(x, y):
for propertykey in keys:
prop = c[PROPERTIES][propertykey]
if self.showprivate or PRIVATE not in prop:
- propdata = {NAME: propertykey, HOST: i, TYPE: 'property', URL:getUrl(i, propertykey, PROPERTY)}
-
+ propdata = {
+ NAME: propertykey,
+ HOST: i,
+ TYPE: 'property',
+ URL: getUrl(i, propertykey, PROPERTY)
+ }
transferToDict( ACCESS, prop, propdata )
if PRIVATE in prop: propdata[ACCESS] = PRIVATE
elif PROTECTED in prop: propdata[ACCESS] = PROTECTED
self.allprops.append(propdata.copy())
+ # completeProp(propdata, prop)
+ self.allprops_ext.append(completeProp(propdata, prop))
+
moduleprops.append(propdata.copy())
transferToDict( TYPE, prop, propdata, OBJECT )
@@ -428,6 +462,8 @@ def allprop_sort(x, y):
elif PROTECTED in method: methoddata[ACCESS] = PROTECTED
self.allprops.append(methoddata.copy())
+ # completeProp(methodData, method)
+ self.allprops_ext.append(completeProp(methoddata, method))
moduleprops.append(methoddata.copy())
transferToDict( DESCRIPTION, method, methoddata )
@@ -466,13 +502,21 @@ def allprop_sort(x, y):
for eventkey in keys:
event = c[EVENTS][eventkey]
if self.showprivate or PRIVATE not in event:
- eventdata = {NAME: eventkey, HOST: i, TYPE: 'event', URL:getUrl(i, eventkey, EVENT)}
+ eventdata = {
+ NAME: eventkey,
+ HOST: i,
+ TYPE: 'event',
+ URL: getUrl(i, eventkey, EVENT)
+ }
transferToDict( ACCESS, event, eventdata )
if PRIVATE in event: eventdata[ACCESS] = PRIVATE
elif PROTECTED in event: eventdata[ACCESS] = PROTECTED
self.allprops.append(eventdata.copy())
+ # completeProp(eventdata, event)
+ self.allprops_ext.append(completeProp(eventdata, event))
+
moduleprops.append(eventdata.copy())
transferToDict( DESCRIPTION, event, eventdata )
@@ -495,8 +539,6 @@ def allprop_sort(x, y):
transferToDict( CANCELABLE, event, eventdata )
if CANCELABLE in event: eventdata[CANCELABLE] = CANCELABLE
-
-
params = eventdata[PARAMS] = []
if PARAMS in event:
mp = event[PARAMS]
@@ -524,6 +566,10 @@ def allprop_sort(x, y):
elif PROTECTED in config: configdata[ACCESS] = PROTECTED
self.allprops.append(configdata.copy())
+
+ # completeProp(configdata, config)
+ self.allprops_ext.append(completeProp(configdata, config))
+
moduleprops.append(configdata.copy())
transferToDict( TYPE, config, configdata, OBJECT )
@@ -626,13 +672,16 @@ def allprop_sort(x, y):
#remove dups
allprops = []
propmap = {}
- for i in self.allprops:
+ # for i in self.allprops:
+ for i in self.allprops_ext:
url = i[URL]
if url not in propmap:
allprops.append(i)
propmap[url] = True
allprops.sort(allprop_sort)
+
+ # self.allprops_ext.sort(allprop_sort)
allprops_json = simplejson.dumps(allprops, ensure_ascii=False)
self.write("index.json", allprops_json, False)
View
2 bin/yuidoc_highlight.py
@@ -3,7 +3,7 @@
# vim: et sw=4 ts=4
'''
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.html
version: 1.0.0b1
View
2 bin/yuidoc_parse.py
@@ -3,7 +3,7 @@
# vim: et sw=4 ts=4
'''
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.html
version: 1.0.0b1
View
2 license.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
Redistribution and use of this software in source and binary forms, with or
View
34 template/assets/ac-js
@@ -12,13 +12,22 @@
ITEM_TEMPLATE = '<em>{host}</em> <span>{name}</span>',
// ITEM_TEMPLATE = '<em>{host}</em> <span>{params}</span> <span>{name}</span>',
// ITEM_TEMPLATE = '<em>{host}</em> <span>{params}</span> <span>{name}</span><div>{description}</div>',
- yuidoc = YAHOO.namespace('yuidoc');
-
-yuidoc.init = function() {
+ yuidoc = YAHOO.namespace('yuidoc'),
+ propdata,
+ initialized = false;
+yuidoc.init = function(altdata) {
+ yuidoc.initUI(altdata);
};
-yuidoc.initUI = function() {
+yuidoc.initUI = function(altdata) {
+
+ if (initialized) {
+ return;
+ }
+
+ propdata = ALL_YUI_PROPS || altdata;
+
//Checkboxes are available..
var handleClick = function(e) {
var id, checked = false;
@@ -75,14 +84,10 @@ yuidoc.initUI = function() {
//Starting the AutoComplete code
var getResults = function(query) {
var results = [];
- if(query && query.length > 0) {
-
+ if (query && query.length > 0) {
var q = query.toLowerCase();
-
- for (var i=0, len=ALL_YUI_PROPS.length; i<len; ++i) {
-
- var prop = ALL_YUI_PROPS[i];
-
+ for (var i=0, len=propdata.length; i<len; ++i) {
+ var prop = propdata[i];
if (!show['protected'] && prop.access == "protected") {
// skip
} else if (!show['private'] && prop.access == "private") {
@@ -156,15 +161,18 @@ yuidoc.initUI = function() {
YAHOO.util.Event.onAvailable('classTab', function() {
var tabs = new YAHOO.widget.TabView('classTab');
});
+
/*
YAHOO.util.Event.onAvailable('codeTree', function() {
var tree1 = new YAHOO.widget.TreeView('codeTree');
tree1.render();
});
*/
- YAHOO.util.Event.onAvailable('show_private', function() {
- YAHOO.yuidoc.initUI();
+ YAHOO.util.Event.onDOMReady(function() {
+ if (typeof ALL_YUI_PROPS != "undefined") {
+ YAHOO.yuidoc.initUI();
+ });
@evocateur
evocateur added a note Jan 13, 2010

The trailing ); on this line causes a syntax error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
});
})();
View
5 template/main.tmpl
@@ -675,8 +675,11 @@
</div>
</div>
<script type="text/javascript">
+ #if $indexasdfsdfa
@evocateur
evocateur added a note Jan 13, 2010

The $indexasdfsdfa variable should be $index here, as the former does not exist in bin/yuidoc_generate.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ YAHOO.yuidoc.init();
+ #end if
+
var ALL_YUI_PROPS = $allprops;
- YAHOO.yuidoc.init();
</script>
#if $ydn
<!-- Yahoo! Web Analytics - All rights reserved -->

0 comments on commit cf62eeb

Please sign in to comment.
Something went wrong with that request. Please try again.