puvox-library 1.0.27 → 1.0.29
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.js +40 -2
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -435,6 +435,21 @@ const puvox_library =
|
|
435
435
|
return result;
|
436
436
|
},
|
437
437
|
|
438
|
+
renameKey (obj, keyFrom, keyTo) {
|
439
|
+
for (const key of Object.keys(obj)) {
|
440
|
+
obj[keyTo] = obj[keyFrom];
|
441
|
+
delete obj[keyFrom];
|
442
|
+
}
|
443
|
+
return obj;
|
444
|
+
},
|
445
|
+
renameSubKey (obj, keyFrom, keyTo) {
|
446
|
+
for (const key of Object.keys(obj)) {
|
447
|
+
obj[key][keyTo] = obj[key][keyFrom];
|
448
|
+
delete obj[key][keyFrom];
|
449
|
+
}
|
450
|
+
return obj;
|
451
|
+
},
|
452
|
+
|
438
453
|
hasEmptyChild(obj){
|
439
454
|
let hasEmpty = false;
|
440
455
|
if(this.isObject(obj)) {
|
@@ -665,6 +680,29 @@ const puvox_library =
|
|
665
680
|
);
|
666
681
|
},
|
667
682
|
|
683
|
+
MakeIframeFullHeight(iframeElement, cycling, overwrite_margin){
|
684
|
+
cycling= cycling || false;
|
685
|
+
overwrite_margin= overwrite_margin || false;
|
686
|
+
iframeElement.style.width = "100%";
|
687
|
+
var ifrD = iframeElement.contentDocument || iframeElement.contentWindow.document;
|
688
|
+
var mHeight = parseInt( window.getComputedStyle( ifrD.documentElement).height ); // Math.max( ifrD.body.scrollHeight, .. offsetHeight, ....clientHeight,
|
689
|
+
var margins = ifrD.body.style.margin + ifrD.body.style.padding + ifrD.documentElement.style.margin + ifrD.documentElement.style.padding;
|
690
|
+
if(margins=="") { margins=0; if(overwrite_margin) { ifrD.body.style.margin="0px"; } }
|
691
|
+
(function(){
|
692
|
+
var interval = setInterval(function(){
|
693
|
+
if(ifrD.readyState == 'complete' ){
|
694
|
+
setTimeout( function(){
|
695
|
+
if(!cycling) { setTimeout( function(){ clearInterval(interval);}, 500); }
|
696
|
+
iframeElement.style.height = (parseInt(window.getComputedStyle( ifrD.documentElement).height) + parseInt(margins)+1) +"px";
|
697
|
+
}, 200 );
|
698
|
+
}
|
699
|
+
},200)
|
700
|
+
})();
|
701
|
+
//var funcname= arguments.callee.name;
|
702
|
+
//window.setTimeout( function(){ console.log(funcname); console.log(cycling); window[funcname](iframeElement, cycling); }, 500 );
|
703
|
+
},
|
704
|
+
|
705
|
+
getYtIdFromURL(URLL){let r=URLL.match(/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/); return r[1];},
|
668
706
|
|
669
707
|
//state url change
|
670
708
|
//function processAjaxData(response, urlPath){
|
@@ -2406,7 +2444,7 @@ const puvox_library =
|
|
2406
2444
|
};
|
2407
2445
|
},
|
2408
2446
|
|
2409
|
-
compare(a,
|
2447
|
+
compare(a, operator, b) {
|
2410
2448
|
if(operator === '==') return a == b;
|
2411
2449
|
else if (operator === '===') return a === b;
|
2412
2450
|
else if (operator === '!=') return a != b;
|
@@ -2417,7 +2455,7 @@ const puvox_library =
|
|
2417
2455
|
else if (operator === '<=') return a <= b;
|
2418
2456
|
else throw "Unknown operator";
|
2419
2457
|
},
|
2420
|
-
calculate(a,
|
2458
|
+
calculate(a, operator, b) {
|
2421
2459
|
if(operator === '+') return a + b;
|
2422
2460
|
else if (operator === '-') return a - b;
|
2423
2461
|
else if (operator === '*') return a * b;
|