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
1 parent
aeffede
commit a1b8d9e
Showing
73 changed files
with
7,047 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
demos/FeatureTests/Advanced/1_NamedDeferredsNoGlobals.html
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html> | ||
<head> | ||
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | ||
<script src="../consoleTest.js" type="text/javascript"></script> | ||
|
||
<script src="../../../jquery.defer.js" type="text/javascript"></script> | ||
<script src="../resources/myScriptDefs.js" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
(function() { | ||
$.defer( "../resources/folder1/c.js", { | ||
myVal: "sendC", | ||
readyName: "c" | ||
}) | ||
.done( log ); | ||
|
||
$.defer.a({ | ||
myVal: "sendA", | ||
delayDomReady: true | ||
}) | ||
.done( log ); | ||
}()); | ||
</script> | ||
</head> | ||
<body> | ||
|
||
<b>Results:</b> <span id="results"></span> | ||
|
||
<script type="text/javascript"> | ||
(function() { | ||
$.ready.a | ||
.done( function( result ){ | ||
log( "a: " + result ); | ||
}); | ||
|
||
$.ready.c | ||
.done( function( result ){ | ||
log( "c: " + result ); | ||
}); | ||
|
||
$.ready.e | ||
.done( function( result ){ | ||
log( "e: " + result ); | ||
}); | ||
|
||
$.when( | ||
$.ready.a, | ||
$.ready.c, | ||
$.ready.e, | ||
$.ready | ||
).done( function( result0, result1, result2 ){ | ||
log( "a, c, e and domReady: " + result0 + ", " + result1 + ", " + result2 ); | ||
}); | ||
}()); | ||
|
||
</script> | ||
</body> | ||
</html> | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html> | ||
<head> | ||
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | ||
<script src="../consoleTest.js" type="text/javascript"></script> | ||
|
||
<script src="../../../jquery.defer.js" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
$.deferSettings.delayDomReady = true; | ||
|
||
$.deferDef({ | ||
a: { | ||
url: "../resources/folder1/addDependencies.js", | ||
depends: "../resources/folder2/c.js" | ||
}, | ||
e: "../resources/folder2/e.js", | ||
c: "../resources/folder2/c.js", | ||
f: "../resources/f.js" | ||
}); | ||
|
||
$.defer( "../resources/f.js", { | ||
myVal: "two", | ||
noCache:true | ||
}) | ||
.done( log ); | ||
|
||
$.defer.f({ | ||
myVal: "three", | ||
noCache:true | ||
}) | ||
.done( log ); | ||
|
||
$.defer.a({ | ||
myVal: "one", | ||
noCache:true | ||
}).done( | ||
log, | ||
function( result ) { | ||
log( $.defer.c.result ); | ||
log( $.defer.e.result || "e not requested" ); | ||
log( $.defer.f.result ); | ||
} | ||
); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
|
||
<b>Results:</b> <span id="results"></span> | ||
|
||
</body> | ||
</html> | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html> | ||
<head> | ||
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | ||
<script src="../consoleTest.js" type="text/javascript"></script> | ||
|
||
<script src="../../../jquery.defer.js" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
$.deferSettings.min = true; | ||
$.deferSettings.delayDomReady = true; | ||
|
||
$.deferDef({ | ||
a: { | ||
url: "../resources/folder1/a.js", | ||
depends: "e" | ||
}, | ||
e: "../resources/folder2/e.js" | ||
}); | ||
|
||
$.deferDef({ | ||
a2: { | ||
url: "../resources/folder1/a.js", | ||
minUrl: "../resources/folder1/a.min.js", | ||
depends: ["e", "../resources/folder2/c.js"] | ||
}, | ||
e: "../resources/folder2/e.js" | ||
}); | ||
|
||
// Get the script def and modify it | ||
// $.defer.a | ||
// $.deferDef( "../resources/folder1/a.js" ) | ||
// .depends.push( "../resources/f.js" ); | ||
|
||
$.when( | ||
$.defer.a({ myVal: "value" }).done( log ), | ||
$.ready | ||
) | ||
.done( log ); | ||
</script> | ||
</head> | ||
<body> | ||
|
||
<b>Results:</b> <span id="results"></span> | ||
|
||
</body> | ||
</html> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html> | ||
<head> | ||
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | ||
<script src="../consoleTest.js" type="text/javascript"></script> | ||
|
||
<script src="../../../jquery.defer.js" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
$.deferSettings.delayDomReady = true; | ||
|
||
$.deferDef({ | ||
d: { | ||
url: "../resources/folder2/d.js" | ||
} | ||
}); | ||
|
||
$.defer.d({ | ||
myVal: "first value" | ||
}).done( function( result ) { | ||
log( "multiple false. First Call" ); | ||
log( result ); | ||
}); | ||
|
||
// multiple is false (default value) | ||
// Script does not re-execute. Previous value returned | ||
$.defer.d({ | ||
myVal: "second value" | ||
}).done( function( result ) { | ||
log( "multiple false. Second Call" ); | ||
log( result ); | ||
}); | ||
|
||
// Redefine script with multiple set to true | ||
$.deferDef({ | ||
d: { | ||
url: "../resources/folder2/d.js", | ||
multiple: true | ||
} | ||
}); | ||
|
||
$.defer.d({ | ||
myVal: "first value" | ||
}).done( function( result ) { | ||
log( "multiple true. First Call" ); | ||
log( result ); | ||
}); | ||
|
||
// Now multiple is true | ||
// Script re-executes, with new parameters and returns new value. | ||
$.defer.d({ | ||
myVal: "second value" | ||
}).done( function( result ) { | ||
log( "multiple true. Second Call" ); | ||
log( result ); | ||
}); | ||
|
||
|
||
|
||
</script> | ||
</head> | ||
<body> | ||
<b>Results:</b> <span id="results"></span> | ||
</body> | ||
</html> | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html> | ||
<head> | ||
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | ||
<script src="../consoleTest.js" type="text/javascript"></script> | ||
|
||
<script src="../../../jquery.defer.js" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
$.deferSettings.delayDomReady = true; | ||
|
||
$.deferDef({ | ||
c: "../resources/folder2/c.js", | ||
d: { | ||
url: "../resources/folder2/d.js", | ||
multiple: true, | ||
depends: "c" | ||
}, | ||
dcf: { | ||
url: "../resources/folder2/compositeDCF.js", | ||
contains: ["d", "c", "../resources/f.js"] | ||
}, | ||
fed: { | ||
url: "../resources/folder2/compositeFED.js", | ||
contains: [ "../resources/f.js", "../resources/folder2/e.js", "d" ] | ||
} | ||
}); | ||
|
||
$.defer.dcf( { | ||
myVal: "valDCF" | ||
}).done( function( components ) { | ||
log( "DCF done" ); | ||
log( components[0] ); | ||
log( components[1] ); | ||
log( components[2] ); | ||
}); | ||
|
||
$.defer( "../resources/folder2/c.js", { | ||
myVal: "valC" | ||
}).done( function( result ) { | ||
log( "C done" ); | ||
log( result ); | ||
}); | ||
|
||
$.defer( "../resources/folder2/d.js", { | ||
myVal: "valD" | ||
}).done( function( result ) { | ||
log( "D done" ); | ||
log( result ); | ||
}); | ||
|
||
$.defer( "../resources/folder2/d.js", { | ||
myVal: "valD2" | ||
}).done( function( result ) { | ||
log( "D done" ); | ||
log( result ); | ||
}); | ||
|
||
$.defer( "../resources/folder2/compositeFED.js", { | ||
myVal: "valFED" | ||
}).done( function( components ) { | ||
log( "FED done" ); | ||
log( components[0] ); | ||
log( components[1] ); | ||
log( components[2] ); | ||
}); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<b>Results:</b> <span id="results"></span> | ||
</body> | ||
</html> | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script> | ||
<!--<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | ||
--> | ||
<script src="../../../jquery.defer.js" type="text/javascript"></script> | ||
<script src="jquery.tmpl.experimental.js" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
$.deferDef({ | ||
richData: "../resources/templateAndData/myRichData.js", | ||
richTmpls: "../resources/templateAndData/richTmpls.js" | ||
}); | ||
|
||
$.defer.richTmpls(); | ||
|
||
$.tmpl( "@outer", "@richData" ).appendTo( "ul" ); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
|
||
<ul></ul> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.