Skip to content

Commit

Permalink
Removed qb jobs reference
Browse files Browse the repository at this point in the history
  • Loading branch information
GhzGarage committed Nov 3, 2023
1 parent 2cad614 commit ea8756c
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 133 deletions.
42 changes: 21 additions & 21 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Config = Config or {}

Config.UseTarget = GetConvar('UseTarget', 'false') == 'true' -- Use qb-target interactions (don't change this, go to your server.cfg and add `setr UseTarget true` to use this and just that from true to false or the other way around)

Config.AvailableJobs = { -- Only used when not using qb-jobs.
["trucker"] = {["label"] = "Trucker", ["isManaged"] = false},
["taxi"] = {["label"] = "Taxi", ["isManaged"] = false},
["tow"] = {["label"] = "Tow Truck", ["isManaged"] = false},
["reporter"] = {["label"] = "News Reporter", ["isManaged"] = false},
["garbage"] = {["label"] = "Garbage Collector", ["isManaged"] = false},
["bus"] = {["label"] = "Bus Driver", ["isManaged"] = false},
["hotdog"] = {["label"] = "Hot Dog Stand", ["isManaged"] = false}
Config.AvailableJobs = { -- Only used when not using qb-jobs.
['trucker'] = { ['label'] = 'Trucker', ['isManaged'] = false },
['taxi'] = { ['label'] = 'Taxi', ['isManaged'] = false },
['tow'] = { ['label'] = 'Tow Truck', ['isManaged'] = false },
['reporter'] = { ['label'] = 'News Reporter', ['isManaged'] = false },
['garbage'] = { ['label'] = 'Garbage Collector', ['isManaged'] = false },
['bus'] = { ['label'] = 'Bus Driver', ['isManaged'] = false },
['hotdog'] = { ['label'] = 'Hot Dog Stand', ['isManaged'] = false }
}

Config.Cityhalls = {
Expand All @@ -21,22 +21,22 @@ Config.Cityhalls = {
display = 4,
scale = 0.65,
colour = 0,
title = "City Services"
title = 'City Services'
},
licenses = {
["id_card"] = {
label = "ID Card",
['id_card'] = {
label = 'ID Card',
cost = 50,
},
["driver_license"] = {
label = "Driver License",
['driver_license'] = {
label = 'Driver License',
cost = 50,
metadata = "driver"
metadata = 'driver'
},
["weaponlicense"] = {
label = "Weapon License",
['weaponlicense'] = {
label = 'Weapon License',
cost = 50,
metadata = "weapon"
metadata = 'weapon'
},
}
},
Expand All @@ -51,12 +51,12 @@ Config.DrivingSchools = {
display = 4,
scale = 0.65,
colour = 3,
title = "Driving School"
title = 'Driving School'
},
instructors = {
"DJD56142",
"DXT09752",
"SRI85140",
'DJD56142',
'DXT09752',
'SRI85140',
}
},
}
Expand Down
75 changes: 39 additions & 36 deletions html/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ let selectedIdentityCost = null;
let selectedJob = null;
let selectedJobId = null;

Open = function(jobs) {
Open = function (jobs) {
SetJobs(jobs);
$(".container").fadeIn(150);
}
};

Close = function() {
$(".container").fadeOut(150, function(){
Close = function () {
$(".container").fadeOut(150, function () {
ResetPages();
});
$.post('https://qb-cityhall/close');
$.post("https://qb-cityhall/close");
$(selectedJob).removeClass("job-selected");
$(selectedIdentity).removeClass("job-selected");
}
};

SetJobs = function(jobs) {
$('.job-page-blocks').empty();
SetJobs = function (jobs) {
$(".job-page-blocks").empty();
$.each(jobs, (job, name) => {
let html = `<div class="job-page-block" data-job="${job}"><p>${name.label}</p></div>`;
$('.job-page-blocks').append(html);
})
}
$(".job-page-blocks").append(html);
});
};

ResetPages = function() {
ResetPages = function () {
$(".cityhall-option-blocks").show();
$(".cityhall-identity-page").hide();
$(".cityhall-job-page").hide();
}
};

$(document).ready(function(){
window.addEventListener('message', function(event) {
switch(event.data.action) {
$(document).ready(function () {
window.addEventListener("message", function (event) {
switch (event.data.action) {
case "open":
Open(event.data.jobs);
break;
Expand All @@ -46,26 +46,26 @@ $(document).ready(function(){
SetJobs(event.data.jobs);
break;
}
})
});
});

$(document).on('keydown', function() {
switch(event.keyCode) {
$(document).on("keydown", function () {
switch (event.keyCode) {
case 27: // ESC
Close();
break;
}
});

$('.cityhall-option-block').click(function(e){
$(".cityhall-option-block").click(function (e) {
e.preventDefault();
let blockPage = $(this).data('page');
let blockPage = $(this).data("page");
$(".cityhall-option-blocks").fadeOut(100, () => {
$(`.cityhall-${blockPage}-page`).fadeIn(100);
});
if (blockPage == "identity") {
$(".identity-page-blocks").html("");
$.post('https://qb-cityhall/requestLicenses', JSON.stringify({}), function(licenses){
$.post("https://qb-cityhall/requestLicenses", JSON.stringify({}), function (licenses) {
$.each(licenses, (i, license) => {
let elem = `<div class="identity-page-block" data-type="${i}" data-cost="${license.cost}"><p>${license.label}</p></div>`;
$(".identity-page-blocks").append(elem);
Expand All @@ -74,10 +74,10 @@ $('.cityhall-option-block').click(function(e){
}
});

$(document).on("click", ".identity-page-block", function(e){
$(document).on("click", ".identity-page-block", function (e) {
e.preventDefault();
selectedIdentityType = $(this).data('type');
selectedIdentityCost = $(this).data('cost');
selectedIdentityType = $(this).data("type");
selectedIdentityCost = $(this).data("cost");
if (selectedIdentity == null) {
$(this).addClass("identity-selected");
$(".hover-description").fadeIn(10);
Expand All @@ -96,19 +96,22 @@ $(document).on("click", ".identity-page-block", function(e){
}
});

$(".request-identity-button").click(function(e){
$(".request-identity-button").click(function (e) {
e.preventDefault();
$.post('https://qb-cityhall/requestId', JSON.stringify({
type: selectedIdentityType,
cost: selectedIdentityCost
}))
$.post(
"https://qb-cityhall/requestId",
JSON.stringify({
type: selectedIdentityType,
cost: selectedIdentityCost,
})
);
ResetPages();
});

$(document).on("click", ".job-page-block", function(e){
$(document).on("click", ".job-page-block", function (e) {
e.preventDefault();
selectedJobId = $(this).data('job');
// selectedJobId["application"] = $(this).data('application')
selectedJobId = $(this).data("job");
// selectedJobId["application"] = $(this).data('application')
if (selectedJob == null) {
$(this).addClass("job-selected");
selectedJob = this;
Expand All @@ -124,13 +127,13 @@ $(document).on("click", ".job-page-block", function(e){
}
});

$(document).on('click', '.apply-job-button', function(e){
$(document).on("click", ".apply-job-button", function (e) {
e.preventDefault();
$.post('https://qb-cityhall/applyJob', JSON.stringify(selectedJobId))
$.post("https://qb-cityhall/applyJob", JSON.stringify(selectedJobId));
ResetPages();
});

$(document).on('click', '.back-to-main', function(e){
$(document).on("click", ".back-to-main", function (e) {
e.preventDefault();
$(selectedJob).removeClass("job-selected");
$(selectedIdentity).removeClass("job-selected");
Expand Down
30 changes: 18 additions & 12 deletions html/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css">
<link rel="stylesheet" href="./style.css">
<title>QB Cityhall</title>
</head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" />
<link rel="stylesheet" href="./style.css" />
<title>QB Cityhall</title>
</head>
<body>
<div class="container">
<div class="cityhall-main-container">
<div class="cityhall-header">CITY HALL</div>

<div class="cityhall-option-blocks" style="text-align: center;">
<div class="cityhall-option-block" style="background-color: #ededed" data-page="identity"><i class="far fa-id-card"></i><p>Identity</p></div>
<div class="cityhall-option-block" style="background-color: #ededed" data-page="job"><i class="fas fa-briefcase"></i><p>Employment</p></div>
<div class="cityhall-option-blocks" style="text-align: center">
<div class="cityhall-option-block" style="background-color: #ededed" data-page="identity">
<i class="far fa-id-card"></i>
<p>Identity</p>
</div>
<div class="cityhall-option-block" style="background-color: #ededed" data-page="job">
<i class="fas fa-briefcase"></i>
<p>Employment</p>
</div>
</div>

<div class="cityhall-identity-page">
Expand Down
Loading

0 comments on commit ea8756c

Please sign in to comment.