Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pulling code before merging
  • Loading branch information
keshavm02 committed Dec 3, 2018
2 parents 8a85153 + 9bfa237 commit d30ca42
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 16 deletions.
53 changes: 52 additions & 1 deletion chromeExtension/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,55 @@
// console.log("spaghetti");
// sendResponse({farewell: "goodbye"});
// chrome.tabs.goBack();
// });
// });

//
// window.onload=function(){
// console.log("page load!");
// }


chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
console.log('The request has been received from the content script.');
chrome.tabs.executeScript({
file: "js/jquery.min.js"
});
chrome.tabs.executeScript({
file: "js/webgazer.js"
});
chrome.tabs.executeScript({
file: "js/makeBackButtonOverlay.js"
});
chrome.tabs.executeScript({
file: "js/makeClickButtonOverlay.js"
});
chrome.tabs.executeScript({
file: "js/start.js"
});
});


// chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
// if (changeInfo.status == 'complete') {
//
// }
// });

//
// window.onload=function(){
// chrome.tabs.executeScript({
// file: "js/jquery.min.js"
// });
// chrome.tabs.executeScript({
// file: "js/webgazer.js"
// });
// chrome.tabs.executeScript({
// file: "js/makeBackButtonOverlay.js"
// });
// chrome.tabs.executeScript({
// file: "js/makeClickButtonOverlay.js"
// });
// chrome.tabs.executeScript({
// file: "js/start.js"
// });
// };
9 changes: 9 additions & 0 deletions chromeExtension/js/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// setTimeout(function(){ chrome.runtime.sendMessage({ from: 'content', message: 'Information from webpage.' }); }, 3000);

chrome.runtime.sendMessage(
"foo",
function( response ) {
console.log(response);
} );
// { from: 'content', message: 'Information from webpage.' });
console.log("yay sent runtime message");
30 changes: 28 additions & 2 deletions chromeExtension/js/makeBackButtonOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,41 @@ myDiv.style.border = "5px solid rgb(171, 46, 185)";
myDiv.style.opacity = "100%";
myDiv.style.borderRadius = "10px";
myDiv.style.top = "30%";
myDiv.style.left = "2%";
myDiv.style.left = "0.5%";
myDiv.style.width = "300px";
myDiv.style.height = "300px";
myDiv.style.textAlign = "center";
myDiv.style.display = "table";

myP.style.display = "table-cell";
myP.style.verticalAlign = "middle";
myP.innerText = "hover me to go back";
myP.innerText = "Hover me to go back";


document.body.appendChild(myDiv);

var topDiv = document.createElement("div");
var botDiv = document.createElement("div");

topDiv.style.background = "rgba(255, 255, 0, 0)";
topDiv.style.position = "fixed";
topDiv.style.border = "5px solid rgb(255, 255, 0)";
topDiv.style.opacity = "100%";
topDiv.style.borderRadius = "10px";
topDiv.style.top = "0%";
topDiv.style.width = "100%";
topDiv.style.height = "12%";
topDiv.style.display = "table";

botDiv.style.background = "rgba(255, 255, 0, 0)";
botDiv.style.position = "fixed";
botDiv.style.border = "5px solid rgb(255, 255, 0)";
botDiv.style.opacity = "100%";
botDiv.style.borderRadius = "10px";
botDiv.style.top = "88%";
botDiv.style.width = "100%";
botDiv.style.height = "12%";
botDiv.style.display = "table";

document.body.appendChild(topDiv);
document.body.appendChild(botDiv);
2 changes: 1 addition & 1 deletion chromeExtension/js/makeClickButtonOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ myDiv.style.display = "table";

myP.style.display = "table-cell";
myP.style.verticalAlign = "middle";
myP.innerText = "hover me to click";
myP.innerText = "Hover me to click";


document.body.appendChild(myDiv);
43 changes: 43 additions & 0 deletions chromeExtension/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,46 @@ function startWebgazer() {
document
.getElementById("start-webgazer")
.addEventListener("click", startWebgazer);





// chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
// if (changeInfo.status == 'complete') {
// chrome.tabs.executeScript({
// file: "js/jquery.min.js"
// });
// chrome.tabs.executeScript({
// file: "js/webgazer.js"
// });
// chrome.tabs.executeScript({
// file: "js/makeBackButtonOverlay.js"
// });
// chrome.tabs.executeScript({
// file: "js/makeClickButtonOverlay.js"
// });
// chrome.tabs.executeScript({
// file: "js/start.js"
// });
// }
// });


// window.onload=function(){
// chrome.tabs.executeScript({
// file: "js/jquery.min.js"
// });
// chrome.tabs.executeScript({
// file: "js/webgazer.js"
// });
// chrome.tabs.executeScript({
// file: "js/makeBackButtonOverlay.js"
// });
// chrome.tabs.executeScript({
// file: "js/makeClickButtonOverlay.js"
// });
// chrome.tabs.executeScript({
// file: "js/start.js"
// });
// };
19 changes: 10 additions & 9 deletions chromeExtension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
"128": "icons/icon128.png"
},

// "background": {
// "scripts": ["js/background.js"]
// "persistent": false
// },
"background": {
"scripts": ["js/background.js"],
"persistent": true
},

// "content_scripts": [{
// "js": ["js/start.js"],
"content_scripts": [{
"js": ["js/content.js"],
//"css": ["styles/styles.css"],
//"matches": ["<all_urls>"]
// }],
"matches": ["<all_urls>"],
"run_at": "document_end"
}],

// "browser_action": {},

"permissions": ["activeTab", "history"]
"permissions": ["activeTab", "history", "https://ajax.googleapis.com/", "*://*/*"]
}
4 changes: 1 addition & 3 deletions devSite/views/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
</div>
<div class="row" id="buttons">
<div class="col-md">
<button type="button" class="btn btn-secondary">
Download
</button>
<a href="https://github.com/Warren-Partridge/ocubrowse" class="btn btn-secondary">Download</a>
<button type="button" class="btn btn-secondary" style="margin-left:30px;">
Callibrate
</button>
Expand Down

0 comments on commit d30ca42

Please sign in to comment.