remove old compatible fonia3

add 404 page request
fixed minor on table
This commit is contained in:
2023-12-31 10:49:03 +07:00
parent 7b7868ba10
commit 14c7d51d4d
3 changed files with 20 additions and 83 deletions
+14 -81
View File
@@ -4,7 +4,7 @@
Desc. : JS - Fonia Custom Class v3
Created By : Siau Pheng ([email protected]).
Created Date : June 19th, 2009.
Last Modified : October 30th, 2023.
Last Modified : December 30th, 2023.
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
@@ -24,39 +24,7 @@ var FoniaJS = {
phpversion: "",
locales: [],
deflocal: "",
_amenu: [//compatible, remove then !
["A", "butAdd", "Tambah", "primary"],
["B", "butPDF", "PDF", "info"],
["C", "butCancel", "Batal", "danger"],
["D", "butDel", "Hapus", "warning"],
["E", "butEdit", "Ubah", "primary"],
["F", "butFind", "Cari", "info"],
["I", "butInfo", "Info", "info"],
["K", "butLock", "Kunci", "info"],
["L", "butExcel", "Excel", "info"],
["M", "butSend", "Kirim", "info"],
["O", "butDownload", "Download", "info"],
["P", "butPrint", "Cetak", "info"],
["R", "butRefresh", "Update", "info"],
["S", "butSave", "Simpan", "success"],
["T", "butFilter", "Filter", "info"],
["V", "butPreview", "Tampil", "info"],
["X", "butProcess", "Proses", "warning"],
["PP", "butPPrint", "Cetak", "info"],
["PN", "butPNormal", "Normal", "info"],
["PS", "butPSmall", "Zoom -", "info"],
["PB", "butPBig", "Zoom +", "info"],
["WO", "butWOK", "OK", "primary"],
["WC", "butWCancel", "Batal", "danger"],
["WS", "butWSave", "Simpan", "success"],
["WK", "butWClose", "Tutup", "danger"],
["WZ", "butWSelAll", "Cek Semua", "info"],
["WX", "butWClrAll", "Hapus Semua", "info"],
["WH", "butWShwAll", "Tampil Semua", "info"],
["ST", "butSTerima", "Terima", "success"],
["SO", "butSTolak", "Tolak", "danger"],
["SB", "butSBelum", "Belum", "secondary"],
],
_debug: (jQuery.inArray(location.hostname, ["localhost","127.0.0.1"]) !== -1) ? true : false;
setConfig: function(key, skey) {//oke
var _hasil, _adata = null;
@@ -83,7 +51,6 @@ var FoniaJS = {
callMenu: function(p, q) {//oke
var apar = ["p=" + p];
if (q != null) apar.push("q=" + q);
//this.closeAllWindows();
new Request.JSON({
url: this.WEB_PATH + "auth.php",
sendParam: apar,
@@ -111,7 +78,6 @@ var FoniaJS = {
}.bind(this)
}).send();
} else {
//$("#pageToolbarTop").html(this.genToolButton(apop.button));
$("#pageToolbarBot").html(this.genToolButton(apop.button));
new Request({
url: this.WEB_PATH + "apps/php/" + apop.php,
@@ -284,26 +250,8 @@ var FoniaJS = {
});
smenu += '</div>';
return smenu;
}
//compatible, remove then !
var tom = menu.split(",");
var amenu = this._amenu;
if (tom.length > 0) {
var ma = 'me-2'; smenu = '<div>';
$.each(tom, function(i, vtom) {
if (vtom == "_") {
smenu += '</div><div>';
ma = 'ms-2';
} else {
$.each(amenu, function(i, subm) {
if (vtom == subm[0]) {
var _xt = (-1!==$.inArray(vtom, ['C','WC','WK','WC2','WK2'])) ? ' data-bs-dismiss="modal"' : '';
smenu += '<button type="button" class="btn btn-'+subm[3]+' '+ma+'" id="'+subm[1]+'"'+_xt+'>' + subm[2] + '</button>';
}
});
}
});
smenu += '</div>';
} else {
if (this._debug) console.log('menu not object'+menu);
}
return smenu;
},
@@ -324,24 +272,8 @@ var FoniaJS = {
});
smenu += '</div></div>';
return smenu;
}
//compatible, remove then !
var tom = menu.split(",");
var amenu = this._amenu;
if (tom.length > 0) {
smenu = '<div class="row mb-2">';
$.each(tom, function(i, vtom) {
if (vtom == "_") {
smenu += '<div class="d-none d-lg-block col-6 col-md-2 col-xl-2 mb-3">&nbsp;</div>';
} else {
$.each(amenu, function(i, subm) {
if (vtom == subm[0]) {
smenu += '<div class="col-6 col-md-3 col-xl-2 mb-3"><button type="button" class="btn btn-block btn-outline-'+subm[3]+'" id="'+subm[1]+'">' + subm[2] + '</button></div>';
}
});
}
});
smenu += "</div>";
} else {
if (this._debug) console.log('menu not object'+menu);
}
return smenu;
},
@@ -659,7 +591,8 @@ var Request = function(options){
};
this.send = function(){
if (!vars.url) {
alert(vars.sendParam + ", cek url php!");//todo: debug
//if (this._debug)
console.log(vars.sendParam + ", cek url php!");
return false;
}
vars.data = FoniaJS.RequestParam(vars.sendParam);
@@ -689,7 +622,8 @@ Request.JSON = function(options){//oke
};
this.send = function(){
if (!vars.url) {
alert(vars.sendParam + ", cek url php!");//todo: debug
//if (this._debug)
console.log(vars.sendParam + ", cek url php!");
return false;
}
vars.data = FoniaJS.RequestParam(vars.sendParam);
@@ -720,7 +654,8 @@ Request.JSONF = function(options){//oke
};
this.send = function(){
if (!vars.url) {
alert(vars.sendParam + ", cek url php!");//todo: debug
//if (this._debug)
console.log(vars.sendParam + ", cek url php!");
return false;
}
vars.data = FoniaJS.RequestParam(vars.sendParam);
@@ -733,7 +668,6 @@ Request.JSONF = function(options){//oke
for (var no = 0; no < data.length; no++) {
var ini = data[no];
if (ini.type == "table" && $(ini.id)) make_table(ini);
//if (ini.type == "table_db" && $(ini.id)) make_table_db(ini);
if (ini.type == "form" && $(ini.id)) make_form(ini);
if (ini.type == "option" && $(ini.id)) make_option(ini);
if (ini.type == "html" && $(ini.id)) make_html(ini);
@@ -859,7 +793,7 @@ Request.JSONF = function(options){//oke
$(divData).append(strTab + strHead + strBody + strFoot + '</table>');
var opsi = { responsive: true, columnDefs: [{responsivePriority:1,targets:0},{responsivePriority:2,targets:1}], lengthMenu: [], dom: '<"row"<"col-sm-12"tr>><"row"<"col-sm-12 col-lg-auto"<"toolbar">><"col-sm-3 col-lg-auto ms-lg-auto"l><"col-sm-9 col-lg-auto"p>>', autoWidth: false, processing: true, searching: false, columns: aSortCol, order: [[iCol, (ini.config.sort_dir=='A'?'asc':'desc')]], pageLength: ini.config.row_count, stateSave: true, stateSaveCallback: function(sett,data){localStorage.setItem(ini.id,JSON.stringify(data));}, stateLoadCallback: function(sett){try{var data=JSON.parse(localStorage.getItem(ini.id))??{};data.length=ini.config.row_count;return data;}catch(e){console.log(e)}} };
/*****/
/** start live db **/
if (ini.config.live){
var post_data = {};
$(vars.data).map(function(key, item){
@@ -913,12 +847,11 @@ Request.JSONF = function(options){//oke
jsono.data[key].push(_tbtn1+_tbtn2);
}
});
return JSON.stringify(jsono);
}
};
}
/******/
/** end live db **/
if (ini.option.length > 0) opsi.columnDefs.push({responsivePriority:3,targets:-1}, {orderable:false,targets:-1});
if (ini.navi.func_navi == '') opsi.paging = false;