I am trying to impliment an addon that works in the context menu.
An abbreviated set the menu would look like this:
BBCWX (top level menu of the addon)
|
_____bbCode (This sub menu covers bbCode tags)
|
____________Clipboard (Operations involving the contents of the clipboard)
|
__________Paste as Quote (Requests an author, but ignore that)
|
__________Paste as Code
|
__________Paste as unordered list
I can assign this to a table of values for the different menu options, with the a tabular object, where we could be calling out a unique MenuID, a Title, a Parent Menu, and code to be executed by some other function when the menu item is clicked.
Something like this:
var defaultMenu = [
{MenuID: "bbcwbx.bbcode", title: browser.i18n.getMessage(bbcwbx.bbcode), Parent: "", ParseCode: ""
{MenuID: "bbcwbx.bbcode.clp", title: browser.i18n.getMessage(bbcwbx.bbcode.clp), Parent: "bbcwbx.bbcode", ParseCode: ""
{MenuID: "bbcwbx.bbcode.clp.quote", title: browser.i18n.getMessage(bbcwbx.bbcode.clp.quote), Parent: "bbcwbx.bbcode.clp", ParseCode: "[quote{{popup}}"Please insert author name or leave empty:"}}]{{clipboard}}[/quote]"
{MenuID: "bbcwbx.bbcode.clp.code", title: browser.i18n.getMessage(bbcwbx.bbcode.clp.code), Parent: "bbcwbx.bbcode.clp", ParseCode: "[code]{{clipboard}}[/code]"
{MenuID: "bbcwbx.bbcode.clp.list", title: browser.i18n.getMessage(bbcwbx.bbcode.clp.list), Parent: "bbcwbx.bbcode.clp", ParseCode: "{{list{{clipboard}},"bbCode"}}"
]
This is a relatively clear notation, and it also provides a framework into which user defined tags can be appended to the end relatively easily.
I have seen an example of this out there, but I am having problems googling examples, because I am unclear as to what is is ordinarily called.
Is there anything fundamentally flawed with this approach?
The data table in question could end up with more than 200 rows depending on how many custom tags the user defines, so I am concerned about this potentially bogging down the browser.