forked from WilcoFiers/UseYUI-for-RequireJS
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,50 +1,34 @@ | |||
<!DOCTYPE html> | <!DOCTYPE html> | ||
<html> | <html> | ||
<body> | <body> | ||
<div id="someNode"></div> | <script src="http://yuim.in/"></script> | ||
<script src="require-0.27.1.js"></script> | |||
<script> | |||
|
|||
console.log('there are 5 tests'); | |||
require(['YUI!dd,anim', 'YUI!cookie'], function (A, B, C) { | |||
var a = new A.Anim(); | |||
console.log("Test 1: " + (typeof A.Anim !== 'undefined' ? 'passed' : 'failed' )); | |||
console.log("Test 2: " + (typeof A.Cookie === 'undefined' ? 'passed' : 'failed' )); | |||
// console.log(A); | |||
console.log("Test 3: " + (typeof B.Cookie !== 'undefined' ? 'passed' : 'failed' )); | |||
console.log(C); //undefined | |||
} | |||
); | |||
|
|
||
<script src="require-0.27.1.js"></script> | require(['YUI!yql'], function (Y) { | ||
<script> | console.log("Test 4: " + (typeof Y.YQL !== 'undefined' ? 'passed' : 'failed' )); | ||
if (typeof console == 'undefined') { | }); | ||
console = { | |||
log : function (d) { | |||
document.getElementById('someNode').innerHTML += d; | |||
} | |||
}; | |||
} | |||
|
|
||
console.log('there are 5 tests'); | require({YUI : { src : 'yui-min-341.js'}}, ['YUI!cookie'], function (Y) { | ||
require({ | console.log("Test 5: " + (typeof Y.Cookie !== 'undefined' ? 'passed' : 'failed' )); | ||
YUI : { | console.log("Test 6: " + (typeof Y.YQL === 'undefined' ? 'passed' : 'failed' )); | ||
src : 'yui-min.js', | console.log(Y); | ||
timeout : 1000 | }); | ||
} |
|
||
}, | require(['YUI!foobar'], function (Y) { | ||
['UseYUI!dd,anim', | //This will throw 'NOT loaded' warnings in the console. | ||
'UseYUI!cookie'], function (Y, X) { | }); | ||
var a = new Y.Anim(); | </script> | ||
console.log((typeof Y.Anim !== 'undefined' ? 'passed' : 'failed' ) + | |||
' test 1'); | |||
console.log((typeof Y.Cookie === 'undefined' ? 'passed' : 'failed' ) + | |||
' test 2'); | |||
console.log((typeof X.Cookie !== 'undefined' ? 'passed' : 'failed' ) + | |||
' test 3'); | |||
}); | |||
|
|||
require( | |||
['UseYUI!cookie'], function (Y) | |||
{ | |||
console.log((typeof Y.Cookie !== 'undefined' ? 'passed' : 'failed' ) + | |||
' test 4'); | |||
}); | |||
|
|||
require( | |||
{ YUI : 'yui-min.js'}, | |||
['UseYUI!cookie'], function (Y) | |||
{ | |||
console.log((typeof Y.Cookie !== 'undefined' ? 'passed' : 'failed' ) + | |||
' test 5'); | |||
}); | |||
</script> | |||
</body> | </body> | ||
</html> | </html> |
Oops, something went wrong.