puvox-library 1.1.49 → 1.1.51
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/library_standard.d.ts +6 -5
- package/library_standard.d.ts.map +1 -1
- package/library_standard.js +74 -76
- package/package.json +1 -1
package/library_standard.d.ts
CHANGED
@@ -34,7 +34,9 @@ declare class PuvoxLibrary {
|
|
34
34
|
removeKeysExcept(obj: any, keysArr: any): {};
|
35
35
|
arrayDiff(source: any, comparedTo: any): any;
|
36
36
|
arrayIntersect(source: any, comparedTo: any): any;
|
37
|
-
|
37
|
+
objects_equal(o1: any, o2: any): boolean;
|
38
|
+
object_keys_diff(old_obj: any, new_obj: any): string[];
|
39
|
+
objects_diff(old_obj: any, new_obj: any, deep?: boolean): any[];
|
38
40
|
sortKeys(x: any, out?: {}): {};
|
39
41
|
sortByValuesIntoArray(obj: any, ascending?: boolean): any;
|
40
42
|
stringArrayToNumeric(arr: any): number[];
|
@@ -87,6 +89,7 @@ declare class PuvoxLibrary {
|
|
87
89
|
renameSubKey(obj: any, keyFrom: any, keyTo: any, strict?: boolean): any;
|
88
90
|
hasEmptyChild(obj: any): boolean;
|
89
91
|
filterObject(obj: any, callback: any): any;
|
92
|
+
filter_object_by(obj: any, key: any, value: any): {};
|
90
93
|
removeAllKeysExcept(inputObj: any, keysArray: any, level?: number, getAllIfNoneFound?: boolean): any;
|
91
94
|
isBetween(a: any, b: any, c: any): boolean;
|
92
95
|
isBetweenEq(a: any, b: any, c: any): boolean;
|
@@ -102,9 +105,7 @@ declare class PuvoxLibrary {
|
|
102
105
|
when_element_is_loaded(Id_or_class: any, functionname: any): void;
|
103
106
|
SetTitlee(title: any): void;
|
104
107
|
setUrl(urlPath: any, title: any): void;
|
105
|
-
requestUri(url: any): any;
|
106
108
|
ArrayKeyExistss(keyname: any, array: any): boolean;
|
107
|
-
hashtageChangeOnClick(e: any): void;
|
108
109
|
capitalizeFirstLetter(string: any): any;
|
109
110
|
addQueryArg(name: any, value: any, url: any): string;
|
110
111
|
buildQueryString(params: any): any;
|
@@ -117,6 +118,7 @@ declare class PuvoxLibrary {
|
|
117
118
|
argvIsSet(which: any): boolean;
|
118
119
|
parseQuery(queryString: any): {};
|
119
120
|
invertDictionary(obj: any): {};
|
121
|
+
arrayInvertToDictionary(arr: any): {};
|
120
122
|
isElementInViewport(el: any): boolean;
|
121
123
|
MakeIframeFullHeight(iframeElement: any, cycling: any, overwrite_margin: any): void;
|
122
124
|
getYtIdFromURL(URLL: any): any;
|
@@ -296,7 +298,6 @@ declare class PuvoxLibrary {
|
|
296
298
|
removeParam: (name: any) => string;
|
297
299
|
};
|
298
300
|
parsePOST(request: any, callback: any): void;
|
299
|
-
ChangeSocialShareUrls(elemnt: any, newurl: any, title: any): void;
|
300
301
|
ReplaceParameterInQuery(url: any, param_name: any, param_new_val: any): any;
|
301
302
|
refferer_is_same_domain(): boolean;
|
302
303
|
DoPrevent(e: any): void;
|
@@ -485,7 +486,7 @@ declare class PuvoxLibrary {
|
|
485
486
|
stringsToArray(str: any, splitBy?: string, splitEachLine?: string, toLowerCase?: boolean): any[];
|
486
487
|
isJsonEncodedObject(object: any): boolean;
|
487
488
|
sanitizeJsonString(string: any): any;
|
488
|
-
encode_html_entities(content: any):
|
489
|
+
encode_html_entities(content: any): string;
|
489
490
|
precisionFromString(string: any): any;
|
490
491
|
numberToString(x: any): any;
|
491
492
|
isBrowser: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"library_standard.d.ts","sourceRoot":"","sources":["library_standard.js"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;AAEF;IAGC,0BAEC;IAJD,eAAgB;IAQhB,uDAEC;IACD,4DAGC;IACD,4DAGC;IACD,6CAIC;IACD,8CAIC;
|
1
|
+
{"version":3,"file":"library_standard.d.ts","sourceRoot":"","sources":["library_standard.js"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;EAeE;AAEF;IAGC,0BAEC;IAJD,eA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ES;IAGT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuMS;IAaT;;;;;;;;;;;;;;;;;;;;MA+GS;IAET,8CAIC;IAIE,mBAMF;IAcD;;;MAAkB;IACf,oBAAkE;IAClE,4BAAuD;IACvD,wBAA6C;IAC7C,qBAAuB;IACvB,sBAAgD;IAChD,iCAA0C;IAI1C,0BAEC;IACD,8BAKC;IACD,8BAKC;IACD,sCASC;IACD,sCAUC;IACD,gEAQC;IACD,4EAUF;IACE,yFAgBF;IACE,oCASC;IACD,2BAA+E;IAC/E,kCAeC;IACD,uBAGC;IACD,8BAeC;IAEJ,uCAA0B;IAGvB,0BAA0D;IAG1D,8BAA4C;IAC5C,8BAA4I;IAC5I,+BAAuF;IAC1F,0BAA6F;IAC7F,sDAA8G;IAC9G,wBAA4G;IAC5G,0BAAqH;IAUrH,uCAaC;IACD,wEAKC;IACD,4CAAgE;IAChE,yBAUC;IACD,2BAOC;IAED,qDAGI;IAEJ,iGASC;IAED,0CAMC;IACD,qCAKC;IAGE,2CAKC;IAEJ,sCAGC;IACD,4BAEC;IAED,mBAAwC;IACxC,oBAA0I;IAC1I,qBAA6F;IAC7F,mBAA0E;IAE1E,gBAA4H;IAC5H,2BAAmB;IAEnB,kBAAgI;IAChI,wBAAmF;IAChF,mBAAgD;IAEnD,kBAAe;IACf,2BAAsB;IACtB,kBAAoD;CAEpD"}
|
package/library_standard.js
CHANGED
@@ -93,9 +93,42 @@ class PuvoxLibrary {
|
|
93
93
|
arrayIntersect(source, comparedTo){
|
94
94
|
return source.filter(x => comparedTo.includes(x));
|
95
95
|
}
|
96
|
-
|
96
|
+
|
97
|
+
// todo fix
|
98
|
+
objects_equal (o1, o2) {
|
99
|
+
if (
|
100
|
+
(!this.isObject(o1) && this.isObject(o2))
|
101
|
+
||
|
102
|
+
(this.isObject(o1) && !this.isObject(o2))
|
103
|
+
) {
|
104
|
+
return Object.is (o1, o2) || o1 === o2;
|
105
|
+
}
|
106
|
+
const objKeys1 = Object.keys(o1);
|
107
|
+
const objKeys2 = Object.keys(o2);
|
108
|
+
if (objKeys1.length !== objKeys2.length) return false;
|
109
|
+
for (var key of objKeys1) {
|
110
|
+
const value1 = o1[key];
|
111
|
+
const value2 = o2[key];
|
112
|
+
const isObjects = this.isObject(value1) && this.isObject(value2);
|
113
|
+
if ((isObjects && !this.objects_equal(value1, value2)) ||
|
114
|
+
(!isObjects && value1 !== value2)
|
115
|
+
) {
|
116
|
+
return false;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
return true;
|
120
|
+
}
|
121
|
+
|
122
|
+
object_keys_diff (old_obj, new_obj) {
|
123
|
+
const keys1 = Object.keys(old_obj);
|
124
|
+
const keys2 = Object.keys(new_obj);
|
125
|
+
const diffKeys = keys1.filter(key => !keys2.includes(key));
|
126
|
+
return diffKeys;
|
127
|
+
}
|
128
|
+
|
129
|
+
objects_diff(old_obj, new_obj, deep = true) {
|
97
130
|
const isObject = o => typeof o ==='object';
|
98
|
-
const diff = (o1, o2) => {
|
131
|
+
const diff = (o1, o2, deep) => {
|
99
132
|
const result = {};
|
100
133
|
// if they are arrays
|
101
134
|
if (this.isArray(o1) && this.isArray(o2)){
|
@@ -113,33 +146,32 @@ class PuvoxLibrary {
|
|
113
146
|
else if (Object.is(o1, o2)) {
|
114
147
|
return undefined;
|
115
148
|
}
|
149
|
+
// if scalars
|
150
|
+
else if (!isObject(o1) && !isObject(o2)) {
|
151
|
+
return Object.is (o1, o2) || o1 === o2 ? o2 : undefined;
|
152
|
+
}
|
116
153
|
// else both objects, but different
|
117
154
|
else {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
155
|
+
if (deep) {
|
156
|
+
for (const key in o2) {
|
157
|
+
const value = diff(o1[key], o2[key], deep);
|
158
|
+
if (value) {
|
159
|
+
result[key] = value;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
} else {
|
163
|
+
for (const key in o2) {
|
164
|
+
if (o1[key] !== o2[key]) {
|
165
|
+
result[key] = o2[key];
|
128
166
|
}
|
129
|
-
} else if (this.isArray(o1[key]) && this.isArray(o2[key])) {
|
130
|
-
result[key] = diff(o1[key],o2[key]);
|
131
|
-
} else if (o1[key] !== o2[key]) {
|
132
|
-
result[key] = o2[key];
|
133
|
-
} else {
|
134
|
-
// do nothing
|
135
167
|
}
|
136
168
|
}
|
137
169
|
return result;
|
138
170
|
}
|
139
171
|
};
|
140
172
|
return [
|
141
|
-
diff(old_obj, new_obj),
|
142
|
-
diff(new_obj, old_obj),
|
173
|
+
diff(old_obj, new_obj, deep),
|
174
|
+
diff(new_obj, old_obj, deep),
|
143
175
|
];
|
144
176
|
}
|
145
177
|
|
@@ -479,6 +511,15 @@ class PuvoxLibrary {
|
|
479
511
|
filter(([key, val]) => callback(val, key)));
|
480
512
|
}
|
481
513
|
|
514
|
+
filter_object_by(obj, key, value) {
|
515
|
+
const newObj = {};
|
516
|
+
for (const [k, v] of Object.entries(obj)) {
|
517
|
+
if (v[key] === value) {
|
518
|
+
newObj[k] = v;
|
519
|
+
}
|
520
|
+
}
|
521
|
+
return newObj;
|
522
|
+
}
|
482
523
|
|
483
524
|
// filterReduceToKeys
|
484
525
|
removeAllKeysExcept(inputObj, keysArray, level = 1, getAllIfNoneFound = true) {
|
@@ -618,44 +659,19 @@ class PuvoxLibrary {
|
|
618
659
|
window.history.pushState( ( title ? {"pageTitle":title} : ""),"", urlPath); //{"html":...,"pageTitle":....}
|
619
660
|
}
|
620
661
|
|
621
|
-
requestUri(url){
|
622
|
-
var url = url || location.href;
|
623
|
-
return url.replace(origin,'');
|
624
|
-
}
|
625
662
|
// check if key exists in array
|
626
663
|
ArrayKeyExistss(keyname,array) {
|
627
664
|
return typeof array[keyname] !== 'undefined';
|
628
665
|
}
|
629
666
|
|
630
|
-
hashtageChangeOnClick(e) {
|
631
|
-
function MyCallbackTemp (e)
|
632
|
-
{
|
633
|
-
var e = window.e || e; var t=e.target;
|
634
|
-
if (t.tagName !== 'A') return;
|
635
|
-
else{
|
636
|
-
var link=t.href;
|
637
|
-
if( link.indexOf('#') >-1) { //found hashtag
|
638
|
-
var hashtag= link.split('#')[1]; //var match = url.match(/#.*[?&]locale=([^&]+)(&|$)/); return(match ? match[1] : "");(^|\s)(#[a-z\d-]+)
|
639
|
-
var sanitized_link= link.replace( location.href.split('#')[0] ,"");
|
640
|
-
if(link.indexOf(location.href) >-1 || sanitized_link.charAt(0)=='#') { //if conains current link, or starts with #
|
641
|
-
location.hash=hashtag;
|
642
|
-
}
|
643
|
-
}
|
644
|
-
}
|
645
|
-
}
|
646
|
-
|
647
|
-
if (document.addEventListener) document.addEventListener('click', MyCallbackTemp, false);
|
648
|
-
else document.attachEvent('onclick', MyCallbackTemp);
|
649
|
-
}
|
650
|
-
|
651
667
|
capitalizeFirstLetter(string) {
|
652
668
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
653
669
|
}
|
654
670
|
|
655
|
-
addQueryArg(name,value, url)
|
671
|
+
addQueryArg(name, value, url)
|
656
672
|
{
|
657
673
|
var url = url || location.href;
|
658
|
-
return url + (url.indexOf("?")<0 ? "?":"&") +
|
674
|
+
return url + (url.indexOf("?")<0 ? "?":"&") + encodeURIComponent(name) + "="+encodeURIComponent(value);
|
659
675
|
}
|
660
676
|
buildQueryString(params){
|
661
677
|
if (!params) return '';
|
@@ -755,6 +771,14 @@ class PuvoxLibrary {
|
|
755
771
|
return newObj;
|
756
772
|
}
|
757
773
|
|
774
|
+
arrayInvertToDictionary(arr){
|
775
|
+
const newObj = {};
|
776
|
+
arr.forEach((value, key) => {
|
777
|
+
newObj[value] = 1;
|
778
|
+
});
|
779
|
+
return newObj;
|
780
|
+
}
|
781
|
+
|
758
782
|
isElementInViewport (el) {
|
759
783
|
// Special bonus for those using jQuery
|
760
784
|
if (typeof jQuery === "function" && el instanceof jQuery) {
|
@@ -2209,33 +2233,6 @@ class PuvoxLibrary {
|
|
2209
2233
|
}
|
2210
2234
|
|
2211
2235
|
|
2212
|
-
|
2213
|
-
// ===== in special occasions, i need to change share urls =======
|
2214
|
-
ChangeSocialShareUrls(elemnt, newurl, title){
|
2215
|
-
ShareUrlForCurrentSession= newurl;
|
2216
|
-
TitleForCurrentSession = title || false;
|
2217
|
-
$(elemnt).each(function(e, elemnt ){
|
2218
|
-
var el = $(this);
|
2219
|
-
var current_share_url = el.attr("href");
|
2220
|
-
var new_url = encodeURIComponent(ShareUrlForCurrentSession);
|
2221
|
-
|
2222
|
-
var CurrentUrlReplaced = current_share_url;
|
2223
|
-
var queryParams = GetQueryParams(current_share_url);
|
2224
|
-
|
2225
|
-
CurrentUrlReplaced = ReplaceParameterInQuery(CurrentUrlReplaced, 'u', new_url);
|
2226
|
-
CurrentUrlReplaced = ReplaceParameterInQuery(CurrentUrlReplaced, 'url', new_url);
|
2227
|
-
|
2228
|
-
if(title){
|
2229
|
-
var new_title = encodeURIComponent(TitleForCurrentSession);
|
2230
|
-
CurrentUrlReplaced = ReplaceParameterInQuery(CurrentUrlReplaced, 'text', new_title);
|
2231
|
-
CurrentUrlReplaced = ReplaceParameterInQuery(CurrentUrlReplaced, 'title', new_title);
|
2232
|
-
}
|
2233
|
-
|
2234
|
-
el.attr("href", CurrentUrlReplaced);
|
2235
|
-
});
|
2236
|
-
}
|
2237
|
-
|
2238
|
-
|
2239
2236
|
//replace parameter in query string
|
2240
2237
|
ReplaceParameterInQuery(url, param_name, param_new_val){
|
2241
2238
|
var queryParams = GetQueryParams(url);
|
@@ -3551,7 +3548,7 @@ class PuvoxLibrary {
|
|
3551
3548
|
}
|
3552
3549
|
parseIfJson(val) {
|
3553
3550
|
try {
|
3554
|
-
if (this.
|
3551
|
+
if (this.isJsonEncodedObject (val)) {
|
3555
3552
|
return JSON.parse(val);
|
3556
3553
|
}
|
3557
3554
|
} catch (e) { }
|
@@ -3590,9 +3587,10 @@ class PuvoxLibrary {
|
|
3590
3587
|
|
3591
3588
|
//htmlentities
|
3592
3589
|
encode_html_entities (content) {
|
3593
|
-
|
3590
|
+
const newStr = content.replace(/[\u00A0-\u9999<>\&]/g, function(i) {
|
3594
3591
|
return '&#'+i.charCodeAt(0)+';';
|
3595
3592
|
});
|
3593
|
+
return String(newStr).replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
3596
3594
|
}
|
3597
3595
|
// number
|
3598
3596
|
precisionFromString (string) {
|