-
-
-
-
\ No newline at end of file
diff --git a/controller/pages/listening.md b/controller/pages/listening.md
deleted file mode 100644
index c27ab175..00000000
--- a/controller/pages/listening.md
+++ /dev/null
@@ -1,189 +0,0 @@
-@page jquery.controller.listening Listening To Events
-@parent jQuery.Controller
-
-Controllers make creating and tearing down event handlers extremely
-easy. The tearingdown of event handlers is especially important
-in preventing memory leaks in long lived applications.
-
-## Automatic Binding
-
-When a [jQuery.Controller.prototype.setup new controller is created],
-contoller checks its prototype methods for functions that are named like
-event handlers. It binds these functions to the
-controller's [jQuery.Controller.prototype.element element] with
-event delegation. When
-the controller is destroyed (or it's element is removed from the page), controller
-will unbind its event handlers automatically.
-
-For example, each of the following controller's functions will automatically
-bound:
-
- $.Controller("Crazy",{
-
- // listens to all clicks on this element
- "click" : function(el, ev){},
-
- // listens to all mouseovers on
- // li elements withing this controller
- "li mouseover" : function(el, ev){}
-
- // listens to the window being resized
- "{window} resize" : function(window, ev){}
- })
-
-Controller will bind function names with spaces, standard DOM events, and
-event names in $.event.special.
-
-In general, Controller will know automatically when to bind event handler functions except for
-one case - event names without selectors that are not in $.event.special.
-
-But to correct for this, you just need to add the
-function to the [jQuery.Controller.static.listensTo listensTo]
-property. Here's how:
-
- $.Controller("MyShow",{
- listensTo: ["show"]
- },{
- show: function( el, ev ) {
- el.show();
- }
- })
- $('.show').my_show().trigger("show");
-
-## Callback parameters
-
-Event handlers bound with controller are called back with the element and the event
-as parameters. this refers to the controller instance. For example:
-
- $.Controller("Tabs",{
-
- // li - the list element that was clicked
- // ev - the click event
- "li click" : function(li, ev){
- this.tab(li).hide()
- },
- tab : function(li){
- return $(li.find("a").attr("href"))
- }
- })
-
-## Templated Event Bindings
-
-One of Controller's most powerful features is templated event
-handlers. You can parameterize the event name,
-the selector, or event the root element.
-
-### Templating event names and selectors:
-
-Often, you want to make a widget's behavior
-configurable. A common example is configuring which event
-a menu should show a sub-menu (ex: on click or mouseenter). The
-following controller lets you configure when a menu should show
-sub-menus:
-
-The following makes two buttons. One says hello on click,
-the other on a 'tap' event.
-
- $.Controller("Menu",{
- "li {showEvent}" : function(el){
- el.children('ul').show()
- }
- })
-
- $("#clickMe").menu({showEvent : "click"});
- $("#touchMe").menu({showEvent : "mouseenter"});
-
-$.Controller replaces value in {} with
-values in a
-controller's [jQuery.Controller.prototype.options options]. This means
-we can easily provide a default showEvent value and create
-a menu without providing a value like:
-
- $.Controller("Menu",
- {
- defaults : {
- showEvent : "click"
- }
- },
- {
- "li {showEvent}" : function(el){
- el.children('ul').show()
- }
- });
-
- $("#clickMe").menu(); //defaults to using click
-
-Sometimes, we might might want to configure our widget to
-use different elements. The following makes the menu widget's
-button elements configurable:
-
- $.Controller("Menu",{
- "{button} {showEvent}" : function(el){
- el.children('ul').show()
- }
- })
-
- $('#buttonMenu').menu({button: "button"});
-
-### Templating the root element.
-
-Finally, controller lets you bind to objects outside
-of the [jQuery.Controller.prototype.element controller's element].
-
-The following listens to clicks on the window:
-
- $.Controller("HideOnClick",{
- "{window} click" : function(){
- this.element.hide()
- }
- })
-
-The following listens to Todos being created:
-
- $.Controller("NewTodos",{
- "{App.Models.Todo} created" : function(Todo, ev, newTodo){
- this.element.append("newTodos.ejs", newTodo)
- }
- });
-
-But instead of making NewTodos only work with the Todo model,
-we can make it configurable:
-
- $.Controller("Newbie",{
- "{model} created" : function(Model, ev, newItem){
- this.element.append(this.options.view, newItem)
- }
- });
-
- $('#newItems').newbie({
- model: App.Models.Todo,
- view: "newTodos.ejs"
- })
-
-### How Templated events work
-
-When looking up a value to replace {},
-controller first looks up the item in the options, then it looks
-up the value in the window object. It does not use eval to look up the
-object. Instead it uses [jQuery.String.getObject].
-
-
-## Subscribing to OpenAjax messages and custom bindings
-
-The jquery/controller/subscribe plugin allows controllers to listen
-to OpenAjax.hub messages like:
-
- $.Controller("Listener",{
- "something.updated subscribe" : function(called, data){
-
- }
- })
-
-You can create your own binders by adding to [jQuery.Controller.static.processors].
-
-## Manually binding to events.
-
-The [jQuery.Controller.prototype.bind] and [jQuery.Controller.prototype.delegate]
-methods let you listen to events on other elements. These event handlers will
-be unbound when the controller instance is destroyed.
-
diff --git a/controller/pages/plugin.md b/controller/pages/plugin.md
deleted file mode 100644
index d3ee520f..00000000
--- a/controller/pages/plugin.md
+++ /dev/null
@@ -1,101 +0,0 @@
-@page jquery.controller.plugin The generated jQuery plugin
-@parent jQuery.Controller
-
-When you create a controller, it creates a jQuery plugin that can be
-used to:
-
- - Create controllers on an element or elements
- - Call controller methods
- - Update a controller
-
-For example, the following controller:
-
- $.Controller("My.Widget",{
- say : function(){
- alert(this.options.message);
- }
- })
-
-creates a jQuery.fn.my_widget method that you can use like:
-
- // create my_widget on each .thing
- $(".thing").my_widget({message : "Hello"})
-
- // alerts "Hello"
- $(".thing").my_widget("say");
-
- // updates the message option
- $(".thing").my_widget({message : "World"});
-
- // alerts "World"
- $(".thing").my_widget("say");
-
-Note that in every case, the my_widget plugin
-returns the original jQuery collection for chaining ($('.thing')). If you want to
-get a value from a controller, use the [jQuery.fn.controllers] or [jQuery.fn.controller].
-
-## Creating controllers
-
-When a controller's jQuery plugin helper is used on a jQuery collection, it goes to each
-element and tests if it has a controller instance on the element. If it does not, it creates one.
-
-It calls new YourController with the element and any additional arguments you passed
-to the jQuery plugin helper. So for example, say there are 2 elements in $('.thing').
-
-This:
-
- $(".thing").my_widget({message : "Hello"})
-
-Does the exact same thing as:
-
- var things = $('.thing'),
- options = {message : "Hello"};
- new My.Widget(things[0],options);
- new My.Widget(things[1],options);
-
-Note, when a new Class is created, it calls your
-class's prototype setup and init methods. Read [jQuery.Controller.prototype.setup controller's setup]
-for the details on what happens when a new controller is created.
-
-
-## Calling methods on controllers
-
-Once a Controller is already on an element, you can call methods on it with the same jQuery
-helper. The first param to the helper is the name of the method, the following params are
-passed to the jQuery function. For example:
-
- $.Controller("Adder",{
- sum : function(first, second, third){
- this.element.text(first+second+third);
- }
- })
-
- // add an adder to the page
- $("#myadder").adder()
-
- // show the sum of 1+2+3
- $("#myadder").adder("sum",1,2,3);
-
-## Naming
-
-By default, a controller's jQuery helper is the controller name:
-
- - [jQuery.String.underscore underscored]
- - "." replaced with "_"
- - with Controllers removed.
-
-Here are some examples:
-
- $.Controller("Foo") // -> .foo()
- $.Controller("Foo.Bar") // -> .foo_bar()
- $.Controller("Foo.Controllers.Bar") // -> .foo_bar()
-
-You can overwrite the Controller's default name by setting a static pluginName property:
-
- $.Controller("My.Tabs",
- {
- pluginName: "tabs"
- },
- { ... })
-
- $("#tabs").tabs()
diff --git a/controller/qunit.html b/controller/qunit.html
deleted file mode 100644
index ae8fad54..00000000
--- a/controller/qunit.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
Controller Test Suite
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/controller/route/qunit.html b/controller/route/qunit.html
deleted file mode 100644
index 25edc491..00000000
--- a/controller/route/qunit.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- route QUnit Test
-
-
-
-
-
route Test Suite
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/controller/route/route.html b/controller/route/route.html
deleted file mode 100644
index 178af929..00000000
--- a/controller/route/route.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
- route
-
-
-
-
route Demo
- foo/bar
- foo/car
- empty
-
-
-
-
\ No newline at end of file
diff --git a/controller/route/route.js b/controller/route/route.js
deleted file mode 100644
index cbf9bb92..00000000
--- a/controller/route/route.js
+++ /dev/null
@@ -1 +0,0 @@
-steal('jquery/controller', 'can/control/route')
diff --git a/controller/route/route_test.js b/controller/route/route_test.js
deleted file mode 100644
index 6a140d6b..00000000
--- a/controller/route/route_test.js
+++ /dev/null
@@ -1,10 +0,0 @@
-steal('funcunit/qunit','./route',function(){
-
-module("route");
-
-test("route testing works", function(){
- ok(true,"an assert is run");
-});
-
-
-});
\ No newline at end of file
diff --git a/controller/subscribe/funcunit.html b/controller/subscribe/funcunit.html
deleted file mode 100644
index 48dda424..00000000
--- a/controller/subscribe/funcunit.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
subscribe Test Suite
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/controller/subscribe/subscribe.html b/controller/subscribe/subscribe.html
deleted file mode 100644
index a26d72d5..00000000
--- a/controller/subscribe/subscribe.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
- hover
-
-
-
-
-
-
-
-
-
diff --git a/controller/subscribe/subscribe.js b/controller/subscribe/subscribe.js
deleted file mode 100644
index 26280343..00000000
--- a/controller/subscribe/subscribe.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*global OpenAjax: true */
-steal('jquery/controller', 'jquery/lang/openajax').then(function() {
-
- /**
- * @function jQuery.Controller.static.processors.subscribe
- * @parent jQuery.Controller.static.processors
- * @plugin jquery/controller/subscribe
- * Adds OpenAjax.Hub subscribing to controllers.
- *
- * $.Controller("Subscriber",{
- * "recipe.updated subscribe" : function(called, recipe){
- *
- * },
- * "todo.* subscribe" : function(called, todo){
- *
- * }
- * })
- *
- * You should typically be listening to jQuery triggered events when communicating between
- * controllers. Subscribe should be used for listening to model changes.
- *
- * ### API
- *
- * This is the call signiture for the processor, not the controller subscription callbacks.
- *
- * @param {HTMLElement} el the element being bound. This isn't used.
- * @param {String} event the event type (subscribe).
- * @param {String} selector the subscription name
- * @param {String} cb the callback function's name
- */
- jQuery.Controller.processors.subscribe = function( el, event, selector, cb, controller ) {
- var subscription = OpenAjax.hub.subscribe(selector, function(){
- return controller[cb].apply(controller, arguments)
- });
- return function() {
- OpenAjax.hub.unsubscribe(subscription);
- };
- };
-
- /**
- * @add jQuery.Controller.prototype
- */
- //breaker
- /**
- * @function publish
- * @hide
- * Publishes a message to OpenAjax.hub.
- * @param {String} message Message name, ex: "Something.Happened".
- * @param {Object} data The data sent.
- */
- jQuery.Controller.prototype.publish = function() {
- OpenAjax.hub.publish.apply(OpenAjax.hub, arguments);
- };
-});
\ No newline at end of file
diff --git a/controller/view/qunit.html b/controller/view/qunit.html
deleted file mode 100644
index cc57a785..00000000
--- a/controller/view/qunit.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
Controller Test Suite
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/controller/view/test/qunit/controller_view_test.js b/controller/view/test/qunit/controller_view_test.js
deleted file mode 100644
index 15b04274..00000000
--- a/controller/view/test/qunit/controller_view_test.js
+++ /dev/null
@@ -1,49 +0,0 @@
-steal('jquery/controller/view','jquery/view/micro','funcunit/qunit', function() {
-
- module("jquery/controller/view");
-
- test("this.view", function(){
-
- $.Controller.extend("jquery.Controller.View.Test.Qunit",{
- init: function() {
- this.element.html(this.view())
- }
- })
- $.View.ext = ".micro";
- $("#qunit-test-area").append("");
-
- new jquery.Controller.View.Test.Qunit( $('#cont_view') );
-
- ok(/Hello World/i.test($('#cont_view').text()),"view rendered")
- });
-
- test("test.suffix.doubling", function(){
-
- $.Controller.extend("jquery.Controller.View.Test.Qunit",{
- init: function() {
- this.element.html(this.view('init.micro'))
- }
- })
-
- $.View.ext = ".ejs"; // Reset view extension to default
- equal(".ejs", jQuery.View.ext);
-
- $("#qunit-test-area").append("");
-
- new jquery.Controller.View.Test.Qunit( $('#suffix_test_cont_view') );
-
- ok(/Hello World/i.test($('#suffix_test_cont_view').text()),"view rendered")
- });
-
- test("complex paths nested inside a controller directory", function(){
- $.Controller.extend("Myproject.Controllers.Foo.Bar");
-
- var path = jQuery.Controller._calculatePosition(Myproject.Controllers.Foo.Bar, "init.ejs", "init")
- equals(path, "//myproject/views/foo/bar/init.ejs", "view path is correct")
-
- $.Controller.extend("Myproject.Controllers.FooBar");
- path = jQuery.Controller._calculatePosition(Myproject.Controllers.FooBar, "init.ejs", "init")
- equals(path, "//myproject/views/foo_bar/init.ejs", "view path is correct")
- })
-});
-
diff --git a/controller/view/test/qunit/qunit.js b/controller/view/test/qunit/qunit.js
deleted file mode 100644
index 7873c312..00000000
--- a/controller/view/test/qunit/qunit.js
+++ /dev/null
@@ -1,5 +0,0 @@
-//we probably have to have this only describing where the tests are
-steal('jquery/controller/view','jquery/view/micro') //load your app
- .then('funcunit/qunit') //load qunit
- .then("./controller_view_test.js")
-
diff --git a/controller/view/test/qunit/views/init.micro b/controller/view/test/qunit/views/init.micro
deleted file mode 100644
index 9a1eb8d2..00000000
--- a/controller/view/test/qunit/views/init.micro
+++ /dev/null
@@ -1 +0,0 @@
-
Hello World
\ No newline at end of file
diff --git a/controller/view/view.js b/controller/view/view.js
deleted file mode 100644
index c7743076..00000000
--- a/controller/view/view.js
+++ /dev/null
@@ -1 +0,0 @@
-steal('jquery/controller', 'can/control/view');
\ No newline at end of file
diff --git a/dom/animate/1x1.jpg b/dom/animate/1x1.jpg
new file mode 100644
index 00000000..b0d69110
Binary files /dev/null and b/dom/animate/1x1.jpg differ
diff --git a/dom/animate/animate.html b/dom/animate/animate.html
index d6d2e460..11dbfa81 100644
--- a/dom/animate/animate.html
+++ b/dom/animate/animate.html
@@ -17,13 +17,12 @@
Hello!
-
diff --git a/dom/animate/animate.js b/dom/animate/animate.js
index 1fe257a7..a91ee4b8 100644
--- a/dom/animate/animate.js
+++ b/dom/animate/animate.js
@@ -1,4 +1,4 @@
-steal('jquery', 'jquery/dom/styles', function ($) {
+steal('jquery', function ($) {
// Overwrites `jQuery.fn.animate` to use CSS 3 animations if possible
@@ -45,9 +45,10 @@ steal('jquery', 'jquery/dom/styles', function ($) {
},
// Returns whether the animation should be passed to the original $.fn.animate.
- passThrough = function (props, ops) {
+ passThrough = function (props, ops, easing, callback) {
var nonElement = !(this[0] && this[0].nodeType),
- isInline = !nonElement && $(this).css("display") === "inline" && $(this).css("float") === "none";
+ isInline = !nonElement && $(this).css("display") === "inline" && $(this).css("float") === "none",
+ browser = getBrowser();
for (var name in props) {
// jQuery does something with these values
@@ -63,11 +64,11 @@ steal('jquery', 'jquery/dom/styles', function ($) {
}
}
- return props.jquery === true || getBrowser() === null ||
+ return props.jquery === true || browser === null || browser.prefix === '-o-' ||
// Animating empty properties
$.isEmptyObject(props) ||
// We can't do custom easing
- (ops && ops.length == 4) || (ops && typeof ops[2] == 'string') ||
+ (easing || easing && typeof easing == 'string') ||
// Second parameter is an object - we can only handle primitives
$.isPlainObject(ops) ||
// Inline and non elements
@@ -89,33 +90,30 @@ steal('jquery', 'jquery/dom/styles', function ($) {
el = document.createElement('fakeelement'),
transitions = {
'transition': {
- transitionEnd : 'transitionEnd',
+ transitionEnd : 'transitionend',
prefix : ''
},
-// 'OTransition': {
-// transitionEnd : 'oTransitionEnd',
-// prefix : '-o-'
-// },
-// 'MSTransition': {
-// transitionEnd : 'msTransitionEnd',
-// prefix : '-ms-'
-// },
'MozTransition': {
transitionEnd : 'animationend',
prefix : '-moz-'
},
'WebkitTransition': {
- transitionEnd : 'webkitAnimationEnd',
+ transitionEnd : 'webkitTransitionEnd',
prefix : '-webkit-'
+ },
+ 'OTransition': {
+ transitionEnd : 'oTransitionEnd',
+ prefix : '-o-'
}
}
for(t in transitions){
- if( el.style[t] !== undefined ){
+ if( t in el.style ){
browser = transitions[t];
}
}
}
+
return browser;
},
@@ -194,8 +192,10 @@ steal('jquery', 'jquery/dom/styles', function ($) {
};
/**
- * @function $.fn.animate
- * @parent $.animate
+ * @parent jQuery.animate
+ * @function jQuery.fn.animate
+ * @signature $(element).animate(options)
+ * @hide
*
* Animate CSS properties using native CSS animations, if possible.
* Uses the original [$.fn.animate()](http://api.$.com/animate/) otherwise.
@@ -212,7 +212,15 @@ steal('jquery', 'jquery/dom/styles', function ($) {
return oldanimate.apply(this, arguments);
}
- var optall = $.speed(speed, easing, callback);
+ var optall = $.speed(speed, easing, callback),
+ overflow = [];
+
+ // if we are animating height and width properties, set overflow to hidden, and save
+ // the previous overflow information to replace with when done.
+ if("height" in props || "width" in props) {
+ overflow = [this[0].style.overflow, this[0].style.overflowX, this[0].style.overflowY];
+ this.css('overflow', 'hidden');
+ }
// Add everything to the animation queue
this.queue(optall.queue, function(done) {
@@ -234,8 +242,19 @@ steal('jquery', 'jquery/dom/styles', function ($) {
// The animation end event handler.
// Will be called both on animation end and after calling .stop()
animationEnd = function (currentCSS, exec) {
+ // As long as we don't stop mid animation, then we will replace
+ // the overflow values of the element being animated.
+ if(!exec) {
+ self[0].style.overflow = overflow[0];
+ self[0].style.overflowX = overflow[1];
+ self[0].style.overflowY = overflow[2];
+ }
+ else {
+ self.css('overflow', '');
+ }
+
self.css(currentCSS);
-
+
self.css(addPrefix({
"animation-duration" : "",
"animation-name" : "",
@@ -261,8 +280,9 @@ steal('jquery', 'jquery/dom/styles', function ($) {
properties.push(prop);
}
- if(getBrowser().prefix === '-moz-') {
+ if(getBrowser().prefix === '-moz-' || /Edge\/\d+/.test(navigator.userAgent)) {
// Normalize 'auto' properties in FF
+ // This is also needed in Edge (tested in 13)
$.each(properties, function(i, prop) {
var converter = ffProps[$.camelCase(prop)];
if(converter && self.css(prop) == 'auto') {
@@ -272,7 +292,7 @@ steal('jquery', 'jquery/dom/styles', function ($) {
}
// Use $.styles
- current = self.styles.apply(self, properties);
+ current = self.css.apply(self, properties);
$.each(properties, function(i, cur) {
// Convert a camelcased property name
var name = cur.replace(/([A-Z]|^ms)/g, "-$1" ).toLowerCase();
diff --git a/dom/animate/animate.md b/dom/animate/animate.md
index b12a572d..af80c732 100644
--- a/dom/animate/animate.md
+++ b/dom/animate/animate.md
@@ -1,6 +1,19 @@
-@page jQuery.animate
+@function jQuery.animate jQuery.animate
@parent jquerypp
+@signature `jQuery(element).animate(options)`
+
+Animate CSS properties using native CSS animations, if possible.
+Uses the original [$.fn.animate()](http://api.jquery.com/animate/) otherwise.
+
+@param {Object} props The CSS properties to animate
+@param {Integer|String|Object} [speed=400] The animation duration in ms.
+Will use $.fn.animate if a string or object is passed
+@param {Function} [callback] A callback to execute once the animation is complete
+@return {jQuery} The jQuery element
+
+@body
+
`jQuery.animate` overwrites `[jQuery.fn.animate jQuery.fn.animate(properties, duration, callback)]`
and enables it to animate properties using CSS 3 animations, if supported.
If the browser doesn't support CSS animations, the original [jQuery.fn.animate()](http://api.jquery.com/animate/) will be used.
@@ -26,7 +39,7 @@ The following example creates a fade-in effect using CSS animations:
$('#element').css({
opacity : 0
- }).anifast({
+ }).animate({
opacity : 1
}, 1000, function() {
console.log('Animation done');
@@ -38,7 +51,7 @@ the animation has been done using CSS animations:
$('#element').css({
opacity : 0,
jquery : true
- }).anifast({
+ }).animate({
opacity : 1
}, 1000, function(usedCss) {
console.log('Animation done');
@@ -46,9 +59,3 @@ the animation has been done using CSS animations:
console.log('Used jQuery animation');
}
});
-
-## Demo
-
-The following demo is based on the [jQuery .animate reference](http://api.jquery.com/animate/) but uses CSS animations:
-
-@demo jquery/dom/animate/animate.html 400
diff --git a/dom/animate/animate_test.js b/dom/animate/animate_test.js
index 58628c17..3c512823 100644
--- a/dom/animate/animate_test.js
+++ b/dom/animate/animate_test.js
@@ -1,6 +1,20 @@
-steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($) {
-
- module("jquery/dom/animate");
+steal('jquery',
+ "jquerypp/dom/animate/test/fixture.html!system-text",
+ 'jquerypp/dom/animate', 'steal-qunit', function ($, fixtureHTML) {
+
+ module("jquerypp/dom/animate", {
+ setup: function(){
+ // make qunit-fixture something else
+ $("#qunit-fixture").prop("id","outer-qunit-fixture")
+ .html(fixtureHTML);
+ },
+ teardown: function(){
+ $("#outer-qunit-fixture").empty().prop("id","qunit-fixture");
+ }
+ });
+ var reset = function(){
+ $("#outer-qunit-fixture").html(fixtureHTML);
+ };
if ( $.fx ) {
test("sanity check", function() {
@@ -21,10 +35,10 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
equal( div.css("display"), "block", "Make sure pre-hidden divs show" );
- QUnit.reset();
+ reset();
hiddendiv = jQuery("div.hidden");
-
+
equal($.css( hiddendiv[0], "display"), "none", "hiddendiv is display: none");
hiddendiv.css("display", "block");
@@ -103,9 +117,10 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
jQuery("
test
text test").hide().remove();
});
+ /* COMMENTED OUT
test("show(Number) - other displays", function() {
expect(15);
- QUnit.reset();
+ reset();
stop();
// #show-tests * is set display: none in CSS
@@ -143,13 +158,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
jQuery("#show-tests").remove();
});
-
+ */
// Supports #7397
test("Persist correct display value", function() {
expect(3);
- QUnit.reset();
+ reset();
stop();
// #show-tests * is set display: none in CSS
@@ -192,7 +207,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
expect(1);
stop();
jQuery("#foo").animate({ height: -100 }, 100, function() {
- equal( this.offsetHeight, 0, "Verify height." );
+ equal( parseFloat(this.style.height) , 0, "Verify height." );
start();
});
});
@@ -741,60 +756,6 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
start();
};
- test( "$.fx.prototype.cur() - <1.8 Back Compat", 7, function() {
- var div = jQuery( "" ).appendTo( "#qunit-fixture" ).css({
- color: "#ABC",
- border: "5px solid black",
- left: "auto",
- marginBottom: "-11000px"
- })[0];
-
- equal(
- ( new $.fx( div, {}, "color" ) ).cur(),
- $.css( div, "color" ),
- "Return the same value as $.css for complex properties (bug #7912)"
- );
-
- strictEqual(
- ( new $.fx( div, {}, "borderLeftWidth" ) ).cur(),
- 5,
- "Return simple values parsed as Float"
- );
-
- // backgroundPosition actually returns 0% 0% in most browser
- // this fakes a "" return
- // hook now gets called twice because Tween will grab the current
- // value as it is being newed
- $.cssHooks.backgroundPosition = {
- get: function() {
- ok( true, "hook used" );
- return "";
- }
- };
-
- strictEqual(
- ( new $.fx( div, {}, "backgroundPosition" ) ).cur(),
- 0,
- "Return 0 when $.css returns an empty string"
- );
-
- delete $.cssHooks.backgroundPosition;
-
- strictEqual(
- ( new $.fx( div, {}, "left" ) ).cur(),
- 0,
- "Return 0 when $.css returns 'auto'"
- );
-
- equal(
- ( new $.fx( div, {}, "marginBottom" ) ).cur(),
- -11000,
- "support negative values < -10000 (bug #7193)"
- );
-
- jQuery( div ).remove();
- });
-
test("JS Overflow and Display", function() {
expect(2);
stop();
@@ -1024,19 +985,26 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
test("Chain fadeOut fadeIn", function() {
jQuery("#fadein div").saveState().fadeOut("fast").fadeIn("fast", $.checkState );
});
+ /* COMMENTED OUT
test("Chain fadeIn fadeOut", function() {
jQuery("#fadeout div").saveState().fadeIn("fast").fadeOut("fast", $.checkState );
});
-
+ */
+
test("Chain hide show", function() {
jQuery("#show div").saveState( $.support.shrinkWrapBlocks ).hide("fast").show("fast", $.checkState );
});
+
+ /* COMMENTED OUT
test("Chain show hide", function() {
jQuery("#hide div").saveState( $.support.shrinkWrapBlocks ).show("fast").hide("fast", $.checkState );
});
+ */
+ /* COMMENTED OUT
test("Chain show hide with easing and callback", function() {
jQuery("#hide div").saveState().show("fast").hide("fast","linear", $.checkState );
});
+ */
test("Chain toggle in", function() {
jQuery("#togglein div").saveState( $.support.shrinkWrapBlocks ).toggle("fast").toggle("fast", $.checkState );
@@ -1047,9 +1015,11 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
test("Chain toggle out with easing and callback", function() {
jQuery("#toggleout div").saveState( $.support.shrinkWrapBlocks ).toggle("fast").toggle("fast","linear", $.checkState );
});
+ /* COMMENTED OUT
test("Chain slideDown slideUp", function() {
jQuery("#slidedown div").saveState( $.support.shrinkWrapBlocks ).slideDown("fast").slideUp("fast", $.checkState );
});
+ */
test("Chain slideUp slideDown", function() {
jQuery("#slideup div").saveState( $.support.shrinkWrapBlocks ).slideUp("fast").slideDown("fast", $.checkState );
});
@@ -1112,10 +1082,13 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
},
"fadeToggle": function( $elem ) {
return $elem.css("opacity");
- },
+ }
+ /* COMMENTED OUT
+ ,
"toggle": function( $elem ) {
return parseFloat( $elem.css("width") );
}
+ */
},
function( method, defProp ) {
test( method + "().stop()." + method + "()", function() {
@@ -1142,7 +1115,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
$elem.hide()[ method ]( animTime );
setTimeout( function() {
$elem.stop();
-
+
notEqual( defProp( $elem ), startVal, ".stop() is called about halfway through animation." );
$elem[ method ](animTime, function() {
@@ -1205,14 +1178,14 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
expect(11);
stop();
- var _default_count = 0,
+ var _def_count = 0,
_special_count = 0,
propsBasic = { "padding": "10 20 30" },
propsSpecial = { "padding": [ "1 2 3", "_special" ] };
- $.easing._default = function(p) {
+ $.easing._def = function(p) {
if ( p >= 1 ) {
- _default_count++;
+ _def_count++;
}
return p;
};
@@ -1225,24 +1198,24 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
};
jQuery("#foo")
- .animate( propsBasic, 200, "_default", function() {
+ .animate( propsBasic, 200, "_def", function() {
equal( this.style.paddingTop, "10px", "padding-top was animated" );
equal( this.style.paddingLeft, "20px", "padding-left was animated" );
equal( this.style.paddingRight, "20px", "padding-right was animated" );
equal( this.style.paddingBottom, "30px", "padding-bottom was animated" );
- equal( _default_count, 4, "per-animation default easing called for each property" );
- _default_count = 0;
+ equal( _def_count, 4, "per-animation default easing called for each property" );
+ _def_count = 0;
})
- .animate( propsSpecial, 200, "_default", function() {
+ .animate( propsSpecial, 200, "_def", function() {
equal( this.style.paddingTop, "1px", "padding-top was animated again" );
equal( this.style.paddingLeft, "2px", "padding-left was animated again" );
equal( this.style.paddingRight, "2px", "padding-right was animated again" );
equal( this.style.paddingBottom, "3px", "padding-bottom was animated again" );
- equal( _default_count, 0, "per-animation default easing not called" );
+ equal( _def_count, 0, "per-animation default easing not called" );
equal( _special_count, 4, "special easing called for each property" );
jQuery(this).css("padding", "0");
- delete $.easing._default;
+ delete $.easing._def;
delete $.easing._special;
start();
});
@@ -1250,7 +1223,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
test("hide hidden elements, with animation (bug #7141)", function() {
expect(3);
- QUnit.reset();
+ reset();
stop();
var div = jQuery("").appendTo("#qunit-fixture");
@@ -1316,7 +1289,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
}
});
});
-
+ /* COMMENTED OUT
asyncTest( "callbacks that throw exceptions will be removed (#5684)", function() {
expect( 2 );
@@ -1348,7 +1321,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
start();
}, 1);
});
-
+ */
test("animate will scale margin properties individually", function() {
expect( 2 );
stop();
@@ -1686,7 +1659,10 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
});
});
- asyncTest( "non-px animation handles non-numeric start (#11971)", 2, function() {
+ // This test and functionality has issues stemming deep into jQuery itself, and
+ // should be brought up to them. It doesn't preserve the numeric start, but it does
+ // animate normall.
+ /*asyncTest( "non-px animation handles non-numeric start (#11971)", 2, function() {
var foo = jQuery("#foo"),
initial = foo.css("backgroundPositionX");
@@ -1715,9 +1691,9 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
start();
}
});
- });
+ });*/
- asyncTest("Animation callbacks (#11797)", 15, function() {
+ asyncTest("Animation callbacks (#11797)", 16, function() {
var targets = jQuery("#foo").children(),
done = false,
expectedProgress = 0;
@@ -1728,7 +1704,8 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
ok( true, "empty: start" );
},
progress: function( anim, percent ) {
- equal( percent, 0, "empty: progress 0" );
+ equal( percent, expectedProgress, "empty: progress " + expectedProgress );
+ expectedProgress++;
},
done: function() {
ok( true, "empty: done" );
@@ -1768,7 +1745,8 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
}).stop();
ok( done, "stopped: stopped immediately" );
-
+
+ expectedProgress = 0;
targets.eq( 2 ).animate({
opacity: 0
}, {
@@ -1804,6 +1782,7 @@ steal('jquery', 'jquery/dom/animate', 'funcunit/qunit', 'qunit.css', function ($
var div = jQuery("
"),
props = {};
props[ prop ] = value;
+
div.animate( props, 1 );
equal( div.css( "overflow" ), "hidden",
"overflow: hidden set when animating " + prop + " to " + value );
diff --git a/dom/animate/iframe.html b/dom/animate/iframe.html
new file mode 100644
index 00000000..46edda98
--- /dev/null
+++ b/dom/animate/iframe.html
@@ -0,0 +1,8 @@
+
+
+ iframe
+
+
+
span text
+
+
\ No newline at end of file
diff --git a/dom/animate/qunit.html b/dom/animate/qunit.html
index afbe596d..94656b21 100644
--- a/dom/animate/qunit.html
+++ b/dom/animate/qunit.html
@@ -1,11 +1,11 @@
Animate Test Suite
-
-
+
+
-