Let’s keep things simple:
Provide one function to register the event(s) with an element.
Touch events (to implement later)
Navigatable: Element with key events etc. Has an html element, role, class
Menu: Abstract class of Menus
Context_Menu
Sub_Menu
Entry: Abstract class of Menu Entries
Item_Rule: Separator rule item (From entry)
Item_Label: Command executing item (From entry)
Item: Abstract class of items with mouse events
Item_Command: Command executing item
Item_Submenu: Submenu item
Item_Radio: Radiobutton item
Menu Structure in HTML
MenuFrame: Transparent element on the entire page to ensure menu can be closed.
Outer div attached to the page.
Inner div covering the entire page.
Menu: Basic element holding one entire context menu.
MenuItem: Single items in the context menu.
Attaching the Menu
General container element that contains the node -> menu maps.
Shift left - right: Get to previous/next element.
Only if in top level menu.
If on submenu element, right should open the submenu
Return types can be omitted in method implementation if they are given in the interface specification.
Getting around the this problem in callbacks:
https://github.com/Microsoft/TypeScript/wiki/’this’-in-TypeScript
Script for extracting basics of the class hierarchy
grep export *.ts | grep -v function | awk -F\: ‘{print $2}’ | sed s/’ export’//g | sed s/{//g | sort > ../../classes.txt
Script for extracting class names
for i in *.ts; do\
echo; echo ‘---------------‘; echo $i:; echo;\
grep -e ‘: [A-Z]’ $i | grep -v TODO| sed s/’^.*: \([A-Z]\)’\1 | sed s/[^a-zA-Z].*$//g | grep -e ‘^[A-Z]’ | sort | uniq;\
done
sed s/[^a-zA-Z].*$//g grep -e ‘^[A-Z]’ sort uniq;\
Future: “file-header”: true,
“member-access”: true,
Compile with –sourceMap flag or sourceMap: true in config file.
URL’s relative for ts and map files.
Absolute: mapRoot and sourceRoot
tsconfig.json insertion:
// “sourceRoot”: “http://zorkow.github.io/context-menu/scripts/ts/ ”,
// “mapRoot”: “http://82.47.250.18/context-menu/scripts/js/ ”,
// “outDir”: “scripts/js”
Change name of element type to stop shadowing DOM element.
Submenu vs SubMenu. The former should be SubmenuItem?
Change type coercion to new syntax