File: notes.org

package info (click to toggle)
node-mj-context-menu 0.6.1%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,848 kB
  • sloc: javascript: 2,165; sh: 35; makefile: 5
file content (81 lines) | stat: -rw-r--r-- 2,609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Let's keep things simple:

* Events
  Provide one function to register the event(s) with an element.
** Keyboard events
** Mouse events
** 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
**** Item_Checkbox:  checkbox 

* 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


* Some Typescript things:
** 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;\ |
 |                       |                  |      |        |

* tslint

  Future: "file-header": true,

        "member-access": true,


* Soure maps

** 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"



* TODO Change name of element type to stop shadowing DOM element.

* TODO Submenu vs SubMenu. The former should be SubmenuItem?

* TODO Make use of string enums

* TODO Change type coercion to new syntax