Skip to content

Commit

Permalink
ver. 3.0.2
Browse files Browse the repository at this point in the history
ver. 3.0.2
  • Loading branch information
progreccor authored Jun 17, 2021
2 parents 3611e25 + 4f83252 commit 7f142a2
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 49 deletions.
76 changes: 45 additions & 31 deletions media/js/adminscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,57 @@ jQuery(document).ready(function () {
page;
currentGetParams = getUrlParams(location.search);

document.querySelector("#historyclear").addEventListener('click', function (event) {
$("#historyclear").html("Wait...")
.prop('disabled', true);
if ('page' in currentGetParams )
{
page=currentGetParams.page;
}
else
{
page="0";
}
var historyClear = document.querySelector("#historyclear");
if(historyClear)
{
historyClear.addEventListener('click', function (event) {
historyClear.innerHTML = "Wait...";
historyClear.disabled = true;
if ('page' in currentGetParams )
{
page=currentGetParams.page;
}
else
{
page="0";
}

$.getJSON("index.php?option=com_ajax&plugin=radicalform&format=json&group=system&admin=2&page="+page, function (data) {
location.reload();
});
$.getJSON("index.php?option=com_ajax&plugin=radicalform&format=json&group=system&admin=2&page="+page, function (data) {
location.reload();
});

event.preventDefault();
});
event.preventDefault();
});
}

document.querySelector("#numberclear").addEventListener('click', function (event) {
$("#numberclear").html("Wait...")
.prop('disabled', true);
$.getJSON("index.php?option=com_ajax&plugin=radicalform&format=json&group=system&admin=3", function (data) {
location.reload();
var numberClear = document.querySelector("#numberclear");
if(numberClear)
{
numberClear.addEventListener('click', function (event) {
numberClear.innerHTML = "Wait...";
numberClear.disabled = true;
$.getJSON("index.php?option=com_ajax&plugin=radicalform&format=json&group=system&admin=3", function (data) {
location.reload();
});
event.preventDefault();
});
event.preventDefault();
});
}

document.querySelector("#exportcsv").addEventListener('click', function (event) {
var t=document.querySelector("#exportcsv");
var temp=t.outerHTML;
t.outerHTML="<button class='btn' id='exportcsv' disabled>Wait...</button>";
var exportCSV = document.querySelector("#exportcsv");
if(exportCSV)
{
exportCSV.addEventListener('click', function (event) {
var temp=exportCSV.innerHTML;
exportCSV.innerHTML = "Wait...";
exportCSV.disabled = true;

setTimeout(function () {
exportCSV.innerHTML = temp;
exportCSV.disabled = false;
}, 3000)
});
}

setTimeout(function () {
document.querySelector("#exportcsv").outerHTML=temp;
}, 3000)
});



Expand Down
2 changes: 1 addition & 1 deletion media/js/adminscript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions media/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RadicalFormClass = function () {
* @type {array}
*/
this.danger_classes = RadicalForm.DangerClass.trim().split(/\s+/);
RadicalForm.ErrorFile = RadicalForm.ErrorFile.trim().split(/\s+/);
this.error_file_classes = RadicalForm.ErrorFile.trim().split(/\s+/);

if (RadicalForm.KeepAlive != 0) {
window.setInterval(function() {
Expand Down Expand Up @@ -476,18 +476,18 @@ RadicalFormClass = function () {
response = JSON.parse(this.response);
} catch (e) {
console.error(request.status + ' ' + e.message + ' ' + this.response);
rf_filenames_list.insertAdjacentHTML('beforeend', "<div class='" + RadicalForm.ErrorFile + "'>Unknown Error. See Console.</div>");
rf_filenames_list.insertAdjacentHTML('beforeend', "<div class='" + selfClass.error_file_classes.join(' ') + "'>Unknown Error. See Console.</div>");
response = false;
return;
}
if (response.success) {
var el=rf_filenames_list.querySelector("." + RadicalForm.ErrorFile);
var el=rf_filenames_list.querySelector("." + selfClass.error_file_classes.join('.'));

if (el) {
el.parentNode.removeChild(el);
}
if ("error" in response.data[0]) {
rf_filenames_list.insertAdjacentHTML('beforeend', "<div class='" + RadicalForm.ErrorFile + "'>" + response.data[0].error + "</div>");
rf_filenames_list.insertAdjacentHTML('beforeend', "<div class='" + selfClass.error_file_classes.join(' ') + "'>" + response.data[0].error + "</div>");
} else {
if (rf_filenames_list.textContent.trim() === "") {
rf_filenames_list.insertAdjacentHTML('beforeend', "<div>" + RadicalForm.thisFilesWillBeSend + "</div>");
Expand Down Expand Up @@ -517,13 +517,13 @@ RadicalFormClass = function () {
};

} else {
var el=rf_filenames_list.querySelector("." + RadicalForm.ErrorFile);
var el=rf_filenames_list.querySelector("." + selfClass.error_file_classes.join('.'));

if (el) {
el.parentNode.removeChild(el);
}

rf_filenames_list.insertAdjacentHTML('beforeend',"<div class='" + RadicalForm.ErrorFile + "'>" + RadicalForm.ErrorMax + "</div>"); // size is more than limit
rf_filenames_list.insertAdjacentHTML('beforeend',"<div class='" + selfClass.error_file_classes.join(' ') + "'>" + RadicalForm.ErrorMax + "</div>"); // size is more than limit
}

};
Expand Down
Loading

0 comments on commit 7f142a2

Please sign in to comment.