Browse files

a very basic example setup for sites (basic-setup.html)

  • Loading branch information...
1 parent fb33581 commit 6e494bf056c6d5fce4dd02c5edf79dd6808cab03 @tipiirai tipiirai committed Apr 26, 2011
Showing with 108 additions and 49 deletions.
  1. +58 −0
  2. +2 −2 src/load.js
  3. +48 −0 tests/manual-tests/basic-setup.html
  4. +0 −47 tests/manual-tests/load.html
@@ -0,0 +1,58 @@
+n.n.n / 2011-04-26
+ * qUnit based test framework
+ * Merge branch 'master' into dev
+ * removed jQuery dependency on tests
+ * corrected paths in random.html
+ * moved manual test files into the tests/manual-tests/ folder
+ * Added QUnit unittests
+ * Some overall robustness. More code commenting
+ * switch of version number
+ * Issue 96. Fixed a small looping mistake
+ * head.ready('dom') changed to head.ready(document). better sanity check for head.ready() arguments
+ * Issue 94: fixed window.addEventListener 'onload' --> 'load'
+ * In IE the version number is checked from document.documentMode and not from UserAgent string
+ * added a specific IE version to the CSS classes
+ * Issue 91. Avoid of duplicate preload with text/cache JavaScript
+ * Issue 88. IE no longer throw an error together with frames on different domains
+ * Polishing the version
+ * A forgotten staement
+ * Version 0.9
+ * Looks like v0.9
+ * @font-face detection & class naming identical to modernizr.
+ * Exposed head.ready("dom") to public API. Fixed issue 82.
+ * domloaded css-property added for CSS developers
+ * head(fn) and head.ready(fn) now also wait for DOM to be ready
+ * DOM ready implementation to be integrated into load.js
+ * Allow empty string values on configuration
+ * minified versions
+ * Issue 69. head(function()) fix for Chrome.
+ * new combined & minified versions
+ * Issue 62: In head.ready(callback) the callback will be called immediately if all scripts are loaded.
+ * Updated combined & minified files
+ * Final twists for 0.8
+ * Issue 51: Cannot load a same URL twice - however the callback is executed if given in head.js() call.
+ * Update of the combined and minified versions
+ * Fixed CSS3 tests for Opera 11. Thanks Paul Irish. Made loader pass JS Lint.
+ * Initial version of async=false loading for Firefox and Opera
+ * Detect DOMContentLoaded in FF3.5 and before
+ * minified versions for 0.5
+ * v0.5. Bugs gathered & fixed for production use. Shifting my emotion on 1.0.
+ * Issue 45. Avoid possible null pointer exception
+ * Fixed issue 31: Proper script preloading for Firefox 3.6. Also fix for Issue 37. Script tags are no longer removed because they caused DOM errors in IE and Opera.
+ * Issue 35: fixed to watch "no-js" substring instead of "no-script" as documented.
+ * Small bug fix for CSS routing.
+ * Subpath support for CSS router: /foo/bar/ adds "foo-section" and "foo-bar-section" classes to HTML element
+ * typo in comment: s/dealy/delay/
+ * Tested with: firefox, chrome, safari, opera and IE 6-8.
+ * Polishing. Trunk should be rather good now.
+ * Calling head.ready("my-script", function) will execute the function and exit if "my-script" is already loaded.
+ * Issue 26: removed global head_conf variable if it's not explicitly defined
+ * removed head.error(): this is unfortunate but there is no way to know in IE whether a request succeeded or not
+ * Made head.error() work on Opera.
+ * head.error() function for detecting loading errors.
+ * Makefile for building minified versions. Uses uglifyjs. Directory structure changes.
+ * Cleaned up the test directory in favor to having tests on the public website. A more solid test framework (qunit or similar) will be introduced on this repository.
+ * Issue 22: CSS detection now works correctly.
@@ -297,10 +297,10 @@
- doc.body.appendChild(s);
+ // use body if available. more safe in IE
+ (doc.body || head).appendChild(s);
The much desired DOM ready check
Thanks to jQuery and
@@ -0,0 +1,48 @@
+<!doctype html>
+ <script src="../../src/load.js"></script>
+ <script>
+ // load the scripts you need
+ head.js(
+ "",
+ ""
+ );
+ </script>
+ <script>
+ // enclose scripting inside head.ready(). all loaded + DOM is ready
+ head.ready(function() {
+$("#test"), _gat);
+ });
+ </script>
+ <div id="lipsum">
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer luctus lorem ut tellus tincidunt dignissim. Fusce volutpat consequat turpis at dapibus. Aliquam justo erat, sollicitudin sit amet accumsan et, vulputate quis purus. Vestibulum nisl lorem, fermentum at scelerisque sed, luctus non nunc. Pellentesque rhoncus gravida tortor eget commodo. Nunc dui turpis, elementum sit amet consectetur dictum, pharetra at nisi. Fusce bibendum luctus ligula, vel aliquet enim viverra ac. Sed tristique, libero id semper euismod, odio magna molestie massa, non pulvinar erat nibh congue sapien. Nullam laoreet sollicitudin tortor sed viverra. Sed et nisi ac nibh vestibulum fermentum ac in tellus. Proin sed velit felis. Donec convallis volutpat mi. Donec massa ipsum, scelerisque a elementum eu, cursus non lorem. Nulla faucibus turpis a orci convallis vitae consequat libero ullamcorper. Sed risus purus, vehicula eget ultrices sit amet, adipiscing sed nibh. Proin vitae arcu risus. Donec ipsum sem, hendrerit sit amet rutrum non, pretium ut lectus. Vivamus ut nunc massa. Pellentesque sit amet lectus elit.
+ </p>
+ <p>
+ Nullam scelerisque urna neque, vel convallis risus. Integer pharetra justo ut mi congue scelerisque. Ut tempor ligula ut velit tincidunt sit amet hendrerit ipsum placerat. Nullam eu libero est. Maecenas odio dolor, vulputate id mattis sodales, varius a nisi. Nam in leo a ante sodales fermentum at eu quam. Maecenas non magna nisl, ut facilisis lorem. Pellentesque vel massa id leo venenatis blandit. Aenean quam mauris, convallis vel aliquam in, imperdiet sagittis libero. Nullam bibendum, eros id iaculis sagittis, lacus enim tincidunt diam, ut varius leo nisl non velit. Vivamus hendrerit, arcu eu auctor eleifend, massa eros congue tortor, id vulputate tellus augue a lacus. Nullam nec ante eu elit pulvinar tincidunt. Sed luctus mollis posuere. Curabitur justo est, dapibus in dignissim et, ullamcorper in tellus.
+ </p>
+ <p>
+ Aliquam convallis imperdiet placerat. Sed pharetra sollicitudin ornare. Proin hendrerit sapien vitae risus hendrerit porta. Curabitur congue felis id est pellentesque elementum pretium erat eleifend. Aliquam erat volutpat. Praesent auctor, risus ac interdum fringilla, nulla lorem auctor felis, nec luctus risus nulla vitae risus. Integer placerat, nulla a malesuada tincidunt, mi purus interdum dolor, eget scelerisque augue elit a justo. In eu ultrices nibh. Nullam lacinia, sem a pellentesque molestie, libero odio dignissim libero, lobortis tempor ante elit vitae ipsum. Phasellus hendrerit, mauris vel venenatis vestibulum, ante urna commodo massa, vitae pretium odio est dictum mi. Pellentesque euismod augue a eros molestie in scelerisque magna ultrices. Curabitur blandit rutrum quam, eu dictum massa suscipit quis. Proin mauris nibh, volutpat quis consectetur vel, blandit et ligula.
+ </p>
+ <p>
+ Praesent mollis velit sed massa pretium ornare. Nunc et lorem ut leo ultrices elementum. Duis ut urna augue, sit amet placerat mauris. Praesent vel tortor enim. Vestibulum iaculis ipsum sed lorem varius ut rutrum odio lacinia. Phasellus ullamcorper arcu in tellus hendrerit congue. Proin quis sem et massa ultrices mattis. Vivamus dignissim sodales scelerisque. Donec sem velit, molestie a tincidunt eget, tempor at ipsum. Curabitur ac libero sit amet lacus faucibus molestie et quis eros. Nullam placerat, turpis in cursus rutrum, dui lectus feugiat est, ut tincidunt tortor diam non mi. Donec consectetur nulla consectetur quam vulputate a mollis purus sagittis. Mauris sit amet felis felis. Morbi porttitor purus nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam sed sagittis tortor.
+ </p>
+ <p>
+ Nam ullamcorper porttitor erat eu tincidunt. Donec ac justo neque, et auctor nisl. Morbi ac felis vitae quam suscipit posuere. Morbi venenatis augue vitae neque commodo vitae interdum metus blandit. Vivamus vehicula semper elit in ultricies. Praesent auctor rutrum pretium. Suspendisse et augue et justo egestas gravida. Duis purus justo, rutrum eu rutrum non, dapibus sed justo. Fusce tempor adipiscing justo, vel pharetra libero dapibus a. Integer placerat, est vel pulvinar viverra, justo urna sodales lectus, adipiscing adipiscing arcu ante dapibus augue. Quisque et dui nulla, et congue dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In sed est non erat auctor cursus a sed nunc. Vestibulum sem lacus, cursus sit amet suscipit ut, malesuada sed elit. Vivamus sodales neque libero, sit amet pellentesque mi. Donec quam quam, aliquet et consequat sed, eleifend eu tellus. Duis dignissim scelerisque sapien, non pellentesque neque porttitor non.
+ </p>
+ </div>
+ <div id="test"></div>
@@ -1,47 +0,0 @@
-<!doctype html>
- <!--[if IE]><script src="ie-console.js"></script><![endif]-->
- <script src="../../src/load.js"></script>
- <script>
- head.js(
- {a: ""},
- {b: ""},
- {c: ""}, function() {
-"a, b & c");
- });
- head.ready("a", function() {
-"a: " + !!Raphael);
- });
- head.ready("b", function() {
-"b: " + !!jQuery);
- });
- head.ready("c", function() {
-"c: " + !!JSLINT);
- });
- head.ready(function() {
- });
- head.js("", function() {
- $(function() {
-"another load + dom is ready");
- });
- });
- </script>
- <div id="info"></div>

0 comments on commit 6e494bf

Please sign in to comment.