Skip to content

Commit

Permalink
Merge Branch 'Copy/Download'
Browse files Browse the repository at this point in the history
Downloading and copying directly available from the results page
  • Loading branch information
Jon-Salmon committed Feb 19, 2018
2 parents e9a150c + da6e348 commit 0ca3932
Show file tree
Hide file tree
Showing 4 changed files with 425 additions and 22 deletions.
172 changes: 172 additions & 0 deletions css/settings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
.modal {
display: block;
opacity: 0;
visibility: hidden;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 999;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
transition: opacity 0.3s linear, visibility 0.3s linear 0s;
}

/* Modal Content/Box */

.modal-content {
background-color: #fefefe;
margin: 15% auto;
/* 15% from the top and centered */
padding: 20px;
border: 1px solid #888;
width: 400px;
/* Could be more or less, depending on screen size */
}

.modal-content #modalHeader {
height: 48px;
}

.modal-content #modalHeader h2 {
position: relative;
top: 10px;
margin: 0 30px 0 30px;
text-align: center;
}

.modal-content #modalHeader img {
width: 48px;
height: 48px;
float: left;
}

.modal-content #modalBody {
padding-top: 20px;
text-align: center;
}

.modal-content #modalBody div {
display: inline-block;
}

/* The Close Button */

.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
/* padding-top: 5px; */
}

.close:hover, .close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

.customOpenImage {
position: relative;
}

.customTopElement {
background-color: #454545;
background-image: linear-gradient(top, #3e3e3e, #333);
border: 1px solid #141414;
box-sizing: border-box;
border-radius: 2px;
box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 1px 1px 0 rgba(255, 255, 255, .03), -1px -1px 0 rgba(0, 0, 0, .02), inset 1px 1px 0 rgba(255, 255, 255, .05);
color: #aaa;
cursor: pointer;
display: inline-table;
height: 100%;
font-size: 11px;
font-weight: bold;
margin-right: 10px;
outline: 0;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0, 0, 0, .5);
vertical-align: middle;
white-space: normal;
word-wrap: normal;
}

.customTopElement:hover {
border: 1px solid #191919;
box-shadow: 0 1px 0 rgba(255, 255, 255, .09), 1px 1px 0 rgba(255, 255, 255, .05), -1px -1px 0 rgba(0, 0, 0, .02), inset 1px 1px 0 rgba(255, 255, 255, .05);
}

.customTopElement a {
box-shadow: unset !important;
padding: 5px 0px 5px 8px !important;
margin: 0 !important;
border: 0 !important;
}

.customTopElement a:hover {
box-shadow: unset !important;
border: 0 !important;
}

a.virDropDown {
padding: 5px 4px 5px 0px !important;
}

/* Dropdown Content (Hidden by Default) */

.dropdown-content {
display: none;
position: absolute;
min-width: 160px;
z-index: 1;
width: 100%;
min-width: 0px;
margin: 0 1px;
}

/* Links inside the dropdown */

.dropdown-content a {
text-decoration: none !important;
display: block !important;
margin: 0 12px 0 0 !important;
border-top: 0 !important;
border-left: 0 !important;
border-right: 0 !important;
border-color: #333 !important;
box-shadow: unset !important;
border-radius: 0px !important;
}

.dropdown-content a:last-child {
border-radius: 0 0 2px 2px !important;
border: 0 !important;
}

.dropdown-content a:hover {
box-shadow: unset !important;
border-top: 0 !important;
border-left: 0 !important;
border-right: 0 !important;
border-color: #333 !important;
}

/* Change color of dropdown links on hover */

/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */

.show {
display: block;
}
11 changes: 10 additions & 1 deletion js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ chrome.webRequest.onBeforeRequest.addListener(
}, {
urls: ["*://*/async/imgrc*"]
}
);
);

chrome.runtime.onMessage.addListener(
function(args, sender, sendResponse) {
if (args.request == "download") {
chrome.downloads.download({
url: args.url
});
}
});
Loading

0 comments on commit 0ca3932

Please sign in to comment.