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,11 +1,14 @@
|
|
1
|
-
define([
|
1
|
+
define( [
|
2
2
|
"../core",
|
3
|
-
|
3
|
+
|
4
|
+
"../event",
|
5
|
+
"./trigger"
|
4
6
|
], function( jQuery ) {
|
5
7
|
|
6
|
-
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
8
|
+
jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
|
7
9
|
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
8
|
-
"change select submit keydown keypress keyup error contextmenu").split(" "),
|
10
|
+
"change select submit keydown keypress keyup error contextmenu" ).split( " " ),
|
11
|
+
function( i, name ) {
|
9
12
|
|
10
13
|
// Handle event binding
|
11
14
|
jQuery.fn[ name ] = function( data, fn ) {
|
@@ -13,27 +16,12 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl
|
|
13
16
|
this.on( name, null, data, fn ) :
|
14
17
|
this.trigger( name );
|
15
18
|
};
|
16
|
-
});
|
19
|
+
} );
|
17
20
|
|
18
|
-
jQuery.fn.extend({
|
21
|
+
jQuery.fn.extend( {
|
19
22
|
hover: function( fnOver, fnOut ) {
|
20
23
|
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
21
|
-
},
|
22
|
-
|
23
|
-
bind: function( types, data, fn ) {
|
24
|
-
return this.on( types, null, data, fn );
|
25
|
-
},
|
26
|
-
unbind: function( types, fn ) {
|
27
|
-
return this.off( types, null, fn );
|
28
|
-
},
|
29
|
-
|
30
|
-
delegate: function( selector, types, data, fn ) {
|
31
|
-
return this.on( types, selector, data, fn );
|
32
|
-
},
|
33
|
-
undelegate: function( selector, types, fn ) {
|
34
|
-
// ( namespace ) or ( selector, types [, fn] )
|
35
|
-
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
|
36
24
|
}
|
37
|
-
});
|
25
|
+
} );
|
38
26
|
|
39
|
-
});
|
27
|
+
} );
|
@@ -0,0 +1,53 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../data/var/dataPriv",
|
4
|
+
"./support",
|
5
|
+
|
6
|
+
"../event",
|
7
|
+
"./trigger"
|
8
|
+
], function( jQuery, dataPriv, support ) {
|
9
|
+
|
10
|
+
// Support: Firefox
|
11
|
+
// Firefox doesn't have focus(in | out) events
|
12
|
+
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
|
13
|
+
//
|
14
|
+
// Support: Chrome, Safari
|
15
|
+
// focus(in | out) events fire after focus & blur events,
|
16
|
+
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
|
17
|
+
// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
|
18
|
+
if ( !support.focusin ) {
|
19
|
+
jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
20
|
+
|
21
|
+
// Attach a single capturing handler on the document while someone wants focusin/focusout
|
22
|
+
var handler = function( event ) {
|
23
|
+
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
|
24
|
+
};
|
25
|
+
|
26
|
+
jQuery.event.special[ fix ] = {
|
27
|
+
setup: function() {
|
28
|
+
var doc = this.ownerDocument || this,
|
29
|
+
attaches = dataPriv.access( doc, fix );
|
30
|
+
|
31
|
+
if ( !attaches ) {
|
32
|
+
doc.addEventListener( orig, handler, true );
|
33
|
+
}
|
34
|
+
dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
|
35
|
+
},
|
36
|
+
teardown: function() {
|
37
|
+
var doc = this.ownerDocument || this,
|
38
|
+
attaches = dataPriv.access( doc, fix ) - 1;
|
39
|
+
|
40
|
+
if ( !attaches ) {
|
41
|
+
doc.removeEventListener( orig, handler, true );
|
42
|
+
dataPriv.remove( doc, fix );
|
43
|
+
|
44
|
+
} else {
|
45
|
+
dataPriv.access( doc, fix, attaches );
|
46
|
+
}
|
47
|
+
}
|
48
|
+
};
|
49
|
+
} );
|
50
|
+
}
|
51
|
+
|
52
|
+
return jQuery;
|
53
|
+
} );
|
@@ -0,0 +1,183 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/document",
|
4
|
+
"../data/var/dataPriv",
|
5
|
+
"../data/var/acceptData",
|
6
|
+
"../var/hasOwn",
|
7
|
+
|
8
|
+
"../event"
|
9
|
+
], function( jQuery, document, dataPriv, acceptData, hasOwn ) {
|
10
|
+
|
11
|
+
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
|
12
|
+
|
13
|
+
jQuery.extend( jQuery.event, {
|
14
|
+
|
15
|
+
trigger: function( event, data, elem, onlyHandlers ) {
|
16
|
+
|
17
|
+
var i, cur, tmp, bubbleType, ontype, handle, special,
|
18
|
+
eventPath = [ elem || document ],
|
19
|
+
type = hasOwn.call( event, "type" ) ? event.type : event,
|
20
|
+
namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
|
21
|
+
|
22
|
+
cur = tmp = elem = elem || document;
|
23
|
+
|
24
|
+
// Don't do events on text and comment nodes
|
25
|
+
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
|
29
|
+
// focus/blur morphs to focusin/out; ensure we're not firing them right now
|
30
|
+
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
|
34
|
+
if ( type.indexOf( "." ) > -1 ) {
|
35
|
+
|
36
|
+
// Namespaced trigger; create a regexp to match event type in handle()
|
37
|
+
namespaces = type.split( "." );
|
38
|
+
type = namespaces.shift();
|
39
|
+
namespaces.sort();
|
40
|
+
}
|
41
|
+
ontype = type.indexOf( ":" ) < 0 && "on" + type;
|
42
|
+
|
43
|
+
// Caller can pass in a jQuery.Event object, Object, or just an event type string
|
44
|
+
event = event[ jQuery.expando ] ?
|
45
|
+
event :
|
46
|
+
new jQuery.Event( type, typeof event === "object" && event );
|
47
|
+
|
48
|
+
// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
|
49
|
+
event.isTrigger = onlyHandlers ? 2 : 3;
|
50
|
+
event.namespace = namespaces.join( "." );
|
51
|
+
event.rnamespace = event.namespace ?
|
52
|
+
new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
|
53
|
+
null;
|
54
|
+
|
55
|
+
// Clean up the event in case it is being reused
|
56
|
+
event.result = undefined;
|
57
|
+
if ( !event.target ) {
|
58
|
+
event.target = elem;
|
59
|
+
}
|
60
|
+
|
61
|
+
// Clone any incoming data and prepend the event, creating the handler arg list
|
62
|
+
data = data == null ?
|
63
|
+
[ event ] :
|
64
|
+
jQuery.makeArray( data, [ event ] );
|
65
|
+
|
66
|
+
// Allow special events to draw outside the lines
|
67
|
+
special = jQuery.event.special[ type ] || {};
|
68
|
+
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
|
72
|
+
// Determine event propagation path in advance, per W3C events spec (#9951)
|
73
|
+
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
74
|
+
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
75
|
+
|
76
|
+
bubbleType = special.delegateType || type;
|
77
|
+
if ( !rfocusMorph.test( bubbleType + type ) ) {
|
78
|
+
cur = cur.parentNode;
|
79
|
+
}
|
80
|
+
for ( ; cur; cur = cur.parentNode ) {
|
81
|
+
eventPath.push( cur );
|
82
|
+
tmp = cur;
|
83
|
+
}
|
84
|
+
|
85
|
+
// Only add window if we got to document (e.g., not plain obj or detached DOM)
|
86
|
+
if ( tmp === ( elem.ownerDocument || document ) ) {
|
87
|
+
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
// Fire handlers on the event path
|
92
|
+
i = 0;
|
93
|
+
while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
|
94
|
+
|
95
|
+
event.type = i > 1 ?
|
96
|
+
bubbleType :
|
97
|
+
special.bindType || type;
|
98
|
+
|
99
|
+
// jQuery handler
|
100
|
+
handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
|
101
|
+
dataPriv.get( cur, "handle" );
|
102
|
+
if ( handle ) {
|
103
|
+
handle.apply( cur, data );
|
104
|
+
}
|
105
|
+
|
106
|
+
// Native handler
|
107
|
+
handle = ontype && cur[ ontype ];
|
108
|
+
if ( handle && handle.apply && acceptData( cur ) ) {
|
109
|
+
event.result = handle.apply( cur, data );
|
110
|
+
if ( event.result === false ) {
|
111
|
+
event.preventDefault();
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
event.type = type;
|
116
|
+
|
117
|
+
// If nobody prevented the default action, do it now
|
118
|
+
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
|
119
|
+
|
120
|
+
if ( ( !special._default ||
|
121
|
+
special._default.apply( eventPath.pop(), data ) === false ) &&
|
122
|
+
acceptData( elem ) ) {
|
123
|
+
|
124
|
+
// Call a native DOM method on the target with the same name name as the event.
|
125
|
+
// Don't do default actions on window, that's where global variables be (#6170)
|
126
|
+
if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
|
127
|
+
|
128
|
+
// Don't re-trigger an onFOO event when we call its FOO() method
|
129
|
+
tmp = elem[ ontype ];
|
130
|
+
|
131
|
+
if ( tmp ) {
|
132
|
+
elem[ ontype ] = null;
|
133
|
+
}
|
134
|
+
|
135
|
+
// Prevent re-triggering of the same event, since we already bubbled it above
|
136
|
+
jQuery.event.triggered = type;
|
137
|
+
elem[ type ]();
|
138
|
+
jQuery.event.triggered = undefined;
|
139
|
+
|
140
|
+
if ( tmp ) {
|
141
|
+
elem[ ontype ] = tmp;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
return event.result;
|
148
|
+
},
|
149
|
+
|
150
|
+
// Piggyback on a donor event to simulate a different one
|
151
|
+
// Used only for `focus(in | out)` events
|
152
|
+
simulate: function( type, elem, event ) {
|
153
|
+
var e = jQuery.extend(
|
154
|
+
new jQuery.Event(),
|
155
|
+
event,
|
156
|
+
{
|
157
|
+
type: type,
|
158
|
+
isSimulated: true
|
159
|
+
}
|
160
|
+
);
|
161
|
+
|
162
|
+
jQuery.event.trigger( e, null, elem );
|
163
|
+
}
|
164
|
+
|
165
|
+
} );
|
166
|
+
|
167
|
+
jQuery.fn.extend( {
|
168
|
+
|
169
|
+
trigger: function( type, data ) {
|
170
|
+
return this.each( function() {
|
171
|
+
jQuery.event.trigger( type, data, this );
|
172
|
+
} );
|
173
|
+
},
|
174
|
+
triggerHandler: function( type, data ) {
|
175
|
+
var elem = this[ 0 ];
|
176
|
+
if ( elem ) {
|
177
|
+
return jQuery.event.trigger( type, data, elem, true );
|
178
|
+
}
|
179
|
+
}
|
180
|
+
} );
|
181
|
+
|
182
|
+
return jQuery;
|
183
|
+
} );
|