Add faction rank management CEF
This commit is contained in:
34
Client/FactionManagement/Ranks/index.html
Normal file
34
Client/FactionManagement/Ranks/index.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!--
|
||||
* @overview Life of German Reallife - Client Save.html
|
||||
* @author hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*-->
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="de" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table id="rank-table">
|
||||
<tr><td>some</td><td>entry</td></tr>
|
||||
</table>
|
||||
|
||||
<script src="../../Dependences/jquery-3.3.1.min.js"></script>
|
||||
<script src="../../Dependences/jquery.tablednd.0.8.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
mp.trigger("onManageFactionRanksLoaded");
|
||||
});
|
||||
|
||||
function loadData(rankData) {
|
||||
var obj = JSON.parse(rankData);
|
||||
obj.forEach(function (rank) {
|
||||
$("table#rank-table").append(rank);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1
Client/FactionManagement/Ranks/script.js
Normal file
1
Client/FactionManagement/Ranks/script.js
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
3
Client/FactionManagement/Ranks/style.css
Normal file
3
Client/FactionManagement/Ranks/style.css
Normal file
@@ -0,0 +1,3 @@
|
||||
body
|
||||
{
|
||||
}
|
||||
25
Client/FactionManagement/main.js
Normal file
25
Client/FactionManagement/main.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - Faction Manager Main (main.js)
|
||||
* @author hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
var manageBrowser = null;
|
||||
var rankData = null;
|
||||
|
||||
mp.events.add('manageFactionRanks', (ranks) => {
|
||||
if (manageBrowser !== null) return;
|
||||
manageBrowser = mp.browsers.new('package://FactionManagement/Ranks/index.html');
|
||||
mp.gui.cursor.show(true, true);
|
||||
//mp.gui.chat.activate(false);
|
||||
mp.gui.chat.push(ranks);
|
||||
rankData = ranks;
|
||||
});
|
||||
|
||||
mp.events.add('onManageFactionRanksLoaded', () => {
|
||||
mp.gui.chat.push("loaded page");
|
||||
if (manageBrowser !== null) {
|
||||
manageBrowser.execute(`loadData(` + rankData + `)`);
|
||||
mp.gui.chat.push(rankData);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user