mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
clickable settings cards ⚙
This commit is contained in:
@@ -81,18 +81,21 @@
|
||||
});
|
||||
|
||||
html += `
|
||||
|
||||
<div class="col-sm-4 ">
|
||||
<div class="small-box bg-green " >
|
||||
<div class="inner ">
|
||||
<a href="#${prefix}_header" onclick="toggleAllSettings('open')">
|
||||
<h5 class="card-title">
|
||||
${getString(prefix+"_display_name")}
|
||||
<b>${getString(prefix+"_display_name")}</b>
|
||||
</h5>
|
||||
</a>
|
||||
${includeSettings_html}
|
||||
</div>
|
||||
<a href="#${prefix}_header" onclick="toggleAllSettings('open')">
|
||||
<div class="icon"> ${getString(prefix+"_icon")} </div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
`
|
||||
});
|
||||
@@ -100,6 +103,41 @@
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Open or close all settings
|
||||
// -----------------------------------------------------------------------------
|
||||
function toggleAllSettings(openOrClose = '')
|
||||
{
|
||||
inStr = ' in';
|
||||
allOpen = true;
|
||||
openIcon = 'fa-angle-double-down';
|
||||
closeIcon = 'fa-angle-double-up';
|
||||
|
||||
$('.panel-collapse').each(function(){
|
||||
if($(this).attr('class').indexOf(inStr) == -1)
|
||||
{
|
||||
allOpen = false;
|
||||
}
|
||||
})
|
||||
|
||||
if(allOpen == false || openOrClose == 'open')
|
||||
{
|
||||
// open all
|
||||
$('div[data-myid="collapsible"]').each(function(){$(this).attr('class', 'panel-collapse collapse in')})
|
||||
$('div[data-myid="collapsible"]').each(function(){$(this).attr('style', 'height:inherit')})
|
||||
$('#toggleSettings').attr('class', $('#toggleSettings').attr('class').replace(openIcon, closeIcon))
|
||||
|
||||
}
|
||||
else{
|
||||
// close all
|
||||
$('div[data-myid="collapsible"]').each(function(){$(this).attr('class', 'panel-collapse collapse ')})
|
||||
$('#toggleSettings').attr('class', $('#toggleSettings').attr('class').replace(closeIcon, openIcon))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Checks if all schedules are the same
|
||||
function schedulesAreSynchronized(prefixesOfEnabledPlugins, pluginsData)
|
||||
|
||||
@@ -279,7 +279,8 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
</div>
|
||||
`;
|
||||
|
||||
headerHtml = `<div class="box box-solid box-primary panel panel-default">
|
||||
// Plugin HEADER
|
||||
headerHtml = `<div class="box box-solid box-primary panel panel-default" id="${group}_header">
|
||||
<a data-toggle="collapse" data-parent="#accordion_gen" href="#${group}">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
@@ -790,37 +791,6 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function toggleAllSettings()
|
||||
{
|
||||
inStr = ' in';
|
||||
allOpen = true;
|
||||
openIcon = 'fa-angle-double-down';
|
||||
closeIcon = 'fa-angle-double-up';
|
||||
|
||||
$('.panel-collapse').each(function(){
|
||||
if($(this).attr('class').indexOf(inStr) == -1)
|
||||
{
|
||||
allOpen = false;
|
||||
}
|
||||
})
|
||||
|
||||
if(allOpen)
|
||||
{
|
||||
// close all
|
||||
$('div[data-myid="collapsible"]').each(function(){$(this).attr('class', 'panel-collapse collapse ')})
|
||||
$('#toggleSettings').attr('class', $('#toggleSettings').attr('class').replace(closeIcon, openIcon))
|
||||
}
|
||||
else{
|
||||
// open all
|
||||
$('div[data-myid="collapsible"]').each(function(){$(this).attr('class', 'panel-collapse collapse in')})
|
||||
$('div[data-myid="collapsible"]').each(function(){$(this).attr('style', 'height:inherit')})
|
||||
$('#toggleSettings').attr('class', $('#toggleSettings').attr('class').replace(openIcon, closeIcon))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getData()
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user