Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/appcelerator/titanium_mobil…

…e into timob-10000
  • Loading branch information...
commit 773f094fa1420e7697e8930d9b64448a8427f346 2 parents 8beee2d + 0e4bacd
@vishalduggal vishalduggal authored
View
4 apidoc/docgen.py
@@ -517,6 +517,10 @@ def __init__(self, api_obj, annotated_parent):
self.parent = annotated_parent
self.typestr = "parameter"
self.yaml_source_folder = self.parent.yaml_source_folder
+ if "repeatable" in api_obj:
+ self.repeatable = api_obj["repeatable"]
+ else:
+ self.repeatable = None
class AnnotatedProperty(AnnotatedApi):
def __init__(self, api_obj, annotated_parent):
View
9 apidoc/generators/jsca_generator.py
@@ -135,11 +135,18 @@ def to_jsca_method_parameter(p):
type_in_method_name = p.parent.name.replace("create", "")
if len(type_in_method_name) > 0 and type_in_method_name == method_return_type.split(".")[-1]:
data_type = to_jsca_type_name(method_return_type)
+ usage = "required"
+
+ if "optional" in p.api_obj and p.api_obj["optional"]:
+ usage = "optional"
+ elif p.repeatable:
+ usage = "one-or-more"
+
result = {
"name": p.name,
"description": "" if "summary" not in p.api_obj else to_jsca_description(p.api_obj["summary"]),
"type": data_type,
- "usage": "optional" if "optional" in p.api_obj and p.api_obj["optional"] else "required"
+ "usage": usage
}
return to_ordered_dict(result, ('name',))
View
13 apidoc/templates/html/member_list.html
@@ -19,6 +19,12 @@
<% platform_names = ", ".join([p["pretty_name"] for p in item.platforms]) %>
<% append_cell_class = " deprecated" if item.deprecated else "" %>
<%
+ if hasattr(item, "repeatable") and item.repeatable:
+ item_name = "%s..." % item.name
+ else:
+ item_name = item.name
+ %>
+ <%
summary = item.summary_html
was_para_close = False
if summary.endswith("</p>"):
@@ -28,9 +34,9 @@
<tr class="${row_class}">
% if item.typestr=="parameter" or (item.typestr=="property" and item.parent.typestr=="event"):
- <td class="name${append_cell_class}">${item.name}</td>
+ <td class="name${append_cell_class}">${item_name}</td>
% else:
- <td class="name${append_cell_class}"><a href="${item.filename_html}.html">${item.name}</a></td>
+ <td class="name${append_cell_class}"><a href="${item.filename_html}.html">${item_name}</a></td>
% endif
% if is_property_list:
<td class="type${append_cell_class}">${item.type_html}</td>
@@ -56,6 +62,9 @@
% if item.optional is not None:
<span class="optional">Optional.</span>
% endif
+ % if item.repeatable:
+ <span class="optional">Repeatable.</span>
+ % endif
% if item.default is not None:
<%
if item.default_html.startswith("<p>"):
View
5 apidoc/validate.py
@@ -31,7 +31,7 @@
"events"],
"method": ["name", "summary", "description", "returns", "platforms", "since",
"deprecated", "osver", "examples", "parameters"],
- "parameter": ["name", "summary", "type", "optional", "default"],
+ "parameter": ["name", "summary", "type", "optional", "default", "repeatable"],
"property": ["name", "summary", "description", "type", "platforms", "since",
"deprecated", "osver", "examples", "permission", "availability", "accessors",
"optional", "value", "default"],
@@ -315,6 +315,9 @@ def validateCommon(tracker, map):
if 'optional' in map:
validateIsBool(tracker, 'optional', map['optional'])
+ if 'repeatable' in map:
+ validateIsBool(tracker, 'repeatable', map['repeatable'])
+
if 'notes' in map:
tracker.trackError('"notes" field is no longer valid')
Please sign in to comment.
Something went wrong with that request. Please try again.