adding extension icon popup functionality

This commit is contained in:
qt31415926
2015-04-02 21:49:49 -04:00
parent c10d0410d5
commit 7986700f14
5 changed files with 31 additions and 12 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ blockService.set(DefaultList);
blockList = blockService.get();
blockChecker = new BlockCheck(DefaultList);
var currTabs = []; //TODO bugfix
var currTabs = []; //TODO add additional information to these objects, e.g. time
var prevSite = "";
chrome.webRequest.onBeforeRequest.addListener(
+7
View File
@@ -0,0 +1,7 @@
//Listener for Disable
$(function(){
$("#enable_button").click(function(){
console.log("button is pressed");
});
});
-10
View File
@@ -29,11 +29,9 @@ window.onload = function setupUpdater(){
var newText=input.value;
var score = a.get(newText)[0][0];
if (score>0.88) {
//debug set(count, "You are " + score*100 + "% accurate (need >91)");
passed = true;
return;
} else if (score> 0.1){
//debug set(count, "You are " + score*100 + "% accurate (need >91)");
}
}
@@ -50,17 +48,9 @@ var activate = function(){
active: true,
windowId: window.id
}, function (tabs, req){
/* console.log("GPS CWGC tabs");
console.log(tabs);
console.log("GPS CWGC tabs[0]");
console.log(tabs[0]);
console.log("GPS CWGC currTabs");
console.log(currTabs);*/
result = $.grep(currTabs, function(e){
return e.tabId == tabs[0].id;
});
/* console.log("result");
console.log(result);*/
req = result;
if (req.length==0){
return "";
+2 -1
View File
@@ -10,7 +10,8 @@
"browser_action": {
"default_icon": "img/128.png",
"default_title": "MAD"
"default_title": "MAD",
"default_popup": "popup.html"
},
"web_accessible_resources":[
+21
View File
@@ -0,0 +1,21 @@
<html>
<head>
<script src="js/jquery.min.js"></script>
<script src="js/popup.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/main.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
</head>
<body style="width:150px">
<div> Yo Swag Son: </div>
<div id="enabler">
<input id="enable_button" class="btn btn-primary" type="submit" value="Don't Kill My Vibe"> </input> </div>
<div id="blacklist">
<input id="blacklist_button" class="btn btn-primary" type="submit" value="This shit aint cool."> </input></div>
<div id="whitelist">
<input id="whitelist_button" class="btn btn-primary" type="submit" value="This shit ballin"> </input></div>
</body>
</html>