0.0.1
This commit is contained in:
32
resources/[creators]/jobs_creator/utils/dialogs/dialogs.js
Normal file
32
resources/[creators]/jobs_creator/utils/dialogs/dialogs.js
Normal file
@@ -0,0 +1,32 @@
|
||||
function toggleCursor(enabled) {
|
||||
if (enabled) {
|
||||
$.post(`https://${resName}/enableCursor`, JSON.stringify({}));
|
||||
} else {
|
||||
$.post(`https://${resName}/disableCursor`, JSON.stringify({}));
|
||||
}
|
||||
}
|
||||
|
||||
function loadDialog(dialogName) {
|
||||
var script = document.createElement('script');
|
||||
|
||||
script.setAttribute('src',`../utils/dialogs/${dialogName}/${dialogName}.js`);
|
||||
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
// Messages received by client
|
||||
window.addEventListener('message', (event) => {
|
||||
let data = event.data;
|
||||
let action = data.action;
|
||||
|
||||
switch(action) {
|
||||
case "loadDialog": {
|
||||
var script = document.createElement('script');
|
||||
script.setAttribute('src',`../utils/dialogs/${data.dialogName}/${data.dialogName}.js`);
|
||||
document.head.appendChild(script);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.post(`https://${resName}/nuiReady`, JSON.stringify({}));
|
||||
Reference in New Issue
Block a user