Skip to content

Commit

Permalink
add backport info and fix wrong permission
Browse files Browse the repository at this point in the history
  • Loading branch information
jobisoft committed Jan 28, 2021
1 parent 5b64ff1 commit 009d936
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 38 deletions.
4 changes: 2 additions & 2 deletions accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Returns details of the requested account, or null if it doesn't exist.
getDefault()
------------

.. api-section-annotation-hack:: -- [Added in TB 85]
.. api-section-annotation-hack:: -- [Added in TB 85, backported to TB 78.7]

Returns the default account, or null if it is not defined.

Expand Down Expand Up @@ -135,7 +135,7 @@ Sets the default identity for an account.
getDefaultIdentity(accountId)
-----------------------------

.. api-section-annotation-hack:: -- [Added in TB 85]
.. api-section-annotation-hack:: -- [Added in TB 85, backported to TB 78.7]

Returns the default identity for an account, or null if it is not defined.

Expand Down
6 changes: 3 additions & 3 deletions browserAction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Manifest file properties
.. api-member::
:name: [``default_label``]
:type: (string)
:annotation: -- [Added in TB 84.0b3]
:annotation: -- [Added in TB 84.0b3, backported to TB 78.6.1]


.. api-member::
Expand Down Expand Up @@ -134,7 +134,7 @@ Gets the title of the toolbar action.
setLabel(details)
-----------------

.. api-section-annotation-hack:: -- [Added in TB 84.0b3]
.. api-section-annotation-hack:: -- [Added in TB 84.0b3, backported to TB 78.6.1]

Sets the label of the toolbar action, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.

Expand All @@ -159,7 +159,7 @@ Sets the label of the toolbar action, defaults to its title. Can be set to an em
getLabel(details)
-----------------

.. api-section-annotation-hack:: -- [Added in TB 84.0b3]
.. api-section-annotation-hack:: -- [Added in TB 84.0b3, backported to TB 78.6.1]

Gets the label of the toolbar action.

Expand Down
2 changes: 1 addition & 1 deletion compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Open a new message compose window. If the provided ComposeDetails object does no
.. api-member::
:name: [``messageId``]
:type: (integer)
:annotation: -- [Added in TB 84]
:annotation: -- [Added in TB 84, backported to TB 78.7]

If specified, the message or template to edit as a new message.

Expand Down
6 changes: 3 additions & 3 deletions composeAction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Manifest file properties
.. api-member::
:name: [``default_label``]
:type: (string)
:annotation: -- [Added in TB 84.0b3]
:annotation: -- [Added in TB 84.0b3, backported to TB 78.6.1]


.. api-member::
Expand Down Expand Up @@ -139,7 +139,7 @@ Gets the title of the toolbar action.
setLabel(details)
-----------------

.. api-section-annotation-hack:: -- [Added in TB 84.0b3]
.. api-section-annotation-hack:: -- [Added in TB 84.0b3, backported to TB 78.6.1]

Sets the label of the toolbar action, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.

Expand All @@ -164,7 +164,7 @@ Sets the label of the toolbar action, defaults to its title. Can be set to an em
getLabel(details)
-----------------

.. api-section-annotation-hack:: -- [Added in TB 84.0b3]
.. api-section-annotation-hack:: -- [Added in TB 84.0b3, backported to TB 78.6.1]

Gets the label of the toolbar action.

Expand Down
10 changes: 0 additions & 10 deletions composeScripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ __ https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/co

.. role:: permission

.. rst-class:: api-main-section

Permissions
===========

.. api-member::
:name: :permission:`messagesModify`

Read and modify your email messages as they are displayed to you

.. rst-class:: api-permission-info

.. note::
Expand Down
6 changes: 3 additions & 3 deletions messageDisplayAction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Manifest file properties
.. api-member::
:name: [``default_label``]
:type: (string)
:annotation: -- [Added in TB 84.0b3]
:annotation: -- [Added in TB 84.0b3, backported to TB 78.6.1]


.. api-member::
Expand Down Expand Up @@ -132,7 +132,7 @@ Gets the title of the toolbar action.
setLabel(details)
-----------------

.. api-section-annotation-hack:: -- [Added in TB 84.0b3]
.. api-section-annotation-hack:: -- [Added in TB 84.0b3, backported to TB 78.6.1]

Sets the label of the toolbar action, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.

Expand All @@ -157,7 +157,7 @@ Sets the label of the toolbar action, defaults to its title. Can be set to an em
getLabel(details)
-----------------

.. api-section-annotation-hack:: -- [Added in TB 84.0b3]
.. api-section-annotation-hack:: -- [Added in TB 84.0b3, backported to TB 78.6.1]

Gets the label of the toolbar action.

Expand Down
6 changes: 4 additions & 2 deletions overlay/accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@
},
{
"name": "getDefaultIdentity",
"added": "85"
"added": "85",
"backported": "78.7"
},
{
"name": "getDefault",
"added": "85"
"added": "85",
"backported": "78.7"
}
]
}
Expand Down
9 changes: 6 additions & 3 deletions overlay/browserAction.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"browser_action": {
"properties": {
"default_label": {
"added" : "84.0b3"
"added" : "84.0b3",
"backported" : "78.6.1"
}
}
}
Expand Down Expand Up @@ -48,11 +49,13 @@
},
{
"name": "setLabel",
"added": "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
},
{
"name": "getLabel",
"added": "84.0b3"
"added": "84.0b3",
"backported" : "78.6.1"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion overlay/compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"parameters": [
{
"name": "messageId",
"added": 84
"added": 84,
"backported": "78.7"
}
],
"returns": {
Expand Down
9 changes: 6 additions & 3 deletions overlay/composeAction.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"compose_action": {
"properties": {
"default_label": {
"added" : "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
}
}
}
Expand Down Expand Up @@ -48,11 +49,13 @@
},
{
"name": "setLabel",
"added": "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
},
{
"name": "getLabel",
"added": "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions overlay/extensionScripts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"namespace": "composeScripts",
"ignore_permissions": ["messagesModify"]
}
]
9 changes: 6 additions & 3 deletions overlay/messageDisplayAction.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"message_display_action": {
"properties": {
"default_label": {
"added" : "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
}
}
}
Expand Down Expand Up @@ -48,11 +49,13 @@
},
{
"name": "setLabel",
"added": "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
},
{
"name": "getLabel",
"added": "84.0b3"
"added": "84.0b3",
"backported": "78.6.1"
}
]
}
Expand Down
14 changes: 10 additions & 4 deletions update-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def merge_objects(a, b):
elif isinstance(a, dict):
for [e, f] in a.iteritems():
if e not in b or e in ["description"]:
if (e in b and e in ["description"]):
print("Replacing Description")
print(" comm-central: " + b[e])
print(" overlay file: " + f)
print("")
b[e] = f
continue
if e not in ["namespace", "name", "id", "$extend"]:
Expand Down Expand Up @@ -639,7 +644,7 @@ def format_namespace(namespace, manifest_namespace=None):
return "\n".join(lines).encode("utf-8")


def format_manifest_namespace(manifest):
def format_manifest_namespace(manifest, namespace):
global unique_id
#unique_id = 1

Expand Down Expand Up @@ -669,8 +674,9 @@ def format_manifest_namespace(manifest):
]:
for choice in type_["choices"]:
for value in choice["enum"]:
description = [permission_strings[value]] if value in permission_strings else None
permission_lines.extend(api_member(name=":permission:`" + value + "`", description=description))
if "ignore_permissions" not in namespace or value not in namespace["ignore_permissions"]:
description = [permission_strings[value]] if value in permission_strings else None
permission_lines.extend(api_member(name=":permission:`" + value + "`", description=description))

if len(permission_lines) > 0:
permission_lines.append("")
Expand Down Expand Up @@ -753,7 +759,7 @@ def format_manifest_namespace(manifest):
current_namespace_name = namespace["namespace"]

if "manifest" in namespaces:
manifest_namespace = format_manifest_namespace(namespaces["manifest"])
manifest_namespace = format_manifest_namespace(namespaces["manifest"], namespace)

with open(os.path.join(DEST_DIR, namespace["namespace"] + ".rst"), "w") as fp_output:
fp_output.write(format_namespace(namespace, manifest_namespace=manifest_namespace))

0 comments on commit 009d936

Please sign in to comment.