Skip to content

Commit 82255aa

Browse files
author
mreishman
committed
fixed bug with links for websites
1 parent 548dfcc commit 82255aa

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

core/html/changelog.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
<li>
1212
Added option for auto get repo type from poll requests (Only works with poll type 2)
1313
</li>
14+
<li>
15+
Added issue links / branch link into seperate dropdown
16+
</li>
17+
</ul>
18+
</li>
19+
<li>
20+
Bug Fixes
21+
<ul>
22+
<li>
23+
Fixed bug with url not linking properly when loading from cache
24+
</li>
1425
</ul>
1526
</li>
1627
</ul>

core/js/main.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ function pollFailureInner(xhr, error, noSpaceName, nameForBackground)
592592
groupInfo: "",
593593
location: null,
594594
WebsiteBase: null,
595+
website: null,
595596
urlHit: ""
596597
};
597598
}
@@ -614,6 +615,10 @@ function pollFailureInner(xhr, error, noSpaceName, nameForBackground)
614615
{
615616
arrayOfWatchFilters[noSpaceName]["WebsiteBase"] = null;
616617
}
618+
if(!("Website" in arrayOfWatchFilters[noSpaceName]))
619+
{
620+
arrayOfWatchFilters[noSpaceName]["website"] = null;
621+
}
617622
if(!("urlHit" in arrayOfWatchFilters[noSpaceName]))
618623
{
619624
arrayOfWatchFilters[noSpaceName]["urlHit"] = "";
@@ -861,6 +866,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
861866
addGroup(dataInner["groupInfo"]);
862867
if(dataInner['branch'] && dataInner['branch'] != 'Location var is too long.')
863868
{
869+
var linkList = "";
864870
switchToColorLed(noSpaceName, "green");
865871
document.getElementById(noSpaceName+'errorMessageLink').style.display = "none";
866872
document.getElementById(noSpaceName+'noticeMessageLink').style.display = "none";
@@ -902,6 +908,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
902908
if(repoDataPresent)
903909
{
904910
dataBranchForFile += '<a style="color: black;" target="_blank" href="https://'+baseRepoUrl+'/'+repoName+'/tree/'+dataInner['branch']+'">';
911+
linkList += '<a style="color: black;" target="_blank" href="https://'+baseRepoUrl+'/'+repoName+'/tree/'+dataInner['branch']+'">Branch</a>';
905912
}
906913
dataBranchForFile += dataInner['branch'];
907914
if(repoDataPresent)
@@ -945,6 +952,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
945952
{
946953
link = '<a target="_blank" style="color: black;" href="https://'+baseRepoUrl+'/'+repoName+'/issues/'+num+'">'+dataBranchForFileStats[i]+num+'</a>';
947954
dataBranchForFile += " "+link;
955+
linkList += " "+link;
948956
linksFromCommitMessage.push(num.toString());
949957
dataBranchForFileStats = dataBranchForFileStats.replace(dataBranchForFileStats[i]+num,link);
950958
len = dataBranchForFileStats.length;
@@ -974,6 +982,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
974982
{
975983
link = '<a target="_blank" style="color: black;" href="https://'+baseRepoUrl+'/'+repoName+'/issues/'+numForStart+'">#'+numForStart+'</a>';
976984
dataBranchForFile += " "+link;
985+
linkList += " "+link;
977986
}
978987
}
979988

@@ -995,6 +1004,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
9951004
{
9961005
link = '<a target="_blank" style="color: black;" href="https://'+baseRepoUrl+'/'+repoName+'/issues/'+numForEnd+'">#'+numForEnd+'</a>';
9971006
dataBranchForFile += " "+link;
1007+
linkList += " "+link;
9981008
}
9991009
}
10001010

@@ -1020,6 +1030,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
10201030
{
10211031
link = '<a target="_blank" style="color: black;" href="https://'+baseRepoUrl+'/'+repoName+'/issues/'+numForLinkIssue+'">#'+numForLinkIssue+'</a>';
10221032
dataBranchForFile += " "+link;
1033+
linkList += " "+link;
10231034
}
10241035
branchNameTMP = branchNameTMP.substring(numForcalc);
10251036
}
@@ -1067,6 +1078,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
10671078
groupInfo: groupNames,
10681079
location: "location" in dataInner ? dataInner["location"] : null,
10691080
WebsiteBase: "WebsiteBase" in dataInner ? dataInner["WebsiteBase"] : null,
1081+
website: "website" in dataInner ? dataInner["website"] : null,
10701082
branchList: branchList,
10711083
urlHit: urlHit
10721084
};
@@ -1089,14 +1101,15 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
10891101
arrayOfWatchFilters[noSpaceName]["groupInfo"] = groupNames;
10901102
arrayOfWatchFilters[noSpaceName]["location"] = "location" in dataInner ? dataInner["location"] : null;
10911103
arrayOfWatchFilters[noSpaceName]["WebsiteBase"] = "WebsiteBase" in dataInner ? dataInner["WebsiteBase"] : null;
1104+
arrayOfWatchFilters[noSpaceName]["website"] = "website" in dataInner ? dataInner["website"] : null;
10921105
arrayOfWatchFilters[noSpaceName]["branchList"] = branchList;
10931106
arrayOfWatchFilters[noSpaceName]["urlHit"] = urlHit;
10941107
}
10951108

10961109
filterBGColor(dataToFilterBy, nameForBackground, 1);
10971110
arrayOfWatchFilters[noSpaceName]["backgroundColor"] = document.getElementById(nameForBackground).style.backgroundColor;
10981111
//custom message stuff
1099-
(Object.values(dataInner).indexOf('messageTextEnabled') > -1)
1112+
if(Object.values(dataInner).indexOf('messageTextEnabled') > -1)
11001113
{
11011114

11021115
var dateForEnd = dataInner['datePicker'];
@@ -1172,6 +1185,12 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
11721185
}
11731186
}
11741187

1188+
1189+
if(linkList !== "" && linkList !== document.getElementById(noSpaceName+"extraLinks").innerHTML)
1190+
{
1191+
document.getElementById(noSpaceName+"extraLinks").innerHTML = linkList;
1192+
}
1193+
11751194
if(setFadeBool)
11761195
{
11771196
setFade(noSpaceName);
@@ -1207,6 +1226,7 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
12071226
groupInfo: "",
12081227
location: null,
12091228
WebsiteBase: null,
1229+
website: null,
12101230
branchList: false
12111231
};
12121232
}
@@ -1230,6 +1250,10 @@ function pollSuccessInner(dataInner, dataInnerPass, dataInnerPassMaster)
12301250
{
12311251
arrayOfWatchFilters[noSpaceName]["WebsiteBase"] = null;
12321252
}
1253+
if(!("Website" in arrayOfWatchFilters[noSpaceName]))
1254+
{
1255+
arrayOfWatchFilters[noSpaceName]["website"] = null;
1256+
}
12331257
}
12341258
}
12351259
displayDataFromPoll(noSpaceName,dataBranchForFile,dataBranchForFileUpdateTime,dataBranchForFileStats);

core/php/functions/indexFunctions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ function generateWindow($data = array(), $pollType)
179179
$blockHTML .= " <div id=\"".$keyNoSpace."SearchOuter\" style=\"display: none; cursor: pointer; width: 100%;\" >";
180180
$blockHTML .= " <a id=\"".$keyNoSpace."SearchInner\" style=\"color: black;\" target=\"_blank\" href=\"#\">Search</a>";
181181
$blockHTML .= " </div>";
182+
$blockHTML .= " <p style=\"border-bottom: 1px solid black;\" ></p>";
183+
$blockHTML .= " <a style=\"color: black;\" target=\"_blank\" href=\"https://".$website."\">Website</a>";
184+
$blockHTML .= " <div id=\"".$keyNoSpace."extraLinks\"></div> ";
182185
$blockHTML .= " <a id=\"".$keyNoSpace."errorMessageLink\" style=\"cursor: pointer; display: none;\">Error</a> ";
183186
$blockHTML .= " <a id=\"".$keyNoSpace."noticeMessageLink\" style=\"cursor: pointer; display: none;\">Notice</a> ";
184187
$blockHTML .= " </div>";

index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@
221221
{
222222
$website = $value["Website"];
223223
}
224+
if(isset($value['website']))
225+
{
226+
$website = $value["website"];
227+
}
224228

225229
if($showTopBarOfGroups && $defaultGroupViewOnLoad !== "All" && strpos($groupInfo, $defaultGroupViewOnLoad) > -1)
226230
{

0 commit comments

Comments
 (0)