aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-08-25 07:33:34 +0200
committerThomas Lange <code@nerdmind.de>2017-08-25 07:33:34 +0200
commit365eaacdcf9212891c4217c7df9528ecbbc8361e (patch)
treed9d467dce3ec9ba89784612e9447db8c8188fd58
parent4c30f91c94eb739a6a82d49f635a0e2a21d73690 (diff)
downloadbigpipe-365eaacdcf9212891c4217c7df9528ecbbc8361e.tar.gz
bigpipe-365eaacdcf9212891c4217c7df9528ecbbc8361e.tar.xz
bigpipe-365eaacdcf9212891c4217c7df9528ecbbc8361e.zip
Optimization: The outsourced function "globalExecution" is no longer necessary and has been replaced by a simpler variant inside the BigPipe library.
-rwxr-xr-xasync.php5
-rwxr-xr-xindex.php5
-rwxr-xr-xstatic/bigpipe.js4
3 files changed, 2 insertions, 12 deletions
diff --git a/async.php b/async.php
index 453b27f..e82c1cc 100755
--- a/async.php
+++ b/async.php
@@ -51,11 +51,6 @@ require_once 'include/pagelets.php';
.text{color:white;margin-bottom:30px;padding:40px;border-radius:4px;font-weight:600;text-align:center;border:4px solid black;}
.hidden{display:none;}
</style>
- <script>
- var globalExecution = function globalExecution(code) {
- window.execScript ? window.execScript(code) : window.eval.call(window, code);
- };
- </script>
<script src="static/bigpipe.js"></script>
<title>BigPipe Demo</title>
<!-- >>> [Additional code for the async function] -->
diff --git a/index.php b/index.php
index 6ee05cf..48d8570 100755
--- a/index.php
+++ b/index.php
@@ -37,11 +37,6 @@ require_once 'include/pagelets.php';
body{max-width:1200px;margin:0 auto;}
.text{color:white;margin-bottom:30px;padding:40px;border-radius:4px;font-weight:600;text-align:center;border:4px solid black;}
</style>
- <script>
- var globalExecution = function globalExecution(code) {
- window.execScript ? window.execScript(code) : window.eval.call(window, code);
- };
- </script>
<script src="static/bigpipe.js"></script>
<title>BigPipe Demo</title>
</head>
diff --git a/static/bigpipe.js b/static/bigpipe.js
index a27eec9..fa56d21 100755
--- a/static/bigpipe.js
+++ b/static/bigpipe.js
@@ -24,7 +24,7 @@ var BigPipe = (function() {
execute: function(context, phase) {
context.phaseDoneJS[phase].forEach(function(code) {
try {
- globalExecution(code);
+ window.eval.call(window, code);
} catch(e) {
console.error("PhaseDoneJS: " + e);
}
@@ -215,7 +215,7 @@ var BigPipe = (function() {
Pagelet.prototype.executeJSCode = function() {
this.JSCode.forEach(function(code) {
try {
- globalExecution(code);
+ window.eval.call(window, code);
} catch(e) {
console.error(this.ID + ": " + e);
}