corrade-http-templates – Blame information for rev 42

Subversion Repositories:
Rev:
Rev Author Line No. Line
42 office 1 /*!
2 * jQuery UI Support for jQuery core 1.7.x 1.12.1
3 * http://jqueryui.com
4 *
5 * Copyright jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
8 *
9 */
10  
11 //>>label: jQuery 1.7 Support
12 //>>group: Core
13 //>>description: Support version 1.7.x of jQuery core
14  
15 ( function( factory ) {
16 if ( typeof define === "function" && define.amd ) {
17  
18 // AMD. Register as an anonymous module.
19 define( [ "jquery", "./version" ], factory );
20 } else {
21  
22 // Browser globals
23 factory( jQuery );
24 }
25 }( function( $ ) {
26  
27 // Support: jQuery 1.7 only
28 // Not a great way to check versions, but since we only support 1.7+ and only
29 // need to detect <1.8, this is a simple check that should suffice. Checking
30 // for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
31 // and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
32 // 1.7 anymore). See #11197 for why we're not using feature detection.
33 if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
34  
35 // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
36 // Unlike jQuery Core 1.8+, these only support numeric values to set the
37 // dimensions in pixels
38 $.each( [ "Width", "Height" ], function( i, name ) {
39 var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
40 type = name.toLowerCase(),
41 orig = {
42 innerWidth: $.fn.innerWidth,
43 innerHeight: $.fn.innerHeight,
44 outerWidth: $.fn.outerWidth,
45 outerHeight: $.fn.outerHeight
46 };
47  
48 function reduce( elem, size, border, margin ) {
49 $.each( side, function() {
50 size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
51 if ( border ) {
52 size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
53 }
54 if ( margin ) {
55 size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
56 }
57 } );
58 return size;
59 }
60  
61 $.fn[ "inner" + name ] = function( size ) {
62 if ( size === undefined ) {
63 return orig[ "inner" + name ].call( this );
64 }
65  
66 return this.each( function() {
67 $( this ).css( type, reduce( this, size ) + "px" );
68 } );
69 };
70  
71 $.fn[ "outer" + name ] = function( size, margin ) {
72 if ( typeof size !== "number" ) {
73 return orig[ "outer" + name ].call( this, size );
74 }
75  
76 return this.each( function() {
77 $( this ).css( type, reduce( this, size, true, margin ) + "px" );
78 } );
79 };
80 } );
81  
82 $.fn.addBack = function( selector ) {
83 return this.add( selector == null ?
84 this.prevObject : this.prevObject.filter( selector )
85 );
86 };
87 }
88  
89 } ) );