Skip to content

Commit

Permalink
Remove css and image transports from jQuery. Deported them as plugins…
Browse files Browse the repository at this point in the history
… in a new directory with separated unit tests.

Signed-off-by: jaubourg <aubourg.julian@gmail.com>
  • Loading branch information
jaubourg committed May 21, 2010
1 parent 1498ebe commit 552849a
Show file tree
Hide file tree
Showing 11 changed files with 407 additions and 356 deletions.
2 changes: 0 additions & 2 deletions Makefile
Expand Up @@ -16,8 +16,6 @@ BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/css.js\
${SRC_DIR}/ajax.js\
${SRC_DIR}/xhr.js\
${SRC_DIR}/transports/css.js\
${SRC_DIR}/transports/image.js\
${SRC_DIR}/transports/jsonp.js\
${SRC_DIR}/transports/script.js\
${SRC_DIR}/transports/xhr.js\
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
@@ -1,6 +1,6 @@
# Basic Rakefile for building jQuery

files = [ "intro", "core", "support", "data", "queue", "event", "selector", "traversing", "attributes", "manipulation", "css", "ajax", "xhr", "transports/css", "transports/image", "transports/jsonp", "transports/script", "transports/xhr", "transports/xdr", "effects", "offset", "dimensions", "outro" ]
files = [ "intro", "core", "support", "data", "queue", "event", "selector", "traversing", "attributes", "manipulation", "css", "ajax", "xhr", "transports/jsonp", "transports/script", "transports/xhr", "transports/xdr", "effects", "offset", "dimensions", "outro" ]

date = `git log -1 | grep Date: | sed 's/[^:]*: *//'`.gsub(/\n/, "")
version = `cat version.txt`.gsub(/\n/, "")
Expand Down
2 changes: 0 additions & 2 deletions build.xml
Expand Up @@ -55,8 +55,6 @@
<fileset file="src/css.js" />
<fileset file="src/ajax.js" />
<fileset file="src/xhr.js" />
<fileset file="src/transports/css.js" />
<fileset file="src/transports/image.js" />
<fileset file="src/transports/jsonp.js" />
<fileset file="src/transports/script.js" />
<fileset file="src/transports/xhr.js" />
Expand Down
193 changes: 0 additions & 193 deletions src/transports/css.js

This file was deleted.

52 changes: 0 additions & 52 deletions src/transports/image.js

This file was deleted.

2 changes: 0 additions & 2 deletions test/index.html
Expand Up @@ -21,8 +21,6 @@
<script src="../src/css.js"></script>
<script src="../src/ajax.js"></script>
<script src="../src/xhr.js"></script>
<script src="../src/transports/css.js"></script>
<script src="../src/transports/image.js"></script>
<script src="../src/transports/jsonp.js"></script>
<script src="../src/transports/script.js"></script>
<script src="../src/transports/xhr.js"></script>
Expand Down
104 changes: 0 additions & 104 deletions test/unit/ajax.js
Expand Up @@ -1654,110 +1654,6 @@ test("jQuery.ajax - Etag support", function() {
});
});

test("jQuery ajax - image preloading", function() {

stop();

var xhr = jQuery.ajax({
url: url("data/cow.jpg"),
dataType: "image"
}).success(function(image) {
ok(image.width, "Image preloaded");
ok(xhr.responseObject === image, "Image is set as responseObject in xhr");
start();
});

});

test("jQuery ajax - image preloading (error)", function() {

stop();

jQuery.ajax({
url: url("data/not_here.gif"),
dataType: "image"
}).error(function() {
ok(true, "Image couldn't be found");
start();
});

});

test("jQuery ajax - image preloading (abort)", function() {

stop();

jQuery.ajax({
url: url("data/name.php?wait=5"),
dataType: "image",
timeout: 100
}).error(function(_,status) {
ok(status=="timeout", "Image preloading aborted by timeout");
start();
});

});

test("jQuery ajax - css (local)", function() {

stop();

jQuery.ajax({
url: url("data/css.php?wait=1&id=css-test-div-id"),
dataType: "css"
}).success(function() {
ok(true, "CSS local success");
var div = jQuery("<div id='css-test-div-id' />").appendTo(jQuery("body"));
strictEqual( div.css("marginLeft") , "27px" , "CSS has been properly applied" );
div.remove();
start();
});

});

test("jQuery ajax - css (remote)", function() {

stop();

jQuery.ajax({
url: url("http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css"),
dataType: "css"
}).success(function() {
ok(true, "CSS remote success");

var div = jQuery("<div class='ui-icon' />").appendTo(jQuery("body")),
textIndent = 1 * div.css("textIndent").replace(/px/,"");

// Opera 16bits capping
if ( textIndent === -32768 ) {
strictEqual( textIndent , -32768 , "CSS has been properly applied" );
} else {
strictEqual( textIndent , -99999 , "CSS has been properly applied" );
}

div.remove();

start();
});

});

test("jQuery ajax - css autoDataType", function() {

stop();

jQuery.ajax({
url: url("data/css.php?wait=1&id=css-autodatatype")
}).success(function() {
ok(true, "Ajax success");
var div = jQuery("<div id='css-autodatatype' />").appendTo(jQuery("body"));
strictEqual( div.css("marginLeft") , "27px" , "CSS has been properly auto-determined and applied" );
div.remove();
start();
});

});

test("jQuery ajax - headers", function() {

stop();
Expand Down

0 comments on commit 552849a

Please sign in to comment.