-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
33 lines (29 loc) · 891 Bytes
/
index.js
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
var cm = require("sdk/context-menu");
// represent our leaves in the menu
function Entry(label){
this.label = label;
this.data = label;
this.context = cm.SelectorContext("textarea, div, input");
this.contentScriptFile = "./content-script.js";
this.contentScriptWhen = "end";
}
// represents a submenu
function SubMenu(label, arrEntries){
this.label = label;
this.context = cm.SelectorContext("textarea, div, input");
this.items = function(arr){
var items = [];
for( id in arr){
items.push( cm.Item( new Entry(arr[id]) ) );
}
return items;
}(arrEntries);
}
cm.Menu({
label: "SEMAT",
items: [
cm.Menu( new SubMenu("Way of Working", ["Principles Established", "Foundation Established", "In Use"]) ),
cm.Menu( new SubMenu("Team", ["Seeded", "Formed", "Collaborating"]) ),
],
context: cm.SelectorContext("textarea, div, input")
});