mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
Added function to Add Focusscript
This commit is contained in:
parent
8927fdb890
commit
fd3fccf008
@ -517,7 +517,7 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
|
||||
// --- Check if Enable/Disable Button was clicked and add Autofocus code!
|
||||
if ( isset($content['CHARTID']) && $content['CHARTID'] == $myChart['ID'] )
|
||||
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('chartenablebutton" . $myChart['ID'] . "').focus(); };</script>";
|
||||
AddWindowLoadFocus("chartenablebutton" . $myChart['ID']);
|
||||
// ---
|
||||
}
|
||||
// ---
|
||||
|
@ -98,16 +98,16 @@ if ( isset($_GET['op']) && isset($_GET['value']) )
|
||||
// Set UserOption
|
||||
$USERCFG['UserOverwriteOptions'] = 1;
|
||||
|
||||
// Add some javascript to FOcus the enable/disable user button
|
||||
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('buttonenableuseropt').focus(); };</script>";
|
||||
// Focus the enable user button
|
||||
AddWindowLoadFocus("buttonenableuseropt");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set UserOption
|
||||
$USERCFG['UserOverwriteOptions'] = 0;
|
||||
|
||||
// Add some javascript to FOcus the enable/disable user button
|
||||
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('buttondisableuseropt').focus(); };</script>";
|
||||
// Focus the disable user button
|
||||
AddWindowLoadFocus("buttondisableuseropt");
|
||||
}
|
||||
|
||||
|
||||
|
@ -456,9 +456,9 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
||||
$content['USERID'] == $content['USERS'][$i]['ID'] )
|
||||
{
|
||||
if ( $_GET['miniop'] == "setisadmin" )
|
||||
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('userisadminbutton" . $content['USERS'][$i]['ID'] . "').focus(); };</script>";
|
||||
AddWindowLoadFocus("userisadminbutton" . $content['USERS'][$i]['ID']);
|
||||
else if ( $_GET['miniop'] == "setisreadonly" )
|
||||
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('userisreadonlybutton" . $content['USERS'][$i]['ID'] . "').focus(); };</script>";
|
||||
AddWindowLoadFocus("userisreadonlybutton" . $content['USERS'][$i]['ID']);
|
||||
}
|
||||
// ---
|
||||
|
||||
|
@ -1529,6 +1529,18 @@ function AddContextLinks(&$sourceTxt)
|
||||
$sourceTxt = preg_replace_callback( '/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/i', "InsertLookupLinkIP", $sourceTxt );
|
||||
}
|
||||
|
||||
/*
|
||||
* AddContextLinks
|
||||
*/
|
||||
function AddWindowLoadFocus($szFieldID)
|
||||
{
|
||||
global $content;
|
||||
|
||||
// Add Javascript to Focus a specific element
|
||||
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('" . $szFieldID . "').focus(); };</script>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Helper to create a Lookup Link!
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user