mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
made scope test optional...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
cdbdf130de
commit
4f3476ec1a
15
Viewer/e.js
15
Viewer/e.js
@ -9,13 +9,14 @@
|
|||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
// Global scope pollution test...
|
// Global scope pollution test...
|
||||||
global.__global = {...global}
|
if(process.env.IMAGEGRID_DEBUG){
|
||||||
global.scopeDiff = function(cur=global, base=__global){
|
global.__global = {...global}
|
||||||
return Object.keys(cur)
|
global.scopeDiff = function(cur=global, base=__global){
|
||||||
.filter(function(k){ return base[k] !== cur[k] })
|
return Object.keys(cur)
|
||||||
.reduce(function(res, k){
|
.filter(function(k){ return base[k] !== cur[k] })
|
||||||
res[k] = cur[k]
|
.reduce(function(res, k){
|
||||||
return res }, {})}
|
res[k] = cur[k]
|
||||||
|
return res }, {})} }
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|||||||
15
Viewer/ig.js
15
Viewer/ig.js
@ -9,13 +9,14 @@
|
|||||||
//var DEBUG = DEBUG != null ? DEBUG : true
|
//var DEBUG = DEBUG != null ? DEBUG : true
|
||||||
|
|
||||||
// Global scope pollution test...
|
// Global scope pollution test...
|
||||||
global.__global = global.__global || {...global}
|
if(process.env.IMAGEGRID_DEBUG){
|
||||||
global.scopeDiff = function(cur=global, base=__global){
|
global.__global = global.__global || {...global}
|
||||||
return Object.keys(cur)
|
global.scopeDiff = function(cur=global, base=__global){
|
||||||
.filter(function(k){ return base[k] !== cur[k] })
|
return Object.keys(cur)
|
||||||
.reduce(function(res, k){
|
.filter(function(k){ return base[k] !== cur[k] })
|
||||||
res[k] = cur[k]
|
.reduce(function(res, k){
|
||||||
return res }, {})}
|
res[k] = cur[k]
|
||||||
|
return res }, {})} }
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
|
|
||||||
<!-- Global scope pollution test -->
|
<!-- Global scope pollution test -->
|
||||||
<script>
|
<!--script>
|
||||||
var __window = {...window}
|
var __window = {...window}
|
||||||
function scopeDiff(cur=window, base=__window){
|
function scopeDiff(cur=window, base=__window){
|
||||||
return Object.keys(cur)
|
return Object.keys(cur)
|
||||||
@ -40,7 +40,7 @@ function scopeDiff(cur=window, base=__window){
|
|||||||
.reduce(function(res, k){
|
.reduce(function(res, k){
|
||||||
res[k] = cur[k]
|
res[k] = cur[k]
|
||||||
return res }, {})}
|
return res }, {})}
|
||||||
</script>
|
</script-->
|
||||||
|
|
||||||
<!-- DevTools fail-safe for electron/nw... -->
|
<!-- DevTools fail-safe for electron/nw... -->
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user