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,271 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"../var/rnotwhite",
|
4
|
+
"../var/strundefined",
|
5
|
+
"../core/access",
|
6
|
+
"./support",
|
7
|
+
"./val",
|
8
|
+
"../selector"
|
9
|
+
], function( jQuery, rnotwhite, strundefined, access, support ) {
|
10
|
+
|
11
|
+
var nodeHook, boolHook,
|
12
|
+
attrHandle = jQuery.expr.attrHandle,
|
13
|
+
ruseDefault = /^(?:checked|selected)$/i,
|
14
|
+
getSetAttribute = support.getSetAttribute,
|
15
|
+
getSetInput = support.input;
|
16
|
+
|
17
|
+
jQuery.fn.extend({
|
18
|
+
attr: function( name, value ) {
|
19
|
+
return access( this, jQuery.attr, name, value, arguments.length > 1 );
|
20
|
+
},
|
21
|
+
|
22
|
+
removeAttr: function( name ) {
|
23
|
+
return this.each(function() {
|
24
|
+
jQuery.removeAttr( this, name );
|
25
|
+
});
|
26
|
+
}
|
27
|
+
});
|
28
|
+
|
29
|
+
jQuery.extend({
|
30
|
+
attr: function( elem, name, value ) {
|
31
|
+
var hooks, ret,
|
32
|
+
nType = elem.nodeType;
|
33
|
+
|
34
|
+
// don't get/set attributes on text, comment and attribute nodes
|
35
|
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
36
|
+
return;
|
37
|
+
}
|
38
|
+
|
39
|
+
// Fallback to prop when attributes are not supported
|
40
|
+
if ( typeof elem.getAttribute === strundefined ) {
|
41
|
+
return jQuery.prop( elem, name, value );
|
42
|
+
}
|
43
|
+
|
44
|
+
// All attributes are lowercase
|
45
|
+
// Grab necessary hook if one is defined
|
46
|
+
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
47
|
+
name = name.toLowerCase();
|
48
|
+
hooks = jQuery.attrHooks[ name ] ||
|
49
|
+
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
|
50
|
+
}
|
51
|
+
|
52
|
+
if ( value !== undefined ) {
|
53
|
+
|
54
|
+
if ( value === null ) {
|
55
|
+
jQuery.removeAttr( elem, name );
|
56
|
+
|
57
|
+
} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
58
|
+
return ret;
|
59
|
+
|
60
|
+
} else {
|
61
|
+
elem.setAttribute( name, value + "" );
|
62
|
+
return value;
|
63
|
+
}
|
64
|
+
|
65
|
+
} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
66
|
+
return ret;
|
67
|
+
|
68
|
+
} else {
|
69
|
+
ret = jQuery.find.attr( elem, name );
|
70
|
+
|
71
|
+
// Non-existent attributes return null, we normalize to undefined
|
72
|
+
return ret == null ?
|
73
|
+
undefined :
|
74
|
+
ret;
|
75
|
+
}
|
76
|
+
},
|
77
|
+
|
78
|
+
removeAttr: function( elem, value ) {
|
79
|
+
var name, propName,
|
80
|
+
i = 0,
|
81
|
+
attrNames = value && value.match( rnotwhite );
|
82
|
+
|
83
|
+
if ( attrNames && elem.nodeType === 1 ) {
|
84
|
+
while ( (name = attrNames[i++]) ) {
|
85
|
+
propName = jQuery.propFix[ name ] || name;
|
86
|
+
|
87
|
+
// Boolean attributes get special treatment (#10870)
|
88
|
+
if ( jQuery.expr.match.bool.test( name ) ) {
|
89
|
+
// Set corresponding property to false
|
90
|
+
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
|
91
|
+
elem[ propName ] = false;
|
92
|
+
// Support: IE<9
|
93
|
+
// Also clear defaultChecked/defaultSelected (if appropriate)
|
94
|
+
} else {
|
95
|
+
elem[ jQuery.camelCase( "default-" + name ) ] =
|
96
|
+
elem[ propName ] = false;
|
97
|
+
}
|
98
|
+
|
99
|
+
// See #9699 for explanation of this approach (setting first, then removal)
|
100
|
+
} else {
|
101
|
+
jQuery.attr( elem, name, "" );
|
102
|
+
}
|
103
|
+
|
104
|
+
elem.removeAttribute( getSetAttribute ? name : propName );
|
105
|
+
}
|
106
|
+
}
|
107
|
+
},
|
108
|
+
|
109
|
+
attrHooks: {
|
110
|
+
type: {
|
111
|
+
set: function( elem, value ) {
|
112
|
+
if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
113
|
+
// Setting the type on a radio button after the value resets the value in IE6-9
|
114
|
+
// Reset value to default in case type is set after value during creation
|
115
|
+
var val = elem.value;
|
116
|
+
elem.setAttribute( "type", value );
|
117
|
+
if ( val ) {
|
118
|
+
elem.value = val;
|
119
|
+
}
|
120
|
+
return value;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
});
|
126
|
+
|
127
|
+
// Hook for boolean attributes
|
128
|
+
boolHook = {
|
129
|
+
set: function( elem, value, name ) {
|
130
|
+
if ( value === false ) {
|
131
|
+
// Remove boolean attributes when set to false
|
132
|
+
jQuery.removeAttr( elem, name );
|
133
|
+
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
|
134
|
+
// IE<8 needs the *property* name
|
135
|
+
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
|
136
|
+
|
137
|
+
// Use defaultChecked and defaultSelected for oldIE
|
138
|
+
} else {
|
139
|
+
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
|
140
|
+
}
|
141
|
+
|
142
|
+
return name;
|
143
|
+
}
|
144
|
+
};
|
145
|
+
|
146
|
+
// Retrieve booleans specially
|
147
|
+
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
|
148
|
+
|
149
|
+
var getter = attrHandle[ name ] || jQuery.find.attr;
|
150
|
+
|
151
|
+
attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
|
152
|
+
function( elem, name, isXML ) {
|
153
|
+
var ret, handle;
|
154
|
+
if ( !isXML ) {
|
155
|
+
// Avoid an infinite loop by temporarily removing this function from the getter
|
156
|
+
handle = attrHandle[ name ];
|
157
|
+
attrHandle[ name ] = ret;
|
158
|
+
ret = getter( elem, name, isXML ) != null ?
|
159
|
+
name.toLowerCase() :
|
160
|
+
null;
|
161
|
+
attrHandle[ name ] = handle;
|
162
|
+
}
|
163
|
+
return ret;
|
164
|
+
} :
|
165
|
+
function( elem, name, isXML ) {
|
166
|
+
if ( !isXML ) {
|
167
|
+
return elem[ jQuery.camelCase( "default-" + name ) ] ?
|
168
|
+
name.toLowerCase() :
|
169
|
+
null;
|
170
|
+
}
|
171
|
+
};
|
172
|
+
});
|
173
|
+
|
174
|
+
// fix oldIE attroperties
|
175
|
+
if ( !getSetInput || !getSetAttribute ) {
|
176
|
+
jQuery.attrHooks.value = {
|
177
|
+
set: function( elem, value, name ) {
|
178
|
+
if ( jQuery.nodeName( elem, "input" ) ) {
|
179
|
+
// Does not return so that setAttribute is also used
|
180
|
+
elem.defaultValue = value;
|
181
|
+
} else {
|
182
|
+
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
|
183
|
+
return nodeHook && nodeHook.set( elem, value, name );
|
184
|
+
}
|
185
|
+
}
|
186
|
+
};
|
187
|
+
}
|
188
|
+
|
189
|
+
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
190
|
+
if ( !getSetAttribute ) {
|
191
|
+
|
192
|
+
// Use this for any attribute in IE6/7
|
193
|
+
// This fixes almost every IE6/7 issue
|
194
|
+
nodeHook = {
|
195
|
+
set: function( elem, value, name ) {
|
196
|
+
// Set the existing or create a new attribute node
|
197
|
+
var ret = elem.getAttributeNode( name );
|
198
|
+
if ( !ret ) {
|
199
|
+
elem.setAttributeNode(
|
200
|
+
(ret = elem.ownerDocument.createAttribute( name ))
|
201
|
+
);
|
202
|
+
}
|
203
|
+
|
204
|
+
ret.value = value += "";
|
205
|
+
|
206
|
+
// Break association with cloned elements by also using setAttribute (#9646)
|
207
|
+
if ( name === "value" || value === elem.getAttribute( name ) ) {
|
208
|
+
return value;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
};
|
212
|
+
|
213
|
+
// Some attributes are constructed with empty-string values when not defined
|
214
|
+
attrHandle.id = attrHandle.name = attrHandle.coords =
|
215
|
+
function( elem, name, isXML ) {
|
216
|
+
var ret;
|
217
|
+
if ( !isXML ) {
|
218
|
+
return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
|
219
|
+
ret.value :
|
220
|
+
null;
|
221
|
+
}
|
222
|
+
};
|
223
|
+
|
224
|
+
// Fixing value retrieval on a button requires this module
|
225
|
+
jQuery.valHooks.button = {
|
226
|
+
get: function( elem, name ) {
|
227
|
+
var ret = elem.getAttributeNode( name );
|
228
|
+
if ( ret && ret.specified ) {
|
229
|
+
return ret.value;
|
230
|
+
}
|
231
|
+
},
|
232
|
+
set: nodeHook.set
|
233
|
+
};
|
234
|
+
|
235
|
+
// Set contenteditable to false on removals(#10429)
|
236
|
+
// Setting to empty string throws an error as an invalid value
|
237
|
+
jQuery.attrHooks.contenteditable = {
|
238
|
+
set: function( elem, value, name ) {
|
239
|
+
nodeHook.set( elem, value === "" ? false : value, name );
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
|
244
|
+
// This is for removals
|
245
|
+
jQuery.each([ "width", "height" ], function( i, name ) {
|
246
|
+
jQuery.attrHooks[ name ] = {
|
247
|
+
set: function( elem, value ) {
|
248
|
+
if ( value === "" ) {
|
249
|
+
elem.setAttribute( name, "auto" );
|
250
|
+
return value;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
};
|
254
|
+
});
|
255
|
+
}
|
256
|
+
|
257
|
+
if ( !support.style ) {
|
258
|
+
jQuery.attrHooks.style = {
|
259
|
+
get: function( elem ) {
|
260
|
+
// Return undefined in the case of empty string
|
261
|
+
// Note: IE uppercases css property names, but if we were to .toLowerCase()
|
262
|
+
// .cssText, that would destroy case senstitivity in URL's, like in "background"
|
263
|
+
return elem.style.cssText || undefined;
|
264
|
+
},
|
265
|
+
set: function( elem, value ) {
|
266
|
+
return ( elem.style.cssText = value + "" );
|
267
|
+
}
|
268
|
+
};
|
269
|
+
}
|
270
|
+
|
271
|
+
});
|
@@ -0,0 +1,157 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"../var/rnotwhite",
|
4
|
+
"../var/strundefined",
|
5
|
+
"../core/init"
|
6
|
+
], function( jQuery, rnotwhite, strundefined ) {
|
7
|
+
|
8
|
+
var rclass = /[\t\r\n\f]/g;
|
9
|
+
|
10
|
+
jQuery.fn.extend({
|
11
|
+
addClass: function( value ) {
|
12
|
+
var classes, elem, cur, clazz, j, finalValue,
|
13
|
+
i = 0,
|
14
|
+
len = this.length,
|
15
|
+
proceed = typeof value === "string" && value;
|
16
|
+
|
17
|
+
if ( jQuery.isFunction( value ) ) {
|
18
|
+
return this.each(function( j ) {
|
19
|
+
jQuery( this ).addClass( value.call( this, j, this.className ) );
|
20
|
+
});
|
21
|
+
}
|
22
|
+
|
23
|
+
if ( proceed ) {
|
24
|
+
// The disjunction here is for better compressibility (see removeClass)
|
25
|
+
classes = ( value || "" ).match( rnotwhite ) || [];
|
26
|
+
|
27
|
+
for ( ; i < len; i++ ) {
|
28
|
+
elem = this[ i ];
|
29
|
+
cur = elem.nodeType === 1 && ( elem.className ?
|
30
|
+
( " " + elem.className + " " ).replace( rclass, " " ) :
|
31
|
+
" "
|
32
|
+
);
|
33
|
+
|
34
|
+
if ( cur ) {
|
35
|
+
j = 0;
|
36
|
+
while ( (clazz = classes[j++]) ) {
|
37
|
+
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
|
38
|
+
cur += clazz + " ";
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// only assign if different to avoid unneeded rendering.
|
43
|
+
finalValue = jQuery.trim( cur );
|
44
|
+
if ( elem.className !== finalValue ) {
|
45
|
+
elem.className = finalValue;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return this;
|
52
|
+
},
|
53
|
+
|
54
|
+
removeClass: function( value ) {
|
55
|
+
var classes, elem, cur, clazz, j, finalValue,
|
56
|
+
i = 0,
|
57
|
+
len = this.length,
|
58
|
+
proceed = arguments.length === 0 || typeof value === "string" && value;
|
59
|
+
|
60
|
+
if ( jQuery.isFunction( value ) ) {
|
61
|
+
return this.each(function( j ) {
|
62
|
+
jQuery( this ).removeClass( value.call( this, j, this.className ) );
|
63
|
+
});
|
64
|
+
}
|
65
|
+
if ( proceed ) {
|
66
|
+
classes = ( value || "" ).match( rnotwhite ) || [];
|
67
|
+
|
68
|
+
for ( ; i < len; i++ ) {
|
69
|
+
elem = this[ i ];
|
70
|
+
// This expression is here for better compressibility (see addClass)
|
71
|
+
cur = elem.nodeType === 1 && ( elem.className ?
|
72
|
+
( " " + elem.className + " " ).replace( rclass, " " ) :
|
73
|
+
""
|
74
|
+
);
|
75
|
+
|
76
|
+
if ( cur ) {
|
77
|
+
j = 0;
|
78
|
+
while ( (clazz = classes[j++]) ) {
|
79
|
+
// Remove *all* instances
|
80
|
+
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
|
81
|
+
cur = cur.replace( " " + clazz + " ", " " );
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
// only assign if different to avoid unneeded rendering.
|
86
|
+
finalValue = value ? jQuery.trim( cur ) : "";
|
87
|
+
if ( elem.className !== finalValue ) {
|
88
|
+
elem.className = finalValue;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
return this;
|
95
|
+
},
|
96
|
+
|
97
|
+
toggleClass: function( value, stateVal ) {
|
98
|
+
var type = typeof value;
|
99
|
+
|
100
|
+
if ( typeof stateVal === "boolean" && type === "string" ) {
|
101
|
+
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
102
|
+
}
|
103
|
+
|
104
|
+
if ( jQuery.isFunction( value ) ) {
|
105
|
+
return this.each(function( i ) {
|
106
|
+
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
107
|
+
});
|
108
|
+
}
|
109
|
+
|
110
|
+
return this.each(function() {
|
111
|
+
if ( type === "string" ) {
|
112
|
+
// toggle individual class names
|
113
|
+
var className,
|
114
|
+
i = 0,
|
115
|
+
self = jQuery( this ),
|
116
|
+
classNames = value.match( rnotwhite ) || [];
|
117
|
+
|
118
|
+
while ( (className = classNames[ i++ ]) ) {
|
119
|
+
// check each className given, space separated list
|
120
|
+
if ( self.hasClass( className ) ) {
|
121
|
+
self.removeClass( className );
|
122
|
+
} else {
|
123
|
+
self.addClass( className );
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
// Toggle whole class name
|
128
|
+
} else if ( type === strundefined || type === "boolean" ) {
|
129
|
+
if ( this.className ) {
|
130
|
+
// store className if set
|
131
|
+
jQuery._data( this, "__className__", this.className );
|
132
|
+
}
|
133
|
+
|
134
|
+
// If the element has a class name or if we're passed "false",
|
135
|
+
// then remove the whole classname (if there was one, the above saved it).
|
136
|
+
// Otherwise bring back whatever was previously saved (if anything),
|
137
|
+
// falling back to the empty string if nothing was stored.
|
138
|
+
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
|
139
|
+
}
|
140
|
+
});
|
141
|
+
},
|
142
|
+
|
143
|
+
hasClass: function( selector ) {
|
144
|
+
var className = " " + selector + " ",
|
145
|
+
i = 0,
|
146
|
+
l = this.length;
|
147
|
+
for ( ; i < l; i++ ) {
|
148
|
+
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
|
149
|
+
return true;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
return false;
|
154
|
+
}
|
155
|
+
});
|
156
|
+
|
157
|
+
});
|
@@ -0,0 +1,134 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"../core/access",
|
4
|
+
"./support"
|
5
|
+
], function( jQuery, access, support ) {
|
6
|
+
|
7
|
+
var rfocusable = /^(?:input|select|textarea|button|object)$/i,
|
8
|
+
rclickable = /^(?:a|area)$/i;
|
9
|
+
|
10
|
+
jQuery.fn.extend({
|
11
|
+
prop: function( name, value ) {
|
12
|
+
return access( this, jQuery.prop, name, value, arguments.length > 1 );
|
13
|
+
},
|
14
|
+
|
15
|
+
removeProp: function( name ) {
|
16
|
+
name = jQuery.propFix[ name ] || name;
|
17
|
+
return this.each(function() {
|
18
|
+
// try/catch handles cases where IE balks (such as removing a property on window)
|
19
|
+
try {
|
20
|
+
this[ name ] = undefined;
|
21
|
+
delete this[ name ];
|
22
|
+
} catch( e ) {}
|
23
|
+
});
|
24
|
+
}
|
25
|
+
});
|
26
|
+
|
27
|
+
jQuery.extend({
|
28
|
+
propFix: {
|
29
|
+
"for": "htmlFor",
|
30
|
+
"class": "className"
|
31
|
+
},
|
32
|
+
|
33
|
+
prop: function( elem, name, value ) {
|
34
|
+
var ret, hooks, notxml,
|
35
|
+
nType = elem.nodeType;
|
36
|
+
|
37
|
+
// don't get/set properties on text, comment and attribute nodes
|
38
|
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
|
42
|
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
43
|
+
|
44
|
+
if ( notxml ) {
|
45
|
+
// Fix name and attach hooks
|
46
|
+
name = jQuery.propFix[ name ] || name;
|
47
|
+
hooks = jQuery.propHooks[ name ];
|
48
|
+
}
|
49
|
+
|
50
|
+
if ( value !== undefined ) {
|
51
|
+
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
|
52
|
+
ret :
|
53
|
+
( elem[ name ] = value );
|
54
|
+
|
55
|
+
} else {
|
56
|
+
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
|
57
|
+
ret :
|
58
|
+
elem[ name ];
|
59
|
+
}
|
60
|
+
},
|
61
|
+
|
62
|
+
propHooks: {
|
63
|
+
tabIndex: {
|
64
|
+
get: function( elem ) {
|
65
|
+
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
66
|
+
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
67
|
+
// Use proper attribute retrieval(#12072)
|
68
|
+
var tabindex = jQuery.find.attr( elem, "tabindex" );
|
69
|
+
|
70
|
+
return tabindex ?
|
71
|
+
parseInt( tabindex, 10 ) :
|
72
|
+
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
73
|
+
0 :
|
74
|
+
-1;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
});
|
79
|
+
|
80
|
+
// Some attributes require a special call on IE
|
81
|
+
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
82
|
+
if ( !support.hrefNormalized ) {
|
83
|
+
// href/src property should get the full normalized URL (#10299/#12915)
|
84
|
+
jQuery.each([ "href", "src" ], function( i, name ) {
|
85
|
+
jQuery.propHooks[ name ] = {
|
86
|
+
get: function( elem ) {
|
87
|
+
return elem.getAttribute( name, 4 );
|
88
|
+
}
|
89
|
+
};
|
90
|
+
});
|
91
|
+
}
|
92
|
+
|
93
|
+
// Support: Safari, IE9+
|
94
|
+
// mis-reports the default selected property of an option
|
95
|
+
// Accessing the parent's selectedIndex property fixes it
|
96
|
+
if ( !support.optSelected ) {
|
97
|
+
jQuery.propHooks.selected = {
|
98
|
+
get: function( elem ) {
|
99
|
+
var parent = elem.parentNode;
|
100
|
+
|
101
|
+
if ( parent ) {
|
102
|
+
parent.selectedIndex;
|
103
|
+
|
104
|
+
// Make sure that it also works with optgroups, see #5701
|
105
|
+
if ( parent.parentNode ) {
|
106
|
+
parent.parentNode.selectedIndex;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
return null;
|
110
|
+
}
|
111
|
+
};
|
112
|
+
}
|
113
|
+
|
114
|
+
jQuery.each([
|
115
|
+
"tabIndex",
|
116
|
+
"readOnly",
|
117
|
+
"maxLength",
|
118
|
+
"cellSpacing",
|
119
|
+
"cellPadding",
|
120
|
+
"rowSpan",
|
121
|
+
"colSpan",
|
122
|
+
"useMap",
|
123
|
+
"frameBorder",
|
124
|
+
"contentEditable"
|
125
|
+
], function() {
|
126
|
+
jQuery.propFix[ this.toLowerCase() ] = this;
|
127
|
+
});
|
128
|
+
|
129
|
+
// IE6/7 call enctype encoding
|
130
|
+
if ( !support.enctype ) {
|
131
|
+
jQuery.propFix.enctype = "encoding";
|
132
|
+
}
|
133
|
+
|
134
|
+
});
|