epuber 0.5.7 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -2
- data/README.md +20 -26
- data/bin/epuber +2 -3
- data/epuber.gemspec +10 -12
- data/lib/epuber/book/contributor.rb +1 -1
- data/lib/epuber/book/file_request.rb +1 -1
- data/lib/epuber/book/target.rb +1 -2
- data/lib/epuber/book/toc_item.rb +1 -2
- data/lib/epuber/book.rb +1 -2
- data/lib/epuber/checker/text_checker.rb +1 -1
- data/lib/epuber/checker.rb +1 -2
- data/lib/epuber/checker_transformer_base.rb +1 -0
- data/lib/epuber/command/build.rb +1 -2
- data/lib/epuber/command/compile.rb +1 -1
- data/lib/epuber/command/init.rb +1 -2
- data/lib/epuber/command/server.rb +1 -2
- data/lib/epuber/command.rb +1 -1
- data/lib/epuber/compiler/compilation_context.rb +1 -1
- data/lib/epuber/compiler/file_database.rb +3 -5
- data/lib/epuber/compiler/file_finders/abstract.rb +1 -1
- data/lib/epuber/compiler/file_finders/imaginary.rb +1 -2
- data/lib/epuber/compiler/file_finders/normal.rb +1 -1
- data/lib/epuber/compiler/file_resolver.rb +1 -2
- data/lib/epuber/compiler/file_stat.rb +0 -1
- data/lib/epuber/compiler/file_types/abstract_file.rb +1 -2
- data/lib/epuber/compiler/file_types/bade_file.rb +1 -2
- data/lib/epuber/compiler/file_types/coffee_script_file.rb +1 -2
- data/lib/epuber/compiler/file_types/container_xml_file.rb +1 -2
- data/lib/epuber/compiler/file_types/generated_file.rb +1 -2
- data/lib/epuber/compiler/file_types/ibooks_display_options_file.rb +1 -7
- data/lib/epuber/compiler/file_types/image_file.rb +1 -2
- data/lib/epuber/compiler/file_types/mime_type_file.rb +1 -2
- data/lib/epuber/compiler/file_types/nav_file.rb +1 -2
- data/lib/epuber/compiler/file_types/opf_file.rb +1 -2
- data/lib/epuber/compiler/file_types/source_file.rb +1 -2
- data/lib/epuber/compiler/file_types/static_file.rb +1 -2
- data/lib/epuber/compiler/file_types/stylus_file.rb +1 -2
- data/lib/epuber/compiler/file_types/xhtml_file.rb +2 -4
- data/lib/epuber/compiler/generator.rb +1 -1
- data/lib/epuber/compiler/meta_inf_generator.rb +1 -1
- data/lib/epuber/compiler/nav_generator.rb +1 -1
- data/lib/epuber/compiler/opf_generator.rb +1 -1
- data/lib/epuber/compiler/problem.rb +1 -2
- data/lib/epuber/compiler/xhtml_processor.rb +6 -6
- data/lib/epuber/compiler.rb +7 -11
- data/lib/epuber/config.rb +3 -4
- data/lib/epuber/dsl/attribute.rb +1 -1
- data/lib/epuber/dsl/attribute_support.rb +2 -2
- data/lib/epuber/dsl/object.rb +1 -1
- data/lib/epuber/dsl/tree_object.rb +1 -1
- data/lib/epuber/helper.rb +1 -1
- data/lib/epuber/lockfile.rb +1 -1
- data/lib/epuber/plugin.rb +1 -1
- data/lib/epuber/ruby_extensions/match_data.rb +1 -0
- data/lib/epuber/ruby_extensions/thread.rb +1 -0
- data/lib/epuber/server/handlers.rb +1 -1
- data/lib/epuber/server.rb +3 -2
- data/lib/epuber/templates.rb +2 -1
- data/lib/epuber/third_party/bower/bower.json +3 -3
- data/lib/epuber/third_party/bower/bower_components/cookies-js/bower.json +1 -1
- data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.js +2 -3
- data/lib/epuber/third_party/bower/bower_components/cookies-js/dist/cookies.min.js +6 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/AUTHORS.txt +278 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/{MIT-LICENSE.txt → LICENSE.txt} +17 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/README.md +65 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/bower.json +2 -16
- data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.js +2566 -1962
- data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.js +4 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/dist/jquery.min.map +1 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/LICENSE.txt +36 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/{src → external}/sizzle/dist/sizzle.js +236 -160
- data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/jsonp.js +25 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/load.js +20 -12
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseJSON.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/parseXML.js +4 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js +16 -12
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/location.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/nonce.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/var/rquery.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax/xhr.js +73 -42
- data/lib/epuber/third_party/bower/bower_components/jquery/src/ajax.js +116 -57
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/attr.js +49 -48
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/classes.js +86 -67
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/prop.js +63 -32
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/support.js +6 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes/val.js +40 -24
- data/lib/epuber/third_party/bower/bower_components/jquery/src/attributes.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/callbacks.js +114 -87
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/access.js +11 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/init.js +27 -16
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/parseHTML.js +10 -8
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/ready.js +20 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core/var/rsingleTag.js +4 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/core.js +77 -85
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/addGetHookIf.js +5 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/adjustCSS.js +65 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/curCSS.js +20 -17
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/defaultDisplay.js +16 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/hiddenVisibleSelectors.js +9 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/showHide.js +48 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/support.js +86 -61
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/cssExpand.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/getStyles.js +8 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/isHidden.js +6 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rmargin.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/var/rnumnonpx.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css/{swap.js → var/swap.js} +3 -7
- data/lib/epuber/third_party/bower/bower_components/jquery/src/css.js +107 -55
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/Data.js +93 -74
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/{accepts.js → var/acceptData.js} +4 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_priv.js → dataPriv.js} +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data/var/{data_user.js → dataUser.js} +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/data.js +49 -40
- data/lib/epuber/third_party/bower/bower_components/jquery/src/deferred.js +34 -25
- data/lib/epuber/third_party/bower/bower_components/jquery/src/deprecated.js +27 -8
- data/lib/epuber/third_party/bower/bower_components/jquery/src/dimensions.js +9 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/Tween.js +14 -7
- data/lib/epuber/third_party/bower/bower_components/jquery/src/effects/animatedSelector.js +4 -4
- data/lib/epuber/third_party/bower/bower_components/jquery/src/effects.js +96 -115
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/ajax.js +11 -4
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/alias.js +11 -23
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/focusin.js +53 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/support.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event/trigger.js +183 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/event.js +168 -325
- data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/amd.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/exports/global.js +2 -8
- data/lib/epuber/third_party/bower/bower_components/jquery/src/intro.js +1 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/src/jquery.js +5 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/_evalUrl.js +6 -4
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/getAll.js +21 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/support.js +7 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/manipulation.js +206 -305
- data/lib/epuber/third_party/bower/bower_components/jquery/src/offset.js +40 -29
- data/lib/epuber/third_party/bower/bower_components/jquery/src/outro.js +1 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/queue/delay.js +6 -6
- data/lib/epuber/third_party/bower/bower_components/jquery/src/queue.js +23 -22
- data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-native.js +107 -68
- data/lib/epuber/third_party/bower/bower_components/jquery/src/selector-sizzle.js +5 -5
- data/lib/epuber/third_party/bower/bower_components/jquery/src/selector.js +1 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/src/serialize.js +28 -14
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/findFilter.js +13 -13
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/dir.js +20 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/rneedsContext.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing/var/siblings.js +15 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/traversing.js +32 -56
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/arr.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/class2type.js +3 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/concat.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/document.js +3 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/documentElement.js +5 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/hasOwn.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/indexOf.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/pnum.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/push.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rcssNum.js +7 -0
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/rnotwhite.js +3 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/slice.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/support.js +3 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/toString.js +2 -2
- data/lib/epuber/third_party/bower/bower_components/jquery/src/wrap.js +19 -19
- data/lib/epuber/third_party/bower/bower_components/spin.js/{LICENSE.txt → LICENSE.md} +2 -1
- data/lib/epuber/third_party/bower/bower_components/spin.js/README.md +21 -21
- data/lib/epuber/third_party/bower/bower_components/spin.js/bower.json +0 -1
- data/lib/epuber/third_party/bower/bower_components/spin.js/jquery.spin.js +23 -24
- data/lib/epuber/third_party/bower/bower_components/spin.js/spin.js +153 -113
- data/lib/epuber/third_party/bower/bower_components/spin.js/spin.min.js +2 -0
- data/lib/epuber/third_party/bower/bower_components/uri.js/CHANGELOG.md +424 -0
- data/lib/epuber/third_party/bower/bower_components/uri.js/README.md +23 -308
- data/lib/epuber/third_party/bower/bower_components/uri.js/SECURITY.md +12 -0
- data/lib/epuber/third_party/bower/bower_components/uri.js/bower.json +2 -2
- data/lib/epuber/third_party/bower/bower_components/uri.js/contributing.md +0 -4
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/IPv6.js +3 -6
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/SecondLevelDomains.js +8 -4
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentQuery.js +21 -4
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.fragmentURI.js +1 -1
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.js +312 -69
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URI.min.js +85 -77
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/URITemplate.js +28 -11
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.js +17 -18
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/jquery.URI.min.js +6 -6
- data/lib/epuber/third_party/bower/bower_components/uri.js/src/punycode.js +63 -38
- data/lib/epuber/third_party/bower.rb +2 -0
- data/lib/epuber/transformer/text_transformer.rb +1 -2
- data/lib/epuber/transformer.rb +1 -2
- data/lib/epuber/user_interface.rb +1 -1
- data/lib/epuber/vendor/hash_binding.rb +1 -1
- data/lib/epuber/vendor/nokogiri_extensions.rb +24 -21
- data/lib/epuber/vendor/ruby_templater.rb +1 -2
- data/lib/epuber/vendor/size.rb +1 -0
- data/lib/epuber/vendor/version.rb +1 -1
- data/lib/epuber/version.rb +2 -1
- data/lib/epuber.rb +1 -1
- metadata +77 -46
- data/lib/epuber/ruby_extensions/string.rb +0 -16
- data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
- data/lib/epuber/third_party/bower/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
- data/lib/epuber/third_party/bower/bower_components/jquery/src/var/strundefined.js +0 -3
- data/lib/epuber/vendor/globals_context.rb +0 -26
@@ -1,22 +1,18 @@
|
|
1
|
-
define([
|
1
|
+
define( [
|
2
2
|
"./core",
|
3
|
-
"./var/
|
3
|
+
"./var/document",
|
4
4
|
"./var/rnotwhite",
|
5
|
-
"./var/hasOwn",
|
6
5
|
"./var/slice",
|
7
|
-
"./
|
8
|
-
"./data/var/data_priv",
|
6
|
+
"./data/var/dataPriv",
|
9
7
|
|
10
8
|
"./core/init",
|
11
|
-
"./data/accepts",
|
12
9
|
"./selector"
|
13
|
-
], function( jQuery,
|
10
|
+
], function( jQuery, document, rnotwhite, slice, dataPriv ) {
|
14
11
|
|
15
12
|
var
|
16
13
|
rkeyEvent = /^key/,
|
17
|
-
rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
|
18
|
-
|
19
|
-
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
|
14
|
+
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
|
15
|
+
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
|
20
16
|
|
21
17
|
function returnTrue() {
|
22
18
|
return true;
|
@@ -26,12 +22,75 @@ function returnFalse() {
|
|
26
22
|
return false;
|
27
23
|
}
|
28
24
|
|
25
|
+
// Support: IE9
|
26
|
+
// See #13393 for more info
|
29
27
|
function safeActiveElement() {
|
30
28
|
try {
|
31
29
|
return document.activeElement;
|
32
30
|
} catch ( err ) { }
|
33
31
|
}
|
34
32
|
|
33
|
+
function on( elem, types, selector, data, fn, one ) {
|
34
|
+
var origFn, type;
|
35
|
+
|
36
|
+
// Types can be a map of types/handlers
|
37
|
+
if ( typeof types === "object" ) {
|
38
|
+
|
39
|
+
// ( types-Object, selector, data )
|
40
|
+
if ( typeof selector !== "string" ) {
|
41
|
+
|
42
|
+
// ( types-Object, data )
|
43
|
+
data = data || selector;
|
44
|
+
selector = undefined;
|
45
|
+
}
|
46
|
+
for ( type in types ) {
|
47
|
+
on( elem, type, selector, data, types[ type ], one );
|
48
|
+
}
|
49
|
+
return elem;
|
50
|
+
}
|
51
|
+
|
52
|
+
if ( data == null && fn == null ) {
|
53
|
+
|
54
|
+
// ( types, fn )
|
55
|
+
fn = selector;
|
56
|
+
data = selector = undefined;
|
57
|
+
} else if ( fn == null ) {
|
58
|
+
if ( typeof selector === "string" ) {
|
59
|
+
|
60
|
+
// ( types, selector, fn )
|
61
|
+
fn = data;
|
62
|
+
data = undefined;
|
63
|
+
} else {
|
64
|
+
|
65
|
+
// ( types, data, fn )
|
66
|
+
fn = data;
|
67
|
+
data = selector;
|
68
|
+
selector = undefined;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
if ( fn === false ) {
|
72
|
+
fn = returnFalse;
|
73
|
+
} else if ( !fn ) {
|
74
|
+
return elem;
|
75
|
+
}
|
76
|
+
|
77
|
+
if ( one === 1 ) {
|
78
|
+
origFn = fn;
|
79
|
+
fn = function( event ) {
|
80
|
+
|
81
|
+
// Can use an empty set, since event contains the info
|
82
|
+
jQuery().off( event );
|
83
|
+
return origFn.apply( this, arguments );
|
84
|
+
};
|
85
|
+
|
86
|
+
// Use same guid so caller can remove using origFn
|
87
|
+
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
88
|
+
}
|
89
|
+
return elem.each( function() {
|
90
|
+
jQuery.event.add( this, types, fn, data, selector );
|
91
|
+
} );
|
92
|
+
}
|
93
|
+
|
35
94
|
/*
|
36
95
|
* Helper functions for managing events -- not part of the public interface.
|
37
96
|
* Props to Dean Edwards' addEvent library for many of the ideas.
|
@@ -45,7 +104,7 @@ jQuery.event = {
|
|
45
104
|
var handleObjIn, eventHandle, tmp,
|
46
105
|
events, t, handleObj,
|
47
106
|
special, handlers, type, namespaces, origType,
|
48
|
-
elemData =
|
107
|
+
elemData = dataPriv.get( elem );
|
49
108
|
|
50
109
|
// Don't attach events to noData or text/comment nodes (but allow plain objects)
|
51
110
|
if ( !elemData ) {
|
@@ -65,14 +124,15 @@ jQuery.event = {
|
|
65
124
|
}
|
66
125
|
|
67
126
|
// Init the element's event structure and main handler, if this is the first
|
68
|
-
if ( !(events = elemData.events) ) {
|
127
|
+
if ( !( events = elemData.events ) ) {
|
69
128
|
events = elemData.events = {};
|
70
129
|
}
|
71
|
-
if ( !(eventHandle = elemData.handle) ) {
|
130
|
+
if ( !( eventHandle = elemData.handle ) ) {
|
72
131
|
eventHandle = elemData.handle = function( e ) {
|
132
|
+
|
73
133
|
// Discard the second event of a jQuery.event.trigger() and
|
74
134
|
// when an event is called after a page has unloaded
|
75
|
-
return typeof jQuery !==
|
135
|
+
return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
|
76
136
|
jQuery.event.dispatch.apply( elem, arguments ) : undefined;
|
77
137
|
};
|
78
138
|
}
|
@@ -81,9 +141,9 @@ jQuery.event = {
|
|
81
141
|
types = ( types || "" ).match( rnotwhite ) || [ "" ];
|
82
142
|
t = types.length;
|
83
143
|
while ( t-- ) {
|
84
|
-
tmp = rtypenamespace.exec( types[t] ) || [];
|
85
|
-
type = origType = tmp[1];
|
86
|
-
namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
144
|
+
tmp = rtypenamespace.exec( types[ t ] ) || [];
|
145
|
+
type = origType = tmp[ 1 ];
|
146
|
+
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
|
87
147
|
|
88
148
|
// There *must* be a type, no attaching namespace-only handlers
|
89
149
|
if ( !type ) {
|
@@ -100,7 +160,7 @@ jQuery.event = {
|
|
100
160
|
special = jQuery.event.special[ type ] || {};
|
101
161
|
|
102
162
|
// handleObj is passed to all event handlers
|
103
|
-
handleObj = jQuery.extend({
|
163
|
+
handleObj = jQuery.extend( {
|
104
164
|
type: type,
|
105
165
|
origType: origType,
|
106
166
|
data: data,
|
@@ -108,18 +168,20 @@ jQuery.event = {
|
|
108
168
|
guid: handler.guid,
|
109
169
|
selector: selector,
|
110
170
|
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
|
111
|
-
namespace: namespaces.join(".")
|
171
|
+
namespace: namespaces.join( "." )
|
112
172
|
}, handleObjIn );
|
113
173
|
|
114
174
|
// Init the event handler queue if we're the first
|
115
|
-
if ( !(handlers = events[ type ]) ) {
|
175
|
+
if ( !( handlers = events[ type ] ) ) {
|
116
176
|
handlers = events[ type ] = [];
|
117
177
|
handlers.delegateCount = 0;
|
118
178
|
|
119
179
|
// Only use addEventListener if the special events handler returns false
|
120
|
-
if ( !special.setup ||
|
180
|
+
if ( !special.setup ||
|
181
|
+
special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
182
|
+
|
121
183
|
if ( elem.addEventListener ) {
|
122
|
-
elem.addEventListener( type, eventHandle
|
184
|
+
elem.addEventListener( type, eventHandle );
|
123
185
|
}
|
124
186
|
}
|
125
187
|
}
|
@@ -151,9 +213,9 @@ jQuery.event = {
|
|
151
213
|
var j, origCount, tmp,
|
152
214
|
events, t, handleObj,
|
153
215
|
special, handlers, type, namespaces, origType,
|
154
|
-
elemData =
|
216
|
+
elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
|
155
217
|
|
156
|
-
if ( !elemData || !(events = elemData.events) ) {
|
218
|
+
if ( !elemData || !( events = elemData.events ) ) {
|
157
219
|
return;
|
158
220
|
}
|
159
221
|
|
@@ -161,9 +223,9 @@ jQuery.event = {
|
|
161
223
|
types = ( types || "" ).match( rnotwhite ) || [ "" ];
|
162
224
|
t = types.length;
|
163
225
|
while ( t-- ) {
|
164
|
-
tmp = rtypenamespace.exec( types[t] ) || [];
|
165
|
-
type = origType = tmp[1];
|
166
|
-
namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
226
|
+
tmp = rtypenamespace.exec( types[ t ] ) || [];
|
227
|
+
type = origType = tmp[ 1 ];
|
228
|
+
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
|
167
229
|
|
168
230
|
// Unbind all events (on this namespace, if provided) for the element
|
169
231
|
if ( !type ) {
|
@@ -176,7 +238,8 @@ jQuery.event = {
|
|
176
238
|
special = jQuery.event.special[ type ] || {};
|
177
239
|
type = ( selector ? special.delegateType : special.bindType ) || type;
|
178
240
|
handlers = events[ type ] || [];
|
179
|
-
tmp = tmp[2] &&
|
241
|
+
tmp = tmp[ 2 ] &&
|
242
|
+
new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
|
180
243
|
|
181
244
|
// Remove matching events
|
182
245
|
origCount = j = handlers.length;
|
@@ -186,7 +249,8 @@ jQuery.event = {
|
|
186
249
|
if ( ( mappedTypes || origType === handleObj.origType ) &&
|
187
250
|
( !handler || handler.guid === handleObj.guid ) &&
|
188
251
|
( !tmp || tmp.test( handleObj.namespace ) ) &&
|
189
|
-
( !selector || selector === handleObj.selector ||
|
252
|
+
( !selector || selector === handleObj.selector ||
|
253
|
+
selector === "**" && handleObj.selector ) ) {
|
190
254
|
handlers.splice( j, 1 );
|
191
255
|
|
192
256
|
if ( handleObj.selector ) {
|
@@ -201,7 +265,9 @@ jQuery.event = {
|
|
201
265
|
// Remove generic event handler if we removed something and no more handlers exist
|
202
266
|
// (avoids potential for endless recursion during removal of special event handlers)
|
203
267
|
if ( origCount && !handlers.length ) {
|
204
|
-
if ( !special.teardown ||
|
268
|
+
if ( !special.teardown ||
|
269
|
+
special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
|
270
|
+
|
205
271
|
jQuery.removeEvent( elem, type, elemData.handle );
|
206
272
|
}
|
207
273
|
|
@@ -209,143 +275,10 @@ jQuery.event = {
|
|
209
275
|
}
|
210
276
|
}
|
211
277
|
|
212
|
-
// Remove the expando if it's no longer used
|
278
|
+
// Remove data and the expando if it's no longer used
|
213
279
|
if ( jQuery.isEmptyObject( events ) ) {
|
214
|
-
|
215
|
-
data_priv.remove( elem, "events" );
|
216
|
-
}
|
217
|
-
},
|
218
|
-
|
219
|
-
trigger: function( event, data, elem, onlyHandlers ) {
|
220
|
-
|
221
|
-
var i, cur, tmp, bubbleType, ontype, handle, special,
|
222
|
-
eventPath = [ elem || document ],
|
223
|
-
type = hasOwn.call( event, "type" ) ? event.type : event,
|
224
|
-
namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
|
225
|
-
|
226
|
-
cur = tmp = elem = elem || document;
|
227
|
-
|
228
|
-
// Don't do events on text and comment nodes
|
229
|
-
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
230
|
-
return;
|
231
|
-
}
|
232
|
-
|
233
|
-
// focus/blur morphs to focusin/out; ensure we're not firing them right now
|
234
|
-
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
|
235
|
-
return;
|
236
|
-
}
|
237
|
-
|
238
|
-
if ( type.indexOf(".") >= 0 ) {
|
239
|
-
// Namespaced trigger; create a regexp to match event type in handle()
|
240
|
-
namespaces = type.split(".");
|
241
|
-
type = namespaces.shift();
|
242
|
-
namespaces.sort();
|
243
|
-
}
|
244
|
-
ontype = type.indexOf(":") < 0 && "on" + type;
|
245
|
-
|
246
|
-
// Caller can pass in a jQuery.Event object, Object, or just an event type string
|
247
|
-
event = event[ jQuery.expando ] ?
|
248
|
-
event :
|
249
|
-
new jQuery.Event( type, typeof event === "object" && event );
|
250
|
-
|
251
|
-
// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
|
252
|
-
event.isTrigger = onlyHandlers ? 2 : 3;
|
253
|
-
event.namespace = namespaces.join(".");
|
254
|
-
event.namespace_re = event.namespace ?
|
255
|
-
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
|
256
|
-
null;
|
257
|
-
|
258
|
-
// Clean up the event in case it is being reused
|
259
|
-
event.result = undefined;
|
260
|
-
if ( !event.target ) {
|
261
|
-
event.target = elem;
|
262
|
-
}
|
263
|
-
|
264
|
-
// Clone any incoming data and prepend the event, creating the handler arg list
|
265
|
-
data = data == null ?
|
266
|
-
[ event ] :
|
267
|
-
jQuery.makeArray( data, [ event ] );
|
268
|
-
|
269
|
-
// Allow special events to draw outside the lines
|
270
|
-
special = jQuery.event.special[ type ] || {};
|
271
|
-
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
|
272
|
-
return;
|
273
|
-
}
|
274
|
-
|
275
|
-
// Determine event propagation path in advance, per W3C events spec (#9951)
|
276
|
-
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
277
|
-
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
278
|
-
|
279
|
-
bubbleType = special.delegateType || type;
|
280
|
-
if ( !rfocusMorph.test( bubbleType + type ) ) {
|
281
|
-
cur = cur.parentNode;
|
282
|
-
}
|
283
|
-
for ( ; cur; cur = cur.parentNode ) {
|
284
|
-
eventPath.push( cur );
|
285
|
-
tmp = cur;
|
286
|
-
}
|
287
|
-
|
288
|
-
// Only add window if we got to document (e.g., not plain obj or detached DOM)
|
289
|
-
if ( tmp === (elem.ownerDocument || document) ) {
|
290
|
-
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
|
291
|
-
}
|
292
|
-
}
|
293
|
-
|
294
|
-
// Fire handlers on the event path
|
295
|
-
i = 0;
|
296
|
-
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
|
297
|
-
|
298
|
-
event.type = i > 1 ?
|
299
|
-
bubbleType :
|
300
|
-
special.bindType || type;
|
301
|
-
|
302
|
-
// jQuery handler
|
303
|
-
handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
|
304
|
-
if ( handle ) {
|
305
|
-
handle.apply( cur, data );
|
306
|
-
}
|
307
|
-
|
308
|
-
// Native handler
|
309
|
-
handle = ontype && cur[ ontype ];
|
310
|
-
if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
|
311
|
-
event.result = handle.apply( cur, data );
|
312
|
-
if ( event.result === false ) {
|
313
|
-
event.preventDefault();
|
314
|
-
}
|
315
|
-
}
|
316
|
-
}
|
317
|
-
event.type = type;
|
318
|
-
|
319
|
-
// If nobody prevented the default action, do it now
|
320
|
-
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
|
321
|
-
|
322
|
-
if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
|
323
|
-
jQuery.acceptData( elem ) ) {
|
324
|
-
|
325
|
-
// Call a native DOM method on the target with the same name name as the event.
|
326
|
-
// Don't do default actions on window, that's where global variables be (#6170)
|
327
|
-
if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
|
328
|
-
|
329
|
-
// Don't re-trigger an onFOO event when we call its FOO() method
|
330
|
-
tmp = elem[ ontype ];
|
331
|
-
|
332
|
-
if ( tmp ) {
|
333
|
-
elem[ ontype ] = null;
|
334
|
-
}
|
335
|
-
|
336
|
-
// Prevent re-triggering of the same event, since we already bubbled it above
|
337
|
-
jQuery.event.triggered = type;
|
338
|
-
elem[ type ]();
|
339
|
-
jQuery.event.triggered = undefined;
|
340
|
-
|
341
|
-
if ( tmp ) {
|
342
|
-
elem[ ontype ] = tmp;
|
343
|
-
}
|
344
|
-
}
|
345
|
-
}
|
280
|
+
dataPriv.remove( elem, "handle events" );
|
346
281
|
}
|
347
|
-
|
348
|
-
return event.result;
|
349
282
|
},
|
350
283
|
|
351
284
|
dispatch: function( event ) {
|
@@ -356,11 +289,11 @@ jQuery.event = {
|
|
356
289
|
var i, j, ret, matched, handleObj,
|
357
290
|
handlerQueue = [],
|
358
291
|
args = slice.call( arguments ),
|
359
|
-
handlers = (
|
292
|
+
handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
|
360
293
|
special = jQuery.event.special[ event.type ] || {};
|
361
294
|
|
362
295
|
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
363
|
-
args[0] = event;
|
296
|
+
args[ 0 ] = event;
|
364
297
|
event.delegateTarget = this;
|
365
298
|
|
366
299
|
// Call the preDispatch hook for the mapped type, and let it bail if desired
|
@@ -373,24 +306,25 @@ jQuery.event = {
|
|
373
306
|
|
374
307
|
// Run delegates first; they may want to stop propagation beneath us
|
375
308
|
i = 0;
|
376
|
-
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
|
309
|
+
while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
|
377
310
|
event.currentTarget = matched.elem;
|
378
311
|
|
379
312
|
j = 0;
|
380
|
-
while ( (handleObj = matched.handlers[ j++ ]) &&
|
313
|
+
while ( ( handleObj = matched.handlers[ j++ ] ) &&
|
314
|
+
!event.isImmediatePropagationStopped() ) {
|
381
315
|
|
382
316
|
// Triggered event must either 1) have no namespace, or 2) have namespace(s)
|
383
317
|
// a subset or equal to those in the bound event (both can have no namespace).
|
384
|
-
if ( !event.
|
318
|
+
if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
|
385
319
|
|
386
320
|
event.handleObj = handleObj;
|
387
321
|
event.data = handleObj.data;
|
388
322
|
|
389
|
-
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle ||
|
390
|
-
|
323
|
+
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
|
324
|
+
handleObj.handler ).apply( matched.elem, args );
|
391
325
|
|
392
326
|
if ( ret !== undefined ) {
|
393
|
-
if ( (event.result = ret) === false ) {
|
327
|
+
if ( ( event.result = ret ) === false ) {
|
394
328
|
event.preventDefault();
|
395
329
|
event.stopPropagation();
|
396
330
|
}
|
@@ -413,15 +347,20 @@ jQuery.event = {
|
|
413
347
|
delegateCount = handlers.delegateCount,
|
414
348
|
cur = event.target;
|
415
349
|
|
350
|
+
// Support (at least): Chrome, IE9
|
416
351
|
// Find delegate handlers
|
417
352
|
// Black-hole SVG <use> instance trees (#13180)
|
418
|
-
//
|
419
|
-
|
353
|
+
//
|
354
|
+
// Support: Firefox<=42+
|
355
|
+
// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
|
356
|
+
if ( delegateCount && cur.nodeType &&
|
357
|
+
( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
|
420
358
|
|
421
359
|
for ( ; cur !== this; cur = cur.parentNode || this ) {
|
422
360
|
|
361
|
+
// Don't check non-elements (#13208)
|
423
362
|
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
424
|
-
if ( cur.disabled !== true || event.type !== "click" ) {
|
363
|
+
if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
|
425
364
|
matches = [];
|
426
365
|
for ( i = 0; i < delegateCount; i++ ) {
|
427
366
|
handleObj = handlers[ i ];
|
@@ -431,7 +370,7 @@ jQuery.event = {
|
|
431
370
|
|
432
371
|
if ( matches[ sel ] === undefined ) {
|
433
372
|
matches[ sel ] = handleObj.needsContext ?
|
434
|
-
jQuery( sel, this ).index( cur )
|
373
|
+
jQuery( sel, this ).index( cur ) > -1 :
|
435
374
|
jQuery.find( sel, this, null, [ cur ] ).length;
|
436
375
|
}
|
437
376
|
if ( matches[ sel ] ) {
|
@@ -439,7 +378,7 @@ jQuery.event = {
|
|
439
378
|
}
|
440
379
|
}
|
441
380
|
if ( matches.length ) {
|
442
|
-
handlerQueue.push({ elem: cur, handlers: matches });
|
381
|
+
handlerQueue.push( { elem: cur, handlers: matches } );
|
443
382
|
}
|
444
383
|
}
|
445
384
|
}
|
@@ -447,19 +386,20 @@ jQuery.event = {
|
|
447
386
|
|
448
387
|
// Add the remaining (directly-bound) handlers
|
449
388
|
if ( delegateCount < handlers.length ) {
|
450
|
-
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
|
389
|
+
handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
|
451
390
|
}
|
452
391
|
|
453
392
|
return handlerQueue;
|
454
393
|
},
|
455
394
|
|
456
395
|
// Includes some event props shared by KeyEvent and MouseEvent
|
457
|
-
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase
|
396
|
+
props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
|
397
|
+
"metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
|
458
398
|
|
459
399
|
fixHooks: {},
|
460
400
|
|
461
401
|
keyHooks: {
|
462
|
-
props: "char charCode key keyCode".split(" "),
|
402
|
+
props: "char charCode key keyCode".split( " " ),
|
463
403
|
filter: function( event, original ) {
|
464
404
|
|
465
405
|
// Add which for key events
|
@@ -472,7 +412,8 @@ jQuery.event = {
|
|
472
412
|
},
|
473
413
|
|
474
414
|
mouseHooks: {
|
475
|
-
props: "button buttons clientX clientY offsetX offsetY pageX pageY
|
415
|
+
props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " +
|
416
|
+
"screenX screenY toElement" ).split( " " ),
|
476
417
|
filter: function( event, original ) {
|
477
418
|
var eventDoc, doc, body,
|
478
419
|
button = original.button;
|
@@ -483,8 +424,12 @@ jQuery.event = {
|
|
483
424
|
doc = eventDoc.documentElement;
|
484
425
|
body = eventDoc.body;
|
485
426
|
|
486
|
-
event.pageX = original.clientX +
|
487
|
-
|
427
|
+
event.pageX = original.clientX +
|
428
|
+
( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
|
429
|
+
( doc && doc.clientLeft || body && body.clientLeft || 0 );
|
430
|
+
event.pageY = original.clientY +
|
431
|
+
( doc && doc.scrollTop || body && body.scrollTop || 0 ) -
|
432
|
+
( doc && doc.clientTop || body && body.clientTop || 0 );
|
488
433
|
}
|
489
434
|
|
490
435
|
// Add which for click: 1 === left; 2 === middle; 3 === right
|
@@ -541,10 +486,12 @@ jQuery.event = {
|
|
541
486
|
|
542
487
|
special: {
|
543
488
|
load: {
|
489
|
+
|
544
490
|
// Prevent triggered image.load events from bubbling to window.load
|
545
491
|
noBubble: true
|
546
492
|
},
|
547
493
|
focus: {
|
494
|
+
|
548
495
|
// Fire native event if possible so blur/focus sequence is correct
|
549
496
|
trigger: function() {
|
550
497
|
if ( this !== safeActiveElement() && this.focus ) {
|
@@ -564,6 +511,7 @@ jQuery.event = {
|
|
564
511
|
delegateType: "focusout"
|
565
512
|
},
|
566
513
|
click: {
|
514
|
+
|
567
515
|
// For checkbox, fire native event so checked state will be right
|
568
516
|
trigger: function() {
|
569
517
|
if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
|
@@ -588,41 +536,21 @@ jQuery.event = {
|
|
588
536
|
}
|
589
537
|
}
|
590
538
|
}
|
591
|
-
},
|
592
|
-
|
593
|
-
simulate: function( type, elem, event, bubble ) {
|
594
|
-
// Piggyback on a donor event to simulate a different one.
|
595
|
-
// Fake originalEvent to avoid donor's stopPropagation, but if the
|
596
|
-
// simulated event prevents default then we do the same on the donor.
|
597
|
-
var e = jQuery.extend(
|
598
|
-
new jQuery.Event(),
|
599
|
-
event,
|
600
|
-
{
|
601
|
-
type: type,
|
602
|
-
isSimulated: true,
|
603
|
-
originalEvent: {}
|
604
|
-
}
|
605
|
-
);
|
606
|
-
if ( bubble ) {
|
607
|
-
jQuery.event.trigger( e, null, elem );
|
608
|
-
} else {
|
609
|
-
jQuery.event.dispatch.call( elem, e );
|
610
|
-
}
|
611
|
-
if ( e.isDefaultPrevented() ) {
|
612
|
-
event.preventDefault();
|
613
|
-
}
|
614
539
|
}
|
615
540
|
};
|
616
541
|
|
617
542
|
jQuery.removeEvent = function( elem, type, handle ) {
|
543
|
+
|
544
|
+
// This "if" is needed for plain objects
|
618
545
|
if ( elem.removeEventListener ) {
|
619
|
-
elem.removeEventListener( type, handle
|
546
|
+
elem.removeEventListener( type, handle );
|
620
547
|
}
|
621
548
|
};
|
622
549
|
|
623
550
|
jQuery.Event = function( src, props ) {
|
551
|
+
|
624
552
|
// Allow instantiation without the 'new' keyword
|
625
|
-
if ( !(this instanceof jQuery.Event) ) {
|
553
|
+
if ( !( this instanceof jQuery.Event ) ) {
|
626
554
|
return new jQuery.Event( src, props );
|
627
555
|
}
|
628
556
|
|
@@ -635,6 +563,7 @@ jQuery.Event = function( src, props ) {
|
|
635
563
|
// by a handler lower down the tree; reflect the correct value.
|
636
564
|
this.isDefaultPrevented = src.defaultPrevented ||
|
637
565
|
src.defaultPrevented === undefined &&
|
566
|
+
|
638
567
|
// Support: Android<4.0
|
639
568
|
src.returnValue === false ?
|
640
569
|
returnTrue :
|
@@ -660,16 +589,18 @@ jQuery.Event = function( src, props ) {
|
|
660
589
|
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
|
661
590
|
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
|
662
591
|
jQuery.Event.prototype = {
|
592
|
+
constructor: jQuery.Event,
|
663
593
|
isDefaultPrevented: returnFalse,
|
664
594
|
isPropagationStopped: returnFalse,
|
665
595
|
isImmediatePropagationStopped: returnFalse,
|
596
|
+
isSimulated: false,
|
666
597
|
|
667
598
|
preventDefault: function() {
|
668
599
|
var e = this.originalEvent;
|
669
600
|
|
670
601
|
this.isDefaultPrevented = returnTrue;
|
671
602
|
|
672
|
-
if ( e &&
|
603
|
+
if ( e && !this.isSimulated ) {
|
673
604
|
e.preventDefault();
|
674
605
|
}
|
675
606
|
},
|
@@ -678,7 +609,7 @@ jQuery.Event.prototype = {
|
|
678
609
|
|
679
610
|
this.isPropagationStopped = returnTrue;
|
680
611
|
|
681
|
-
if ( e &&
|
612
|
+
if ( e && !this.isSimulated ) {
|
682
613
|
e.stopPropagation();
|
683
614
|
}
|
684
615
|
},
|
@@ -687,7 +618,7 @@ jQuery.Event.prototype = {
|
|
687
618
|
|
688
619
|
this.isImmediatePropagationStopped = returnTrue;
|
689
620
|
|
690
|
-
if ( e &&
|
621
|
+
if ( e && !this.isSimulated ) {
|
691
622
|
e.stopImmediatePropagation();
|
692
623
|
}
|
693
624
|
|
@@ -696,8 +627,14 @@ jQuery.Event.prototype = {
|
|
696
627
|
};
|
697
628
|
|
698
629
|
// Create mouseenter/leave events using mouseover/out and event-time checks
|
699
|
-
//
|
700
|
-
|
630
|
+
// so that event delegation works in jQuery.
|
631
|
+
// Do the same for pointerenter/pointerleave and pointerover/pointerout
|
632
|
+
//
|
633
|
+
// Support: Safari 7 only
|
634
|
+
// Safari sends mouseenter too often; see:
|
635
|
+
// https://code.google.com/p/chromium/issues/detail?id=470258
|
636
|
+
// for the description of the bug (it existed in older Chrome versions as well).
|
637
|
+
jQuery.each( {
|
701
638
|
mouseenter: "mouseover",
|
702
639
|
mouseleave: "mouseout",
|
703
640
|
pointerenter: "pointerover",
|
@@ -713,9 +650,9 @@ jQuery.each({
|
|
713
650
|
related = event.relatedTarget,
|
714
651
|
handleObj = event.handleObj;
|
715
652
|
|
716
|
-
// For
|
653
|
+
// For mouseenter/leave call the handler if related is outside the target.
|
717
654
|
// NB: No relatedTarget if the mouse left/entered the browser window
|
718
|
-
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
|
655
|
+
if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
|
719
656
|
event.type = handleObj.origType;
|
720
657
|
ret = handleObj.handler.apply( this, arguments );
|
721
658
|
event.type = fix;
|
@@ -723,115 +660,32 @@ jQuery.each({
|
|
723
660
|
return ret;
|
724
661
|
}
|
725
662
|
};
|
726
|
-
});
|
727
|
-
|
728
|
-
// Support: Firefox, Chrome, Safari
|
729
|
-
// Create "bubbling" focus and blur events
|
730
|
-
if ( !support.focusinBubbles ) {
|
731
|
-
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
732
|
-
|
733
|
-
// Attach a single capturing handler on the document while someone wants focusin/focusout
|
734
|
-
var handler = function( event ) {
|
735
|
-
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
|
736
|
-
};
|
737
|
-
|
738
|
-
jQuery.event.special[ fix ] = {
|
739
|
-
setup: function() {
|
740
|
-
var doc = this.ownerDocument || this,
|
741
|
-
attaches = data_priv.access( doc, fix );
|
742
|
-
|
743
|
-
if ( !attaches ) {
|
744
|
-
doc.addEventListener( orig, handler, true );
|
745
|
-
}
|
746
|
-
data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
|
747
|
-
},
|
748
|
-
teardown: function() {
|
749
|
-
var doc = this.ownerDocument || this,
|
750
|
-
attaches = data_priv.access( doc, fix ) - 1;
|
751
|
-
|
752
|
-
if ( !attaches ) {
|
753
|
-
doc.removeEventListener( orig, handler, true );
|
754
|
-
data_priv.remove( doc, fix );
|
755
|
-
|
756
|
-
} else {
|
757
|
-
data_priv.access( doc, fix, attaches );
|
758
|
-
}
|
759
|
-
}
|
760
|
-
};
|
761
|
-
});
|
762
|
-
}
|
763
|
-
|
764
|
-
jQuery.fn.extend({
|
663
|
+
} );
|
765
664
|
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
// Types can be a map of types/handlers
|
770
|
-
if ( typeof types === "object" ) {
|
771
|
-
// ( types-Object, selector, data )
|
772
|
-
if ( typeof selector !== "string" ) {
|
773
|
-
// ( types-Object, data )
|
774
|
-
data = data || selector;
|
775
|
-
selector = undefined;
|
776
|
-
}
|
777
|
-
for ( type in types ) {
|
778
|
-
this.on( type, selector, data, types[ type ], one );
|
779
|
-
}
|
780
|
-
return this;
|
781
|
-
}
|
782
|
-
|
783
|
-
if ( data == null && fn == null ) {
|
784
|
-
// ( types, fn )
|
785
|
-
fn = selector;
|
786
|
-
data = selector = undefined;
|
787
|
-
} else if ( fn == null ) {
|
788
|
-
if ( typeof selector === "string" ) {
|
789
|
-
// ( types, selector, fn )
|
790
|
-
fn = data;
|
791
|
-
data = undefined;
|
792
|
-
} else {
|
793
|
-
// ( types, data, fn )
|
794
|
-
fn = data;
|
795
|
-
data = selector;
|
796
|
-
selector = undefined;
|
797
|
-
}
|
798
|
-
}
|
799
|
-
if ( fn === false ) {
|
800
|
-
fn = returnFalse;
|
801
|
-
} else if ( !fn ) {
|
802
|
-
return this;
|
803
|
-
}
|
804
|
-
|
805
|
-
if ( one === 1 ) {
|
806
|
-
origFn = fn;
|
807
|
-
fn = function( event ) {
|
808
|
-
// Can use an empty set, since event contains the info
|
809
|
-
jQuery().off( event );
|
810
|
-
return origFn.apply( this, arguments );
|
811
|
-
};
|
812
|
-
// Use same guid so caller can remove using origFn
|
813
|
-
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
814
|
-
}
|
815
|
-
return this.each( function() {
|
816
|
-
jQuery.event.add( this, types, fn, data, selector );
|
817
|
-
});
|
665
|
+
jQuery.fn.extend( {
|
666
|
+
on: function( types, selector, data, fn ) {
|
667
|
+
return on( this, types, selector, data, fn );
|
818
668
|
},
|
819
669
|
one: function( types, selector, data, fn ) {
|
820
|
-
return
|
670
|
+
return on( this, types, selector, data, fn, 1 );
|
821
671
|
},
|
822
672
|
off: function( types, selector, fn ) {
|
823
673
|
var handleObj, type;
|
824
674
|
if ( types && types.preventDefault && types.handleObj ) {
|
675
|
+
|
825
676
|
// ( event ) dispatched jQuery.Event
|
826
677
|
handleObj = types.handleObj;
|
827
678
|
jQuery( types.delegateTarget ).off(
|
828
|
-
handleObj.namespace ?
|
679
|
+
handleObj.namespace ?
|
680
|
+
handleObj.origType + "." + handleObj.namespace :
|
681
|
+
handleObj.origType,
|
829
682
|
handleObj.selector,
|
830
683
|
handleObj.handler
|
831
684
|
);
|
832
685
|
return this;
|
833
686
|
}
|
834
687
|
if ( typeof types === "object" ) {
|
688
|
+
|
835
689
|
// ( types-object [, selector] )
|
836
690
|
for ( type in types ) {
|
837
691
|
this.off( type, selector, types[ type ] );
|
@@ -839,6 +693,7 @@ jQuery.fn.extend({
|
|
839
693
|
return this;
|
840
694
|
}
|
841
695
|
if ( selector === false || typeof selector === "function" ) {
|
696
|
+
|
842
697
|
// ( types [, fn] )
|
843
698
|
fn = selector;
|
844
699
|
selector = undefined;
|
@@ -846,23 +701,11 @@ jQuery.fn.extend({
|
|
846
701
|
if ( fn === false ) {
|
847
702
|
fn = returnFalse;
|
848
703
|
}
|
849
|
-
return this.each(function() {
|
704
|
+
return this.each( function() {
|
850
705
|
jQuery.event.remove( this, types, fn, selector );
|
851
|
-
});
|
852
|
-
},
|
853
|
-
|
854
|
-
trigger: function( type, data ) {
|
855
|
-
return this.each(function() {
|
856
|
-
jQuery.event.trigger( type, data, this );
|
857
|
-
});
|
858
|
-
},
|
859
|
-
triggerHandler: function( type, data ) {
|
860
|
-
var elem = this[0];
|
861
|
-
if ( elem ) {
|
862
|
-
return jQuery.event.trigger( type, data, elem, true );
|
863
|
-
}
|
706
|
+
} );
|
864
707
|
}
|
865
|
-
});
|
708
|
+
} );
|
866
709
|
|
867
710
|
return jQuery;
|
868
|
-
});
|
711
|
+
} );
|