MCPcopy
hub / github.com/alseambusher/crontab-ui / messageBox

Function messageBox

public/js/script.js:22–43  ·  view source on GitHub ↗
(body, title, ok_text, close_text, callback)

Source from the content-addressed store, hash-verified

20}
21
22function messageBox(body, title, ok_text, close_text, callback) {
23 var modalBody = document.getElementById('modal-body');
24 if (typeof body === 'string') {
25 modalBody.innerHTML = body;
26 } else {
27 modalBody.innerHTML = '';
28 modalBody.appendChild(body);
29 }
30 document.getElementById('modal-title').innerHTML = title;
31 if (ok_text) document.getElementById('modal-button').innerHTML = ok_text;
32 if (close_text) document.getElementById('modal-close-button').innerHTML = close_text;
33
34 var btn = document.getElementById('modal-button');
35 var newBtn = btn.cloneNode(true);
36 btn.parentNode.replaceChild(newBtn, btn);
37 newBtn.addEventListener('click', function() {
38 getModal('popup').hide();
39 if (callback) callback();
40 });
41
42 getModal('popup').show();
43}
44
45
46/*********** crontab actions ****************/

Callers 12

deleteJobFunction · 0.85
stopJobFunction · 0.85
startJobFunction · 0.85
runJobFunction · 0.85
setCrontabFunction · 0.85
getCrontabFunction · 0.85
doBackupFunction · 0.85
delete_backupFunction · 0.85
restore_backupFunction · 0.85
import_dbFunction · 0.85
setMailConfigFunction · 0.85
setHookConfigFunction · 0.85

Calls 3

getModalFunction · 0.85
hideMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected