mirror of
https://github.com/LBRYFoundation/Watch-on-LBRY.git
synced 2025-09-04 04:45:13 +00:00
Added new button to popup
This commit is contained in:
parent
77d6476ea2
commit
cc2d4f41eb
3 changed files with 42 additions and 5 deletions
|
@ -13,6 +13,26 @@ body {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container2 {
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 80%;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn1 {
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #075656;
|
||||||
|
border: 4px solid #075656;
|
||||||
|
color: whitesmoke;
|
||||||
|
font-weight: 400;
|
||||||
|
padding: 4px 15px;
|
||||||
|
margin-right: 25px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: #075656;
|
background-color: #075656;
|
||||||
|
@ -36,3 +56,9 @@ label {
|
||||||
margin: 15px auto;
|
margin: 15px auto;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.span {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
background: black;
|
||||||
|
}
|
||||||
|
|
|
@ -10,13 +10,19 @@
|
||||||
<button type="button" class="button" name="enable" value="1" > YES </button>
|
<button type="button" class="button" name="enable" value="1" > YES </button>
|
||||||
<button type="button" class="button" name="disable" value="0" > NO </button>
|
<button type="button" class="button" name="disable" value="0" > NO </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label> Where would you like to redirect ? </label>
|
<label> Where would you like to redirect ? </label>
|
||||||
<div class="redirect">
|
<div class="redirect">
|
||||||
<button type="button" class="button" name="site" value="lbry.tv" > LBRY.tv </button>
|
<button type="button" class="button" name="site" value="lbry.tv" > LBRY.tv </button>
|
||||||
<button type="button" class="button" name="app" value="app" > LBRY App </button>
|
<button type="button" class="button" name="app" value="app" > LBRY App </button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<label> Another usefull tools: </label>
|
||||||
|
<button type="button" class="btn1" id="btn1">Subscribtions Converter</button>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script src="popup.js"></script>
|
<script src="popup.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -9,7 +9,7 @@ chrome.storage.local.get(['enabled', 'redirect'], ({ enabled, redirect }) => {
|
||||||
|
|
||||||
const currentButton = enabled ? enable : disable;
|
const currentButton = enabled ? enable : disable;
|
||||||
currentButton.classList.add('active');
|
currentButton.classList.add('active');
|
||||||
|
|
||||||
const currentRadio = !redirect ? lbrySite : redirect === 'lbry.tv' ? lbrySite : lbryApp;
|
const currentRadio = !redirect ? lbrySite : redirect === 'lbry.tv' ? lbrySite : lbryApp;
|
||||||
currentRadio.classList.add('active');
|
currentRadio.classList.add('active');
|
||||||
});
|
});
|
||||||
|
@ -18,7 +18,7 @@ const checkElementForClass = (elToAdd, elToRemove) => {
|
||||||
if(!elToAdd.classList.contains('active')){
|
if(!elToAdd.classList.contains('active')){
|
||||||
|
|
||||||
elToAdd.classList.add('active');
|
elToAdd.classList.add('active');
|
||||||
elToRemove.classList.remove('active');
|
elToRemove.classList.remove('active');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@ const attachClick = (selector, handler) =>{
|
||||||
const element = event.target;
|
const element = event.target;
|
||||||
const name = event.target.getAttribute('name');
|
const name = event.target.getAttribute('name');
|
||||||
const value = event.target.getAttribute('value');
|
const value = event.target.getAttribute('value');
|
||||||
typeof handler==='function' ? handler(element, name, value): null;
|
typeof handler==='function' ? handler(element, name, value): null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
attachClick('.enable', (element, name, value) => {
|
attachClick('.enable', (element, name, value) => {
|
||||||
const parsedValue = !!+value;
|
const parsedValue = !!+value;
|
||||||
if(name){
|
if(name){
|
||||||
checkElementForClass(element, name === 'enable' ? disable : enable );
|
checkElementForClass(element, name === 'enable' ? disable : enable );
|
||||||
chrome.storage.local.set({ enabled: parsedValue });
|
chrome.storage.local.set({ enabled: parsedValue });
|
||||||
|
@ -45,3 +45,8 @@ attachClick('.redirect', (element, name, value) => {
|
||||||
chrome.storage.local.set({ redirect: value });
|
chrome.storage.local.set({ redirect: value });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var button = document.getElementById("btn1");
|
||||||
|
button.addEventListener("click", function(){
|
||||||
|
chrome.tabs.create({url:"/tools/YTtoLBRY.html"});
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue