Add clientside job label utils

This commit is contained in:
Vortrex
2020-12-27 22:02:56 -06:00
parent e2d2aac6ad
commit 3f14e9bc82

View File

@@ -131,6 +131,40 @@ addNetworkHandler("ag.bizlabel.all", function(tempBusinessLabels) {
// ----------------------------------------------------------------------------
addNetworkHandler("ag.joblabel.all", function(tempJobLabels) {
for(let i in tempJobLabels) {
jobLabels.push(new jobLabelData(tempJobLabels[i][0], tempJobLabels[i][1], tempJobLabels[i][2], tempJobLabels[i][3], tempJobLabels[i][4], tempJobLabels[i][5]));
}
return true;
});
// ----------------------------------------------------------------------------
addNetworkHandler("ag.joblabel.add", function(labelId, position, height, name, locked, hidden) {
jobLabels.push(new jobLabelData(labelId, position, height, name, locked, hidden));
return true;
});
// ----------------------------------------------------------------------------
addNetworkHandler("ag.joblabel.del", function(labelId) {
for(let i in jobLabels) {
if(jobLabels[i].labelId == labelId) {
jobLabels.splice(i, 1);
}
}
return true;
});
// ----------------------------------------------------------------------------
addNetworkHandler("ag.joblabel.name", function(labelId, name) {
getJobLabelData(labelId).name = name;
return true;
});
// ----------------------------------------------------------------------------
addNetworkHandler("ag.houselabel.add", function(labelId, position, height, name, locked, hidden) {
houseLabels.push(new houseLabelData(labelId, position, height, name, locked, hidden));
return true;
@@ -147,15 +181,6 @@ addNetworkHandler("ag.houselabel.all", function(tempHouseLabels) {
// ----------------------------------------------------------------------------
addNetworkHandler("ag.joblabel.all", function(tempJobLabels) {
for(let i in tempJobLabels) {
jobLabels.push(new jobLabelData(tempJobLabels[i][0], tempJobLabels[i][1], tempJobLabels[i][2], tempJobLabels[i][3], tempJobLabels[i][4], tempJobLabels[i][5]));
}
return true;
});
// ----------------------------------------------------------------------------
addNetworkHandler("ag.houselabel.name", function(labelId, name) {
getHouseLabelData(labelId).name = name;
return true;
@@ -201,6 +226,16 @@ function getHouseLabelData(labelId) {
// ----------------------------------------------------------------------------
function getJobLabelData(labelId) {
for(let i in jobLabels) {
if(jobLabels[i].labelId == labelId) {
return jobLabels[i];
}
}
}
// ----------------------------------------------------------------------------
function renderPropertyLabel(labelData, isBusiness) {
if(labelData.hidden) {
return false;