@bbn/bbn 1.0.22 → 1.0.23
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 +1 -376
- package/dist/bundle.js +395 -399
- package/dist/index.d.ts +1 -376
- package/dist/index.js +392 -395
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -227,403 +227,400 @@ import { uniqString } from './fn/uniqString';
|
|
|
227
227
|
import { unique } from './fn/unique';
|
|
228
228
|
import { upload } from './fn/upload';
|
|
229
229
|
import { warning } from './fn/warning';
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
230
|
+
const version = "1.0.1";
|
|
231
|
+
const opt = {
|
|
232
|
+
_cat: {}
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Translate an expression using the object bbn.lng
|
|
236
|
+
*
|
|
237
|
+
* @param {String} st
|
|
238
|
+
* @returns {String}
|
|
239
|
+
*/
|
|
240
|
+
const _ = (st) => {
|
|
241
|
+
bbn.fn.checkType(st, 'string', "Undeerscore function takes strings as arguments");
|
|
242
|
+
let res = bbn.lng[st] || st;
|
|
243
|
+
let args = Array.prototype.slice.call(arguments, 1);
|
|
244
|
+
if (args.length) {
|
|
245
|
+
let i = 0;
|
|
246
|
+
return res.replace(/\%([d|s])/g, (match, type) => {
|
|
247
|
+
let tmp = args[i++];
|
|
248
|
+
if (!tmp) {
|
|
249
|
+
tmp = type === 'd' ? 0 : '';
|
|
250
|
+
}
|
|
251
|
+
bbn.fn.checkType(tmp, type === 'd' ? 'number' : 'string', bbn._("The value you gave did not correspond, check the loggg"));
|
|
252
|
+
return tmp;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return res;
|
|
256
|
+
};
|
|
257
|
+
const $ = (selector, context) => {
|
|
258
|
+
if (context && context.querySelectorAll) {
|
|
259
|
+
return context.querySelectorAll(selector);
|
|
260
|
+
}
|
|
261
|
+
return document.body.querySelectorAll(selector);
|
|
262
|
+
};
|
|
263
|
+
const _popups = [];
|
|
264
|
+
const lng = {
|
|
265
|
+
/* User-defined languages elements */
|
|
266
|
+
select_unselect_all: "Select/Clear all",
|
|
267
|
+
select_all: "Select all",
|
|
268
|
+
search: 'Search',
|
|
269
|
+
loading: 'Loading...',
|
|
270
|
+
choose: 'Choose',
|
|
271
|
+
error: 'Error',
|
|
272
|
+
server_response: 'Server response',
|
|
273
|
+
reload: 'Reload',
|
|
274
|
+
errorText: 'Something went wrong',
|
|
275
|
+
closeAll: "Close all",
|
|
276
|
+
closeOthers: "Close others",
|
|
277
|
+
pin: "Pin",
|
|
278
|
+
arrange: "Arrange",
|
|
279
|
+
cancel: "Cancel",
|
|
280
|
+
unpin: "Unpin",
|
|
281
|
+
yes: "Yes",
|
|
282
|
+
no: "No",
|
|
283
|
+
unknown: "Unknown",
|
|
284
|
+
untitled: "Untitled",
|
|
285
|
+
confirmation: "Confirmation",
|
|
286
|
+
Today: "Today",
|
|
287
|
+
Tomorrow: "Tomorrow",
|
|
288
|
+
Yesterday: "Yesterday"
|
|
289
|
+
};
|
|
290
|
+
const app = {
|
|
291
|
+
popups: [],
|
|
292
|
+
};
|
|
293
|
+
const vars = {
|
|
294
|
+
loggers: {
|
|
295
|
+
_num: 0
|
|
293
296
|
},
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
confirm: [13, 9],
|
|
308
|
-
alt: [20, 16, 17, 18, 144],
|
|
309
|
-
numbers: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105],
|
|
310
|
-
numsigns: [109, 110, 189, 190]
|
|
311
|
-
},
|
|
312
|
-
comparators: [">=", "<=", ">", "<", "="],
|
|
313
|
-
operators: ["+", "-", "/", "*"],
|
|
314
|
-
tags: ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'slot', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'],
|
|
315
|
-
colors: {
|
|
316
|
-
darkgrey: '#5a6a62',
|
|
317
|
-
black: '#000000',
|
|
318
|
-
anthracite: '#454545',
|
|
319
|
-
grey: '#d3d3d3',
|
|
320
|
-
white: '#ffffff',
|
|
321
|
-
beige: '#fdfdfd',
|
|
322
|
-
lightgrey: '#dcdcdc',
|
|
323
|
-
pastelblue: '#ddebf6',
|
|
324
|
-
cyan: '#00c8f8',
|
|
325
|
-
blue: '#6e9ecf',
|
|
326
|
-
indigo: '#3f51b5',
|
|
327
|
-
navy: '#354458',
|
|
328
|
-
webblue: '#2196f3',
|
|
329
|
-
teal: '#009688',
|
|
330
|
-
turquoise: '#1fda9a',
|
|
331
|
-
pastelgreen: '#e2efda',
|
|
332
|
-
palegreen: '#ccffcc',
|
|
333
|
-
green: '#00a03e',
|
|
334
|
-
olive: '#92b06a',
|
|
335
|
-
pastelorange: '#fff2cc',
|
|
336
|
-
yellow: '#fdf200',
|
|
337
|
-
orange: '#ff9900',
|
|
338
|
-
pink: '#eb65a0',
|
|
339
|
-
purple: '#a333c8',
|
|
340
|
-
red: '#db3340',
|
|
341
|
-
brown: '#8c6954'
|
|
342
|
-
},
|
|
343
|
-
mockText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
344
|
-
regexp: {
|
|
345
|
-
url: new RegExp('^(https?:\\/\\/)?' + // protocol
|
|
346
|
-
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|' + // domain name
|
|
347
|
-
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
|
348
|
-
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
|
349
|
-
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
|
350
|
-
'(\\#[-a-z\\d_]*)?$', 'i'),
|
|
351
|
-
ip: new RegExp("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"),
|
|
352
|
-
hostname: new RegExp("^[a-z\\d]([a-z\\d\\-]{0,61}[a-z\\d])?(\\.[a-z\\d]([a-z\\d\\-]{0,61}[a-z\\d])?)*$", 'i'),
|
|
353
|
-
}
|
|
297
|
+
/* Usable datatypes through Ajax function */
|
|
298
|
+
datatypes: ['xml', 'html', 'script', 'json', 'jsonp', 'text', 'blob'],
|
|
299
|
+
/* The default value used by the function shorten */
|
|
300
|
+
shortenLen: 30,
|
|
301
|
+
/* Categorizing keyboard map */
|
|
302
|
+
keys: {
|
|
303
|
+
upDown: [33, 34, 35, 36, 38, 40],
|
|
304
|
+
leftRight: [36, 35, 37, 39],
|
|
305
|
+
dels: [8, 46, 45],
|
|
306
|
+
confirm: [13, 9],
|
|
307
|
+
alt: [20, 16, 17, 18, 144],
|
|
308
|
+
numbers: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105],
|
|
309
|
+
numsigns: [109, 110, 189, 190]
|
|
354
310
|
},
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
/* bbn.env.params is an array of each element of the path */
|
|
386
|
-
resizeTimer: false,
|
|
387
|
-
hashChanged: 0,
|
|
388
|
-
params: [],
|
|
389
|
-
isInit: false,
|
|
390
|
-
isFocused: false,
|
|
391
|
-
timeoff: Math.round((new Date()).getTime() / 1000),
|
|
392
|
-
loggingLevel: 5,
|
|
393
|
-
ignoreUnload: false,
|
|
394
|
-
historyDisabled: false,
|
|
395
|
-
nav: 'ajax'
|
|
311
|
+
comparators: [">=", "<=", ">", "<", "="],
|
|
312
|
+
operators: ["+", "-", "/", "*"],
|
|
313
|
+
tags: ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'slot', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'],
|
|
314
|
+
colors: {
|
|
315
|
+
darkgrey: '#5a6a62',
|
|
316
|
+
black: '#000000',
|
|
317
|
+
anthracite: '#454545',
|
|
318
|
+
grey: '#d3d3d3',
|
|
319
|
+
white: '#ffffff',
|
|
320
|
+
beige: '#fdfdfd',
|
|
321
|
+
lightgrey: '#dcdcdc',
|
|
322
|
+
pastelblue: '#ddebf6',
|
|
323
|
+
cyan: '#00c8f8',
|
|
324
|
+
blue: '#6e9ecf',
|
|
325
|
+
indigo: '#3f51b5',
|
|
326
|
+
navy: '#354458',
|
|
327
|
+
webblue: '#2196f3',
|
|
328
|
+
teal: '#009688',
|
|
329
|
+
turquoise: '#1fda9a',
|
|
330
|
+
pastelgreen: '#e2efda',
|
|
331
|
+
palegreen: '#ccffcc',
|
|
332
|
+
green: '#00a03e',
|
|
333
|
+
olive: '#92b06a',
|
|
334
|
+
pastelorange: '#fff2cc',
|
|
335
|
+
yellow: '#fdf200',
|
|
336
|
+
orange: '#ff9900',
|
|
337
|
+
pink: '#eb65a0',
|
|
338
|
+
purple: '#a333c8',
|
|
339
|
+
red: '#db3340',
|
|
340
|
+
brown: '#8c6954'
|
|
396
341
|
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
adjustSize,
|
|
408
|
-
adjustWidth,
|
|
409
|
-
ajax,
|
|
410
|
-
analyzeFunction,
|
|
411
|
-
animateCss,
|
|
412
|
-
arrayBuffer2String,
|
|
413
|
-
arrayFromProp,
|
|
414
|
-
autoExtend,
|
|
415
|
-
baseName,
|
|
416
|
-
br2nl,
|
|
417
|
-
calendar,
|
|
418
|
-
callback,
|
|
419
|
-
camelize,
|
|
420
|
-
camelToCss,
|
|
421
|
-
canvasToImage,
|
|
422
|
-
center,
|
|
423
|
-
checkProps,
|
|
424
|
-
checkPropsDetails,
|
|
425
|
-
checkPropsOrDie,
|
|
426
|
-
checkType,
|
|
427
|
-
circularReplacer,
|
|
428
|
-
clone,
|
|
429
|
-
colorToHex,
|
|
430
|
-
compare,
|
|
431
|
-
compareConditions,
|
|
432
|
-
copy,
|
|
433
|
-
correctCase,
|
|
434
|
-
count,
|
|
435
|
-
crc32,
|
|
436
|
-
createObject,
|
|
437
|
-
cssExists,
|
|
438
|
-
date,
|
|
439
|
-
dateSQL,
|
|
440
|
-
daysInMonth,
|
|
441
|
-
deepPath,
|
|
442
|
-
defaultAjaxAbortFunction,
|
|
443
|
-
defaultAjaxErrorFunction,
|
|
444
|
-
defaultAlertFunction,
|
|
445
|
-
defaultConfirmFunction,
|
|
446
|
-
defaultEndLoadingFunction,
|
|
447
|
-
defaultErrorFunction,
|
|
448
|
-
defaultHistoryFunction,
|
|
449
|
-
defaultLinkFunction,
|
|
450
|
-
defaultPostLinkFunction,
|
|
451
|
-
defaultPreLinkFunction,
|
|
452
|
-
defaultResizeFunction,
|
|
453
|
-
defaultStartLoadingFunction,
|
|
454
|
-
deleteProp,
|
|
455
|
-
diffObj,
|
|
456
|
-
dirName,
|
|
457
|
-
download,
|
|
458
|
-
downloadContent,
|
|
459
|
-
each,
|
|
460
|
-
eraseCookie,
|
|
461
|
-
error,
|
|
462
|
-
escapeDquotes,
|
|
463
|
-
escapeRegExp,
|
|
464
|
-
escapeSquotes,
|
|
465
|
-
escapeTicks,
|
|
466
|
-
escapeUrl,
|
|
467
|
-
extend,
|
|
468
|
-
extendOut,
|
|
469
|
-
fdate,
|
|
470
|
-
fdatetime,
|
|
471
|
-
fieldValue,
|
|
472
|
-
fileExt,
|
|
473
|
-
filter,
|
|
474
|
-
filterToConditions,
|
|
475
|
-
findAll,
|
|
476
|
-
fori,
|
|
477
|
-
forir,
|
|
478
|
-
format,
|
|
479
|
-
formatBytes,
|
|
480
|
-
formatDate,
|
|
481
|
-
formatSize,
|
|
482
|
-
formdata,
|
|
483
|
-
fromXml,
|
|
484
|
-
ftime,
|
|
485
|
-
getAllTags,
|
|
486
|
-
getAncestors,
|
|
487
|
-
getAttributes,
|
|
488
|
-
getBrowserName,
|
|
489
|
-
getBrowserVersion,
|
|
490
|
-
getCookie,
|
|
491
|
-
getCssVar,
|
|
492
|
-
getDay,
|
|
493
|
-
getDeviceType,
|
|
494
|
-
getEventData,
|
|
495
|
-
getField,
|
|
496
|
-
getFieldValues,
|
|
497
|
-
getHtml,
|
|
498
|
-
getHTMLOfSelection,
|
|
499
|
-
getLoader,
|
|
500
|
-
getPath,
|
|
501
|
-
getProp,
|
|
502
|
-
getProperty,
|
|
503
|
-
getRequestId,
|
|
504
|
-
getRow,
|
|
505
|
-
getScrollBarSize,
|
|
506
|
-
getText,
|
|
507
|
-
getTimeoff,
|
|
508
|
-
happy,
|
|
509
|
-
hash,
|
|
510
|
-
hex2rgb,
|
|
511
|
-
history,
|
|
512
|
-
html2text,
|
|
513
|
-
imageToCanvas,
|
|
514
|
-
imgToBase64,
|
|
515
|
-
info,
|
|
516
|
-
init,
|
|
517
|
-
isActiveInterface,
|
|
518
|
-
isArray,
|
|
519
|
-
isBlob,
|
|
520
|
-
isBoolean,
|
|
521
|
-
isCanvas,
|
|
522
|
-
isColor,
|
|
523
|
-
isComment,
|
|
524
|
-
isCp,
|
|
525
|
-
isDate,
|
|
526
|
-
isDesktopDevice,
|
|
527
|
-
isDimension,
|
|
528
|
-
isDom,
|
|
529
|
-
isEmail,
|
|
530
|
-
isEmpty,
|
|
531
|
-
isEvent,
|
|
532
|
-
isFocused,
|
|
533
|
-
isFunction,
|
|
534
|
-
isHostname,
|
|
535
|
-
isInside,
|
|
536
|
-
isInt,
|
|
537
|
-
isIP,
|
|
538
|
-
isIterable,
|
|
539
|
-
isMobile,
|
|
540
|
-
isMobileDevice,
|
|
541
|
-
isNull,
|
|
542
|
-
isNumber,
|
|
543
|
-
isObject,
|
|
544
|
-
isPercent,
|
|
545
|
-
isPrimitive,
|
|
546
|
-
isPromise,
|
|
547
|
-
isPropSize,
|
|
548
|
-
isSame,
|
|
549
|
-
isSQLDate,
|
|
550
|
-
isString,
|
|
551
|
-
isSymbol,
|
|
552
|
-
isTabletDevice,
|
|
553
|
-
isURL,
|
|
554
|
-
isValidDimension,
|
|
555
|
-
isValidName,
|
|
556
|
-
isValue,
|
|
557
|
-
isVue,
|
|
558
|
-
iterate,
|
|
559
|
-
lightenDarkenHex,
|
|
560
|
-
link,
|
|
561
|
-
log,
|
|
562
|
-
makeReactive,
|
|
563
|
-
map,
|
|
564
|
-
md5,
|
|
565
|
-
money,
|
|
566
|
-
move,
|
|
567
|
-
multiorder,
|
|
568
|
-
nl2br,
|
|
569
|
-
numProperties,
|
|
570
|
-
objectToFormData,
|
|
571
|
-
order,
|
|
572
|
-
outerHeight,
|
|
573
|
-
outerWidth,
|
|
574
|
-
percent,
|
|
575
|
-
pickValue,
|
|
576
|
-
post,
|
|
577
|
-
postOut,
|
|
578
|
-
printf,
|
|
579
|
-
quotes2html,
|
|
580
|
-
randomInt,
|
|
581
|
-
randomString,
|
|
582
|
-
removeAccents,
|
|
583
|
-
removeEmpty,
|
|
584
|
-
removeExtraSpaces,
|
|
585
|
-
removeHtmlComments,
|
|
586
|
-
removePrivateProp,
|
|
587
|
-
removeTrailingChars,
|
|
588
|
-
repeat,
|
|
589
|
-
replaceAll,
|
|
590
|
-
replaceSelection,
|
|
591
|
-
resize,
|
|
592
|
-
rgb2hex,
|
|
593
|
-
riterate,
|
|
594
|
-
roundDecimal,
|
|
595
|
-
sanitize,
|
|
596
|
-
search,
|
|
597
|
-
selectElementText,
|
|
598
|
-
selector,
|
|
599
|
-
setCookie,
|
|
600
|
-
setCssVar,
|
|
601
|
-
setNavigationVars,
|
|
602
|
-
setProp,
|
|
603
|
-
setProperty,
|
|
604
|
-
shorten,
|
|
605
|
-
shortenObj,
|
|
606
|
-
shuffle,
|
|
607
|
-
simpleHash,
|
|
608
|
-
simpleHash1,
|
|
609
|
-
simpleHash2,
|
|
610
|
-
startChrono,
|
|
611
|
-
stat,
|
|
612
|
-
stopChrono,
|
|
613
|
-
string2ArrayBuffer,
|
|
614
|
-
submit,
|
|
615
|
-
substr,
|
|
616
|
-
sum,
|
|
617
|
-
timestamp,
|
|
618
|
-
toCSV,
|
|
619
|
-
toggleFullScreen,
|
|
620
|
-
translate,
|
|
621
|
-
treatAjaxArguments,
|
|
622
|
-
trim,
|
|
623
|
-
uniqString,
|
|
624
|
-
unique,
|
|
625
|
-
upload,
|
|
626
|
-
warning,
|
|
342
|
+
mockText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
343
|
+
regexp: {
|
|
344
|
+
url: new RegExp('^(https?:\\/\\/)?' + // protocol
|
|
345
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|' + // domain name
|
|
346
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
|
347
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
|
348
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
|
349
|
+
'(\\#[-a-z\\d_]*)?$', 'i'),
|
|
350
|
+
ip: new RegExp("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"),
|
|
351
|
+
hostname: new RegExp("^[a-z\\d]([a-z\\d\\-]{0,61}[a-z\\d])?(\\.[a-z\\d]([a-z\\d\\-]{0,61}[a-z\\d])?)*$", 'i'),
|
|
627
352
|
}
|
|
628
353
|
};
|
|
629
|
-
|
|
354
|
+
const env = {
|
|
355
|
+
siteTitle: window.document.title,
|
|
356
|
+
/* This variable should be set to true in debugging mode only */
|
|
357
|
+
logging: false,
|
|
358
|
+
/* Address of the CDN (where this file should be hosted) */
|
|
359
|
+
cdn: '',
|
|
360
|
+
/* Default language */
|
|
361
|
+
lang: 'en',
|
|
362
|
+
host: window.location.protocol + '//' + window.location.hostname,
|
|
363
|
+
url: window.location.href,
|
|
364
|
+
old_path: null,
|
|
365
|
+
/* True when non asynchronous Ajax loads */
|
|
366
|
+
loading: false,
|
|
367
|
+
/* Window width */
|
|
368
|
+
width: 0,
|
|
369
|
+
/* Window height */
|
|
370
|
+
height: 0,
|
|
371
|
+
/* Element currently focused (Element object) */
|
|
372
|
+
focused: false,
|
|
373
|
+
/* Last time user has been active */
|
|
374
|
+
last_focus: (new Date()).getTime(),
|
|
375
|
+
/* Sleep mode (tab or window unfocused */
|
|
376
|
+
sleep: false,
|
|
377
|
+
/**
|
|
378
|
+
* @var bbn.env.loaders Object where the props are MD5 of data and url while the values are the requests,
|
|
379
|
+
* for preventing the same call to be made at the same time
|
|
380
|
+
**/
|
|
381
|
+
loaders: [],
|
|
382
|
+
loadersHistory: [],
|
|
383
|
+
maxLoadersHistory: 20,
|
|
384
|
+
/* bbn.env.params is an array of each element of the path */
|
|
385
|
+
resizeTimer: false,
|
|
386
|
+
hashChanged: 0,
|
|
387
|
+
params: [],
|
|
388
|
+
isInit: false,
|
|
389
|
+
isFocused: false,
|
|
390
|
+
timeoff: Math.round((new Date()).getTime() / 1000),
|
|
391
|
+
loggingLevel: 5,
|
|
392
|
+
ignoreUnload: false,
|
|
393
|
+
historyDisabled: false,
|
|
394
|
+
nav: 'ajax'
|
|
395
|
+
};
|
|
396
|
+
const fn = {
|
|
397
|
+
_addLoader,
|
|
398
|
+
_compareValues,
|
|
399
|
+
_deleteLoader,
|
|
400
|
+
abort,
|
|
401
|
+
abortURL,
|
|
402
|
+
addColors,
|
|
403
|
+
addInputs,
|
|
404
|
+
addStyle,
|
|
405
|
+
adjustHeight,
|
|
406
|
+
adjustSize,
|
|
407
|
+
adjustWidth,
|
|
408
|
+
ajax,
|
|
409
|
+
analyzeFunction,
|
|
410
|
+
animateCss,
|
|
411
|
+
arrayBuffer2String,
|
|
412
|
+
arrayFromProp,
|
|
413
|
+
autoExtend,
|
|
414
|
+
baseName,
|
|
415
|
+
br2nl,
|
|
416
|
+
calendar,
|
|
417
|
+
callback,
|
|
418
|
+
camelize,
|
|
419
|
+
camelToCss,
|
|
420
|
+
canvasToImage,
|
|
421
|
+
center,
|
|
422
|
+
checkProps,
|
|
423
|
+
checkPropsDetails,
|
|
424
|
+
checkPropsOrDie,
|
|
425
|
+
checkType,
|
|
426
|
+
circularReplacer,
|
|
427
|
+
clone,
|
|
428
|
+
colorToHex,
|
|
429
|
+
compare,
|
|
430
|
+
compareConditions,
|
|
431
|
+
copy,
|
|
432
|
+
correctCase,
|
|
433
|
+
count,
|
|
434
|
+
crc32,
|
|
435
|
+
createObject,
|
|
436
|
+
cssExists,
|
|
437
|
+
date,
|
|
438
|
+
dateSQL,
|
|
439
|
+
daysInMonth,
|
|
440
|
+
deepPath,
|
|
441
|
+
defaultAjaxAbortFunction,
|
|
442
|
+
defaultAjaxErrorFunction,
|
|
443
|
+
defaultAlertFunction,
|
|
444
|
+
defaultConfirmFunction,
|
|
445
|
+
defaultEndLoadingFunction,
|
|
446
|
+
defaultErrorFunction,
|
|
447
|
+
defaultHistoryFunction,
|
|
448
|
+
defaultLinkFunction,
|
|
449
|
+
defaultPostLinkFunction,
|
|
450
|
+
defaultPreLinkFunction,
|
|
451
|
+
defaultResizeFunction,
|
|
452
|
+
defaultStartLoadingFunction,
|
|
453
|
+
deleteProp,
|
|
454
|
+
diffObj,
|
|
455
|
+
dirName,
|
|
456
|
+
download,
|
|
457
|
+
downloadContent,
|
|
458
|
+
each,
|
|
459
|
+
eraseCookie,
|
|
460
|
+
error,
|
|
461
|
+
escapeDquotes,
|
|
462
|
+
escapeRegExp,
|
|
463
|
+
escapeSquotes,
|
|
464
|
+
escapeTicks,
|
|
465
|
+
escapeUrl,
|
|
466
|
+
extend,
|
|
467
|
+
extendOut,
|
|
468
|
+
fdate,
|
|
469
|
+
fdatetime,
|
|
470
|
+
fieldValue,
|
|
471
|
+
fileExt,
|
|
472
|
+
filter,
|
|
473
|
+
filterToConditions,
|
|
474
|
+
findAll,
|
|
475
|
+
fori,
|
|
476
|
+
forir,
|
|
477
|
+
format,
|
|
478
|
+
formatBytes,
|
|
479
|
+
formatDate,
|
|
480
|
+
formatSize,
|
|
481
|
+
formdata,
|
|
482
|
+
fromXml,
|
|
483
|
+
ftime,
|
|
484
|
+
getAllTags,
|
|
485
|
+
getAncestors,
|
|
486
|
+
getAttributes,
|
|
487
|
+
getBrowserName,
|
|
488
|
+
getBrowserVersion,
|
|
489
|
+
getCookie,
|
|
490
|
+
getCssVar,
|
|
491
|
+
getDay,
|
|
492
|
+
getDeviceType,
|
|
493
|
+
getEventData,
|
|
494
|
+
getField,
|
|
495
|
+
getFieldValues,
|
|
496
|
+
getHtml,
|
|
497
|
+
getHTMLOfSelection,
|
|
498
|
+
getLoader,
|
|
499
|
+
getPath,
|
|
500
|
+
getProp,
|
|
501
|
+
getProperty,
|
|
502
|
+
getRequestId,
|
|
503
|
+
getRow,
|
|
504
|
+
getScrollBarSize,
|
|
505
|
+
getText,
|
|
506
|
+
getTimeoff,
|
|
507
|
+
happy,
|
|
508
|
+
hash,
|
|
509
|
+
hex2rgb,
|
|
510
|
+
history,
|
|
511
|
+
html2text,
|
|
512
|
+
imageToCanvas,
|
|
513
|
+
imgToBase64,
|
|
514
|
+
info,
|
|
515
|
+
init,
|
|
516
|
+
isActiveInterface,
|
|
517
|
+
isArray,
|
|
518
|
+
isBlob,
|
|
519
|
+
isBoolean,
|
|
520
|
+
isCanvas,
|
|
521
|
+
isColor,
|
|
522
|
+
isComment,
|
|
523
|
+
isCp,
|
|
524
|
+
isDate,
|
|
525
|
+
isDesktopDevice,
|
|
526
|
+
isDimension,
|
|
527
|
+
isDom,
|
|
528
|
+
isEmail,
|
|
529
|
+
isEmpty,
|
|
530
|
+
isEvent,
|
|
531
|
+
isFocused,
|
|
532
|
+
isFunction,
|
|
533
|
+
isHostname,
|
|
534
|
+
isInside,
|
|
535
|
+
isInt,
|
|
536
|
+
isIP,
|
|
537
|
+
isIterable,
|
|
538
|
+
isMobile,
|
|
539
|
+
isMobileDevice,
|
|
540
|
+
isNull,
|
|
541
|
+
isNumber,
|
|
542
|
+
isObject,
|
|
543
|
+
isPercent,
|
|
544
|
+
isPrimitive,
|
|
545
|
+
isPromise,
|
|
546
|
+
isPropSize,
|
|
547
|
+
isSame,
|
|
548
|
+
isSQLDate,
|
|
549
|
+
isString,
|
|
550
|
+
isSymbol,
|
|
551
|
+
isTabletDevice,
|
|
552
|
+
isURL,
|
|
553
|
+
isValidDimension,
|
|
554
|
+
isValidName,
|
|
555
|
+
isValue,
|
|
556
|
+
isVue,
|
|
557
|
+
iterate,
|
|
558
|
+
lightenDarkenHex,
|
|
559
|
+
link,
|
|
560
|
+
log,
|
|
561
|
+
makeReactive,
|
|
562
|
+
map,
|
|
563
|
+
md5,
|
|
564
|
+
money,
|
|
565
|
+
move,
|
|
566
|
+
multiorder,
|
|
567
|
+
nl2br,
|
|
568
|
+
numProperties,
|
|
569
|
+
objectToFormData,
|
|
570
|
+
order,
|
|
571
|
+
outerHeight,
|
|
572
|
+
outerWidth,
|
|
573
|
+
percent,
|
|
574
|
+
pickValue,
|
|
575
|
+
post,
|
|
576
|
+
postOut,
|
|
577
|
+
printf,
|
|
578
|
+
quotes2html,
|
|
579
|
+
randomInt,
|
|
580
|
+
randomString,
|
|
581
|
+
removeAccents,
|
|
582
|
+
removeEmpty,
|
|
583
|
+
removeExtraSpaces,
|
|
584
|
+
removeHtmlComments,
|
|
585
|
+
removePrivateProp,
|
|
586
|
+
removeTrailingChars,
|
|
587
|
+
repeat,
|
|
588
|
+
replaceAll,
|
|
589
|
+
replaceSelection,
|
|
590
|
+
resize,
|
|
591
|
+
rgb2hex,
|
|
592
|
+
riterate,
|
|
593
|
+
roundDecimal,
|
|
594
|
+
sanitize,
|
|
595
|
+
search,
|
|
596
|
+
selectElementText,
|
|
597
|
+
selector,
|
|
598
|
+
setCookie,
|
|
599
|
+
setCssVar,
|
|
600
|
+
setNavigationVars,
|
|
601
|
+
setProp,
|
|
602
|
+
setProperty,
|
|
603
|
+
shorten,
|
|
604
|
+
shortenObj,
|
|
605
|
+
shuffle,
|
|
606
|
+
simpleHash,
|
|
607
|
+
simpleHash1,
|
|
608
|
+
simpleHash2,
|
|
609
|
+
startChrono,
|
|
610
|
+
stat,
|
|
611
|
+
stopChrono,
|
|
612
|
+
string2ArrayBuffer,
|
|
613
|
+
submit,
|
|
614
|
+
substr,
|
|
615
|
+
sum,
|
|
616
|
+
timestamp,
|
|
617
|
+
toCSV,
|
|
618
|
+
toggleFullScreen,
|
|
619
|
+
translate,
|
|
620
|
+
treatAjaxArguments,
|
|
621
|
+
trim,
|
|
622
|
+
uniqString,
|
|
623
|
+
unique,
|
|
624
|
+
upload,
|
|
625
|
+
warning,
|
|
626
|
+
};
|