Skip to content

Commit

Permalink
Restored Hide Mink UI functionality for MCW.
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Sep 4, 2015
1 parent b5f12a2 commit ac9195c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mink-plugin/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ function addToBlacklist(currentBlacklist, uriIn){


chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if(request.method == "hideUI"){
$("#minkContainer").fadeOut();
return;
}

if(request.method === 'addToBlacklist'){
// TODO: convert this to add to blacklist

Expand Down
2 changes: 1 addition & 1 deletion mink-plugin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Mink",
"version": "1.4",
"version": "1.4.1",
"description": "Integrating the Live and Archived Web Viewing Experience Using Memento",
"homepage_url": "http://matkelly.com/mink",
"author": "Mat Kelly <[email protected]>",
Expand Down
22 changes: 20 additions & 2 deletions mink-plugin/mink.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,29 @@ chrome.runtime.onMessage.addListener(
}
);

chrome.contextMenus.create({
"title": "Hide Mink until reload",
"contexts": ["image"],
"onclick" : hideMinkUI
//,"targetUrlPatterns":["*://*/*"] //TODO: filter this solely to the Mink UI
});

function hideMinkUI(){
chrome.tabs.query({
"active": true,
"currentWindow": true
}, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, {
"method": "hideUI"
});
});
}

if(debug) { // Only show contextual menu items in dev for now.
chrome.contextMenus.create({
'title': 'Add to Mink Blacklist',
'contexts': ['image'],
'onclick' : hideMinkUI
'onclick' : addToBlackList
//,'targetUrlPatterns':['*://*/*'] //TODO: filter this solely to the Mink UI
});

Expand All @@ -125,7 +143,7 @@ chrome.contextMenus.create({

}

function hideMinkUI(){
function addToBlackList(){
chrome.tabs.query({
'active': true,
'currentWindow': true
Expand Down

0 comments on commit ac9195c

Please sign in to comment.