Added new kind of popup menu for use within the grid.

The popup menu uses javascript and is shown on click.
It seems to be the best option so far for later development.
This state is kind of in the middle as I need to take care
of a bug in the beta branch.
This commit is contained in:
Andre Lorbach 2008-04-29 14:51:26 +02:00
parent 36035a8946
commit 8dd71e818f
15 changed files with 160 additions and 32 deletions

View File

@ -24,7 +24,7 @@
.SelectSavedFilter
{
margin-top: 3px;
margin-top: 2px;
border: 1px solid;
border-color: #233B51 #124A7C #124A7C #233B51;
}

View File

@ -14,11 +14,11 @@
border-width: 1px;
border-style: solid;
margin: 0;
padding: 2px 3px;
padding: 1px 1px;
}
#menu h2 {
font: bold 11px/16px;
font: bold;
text-align: center;
}
@ -33,22 +33,27 @@
}
#menu li {
z-index:10;
/* make the list elements a containing block for the nested lists */
position: relative;
}
#menu ul ul {
z-index:10;
position: absolute;
top: 16px;
left: 0px; /* to position them to the right of their containing block */
top: 12px;
left: 4px; /* to position them to the right of their containing block */
width: 300; /* width is based on the containing block */
}
div#menu ul ul,
div#menu ul li:hover ul ul
{display: none;}
{
display: none;
}
div#menu ul li:hover ul,
div#menu ul ul li:hover ul
{display: block;}
{
display: block;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

View File

@ -95,7 +95,7 @@ $fields[SYSLOG_MESSAGETYPE]['FieldCaptionID'] = 'LN_FIELDS_MESSAGETYPE';
$fields[SYSLOG_MESSAGETYPE]['FieldType'] = FILTER_TYPE_NUMBER;
$fields[SYSLOG_MESSAGETYPE]['Sortable'] = true;
$fields[SYSLOG_MESSAGETYPE]['DefaultWidth'] = "90";
$fields[SYSLOG_MESSAGETYPE]['FieldAlign'] = "left";
$fields[SYSLOG_MESSAGETYPE]['FieldAlign'] = "center";
// Syslog specific
$fields[SYSLOG_FACILITY]['FieldID'] = SYSLOG_FACILITY;

View File

@ -360,11 +360,16 @@ function InitFrontEndVariables()
$content['MENU_NAV_RIGHT'] = $content['BASEPATH'] . "images/icons/navigate_right.png";
$content['MENU_NAV_CLOSE'] = $content['BASEPATH'] . "images/icons/navigate_close.png";
$content['MENU_NAV_OPEN'] = $content['BASEPATH'] . "images/icons/navigate_open.png";
$content['MENU_PAGER_BEGIN_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_beginning.png";
$content['MENU_PAGER_PREVIOUS_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_rewind.png";
$content['MENU_PAGER_NEXT_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_fast_forward.png";
$content['MENU_PAGER_END_GREY'] = $content['BASEPATH'] . "images/icons/grey/media_end.png";
$content['MENU_BULLET_BLUE'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_blue.png";
$content['MENU_BULLET_GREEN'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_green.png";
$content['MENU_BULLET_RED'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_red.png";
$content['MENU_BULLET_YELLOW'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_yellow.png";
$content['MENU_BULLET_GREY'] = $content['BASEPATH'] . "images/icons/bullet_ball_glass_grey.png";
}
// Lang Helper for Strings with ONE variable

View File

@ -267,6 +267,8 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
if ( isset($logArray[$mycolkey]) )
{
// Set defaults
$content['syslogmessages'][$counter]['values'][$mycolkey]['FieldColumn'] = $mycolkey;
$content['syslogmessages'][$counter]['values'][$mycolkey]['uid'] = $uID;
$content['syslogmessages'][$counter]['values'][$mycolkey]['FieldAlign'] = $fields[$mycolkey]['FieldAlign'];
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldcssclass'] = $content['syslogmessages'][$counter]['cssclass'];
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldbgcolor'] = "";
@ -408,15 +410,22 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['Sources'][$c
{
// Append Syslogtag Search Button
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = '<a href="?filter=syslogtag%3A' . $logArray[$mycolkey] .
'&search=Search" target="_top"><img src="' . $content['MENU_VIEW'] .
'" width="16" align="right" title="' . $content['LN_VIEW_FILTERFOR'] . $logArray[$mycolkey] . '">' . '</a>' . $logArray[$mycolkey];
'&search=Search" target="_top">' . $logArray[$mycolkey]. '</a>';
// <img src="' . $content['MENU_VIEW'] . '" width="16" align="left" title="' . $content['LN_VIEW_FILTERFOR'] . $logArray[$mycolkey] . '">'
}
else if ( $mycolkey == SYSLOG_HOST )
{
$content['syslogmessages'][$counter]['values'][$mycolkey]['hasbuttons'] = true;
$content['syslogmessages'][$counter]['values'][$mycolkey]['buttons'][] = array(
'ButtonUrl' => '?filter=source%3A' . $logArray[$mycolkey] . '&search=Search',
'DisplayName' => $content['LN_VIEW_FILTERFOR'] . "'" . $logArray[$mycolkey] . "'"
);
// Append Syslogtag Search Button
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = '<a href="?filter=source%3A' . $logArray[$mycolkey] .
'&search=Search" target="_top"><img src="' . $content['MENU_VIEW'] .
'" width="16" align="right" title="' . $content['LN_VIEW_FILTERFOR'] . $logArray[$mycolkey] . '">' . '</a>' . $logArray[$mycolkey];
// $content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = '<a href="?filter=source%3A' . $logArray[$mycolkey] .
// '&search=Search" target="_top"><img src="' . $content['MENU_VIEW'] .
//'" width="16" align="right" title="' . $content['LN_VIEW_FILTERFOR'] . $logArray[$mycolkey] . '">' . '</a>' . $logArray[$mycolkey];
/* TODO ...
$content['syslogmessages'][$counter]['values'][$mycolkey]['fieldvalue'] = '
<div id="menu">

View File

@ -133,4 +133,81 @@ function toggleFormareaVisibility(FormFieldName, FirstHiddenArea, SecondHiddenAr
hidevisibility(FirstHiddenArea);
togglevisibility(SecondHiddenArea);
}
}
}
// helper array to keep track of the timeouts!
var runningTimeouts = new Array();
var defaultMenuTimeout = 1500;
/*
* Toggle display type from NONE to BLOCK
*/
function ToggleDisplayTypeById(ObjID)
{
var obj = document.getElementById(ObjID);
if (obj != null)
{
if (obj.style.display == '' || obj.style.display == 'none')
{
obj.style.display='block';
// Set Timeout to make sure the menu disappears
ToggleDisplaySetTimeout(ObjID);
}
else
{
obj.style.display='none';
// Abort Timeout if set!
ToggleDisplayClearTimeout(ObjID);
}
}
}
function ToggleDisplaySetTimeout(ObjID)
{
// Set Timeout
var szTimeOut = "ToggleDisplayOffTypeById('" + ObjID + "')";
runningTimeouts[ObjID] = window.setTimeout(szTimeOut, defaultMenuTimeout);
}
function ToggleDisplayClearTimeout(ObjID)
{
// Abort Timeout if set!
if ( runningTimeouts[ObjID] != null )
{
window.clearTimeout(runningTimeouts[ObjID]);
}
}
function ToggleDisplayEnhanceTimeOut(ObjID)
{
// First clear timeout
ToggleDisplayClearTimeout(ObjID);
// Set new timeout
ToggleDisplaySetTimeout(ObjID);
}
/*
* Make Style sheet display OFF in any case
*/
function ToggleDisplayOffTypeById(ObjID)
{
var obj = document.getElementById(ObjID);
if (obj != null)
{
obj.style.display='none';
}
}
/*
* Debug Helper function to read possible properties of an object
*/
function DebugShowElementsById(ObjName)
{
var obj = document.getElementById(ObjName);
for (var key in obj) {
document.write(obj[key]);
}
}

View File

@ -45,6 +45,7 @@ $content['LN_GEN_SOURCE_DISK'] = "Diskfile";
$content['LN_GEN_SOURCE_DB'] = "Database";
$content['LN_GEN_RECORDSPERPAGE'] = "records per page";
$content['LN_GEN_PRECONFIGURED'] = "Preconfigured";
$content['LN_GEN_AVAILABLESEARCHES'] = "Available searches";
// Main Index Site

View File

@ -10,11 +10,13 @@
<td nowrap align="left" nowrap valign="top">
<div id="menu">
<ul>
<li><img src="{MENU_NAV_CLOSE}" width="16" height="16" title="{LN_GEN_PREDEFINEDSEARCHES}" class="SelectSavedFilter">
<ul class="with_border">
<li><img src="{MENU_NAV_CLOSE}" width="16" height="16" title="{LN_GEN_PREDEFINEDSEARCHES}" class="SelectSavedFilter" OnClick="ToggleDisplayTypeById('menu_presearches');">
<ul class="with_border" id="menu_presearches">
<li><h2 class="cellmenu1">{LN_GEN_PREDEFINEDSEARCHES}</h2>
<!-- BEGIN Search -->
<li class="{cssclass}"><a href="?{SearchQuery}" target="_top">{DisplayName}</a></li>
<li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_presearches');">
<a href="?{SearchQuery}" target="_top">{DisplayName}</a>
</li>
<!-- END Search -->
</ul>
</li>
@ -198,15 +200,44 @@
<!-- BEGIN values -->
<!-- IF hasdetails="false" -->
<td align="{FieldAlign}" class="{fieldcssclass}" {fieldbgcolor} valign="middle" nowrap>
<!-- IF haslink="true" -->
<a href="{detaillink}" class="syslogdetails" target="_top">
<!-- ENDIF haslink="true" -->
<!-- IF haslink!="true" --><B><!-- ENDIF haslink!="true" -->
{fieldvalue}
<!-- IF haslink!="true" --></B><!-- ENDIF haslink!="true" -->
<!-- IF haslink="true" -->
</a>
<!-- ENDIF haslink="true" -->
<!-- IF hasbuttons="true" -->
<div id="menu">
<ul>
<li>
<!-- <img align="left" src="{MENU_NAV_CLOSE}" width="16" height="16" border="1" title="{LN_GEN_AVAILABLESEARCHES}">-->
<ul class="with_border" id="menu_{FieldColumn}_{uid}">
<li OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_{FieldColumn}_{uid}');">
<h2 class="cellmenu1">{LN_GEN_AVAILABLESEARCHES}
</h2>
<!-- BEGIN buttons -->
<li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_{FieldColumn}_{uid}');">
<img align="left" src="{MENU_BULLET_BLUE}" width="16" height="16"><a href="{ButtonUrl}" target="_top">{DisplayName}</a>
</li>
<!-- END buttons -->
</ul>
</li>
</ul>
</div>
<span OnClick="ToggleDisplayTypeById('menu_{FieldColumn}_{uid}');">
<!-- ENDIF hasbuttons="true" -->
<!-- IF haslink="true" -->
<a href="{detaillink}" class="syslogdetails" target="_top">
<!-- ENDIF haslink="true" -->
<!-- IF haslink!="true" --><B><!-- ENDIF haslink!="true" -->
{fieldvalue}
<!-- IF haslink!="true" --></B><!-- ENDIF haslink!="true" -->
<!-- IF haslink="true" -->
</a>
<!-- ENDIF haslink="true" -->
<!-- IF hasbuttons="true" -->
</span>
<!-- ENDIF hasbuttons="true" -->
<!-- ENDIF hasdetails="false" -->
<!-- IF hasdetails="true" -->
<td align="{FieldAlign}" class="{fieldcssclass}" {fieldbgcolor} valign="middle" width="100%">

View File

@ -243,12 +243,12 @@ font
/* Cell Columns */
.cellmenu1
{
height: 15px;
/* height: 15px; */
border:1px solid;
border-color: #353A3F #050A0F #050A0F #353A3F;
text-indent:5px;
font: 10px Verdana, Arial, Helvetica, sans-serif;
font: bold 10px Verdana, Arial, Helvetica, sans-serif;
color: #FFFCE5;
background-color: #103B65;
}

View File

@ -272,12 +272,12 @@ font
/* Cell Columns */
.cellmenu1
{
height: 16px;
/* height: 16px; */
border:1px ridge;
border-color: #79AABE #09506C #09506C #79AABE;
text-indent:5px;
font: 10px Verdana, Arial, Helvetica, sans-serif;
font: bold 10px Verdana, Arial, Helvetica, sans-serif;
color: #FFFFFF;
background-color: #6C8E9C;
}