Skip to content

Commit

Permalink
Added color options for highlight #271
Browse files Browse the repository at this point in the history
  • Loading branch information
mreishman committed Jan 21, 2018
1 parent 554bf5c commit 724c7a9
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 27 deletions.
2 changes: 2 additions & 0 deletions core/conf/config.php
Expand Up @@ -233,6 +233,8 @@
'groupByColorEnabled' => 'true',
'groupByType' => 'folder',
'hideEmptyLog' => 'false',
'highlightColorBG' => '#FFFF00',
'highlightColorFont' => '#000000',
'invertMenuImages' => 'false',
'layoutVersion' => 1,
'loadingBarVersion' => 1,
Expand Down
31 changes: 19 additions & 12 deletions core/js/settingsMain.js
Expand Up @@ -36,7 +36,7 @@ function changeDescriptionLineSize()
}
else if (valueForDesc === "size")
{
document.getElementById("logTrimTypeText").innerHTML = "Size";
document.getElementById("logTrimTypeText").innerHTML = document.getElementById("TrimSize").value;
document.getElementById("LiForlogTrimSize").style.display = "block";
}
}
Expand Down Expand Up @@ -88,6 +88,20 @@ function showOrHideFilterContentSettings()
}
}

function showOrHideFilterHighlightSettings()
{
try
{
var valueForPopup = document.getElementById("filterContentHighlight");
var valueForVars = document.getElementById("highlightContentSettings");
showOrHideSubWindow(valueForPopup, valueForVars);
}
catch(e)
{
eventThrowException(e);
}
}

function showOrHideSubWindow(valueForPopupInner, valueForVarsInner)
{
try
Expand Down Expand Up @@ -141,17 +155,6 @@ function checkIfChanges()

$( document ).ready(function()
{
if(document.getElementById("logTrimTypeText"))
{
if(logTrimType == "lines")
{
document.getElementById("logTrimTypeText").innerHTML = "Lines";
}
else if (logTrimType == "size")
{
document.getElementById("logTrimTypeText").innerHTML = "Size";
}
}
if(document.getElementById("popupSelect"))
{
document.getElementById("popupSelect").addEventListener("change", showOrHidePopupSubWindow, false);
Expand All @@ -172,6 +175,10 @@ $( document ).ready(function()
{
document.getElementById("filterContentLimit").addEventListener("change", showOrHideFilterContentSettings, false);
}
if(document.getElementById("filterContentHighlight"))
{
document.getElementById("filterContentHighlight").addEventListener("change", showOrHideFilterHighlightSettings, false);
}

var arrayToRefresh = new Array();
if(document.getElementById("settingsMainVars"))
Expand Down
4 changes: 2 additions & 2 deletions core/php/customCSS.php
Expand Up @@ -143,8 +143,8 @@

.highlight
{
background-color: yellow;
color: black;
background-color: <?php echo $highlightColorBG; ?>;
color: <?php echo $highlightColorFont; ?>
}

</style>
40 changes: 29 additions & 11 deletions core/php/template/filterVars.php
Expand Up @@ -33,12 +33,31 @@
<li>
<span class="settingsBuffer" > Highlight Content match: </span>
<div class="selectDiv">
<select name="filterContentHighlight">
<select id="filterContentHighlight" name="filterContentHighlight">
<option <?php if($filterContentHighlight == 'true'){echo "selected";} ?> value="true">True</option>
<option <?php if($filterContentHighlight == 'false'){echo "selected";} ?> value="false">False</option>
</select>
</div>
</li>
<li>
<div id="highlightContentSettings" style=" <?php if($filterContentHighlight == 'false'){ echo 'display: none;'; }?> " >
<div class="settingsHeader">
Filter Highlight Settings
</div>
<div class="settingsDiv" >
<ul id="settingsUl">
<li>
<span class="settingsBuffer" > Background: </span>
<input type="text" name="highlightColorBG" value="<?php echo $highlightColorBG;?>" >
</li>
<li>
<span class="settingsBuffer" > Font: </span>
<input type="text" name="highlightColorFont" value="<?php echo $highlightColorFont;?>" >
</li>
</ul>
</div>
</div>
</li>
<li>
<span class="settingsBuffer" > Filter Content match: </span>
<div class="selectDiv">
Expand Down Expand Up @@ -71,16 +90,15 @@
<span class="settingsBuffer" > Line Padding: </span>
<div class="selectDiv">
<select name="filterContentLinePadding">
<option <?php if($filterContentLinePadding == 0){echo "selected";} ?> value=0>0</option>
<option <?php if($filterContentLinePadding == 1){echo "selected";} ?> value=1>1</option>
<option <?php if($filterContentLinePadding == 2){echo "selected";} ?> value=2>2</option>
<option <?php if($filterContentLinePadding == 3){echo "selected";} ?> value=3>3</option>
<option <?php if($filterContentLinePadding == 4){echo "selected";} ?> value=4>4</option>
<option <?php if($filterContentLinePadding == 5){echo "selected";} ?> value=5>5</option>
<option <?php if($filterContentLinePadding == 6){echo "selected";} ?> value=6>6</option>
<option <?php if($filterContentLinePadding == 7){echo "selected";} ?> value=7>7</option>
<option <?php if($filterContentLinePadding == 8){echo "selected";} ?> value=8>8</option>
<option <?php if($filterContentLinePadding == 9){echo "selected";} ?> value=9>9</option>
<?php for ($i=0; $i < 10; $i++)
{
echo "<option ";
if($filterContentLinePadding == $i)
{
echo " selected ";
}
echo " value=".$i.">".$i."</option>";
}?>
</select>
</div>
</li>
Expand Down
12 changes: 10 additions & 2 deletions core/php/template/logSettings.php
Expand Up @@ -69,7 +69,15 @@
: </span>
<input type="text" name="logSizeLimit" value="<?php echo $logSizeLimit;?>" >
<span id="logTrimTypeText" >

<?php if($logTrimType == 'lines')
{
echo "Lines";
}
elseif($logTrimType == 'size')
{
echo $TrimSize;
}
?>
</span>
</li>
<li>
Expand All @@ -89,7 +97,7 @@
<li id="LiForlogTrimSize" <?php if($logTrimType != 'size'){echo "style='display:none;'";} ?> >
<span class="settingsBuffer" > Size is measured in: </span>
<div class="selectDiv">
<select name="TrimSize">
<select id="TrimSize" name="TrimSize">
<option <?php if($TrimSize == 'KB'){echo "selected";} ?> value="KB">KB</option>
<option <?php if($TrimSize == 'K'){echo "selected";} ?> value="K">K</option>
<option <?php if($TrimSize == 'MB'){echo "selected";} ?> value="MB">MB</option>
Expand Down

0 comments on commit 724c7a9

Please sign in to comment.