@bbn/bbn 1.0.86 → 1.0.87
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.js +78 -73
- package/dist/fn/browser/getEventData.js +1 -2
- package/dist/fn/init.js +80 -76
- package/dist/fn/style/resize.js +1 -2
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -5948,7 +5948,7 @@
|
|
|
5948
5948
|
};
|
|
5949
5949
|
exports.getHTMLOfSelection = getHTMLOfSelection;
|
|
5950
5950
|
});
|
|
5951
|
-
define("fn/browser/getEventData", ["require", "exports", "fn/html/getHTMLOfSelection", "fn/loop/each"
|
|
5951
|
+
define("fn/browser/getEventData", ["require", "exports", "fn/html/getHTMLOfSelection", "fn/loop/each"], function (require, exports, getHTMLOfSelection_1, each_15) {
|
|
5952
5952
|
"use strict";
|
|
5953
5953
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5954
5954
|
exports.getEventData = void 0;
|
|
@@ -6032,7 +6032,7 @@
|
|
|
6032
6032
|
}
|
|
6033
6033
|
}
|
|
6034
6034
|
else {
|
|
6035
|
-
|
|
6035
|
+
bbn.fn.defaultErrorFunction(bbn._('Impossible to read the file') + ' ' + name);
|
|
6036
6036
|
}
|
|
6037
6037
|
}
|
|
6038
6038
|
else {
|
|
@@ -6899,7 +6899,7 @@
|
|
|
6899
6899
|
};
|
|
6900
6900
|
exports.submit = submit;
|
|
6901
6901
|
});
|
|
6902
|
-
define("fn/style/resize", ["require", "exports", "fn/style/getCssVar", "fn/loop/each"
|
|
6902
|
+
define("fn/style/resize", ["require", "exports", "fn/style/getCssVar", "fn/loop/each"], function (require, exports, getCssVar_1, each_17) {
|
|
6903
6903
|
"use strict";
|
|
6904
6904
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6905
6905
|
exports.resize = void 0;
|
|
@@ -6934,8 +6934,8 @@
|
|
|
6934
6934
|
if (!done) {
|
|
6935
6935
|
classes.push(newCls);
|
|
6936
6936
|
}
|
|
6937
|
+
bbn.fn.defaultResizeFunction();
|
|
6937
6938
|
document.body.className = classes.join(' ');
|
|
6938
|
-
(0, defaultResizeFunction_1.defaultResizeFunction)();
|
|
6939
6939
|
}
|
|
6940
6940
|
};
|
|
6941
6941
|
exports.resize = resize;
|
|
@@ -6991,7 +6991,7 @@
|
|
|
6991
6991
|
};
|
|
6992
6992
|
exports.isMobile = isMobile;
|
|
6993
6993
|
});
|
|
6994
|
-
define("fn/init", ["require", "exports", "fn/string/substr", "fn/loop/each", "fn/object/extend", "fn/style/addColors", "fn/ajax/link", "fn/form/submit", "fn/style/resize", "fn/browser/isMobile", "fn/browser/isTabletDevice", "fn/
|
|
6994
|
+
define("fn/init", ["require", "exports", "fn/string/substr", "fn/loop/each", "fn/object/extend", "fn/style/addColors", "fn/ajax/link", "fn/form/submit", "fn/style/resize", "fn/browser/isMobile", "fn/browser/isTabletDevice", "fn/type/isFunction", "fn/browser/log"], function (require, exports, substr_11, each_18, extend_7, addColors_1, link_1, submit_1, resize_1, isMobile_1, isTabletDevice_2, isFunction_9, log_18) {
|
|
6995
6995
|
"use strict";
|
|
6996
6996
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6997
6997
|
exports.init = void 0;
|
|
@@ -7011,61 +7011,62 @@
|
|
|
7011
7011
|
const init = function (cfg, force) {
|
|
7012
7012
|
let parts;
|
|
7013
7013
|
if (!bbn.env.isInit || force) {
|
|
7014
|
-
bbn.env.root =
|
|
7015
|
-
|
|
7016
|
-
|
|
7014
|
+
bbn.env.root =
|
|
7015
|
+
document.baseURI.length > 0 ? document.baseURI : bbn.env.host;
|
|
7016
|
+
if (bbn.env.root.length && (0, substr_11.substr)(bbn.env.root, -1) !== "/") {
|
|
7017
|
+
bbn.env.root += "/";
|
|
7017
7018
|
}
|
|
7018
|
-
if (!bbn.env.isInit && typeof dayjs !==
|
|
7019
|
+
if (!bbn.env.isInit && typeof dayjs !== "undefined") {
|
|
7019
7020
|
(0, each_18.each)([
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7021
|
+
"advancedFormat",
|
|
7022
|
+
"arraySupport",
|
|
7023
|
+
"badMutable",
|
|
7024
|
+
"buddhistEra",
|
|
7025
|
+
"calendar",
|
|
7026
|
+
"customParseFormat",
|
|
7027
|
+
"dayOfYear",
|
|
7028
|
+
"devHelper",
|
|
7029
|
+
"duration",
|
|
7030
|
+
"isBetween",
|
|
7031
|
+
"isLeapYear",
|
|
7032
|
+
"isSameOrAfter",
|
|
7033
|
+
"isSameOrBefore",
|
|
7034
|
+
"isToday",
|
|
7035
|
+
"isTomorrow",
|
|
7036
|
+
"isYesterday",
|
|
7037
|
+
"isoWeek",
|
|
7038
|
+
"isoWeeksInYear",
|
|
7039
|
+
"localeData",
|
|
7040
|
+
"localizedFormat",
|
|
7041
|
+
"minMax",
|
|
7042
|
+
"objectSupport",
|
|
7043
|
+
"pluralGetSet",
|
|
7044
|
+
"quarterOfYear",
|
|
7045
|
+
"relativeTime",
|
|
7046
|
+
"timezone",
|
|
7047
|
+
"toArray",
|
|
7048
|
+
"toObject",
|
|
7049
|
+
"updateLocale",
|
|
7050
|
+
"utc",
|
|
7051
|
+
"weekOfYear",
|
|
7052
|
+
"weekYear",
|
|
7053
|
+
"weekday",
|
|
7053
7054
|
], (plugin) => {
|
|
7054
|
-
if (window[
|
|
7055
|
-
dayjs.extend(window[
|
|
7055
|
+
if (window["dayjs_plugin_" + plugin]) {
|
|
7056
|
+
dayjs.extend(window["dayjs_plugin_" + plugin]);
|
|
7056
7057
|
}
|
|
7057
7058
|
});
|
|
7058
7059
|
}
|
|
7059
7060
|
/* The server's path (difference between the host and the current dir */
|
|
7060
|
-
if (typeof cfg ===
|
|
7061
|
+
if (typeof cfg === "object") {
|
|
7061
7062
|
(0, extend_7.extend)(true, bbn, cfg);
|
|
7062
7063
|
}
|
|
7063
7064
|
bbn.env.path = (0, substr_11.substr)(bbn.env.url, bbn.env.root.length);
|
|
7064
|
-
parts = bbn.env.path.split(
|
|
7065
|
+
parts = bbn.env.path.split("/");
|
|
7065
7066
|
//$.each(parts, function(i, v){
|
|
7066
7067
|
(0, each_18.each)(parts, (v, i) => {
|
|
7067
7068
|
v = decodeURI(v.trim());
|
|
7068
|
-
if (v !==
|
|
7069
|
+
if (v !== "") {
|
|
7069
7070
|
bbn.env.params.push(v);
|
|
7070
7071
|
}
|
|
7071
7072
|
});
|
|
@@ -7082,59 +7083,63 @@
|
|
|
7082
7083
|
bbn.env.isFocused = false;
|
|
7083
7084
|
bbn.env.timeoff = Math.round(new Date().getTime() / 1000);
|
|
7084
7085
|
};
|
|
7085
|
-
document.addEventListener(
|
|
7086
|
-
if (e.target instanceof HTMLElement &&
|
|
7086
|
+
document.addEventListener("focusin", (e) => {
|
|
7087
|
+
if (e.target instanceof HTMLElement &&
|
|
7088
|
+
!e.target.classList.contains("bbn-no")) {
|
|
7087
7089
|
bbn.env.focused = e.target;
|
|
7088
7090
|
}
|
|
7089
7091
|
bbn.env.last_focus = new Date().getTime();
|
|
7090
7092
|
});
|
|
7091
|
-
document.addEventListener(
|
|
7093
|
+
document.addEventListener("click", (e) => {
|
|
7092
7094
|
bbn.env.last_focus = new Date().getTime();
|
|
7093
|
-
if (bbn.env.nav !==
|
|
7095
|
+
if (bbn.env.nav !== "ajax") {
|
|
7094
7096
|
return;
|
|
7095
7097
|
}
|
|
7096
7098
|
let target = e.target;
|
|
7097
|
-
if (target instanceof HTMLElement &&
|
|
7099
|
+
if (target instanceof HTMLElement && target.tagName !== "A") {
|
|
7098
7100
|
let p = target;
|
|
7099
|
-
while (p && p.tagName !==
|
|
7100
|
-
if (p.tagName ===
|
|
7101
|
+
while (p && p.tagName !== "A") {
|
|
7102
|
+
if (p.tagName === "BODY") {
|
|
7101
7103
|
break;
|
|
7102
7104
|
}
|
|
7103
7105
|
p = p.parentElement;
|
|
7104
7106
|
}
|
|
7105
|
-
if (p && p.tagName ===
|
|
7107
|
+
if (p && p.tagName === "A") {
|
|
7106
7108
|
target = p;
|
|
7107
7109
|
}
|
|
7108
7110
|
else {
|
|
7109
7111
|
target = null;
|
|
7110
7112
|
}
|
|
7111
7113
|
}
|
|
7112
|
-
if (target instanceof HTMLElement &&
|
|
7114
|
+
if (target instanceof HTMLElement &&
|
|
7115
|
+
target.hasAttribute("href") &&
|
|
7116
|
+
!target.hasAttribute("target") &&
|
|
7117
|
+
!target.classList.contains("bbn-no")) {
|
|
7113
7118
|
e.preventDefault();
|
|
7114
7119
|
e.stopPropagation();
|
|
7115
|
-
(0, link_1.link)(target.getAttribute(
|
|
7120
|
+
(0, link_1.link)(target.getAttribute("href"));
|
|
7116
7121
|
return false;
|
|
7117
7122
|
}
|
|
7118
7123
|
});
|
|
7119
|
-
(0, each_18.each)(document.querySelectorAll(
|
|
7120
|
-
ele.addEventListener(
|
|
7124
|
+
(0, each_18.each)(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele) => {
|
|
7125
|
+
ele.addEventListener("submit", (e) => {
|
|
7121
7126
|
(0, submit_1.submit)(ele, e);
|
|
7122
7127
|
});
|
|
7123
7128
|
});
|
|
7124
|
-
window.addEventListener(
|
|
7129
|
+
window.addEventListener("hashchange", () => {
|
|
7125
7130
|
bbn.env.hashChanged = new Date().getTime();
|
|
7126
7131
|
}, false);
|
|
7127
|
-
window.addEventListener(
|
|
7132
|
+
window.addEventListener("resize", () => {
|
|
7128
7133
|
(0, resize_1.resize)();
|
|
7129
7134
|
});
|
|
7130
|
-
window.addEventListener(
|
|
7135
|
+
window.addEventListener("orientationchange", () => {
|
|
7131
7136
|
(0, resize_1.resize)();
|
|
7132
7137
|
});
|
|
7133
7138
|
(0, resize_1.resize)();
|
|
7134
7139
|
if ((0, isMobile_1.isMobile)()) {
|
|
7135
|
-
document.body.classList.add(
|
|
7140
|
+
document.body.classList.add("bbn-mobile");
|
|
7136
7141
|
if ((0, isTabletDevice_2.isTabletDevice)()) {
|
|
7137
|
-
document.body.classList.add(
|
|
7142
|
+
document.body.classList.add("bbn-tablet");
|
|
7138
7143
|
}
|
|
7139
7144
|
}
|
|
7140
7145
|
if (window.history) {
|
|
@@ -7142,9 +7147,9 @@
|
|
|
7142
7147
|
let h = window.history;
|
|
7143
7148
|
if (!bbn.env.historyDisabled && h) {
|
|
7144
7149
|
//e.preventDefault();
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
if (
|
|
7150
|
+
if (bbn.fn.defaultHistoryFunction(h.state)) {
|
|
7151
|
+
let state = h.state;
|
|
7152
|
+
if (state) {
|
|
7148
7153
|
//link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
|
|
7149
7154
|
(0, link_1.link)(state.url, (0, extend_7.extend)({ title: state.title || bbn.env.siteTitle }, state.data || {}));
|
|
7150
7155
|
}
|
|
@@ -7156,9 +7161,9 @@
|
|
|
7156
7161
|
};
|
|
7157
7162
|
}
|
|
7158
7163
|
bbn.env.isInit = true;
|
|
7159
|
-
document.dispatchEvent(new Event(
|
|
7164
|
+
document.dispatchEvent(new Event("bbninit"));
|
|
7160
7165
|
if (bbn.env.logging) {
|
|
7161
|
-
(0, log_18.log)(
|
|
7166
|
+
(0, log_18.log)("Logging in bbn is enabled");
|
|
7162
7167
|
}
|
|
7163
7168
|
}
|
|
7164
7169
|
};
|
|
@@ -9769,7 +9774,7 @@
|
|
|
9769
9774
|
};
|
|
9770
9775
|
exports.upload = upload;
|
|
9771
9776
|
});
|
|
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,
|
|
9777
|
+
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_1, defaultHistoryFunction_1, defaultLinkFunction_1, defaultPostLinkFunction_1, defaultPreLinkFunction_1, defaultResizeFunction_1, 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) {
|
|
9773
9778
|
"use strict";
|
|
9774
9779
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9775
9780
|
exports.fn = void 0;
|
|
@@ -9823,12 +9828,12 @@
|
|
|
9823
9828
|
defaultAlertFunction: defaultAlertFunction_1.defaultAlertFunction,
|
|
9824
9829
|
defaultConfirmFunction: defaultConfirmFunction_1.defaultConfirmFunction,
|
|
9825
9830
|
defaultEndLoadingFunction: defaultEndLoadingFunction_1.defaultEndLoadingFunction,
|
|
9826
|
-
defaultErrorFunction:
|
|
9827
|
-
defaultHistoryFunction:
|
|
9831
|
+
defaultErrorFunction: defaultErrorFunction_1.defaultErrorFunction,
|
|
9832
|
+
defaultHistoryFunction: defaultHistoryFunction_1.defaultHistoryFunction,
|
|
9828
9833
|
defaultLinkFunction: defaultLinkFunction_1.defaultLinkFunction,
|
|
9829
9834
|
defaultPostLinkFunction: defaultPostLinkFunction_1.defaultPostLinkFunction,
|
|
9830
9835
|
defaultPreLinkFunction: defaultPreLinkFunction_1.defaultPreLinkFunction,
|
|
9831
|
-
defaultResizeFunction:
|
|
9836
|
+
defaultResizeFunction: defaultResizeFunction_1.defaultResizeFunction,
|
|
9832
9837
|
defaultStartLoadingFunction: defaultStartLoadingFunction_1.defaultStartLoadingFunction,
|
|
9833
9838
|
deleteProp: deleteProp_1.deleteProp,
|
|
9834
9839
|
diffObj: diffObj_1.diffObj,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getHTMLOfSelection } from '../html/getHTMLOfSelection';
|
|
2
2
|
import { each } from '../loop/each';
|
|
3
|
-
import { defaultErrorFunction } from '../default/defaultErrorFunction';
|
|
4
3
|
/**
|
|
5
4
|
* Returns a promise having the event's data as argument.
|
|
6
5
|
* @method getEventData
|
|
@@ -81,7 +80,7 @@ const getEventData = function (e) {
|
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
else {
|
|
84
|
-
defaultErrorFunction(bbn._('Impossible to read the file') + ' ' + name);
|
|
83
|
+
bbn.fn.defaultErrorFunction(bbn._('Impossible to read the file') + ' ' + name);
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
else {
|
package/dist/fn/init.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { substr } from
|
|
2
|
-
import { each } from
|
|
3
|
-
import { extend } from
|
|
4
|
-
import { addColors } from
|
|
5
|
-
import { link } from
|
|
6
|
-
import { submit } from
|
|
7
|
-
import { resize } from
|
|
8
|
-
import { isMobile } from
|
|
9
|
-
import { isTabletDevice } from
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { log } from './browser/log';
|
|
1
|
+
import { substr } from "./string/substr";
|
|
2
|
+
import { each } from "./loop/each";
|
|
3
|
+
import { extend } from "./object/extend";
|
|
4
|
+
import { addColors } from "./style/addColors";
|
|
5
|
+
import { link } from "./ajax/link";
|
|
6
|
+
import { submit } from "./form/submit";
|
|
7
|
+
import { resize } from "./style/resize";
|
|
8
|
+
import { isMobile } from "./browser/isMobile";
|
|
9
|
+
import { isTabletDevice } from "./browser/isTabletDevice";
|
|
10
|
+
import { isFunction } from "./type/isFunction";
|
|
11
|
+
import { log } from "./browser/log";
|
|
13
12
|
/**
|
|
14
13
|
* Initializes the library bbn basing on the given configuration object.
|
|
15
14
|
* - Gives to the environment the dimension of the window.innerWidth and window.innerHeight
|
|
@@ -26,61 +25,62 @@ import { log } from './browser/log';
|
|
|
26
25
|
const init = function (cfg, force) {
|
|
27
26
|
let parts;
|
|
28
27
|
if (!bbn.env.isInit || force) {
|
|
29
|
-
bbn.env.root =
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
bbn.env.root =
|
|
29
|
+
document.baseURI.length > 0 ? document.baseURI : bbn.env.host;
|
|
30
|
+
if (bbn.env.root.length && substr(bbn.env.root, -1) !== "/") {
|
|
31
|
+
bbn.env.root += "/";
|
|
32
32
|
}
|
|
33
|
-
if (!bbn.env.isInit && typeof dayjs !==
|
|
33
|
+
if (!bbn.env.isInit && typeof dayjs !== "undefined") {
|
|
34
34
|
each([
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
"advancedFormat",
|
|
36
|
+
"arraySupport",
|
|
37
|
+
"badMutable",
|
|
38
|
+
"buddhistEra",
|
|
39
|
+
"calendar",
|
|
40
|
+
"customParseFormat",
|
|
41
|
+
"dayOfYear",
|
|
42
|
+
"devHelper",
|
|
43
|
+
"duration",
|
|
44
|
+
"isBetween",
|
|
45
|
+
"isLeapYear",
|
|
46
|
+
"isSameOrAfter",
|
|
47
|
+
"isSameOrBefore",
|
|
48
|
+
"isToday",
|
|
49
|
+
"isTomorrow",
|
|
50
|
+
"isYesterday",
|
|
51
|
+
"isoWeek",
|
|
52
|
+
"isoWeeksInYear",
|
|
53
|
+
"localeData",
|
|
54
|
+
"localizedFormat",
|
|
55
|
+
"minMax",
|
|
56
|
+
"objectSupport",
|
|
57
|
+
"pluralGetSet",
|
|
58
|
+
"quarterOfYear",
|
|
59
|
+
"relativeTime",
|
|
60
|
+
"timezone",
|
|
61
|
+
"toArray",
|
|
62
|
+
"toObject",
|
|
63
|
+
"updateLocale",
|
|
64
|
+
"utc",
|
|
65
|
+
"weekOfYear",
|
|
66
|
+
"weekYear",
|
|
67
|
+
"weekday",
|
|
68
68
|
], (plugin) => {
|
|
69
|
-
if (window[
|
|
70
|
-
dayjs.extend(window[
|
|
69
|
+
if (window["dayjs_plugin_" + plugin]) {
|
|
70
|
+
dayjs.extend(window["dayjs_plugin_" + plugin]);
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
/* The server's path (difference between the host and the current dir */
|
|
75
|
-
if (typeof cfg ===
|
|
75
|
+
if (typeof cfg === "object") {
|
|
76
76
|
extend(true, bbn, cfg);
|
|
77
77
|
}
|
|
78
78
|
bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
|
|
79
|
-
parts = bbn.env.path.split(
|
|
79
|
+
parts = bbn.env.path.split("/");
|
|
80
80
|
//$.each(parts, function(i, v){
|
|
81
81
|
each(parts, (v, i) => {
|
|
82
82
|
v = decodeURI(v.trim());
|
|
83
|
-
if (v !==
|
|
83
|
+
if (v !== "") {
|
|
84
84
|
bbn.env.params.push(v);
|
|
85
85
|
}
|
|
86
86
|
});
|
|
@@ -97,59 +97,63 @@ const init = function (cfg, force) {
|
|
|
97
97
|
bbn.env.isFocused = false;
|
|
98
98
|
bbn.env.timeoff = Math.round(new Date().getTime() / 1000);
|
|
99
99
|
};
|
|
100
|
-
document.addEventListener(
|
|
101
|
-
if (e.target instanceof HTMLElement &&
|
|
100
|
+
document.addEventListener("focusin", (e) => {
|
|
101
|
+
if (e.target instanceof HTMLElement &&
|
|
102
|
+
!e.target.classList.contains("bbn-no")) {
|
|
102
103
|
bbn.env.focused = e.target;
|
|
103
104
|
}
|
|
104
105
|
bbn.env.last_focus = new Date().getTime();
|
|
105
106
|
});
|
|
106
|
-
document.addEventListener(
|
|
107
|
+
document.addEventListener("click", (e) => {
|
|
107
108
|
bbn.env.last_focus = new Date().getTime();
|
|
108
|
-
if (bbn.env.nav !==
|
|
109
|
+
if (bbn.env.nav !== "ajax") {
|
|
109
110
|
return;
|
|
110
111
|
}
|
|
111
112
|
let target = e.target;
|
|
112
|
-
if (target instanceof HTMLElement &&
|
|
113
|
+
if (target instanceof HTMLElement && target.tagName !== "A") {
|
|
113
114
|
let p = target;
|
|
114
|
-
while (p && p.tagName !==
|
|
115
|
-
if (p.tagName ===
|
|
115
|
+
while (p && p.tagName !== "A") {
|
|
116
|
+
if (p.tagName === "BODY") {
|
|
116
117
|
break;
|
|
117
118
|
}
|
|
118
119
|
p = p.parentElement;
|
|
119
120
|
}
|
|
120
|
-
if (p && p.tagName ===
|
|
121
|
+
if (p && p.tagName === "A") {
|
|
121
122
|
target = p;
|
|
122
123
|
}
|
|
123
124
|
else {
|
|
124
125
|
target = null;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
if (target instanceof HTMLElement &&
|
|
128
|
+
if (target instanceof HTMLElement &&
|
|
129
|
+
target.hasAttribute("href") &&
|
|
130
|
+
!target.hasAttribute("target") &&
|
|
131
|
+
!target.classList.contains("bbn-no")) {
|
|
128
132
|
e.preventDefault();
|
|
129
133
|
e.stopPropagation();
|
|
130
|
-
link(target.getAttribute(
|
|
134
|
+
link(target.getAttribute("href"));
|
|
131
135
|
return false;
|
|
132
136
|
}
|
|
133
137
|
});
|
|
134
|
-
each(document.querySelectorAll(
|
|
135
|
-
ele.addEventListener(
|
|
138
|
+
each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele) => {
|
|
139
|
+
ele.addEventListener("submit", (e) => {
|
|
136
140
|
submit(ele, e);
|
|
137
141
|
});
|
|
138
142
|
});
|
|
139
|
-
window.addEventListener(
|
|
143
|
+
window.addEventListener("hashchange", () => {
|
|
140
144
|
bbn.env.hashChanged = new Date().getTime();
|
|
141
145
|
}, false);
|
|
142
|
-
window.addEventListener(
|
|
146
|
+
window.addEventListener("resize", () => {
|
|
143
147
|
resize();
|
|
144
148
|
});
|
|
145
|
-
window.addEventListener(
|
|
149
|
+
window.addEventListener("orientationchange", () => {
|
|
146
150
|
resize();
|
|
147
151
|
});
|
|
148
152
|
resize();
|
|
149
153
|
if (isMobile()) {
|
|
150
|
-
document.body.classList.add(
|
|
154
|
+
document.body.classList.add("bbn-mobile");
|
|
151
155
|
if (isTabletDevice()) {
|
|
152
|
-
document.body.classList.add(
|
|
156
|
+
document.body.classList.add("bbn-tablet");
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
if (window.history) {
|
|
@@ -157,9 +161,9 @@ const init = function (cfg, force) {
|
|
|
157
161
|
let h = window.history;
|
|
158
162
|
if (!bbn.env.historyDisabled && h) {
|
|
159
163
|
//e.preventDefault();
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (
|
|
164
|
+
if (bbn.fn.defaultHistoryFunction(h.state)) {
|
|
165
|
+
let state = h.state;
|
|
166
|
+
if (state) {
|
|
163
167
|
//link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
|
|
164
168
|
link(state.url, extend({ title: state.title || bbn.env.siteTitle }, state.data || {}));
|
|
165
169
|
}
|
|
@@ -171,9 +175,9 @@ const init = function (cfg, force) {
|
|
|
171
175
|
};
|
|
172
176
|
}
|
|
173
177
|
bbn.env.isInit = true;
|
|
174
|
-
document.dispatchEvent(new Event(
|
|
178
|
+
document.dispatchEvent(new Event("bbninit"));
|
|
175
179
|
if (bbn.env.logging) {
|
|
176
|
-
log(
|
|
180
|
+
log("Logging in bbn is enabled");
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
183
|
};
|
package/dist/fn/style/resize.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getCssVar } from './getCssVar';
|
|
2
2
|
import { each } from '../loop/each';
|
|
3
|
-
import { defaultResizeFunction } from '../default/defaultResizeFunction';
|
|
4
3
|
const resize = function () {
|
|
5
4
|
let diffW = bbn.env.width !== window.innerWidth;
|
|
6
5
|
let diffH = bbn.env.height !== window.innerHeight;
|
|
@@ -32,8 +31,8 @@ const resize = function () {
|
|
|
32
31
|
if (!done) {
|
|
33
32
|
classes.push(newCls);
|
|
34
33
|
}
|
|
34
|
+
bbn.fn.defaultResizeFunction();
|
|
35
35
|
document.body.className = classes.join(' ');
|
|
36
|
-
defaultResizeFunction();
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
38
|
export { resize };
|