mirror of
https://github.com/anatolykopyl/vk-mute.git
synced 2026-03-26 12:55:13 +00:00
Обновил оформление
This commit is contained in:
1
extension/dist/popup.html
vendored
1
extension/dist/popup.html
vendored
@@ -15,7 +15,6 @@
|
||||
</label>
|
||||
</div>
|
||||
<div id="id_list">
|
||||
<div class="idToHide"></div>
|
||||
</div>
|
||||
<script src="popup.js"></script></body>
|
||||
</html>
|
||||
29
extension/dist/popup.js
vendored
29
extension/dist/popup.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
body {
|
||||
min-width: 80px;
|
||||
min-width: 120px;
|
||||
}
|
||||
/* The switch - the box around the slider */
|
||||
.switch {
|
||||
@@ -78,21 +78,26 @@ input:checked + .slider:before {
|
||||
}
|
||||
|
||||
.idToHide {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background-color: #fff;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.idToHide:hover {
|
||||
background-color: white;
|
||||
background-color: #dcdfde;
|
||||
}
|
||||
|
||||
#id_list {
|
||||
background-color: #dcdfde;
|
||||
color: black;
|
||||
width: 100vw;
|
||||
position: relative;
|
||||
margin-left: -50vw;
|
||||
left: 50%;
|
||||
margin-top: 10vw;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.del_item {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
</label>
|
||||
</div>
|
||||
<div id="id_list">
|
||||
<div class="idToHide"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,7 +14,11 @@ let disableText = "Выкл";
|
||||
function idBtnHTML(id) {
|
||||
const element = document.createElement('div');
|
||||
element.setAttribute('class', 'idToHide');
|
||||
element.innerHTML = id;
|
||||
element.innerHTML = `
|
||||
<a href="https://vk.com/id${id}" target="_blank" title="Перейти в профиль">🧑 id${id}</a>
|
||||
<span class="del_item" title="Удалить">🗑️</span>
|
||||
`;
|
||||
element.id = id;
|
||||
return element;
|
||||
}
|
||||
|
||||
@@ -36,16 +40,20 @@ chrome.storage.sync.get('idsToHide', function(data) {
|
||||
idList.appendChild(row);
|
||||
}
|
||||
for (const element of idsToHideElements) {
|
||||
element.addEventListener('click', function() {
|
||||
const index = idsToHide.indexOf(element.innerText)
|
||||
for (const child of element.childNodes) {
|
||||
if (child.className === "del_item") {
|
||||
child.addEventListener('click', function() {
|
||||
const index = idsToHide.indexOf(element.id)
|
||||
if (index > -1) {
|
||||
idsToHide.splice(index, 1);
|
||||
}
|
||||
chrome.storage.sync.set({idsToHide: idsToHide}, function() {
|
||||
element.innerText = '';
|
||||
element.remove();
|
||||
console.log('Cleared idsToHide');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user