Merge pull request #5 from JasonBarnabe/master

Update from JasonBarnabe
This commit is contained in:
hideheader 2015-02-21 12:49:03 -05:00
commit 99968395d9
2 changed files with 28 additions and 2 deletions

View File

@ -85,6 +85,32 @@
.applies-to img { .applies-to img {
vertical-align: bottom; vertical-align: bottom;
} }
@media(max-width:737px) {
#header {
height: auto;
position: inherit;
width: auto;
border-right: none;
padding-left: 8px;
}
#sections {
padding-left: 0px;
}
#sections > div {
padding: 0px;
}
#sections-heading {
padding-left: 8px;
}
body > section > *:not(h2) {
padding-left: 8px;
}
}
</style> </style>
<script src="storage.js"></script> <script src="storage.js"></script>
<script src="messaging.js"></script> <script src="messaging.js"></script>

View File

@ -5,7 +5,7 @@ var writeStyleTemplate = document.createElement("a");
writeStyleTemplate.className = "write-style-link"; writeStyleTemplate.className = "write-style-link";
chrome.tabs.getSelected(null, function(tab) { chrome.tabs.getSelected(null, function(tab) {
var urlWillWork = /^(file|http|https|chrome\-extension):.*/.test(tab.url); var urlWillWork = /^(file|http|https|chrome\-extension):.*/.exec(tab.url);
if (!urlWillWork) { if (!urlWillWork) {
["installed", "find-styles", "write-style"].forEach(function(id) { ["installed", "find-styles", "write-style"].forEach(function(id) {
@ -16,7 +16,7 @@ chrome.tabs.getSelected(null, function(tab) {
} }
chrome.extension.sendMessage({method: "getStyles", matchUrl: tab.url}, showStyles); chrome.extension.sendMessage({method: "getStyles", matchUrl: tab.url}, showStyles);
document.querySelector("#find-styles a").href = "https://userstyles.org/styles/browse/all/" + encodeURIComponent(tab.url); document.querySelector("#find-styles a").href = "https://userstyles.org/styles/browse/all/" + encodeURIComponent("file" === urlWillWork[1] ? "file:" : tab.url);
// Write new style links // Write new style links
var writeStyleLinks = [] var writeStyleLinks = []