extension work

This commit is contained in:
Will Bamberg
2015-09-14 16:49:43 -07:00
parent 1c5962365d
commit 11fe52f05a
7 changed files with 67 additions and 14 deletions
+20
View File
@@ -0,0 +1,20 @@
html, body {
height: 100px;
width: 300px;
margin: 0;
}
.action {
height: 30%;
width: 90%;
margin: 3% auto;
padding-top: 6%;
text-align: center;
font-size: 1.5em;
background-color: #E5F2F2;
cursor: pointer;
}
.action:hover {
background-color: #CFF2F2;
}
+16
View File
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="choose_action.css"/>
</head>
<body>
<div class="action">highlight-para</div>
<div class="action">show-foo</div>
<div class="action">call-confirm</div>
<script src="choose_action.js"></script>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
document.addEventListener("click", function(e) {
if (!e.target.classList.contains("action")) {
return;
}
var chosenAction = e.target.textContent;
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].id, {name: chosenAction});
});
});