fixed change of framework
This commit is contained in:
+36
-30
@@ -4,7 +4,7 @@
|
||||
Desc. : JS - Fonia Custom Class v3
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : June 19th, 2009.
|
||||
Last Modified : February 10th, 2026.
|
||||
Last Modified : September 4th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -58,8 +58,8 @@ var FoniaJS = {
|
||||
},
|
||||
callMenu: function(p, q) {
|
||||
var apar = ["p=" + p];
|
||||
if (q != null) apar.push("q=" + q);
|
||||
new Request.JSON({
|
||||
if (q !== null) apar.push("q=" + q);
|
||||
new Request({
|
||||
url: "auth/menu",
|
||||
sendParam: apar,
|
||||
onSuccess: (apop) => {
|
||||
@@ -68,29 +68,29 @@ var FoniaJS = {
|
||||
setTimeout(() => { self.location = self.location.href; }, 1600);
|
||||
return false;
|
||||
}
|
||||
if (apop.php == "" || !window[apop.func]) {
|
||||
if (apop.php === "" || !window[apop.func]) {
|
||||
this.showErrorLocale("Fonia.page404");
|
||||
return false;
|
||||
}
|
||||
window[apop.func]['PHP'] = apop.php;
|
||||
window[apop.func]['KODE'] = apop.kode;
|
||||
if (apop.iswindow == true) {
|
||||
if (IndexJS.loading) IndexJS.loading();
|
||||
new Request.JSON({
|
||||
if (apop.iswindow === true) {
|
||||
if (IndexJS.index) IndexJS.index();
|
||||
new Request({
|
||||
url: apop.php + '/index',
|
||||
onSuccess: (ajson) => {
|
||||
this.showWindow(apop.kode, apop.title, ajson.html, apop.width, apop.button, () => {
|
||||
if (typeof window[apop.func]['loading'] === 'function') window[apop.func]['loading'](q);
|
||||
if (typeof window[apop.func]['index'] === 'function') window[apop.func]['index'](q);
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
} else {
|
||||
$("#pageToolbarBot").html(this.genToolButton(apop.button));
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: apop.php + '/index',
|
||||
onSuccess: (ajson) => {
|
||||
$('#pageContent').html(ajson.html);
|
||||
if (typeof window[apop.func]['loading'] === 'function') window[apop.func]['loading'](q);
|
||||
if (typeof window[apop.func]['index'] === 'function') window[apop.func]['index'](q);
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
@@ -112,12 +112,12 @@ var FoniaJS = {
|
||||
if ($('#HomeLink').length){
|
||||
$('#HomeLink').click(() => {
|
||||
this.closeAllWindows();
|
||||
if (IndexJS.loading) IndexJS.loading();
|
||||
if (IndexJS.index) IndexJS.index();
|
||||
});
|
||||
}
|
||||
if ($('#ExitLink').length) {
|
||||
$('#ExitLink').click(() => {
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: "auth/logout",
|
||||
onFailure: () => {
|
||||
self.location = self.location.href;
|
||||
@@ -157,11 +157,11 @@ var FoniaJS = {
|
||||
var _buover = (buserover == null) ? false : buserover;
|
||||
var _tsid = parseInt(Math.random() * 99999999);
|
||||
var _ceksuper = null;
|
||||
var _isi = new String('<div class="row mb-1" id="Auth_SP1"><div class="col-sm-6 col-lg-5">Username</div><div class="col-sm-6 col-lg-7"><input type="text" class="form-control" id="UID" name="UID" value="'+((_bsuper==false)?this.User.ID:'')+'" required="true"></div></div><div class="row mb-1" id="Auth_SP2"><div class="col-sm-6 col-lg-5">Password</div><div class="col-sm-6 col-lg-7"><input type="password" class="form-control" id="PWD" name="PWD" value="" required="true"></div></div><div class="row mb-1 d-none" id="Auth_SP3"><div class="col-12 text-center"><p>'+this.locale("Fonia.auth_wait_msg")+'</p></div></div><hr class="my-2"><div class="row mt-1"><div class="col-4"><button type="button" class="btn btn-outline-primary shadow-none" id="butSReq">Request</button></div><div class="col-8 text-end"><button type="button" class="btn btn-danger me-2" id="butSBatal" data-bs-dismiss="modal">Batal</button><button type="button" class="btn btn-success" id="butSOK">OK</button></div></div>');
|
||||
var _isi = new String('<div class="row mb-1" id="Auth_SP1"><div class="col-sm-6 col-lg-5">Username</div><div class="col-sm-6 col-lg-7"><input type="text" class="form-control" id="UID" name="UID" value="'+((_bsuper===false)?this.User.ID:'')+'" required="true"></div></div><div class="row mb-1" id="Auth_SP2"><div class="col-sm-6 col-lg-5">Password</div><div class="col-sm-6 col-lg-7"><input type="password" class="form-control" id="PWD" name="PWD" value="" required="true"></div></div><div class="row mb-1 d-none" id="Auth_SP3"><div class="col-12 text-center"><p>'+this.locale("Fonia.auth_wait_msg")+'</p></div></div><hr class="my-2"><div class="row mt-1"><div class="col-4"><button type="button" class="btn btn-outline-primary shadow-none" id="butSReq">Request</button></div><div class="col-8 text-end"><button type="button" class="btn btn-danger me-2" id="butSBatal" data-bs-dismiss="modal">Batal</button><button type="button" class="btn btn-success" id="butSOK">OK</button></div></div>');
|
||||
this.winSAuth = this.showWindow('SAuth', ((this.AUTH_LEVEL < 9 && _bsuper == true) ? this.locale("Fonia.auth_super") : this.locale("Fonia.auth_user")), _isi, 200, '', () => {
|
||||
$('#butSOK').click(() => {
|
||||
$('#butSOK').prop('disabled', true);
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: "auth/supervisi",
|
||||
sendParam: ["data=super-check", "UID", "PWD", "SUPER=" + _bsuper, "UOVER=" + _buover],
|
||||
onSuccess: (adata) => {
|
||||
@@ -177,7 +177,7 @@ var FoniaJS = {
|
||||
$('#butSBatal').click(() => {
|
||||
if (_ceksuper) {
|
||||
clearInterval(_ceksuper);
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: "auth/supervisi",
|
||||
sendParam: ["data=super-cancel", "KODE=" + ocall.KODE, "REQ_SID=" + this.APP_SID, "REQ=" + _tsid]
|
||||
}).send();
|
||||
@@ -189,16 +189,16 @@ var FoniaJS = {
|
||||
$('#Auth_SP2').addClass('d-none');
|
||||
$('#Auth_SP3').removeClass('d-none');
|
||||
$('#butSOK').prop('disabled', true);
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: "auth/supervisi",
|
||||
sendParam: ["data=super-request", "KODE=" + ocall.KODE, "REQ_SID=" + this.APP_SID, "REQ=" + _tsid, "MSG=" + tmsg]
|
||||
}).send();
|
||||
var _cobalagi = 5;
|
||||
_ceksuper = setInterval(() => {
|
||||
$('#butSBatal').html(this.locale("Fonia.cancel") + " (" + _cobalagi + ")");
|
||||
if (_cobalagi == 0) {
|
||||
if (_cobalagi === 0) {
|
||||
clearInterval(_ceksuper);
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: "auth/supervisi",
|
||||
sendParam: ["data=super-cancel", "KODE=" + ocall.KODE, "REQ_SID=" + this.APP_SID, "REQ=" + _tsid]
|
||||
}).send();
|
||||
@@ -206,11 +206,11 @@ var FoniaJS = {
|
||||
this.showErrorLocale("Fonia.auth_fail");
|
||||
return false;
|
||||
}
|
||||
new Request.JSON({
|
||||
new Request({
|
||||
url: "auth/supervisi",
|
||||
sendParam: ["data=request-check", "KODE=" + ocall.KODE, "REQ_SID=" + this.APP_SID, "REQ=" + _tsid],
|
||||
onSuccess: (adata) => {
|
||||
if (adata.status == 1) {
|
||||
if (adata.status === 1) {
|
||||
clearInterval(_ceksuper);
|
||||
this.showInfoLocale("Fonia.auth_success");
|
||||
fungcall();
|
||||
@@ -224,14 +224,14 @@ var FoniaJS = {
|
||||
});
|
||||
$('#UID').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) {
|
||||
if (e.currentTarget.value != '') $('#PWD').focus();
|
||||
if (e.currentTarget.value !== '') $('#PWD').focus();
|
||||
}
|
||||
});
|
||||
$('#PWD').keyup((e) => {
|
||||
if (e.currentTarget.value == '') return false;
|
||||
if (e.currentTarget.value === '') return false;
|
||||
if (13 == e.which) $('#butSOK').trigger('click');
|
||||
});
|
||||
if (_bsuper == false) {
|
||||
if (_bsuper === false) {
|
||||
FoniaJS.setFocus("#PWD");
|
||||
} else {
|
||||
FoniaJS.setFocus("#UID");
|
||||
@@ -273,8 +273,7 @@ var FoniaJS = {
|
||||
} else {
|
||||
if (atom.i == 'butTutup') { atom.v='Tutup', atom.c='danger', atom.d='' };
|
||||
if (atom.i == 'butBatal') { atom.v='Batal', atom.c='danger', atom.d='' };
|
||||
var _xt = "";//(typeof atom?.d !== 'undefined') ? ' data-bs-dismiss="modal"' : '';
|
||||
smenu += '<button type="button" class="btn btn-'+(atom?.c ?? 'info')+' mb-2 mb-sm-0'+ma+' col-10 col-sm-3" id="'+atom.i+'"'+_xt+'>' + atom.v + '</button>';
|
||||
smenu += '<button type="button" class="btn btn-'+(atom?.c ?? 'info')+' mb-2 mb-sm-0'+ma+' col-10 col-sm-3" id="'+atom.i+'">' + atom.v + '</button>';
|
||||
}
|
||||
});
|
||||
smenu += '</div></div>';
|
||||
@@ -344,7 +343,7 @@ var FoniaJS = {
|
||||
elm.on('click', () => {
|
||||
const oclic = elm.attr('ochan') ?? '';
|
||||
const elp = $('#'+elm.attr('name'));
|
||||
if (elm.is(':checked')) elp.val(elm.val());
|
||||
if (elp && elm.is(':checked')) elp.val(elm.val());
|
||||
if (oclic) {
|
||||
var fnc = oclic.split('.');
|
||||
if (typeof window[fnc[0]][fnc[1]] === 'function'){
|
||||
@@ -358,7 +357,7 @@ var FoniaJS = {
|
||||
elm.on('change', () => {
|
||||
const odata = JSON.parse(elm.attr('odata') ?? '[]');
|
||||
const ochan = elm.attr('ochan') ?? '';
|
||||
elm.val(elm.is(':checked') ? odata[0] : odata[1]);
|
||||
if (odata.length > 0) elm.val(elm.is(':checked') ? odata[0] : odata[1]);
|
||||
if (ochan) {
|
||||
var fnc = ochan.split('.');
|
||||
if (typeof window[fnc[0]][fnc[1]] === 'function'){
|
||||
@@ -505,7 +504,7 @@ var FoniaJS = {
|
||||
'<div class="modal-dialog modal-dialog-centered '+_ctipe+' modal-400" role="document">'+
|
||||
'<div class="modal-content">'+
|
||||
'<div class="modal-header"><h5 class="modal-title" id="winAPPConfLabel">'+str_judul+'</h5><button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close"></button></div>'+
|
||||
'<div class="modal-body text-center mh-100">'+str_isi+'</div>'+
|
||||
'<div class="modal-body text-center text-break mh-100">'+str_isi+'</div>'+
|
||||
'<div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tidak</button><button type="button" class="btn '+_btipe+' ms-2" id="winConfirmY">Ya</button></div>'+
|
||||
'</div></div></div>';
|
||||
if ($('#winAPPConf').length) $('#winAPPConf').modal('dispose').remove();
|
||||
@@ -641,7 +640,7 @@ class _Request {
|
||||
onSuccess: () => {},
|
||||
onFailure: () => {},
|
||||
data: null,
|
||||
dataType: 'text'
|
||||
dataType: 'json'
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
@@ -669,7 +668,7 @@ class _Request {
|
||||
|
||||
class _Request_JSONF extends _Request {
|
||||
constructor(options) {
|
||||
const _options = Object.assign({}, options, {'dataType':'json'});
|
||||
const _options = Object.assign({}, options);
|
||||
_options.onSuccess = (data) => {
|
||||
if (data.length > 0) {
|
||||
$(data).each((i, ini) => {
|
||||
@@ -1018,11 +1017,18 @@ var Request = function (options) {
|
||||
return new _Request(options);
|
||||
};
|
||||
|
||||
/*
|
||||
Request.JSON = function (options) {
|
||||
const _options = Object.assign({}, options, { 'dataType': 'json' });
|
||||
return new _Request(_options);
|
||||
};
|
||||
|
||||
Request.TEXT = function (options) {
|
||||
const _options = Object.assign({}, options, { 'dataType': 'text' });
|
||||
return new _Request(_options);
|
||||
};
|
||||
*/
|
||||
|
||||
Request.JSONF = function(options){
|
||||
return new _Request_JSONF(options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user