Ajax file upload make all fuctions "afus" prefixed
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
/* jshint esversion: 6 */
|
||||
|
||||
/* global initAjaxUploader, keyInObject, errorCatch, showActionIndicator, hideActionIndicator, exists, phfo, aelx, cel */
|
||||
/* global initAjaxUploader, afusKeyInObject, afusErrorCatch, showActionIndicator, hideActionIndicator, exists, phfo, aelx, cel */
|
||||
|
||||
/**
|
||||
* clear the alert div and hide it
|
||||
@@ -30,7 +30,7 @@ function printMsg(msg) {
|
||||
var content = [];
|
||||
for (const t of msg) {
|
||||
// console.log('v: %s, t: %o', v, t);
|
||||
if (keyInObject('code', t) && t.code != null && t.code.length > 0) {
|
||||
if (afusKeyInObject('code', t) && t.code != null && t.code.length > 0) {
|
||||
t.str = '[' + t.code + '] ' + t.str;
|
||||
}
|
||||
content.push(phfo(cel('div', '', t.str, ['error-' + t.level])));
|
||||
@@ -57,7 +57,7 @@ function printMsg(msg) {
|
||||
*/
|
||||
function ajaxWrapper(call_id, queryString = {}, control = {}, url = 'backend.php') {
|
||||
var no_action_indicator = false;
|
||||
if (keyInObject('no_action_indicator', control)) {
|
||||
if (afusKeyInObject('no_action_indicator', control)) {
|
||||
no_action_indicator = control.no_action_indicator ? true : false;
|
||||
}
|
||||
// if inidicator not visible, show before
|
||||
@@ -226,7 +226,7 @@ function fileUploadedFunction(target_file, file_pos, target_router, control_data
|
||||
}
|
||||
}
|
||||
} catch(err) {
|
||||
errorCatch(err);
|
||||
afusErrorCatch(err);
|
||||
}
|
||||
// chain action test
|
||||
var call_id = 'chainAction';
|
||||
@@ -250,7 +250,7 @@ function fileUploadedFunction(target_file, file_pos, target_router, control_data
|
||||
// top message
|
||||
printMsg(data.msg);
|
||||
} catch (err) {
|
||||
errorCatch(err);
|
||||
afusErrorCatch(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -316,7 +316,7 @@ $(document).ready(function () {
|
||||
// top message
|
||||
printMsg(data.msg);
|
||||
} catch (err) {
|
||||
errorCatch(err);
|
||||
afusErrorCatch(err);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user