-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmenu.js
More file actions
35 lines (29 loc) · 719 Bytes
/
menu.js
File metadata and controls
35 lines (29 loc) · 719 Bytes
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
/***
* Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
* @author babin
*
*/
function ContentMenuFactory() {
this.create = function(name,id) {
return new SelectionContextMenu(name,id);
};
}
/***
* Provide an impl or instance of selection context menu
* @author babin
*
*/
function SelectionContextMenu(name,id) {
this.name = name;
this.id=id;
chrome.contextMenus.create( {
title: this.name,
id: this.id,
contexts: ['selection']
});
chrome.contextMenus.create({
type: "separator",
id: new String(this.id).concat('seperator'),
contexts: ['all']
});
}