D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
htdocs
/
modules
/
xovi
/
js
/
Filename :
siteaudit.js
back
Copy
Jsw.onReady(function () { var newScanBtn = $('newScanBtn'); if (newScanBtn !== null) { newScanBtn.observe('click', function (event) { Event.stop(event); this.hide(); var loader = $('newScanLoader'); if (loader === null) { new Insertion.After('newScanBtn', '<div id="newScanLoader"><img width="38" height="38" src="/modules/xovi/images/icons/indicator.gif"></div>'); } else { loader.show(); } new Ajax.Request(runScan['url'], { method: 'POST', requestHeaders: {Accept: 'application/json'}, onSuccess: function (transport) { var response = {}; try { response = transport.responseText.evalJSON(true); } catch (e) { } if (typeof response["redirect"] === "string") { location.href = response["redirect"]; return; } $('newScanBtn').show(); $('newScanLoader').hide(); if (typeof response["success"] !== "boolean") { response["success"] = false; } if (!response["success"] && typeof response["message"] !== "string") { response["message"] = runScan['message']; } if (typeof response['ask_credentials'] === "boolean" && response['ask_credentials']) { new Jsw.AjaxPopupForm({ cls: 'popup-panel', title: runScan['form_title'], url: runScan['form_url'] }); } else { Jsw.messageBox.show({ type: Jsw.messageBox.TYPE_YESNO, subtype: 'toggle', text: response['message'], description: '', buttonTitles: { 'yes': runScan['ok'], 'no': runScan['force_start'] }, onNoClick: function () { siteauditForceStart(); } }); } } }); }); } $$('a.siteauditForceStart').each(function (element) { element.observe('click', siteauditForceStart); }); function siteauditForceStart() { if (runScan['url'] !== undefined) { new Ajax.Request(runScan['url'], { method: 'POST', requestHeaders: {Accept: 'application/json'}, parameters: { forceStart: 1 }, onSuccess: function () { location.reload(); } }); } } });