kanpachi 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bowerrc +3 -0
- data/.travis.yml +3 -1
- data/bower.json +22 -0
- data/kanpachi.gemspec +6 -6
- data/lib/kanpachi/doc/template/components/html5shiv/.bower.json +26 -0
- data/lib/kanpachi/doc/template/components/html5shiv/dist/html5shiv-printshiv.js +11 -0
- data/lib/kanpachi/doc/template/{source/javascripts → components/html5shiv/dist}/html5shiv.js +4 -5
- data/lib/kanpachi/doc/template/components/html5shiv/readme.md +143 -0
- data/lib/kanpachi/doc/template/components/jquery/.bower.json +37 -0
- data/lib/kanpachi/doc/template/components/jquery/MIT-LICENSE.txt +21 -0
- data/lib/kanpachi/doc/template/components/jquery/bower.json +27 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.js +10337 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.min.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.min.map +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax.js +807 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/jsonp.js +89 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/load.js +75 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/parseJSON.js +51 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/parseXML.js +31 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/script.js +93 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/xhr.js +196 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes.js +11 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/attr.js +271 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/classes.js +157 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/prop.js +134 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/support.js +64 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/val.js +176 -0
- data/lib/kanpachi/doc/template/components/jquery/src/callbacks.js +205 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core.js +542 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/access.js +60 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/init.js +132 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/parseHTML.js +39 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/ready.js +151 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css.js +508 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/addGetHookIf.js +32 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/curCSS.js +117 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/defaultDisplay.js +68 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/hiddenVisibleSelectors.js +20 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/support.js +193 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/swap.js +28 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/isHidden.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/rmargin.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data.js +332 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data/accepts.js +21 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data/support.js +25 -0
- data/lib/kanpachi/doc/template/components/jquery/src/deferred.js +150 -0
- data/lib/kanpachi/doc/template/components/jquery/src/deprecated.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/dimensions.js +50 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects.js +648 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/Tween.js +114 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/support.js +76 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event.js +1029 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event/alias.js +39 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event/support.js +26 -0
- data/lib/kanpachi/doc/template/components/jquery/src/exports/amd.js +18 -0
- data/lib/kanpachi/doc/template/components/jquery/src/exports/global.js +32 -0
- data/lib/kanpachi/doc/template/components/jquery/src/intro.js +44 -0
- data/lib/kanpachi/doc/template/components/jquery/src/jquery.js +37 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation.js +744 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/support.js +79 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/offset.js +211 -0
- data/lib/kanpachi/doc/template/components/jquery/src/outro.js +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/queue.js +142 -0
- data/lib/kanpachi/doc/template/components/jquery/src/queue/delay.js +22 -0
- data/lib/kanpachi/doc/template/components/jquery/src/selector-sizzle.js +14 -0
- data/lib/kanpachi/doc/template/components/jquery/src/selector.js +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/serialize.js +110 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.js +2015 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/support.js +62 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing.js +200 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing/findFilter.js +100 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/class2type.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/concat.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/deletedIds.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/hasOwn.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/indexOf.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/pnum.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/push.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/rnotwhite.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/slice.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/strundefined.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/support.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/toString.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/trim.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/wrap.js +75 -0
- data/lib/kanpachi/doc/template/components/respond/.bower.json +20 -0
- data/lib/kanpachi/doc/template/components/respond/Gruntfile.js +90 -0
- data/lib/kanpachi/doc/template/components/respond/LICENSE-MIT +22 -0
- data/lib/kanpachi/doc/template/components/respond/README.md +114 -0
- data/lib/kanpachi/doc/template/components/respond/bower.json +10 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/example.html +24 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond-proxy.html +96 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond.proxy.gif +0 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond.proxy.js +127 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.matchmedia.addListener.min.js +5 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.matchmedia.addListener.src.js +273 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.min.js +5 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.src.js +224 -0
- data/lib/kanpachi/doc/template/components/respond/package.json +32 -0
- data/lib/kanpachi/doc/template/components/respond/src/matchmedia.addListener.js +76 -0
- data/lib/kanpachi/doc/template/components/respond/src/matchmedia.polyfill.js +36 -0
- data/lib/kanpachi/doc/template/components/respond/src/respond.js +341 -0
- data/lib/kanpachi/doc/template/config.rb +4 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.svg +201 -200
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/kanpachi/doc/template/source/javascripts/all.coffee +2 -0
- data/lib/kanpachi/doc/template/source/javascripts/bootstrap.js +271 -319
- data/lib/kanpachi/doc/template/source/javascripts/bootstrap.min.js +6 -6
- data/lib/kanpachi/doc/template/source/javascripts/ie.coffee +2 -0
- data/lib/kanpachi/doc/template/source/layouts/layout.slim +4 -6
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css +192 -229
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css.map +1 -0
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.min.css +7 -1
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.css +2036 -3056
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.css.map +1 -0
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.min.css +6 -8
- data/lib/kanpachi/version.rb +1 -1
- data/wercker.yml +27 -0
- metadata +143 -31
- data/lib/kanpachi/doc/template/source/javascripts/all.js +0 -1
- data/lib/kanpachi/doc/template/source/javascripts/jquery-1.10.2.min.js +0 -6
- data/lib/kanpachi/doc/template/source/javascripts/respond.min.js +0 -7
@@ -0,0 +1,32 @@
|
|
1
|
+
define(function() {
|
2
|
+
|
3
|
+
function addGetHookIf( conditionFn, hookFn ) {
|
4
|
+
// Define the hook, we'll check on the first run if it's really needed.
|
5
|
+
return {
|
6
|
+
get: function() {
|
7
|
+
var condition = conditionFn();
|
8
|
+
|
9
|
+
if ( condition == null ) {
|
10
|
+
// The test was not ready at this point; screw the hook this time
|
11
|
+
// but check again when needed next time.
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
|
15
|
+
if ( condition ) {
|
16
|
+
// Hook not needed (or it's not possible to use it due to missing dependency),
|
17
|
+
// remove it.
|
18
|
+
// Since there are no other hooks for marginRight, remove the whole object.
|
19
|
+
delete this.get;
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
|
23
|
+
// Hook needed; redefine it so that the support test is not executed again.
|
24
|
+
|
25
|
+
return (this.get = hookFn).apply( this, arguments );
|
26
|
+
}
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
return addGetHookIf;
|
31
|
+
|
32
|
+
});
|
@@ -0,0 +1,117 @@
|
|
1
|
+
define([
|
2
|
+
"exports",
|
3
|
+
"../core",
|
4
|
+
"./var/rnumnonpx",
|
5
|
+
"./var/rmargin",
|
6
|
+
"../selector" // contains
|
7
|
+
], function( exports, jQuery, rnumnonpx, rmargin ) {
|
8
|
+
|
9
|
+
var getStyles, curCSS,
|
10
|
+
rposition = /^(top|right|bottom|left)$/;
|
11
|
+
|
12
|
+
if ( window.getComputedStyle ) {
|
13
|
+
getStyles = function( elem ) {
|
14
|
+
return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
|
15
|
+
};
|
16
|
+
|
17
|
+
curCSS = function( elem, name, computed ) {
|
18
|
+
var width, minWidth, maxWidth, ret,
|
19
|
+
style = elem.style;
|
20
|
+
|
21
|
+
computed = computed || getStyles( elem );
|
22
|
+
|
23
|
+
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
|
24
|
+
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
|
25
|
+
|
26
|
+
if ( computed ) {
|
27
|
+
|
28
|
+
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
|
29
|
+
ret = jQuery.style( elem, name );
|
30
|
+
}
|
31
|
+
|
32
|
+
// A tribute to the "awesome hack by Dean Edwards"
|
33
|
+
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
|
34
|
+
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
|
35
|
+
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
|
36
|
+
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
37
|
+
|
38
|
+
// Remember the original values
|
39
|
+
width = style.width;
|
40
|
+
minWidth = style.minWidth;
|
41
|
+
maxWidth = style.maxWidth;
|
42
|
+
|
43
|
+
// Put in the new values to get a computed value out
|
44
|
+
style.minWidth = style.maxWidth = style.width = ret;
|
45
|
+
ret = computed.width;
|
46
|
+
|
47
|
+
// Revert the changed values
|
48
|
+
style.width = width;
|
49
|
+
style.minWidth = minWidth;
|
50
|
+
style.maxWidth = maxWidth;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// Support: IE
|
55
|
+
// IE returns zIndex value as an integer.
|
56
|
+
return ret === undefined ?
|
57
|
+
ret :
|
58
|
+
ret + "";
|
59
|
+
};
|
60
|
+
} else if ( document.documentElement.currentStyle ) {
|
61
|
+
getStyles = function( elem ) {
|
62
|
+
return elem.currentStyle;
|
63
|
+
};
|
64
|
+
|
65
|
+
curCSS = function( elem, name, computed ) {
|
66
|
+
var left, rs, rsLeft, ret,
|
67
|
+
style = elem.style;
|
68
|
+
|
69
|
+
computed = computed || getStyles( elem );
|
70
|
+
ret = computed ? computed[ name ] : undefined;
|
71
|
+
|
72
|
+
// Avoid setting ret to empty string here
|
73
|
+
// so we don't default to auto
|
74
|
+
if ( ret == null && style && style[ name ] ) {
|
75
|
+
ret = style[ name ];
|
76
|
+
}
|
77
|
+
|
78
|
+
// From the awesome hack by Dean Edwards
|
79
|
+
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
80
|
+
|
81
|
+
// If we're not dealing with a regular pixel number
|
82
|
+
// but a number that has a weird ending, we need to convert it to pixels
|
83
|
+
// but not position css attributes, as those are proportional to the parent element instead
|
84
|
+
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
|
85
|
+
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
|
86
|
+
|
87
|
+
// Remember the original values
|
88
|
+
left = style.left;
|
89
|
+
rs = elem.runtimeStyle;
|
90
|
+
rsLeft = rs && rs.left;
|
91
|
+
|
92
|
+
// Put in the new values to get a computed value out
|
93
|
+
if ( rsLeft ) {
|
94
|
+
rs.left = elem.currentStyle.left;
|
95
|
+
}
|
96
|
+
style.left = name === "fontSize" ? "1em" : ret;
|
97
|
+
ret = style.pixelLeft + "px";
|
98
|
+
|
99
|
+
// Revert the changed values
|
100
|
+
style.left = left;
|
101
|
+
if ( rsLeft ) {
|
102
|
+
rs.left = rsLeft;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
// Support: IE
|
107
|
+
// IE returns zIndex value as an integer.
|
108
|
+
return ret === undefined ?
|
109
|
+
ret :
|
110
|
+
ret + "" || "auto";
|
111
|
+
};
|
112
|
+
}
|
113
|
+
|
114
|
+
exports.getStyles = getStyles;
|
115
|
+
exports.curCSS = curCSS;
|
116
|
+
|
117
|
+
});
|
@@ -0,0 +1,68 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"../manipulation" // appendTo
|
4
|
+
], function( jQuery ) {
|
5
|
+
|
6
|
+
var iframe,
|
7
|
+
elemdisplay = {};
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Retrieve the actual display of a element
|
11
|
+
* @param {String} name nodeName of the element
|
12
|
+
* @param {Object} doc Document object
|
13
|
+
*/
|
14
|
+
// Called only from within defaultDisplay
|
15
|
+
function actualDisplay( name, doc ) {
|
16
|
+
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
|
17
|
+
|
18
|
+
// getDefaultComputedStyle might be reliably used only on attached element
|
19
|
+
display = window.getDefaultComputedStyle ?
|
20
|
+
|
21
|
+
// Use of this method is a temporary fix (more like optmization) until something better comes along,
|
22
|
+
// since it was removed from specification and supported only in FF
|
23
|
+
window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" );
|
24
|
+
|
25
|
+
// We don't have any data stored on the element,
|
26
|
+
// so use "detach" method as fast way to get rid of the element
|
27
|
+
elem.detach();
|
28
|
+
|
29
|
+
return display;
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Try to determine the default display value of an element
|
34
|
+
* @param {String} nodeName
|
35
|
+
*/
|
36
|
+
function defaultDisplay( nodeName ) {
|
37
|
+
var doc = document,
|
38
|
+
display = elemdisplay[ nodeName ];
|
39
|
+
|
40
|
+
if ( !display ) {
|
41
|
+
display = actualDisplay( nodeName, doc );
|
42
|
+
|
43
|
+
// If the simple way fails, read from inside an iframe
|
44
|
+
if ( display === "none" || !display ) {
|
45
|
+
|
46
|
+
// Use the already-created iframe if possible
|
47
|
+
iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
|
48
|
+
|
49
|
+
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
|
50
|
+
doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
|
51
|
+
|
52
|
+
// Support: IE
|
53
|
+
doc.write();
|
54
|
+
doc.close();
|
55
|
+
|
56
|
+
display = actualDisplay( nodeName, doc );
|
57
|
+
iframe.detach();
|
58
|
+
}
|
59
|
+
|
60
|
+
// Store the correct default display
|
61
|
+
elemdisplay[ nodeName ] = display;
|
62
|
+
}
|
63
|
+
|
64
|
+
return display;
|
65
|
+
}
|
66
|
+
|
67
|
+
return defaultDisplay;
|
68
|
+
});
|
@@ -0,0 +1,20 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"./support",
|
4
|
+
"../selector",
|
5
|
+
"../css"
|
6
|
+
], function( jQuery, support ) {
|
7
|
+
|
8
|
+
jQuery.expr.filters.hidden = function( elem ) {
|
9
|
+
// Support: Opera <= 12.12
|
10
|
+
// Opera reports offsetWidths and offsetHeights less than zero on some elements
|
11
|
+
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
|
12
|
+
(!support.reliableHiddenOffsets() &&
|
13
|
+
((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
14
|
+
};
|
15
|
+
|
16
|
+
jQuery.expr.filters.visible = function( elem ) {
|
17
|
+
return !jQuery.expr.filters.hidden( elem );
|
18
|
+
};
|
19
|
+
|
20
|
+
});
|
@@ -0,0 +1,193 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"../var/support"
|
4
|
+
], function( jQuery, support ) {
|
5
|
+
|
6
|
+
(function() {
|
7
|
+
var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal,
|
8
|
+
pixelPositionVal, reliableMarginRightVal,
|
9
|
+
div = document.createElement( "div" ),
|
10
|
+
containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px",
|
11
|
+
divReset =
|
12
|
+
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +
|
13
|
+
"display:block;padding:0;margin:0;border:0";
|
14
|
+
|
15
|
+
// Setup
|
16
|
+
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
17
|
+
a = div.getElementsByTagName( "a" )[ 0 ];
|
18
|
+
|
19
|
+
a.style.cssText = "float:left;opacity:.5";
|
20
|
+
|
21
|
+
// Make sure that element opacity exists
|
22
|
+
// (IE uses filter instead)
|
23
|
+
// Use a regex to work around a WebKit issue. See #5145
|
24
|
+
support.opacity = /^0.5/.test( a.style.opacity );
|
25
|
+
|
26
|
+
// Verify style float existence
|
27
|
+
// (IE uses styleFloat instead of cssFloat)
|
28
|
+
support.cssFloat = !!a.style.cssFloat;
|
29
|
+
|
30
|
+
div.style.backgroundClip = "content-box";
|
31
|
+
div.cloneNode( true ).style.backgroundClip = "";
|
32
|
+
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
33
|
+
|
34
|
+
// Null elements to avoid leaks in IE.
|
35
|
+
a = div = null;
|
36
|
+
|
37
|
+
jQuery.extend(support, {
|
38
|
+
reliableHiddenOffsets: function() {
|
39
|
+
if ( reliableHiddenOffsetsVal != null ) {
|
40
|
+
return reliableHiddenOffsetsVal;
|
41
|
+
}
|
42
|
+
|
43
|
+
var container, tds, isSupported,
|
44
|
+
div = document.createElement( "div" ),
|
45
|
+
body = document.getElementsByTagName( "body" )[ 0 ];
|
46
|
+
|
47
|
+
if ( !body ) {
|
48
|
+
// Return for frameset docs that don't have a body
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
|
52
|
+
// Setup
|
53
|
+
div.setAttribute( "className", "t" );
|
54
|
+
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
55
|
+
|
56
|
+
container = document.createElement( "div" );
|
57
|
+
container.style.cssText = containerStyles;
|
58
|
+
|
59
|
+
body.appendChild( container ).appendChild( div );
|
60
|
+
|
61
|
+
// Support: IE8
|
62
|
+
// Check if table cells still have offsetWidth/Height when they are set
|
63
|
+
// to display:none and there are still other visible table cells in a
|
64
|
+
// table row; if so, offsetWidth/Height are not reliable for use when
|
65
|
+
// determining if an element has been hidden directly using
|
66
|
+
// display:none (it is still safe to use offsets if a parent element is
|
67
|
+
// hidden; don safety goggles and see bug #4512 for more information).
|
68
|
+
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
|
69
|
+
tds = div.getElementsByTagName( "td" );
|
70
|
+
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
|
71
|
+
isSupported = ( tds[ 0 ].offsetHeight === 0 );
|
72
|
+
|
73
|
+
tds[ 0 ].style.display = "";
|
74
|
+
tds[ 1 ].style.display = "none";
|
75
|
+
|
76
|
+
// Support: IE8
|
77
|
+
// Check if empty table cells still have offsetWidth/Height
|
78
|
+
reliableHiddenOffsetsVal = isSupported && ( tds[ 0 ].offsetHeight === 0 );
|
79
|
+
|
80
|
+
body.removeChild( container );
|
81
|
+
|
82
|
+
// Null elements to avoid leaks in IE.
|
83
|
+
div = body = null;
|
84
|
+
|
85
|
+
return reliableHiddenOffsetsVal;
|
86
|
+
},
|
87
|
+
|
88
|
+
boxSizing: function() {
|
89
|
+
if ( boxSizingVal == null ) {
|
90
|
+
computeStyleTests();
|
91
|
+
}
|
92
|
+
return boxSizingVal;
|
93
|
+
},
|
94
|
+
|
95
|
+
boxSizingReliable: function() {
|
96
|
+
if ( boxSizingReliableVal == null ) {
|
97
|
+
computeStyleTests();
|
98
|
+
}
|
99
|
+
return boxSizingReliableVal;
|
100
|
+
},
|
101
|
+
|
102
|
+
pixelPosition: function() {
|
103
|
+
if ( pixelPositionVal == null ) {
|
104
|
+
computeStyleTests();
|
105
|
+
}
|
106
|
+
return pixelPositionVal;
|
107
|
+
},
|
108
|
+
|
109
|
+
reliableMarginRight: function() {
|
110
|
+
var body, container, div, marginDiv;
|
111
|
+
|
112
|
+
// Use window.getComputedStyle because jsdom on node.js will break without it.
|
113
|
+
if ( reliableMarginRightVal == null && window.getComputedStyle ) {
|
114
|
+
body = document.getElementsByTagName( "body" )[ 0 ];
|
115
|
+
if ( !body ) {
|
116
|
+
// Test fired too early or in an unsupported environment, exit.
|
117
|
+
return;
|
118
|
+
}
|
119
|
+
|
120
|
+
container = document.createElement( "div" );
|
121
|
+
div = document.createElement( "div" );
|
122
|
+
container.style.cssText = containerStyles;
|
123
|
+
|
124
|
+
body.appendChild( container ).appendChild( div );
|
125
|
+
|
126
|
+
// Check if div with explicit width and no margin-right incorrectly
|
127
|
+
// gets computed margin-right based on width of container. (#3333)
|
128
|
+
// Fails in WebKit before Feb 2011 nightlies
|
129
|
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
130
|
+
marginDiv = div.appendChild( document.createElement( "div" ) );
|
131
|
+
marginDiv.style.cssText = div.style.cssText = divReset;
|
132
|
+
marginDiv.style.marginRight = marginDiv.style.width = "0";
|
133
|
+
div.style.width = "1px";
|
134
|
+
|
135
|
+
reliableMarginRightVal =
|
136
|
+
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
|
137
|
+
|
138
|
+
body.removeChild( container );
|
139
|
+
}
|
140
|
+
|
141
|
+
return reliableMarginRightVal;
|
142
|
+
}
|
143
|
+
});
|
144
|
+
|
145
|
+
function computeStyleTests() {
|
146
|
+
var container, div,
|
147
|
+
body = document.getElementsByTagName( "body" )[ 0 ];
|
148
|
+
|
149
|
+
if ( !body ) {
|
150
|
+
// Test fired too early or in an unsupported environment, exit.
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
|
154
|
+
container = document.createElement( "div" );
|
155
|
+
div = document.createElement( "div" );
|
156
|
+
container.style.cssText = containerStyles;
|
157
|
+
|
158
|
+
body.appendChild( container ).appendChild( div );
|
159
|
+
|
160
|
+
div.style.cssText =
|
161
|
+
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
|
162
|
+
"position:absolute;display:block;padding:1px;border:1px;width:4px;" +
|
163
|
+
"margin-top:1%;top:1%";
|
164
|
+
|
165
|
+
// Workaround failing boxSizing test due to offsetWidth returning wrong value
|
166
|
+
// with some non-1 values of body zoom, ticket #13543
|
167
|
+
jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
|
168
|
+
boxSizingVal = div.offsetWidth === 4;
|
169
|
+
});
|
170
|
+
|
171
|
+
// Will be changed later if needed.
|
172
|
+
boxSizingReliableVal = true;
|
173
|
+
pixelPositionVal = false;
|
174
|
+
reliableMarginRightVal = true;
|
175
|
+
|
176
|
+
// Use window.getComputedStyle because jsdom on node.js will break without it.
|
177
|
+
if ( window.getComputedStyle ) {
|
178
|
+
pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
|
179
|
+
boxSizingReliableVal =
|
180
|
+
( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
|
181
|
+
}
|
182
|
+
|
183
|
+
body.removeChild( container );
|
184
|
+
|
185
|
+
// Null elements to avoid leaks in IE.
|
186
|
+
div = body = null;
|
187
|
+
}
|
188
|
+
|
189
|
+
})();
|
190
|
+
|
191
|
+
return support;
|
192
|
+
|
193
|
+
});
|
@@ -0,0 +1,28 @@
|
|
1
|
+
define([
|
2
|
+
"../core"
|
3
|
+
], function( jQuery ) {
|
4
|
+
|
5
|
+
// A method for quickly swapping in/out CSS properties to get correct calculations.
|
6
|
+
jQuery.swap = function( elem, options, callback, args ) {
|
7
|
+
var ret, name,
|
8
|
+
old = {};
|
9
|
+
|
10
|
+
// Remember the old values, and insert the new ones
|
11
|
+
for ( name in options ) {
|
12
|
+
old[ name ] = elem.style[ name ];
|
13
|
+
elem.style[ name ] = options[ name ];
|
14
|
+
}
|
15
|
+
|
16
|
+
ret = callback.apply( elem, args || [] );
|
17
|
+
|
18
|
+
// Revert the old values
|
19
|
+
for ( name in options ) {
|
20
|
+
elem.style[ name ] = old[ name ];
|
21
|
+
}
|
22
|
+
|
23
|
+
return ret;
|
24
|
+
};
|
25
|
+
|
26
|
+
return jQuery.swap;
|
27
|
+
|
28
|
+
});
|