mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-26 15:13:00 -05:00
fixed aliases
fixed forum decoding of thread content fixed escaping html "special" characters in player names on webfront fixed findall not always informing if no matches found.
This commit is contained in:
@ -1,34 +1,29 @@
|
||||
<script>
|
||||
var curFrom = 0;
|
||||
var curFrom = 0;
|
||||
|
||||
function getNextPage()
|
||||
{
|
||||
curFrom += 15;
|
||||
return curFrom;
|
||||
}
|
||||
function getNextPage() {
|
||||
curFrom += 15;
|
||||
return curFrom;
|
||||
}
|
||||
|
||||
function getPrevPage()
|
||||
{
|
||||
if ((curFrom - 15) >= 0)
|
||||
{
|
||||
curFrom -= 15;
|
||||
return (curFrom );
|
||||
}
|
||||
else
|
||||
{
|
||||
curFrom = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function getPrevPage() {
|
||||
if ((curFrom - 15) >= 0) {
|
||||
curFrom -= 15;
|
||||
return (curFrom);
|
||||
}
|
||||
else {
|
||||
curFrom = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function getPenalties(from)
|
||||
{
|
||||
$("#penaltyList").html("");
|
||||
$(".loader").fadeIn();
|
||||
$.getJSON("/_penalties?from=" + from, function(result) {
|
||||
$.each(result, function(i, penalty) {
|
||||
$("#penaltyList").append(
|
||||
"<div class=\"playerPenalty table alternate_" + i % 2 + "\"> \
|
||||
function getPenalties(from) {
|
||||
$("#penaltyList").html("");
|
||||
$(".loader").fadeIn();
|
||||
$.getJSON("/_penalties?from=" + from, function (result) {
|
||||
$.each(result, function (i, penalty) {
|
||||
$("#penaltyList").append(
|
||||
"<div class=\"playerPenalty table alternate_" + i % 2 + "\"> \
|
||||
<div class=\"penaltyName tableCell\"><a href=\"/players?id="+ penalty['playerID'] + "\">" + penalty['playerName'] + "</a></div> \
|
||||
<div class=\"penaltyType tableCell\">"+ getColorForLevel(penalty['penaltyType'], penalty['penaltyType']) + "</div> \
|
||||
<div class=\"penaltyReason tableCell\">"+ penalty['penaltyReason'] + "</div> \
|
||||
@ -36,28 +31,28 @@ function getPenalties(from)
|
||||
<div class=\"penaltyTime tableCell\">"+ penalty['penaltyTime'] + "</div> \
|
||||
<div class=\" penaltyRemaining tableCell\">" + penalty['Expires'] + "</div> \
|
||||
</div>"
|
||||
)
|
||||
});
|
||||
)
|
||||
});
|
||||
|
||||
}).done(function (data) { $(".loader").fadeOut(); });
|
||||
}
|
||||
$( document ).ready(function() {
|
||||
getPenalties(0);
|
||||
});
|
||||
}).done(function (data) { $(".loader").fadeOut(); });
|
||||
}
|
||||
$(document).ready(function () {
|
||||
getPenalties(0);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="penaltyHeader table">
|
||||
<div class="penaltyName tableCell">Name</div>
|
||||
<div class="penaltyType tableCell">Type</div>
|
||||
<div class="penaltyReason tableCell">Reason</div>
|
||||
<div class="penaltyOrigin tableCell">Admin</div>
|
||||
<div class="penaltyTime tableCell">Time</div>
|
||||
<div class="penaltyRemaining tableCell">Remaining</div>
|
||||
<div class="penaltyName tableCell">Name</div>
|
||||
<div class="penaltyType tableCell">Type</div>
|
||||
<div class="penaltyReason tableCell">Reason</div>
|
||||
<div class="penaltyOrigin tableCell">Admin</div>
|
||||
<div class="penaltyTime tableCell">Time</div>
|
||||
<div class="penaltyRemaining tableCell">Remaining</div>
|
||||
</div>
|
||||
<div id="penaltyList">
|
||||
</div>
|
||||
<hr />
|
||||
<div id="paginationButtons" class="table">
|
||||
<div id="paginationButtons" class="table">
|
||||
<div id="previousPage" class="tableCell"><a href=# onclick="getPenalties(getPrevPage())"><<</a></div>
|
||||
<div id="nextPage" class="tableCell"><a href=# onclick="getPenalties(getNextPage())">>></a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,14 @@
|
||||
|
||||
<script>
|
||||
function escapeHtml(unsafe) {
|
||||
return unsafe
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
var curFrom = 0;
|
||||
|
||||
function getNextPage() {
|
||||
@ -9,18 +19,22 @@
|
||||
function getPrevPage() {
|
||||
if ((curFrom - 15) >= 0) {
|
||||
curFrom -= 15;
|
||||
return (curFrom - 15);
|
||||
return (curFrom);
|
||||
}
|
||||
else
|
||||
else {
|
||||
curFrom = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function formatHidden(data, authed) {
|
||||
var p = "<div class=\"hiddenWrapper\"><span>Expand</span><div class=\"hiddenElements\">";
|
||||
|
||||
if (authed) {
|
||||
if (data == undefined || data.length == 0)
|
||||
p += "Not Loaded"
|
||||
$.each(data, function (i, dat) {
|
||||
p += "<span>" + dat + "</span><br/>"
|
||||
p += "<span>" + escapeHtml(dat) + "</span><br/>"
|
||||
})
|
||||
}
|
||||
|
||||
@ -36,7 +50,7 @@
|
||||
var p = "";
|
||||
p +=
|
||||
"<div class=\"playerInfo table alternate_" + i % 2 + "\"> \
|
||||
<div class=\"tableCell\"><a href=\"/players?id=" + player['playerID'] + "\">" + player['playerName'] + "</a></div> \
|
||||
<div class=\"tableCell\"><a href=\"/players?id=" + player['playerID'] + "\">" + escapeHtml(player['playerName']) + "</a></div> \
|
||||
<div class=\"tableCell\">" + formatHidden(player['playerAliases'], player.authed) + "</div> \
|
||||
<div class=\"tableCell\">" + formatHidden(player['playerIPs'], player.authed) + "</div> \
|
||||
<div class=\"tableCell\">" + getColorForLevel(player['playerLevel'], player['playerLevel']) + "</div> \
|
||||
@ -73,7 +87,8 @@
|
||||
$.each(result, function (i, player) {
|
||||
printPlayer(player, i);
|
||||
});
|
||||
}).done(function (data) { $(".loader").fadeOut(); });
|
||||
}).done(function (data) { $(".loader").fadeOut(); })
|
||||
.error(function (data) { $(".loader").fadeOut(); })
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
Reference in New Issue
Block a user