mirror of
https://github.com/thebaer/MMRA
synced 2024-11-13 10:11:01 +00:00
rename makeViewable to shrinkHeaderImages and make default
This commit is contained in:
parent
f7db85ba31
commit
de3c8d3883
@ -38,7 +38,7 @@ var disableLazyLoading = function() {
|
||||
}
|
||||
};
|
||||
|
||||
var makeViewable = function() {
|
||||
var shrinkHeaderImages = function() {
|
||||
var ridiculousHeaderImage = document.querySelector('figure.graf--layoutFillWidth');
|
||||
if (ridiculousHeaderImage != null) {
|
||||
ridiculousHeaderImage.style.maxWidth = '700px';
|
||||
@ -57,6 +57,7 @@ var config = {attributes: true};
|
||||
var metaCheck = document.head.querySelector('meta[property="al:ios:app_name"]');
|
||||
if (metaCheck != null && metaCheck.content == "Medium") {
|
||||
makeReadable();
|
||||
shrinkHeaderImages();
|
||||
|
||||
chrome.storage.sync.get(null, function(items) {
|
||||
if (items.hideDickbar) {
|
||||
@ -65,10 +66,6 @@ if (metaCheck != null && metaCheck.content == "Medium") {
|
||||
if (items.disableLazyImages) {
|
||||
disableLazyLoading();
|
||||
}
|
||||
|
||||
if (items.makeViewable) {
|
||||
makeViewable();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document.querySelector('body'), config);
|
||||
|
@ -25,10 +25,6 @@
|
||||
<input type="checkbox" id="images"> Disable lazy image loading
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" id="ridiculousHeader"> Make ridiculous massive header images viewable
|
||||
</label>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2>Defaults</h2>
|
||||
@ -41,6 +37,10 @@
|
||||
<input type="checkbox" checked="checked" disabled="disabled"> Hide bottom <em>Get Updates</em> bar
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" checked="checked" disabled="disabled"> Shrink ridiculous massive header images
|
||||
</label>
|
||||
|
||||
<hr />
|
||||
|
||||
<p id="status"></p>
|
||||
|
@ -2,11 +2,9 @@
|
||||
function save_options() {
|
||||
var hideDickbar = document.getElementById('dickbar').checked;
|
||||
var disableLazyImages = document.getElementById('images').checked;
|
||||
var makeViewable = document.getElementById('ridiculousHeader').checked;
|
||||
chrome.storage.sync.set({
|
||||
hideDickbar: hideDickbar,
|
||||
disableLazyImages: disableLazyImages,
|
||||
makeViewable: makeViewable
|
||||
disableLazyImages: disableLazyImages
|
||||
}, function() {
|
||||
// Update status to let user know options were saved.
|
||||
var status = document.getElementById('status');
|
||||
@ -26,7 +24,6 @@ function restore_options() {
|
||||
}, function(items) {
|
||||
document.getElementById('dickbar').checked = items.hideDickbar;
|
||||
document.getElementById('images').checked = items.disableLazyImages;
|
||||
document.getElementById('makeViewable').checked = items.makeViewable;
|
||||
});
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', restore_options);
|
||||
|
Loading…
Reference in New Issue
Block a user