Files
webgui/emhttp/plugins/dynamix/MyFavorites.page
Zack Spear 8e2d4e434d refactor: streamline favorites functionality in MyFavorites.page
- 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?
2025-05-27 16:20:43 -07:00

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(&quot;'+page+'&quot;);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>