trusty-cms 4.2.2 → 4.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/Gemfile.lock +98 -89
- data/app/assets/config/trusty-cms/manifest.js +7 -0
- data/app/assets/javascripts/admin/custom_file_upload.js +7 -0
- data/app/controllers/admin/assets_controller.rb +1 -1
- data/app/models/page.rb +2 -2
- data/app/views/admin/assets/new.html.haml +2 -0
- data/config/database.yml +4 -0
- data/config/initializers/assets.rb +0 -4
- data/coverage/index.html +155 -155
- data/lib/trusty_cms.rb +1 -1
- data/node_modules/hosted-git-info/CHANGELOG.md +10 -0
- data/node_modules/hosted-git-info/index.js +2 -2
- data/node_modules/hosted-git-info/package.json +1 -1
- data/node_modules/lodash/README.md +2 -2
- data/node_modules/lodash/_baseClone.js +2 -1
- data/node_modules/lodash/_baseOrderBy.js +17 -2
- data/node_modules/lodash/_baseSet.js +4 -0
- data/node_modules/lodash/_baseSortedIndexBy.js +7 -4
- data/node_modules/lodash/_baseTrim.js +19 -0
- data/node_modules/lodash/_equalArrays.js +5 -4
- data/node_modules/lodash/_equalObjects.js +5 -4
- data/node_modules/lodash/_trimmedEndIndex.js +19 -0
- data/node_modules/lodash/core.js +48 -6
- data/node_modules/lodash/core.min.js +9 -9
- data/node_modules/lodash/filter.js +4 -0
- data/node_modules/lodash/flake.lock +40 -0
- data/node_modules/lodash/flake.nix +20 -0
- data/node_modules/lodash/lodash.js +59 -11
- data/node_modules/lodash/lodash.min.js +126 -125
- data/node_modules/lodash/matches.js +7 -0
- data/node_modules/lodash/matchesProperty.js +7 -0
- data/node_modules/lodash/overEvery.js +4 -0
- data/node_modules/lodash/overSome.js +7 -0
- data/node_modules/lodash/package.json +1 -1
- data/node_modules/lodash/parseInt.js +1 -1
- data/node_modules/lodash/release.md +48 -0
- data/node_modules/lodash/sortBy.js +3 -3
- data/node_modules/lodash/template.js +24 -5
- data/node_modules/lodash/toNumber.js +3 -5
- data/node_modules/lodash/trim.js +2 -4
- data/node_modules/lodash/trimEnd.js +3 -5
- data/node_modules/lodash/trimStart.js +1 -1
- data/spec/dummy/log/development.log +9 -163
- data/spec/dummy/log/test.log +536 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/AUTHORS.txt +333 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/LICENSE.txt +43 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/external/jquery/jquery.js +11008 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_444444_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_555555_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777620_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777777_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_cc0000_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_ffffff_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/index.html +559 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.css +1312 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.js +18706 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.css +7 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.js +13 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.css +886 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.min.css +5 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.css +443 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.min.css +5 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/package.json +33 -0
- data/spec/dummy/node_modules/jquery-ujs/CONTRIBUTING.md +109 -0
- data/spec/dummy/node_modules/jquery-ujs/MIT-LICENSE +20 -0
- data/spec/dummy/node_modules/jquery-ujs/README.md +86 -0
- data/spec/dummy/node_modules/jquery-ujs/RELEASE.md +23 -0
- data/spec/dummy/node_modules/jquery-ujs/bower.json +19 -0
- data/spec/dummy/node_modules/jquery-ujs/package.json +26 -0
- data/spec/dummy/node_modules/jquery-ujs/src/rails.js +555 -0
- data/spec/dummy/node_modules/jquery/AUTHORS.txt +327 -0
- data/spec/dummy/node_modules/jquery/LICENSE.txt +20 -0
- data/spec/dummy/node_modules/jquery/README.md +62 -0
- data/spec/dummy/node_modules/jquery/bower.json +14 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.js +10872 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.min.js +2 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.min.map +1 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.slim.js +8777 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.js +2 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.map +1 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.js +2478 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/spec/dummy/node_modules/jquery/package.json +117 -0
- data/spec/dummy/node_modules/jquery/src/ajax.js +873 -0
- data/spec/dummy/node_modules/jquery/src/ajax/jsonp.js +103 -0
- data/spec/dummy/node_modules/jquery/src/ajax/load.js +77 -0
- data/spec/dummy/node_modules/jquery/src/ajax/script.js +74 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/location.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/rquery.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/xhr.js +170 -0
- data/spec/dummy/node_modules/jquery/src/attributes.js +13 -0
- data/spec/dummy/node_modules/jquery/src/attributes/attr.js +141 -0
- data/spec/dummy/node_modules/jquery/src/attributes/classes.js +186 -0
- data/spec/dummy/node_modules/jquery/src/attributes/prop.js +143 -0
- data/spec/dummy/node_modules/jquery/src/attributes/support.js +33 -0
- data/spec/dummy/node_modules/jquery/src/attributes/val.js +191 -0
- data/spec/dummy/node_modules/jquery/src/callbacks.js +236 -0
- data/spec/dummy/node_modules/jquery/src/core.js +400 -0
- data/spec/dummy/node_modules/jquery/src/core/DOMEval.js +43 -0
- data/spec/dummy/node_modules/jquery/src/core/access.js +72 -0
- data/spec/dummy/node_modules/jquery/src/core/camelCase.js +23 -0
- data/spec/dummy/node_modules/jquery/src/core/init.js +129 -0
- data/spec/dummy/node_modules/jquery/src/core/isAttached.js +26 -0
- data/spec/dummy/node_modules/jquery/src/core/nodeName.js +13 -0
- data/spec/dummy/node_modules/jquery/src/core/parseHTML.js +65 -0
- data/spec/dummy/node_modules/jquery/src/core/parseXML.js +30 -0
- data/spec/dummy/node_modules/jquery/src/core/ready-no-deferred.js +97 -0
- data/spec/dummy/node_modules/jquery/src/core/ready.js +86 -0
- data/spec/dummy/node_modules/jquery/src/core/readyException.js +13 -0
- data/spec/dummy/node_modules/jquery/src/core/stripAndCollapse.js +14 -0
- data/spec/dummy/node_modules/jquery/src/core/support.js +20 -0
- data/spec/dummy/node_modules/jquery/src/core/toType.js +20 -0
- data/spec/dummy/node_modules/jquery/src/core/var/rsingleTag.js +7 -0
- data/spec/dummy/node_modules/jquery/src/css.js +494 -0
- data/spec/dummy/node_modules/jquery/src/css/addGetHookIf.js +26 -0
- data/spec/dummy/node_modules/jquery/src/css/adjustCSS.js +74 -0
- data/spec/dummy/node_modules/jquery/src/css/curCSS.js +65 -0
- data/spec/dummy/node_modules/jquery/src/css/finalPropName.js +42 -0
- data/spec/dummy/node_modules/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/spec/dummy/node_modules/jquery/src/css/showHide.js +105 -0
- data/spec/dummy/node_modules/jquery/src/css/support.js +133 -0
- data/spec/dummy/node_modules/jquery/src/css/var/cssExpand.js +5 -0
- data/spec/dummy/node_modules/jquery/src/css/var/getStyles.js +17 -0
- data/spec/dummy/node_modules/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/spec/dummy/node_modules/jquery/src/css/var/rboxStyle.js +7 -0
- data/spec/dummy/node_modules/jquery/src/css/var/rnumnonpx.js +7 -0
- data/spec/dummy/node_modules/jquery/src/css/var/swap.js +26 -0
- data/spec/dummy/node_modules/jquery/src/data.js +180 -0
- data/spec/dummy/node_modules/jquery/src/data/Data.js +162 -0
- data/spec/dummy/node_modules/jquery/src/data/var/acceptData.js +19 -0
- data/spec/dummy/node_modules/jquery/src/data/var/dataPriv.js +7 -0
- data/spec/dummy/node_modules/jquery/src/data/var/dataUser.js +7 -0
- data/spec/dummy/node_modules/jquery/src/deferred.js +399 -0
- data/spec/dummy/node_modules/jquery/src/deferred/exceptionHook.js +21 -0
- data/spec/dummy/node_modules/jquery/src/deprecated.js +87 -0
- data/spec/dummy/node_modules/jquery/src/deprecated/ajax-event-alias.js +22 -0
- data/spec/dummy/node_modules/jquery/src/deprecated/event.js +48 -0
- data/spec/dummy/node_modules/jquery/src/dimensions.js +57 -0
- data/spec/dummy/node_modules/jquery/src/effects.js +701 -0
- data/spec/dummy/node_modules/jquery/src/effects/Tween.js +125 -0
- data/spec/dummy/node_modules/jquery/src/effects/animatedSelector.js +15 -0
- data/spec/dummy/node_modules/jquery/src/event.js +892 -0
- data/spec/dummy/node_modules/jquery/src/event/focusin.js +58 -0
- data/spec/dummy/node_modules/jquery/src/event/support.js +11 -0
- data/spec/dummy/node_modules/jquery/src/event/trigger.js +201 -0
- data/spec/dummy/node_modules/jquery/src/exports/amd.js +26 -0
- data/spec/dummy/node_modules/jquery/src/exports/global.js +34 -0
- data/spec/dummy/node_modules/jquery/src/jquery.js +41 -0
- data/spec/dummy/node_modules/jquery/src/manipulation.js +480 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/_evalUrl.js +32 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/buildFragment.js +106 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/getAll.js +32 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/support.js +41 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rtagName.js +8 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
- data/spec/dummy/node_modules/jquery/src/offset.js +238 -0
- data/spec/dummy/node_modules/jquery/src/queue.js +145 -0
- data/spec/dummy/node_modules/jquery/src/queue/delay.js +24 -0
- data/spec/dummy/node_modules/jquery/src/selector-native.js +241 -0
- data/spec/dummy/node_modules/jquery/src/selector-sizzle.js +19 -0
- data/spec/dummy/node_modules/jquery/src/selector.js +3 -0
- data/spec/dummy/node_modules/jquery/src/serialize.js +136 -0
- data/spec/dummy/node_modules/jquery/src/traversing.js +198 -0
- data/spec/dummy/node_modules/jquery/src/traversing/findFilter.js +97 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/dir.js +22 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/siblings.js +17 -0
- data/spec/dummy/node_modules/jquery/src/var/ObjectFunctionString.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/arr.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/class2type.js +6 -0
- data/spec/dummy/node_modules/jquery/src/var/document.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/documentElement.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/flat.js +16 -0
- data/spec/dummy/node_modules/jquery/src/var/fnToString.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/getProto.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/hasOwn.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/indexOf.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/isFunction.js +13 -0
- data/spec/dummy/node_modules/jquery/src/var/isWindow.js +8 -0
- data/spec/dummy/node_modules/jquery/src/var/pnum.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/push.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/rcheckableType.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/rcssNum.js +9 -0
- data/spec/dummy/node_modules/jquery/src/var/rnothtmlwhite.js +8 -0
- data/spec/dummy/node_modules/jquery/src/var/slice.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/support.js +6 -0
- data/spec/dummy/node_modules/jquery/src/var/toString.js +7 -0
- data/spec/dummy/node_modules/jquery/src/wrap.js +78 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +5 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +1 -0
- data/trusty_cms.gemspec +3 -2
- data/yarn.lock +9 -9
- metadata +354 -50
@@ -0,0 +1,141 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../core/access",
|
4
|
+
"../core/nodeName",
|
5
|
+
"./support",
|
6
|
+
"../var/rnothtmlwhite",
|
7
|
+
"../selector"
|
8
|
+
], function( jQuery, access, nodeName, support, rnothtmlwhite ) {
|
9
|
+
|
10
|
+
"use strict";
|
11
|
+
|
12
|
+
var boolHook,
|
13
|
+
attrHandle = jQuery.expr.attrHandle;
|
14
|
+
|
15
|
+
jQuery.fn.extend( {
|
16
|
+
attr: function( name, value ) {
|
17
|
+
return access( this, jQuery.attr, name, value, arguments.length > 1 );
|
18
|
+
},
|
19
|
+
|
20
|
+
removeAttr: function( name ) {
|
21
|
+
return this.each( function() {
|
22
|
+
jQuery.removeAttr( this, name );
|
23
|
+
} );
|
24
|
+
}
|
25
|
+
} );
|
26
|
+
|
27
|
+
jQuery.extend( {
|
28
|
+
attr: function( elem, name, value ) {
|
29
|
+
var ret, hooks,
|
30
|
+
nType = elem.nodeType;
|
31
|
+
|
32
|
+
// Don't get/set attributes on text, comment and attribute nodes
|
33
|
+
if ( nType === 3 || nType === 8 || nType === 2 ) {
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
|
37
|
+
// Fallback to prop when attributes are not supported
|
38
|
+
if ( typeof elem.getAttribute === "undefined" ) {
|
39
|
+
return jQuery.prop( elem, name, value );
|
40
|
+
}
|
41
|
+
|
42
|
+
// Attribute hooks are determined by the lowercase version
|
43
|
+
// Grab necessary hook if one is defined
|
44
|
+
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
45
|
+
hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
|
46
|
+
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
|
47
|
+
}
|
48
|
+
|
49
|
+
if ( value !== undefined ) {
|
50
|
+
if ( value === null ) {
|
51
|
+
jQuery.removeAttr( elem, name );
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
|
55
|
+
if ( hooks && "set" in hooks &&
|
56
|
+
( ret = hooks.set( elem, value, name ) ) !== undefined ) {
|
57
|
+
return ret;
|
58
|
+
}
|
59
|
+
|
60
|
+
elem.setAttribute( name, value + "" );
|
61
|
+
return value;
|
62
|
+
}
|
63
|
+
|
64
|
+
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
|
65
|
+
return ret;
|
66
|
+
}
|
67
|
+
|
68
|
+
ret = jQuery.find.attr( elem, name );
|
69
|
+
|
70
|
+
// Non-existent attributes return null, we normalize to undefined
|
71
|
+
return ret == null ? undefined : ret;
|
72
|
+
},
|
73
|
+
|
74
|
+
attrHooks: {
|
75
|
+
type: {
|
76
|
+
set: function( elem, value ) {
|
77
|
+
if ( !support.radioValue && value === "radio" &&
|
78
|
+
nodeName( elem, "input" ) ) {
|
79
|
+
var val = elem.value;
|
80
|
+
elem.setAttribute( "type", value );
|
81
|
+
if ( val ) {
|
82
|
+
elem.value = val;
|
83
|
+
}
|
84
|
+
return value;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
},
|
89
|
+
|
90
|
+
removeAttr: function( elem, value ) {
|
91
|
+
var name,
|
92
|
+
i = 0,
|
93
|
+
|
94
|
+
// Attribute names can contain non-HTML whitespace characters
|
95
|
+
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
96
|
+
attrNames = value && value.match( rnothtmlwhite );
|
97
|
+
|
98
|
+
if ( attrNames && elem.nodeType === 1 ) {
|
99
|
+
while ( ( name = attrNames[ i++ ] ) ) {
|
100
|
+
elem.removeAttribute( name );
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
} );
|
105
|
+
|
106
|
+
// Hooks for boolean attributes
|
107
|
+
boolHook = {
|
108
|
+
set: function( elem, value, name ) {
|
109
|
+
if ( value === false ) {
|
110
|
+
|
111
|
+
// Remove boolean attributes when set to false
|
112
|
+
jQuery.removeAttr( elem, name );
|
113
|
+
} else {
|
114
|
+
elem.setAttribute( name, name );
|
115
|
+
}
|
116
|
+
return name;
|
117
|
+
}
|
118
|
+
};
|
119
|
+
|
120
|
+
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
|
121
|
+
var getter = attrHandle[ name ] || jQuery.find.attr;
|
122
|
+
|
123
|
+
attrHandle[ name ] = function( elem, name, isXML ) {
|
124
|
+
var ret, handle,
|
125
|
+
lowercaseName = name.toLowerCase();
|
126
|
+
|
127
|
+
if ( !isXML ) {
|
128
|
+
|
129
|
+
// Avoid an infinite loop by temporarily removing this function from the getter
|
130
|
+
handle = attrHandle[ lowercaseName ];
|
131
|
+
attrHandle[ lowercaseName ] = ret;
|
132
|
+
ret = getter( elem, name, isXML ) != null ?
|
133
|
+
lowercaseName :
|
134
|
+
null;
|
135
|
+
attrHandle[ lowercaseName ] = handle;
|
136
|
+
}
|
137
|
+
return ret;
|
138
|
+
};
|
139
|
+
} );
|
140
|
+
|
141
|
+
} );
|
@@ -0,0 +1,186 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../core/stripAndCollapse",
|
4
|
+
"../var/isFunction",
|
5
|
+
"../var/rnothtmlwhite",
|
6
|
+
"../data/var/dataPriv",
|
7
|
+
"../core/init"
|
8
|
+
], function( jQuery, stripAndCollapse, isFunction, rnothtmlwhite, dataPriv ) {
|
9
|
+
|
10
|
+
"use strict";
|
11
|
+
|
12
|
+
function getClass( elem ) {
|
13
|
+
return elem.getAttribute && elem.getAttribute( "class" ) || "";
|
14
|
+
}
|
15
|
+
|
16
|
+
function classesToArray( value ) {
|
17
|
+
if ( Array.isArray( value ) ) {
|
18
|
+
return value;
|
19
|
+
}
|
20
|
+
if ( typeof value === "string" ) {
|
21
|
+
return value.match( rnothtmlwhite ) || [];
|
22
|
+
}
|
23
|
+
return [];
|
24
|
+
}
|
25
|
+
|
26
|
+
jQuery.fn.extend( {
|
27
|
+
addClass: function( value ) {
|
28
|
+
var classes, elem, cur, curValue, clazz, j, finalValue,
|
29
|
+
i = 0;
|
30
|
+
|
31
|
+
if ( isFunction( value ) ) {
|
32
|
+
return this.each( function( j ) {
|
33
|
+
jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
|
34
|
+
} );
|
35
|
+
}
|
36
|
+
|
37
|
+
classes = classesToArray( value );
|
38
|
+
|
39
|
+
if ( classes.length ) {
|
40
|
+
while ( ( elem = this[ i++ ] ) ) {
|
41
|
+
curValue = getClass( elem );
|
42
|
+
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
43
|
+
|
44
|
+
if ( cur ) {
|
45
|
+
j = 0;
|
46
|
+
while ( ( clazz = classes[ j++ ] ) ) {
|
47
|
+
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
|
48
|
+
cur += clazz + " ";
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// Only assign if different to avoid unneeded rendering.
|
53
|
+
finalValue = stripAndCollapse( cur );
|
54
|
+
if ( curValue !== finalValue ) {
|
55
|
+
elem.setAttribute( "class", finalValue );
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
return this;
|
62
|
+
},
|
63
|
+
|
64
|
+
removeClass: function( value ) {
|
65
|
+
var classes, elem, cur, curValue, clazz, j, finalValue,
|
66
|
+
i = 0;
|
67
|
+
|
68
|
+
if ( isFunction( value ) ) {
|
69
|
+
return this.each( function( j ) {
|
70
|
+
jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
|
71
|
+
} );
|
72
|
+
}
|
73
|
+
|
74
|
+
if ( !arguments.length ) {
|
75
|
+
return this.attr( "class", "" );
|
76
|
+
}
|
77
|
+
|
78
|
+
classes = classesToArray( value );
|
79
|
+
|
80
|
+
if ( classes.length ) {
|
81
|
+
while ( ( elem = this[ i++ ] ) ) {
|
82
|
+
curValue = getClass( elem );
|
83
|
+
|
84
|
+
// This expression is here for better compressibility (see addClass)
|
85
|
+
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
86
|
+
|
87
|
+
if ( cur ) {
|
88
|
+
j = 0;
|
89
|
+
while ( ( clazz = classes[ j++ ] ) ) {
|
90
|
+
|
91
|
+
// Remove *all* instances
|
92
|
+
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
|
93
|
+
cur = cur.replace( " " + clazz + " ", " " );
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// Only assign if different to avoid unneeded rendering.
|
98
|
+
finalValue = stripAndCollapse( cur );
|
99
|
+
if ( curValue !== finalValue ) {
|
100
|
+
elem.setAttribute( "class", finalValue );
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
return this;
|
107
|
+
},
|
108
|
+
|
109
|
+
toggleClass: function( value, stateVal ) {
|
110
|
+
var type = typeof value,
|
111
|
+
isValidValue = type === "string" || Array.isArray( value );
|
112
|
+
|
113
|
+
if ( typeof stateVal === "boolean" && isValidValue ) {
|
114
|
+
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
115
|
+
}
|
116
|
+
|
117
|
+
if ( isFunction( value ) ) {
|
118
|
+
return this.each( function( i ) {
|
119
|
+
jQuery( this ).toggleClass(
|
120
|
+
value.call( this, i, getClass( this ), stateVal ),
|
121
|
+
stateVal
|
122
|
+
);
|
123
|
+
} );
|
124
|
+
}
|
125
|
+
|
126
|
+
return this.each( function() {
|
127
|
+
var className, i, self, classNames;
|
128
|
+
|
129
|
+
if ( isValidValue ) {
|
130
|
+
|
131
|
+
// Toggle individual class names
|
132
|
+
i = 0;
|
133
|
+
self = jQuery( this );
|
134
|
+
classNames = classesToArray( value );
|
135
|
+
|
136
|
+
while ( ( className = classNames[ i++ ] ) ) {
|
137
|
+
|
138
|
+
// Check each className given, space separated list
|
139
|
+
if ( self.hasClass( className ) ) {
|
140
|
+
self.removeClass( className );
|
141
|
+
} else {
|
142
|
+
self.addClass( className );
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
// Toggle whole class name
|
147
|
+
} else if ( value === undefined || type === "boolean" ) {
|
148
|
+
className = getClass( this );
|
149
|
+
if ( className ) {
|
150
|
+
|
151
|
+
// Store className if set
|
152
|
+
dataPriv.set( this, "__className__", className );
|
153
|
+
}
|
154
|
+
|
155
|
+
// If the element has a class name or if we're passed `false`,
|
156
|
+
// then remove the whole classname (if there was one, the above saved it).
|
157
|
+
// Otherwise bring back whatever was previously saved (if anything),
|
158
|
+
// falling back to the empty string if nothing was stored.
|
159
|
+
if ( this.setAttribute ) {
|
160
|
+
this.setAttribute( "class",
|
161
|
+
className || value === false ?
|
162
|
+
"" :
|
163
|
+
dataPriv.get( this, "__className__" ) || ""
|
164
|
+
);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
} );
|
168
|
+
},
|
169
|
+
|
170
|
+
hasClass: function( selector ) {
|
171
|
+
var className, elem,
|
172
|
+
i = 0;
|
173
|
+
|
174
|
+
className = " " + selector + " ";
|
175
|
+
while ( ( elem = this[ i++ ] ) ) {
|
176
|
+
if ( elem.nodeType === 1 &&
|
177
|
+
( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
|
178
|
+
return true;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
return false;
|
183
|
+
}
|
184
|
+
} );
|
185
|
+
|
186
|
+
} );
|
@@ -0,0 +1,143 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../core/access",
|
4
|
+
"./support",
|
5
|
+
"../selector"
|
6
|
+
], function( jQuery, access, support ) {
|
7
|
+
|
8
|
+
"use strict";
|
9
|
+
|
10
|
+
var rfocusable = /^(?:input|select|textarea|button)$/i,
|
11
|
+
rclickable = /^(?:a|area)$/i;
|
12
|
+
|
13
|
+
jQuery.fn.extend( {
|
14
|
+
prop: function( name, value ) {
|
15
|
+
return access( this, jQuery.prop, name, value, arguments.length > 1 );
|
16
|
+
},
|
17
|
+
|
18
|
+
removeProp: function( name ) {
|
19
|
+
return this.each( function() {
|
20
|
+
delete this[ jQuery.propFix[ name ] || name ];
|
21
|
+
} );
|
22
|
+
}
|
23
|
+
} );
|
24
|
+
|
25
|
+
jQuery.extend( {
|
26
|
+
prop: function( elem, name, value ) {
|
27
|
+
var ret, hooks,
|
28
|
+
nType = elem.nodeType;
|
29
|
+
|
30
|
+
// Don't get/set properties on text, comment and attribute nodes
|
31
|
+
if ( nType === 3 || nType === 8 || nType === 2 ) {
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
|
35
|
+
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
36
|
+
|
37
|
+
// Fix name and attach hooks
|
38
|
+
name = jQuery.propFix[ name ] || name;
|
39
|
+
hooks = jQuery.propHooks[ name ];
|
40
|
+
}
|
41
|
+
|
42
|
+
if ( value !== undefined ) {
|
43
|
+
if ( hooks && "set" in hooks &&
|
44
|
+
( ret = hooks.set( elem, value, name ) ) !== undefined ) {
|
45
|
+
return ret;
|
46
|
+
}
|
47
|
+
|
48
|
+
return ( elem[ name ] = value );
|
49
|
+
}
|
50
|
+
|
51
|
+
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
|
52
|
+
return ret;
|
53
|
+
}
|
54
|
+
|
55
|
+
return elem[ name ];
|
56
|
+
},
|
57
|
+
|
58
|
+
propHooks: {
|
59
|
+
tabIndex: {
|
60
|
+
get: function( elem ) {
|
61
|
+
|
62
|
+
// Support: IE <=9 - 11 only
|
63
|
+
// elem.tabIndex doesn't always return the
|
64
|
+
// correct value when it hasn't been explicitly set
|
65
|
+
// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
66
|
+
// Use proper attribute retrieval(#12072)
|
67
|
+
var tabindex = jQuery.find.attr( elem, "tabindex" );
|
68
|
+
|
69
|
+
if ( tabindex ) {
|
70
|
+
return parseInt( tabindex, 10 );
|
71
|
+
}
|
72
|
+
|
73
|
+
if (
|
74
|
+
rfocusable.test( elem.nodeName ) ||
|
75
|
+
rclickable.test( elem.nodeName ) &&
|
76
|
+
elem.href
|
77
|
+
) {
|
78
|
+
return 0;
|
79
|
+
}
|
80
|
+
|
81
|
+
return -1;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
},
|
85
|
+
|
86
|
+
propFix: {
|
87
|
+
"for": "htmlFor",
|
88
|
+
"class": "className"
|
89
|
+
}
|
90
|
+
} );
|
91
|
+
|
92
|
+
// Support: IE <=11 only
|
93
|
+
// Accessing the selectedIndex property
|
94
|
+
// forces the browser to respect setting selected
|
95
|
+
// on the option
|
96
|
+
// The getter ensures a default option is selected
|
97
|
+
// when in an optgroup
|
98
|
+
// eslint rule "no-unused-expressions" is disabled for this code
|
99
|
+
// since it considers such accessions noop
|
100
|
+
if ( !support.optSelected ) {
|
101
|
+
jQuery.propHooks.selected = {
|
102
|
+
get: function( elem ) {
|
103
|
+
|
104
|
+
/* eslint no-unused-expressions: "off" */
|
105
|
+
|
106
|
+
var parent = elem.parentNode;
|
107
|
+
if ( parent && parent.parentNode ) {
|
108
|
+
parent.parentNode.selectedIndex;
|
109
|
+
}
|
110
|
+
return null;
|
111
|
+
},
|
112
|
+
set: function( elem ) {
|
113
|
+
|
114
|
+
/* eslint no-unused-expressions: "off" */
|
115
|
+
|
116
|
+
var parent = elem.parentNode;
|
117
|
+
if ( parent ) {
|
118
|
+
parent.selectedIndex;
|
119
|
+
|
120
|
+
if ( parent.parentNode ) {
|
121
|
+
parent.parentNode.selectedIndex;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
};
|
126
|
+
}
|
127
|
+
|
128
|
+
jQuery.each( [
|
129
|
+
"tabIndex",
|
130
|
+
"readOnly",
|
131
|
+
"maxLength",
|
132
|
+
"cellSpacing",
|
133
|
+
"cellPadding",
|
134
|
+
"rowSpan",
|
135
|
+
"colSpan",
|
136
|
+
"useMap",
|
137
|
+
"frameBorder",
|
138
|
+
"contentEditable"
|
139
|
+
], function() {
|
140
|
+
jQuery.propFix[ this.toLowerCase() ] = this;
|
141
|
+
} );
|
142
|
+
|
143
|
+
} );
|