-
Notifications
You must be signed in to change notification settings - Fork 13
/
permissions.html
169 lines (151 loc) · 7 KB
/
permissions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="en">
<head>
<title>EssentialsX Info - Permissions</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/darkly/bootstrap.min.css" />
<style>
code {
cursor: copy;
}
</style>
<script src="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/dt-1.10.18/datatables.min.js"></script>
<script src="./includes/notify.min.js"></script>
<script>
$(document).ready(function() {
$('#main').DataTable( {
"ajax": './data/permissions.json',
"iDisplayLength": -1,
"paging": false,
"deferRender": true,
"columnDefs": [
{
"targets": [0],
"title": "Module"
},
{
"targets": [1],
"title": "Command"
},
{
"targets": [2],
"title": "Permission",
"render": function (data) {
data = data.replace(/\</g,"<").replace(/\>/g,">");
return '<code>'+data+'</code>';
},
"width": "30%"
},
{
"targets": [3],
"title": "Description",
"render": function (data) {
data = data.replace(/\</g,"<").replace(/\>/g,">");
return data;
}
}
]
} );
fixWidth();
$('div.dataTables_filter input').focus();
$.notify.addStyle('copy', {
html: "<div>✔ <span data-notify-text/></div>",
classes: {
base: {
"background-color": "darkgray",
"padding": "5px",
"color": "white"
}
}
});
$('#main').on('click', 'tbody td', function() {
//get column name
var columnNum = $('#main').DataTable().cell(this).index().column;
var columnName = $('#main').DataTable().column(columnNum).header().innerHTML;
if (columnName == "Permission") {
document.getElementById("copyTextarea").value = $('#main').DataTable().cell(this).data();
document.getElementById("copyTextarea").hidden = false;
document.getElementById("copyTextarea").select();
document.execCommand("copy");
document.getElementById("copyTextarea").hidden = true;
$.notify('Copied to clipboard', { style: 'copy', autoHideDelay: 1500, position: "bottom-right"});
}
});
} );
function fixWidth() {
if (getCookie("fullwidth") == "true") {
document.getElementById('maincontainer').classList.remove('container');
} else if (getCookie("fullwidth") == "false") {
document.getElementById('maincontainer').classList.add('container');
} else {
setCookie("fullwidth", "false");
}
}
function changeWidth() {
if (getCookie("fullwidth") == "true") {
setCookie("fullwidth", "false");
} else {
setCookie("fullwidth", "true");
}
fixWidth()
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function setCookie(cname, cvalue) {
var d = new Date();
d.setTime(d.getTime() + (365*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
</script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="../">EssentialsX Info</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="./index.html">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="./permissions.html">Permissions</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./commands.html">Commands</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/EssentialsX/Essentials">GitHub</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://essentialsx.net/downloads.html">Downloads</a>
</li>
</ul>
<a href="https://github.com/Xeyame/essinfo.xeya.me"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat&color=lightgrey"> </a>
<button type="button" class="btn btn-dark ml-2" id="widthSwitch" onclick="changeWidth()">⭾</button>
</div>
</nav>
<br>
<div class="container" id="maincontainer" style="margin-bottom: 50px; padding-bottom: 15px; border-radius: 5px; padding-left: 30px; padding-right: 30px;">
<table class="table table-striped table-sm" style="width:100%" id="main"></table>
<input hidden type="text" id="copyTextarea">
</div>
</body>
</html>