mirror of
https://github.com/thebaer/MMRA
synced 2024-11-13 10:11:01 +00:00
Merge pull request #25 from Nudin/master
Hide highlightbar on selection
This commit is contained in:
commit
4db614aa4b
10
content.js
10
content.js
@ -15,6 +15,13 @@ var makeReadable = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var hideHighlightMenu = function() {
|
||||||
|
var bar = document.querySelector('.highlightMenu');
|
||||||
|
if (bar) {
|
||||||
|
bar.style.display = 'none';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var hideDickbar = function() {
|
var hideDickbar = function() {
|
||||||
var dickbar = document.querySelector('.js-postShareWidget');
|
var dickbar = document.querySelector('.js-postShareWidget');
|
||||||
if (dickbar) {
|
if (dickbar) {
|
||||||
@ -76,6 +83,9 @@ if (document.querySelector('head meta[property="al:ios:app_name"][content="mediu
|
|||||||
if (items.disableLazyImages) {
|
if (items.disableLazyImages) {
|
||||||
disableLazyLoading();
|
disableLazyLoading();
|
||||||
}
|
}
|
||||||
|
if (items.hideHighlightMenu) {
|
||||||
|
hideHighlightMenu();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
observer.observe(document.body, config);
|
observer.observe(document.body, config);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
"name": "Make Medium Readable Again",
|
"name": "Make Medium Readable Again",
|
||||||
"description": "Neutralizes annoying parts of the Medium reading experience and lets you read again.",
|
"description": "Neutralizes annoying parts of the Medium reading experience and lets you read again.",
|
||||||
"version": "1.3.1",
|
"version": "1.4.0",
|
||||||
|
|
||||||
"applications": {
|
"applications": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#status {
|
#status {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
#save {
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -25,6 +28,10 @@
|
|||||||
<input type="checkbox" id="images"> Disable lazy image loading
|
<input type="checkbox" id="images"> Disable lazy image loading
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="highlight"> Disable Highlight Menu
|
||||||
|
</label>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<h2>Default Features</h2>
|
<h2>Default Features</h2>
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
function save_options() {
|
function save_options() {
|
||||||
var hideDickbar = document.getElementById('dickbar').checked;
|
var hideDickbar = document.getElementById('dickbar').checked;
|
||||||
var disableLazyImages = document.getElementById('images').checked;
|
var disableLazyImages = document.getElementById('images').checked;
|
||||||
|
var hideHighlightMenu = document.getElementById('highlight').checked;
|
||||||
chrome.storage.sync.set({
|
chrome.storage.sync.set({
|
||||||
hideDickbar: hideDickbar,
|
hideDickbar: hideDickbar,
|
||||||
disableLazyImages: disableLazyImages
|
disableLazyImages: disableLazyImages,
|
||||||
|
hideHighlightMenu: hideHighlightMenu
|
||||||
}, function() {
|
}, function() {
|
||||||
// Update status to let user know options were saved.
|
// Update status to let user know options were saved.
|
||||||
var status = document.getElementById('status');
|
var status = document.getElementById('status');
|
||||||
@ -20,10 +22,12 @@ function save_options() {
|
|||||||
function restore_options() {
|
function restore_options() {
|
||||||
chrome.storage.sync.get({
|
chrome.storage.sync.get({
|
||||||
hideDickbar: false,
|
hideDickbar: false,
|
||||||
disableLazyImages: false
|
disableLazyImages: false,
|
||||||
|
hideHighlightMenu: false
|
||||||
}, function(items) {
|
}, function(items) {
|
||||||
document.getElementById('dickbar').checked = items.hideDickbar;
|
document.getElementById('dickbar').checked = items.hideDickbar;
|
||||||
document.getElementById('images').checked = items.disableLazyImages;
|
document.getElementById('images').checked = items.disableLazyImages;
|
||||||
|
document.getElementById('highlight').checked = items.hideHighlightMenu;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
document.addEventListener('DOMContentLoaded', restore_options);
|
document.addEventListener('DOMContentLoaded', restore_options);
|
||||||
|
Loading…
Reference in New Issue
Block a user