-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
let lightbox = function(objOption){ | ||
let domDiv = document.createElement('div'); | ||
domDiv.setAttribute('style', 'position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, .8);'); | ||
domDiv.style.display = 'none'; | ||
domDiv.addEventListener('click', function(){ | ||
domDiv.style.display = 'none'; | ||
}); | ||
let domTable = document.createElement('table'); | ||
let domTr = document.createElement('tr'); | ||
let domTd = document.createElement('td'); | ||
domTable.setAttribute('style', 'width:100%;height:100%;'); | ||
domTd.setAttribute('style', 'vertical-align:middle; text-align:center;'); | ||
|
||
domTd.appendChild(objOption.contentNode); | ||
domTr.appendChild(domTd); | ||
domTable.appendChild(domTr); | ||
domDiv.appendChild(domTable); | ||
document.body.appendChild(domDiv); | ||
if(objOption.opener){ | ||
objOption.opener.addEventListener('click', function(){ | ||
domDiv.style.display = 'inline'; | ||
}); | ||
}else{ | ||
domDiv.style.display = 'inline'; | ||
} | ||
|
||
return domDiv; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4f8f8ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I'm trying to developt a webextension for firefox, I'm new to this, I would like to know how to generate another item in the context menu. It seems that just one is allowed but I guess it has to be with the id, but I used diferent names. Good work by the way. Thanks for share the code. If you want to check the addon I'm working on is "Textise-it".