[Pkg-javascript-commits] [less.js] 12/26: Run less.js after page load to see if it fixes IE page load issue
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:25:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v2.1.0
in repository less.js.
commit de06e26c038e6c6b705d5fbe171259d45653f971
Author: Luke Page <luke.a.page at gmail.com>
Date: Sun Nov 16 11:30:42 2014 +0000
Run less.js after page load to see if it fixes IE page load issue
---
test/browser/test-runner-template.tmpl | 43 ++++++++++++++++++++++++----------
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/test/browser/test-runner-template.tmpl b/test/browser/test-runner-template.tmpl
index 1047c3d..44e2e21 100644
--- a/test/browser/test-runner-template.tmpl
+++ b/test/browser/test-runner-template.tmpl
@@ -9,6 +9,18 @@
<script src="<%= script %>"></script>
<% }); }; %>
+ <!-- generate script tags for tests -->
+ <% var toArray = function(scripts) {
+ %>[<%
+ scripts.forEach(function(scriptUrl, index){
+ %>"<%= scriptUrl %>"<%
+ if (index !== scripts.length -1) {
+ %>,<%
+ }
+ });
+ %>]<%
+ }; %>
+
<!-- for each test, generate CSS/LESS link tags -->
<% scripts.src.forEach(function(fullLessName) {
var pathParts = fullLessName.split('/');
@@ -25,20 +37,27 @@
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
- <!-- inital grunt-contrib-jasmine scripts -->
- <% generateScriptTags([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)); %>
-
- <!-- Helpers - The less options -->
- <% generateScriptTags(scripts.helpers); %>
-
- <!-- Vendor - less.js and common code -->
- <% generateScriptTags(scripts.vendor); %>
+ <script>
+ setTimeout(function() {
+ var jasmine = <% toArray([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)) %>,
+ helpers = <% toArray(scripts.helpers) %>,
+ vendor = <% toArray(scripts.vendor) %>,
+ specs = <% toArray(scripts.specs) %>,
+ reporters = <% toArray([].concat(scripts.reporters)) %>,
+ allScripts = jasmine.concat(helpers).concat(vendor).concat(specs).concat(reporters);
- <!-- Spec -->
- <% generateScriptTags(scripts.specs); %>
+ for(var i = 0; i < allScripts.length; i++) {
+ var script = document.createElement("script");
+ script.src = allScripts[i];
+ script.async = false;
+ document.body.appendChild(script);
+ }
+ script.onload = function() {
+ window.onload();
+ };
- <!-- final grunt-contrib-jasmine scripts -->
- <% generateScriptTags([].concat(scripts.reporters)); %>
+ },1000);
+ </script>
</head>
<body>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git
More information about the Pkg-javascript-commits
mailing list