Skip to content

Commit e16f1db

Browse files
author
mreishman
committed
Added tabs to settings watchlist
1 parent 60b90f9 commit e16f1db

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

core/js/watchlist.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ function checkWebsiteStatus(sendUrlHere)
250250
});
251251
}
252252

253+
function toggleSettingsGroupSection(number, type)
254+
{
255+
$("#"+number+"General").hide();
256+
$("#"+number+"Git").hide();
257+
$("#"+number+"Advanced").hide();
258+
$("#"+number+type).show();
259+
}
260+
253261
$( document ).ready(function() {
254262
hideLastMoveDownButton();
255263
});

core/php/functions/watchlistFunctions.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ function generateWatchlistBlock($defaultArray, $arrayKeys, $key = "{{key}}", $it
1818
<span class=\"leftSpacingserverNames\" > Name: </span>
1919
<input class='inputWidth300' type='text' name='watchListKey" . $i . "' value='" . $key . "'>";
2020
$j = 0;
21+
$stringToReturn .= "<div style=\"border-bottom: 1px solid black; margin-bottom: 5px; padding: 5px;\">";
2122
foreach($defaultArray as $groupName => $groupData)
2223
{
23-
if($groupName !== "")
24+
$stringToReturn .= "<span class=\"buttonButton\" style=\"margin-right: 5px;\" onclick=\"toggleSettingsGroupSection('".$i."','".$groupName."');\" >".$groupName."</span>";
25+
}
26+
$stringToReturn .= "</div>";
27+
foreach($defaultArray as $groupName => $groupData)
28+
{
29+
$stringToReturn .= "<span id=\"".$i.$groupName."\" ";
30+
if($j !== 0)
2431
{
25-
$stringToReturn .= "<div style=\"border-bottom: 1px solid black; margin-bottom: 5px;\">
26-
<h4 style=\"margin: 5px;\">".$groupName."</h4>
27-
</div>";
32+
$stringToReturn .= " style=\"display: none;\" ";
2833
}
34+
$stringToReturn .= " >";
2935
$brCount = 0;
3036
foreach($groupData as $key2 => $item2)
3137
{
@@ -148,6 +154,7 @@ function generateWatchlistBlock($defaultArray, $arrayKeys, $key = "{{key}}", $it
148154
$stringToReturn .= "'>";
149155
}
150156
}
157+
$stringToReturn .= "</span>";
151158
}
152159
$stringToReturn .= "
153160
<input style=\"display: none\" type=\"text\" name=\"watchListItem" . $i . "-0\" value='" . $j . "'>

0 commit comments

Comments
 (0)