@bbn/bbn 1.0.84 → 1.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +98 -98
- package/dist/bundle.js +131 -129
- package/dist/fn/ajax/postOut.d.ts +2 -2
- package/dist/fn/ajax/postOut.js +28 -25
- package/dist/fn/ajax/setNavigationVars.d.ts +2 -2
- package/dist/fn/ajax/setNavigationVars.js +2 -2
- package/dist/fn/ajax/treatAjaxArguments.d.ts +1 -1
- package/dist/fn/ajax/treatAjaxArguments.js +32 -31
- package/dist/fn/ajax/upload.d.ts +1 -1
- package/dist/fn/ajax/upload.js +1 -1
- package/dist/fn/browser/isFocused.d.ts +1 -1
- package/dist/fn/browser/isFocused.js +1 -1
- package/dist/fn/browser/selectElementText.d.ts +1 -1
- package/dist/fn/browser/selectElementText.js +1 -1
- package/dist/fn/browser/warning.d.ts +1 -1
- package/dist/fn/convert/imageToCanvas.d.ts +1 -1
- package/dist/fn/convert/imageToCanvas.js +1 -1
- package/dist/fn/convert/imgToBase64.js +0 -1
- package/dist/fn/convert/toCSV.d.ts +1 -1
- package/dist/fn/datetime/calendar.d.ts +1 -1
- package/dist/fn/datetime/calendar.js +1 -1
- package/dist/fn/datetime/fdate.d.ts +1 -1
- package/dist/fn/datetime/fdate.js +1 -1
- package/dist/fn/datetime/fdatetime.d.ts +1 -1
- package/dist/fn/datetime/fdatetime.js +1 -1
- package/dist/fn/datetime/timestamp.js +1 -1
- package/dist/fn/default/defaultAjaxAbortFunction.d.ts +1 -1
- package/dist/fn/default/defaultAjaxErrorFunction.d.ts +1 -1
- package/dist/fn/default/defaultAjaxErrorFunction.js +1 -1
- package/dist/fn/default/defaultAlertFunction.d.ts +1 -1
- package/dist/fn/default/defaultAlertFunction.js +1 -1
- package/dist/fn/default/defaultConfirmFunction.d.ts +1 -1
- package/dist/fn/default/defaultConfirmFunction.js +1 -1
- package/dist/fn/default/defaultEndLoadingFunction.d.ts +1 -1
- package/dist/fn/default/defaultEndLoadingFunction.js +1 -1
- package/dist/fn/default/defaultPostLinkFunction.d.ts +1 -1
- package/dist/fn/default/defaultPostLinkFunction.js +1 -1
- package/dist/fn/default/defaultPreLinkFunction.d.ts +1 -1
- package/dist/fn/default/defaultPreLinkFunction.js +1 -1
- package/dist/fn/default/defaultStartLoadingFunction.d.ts +1 -1
- package/dist/fn/default/defaultStartLoadingFunction.js +1 -1
- package/dist/fn/form/addInputs.d.ts +1 -1
- package/dist/fn/form/formdata.d.ts +1 -1
- package/dist/fn/form/objectToFormData.d.ts +1 -1
- package/dist/fn/form/objectToFormData.js +1 -1
- package/dist/fn/html/getAncestors.d.ts +1 -1
- package/dist/fn/html/getAncestors.js +1 -1
- package/dist/fn/html/getPath.d.ts +1 -1
- package/dist/fn/html/getText.d.ts +1 -1
- package/dist/fn/html/html2text.d.ts +1 -1
- package/dist/fn/html/selector.d.ts +2 -2
- package/dist/fn/html/selector.js +1 -1
- package/dist/fn/loop/fori.d.ts +1 -1
- package/dist/fn/loop/forir.d.ts +1 -1
- package/dist/fn/loop/iterate.d.ts +1 -1
- package/dist/fn/loop/riterate.d.ts +1 -1
- package/dist/fn/loop/riterate.js +1 -1
- package/dist/fn.d.ts +31 -31
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -3615,7 +3615,7 @@
|
|
|
3615
3615
|
* @memberof bbn.fn
|
|
3616
3616
|
* @returns {*}
|
|
3617
3617
|
*/
|
|
3618
|
-
const fdatetime = function (d, wrong_result) {
|
|
3618
|
+
const fdatetime = function (d, wrong_result = false) {
|
|
3619
3619
|
let r = (0, date_1.date)(d);
|
|
3620
3620
|
if (!(0, isDate_3.isDate)(r)) {
|
|
3621
3621
|
return wrong_result && (0, isString_6.isString)(wrong_result) ? wrong_result : '';
|
|
@@ -3649,7 +3649,7 @@
|
|
|
3649
3649
|
* @param {String} wrong_result
|
|
3650
3650
|
* @returns
|
|
3651
3651
|
*/
|
|
3652
|
-
const fdate = function (d, wrong_result) {
|
|
3652
|
+
const fdate = function (d, wrong_result = false) {
|
|
3653
3653
|
// Retro compatibility
|
|
3654
3654
|
if (wrong_result === true) {
|
|
3655
3655
|
return (0, fdatetime_1.fdatetime)(d);
|
|
@@ -3670,7 +3670,7 @@
|
|
|
3670
3670
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3671
3671
|
exports.calendar = void 0;
|
|
3672
3672
|
dayjs.extend(window['dayjs_plugin_calendar']);
|
|
3673
|
-
const calendar = function (d, wrong_result) {
|
|
3673
|
+
const calendar = function (d, wrong_result = false) {
|
|
3674
3674
|
if (undefined === dayjs) {
|
|
3675
3675
|
return (0, fdate_1.fdate)(d, wrong_result);
|
|
3676
3676
|
}
|
|
@@ -4426,7 +4426,7 @@
|
|
|
4426
4426
|
"use strict";
|
|
4427
4427
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4428
4428
|
exports.defaultAjaxErrorFunction = void 0;
|
|
4429
|
-
const defaultAjaxErrorFunction = function (jqXHR, textStatus, errorThrown) {
|
|
4429
|
+
const defaultAjaxErrorFunction = function (jqXHR, textStatus = null, errorThrown = null) {
|
|
4430
4430
|
(0, log_10.log)(textStatus, errorThrown);
|
|
4431
4431
|
};
|
|
4432
4432
|
exports.defaultAjaxErrorFunction = defaultAjaxErrorFunction;
|
|
@@ -4435,7 +4435,7 @@
|
|
|
4435
4435
|
"use strict";
|
|
4436
4436
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4437
4437
|
exports.defaultAlertFunction = void 0;
|
|
4438
|
-
const defaultAlertFunction = function (msg, title) {
|
|
4438
|
+
const defaultAlertFunction = function (msg, title = null) {
|
|
4439
4439
|
/** @todo */
|
|
4440
4440
|
alert(msg);
|
|
4441
4441
|
};
|
|
@@ -4445,7 +4445,7 @@
|
|
|
4445
4445
|
"use strict";
|
|
4446
4446
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4447
4447
|
exports.defaultConfirmFunction = void 0;
|
|
4448
|
-
const defaultConfirmFunction = function (text, yesFn, noFn) {
|
|
4448
|
+
const defaultConfirmFunction = function (text, yesFn, noFn = null) {
|
|
4449
4449
|
let ok = 0;
|
|
4450
4450
|
if (confirm(text)) {
|
|
4451
4451
|
if ((0, isFunction_6.isFunction)(yesFn)) {
|
|
@@ -4463,7 +4463,7 @@
|
|
|
4463
4463
|
"use strict";
|
|
4464
4464
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4465
4465
|
exports.defaultEndLoadingFunction = void 0;
|
|
4466
|
-
const defaultEndLoadingFunction = function (url, timestamp, data, res) {
|
|
4466
|
+
const defaultEndLoadingFunction = function (url, timestamp, data = null, res = null) {
|
|
4467
4467
|
return true;
|
|
4468
4468
|
};
|
|
4469
4469
|
exports.defaultEndLoadingFunction = defaultEndLoadingFunction;
|
|
@@ -4499,7 +4499,7 @@
|
|
|
4499
4499
|
"use strict";
|
|
4500
4500
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4501
4501
|
exports.defaultPostLinkFunction = void 0;
|
|
4502
|
-
const defaultPostLinkFunction = function (r, ele) {
|
|
4502
|
+
const defaultPostLinkFunction = function (r, ele = null) {
|
|
4503
4503
|
return true;
|
|
4504
4504
|
};
|
|
4505
4505
|
exports.defaultPostLinkFunction = defaultPostLinkFunction;
|
|
@@ -4508,7 +4508,7 @@
|
|
|
4508
4508
|
"use strict";
|
|
4509
4509
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4510
4510
|
exports.defaultPreLinkFunction = void 0;
|
|
4511
|
-
const defaultPreLinkFunction = function (url, force, ele) {
|
|
4511
|
+
const defaultPreLinkFunction = function (url, force = false, ele = null) {
|
|
4512
4512
|
(0, log_12.log)("defaultPreLinkFunction", url, force, ele);
|
|
4513
4513
|
return true;
|
|
4514
4514
|
};
|
|
@@ -4527,7 +4527,7 @@
|
|
|
4527
4527
|
"use strict";
|
|
4528
4528
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4529
4529
|
exports.defaultStartLoadingFunction = void 0;
|
|
4530
|
-
const defaultStartLoadingFunction = function (url, tst, data, requestId = null) {
|
|
4530
|
+
const defaultStartLoadingFunction = function (url, tst, data = null, requestId = null) {
|
|
4531
4531
|
return true;
|
|
4532
4532
|
};
|
|
4533
4533
|
exports.defaultStartLoadingFunction = defaultStartLoadingFunction;
|
|
@@ -5701,7 +5701,7 @@
|
|
|
5701
5701
|
"use strict";
|
|
5702
5702
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5703
5703
|
exports.getAncestors = void 0;
|
|
5704
|
-
const getAncestors = function (ele, selector) {
|
|
5704
|
+
const getAncestors = function (ele, selector = null) {
|
|
5705
5705
|
let r = [];
|
|
5706
5706
|
if (typeof ele === 'string') {
|
|
5707
5707
|
ele = document.querySelector(ele);
|
|
@@ -6420,7 +6420,7 @@
|
|
|
6420
6420
|
* @global
|
|
6421
6421
|
* @memberof bbn.fn
|
|
6422
6422
|
* @param {HTMLElement} img
|
|
6423
|
-
* @returns
|
|
6423
|
+
* @returns {HTMLCanvasElement}
|
|
6424
6424
|
*/
|
|
6425
6425
|
const imageToCanvas = function (img) {
|
|
6426
6426
|
let canvas = document.createElement('canvas');
|
|
@@ -6437,7 +6437,6 @@
|
|
|
6437
6437
|
exports.imgToBase64 = void 0;
|
|
6438
6438
|
const imgToBase64 = function (img, type = 'image/png') {
|
|
6439
6439
|
let canvas = (0, imageToCanvas_1.imageToCanvas)(img);
|
|
6440
|
-
//return canvasToImage(canvas);
|
|
6441
6440
|
return canvas.toDataURL(type);
|
|
6442
6441
|
};
|
|
6443
6442
|
exports.imgToBase64 = imgToBase64;
|
|
@@ -6532,62 +6531,63 @@
|
|
|
6532
6531
|
t = t.toLowerCase();
|
|
6533
6532
|
/* Callbacks */
|
|
6534
6533
|
if ((0, isFunction_8.isFunction)(args[i])) {
|
|
6535
|
-
if (cfg
|
|
6536
|
-
cfg
|
|
6534
|
+
if (cfg["errorFn"] && !cfg["abortFn"]) {
|
|
6535
|
+
cfg["abortFn"] = args[i];
|
|
6537
6536
|
}
|
|
6538
|
-
if (cfg
|
|
6539
|
-
cfg
|
|
6537
|
+
if (cfg["successFn"] && !cfg["errorFn"]) {
|
|
6538
|
+
cfg["errorFn"] = args[i];
|
|
6540
6539
|
}
|
|
6541
|
-
else if (!cfg
|
|
6542
|
-
cfg
|
|
6540
|
+
else if (!cfg["successFn"]) {
|
|
6541
|
+
cfg["successFn"] = args[i];
|
|
6543
6542
|
}
|
|
6544
6543
|
}
|
|
6545
6544
|
else if (args[i] === 1 || args[i] === true) {
|
|
6546
6545
|
/* Force */
|
|
6547
|
-
cfg
|
|
6546
|
+
cfg["force"] = true;
|
|
6548
6547
|
}
|
|
6549
|
-
else if (t ===
|
|
6550
|
-
if (!cfg
|
|
6548
|
+
else if (t === "string") {
|
|
6549
|
+
if (!cfg["url"]) {
|
|
6551
6550
|
/* Hash */
|
|
6552
|
-
if (args[i].indexOf(
|
|
6553
|
-
|
|
6551
|
+
if (args[i].indexOf("#") === 0 ||
|
|
6552
|
+
args[i].indexOf(bbn.env.root + "#") === 0) {
|
|
6553
|
+
cfg["url"] = (0, substr_9.substr)(args[i], bbn.env.root.length);
|
|
6554
6554
|
}
|
|
6555
6555
|
else {
|
|
6556
6556
|
/* Link */
|
|
6557
|
-
cfg
|
|
6558
|
-
if (cfg
|
|
6559
|
-
cfg
|
|
6557
|
+
cfg["url"] = args[i];
|
|
6558
|
+
if (cfg["url"].indexOf(bbn.env.root) === 0) {
|
|
6559
|
+
cfg["url"] = (0, substr_9.substr)(cfg["url"], bbn.env.root.length);
|
|
6560
6560
|
}
|
|
6561
6561
|
}
|
|
6562
6562
|
}
|
|
6563
6563
|
else {
|
|
6564
6564
|
/* Ajax datatype */
|
|
6565
|
-
cfg
|
|
6565
|
+
cfg["datatype"] = args[i];
|
|
6566
6566
|
}
|
|
6567
6567
|
}
|
|
6568
|
-
else if (args[i] && t ===
|
|
6568
|
+
else if (args[i] && t === "object") {
|
|
6569
6569
|
/* Event */
|
|
6570
6570
|
if (args[i] instanceof Event) {
|
|
6571
|
-
cfg
|
|
6571
|
+
cfg["e"] = args[i];
|
|
6572
6572
|
}
|
|
6573
|
-
else if (!cfg
|
|
6573
|
+
else if (!cfg["ele"] && args[i].nodeType === 1) {
|
|
6574
6574
|
/* HTML Element */
|
|
6575
|
-
cfg
|
|
6575
|
+
cfg["ele"] = args[i];
|
|
6576
6576
|
}
|
|
6577
|
-
else if (t.toLowerCase() ===
|
|
6577
|
+
else if (t.toLowerCase() === "object") {
|
|
6578
6578
|
/* An object to post */
|
|
6579
|
-
cfg
|
|
6579
|
+
cfg["obj"] = args[i];
|
|
6580
6580
|
}
|
|
6581
6581
|
}
|
|
6582
6582
|
}
|
|
6583
|
-
if (!cfg
|
|
6584
|
-
cfg
|
|
6583
|
+
if (!cfg["url"] && (0, numProperties_6.numProperties)(cfg)) {
|
|
6584
|
+
cfg["url"] = bbn.env.path;
|
|
6585
6585
|
}
|
|
6586
|
-
if (cfg
|
|
6587
|
-
cfg
|
|
6586
|
+
if (cfg["obj"] === undefined) {
|
|
6587
|
+
cfg["obj"] = { _bbn: "public" };
|
|
6588
6588
|
}
|
|
6589
|
-
if (!cfg
|
|
6590
|
-
cfg
|
|
6589
|
+
if (!cfg["datatype"]) {
|
|
6590
|
+
cfg["datatype"] = "json";
|
|
6591
6591
|
}
|
|
6592
6592
|
return cfg;
|
|
6593
6593
|
};
|
|
@@ -6618,9 +6618,9 @@
|
|
|
6618
6618
|
* @param {Object} data The data if any
|
|
6619
6619
|
* @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
|
|
6620
6620
|
*
|
|
6621
|
-
* @returns {
|
|
6621
|
+
* @returns {void}
|
|
6622
6622
|
*/
|
|
6623
|
-
const setNavigationVars = function (url, title, data, repl) {
|
|
6623
|
+
const setNavigationVars = function (url, title, data = null, repl = false) {
|
|
6624
6624
|
// Current path becomes old path
|
|
6625
6625
|
bbn.env.old_path = bbn.env.path;
|
|
6626
6626
|
// URL includes the domain
|
|
@@ -7459,7 +7459,7 @@
|
|
|
7459
7459
|
*
|
|
7460
7460
|
* @returns {Boolean} True if focused
|
|
7461
7461
|
*/
|
|
7462
|
-
const isFocused = function (ele, contain) {
|
|
7462
|
+
const isFocused = function (ele, contain = false) {
|
|
7463
7463
|
return ele === document.activeElement || (contain && ele.contains && ele.contains(document.activeElement));
|
|
7464
7464
|
};
|
|
7465
7465
|
exports.isFocused = isFocused;
|
|
@@ -8423,7 +8423,7 @@
|
|
|
8423
8423
|
* @param {Array} ignoreList
|
|
8424
8424
|
* @returns
|
|
8425
8425
|
*/
|
|
8426
|
-
const objectToFormData = function (obj, key = '', ignoreList) {
|
|
8426
|
+
const objectToFormData = function (obj, key = '', ignoreList = null) {
|
|
8427
8427
|
let formData = new FormData();
|
|
8428
8428
|
let appendFormData = (data, key = '') => {
|
|
8429
8429
|
if (!ignoreList || ((0, isArray_15.isArray)(ignoreList) && !ignoreList.includes(key))) {
|
|
@@ -8504,7 +8504,7 @@
|
|
|
8504
8504
|
* @todo Add method description for selector
|
|
8505
8505
|
* @global
|
|
8506
8506
|
* @memberof bbn.fn
|
|
8507
|
-
* @returns {
|
|
8507
|
+
* @returns {HTMLElement | undefined}
|
|
8508
8508
|
*/
|
|
8509
8509
|
const selector = function (ele) {
|
|
8510
8510
|
return typeof ele === "string" ? document.querySelector(ele) : ele;
|
|
@@ -8595,7 +8595,61 @@
|
|
|
8595
8595
|
};
|
|
8596
8596
|
exports.pickValue = pickValue;
|
|
8597
8597
|
});
|
|
8598
|
-
define("fn/
|
|
8598
|
+
define("fn/object/setProperty", ["require", "exports", "fn/loop/each"], function (require, exports, each_22) {
|
|
8599
|
+
"use strict";
|
|
8600
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8601
|
+
exports.setProperty = void 0;
|
|
8602
|
+
/**
|
|
8603
|
+
* Returns the value of the given property from the given object.
|
|
8604
|
+
*
|
|
8605
|
+
* Looks for the given property in the given object, accepting dot (.) separator
|
|
8606
|
+
* for deep property access, and returns its value if found and undefined otherwise.
|
|
8607
|
+
*
|
|
8608
|
+
* @method getProperty
|
|
8609
|
+
* @global
|
|
8610
|
+
* @example
|
|
8611
|
+
* ```javascript
|
|
8612
|
+
* bbn.fn.getProperty({a: 1, b: 2}, 'b');
|
|
8613
|
+
* // 2
|
|
8614
|
+
* ```
|
|
8615
|
+
* @example
|
|
8616
|
+
* ```javascript
|
|
8617
|
+
* bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.o.a');
|
|
8618
|
+
* // 33
|
|
8619
|
+
* ```
|
|
8620
|
+
* @example
|
|
8621
|
+
* ```javascript
|
|
8622
|
+
* bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.h.a');
|
|
8623
|
+
* // undefined
|
|
8624
|
+
* ```
|
|
8625
|
+
* @memberof bbn.fn
|
|
8626
|
+
* @param {Object} obj
|
|
8627
|
+
* @param {String} prop
|
|
8628
|
+
* @returns {*} The property's value or undefined
|
|
8629
|
+
*/
|
|
8630
|
+
const setProperty = function (obj, prop, value, force) {
|
|
8631
|
+
if (typeof obj === 'object' && typeof prop === 'string') {
|
|
8632
|
+
let o = obj;
|
|
8633
|
+
const bits = prop.split('.');
|
|
8634
|
+
(0, each_22.each)(bits, (v, i) => {
|
|
8635
|
+
if (!o) {
|
|
8636
|
+
if (!force) {
|
|
8637
|
+
throw new Error(bbn._('The object is invalid'));
|
|
8638
|
+
}
|
|
8639
|
+
o = {};
|
|
8640
|
+
}
|
|
8641
|
+
if (bits.length - 1 === i) {
|
|
8642
|
+
o[v] = value;
|
|
8643
|
+
}
|
|
8644
|
+
else {
|
|
8645
|
+
o = o[v];
|
|
8646
|
+
}
|
|
8647
|
+
});
|
|
8648
|
+
}
|
|
8649
|
+
};
|
|
8650
|
+
exports.setProperty = setProperty;
|
|
8651
|
+
});
|
|
8652
|
+
define("fn/ajax/postOut", ["require", "exports", "fn/object/createObject", "fn/form/addInputs", "fn/object/setProperty"], function (require, exports, createObject_3, addInputs_1, setProperty_1) {
|
|
8599
8653
|
"use strict";
|
|
8600
8654
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8601
8655
|
exports.postOut = void 0;
|
|
@@ -8616,33 +8670,35 @@
|
|
|
8616
8670
|
* @param {Function} success A function to execute in case of success
|
|
8617
8671
|
* @param {String} target The target attribute of the form
|
|
8618
8672
|
*
|
|
8619
|
-
* @returns {
|
|
8673
|
+
* @returns {void}
|
|
8620
8674
|
*/
|
|
8621
|
-
const postOut = function (url, data, success, target) {
|
|
8622
|
-
let form = document.body.querySelector(
|
|
8675
|
+
const postOut = function (url, data, success = null, target = "") {
|
|
8676
|
+
let form = document.body.querySelector("form#bbn-form_out");
|
|
8623
8677
|
if (!form) {
|
|
8624
|
-
form = document.createElement(
|
|
8625
|
-
form.classList.add(
|
|
8626
|
-
form.setAttribute(
|
|
8627
|
-
form.setAttribute(
|
|
8628
|
-
form.setAttribute(
|
|
8629
|
-
form
|
|
8678
|
+
form = document.createElement("form");
|
|
8679
|
+
form.classList.add("bbn-no");
|
|
8680
|
+
form.setAttribute("id", "bbn-form_out");
|
|
8681
|
+
form.setAttribute("method", "post");
|
|
8682
|
+
form.setAttribute("enctype", "multipart/form-data-encoded");
|
|
8683
|
+
(0, setProperty_1.setProperty)(form, "style.display", "none");
|
|
8630
8684
|
document.body.appendChild(form);
|
|
8631
8685
|
}
|
|
8632
|
-
form
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
data
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
data.bbn
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
success
|
|
8686
|
+
if (form instanceof HTMLFormElement) {
|
|
8687
|
+
form.innerHTML = "";
|
|
8688
|
+
form.setAttribute("action", url);
|
|
8689
|
+
form.setAttribute("target", target || "_blank");
|
|
8690
|
+
if (!data) {
|
|
8691
|
+
data = {};
|
|
8692
|
+
}
|
|
8693
|
+
data = (0, createObject_3.createObject)(data);
|
|
8694
|
+
if (!data.bbn) {
|
|
8695
|
+
data.bbn = "public";
|
|
8696
|
+
}
|
|
8697
|
+
(0, addInputs_1.addInputs)(form, data);
|
|
8698
|
+
form.submit();
|
|
8699
|
+
if (success) {
|
|
8700
|
+
success();
|
|
8701
|
+
}
|
|
8646
8702
|
}
|
|
8647
8703
|
};
|
|
8648
8704
|
exports.postOut = postOut;
|
|
@@ -9033,7 +9089,7 @@
|
|
|
9033
9089
|
* @param {Boolean} noPrivate If set to true the _private_ properties won't be included
|
|
9034
9090
|
* @returns {Object}
|
|
9035
9091
|
*/
|
|
9036
|
-
const riterate = function (obj, fn, noPrivate) {
|
|
9092
|
+
const riterate = function (obj, fn, noPrivate = false) {
|
|
9037
9093
|
return (0, iterate_10.iterate)(obj, fn, noPrivate, true);
|
|
9038
9094
|
};
|
|
9039
9095
|
exports.riterate = riterate;
|
|
@@ -9140,7 +9196,7 @@
|
|
|
9140
9196
|
*
|
|
9141
9197
|
* @returns {Boolean} True if focused
|
|
9142
9198
|
*/
|
|
9143
|
-
const selectElementText = function (ele, win) {
|
|
9199
|
+
const selectElementText = function (ele, win = null) {
|
|
9144
9200
|
win = win || window;
|
|
9145
9201
|
if (ele instanceof HTMLInputElement) {
|
|
9146
9202
|
ele.select();
|
|
@@ -9235,60 +9291,6 @@
|
|
|
9235
9291
|
};
|
|
9236
9292
|
exports.setProp = setProp;
|
|
9237
9293
|
});
|
|
9238
|
-
define("fn/object/setProperty", ["require", "exports", "fn/loop/each"], function (require, exports, each_22) {
|
|
9239
|
-
"use strict";
|
|
9240
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9241
|
-
exports.setProperty = void 0;
|
|
9242
|
-
/**
|
|
9243
|
-
* Returns the value of the given property from the given object.
|
|
9244
|
-
*
|
|
9245
|
-
* Looks for the given property in the given object, accepting dot (.) separator
|
|
9246
|
-
* for deep property access, and returns its value if found and undefined otherwise.
|
|
9247
|
-
*
|
|
9248
|
-
* @method getProperty
|
|
9249
|
-
* @global
|
|
9250
|
-
* @example
|
|
9251
|
-
* ```javascript
|
|
9252
|
-
* bbn.fn.getProperty({a: 1, b: 2}, 'b');
|
|
9253
|
-
* // 2
|
|
9254
|
-
* ```
|
|
9255
|
-
* @example
|
|
9256
|
-
* ```javascript
|
|
9257
|
-
* bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.o.a');
|
|
9258
|
-
* // 33
|
|
9259
|
-
* ```
|
|
9260
|
-
* @example
|
|
9261
|
-
* ```javascript
|
|
9262
|
-
* bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.h.a');
|
|
9263
|
-
* // undefined
|
|
9264
|
-
* ```
|
|
9265
|
-
* @memberof bbn.fn
|
|
9266
|
-
* @param {Object} obj
|
|
9267
|
-
* @param {String} prop
|
|
9268
|
-
* @returns {*} The property's value or undefined
|
|
9269
|
-
*/
|
|
9270
|
-
const setProperty = function (obj, prop, value, force) {
|
|
9271
|
-
if (typeof obj === 'object' && typeof prop === 'string') {
|
|
9272
|
-
let o = obj;
|
|
9273
|
-
const bits = prop.split('.');
|
|
9274
|
-
(0, each_22.each)(bits, (v, i) => {
|
|
9275
|
-
if (!o) {
|
|
9276
|
-
if (!force) {
|
|
9277
|
-
throw new Error(bbn._('The object is invalid'));
|
|
9278
|
-
}
|
|
9279
|
-
o = {};
|
|
9280
|
-
}
|
|
9281
|
-
if (bits.length - 1 === i) {
|
|
9282
|
-
o[v] = value;
|
|
9283
|
-
}
|
|
9284
|
-
else {
|
|
9285
|
-
o = o[v];
|
|
9286
|
-
}
|
|
9287
|
-
});
|
|
9288
|
-
}
|
|
9289
|
-
};
|
|
9290
|
-
exports.setProperty = setProperty;
|
|
9291
|
-
});
|
|
9292
9294
|
define("fn/string/shorten", ["require", "exports", "fn/type/isString", "fn/string/substr"], function (require, exports, isString_25, substr_15) {
|
|
9293
9295
|
"use strict";
|
|
9294
9296
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -9534,7 +9536,7 @@
|
|
|
9534
9536
|
* @param {Number} seconds
|
|
9535
9537
|
* @returns {Boolean}
|
|
9536
9538
|
*/
|
|
9537
|
-
const timestamp = function (seconds) {
|
|
9539
|
+
const timestamp = function (seconds = false) {
|
|
9538
9540
|
let r = new Date().getTime();
|
|
9539
9541
|
return seconds ? Math.round(r / 1000) : r;
|
|
9540
9542
|
};
|
|
@@ -9732,7 +9734,7 @@
|
|
|
9732
9734
|
*
|
|
9733
9735
|
* @returns {Promise}
|
|
9734
9736
|
*/
|
|
9735
|
-
const upload = function (url, file, success, failure, progress) {
|
|
9737
|
+
const upload = function (url, file, success = null, failure = null, progress = null) {
|
|
9736
9738
|
let fn = () => {
|
|
9737
9739
|
return axios.post(url || bbn.env.path, (0, objectToFormData_1.objectToFormData)(file), {
|
|
9738
9740
|
headers: {
|
|
@@ -9767,7 +9769,7 @@
|
|
|
9767
9769
|
};
|
|
9768
9770
|
exports.upload = upload;
|
|
9769
9771
|
});
|
|
9770
|
-
define("fn", ["require", "exports", "fn/ajax/_addLoader", "fn/object/_compareValues", "fn/ajax/_deleteLoader", "fn/ajax/abort", "fn/ajax/abortURL", "fn/style/addColors", "fn/form/addInputs", "fn/style/addStyle", "fn/html/adjustHeight", "fn/html/adjustSize", "fn/html/adjustWidth", "fn/ajax/ajax", "fn/misc/analyzeFunction", "fn/style/animateCss", "fn/convert/arrayBuffer2String", "fn/object/arrayFromProp", "fn/object/autoExtend", "fn/string/baseName", "fn/string/br2nl", "fn/datetime/calendar", "fn/ajax/callback", "fn/string/camelize", "fn/string/camelToCss", "fn/convert/canvasToImage", "fn/style/center", "fn/object/checkProps", "fn/object/checkPropsDetails", "fn/object/checkPropsOrDie", "fn/type/checkType", "fn/object/circularReplacer", "fn/object/clone", "fn/convert/colorToHex", "fn/object/compare", "fn/object/compareConditions", "fn/browser/copy", "fn/string/correctCase", "fn/object/count", "fn/string/crc32", "fn/object/createObject", "fn/style/cssExists", "fn/datetime/date", "fn/datetime/dateSQL", "fn/datetime/daysInMonth", "fn/object/deepPath", "fn/default/defaultAjaxAbortFunction", "fn/default/defaultAjaxErrorFunction", "fn/default/defaultAlertFunction", "fn/default/defaultConfirmFunction", "fn/default/defaultEndLoadingFunction", "fn/default/defaultErrorFunction", "fn/default/defaultHistoryFunction", "fn/default/defaultLinkFunction", "fn/default/defaultPostLinkFunction", "fn/default/defaultPreLinkFunction", "fn/default/defaultResizeFunction", "fn/default/defaultStartLoadingFunction", "fn/object/deleteProp", "fn/object/diffObj", "fn/string/dirName", "fn/ajax/download", "fn/ajax/downloadContent", "fn/loop/each", "fn/browser/eraseCookie", "fn/browser/error", "fn/string/escapeDquotes", "fn/string/escapeRegExp", "fn/string/escapeSquotes", "fn/string/escapeTicks", "fn/string/escapeUrl", "fn/object/extend", "fn/object/extendOut", "fn/datetime/fdate", "fn/datetime/fdatetime", "fn/form/fieldValue", "fn/string/fileExt", "fn/object/filter", "fn/object/filterToConditions", "fn/object/findAll", "fn/loop/fori", "fn/loop/forir", "fn/string/format", "fn/string/formatBytes", "fn/datetime/formatDate", "fn/string/formatSize", "fn/form/formdata", "fn/convert/fromXml", "fn/datetime/ftime", "fn/html/getAllTags", "fn/html/getAncestors", "fn/html/getAttributes", "fn/browser/getBrowserName", "fn/browser/getBrowserVersion", "fn/browser/getCookie", "fn/style/getCssVar", "fn/datetime/getDay", "fn/browser/getDeviceType", "fn/browser/getEventData", "fn/object/getField", "fn/object/getFieldValues", "fn/html/getHtml", "fn/html/getHTMLOfSelection", "fn/ajax/getLoader", "fn/html/getPath", "fn/object/getProp", "fn/object/getProperty", "fn/ajax/getRequestId", "fn/object/getRow", "fn/style/getScrollBarSize", "fn/html/getText", "fn/misc/getTimeoff", "fn/browser/happy", "fn/string/hash", "fn/convert/hex2rgb", "fn/browser/history", "fn/html/html2text", "fn/convert/imageToCanvas", "fn/convert/imgToBase64", "fn/browser/info", "fn/init", "fn/browser/isActiveInterface", "fn/type/isArray", "fn/type/isBlob", "fn/type/isBoolean", "fn/type/isCanvas", "fn/type/isColor", "fn/type/isComment", "fn/type/isCp", "fn/type/isDate", "fn/browser/isDesktopDevice", "fn/type/isDimension", "fn/type/isDom", "fn/type/isEmail", "fn/type/isEmpty", "fn/type/isEvent", "fn/browser/isFocused", "fn/type/isFunction", "fn/type/isHostname", "fn/html/isInside", "fn/type/isInt", "fn/type/isIP", "fn/type/isIterable", "fn/browser/isMobile", "fn/browser/isMobileDevice", "fn/type/isNull", "fn/type/isNumber", "fn/type/isObject", "fn/type/isPercent", "fn/type/isPrimitive", "fn/type/isPromise", "fn/type/isPropSize", "fn/type/isSame", "fn/type/isSQLDate", "fn/type/isString", "fn/type/isSymbol", "fn/browser/isTabletDevice", "fn/type/isURL", "fn/type/isValidDimension", "fn/type/isValidName", "fn/type/isValue", "fn/type/isVue", "fn/loop/iterate", "fn/style/lightenDarkenHex", "fn/ajax/link", "fn/browser/log", "fn/html/makeReactive", "fn/object/map", "fn/string/md5", "fn/misc/money", "fn/object/move", "fn/object/multiorder", "fn/string/nl2br", "fn/object/numProperties", "fn/form/objectToFormData", "fn/object/order", "fn/style/outerHeight", "fn/style/outerWidth", "fn/misc/percent", "fn/object/pickValue", "fn/ajax/post", "fn/ajax/postOut", "fn/string/printf", "fn/string/quotes2html", "fn/misc/randomInt", "fn/string/randomString", "fn/string/removeAccents", "fn/object/removeEmpty", "fn/string/removeExtraSpaces", "fn/string/removeHtmlComments", "fn/object/removePrivateProp", "fn/string/removeTrailingChars", "fn/string/repeat", "fn/string/replaceAll", "fn/browser/replaceSelection", "fn/style/resize", "fn/convert/rgb2hex", "fn/loop/riterate", "fn/misc/roundDecimal", "fn/string/sanitize", "fn/object/search", "fn/browser/selectElementText", "fn/html/selector", "fn/browser/setCookie", "fn/style/setCssVar", "fn/ajax/setNavigationVars", "fn/object/setProp", "fn/object/setProperty", "fn/string/shorten", "fn/object/shortenObj", "fn/object/shuffle", "fn/string/simpleHash", "fn/string/simpleHash1", "fn/string/simpleHash2", "fn/datetime/chrono", "fn/convert/string2ArrayBuffer", "fn/form/submit", "fn/string/substr", "fn/object/sum", "fn/datetime/timestamp", "fn/convert/toCSV", "fn/browser/toggleFullScreen", "fn/misc/translate", "fn/ajax/treatAjaxArguments", "fn/string/trim", "fn/string/uniqString", "fn/object/unique", "fn/ajax/upload", "fn/browser/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_6, circularReplacer_2, clone_2, colorToHex_1, compare_2, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_1, defaultAjaxErrorFunction_1, defaultAlertFunction_1, defaultConfirmFunction_1, defaultEndLoadingFunction_1, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_1, defaultPostLinkFunction_1, defaultPreLinkFunction_1, defaultResizeFunction_2, defaultStartLoadingFunction_1, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_28, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_8, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_4, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1, isFunction_11, isHostname_1, isInside_1, isInt_2, isIP_2, isIterable_5, isMobile_2, isMobileDevice_2, isNull_4, isNumber_10, isObject_18, isPercent_1, isPrimitive_1, isPromise_1, isPropSize_1, isSame_3, isSQLDate_1, isString_27, isSymbol_2, isTabletDevice_3, isURL_1, isValidDimension_2, isValidName_1, isValue_2, isVue_1, iterate_12, lightenDarkenHex_1, link_2, log_22, makeReactive_1, map_1, md5_4, money_1, move_1, multiorder_1, nl2br_1, numProperties_8, objectToFormData_2, order_1, outerHeight_1, outerWidth_1, percent_1, pickValue_1, post_2, postOut_1, printf_1, quotes2html_1, randomInt_2, randomString_1, removeAccents_4, removeEmpty_1, removeExtraSpaces_1, removeHtmlComments_2, removePrivateProp_2, removeTrailingChars_1, repeat_1, replaceAll_8, replaceSelection_1, resize_3, rgb2hex_1, riterate_1, roundDecimal_1, sanitize_1, search_6, selectElementText_1, selector_3, setCookie_1, setCssVar_1, setNavigationVars_2, setProp_1,
|
|
9772
|
+
define("fn", ["require", "exports", "fn/ajax/_addLoader", "fn/object/_compareValues", "fn/ajax/_deleteLoader", "fn/ajax/abort", "fn/ajax/abortURL", "fn/style/addColors", "fn/form/addInputs", "fn/style/addStyle", "fn/html/adjustHeight", "fn/html/adjustSize", "fn/html/adjustWidth", "fn/ajax/ajax", "fn/misc/analyzeFunction", "fn/style/animateCss", "fn/convert/arrayBuffer2String", "fn/object/arrayFromProp", "fn/object/autoExtend", "fn/string/baseName", "fn/string/br2nl", "fn/datetime/calendar", "fn/ajax/callback", "fn/string/camelize", "fn/string/camelToCss", "fn/convert/canvasToImage", "fn/style/center", "fn/object/checkProps", "fn/object/checkPropsDetails", "fn/object/checkPropsOrDie", "fn/type/checkType", "fn/object/circularReplacer", "fn/object/clone", "fn/convert/colorToHex", "fn/object/compare", "fn/object/compareConditions", "fn/browser/copy", "fn/string/correctCase", "fn/object/count", "fn/string/crc32", "fn/object/createObject", "fn/style/cssExists", "fn/datetime/date", "fn/datetime/dateSQL", "fn/datetime/daysInMonth", "fn/object/deepPath", "fn/default/defaultAjaxAbortFunction", "fn/default/defaultAjaxErrorFunction", "fn/default/defaultAlertFunction", "fn/default/defaultConfirmFunction", "fn/default/defaultEndLoadingFunction", "fn/default/defaultErrorFunction", "fn/default/defaultHistoryFunction", "fn/default/defaultLinkFunction", "fn/default/defaultPostLinkFunction", "fn/default/defaultPreLinkFunction", "fn/default/defaultResizeFunction", "fn/default/defaultStartLoadingFunction", "fn/object/deleteProp", "fn/object/diffObj", "fn/string/dirName", "fn/ajax/download", "fn/ajax/downloadContent", "fn/loop/each", "fn/browser/eraseCookie", "fn/browser/error", "fn/string/escapeDquotes", "fn/string/escapeRegExp", "fn/string/escapeSquotes", "fn/string/escapeTicks", "fn/string/escapeUrl", "fn/object/extend", "fn/object/extendOut", "fn/datetime/fdate", "fn/datetime/fdatetime", "fn/form/fieldValue", "fn/string/fileExt", "fn/object/filter", "fn/object/filterToConditions", "fn/object/findAll", "fn/loop/fori", "fn/loop/forir", "fn/string/format", "fn/string/formatBytes", "fn/datetime/formatDate", "fn/string/formatSize", "fn/form/formdata", "fn/convert/fromXml", "fn/datetime/ftime", "fn/html/getAllTags", "fn/html/getAncestors", "fn/html/getAttributes", "fn/browser/getBrowserName", "fn/browser/getBrowserVersion", "fn/browser/getCookie", "fn/style/getCssVar", "fn/datetime/getDay", "fn/browser/getDeviceType", "fn/browser/getEventData", "fn/object/getField", "fn/object/getFieldValues", "fn/html/getHtml", "fn/html/getHTMLOfSelection", "fn/ajax/getLoader", "fn/html/getPath", "fn/object/getProp", "fn/object/getProperty", "fn/ajax/getRequestId", "fn/object/getRow", "fn/style/getScrollBarSize", "fn/html/getText", "fn/misc/getTimeoff", "fn/browser/happy", "fn/string/hash", "fn/convert/hex2rgb", "fn/browser/history", "fn/html/html2text", "fn/convert/imageToCanvas", "fn/convert/imgToBase64", "fn/browser/info", "fn/init", "fn/browser/isActiveInterface", "fn/type/isArray", "fn/type/isBlob", "fn/type/isBoolean", "fn/type/isCanvas", "fn/type/isColor", "fn/type/isComment", "fn/type/isCp", "fn/type/isDate", "fn/browser/isDesktopDevice", "fn/type/isDimension", "fn/type/isDom", "fn/type/isEmail", "fn/type/isEmpty", "fn/type/isEvent", "fn/browser/isFocused", "fn/type/isFunction", "fn/type/isHostname", "fn/html/isInside", "fn/type/isInt", "fn/type/isIP", "fn/type/isIterable", "fn/browser/isMobile", "fn/browser/isMobileDevice", "fn/type/isNull", "fn/type/isNumber", "fn/type/isObject", "fn/type/isPercent", "fn/type/isPrimitive", "fn/type/isPromise", "fn/type/isPropSize", "fn/type/isSame", "fn/type/isSQLDate", "fn/type/isString", "fn/type/isSymbol", "fn/browser/isTabletDevice", "fn/type/isURL", "fn/type/isValidDimension", "fn/type/isValidName", "fn/type/isValue", "fn/type/isVue", "fn/loop/iterate", "fn/style/lightenDarkenHex", "fn/ajax/link", "fn/browser/log", "fn/html/makeReactive", "fn/object/map", "fn/string/md5", "fn/misc/money", "fn/object/move", "fn/object/multiorder", "fn/string/nl2br", "fn/object/numProperties", "fn/form/objectToFormData", "fn/object/order", "fn/style/outerHeight", "fn/style/outerWidth", "fn/misc/percent", "fn/object/pickValue", "fn/ajax/post", "fn/ajax/postOut", "fn/string/printf", "fn/string/quotes2html", "fn/misc/randomInt", "fn/string/randomString", "fn/string/removeAccents", "fn/object/removeEmpty", "fn/string/removeExtraSpaces", "fn/string/removeHtmlComments", "fn/object/removePrivateProp", "fn/string/removeTrailingChars", "fn/string/repeat", "fn/string/replaceAll", "fn/browser/replaceSelection", "fn/style/resize", "fn/convert/rgb2hex", "fn/loop/riterate", "fn/misc/roundDecimal", "fn/string/sanitize", "fn/object/search", "fn/browser/selectElementText", "fn/html/selector", "fn/browser/setCookie", "fn/style/setCssVar", "fn/ajax/setNavigationVars", "fn/object/setProp", "fn/object/setProperty", "fn/string/shorten", "fn/object/shortenObj", "fn/object/shuffle", "fn/string/simpleHash", "fn/string/simpleHash1", "fn/string/simpleHash2", "fn/datetime/chrono", "fn/convert/string2ArrayBuffer", "fn/form/submit", "fn/string/substr", "fn/object/sum", "fn/datetime/timestamp", "fn/convert/toCSV", "fn/browser/toggleFullScreen", "fn/misc/translate", "fn/ajax/treatAjaxArguments", "fn/string/trim", "fn/string/uniqString", "fn/object/unique", "fn/ajax/upload", "fn/browser/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_6, circularReplacer_2, clone_2, colorToHex_1, compare_2, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_1, defaultAjaxErrorFunction_1, defaultAlertFunction_1, defaultConfirmFunction_1, defaultEndLoadingFunction_1, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_1, defaultPostLinkFunction_1, defaultPreLinkFunction_1, defaultResizeFunction_2, defaultStartLoadingFunction_1, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_28, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_8, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_4, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1, isFunction_11, isHostname_1, isInside_1, isInt_2, isIP_2, isIterable_5, isMobile_2, isMobileDevice_2, isNull_4, isNumber_10, isObject_18, isPercent_1, isPrimitive_1, isPromise_1, isPropSize_1, isSame_3, isSQLDate_1, isString_27, isSymbol_2, isTabletDevice_3, isURL_1, isValidDimension_2, isValidName_1, isValue_2, isVue_1, iterate_12, lightenDarkenHex_1, link_2, log_22, makeReactive_1, map_1, md5_4, money_1, move_1, multiorder_1, nl2br_1, numProperties_8, objectToFormData_2, order_1, outerHeight_1, outerWidth_1, percent_1, pickValue_1, post_2, postOut_1, printf_1, quotes2html_1, randomInt_2, randomString_1, removeAccents_4, removeEmpty_1, removeExtraSpaces_1, removeHtmlComments_2, removePrivateProp_2, removeTrailingChars_1, repeat_1, replaceAll_8, replaceSelection_1, resize_3, rgb2hex_1, riterate_1, roundDecimal_1, sanitize_1, search_6, selectElementText_1, selector_3, setCookie_1, setCssVar_1, setNavigationVars_2, setProp_1, setProperty_2, shorten_2, shortenObj_1, shuffle_1, simpleHash_2, simpleHash1_2, simpleHash2_2, chrono_1, string2ArrayBuffer_1, submit_2, substr_16, sum_1, timestamp_1, toCSV_1, toggleFullScreen_1, translate_1, treatAjaxArguments_3, trim_2, uniqString_1, unique_2, upload_1, warning_2) {
|
|
9771
9773
|
"use strict";
|
|
9772
9774
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9773
9775
|
exports.fn = void 0;
|
|
@@ -9977,7 +9979,7 @@
|
|
|
9977
9979
|
setCssVar: setCssVar_1.setCssVar,
|
|
9978
9980
|
setNavigationVars: setNavigationVars_2.setNavigationVars,
|
|
9979
9981
|
setProp: setProp_1.setProp,
|
|
9980
|
-
setProperty:
|
|
9982
|
+
setProperty: setProperty_2.setProperty,
|
|
9981
9983
|
shorten: shorten_2.shorten,
|
|
9982
9984
|
shortenObj: shortenObj_1.shortenObj,
|
|
9983
9985
|
shuffle: shuffle_1.shuffle,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @param {Function} success A function to execute in case of success
|
|
16
16
|
* @param {String} target The target attribute of the form
|
|
17
17
|
*
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {void}
|
|
19
19
|
*/
|
|
20
|
-
declare const postOut: (url:
|
|
20
|
+
declare const postOut: (url: any, data: any, success?: any, target?: string) => void;
|
|
21
21
|
export { postOut };
|
package/dist/fn/ajax/postOut.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createObject } from
|
|
2
|
-
import { addInputs } from
|
|
1
|
+
import { createObject } from "../object/createObject";
|
|
2
|
+
import { addInputs } from "../form/addInputs";
|
|
3
|
+
import { setProperty } from "../object/setProperty";
|
|
3
4
|
/**
|
|
4
5
|
* Posts a request in a new window.
|
|
5
6
|
*
|
|
@@ -17,33 +18,35 @@ import { addInputs } from '../form/addInputs';
|
|
|
17
18
|
* @param {Function} success A function to execute in case of success
|
|
18
19
|
* @param {String} target The target attribute of the form
|
|
19
20
|
*
|
|
20
|
-
* @returns {
|
|
21
|
+
* @returns {void}
|
|
21
22
|
*/
|
|
22
|
-
const postOut = function (url, data, success, target) {
|
|
23
|
-
let form = document.body.querySelector(
|
|
23
|
+
const postOut = function (url, data, success = null, target = "") {
|
|
24
|
+
let form = document.body.querySelector("form#bbn-form_out");
|
|
24
25
|
if (!form) {
|
|
25
|
-
form = document.createElement(
|
|
26
|
-
form.classList.add(
|
|
27
|
-
form.setAttribute(
|
|
28
|
-
form.setAttribute(
|
|
29
|
-
form.setAttribute(
|
|
30
|
-
form
|
|
26
|
+
form = document.createElement("form");
|
|
27
|
+
form.classList.add("bbn-no");
|
|
28
|
+
form.setAttribute("id", "bbn-form_out");
|
|
29
|
+
form.setAttribute("method", "post");
|
|
30
|
+
form.setAttribute("enctype", "multipart/form-data-encoded");
|
|
31
|
+
setProperty(form, "style.display", "none");
|
|
31
32
|
document.body.appendChild(form);
|
|
32
33
|
}
|
|
33
|
-
form
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
data
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
data.bbn
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
success
|
|
34
|
+
if (form instanceof HTMLFormElement) {
|
|
35
|
+
form.innerHTML = "";
|
|
36
|
+
form.setAttribute("action", url);
|
|
37
|
+
form.setAttribute("target", target || "_blank");
|
|
38
|
+
if (!data) {
|
|
39
|
+
data = {};
|
|
40
|
+
}
|
|
41
|
+
data = createObject(data);
|
|
42
|
+
if (!data.bbn) {
|
|
43
|
+
data.bbn = "public";
|
|
44
|
+
}
|
|
45
|
+
addInputs(form, data);
|
|
46
|
+
form.submit();
|
|
47
|
+
if (success) {
|
|
48
|
+
success();
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
};
|
|
49
52
|
export { postOut };
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @param {Object} data The data if any
|
|
20
20
|
* @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
|
|
21
21
|
*
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {void}
|
|
23
23
|
*/
|
|
24
|
-
declare const setNavigationVars: (url: any, title: any, data?:
|
|
24
|
+
declare const setNavigationVars: (url: any, title: any, data?: any, repl?: boolean) => void;
|
|
25
25
|
export { setNavigationVars };
|
|
@@ -23,9 +23,9 @@ import { html2text } from '../html/html2text';
|
|
|
23
23
|
* @param {Object} data The data if any
|
|
24
24
|
* @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
|
|
25
25
|
*
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {void}
|
|
27
27
|
*/
|
|
28
|
-
const setNavigationVars = function (url, title, data, repl) {
|
|
28
|
+
const setNavigationVars = function (url, title, data = null, repl = false) {
|
|
29
29
|
// Current path becomes old path
|
|
30
30
|
bbn.env.old_path = bbn.env.path;
|
|
31
31
|
// URL includes the domain
|