Andy Li пре 8 година
родитељ
комит
f72dc37444
4 измењених фајлова са 98 додато и 7 уклоњено
  1. 1 0
      extra/CHANGES.txt
  2. 5 0
      std/js/jquery/Deferred.hx
  3. 76 0
      std/js/jquery/Event.hx
  4. 16 7
      std/js/jquery/JQuery.hx

+ 1 - 0
extra/CHANGES.txt

@@ -5,6 +5,7 @@
 	js : improved generation of `break` inside `switch` inside loops (#4964)
 	cs : improved generation of enum classes (#6119)
 	sys : the `database` parameter of `Mysql.connect` is now optional
+	js : updated jQuery extern (js.jquery.*) for jQuery 1.12.4 / 3.2.1 support.
 
 	Removals:
 

+ 5 - 0
std/js/jquery/Deferred.hx

@@ -5,6 +5,11 @@ package js.jquery;
 		Add handlers to be called when the Deferred object is either resolved or rejected.
 	**/
 	public function always(alwaysCallbacks:haxe.extern.EitherType<haxe.Constraints.Function, Array<haxe.Constraints.Function>>, ?alwaysCallbacks:haxe.extern.EitherType<haxe.Constraints.Function, Array<haxe.Constraints.Function>>):js.jquery.Deferred;
+	/**
+		Add handlers to be called when the Deferred object is rejected.
+	**/
+	@:native("catch")
+	public function _catch(failFilter:haxe.Constraints.Function):js.jquery.Promise;
 	/**
 		Add handlers to be called when the Deferred object is resolved.
 	**/

+ 76 - 0
std/js/jquery/Event.hx

@@ -49,22 +49,98 @@ package js.jquery;
 		For key or mouse events, this property indicates the specific key or button that was pressed.
 	**/
 	public var which : Float;
+	/**
+		
+				Returns a `Boolean` that is `true` if the Alt ( Option or ⌥ on OS X) key was active when the key event was generated.
+			
+	**/
 	public var altKey : Bool;
+	/**
+		
+				The button number that was pressed when the mouse event was fired. 
+			
+	**/
 	public var button : Int;
+	/**
+		
+				
+				 The buttons being pressed when the mouse event was fired
+				 
+			
+	**/
 	public var buttons : Int;
 	public var char : Int;
+	/**
+		
+				Returns a `Number` representing the Unicode reference number of the key; this attribute is used only by the `keypress` event. For keys whose `char` attribute contains multiple characters, this is the Unicode value of the first character in that attribute. In Firefox 26 this returns codes for printable characters.
+				 Warning: This attribute is deprecated; you should use `KeyboardEvent.key` instead, if available.
+				 
+			
+	**/
 	public var charCode : Int;
+	/**
+		
+				The X coordinate of the mouse pointer in local (DOM content) coordinates.
+			
+	**/
 	public var clientX : Int;
+	/**
+		
+				The Y coordinate of the mouse pointer in local (DOM content) coordinates.
+			
+	**/
 	public var clientY : Int;
+	/**
+		
+				Returns a `Boolean` that is `true` if the Ctrl key was active when the key event was generated.
+			
+	**/
 	public var ctrlKey : Bool;
+	/**
+		
+				Returns a `long` with details about the event, depending on the event type.
+			
+	**/
 	public var detail : Int;
+	/**
+		
+				Returns a `DOMString` representing the key value of the key represented by the event.
+			
+	**/
 	public var key : String;
+	/**
+		
+				Returns a `Number` representing a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
+				 Warning: This attribute is deprecated; you should use `KeyboardEvent.key` instead, if available.
+				 
+			
+	**/
 	public var keyCode : Int;
 	public var offsetX : Int;
 	public var offsetY : Int;
+	/**
+		
+				The X coordinate of the mouse pointer in global (screen) coordinates.
+			
+	**/
 	public var screenX : Int;
+	/**
+		
+				The Y coordinate of the mouse pointer in global (screen) coordinates.
+			
+	**/
 	public var screenY : Int;
+	/**
+		
+				Returns a `Boolean` that is `true` if the Shift key was active when the key event was generated.
+			
+	**/
 	public var shiftKey : Bool;
 	public var toElement : js.html.Element;
+	/**
+		
+				Returns a `WindowProxy` that contains the view that generated the event.
+			
+	**/
 	public var view : js.html.Window;
 }

+ 16 - 7
std/js/jquery/JQuery.hx

@@ -85,6 +85,7 @@ package js.jquery;
 	static public var fx : { /**
 		The rate (in milliseconds) at which animations fire.
 	**/
+	@:deprecated("Deprecated since jQuery 3.0")
 	var interval : Float; /**
 		Globally disable all animations.
 	**/
@@ -217,6 +218,10 @@ package js.jquery;
 	@:overload(function(element:js.html.Element, queueName:String, newQueue:Array<Void -> Void>):js.jquery.JQuery { })
 	@:overload(function(element:js.html.Element, queueName:String, callback:haxe.Constraints.Function):js.jquery.JQuery { })
 	static public function queue(element:js.html.Element, ?queueName:String):Array<Void -> Void>;
+	/**
+		A Promise-like object (or "thenable") that resolves when the document is ready.
+	**/
+	static public var ready : js.Promise.Thenable<Dynamic>;
 	/**
 		Handles errors thrown synchronously in functions wrapped in <code>jQuery()</code>.
 	**/
@@ -259,9 +264,9 @@ package js.jquery;
 	**/
 	static public function uniqueSort(array:Array<js.html.Element>):Array<js.html.Element>;
 	/**
-		Provides a way to execute callback functions based on zero or more objects, usually <a href="/category/deferred-object/">Deferred</a> objects that represent asynchronous events.
+		Provides a way to execute callback functions based on zero or more Thenable objects, usually <a href="/category/deferred-object/">Deferred</a> objects that represent asynchronous events.
 	**/
-	static public function when(deferreds:haxe.extern.Rest<js.jquery.Deferred>):js.jquery.Promise;
+	static public function when(deferreds:haxe.extern.EitherType<js.jquery.Promise, haxe.extern.EitherType<haxe.extern.Rest<js.jquery.Deferred>, js.Promise.Thenable<Dynamic>>>):js.jquery.Promise;
 	/**
 		Create a new jQuery object with elements added to the set of matched elements.
 	**/
@@ -346,6 +351,7 @@ package js.jquery;
 	/**
 		Attach a handler to an event for the elements.
 	**/
+	@:deprecated("Deprecated since jQuery 3.0")
 	@:overload(function(eventType:String, ?eventData:Dynamic, handler:js.jquery.Event -> Void):js.jquery.JQuery { })
 	@:overload(function(eventType:String, ?eventData:Dynamic, ?preventBubble:Bool):js.jquery.JQuery { })
 	public function bind(events:Dynamic):js.jquery.JQuery;
@@ -437,6 +443,7 @@ package js.jquery;
 	/**
 		Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
 	**/
+	@:deprecated("Deprecated since jQuery 3.0")
 	@:overload(function(selector:String, eventType:String, handler:js.jquery.Event -> Void):js.jquery.JQuery { })
 	@:overload(function(selector:String, eventType:String, eventData:Dynamic, handler:js.jquery.Event -> Void):js.jquery.JQuery { })
 	public function delegate(selector:String, events:Dynamic):js.jquery.JQuery;
@@ -779,19 +786,19 @@ package js.jquery;
 	@:overload(function(events:String, ?selector:String, ?data:Dynamic, handler:js.jquery.Event -> Void):js.jquery.JQuery { })
 	public function one(events:String, ?data:Dynamic, handler:js.jquery.Event -> Void):js.jquery.JQuery;
 	/**
-		Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements.
+		Set the CSS outer height of each element in the set of matched elements.
 		OR
-		Set the CSS outer Height of each element in the set of matched elements.
+		Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements.
 	**/
-	@:overload(function(_function:haxe.Constraints.Function):js.jquery.JQuery { })
+	@:overload(function(_function:Int -> Float -> haxe.extern.EitherType<Float, String>):js.jquery.JQuery { })
 	@:overload(function(?includeMargin:Bool):Float { })
 	public function outerHeight(value:haxe.extern.EitherType<Float, String>):js.jquery.JQuery;
 	/**
-		Get the current computed width for the first element in the set of matched elements, including padding and border.
+		Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements.
 		OR
 		Set the CSS outer width of each element in the set of matched elements.
 	**/
-	@:overload(function(_function:haxe.Constraints.Function):js.jquery.JQuery { })
+	@:overload(function(_function:Int -> Float -> haxe.extern.EitherType<Float, String>):js.jquery.JQuery { })
 	@:overload(function(?includeMargin:Bool):Float { })
 	public function outerWidth(value:haxe.extern.EitherType<Float, String>):js.jquery.JQuery;
 	/**
@@ -1030,6 +1037,7 @@ package js.jquery;
 	/**
 		Remove a previously-attached event handler from the elements.
 	**/
+	@:deprecated("Deprecated since jQuery 3.0")
 	@:overload(function(event:js.jquery.Event):js.jquery.JQuery { })
 	@:overload(function(eventType:String, _false:Bool):js.jquery.JQuery { })
 	@:overload(function(eventType:String, ?handler:js.jquery.Event -> Void):js.jquery.JQuery { })
@@ -1037,6 +1045,7 @@ package js.jquery;
 	/**
 		Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
 	**/
+	@:deprecated("Deprecated since jQuery 3.0")
 	@:overload(function(namespace:String):js.jquery.JQuery { })
 	@:overload(function(selector:String, eventType:String):js.jquery.JQuery { })
 	@:overload(function(selector:String, events:Dynamic):js.jquery.JQuery { })