mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
- Moved the favorites deletion script from Favorites.page to MyFavorites.page for better organization. - Updated the no favorites message to use a header element for improved semantics. - Removed unnecessary script from Favorites.page to clean up the code. [COMPLETE] Should I continue to the next item?
40 lines
925 B
Plaintext
40 lines
925 B
Plaintext
Menu="Favorites"
|
|
Type="menu"
|
|
Title="My Favorites"
|
|
Tag="heart"
|
|
---
|
|
<script>
|
|
function delPage(page) {
|
|
$.post('/webGui/include/MyFavorites.php',{
|
|
action: 'del',
|
|
page: page,
|
|
}, function() {
|
|
refresh();
|
|
});
|
|
}
|
|
|
|
$(function(){
|
|
$('div.Panel').each(function(){
|
|
const page = $(this).find('a')
|
|
.prop('href')
|
|
.split('/')
|
|
.pop();
|
|
$(this).find('span')
|
|
.append('<i class="fa fa-trash-o favo" title="_(Remove from favorites)_" onclick="delPage("'+page+'");return false"></i>');
|
|
$(this).hover(function() {
|
|
$(this).find('i.favo').show();
|
|
}, function() {
|
|
$(this).find('i.favo').hide();
|
|
});
|
|
});
|
|
|
|
if ($('div.Panel').length === 0) {
|
|
$('#nofavs').show();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<h3 id="nofavs" class="text-center" style="display: none">
|
|
_(No favorites available)_
|
|
</h3>
|