Version Description
- Updated bundled jQuery-Mobile to 1.5-rc for WordPress 5.6+ without jQuery-Migrate and fixed JavaScript errors
- Fixed panels overlapping on smaller screens on the edit slider screen
- Fixed 'forced' size mode responsiveness to remove unwanted gap under the slider
Download this release
Release Info
Developer | Cryout Creations |
Plugin | Serious Slider |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.2.1
- cryout-serious-slider.php +11 -6
- readme.txt +9 -3
- resources/backend.css +1 -1
- resources/jquery.mobile.custom-1.4.5.js +864 -0
- resources/jquery.mobile.custom-1.4.5.min.js +3 -0
- resources/jquery.mobile.custom.js +1388 -303
- resources/jquery.mobile.custom.min.js +2 -2
- resources/style.css +5 -1
cryout-serious-slider.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Plugin Name: Cryout Serious Slider
|
3 |
Plugin URI: https://www.cryoutcreations.eu/wordpress-plugins/cryout-serious-slider
|
4 |
Description: A highly efficient SEO friendly fully translatable accessibility ready free image slider for WordPress. Seriously!
|
5 |
-
Version: 1.2.
|
6 |
Author: Cryout Creations
|
7 |
Author URI: https://www.cryoutcreations.eu
|
8 |
Text Domain: cryout-serious-slider
|
@@ -15,13 +15,13 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
15 |
|
16 |
class Cryout_Serious_Slider {
|
17 |
|
18 |
-
public $version = "1.2.
|
19 |
public $options = array();
|
20 |
public $shortcode_tag = 'serious-slider';
|
21 |
public $mce_tag = 'serious_slider';
|
22 |
|
23 |
public $slug = 'cryout-serious-slider';
|
24 |
-
public $posttype = 'cryout_serious_slide'; // 20 chars!
|
25 |
public $taxonomy = 'cryout_serious_slider_category';
|
26 |
|
27 |
private $butts = 2;
|
@@ -210,7 +210,12 @@ class Cryout_Serious_Slider {
|
|
210 |
* frontend enqueues
|
211 |
***********************/
|
212 |
public function enqueue_scripts() {
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
214 |
wp_enqueue_script( 'cryout-serious-slider-script', plugins_url( 'resources/slider.js', __FILE__ ), NULL, $this->version );
|
215 |
} // enqueue_scripts()
|
216 |
|
@@ -247,9 +252,9 @@ class Cryout_Serious_Slider {
|
|
247 |
// Check plugin
|
248 |
if ( $file === plugin_basename( __FILE__ ) ) {
|
249 |
unset( $links[2] );
|
250 |
-
$links[] = '<a href="
|
251 |
$links[] = '<a href="https://www.cryoutcreations.eu/forums/f/wordpress/plugins/serious-slider" target="_blank">' . __( 'Support forum', 'cryout-serious-slider' ) . '</a>';
|
252 |
-
$links[] = '<a href="
|
253 |
}
|
254 |
return $links;
|
255 |
}
|
2 |
Plugin Name: Cryout Serious Slider
|
3 |
Plugin URI: https://www.cryoutcreations.eu/wordpress-plugins/cryout-serious-slider
|
4 |
Description: A highly efficient SEO friendly fully translatable accessibility ready free image slider for WordPress. Seriously!
|
5 |
+
Version: 1.2.1
|
6 |
Author: Cryout Creations
|
7 |
Author URI: https://www.cryoutcreations.eu
|
8 |
Text Domain: cryout-serious-slider
|
15 |
|
16 |
class Cryout_Serious_Slider {
|
17 |
|
18 |
+
public $version = "1.2.1";
|
19 |
public $options = array();
|
20 |
public $shortcode_tag = 'serious-slider';
|
21 |
public $mce_tag = 'serious_slider';
|
22 |
|
23 |
public $slug = 'cryout-serious-slider';
|
24 |
+
public $posttype = 'cryout_serious_slide'; // 20 chars max!
|
25 |
public $taxonomy = 'cryout_serious_slider_category';
|
26 |
|
27 |
private $butts = 2;
|
210 |
* frontend enqueues
|
211 |
***********************/
|
212 |
public function enqueue_scripts() {
|
213 |
+
if(version_compare(get_bloginfo('version'),'5.6', '<') )
|
214 |
+
// jQuery-mobile 1.4.5 for WP < 5.6
|
215 |
+
wp_enqueue_script( 'cryout-serious-slider-jquerymobile', plugins_url( 'resources/jquery.mobile.custom-145.min.js', __FILE__ ), array('jquery'), $this->version );
|
216 |
+
else
|
217 |
+
// jQuery-mobile 1.5.0-rc for WP 5.6 with jQuery 3.5 and no jQuery-Migrate
|
218 |
+
wp_enqueue_script( 'cryout-serious-slider-jquerymobile', plugins_url( 'resources/jquery.mobile.custom.min.js', __FILE__ ), array('jquery'), $this->version );
|
219 |
wp_enqueue_script( 'cryout-serious-slider-script', plugins_url( 'resources/slider.js', __FILE__ ), NULL, $this->version );
|
220 |
} // enqueue_scripts()
|
221 |
|
252 |
// Check plugin
|
253 |
if ( $file === plugin_basename( __FILE__ ) ) {
|
254 |
unset( $links[2] );
|
255 |
+
$links[] = '<a href="https://www.cryoutcreations.eu/wordpress-plugins/cryout-serious-slider" target="_blank">' . __( 'Plugin homepage', 'cryout-serious-slider' ) . '</a>';
|
256 |
$links[] = '<a href="https://www.cryoutcreations.eu/forums/f/wordpress/plugins/serious-slider" target="_blank">' . __( 'Support forum', 'cryout-serious-slider' ) . '</a>';
|
257 |
+
$links[] = '<a href="https://wordpress.org/plugins/cryout-serious-slider/#developers" target="_blank">' . __( 'Changelog', 'cryout-serious-slider' ) . '</a>';
|
258 |
}
|
259 |
return $links;
|
260 |
}
|
readme.txt
CHANGED
@@ -5,9 +5,10 @@ License: GPLv3
|
|
5 |
License URI: http://www.gnu.org/licenses/gpl.html
|
6 |
Tags: slider, slideshow, image slider, responsive slider, wordpress slider
|
7 |
Text Domain: cryout-serious-slider
|
8 |
-
Requires at least: 4.
|
9 |
-
|
10 |
-
|
|
|
11 |
|
12 |
Serious Slider is a highly efficient SEO friendly fully translatable accessibility ready free image slider for WordPress. Seriously!
|
13 |
|
@@ -99,6 +100,11 @@ Serious Slider works with all WordPress themes and has been designed to integrat
|
|
99 |
|
100 |
== Changelog ==
|
101 |
|
|
|
|
|
|
|
|
|
|
|
102 |
= 1.2.0 =
|
103 |
* Added the third 'forced' images size mode for sliders
|
104 |
* Added forced support for Polylang multilingual plugin
|
5 |
License URI: http://www.gnu.org/licenses/gpl.html
|
6 |
Tags: slider, slideshow, image slider, responsive slider, wordpress slider
|
7 |
Text Domain: cryout-serious-slider
|
8 |
+
Requires at least: 4.5
|
9 |
+
Requires PHP: 5.4
|
10 |
+
Tested up to: 5.7.0
|
11 |
+
Stable tag: 1.2.1
|
12 |
|
13 |
Serious Slider is a highly efficient SEO friendly fully translatable accessibility ready free image slider for WordPress. Seriously!
|
14 |
|
100 |
|
101 |
== Changelog ==
|
102 |
|
103 |
+
= 1.2.1 =
|
104 |
+
* Updated bundled jQuery-Mobile to 1.5-rc for WordPress 5.6+ without jQuery-Migrate and fixed JavaScript errors
|
105 |
+
* Fixed panels overlapping on smaller screens on the edit slider screen
|
106 |
+
* Fixed 'forced' size mode responsiveness to remove unwanted gap under the slider
|
107 |
+
|
108 |
= 1.2.0 =
|
109 |
* Added the third 'forced' images size mode for sliders
|
110 |
* Added forced support for Polylang multilingual plugin
|
resources/backend.css
CHANGED
@@ -346,7 +346,7 @@ select#filter-by-date {
|
|
346 |
width: 100%;
|
347 |
background: #eee;
|
348 |
max-width: 800px;
|
349 |
-
float:
|
350 |
}
|
351 |
}
|
352 |
|
346 |
width: 100%;
|
347 |
background: #eee;
|
348 |
max-width: 800px;
|
349 |
+
float: none;
|
350 |
}
|
351 |
}
|
352 |
|
resources/jquery.mobile.custom-1.4.5.js
ADDED
@@ -0,0 +1,864 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery Mobile v1.4.5
|
3 |
+
* http://jquerymobile.com
|
4 |
+
*
|
5 |
+
* Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors
|
6 |
+
* Released under the MIT license.
|
7 |
+
* http://jquery.org/license
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function ( root, doc, factory ) {
|
12 |
+
if ( typeof define === "function" && define.amd ) {
|
13 |
+
// AMD. Register as an anonymous module.
|
14 |
+
define( [ "jquery" ], function ( $ ) {
|
15 |
+
factory( $, root, doc );
|
16 |
+
return $.mobile;
|
17 |
+
});
|
18 |
+
} else {
|
19 |
+
// Browser globals
|
20 |
+
factory( root.jQuery, root, doc );
|
21 |
+
}
|
22 |
+
}( this, document, function ( jQuery, window, document, undefined ) {// This plugin is an experiment for abstracting away the touch and mouse
|
23 |
+
// events so that developers don't have to worry about which method of input
|
24 |
+
// the device their document is loaded on supports.
|
25 |
+
//
|
26 |
+
// The idea here is to allow the developer to register listeners for the
|
27 |
+
// basic mouse events, such as mousedown, mousemove, mouseup, and click,
|
28 |
+
// and the plugin will take care of registering the correct listeners
|
29 |
+
// behind the scenes to invoke the listener at the fastest possible time
|
30 |
+
// for that device, while still retaining the order of event firing in
|
31 |
+
// the traditional mouse environment, should multiple handlers be registered
|
32 |
+
// on the same element for different events.
|
33 |
+
//
|
34 |
+
// The current version exposes the following virtual events to jQuery bind methods:
|
35 |
+
// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
|
36 |
+
|
37 |
+
(function( $, window, document, undefined ) {
|
38 |
+
|
39 |
+
var dataPropertyName = "virtualMouseBindings",
|
40 |
+
touchTargetPropertyName = "virtualTouchID",
|
41 |
+
virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
|
42 |
+
touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
|
43 |
+
mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],
|
44 |
+
mouseEventProps = $.event.props.concat( mouseHookProps ),
|
45 |
+
activeDocHandlers = {},
|
46 |
+
resetTimerID = 0,
|
47 |
+
startX = 0,
|
48 |
+
startY = 0,
|
49 |
+
didScroll = false,
|
50 |
+
clickBlockList = [],
|
51 |
+
blockMouseTriggers = false,
|
52 |
+
blockTouchTriggers = false,
|
53 |
+
eventCaptureSupported = "addEventListener" in document,
|
54 |
+
$document = $( document ),
|
55 |
+
nextTouchID = 1,
|
56 |
+
lastTouchID = 0, threshold,
|
57 |
+
i;
|
58 |
+
|
59 |
+
$.vmouse = {
|
60 |
+
moveDistanceThreshold: 10,
|
61 |
+
clickDistanceThreshold: 10,
|
62 |
+
resetTimerDuration: 1500
|
63 |
+
};
|
64 |
+
|
65 |
+
function getNativeEvent( event ) {
|
66 |
+
|
67 |
+
while ( event && typeof event.originalEvent !== "undefined" ) {
|
68 |
+
event = event.originalEvent;
|
69 |
+
}
|
70 |
+
return event;
|
71 |
+
}
|
72 |
+
|
73 |
+
function createVirtualEvent( event, eventType ) {
|
74 |
+
|
75 |
+
var t = event.type,
|
76 |
+
oe, props, ne, prop, ct, touch, i, j, len;
|
77 |
+
|
78 |
+
event = $.Event( event );
|
79 |
+
event.type = eventType;
|
80 |
+
|
81 |
+
oe = event.originalEvent;
|
82 |
+
props = $.event.props;
|
83 |
+
|
84 |
+
// addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
|
85 |
+
// https://github.com/jquery/jquery-mobile/issues/3280
|
86 |
+
if ( t.search( /^(mouse|click)/ ) > -1 ) {
|
87 |
+
props = mouseEventProps;
|
88 |
+
}
|
89 |
+
|
90 |
+
// copy original event properties over to the new event
|
91 |
+
// this would happen if we could call $.event.fix instead of $.Event
|
92 |
+
// but we don't have a way to force an event to be fixed multiple times
|
93 |
+
if ( oe ) {
|
94 |
+
for ( i = props.length, prop; i; ) {
|
95 |
+
prop = props[ --i ];
|
96 |
+
event[ prop ] = oe[ prop ];
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
// make sure that if the mouse and click virtual events are generated
|
101 |
+
// without a .which one is defined
|
102 |
+
if ( t.search(/mouse(down|up)|click/) > -1 && !event.which ) {
|
103 |
+
event.which = 1;
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( t.search(/^touch/) !== -1 ) {
|
107 |
+
ne = getNativeEvent( oe );
|
108 |
+
t = ne.touches;
|
109 |
+
ct = ne.changedTouches;
|
110 |
+
touch = ( t && t.length ) ? t[0] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );
|
111 |
+
|
112 |
+
if ( touch ) {
|
113 |
+
for ( j = 0, len = touchEventProps.length; j < len; j++) {
|
114 |
+
prop = touchEventProps[ j ];
|
115 |
+
event[ prop ] = touch[ prop ];
|
116 |
+
}
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
return event;
|
121 |
+
}
|
122 |
+
|
123 |
+
function getVirtualBindingFlags( element ) {
|
124 |
+
|
125 |
+
var flags = {},
|
126 |
+
b, k;
|
127 |
+
|
128 |
+
while ( element ) {
|
129 |
+
|
130 |
+
b = $.data( element, dataPropertyName );
|
131 |
+
|
132 |
+
for ( k in b ) {
|
133 |
+
if ( b[ k ] ) {
|
134 |
+
flags[ k ] = flags.hasVirtualBinding = true;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
element = element.parentNode;
|
138 |
+
}
|
139 |
+
return flags;
|
140 |
+
}
|
141 |
+
|
142 |
+
function getClosestElementWithVirtualBinding( element, eventType ) {
|
143 |
+
var b;
|
144 |
+
while ( element ) {
|
145 |
+
|
146 |
+
b = $.data( element, dataPropertyName );
|
147 |
+
|
148 |
+
if ( b && ( !eventType || b[ eventType ] ) ) {
|
149 |
+
return element;
|
150 |
+
}
|
151 |
+
element = element.parentNode;
|
152 |
+
}
|
153 |
+
return null;
|
154 |
+
}
|
155 |
+
|
156 |
+
function enableTouchBindings() {
|
157 |
+
blockTouchTriggers = false;
|
158 |
+
}
|
159 |
+
|
160 |
+
function disableTouchBindings() {
|
161 |
+
blockTouchTriggers = true;
|
162 |
+
}
|
163 |
+
|
164 |
+
function enableMouseBindings() {
|
165 |
+
lastTouchID = 0;
|
166 |
+
clickBlockList.length = 0;
|
167 |
+
blockMouseTriggers = false;
|
168 |
+
|
169 |
+
// When mouse bindings are enabled, our
|
170 |
+
// touch bindings are disabled.
|
171 |
+
disableTouchBindings();
|
172 |
+
}
|
173 |
+
|
174 |
+
function disableMouseBindings() {
|
175 |
+
// When mouse bindings are disabled, our
|
176 |
+
// touch bindings are enabled.
|
177 |
+
enableTouchBindings();
|
178 |
+
}
|
179 |
+
|
180 |
+
function startResetTimer() {
|
181 |
+
clearResetTimer();
|
182 |
+
resetTimerID = setTimeout( function() {
|
183 |
+
resetTimerID = 0;
|
184 |
+
enableMouseBindings();
|
185 |
+
}, $.vmouse.resetTimerDuration );
|
186 |
+
}
|
187 |
+
|
188 |
+
function clearResetTimer() {
|
189 |
+
if ( resetTimerID ) {
|
190 |
+
clearTimeout( resetTimerID );
|
191 |
+
resetTimerID = 0;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
function triggerVirtualEvent( eventType, event, flags ) {
|
196 |
+
var ve;
|
197 |
+
|
198 |
+
if ( ( flags && flags[ eventType ] ) ||
|
199 |
+
( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) {
|
200 |
+
|
201 |
+
ve = createVirtualEvent( event, eventType );
|
202 |
+
|
203 |
+
$( event.target).trigger( ve );
|
204 |
+
}
|
205 |
+
|
206 |
+
return ve;
|
207 |
+
}
|
208 |
+
|
209 |
+
function mouseEventCallback( event ) {
|
210 |
+
var touchID = $.data( event.target, touchTargetPropertyName ),
|
211 |
+
ve;
|
212 |
+
|
213 |
+
if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) {
|
214 |
+
ve = triggerVirtualEvent( "v" + event.type, event );
|
215 |
+
if ( ve ) {
|
216 |
+
if ( ve.isDefaultPrevented() ) {
|
217 |
+
event.preventDefault();
|
218 |
+
}
|
219 |
+
if ( ve.isPropagationStopped() ) {
|
220 |
+
event.stopPropagation();
|
221 |
+
}
|
222 |
+
if ( ve.isImmediatePropagationStopped() ) {
|
223 |
+
event.stopImmediatePropagation();
|
224 |
+
}
|
225 |
+
}
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
function handleTouchStart( event ) {
|
230 |
+
|
231 |
+
var touches = getNativeEvent( event ).touches,
|
232 |
+
target, flags, t;
|
233 |
+
|
234 |
+
if ( touches && touches.length === 1 ) {
|
235 |
+
|
236 |
+
target = event.target;
|
237 |
+
flags = getVirtualBindingFlags( target );
|
238 |
+
|
239 |
+
if ( flags.hasVirtualBinding ) {
|
240 |
+
|
241 |
+
lastTouchID = nextTouchID++;
|
242 |
+
$.data( target, touchTargetPropertyName, lastTouchID );
|
243 |
+
|
244 |
+
clearResetTimer();
|
245 |
+
|
246 |
+
disableMouseBindings();
|
247 |
+
didScroll = false;
|
248 |
+
|
249 |
+
t = getNativeEvent( event ).touches[ 0 ];
|
250 |
+
startX = t.pageX;
|
251 |
+
startY = t.pageY;
|
252 |
+
|
253 |
+
triggerVirtualEvent( "vmouseover", event, flags );
|
254 |
+
triggerVirtualEvent( "vmousedown", event, flags );
|
255 |
+
}
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
function handleScroll( event ) {
|
260 |
+
if ( blockTouchTriggers ) {
|
261 |
+
return;
|
262 |
+
}
|
263 |
+
|
264 |
+
if ( !didScroll ) {
|
265 |
+
triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) );
|
266 |
+
}
|
267 |
+
|
268 |
+
didScroll = true;
|
269 |
+
startResetTimer();
|
270 |
+
}
|
271 |
+
|
272 |
+
function handleTouchMove( event ) {
|
273 |
+
if ( blockTouchTriggers ) {
|
274 |
+
return;
|
275 |
+
}
|
276 |
+
|
277 |
+
var t = getNativeEvent( event ).touches[ 0 ],
|
278 |
+
didCancel = didScroll,
|
279 |
+
moveThreshold = $.vmouse.moveDistanceThreshold,
|
280 |
+
flags = getVirtualBindingFlags( event.target );
|
281 |
+
|
282 |
+
didScroll = didScroll ||
|
283 |
+
( Math.abs( t.pageX - startX ) > moveThreshold ||
|
284 |
+
Math.abs( t.pageY - startY ) > moveThreshold );
|
285 |
+
|
286 |
+
if ( didScroll && !didCancel ) {
|
287 |
+
triggerVirtualEvent( "vmousecancel", event, flags );
|
288 |
+
}
|
289 |
+
|
290 |
+
triggerVirtualEvent( "vmousemove", event, flags );
|
291 |
+
startResetTimer();
|
292 |
+
}
|
293 |
+
|
294 |
+
function handleTouchEnd( event ) {
|
295 |
+
if ( blockTouchTriggers ) {
|
296 |
+
return;
|
297 |
+
}
|
298 |
+
|
299 |
+
disableTouchBindings();
|
300 |
+
|
301 |
+
var flags = getVirtualBindingFlags( event.target ),
|
302 |
+
ve, t;
|
303 |
+
triggerVirtualEvent( "vmouseup", event, flags );
|
304 |
+
|
305 |
+
if ( !didScroll ) {
|
306 |
+
ve = triggerVirtualEvent( "vclick", event, flags );
|
307 |
+
if ( ve && ve.isDefaultPrevented() ) {
|
308 |
+
// The target of the mouse events that follow the touchend
|
309 |
+
// event don't necessarily match the target used during the
|
310 |
+
// touch. This means we need to rely on coordinates for blocking
|
311 |
+
// any click that is generated.
|
312 |
+
t = getNativeEvent( event ).changedTouches[ 0 ];
|
313 |
+
clickBlockList.push({
|
314 |
+
touchID: lastTouchID,
|
315 |
+
x: t.clientX,
|
316 |
+
y: t.clientY
|
317 |
+
});
|
318 |
+
|
319 |
+
// Prevent any mouse events that follow from triggering
|
320 |
+
// virtual event notifications.
|
321 |
+
blockMouseTriggers = true;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
triggerVirtualEvent( "vmouseout", event, flags);
|
325 |
+
didScroll = false;
|
326 |
+
|
327 |
+
startResetTimer();
|
328 |
+
}
|
329 |
+
|
330 |
+
function hasVirtualBindings( ele ) {
|
331 |
+
var bindings = $.data( ele, dataPropertyName ),
|
332 |
+
k;
|
333 |
+
|
334 |
+
if ( bindings ) {
|
335 |
+
for ( k in bindings ) {
|
336 |
+
if ( bindings[ k ] ) {
|
337 |
+
return true;
|
338 |
+
}
|
339 |
+
}
|
340 |
+
}
|
341 |
+
return false;
|
342 |
+
}
|
343 |
+
|
344 |
+
function dummyMouseHandler() {}
|
345 |
+
|
346 |
+
function getSpecialEventObject( eventType ) {
|
347 |
+
var realType = eventType.substr( 1 );
|
348 |
+
|
349 |
+
return {
|
350 |
+
setup: function(/* data, namespace */) {
|
351 |
+
// If this is the first virtual mouse binding for this element,
|
352 |
+
// add a bindings object to its data.
|
353 |
+
|
354 |
+
if ( !hasVirtualBindings( this ) ) {
|
355 |
+
$.data( this, dataPropertyName, {} );
|
356 |
+
}
|
357 |
+
|
358 |
+
// If setup is called, we know it is the first binding for this
|
359 |
+
// eventType, so initialize the count for the eventType to zero.
|
360 |
+
var bindings = $.data( this, dataPropertyName );
|
361 |
+
bindings[ eventType ] = true;
|
362 |
+
|
363 |
+
// If this is the first virtual mouse event for this type,
|
364 |
+
// register a global handler on the document.
|
365 |
+
|
366 |
+
activeDocHandlers[ eventType ] = ( activeDocHandlers[ eventType ] || 0 ) + 1;
|
367 |
+
|
368 |
+
if ( activeDocHandlers[ eventType ] === 1 ) {
|
369 |
+
$document.bind( realType, mouseEventCallback );
|
370 |
+
}
|
371 |
+
|
372 |
+
// Some browsers, like Opera Mini, won't dispatch mouse/click events
|
373 |
+
// for elements unless they actually have handlers registered on them.
|
374 |
+
// To get around this, we register dummy handlers on the elements.
|
375 |
+
|
376 |
+
$( this ).bind( realType, dummyMouseHandler );
|
377 |
+
|
378 |
+
// For now, if event capture is not supported, we rely on mouse handlers.
|
379 |
+
if ( eventCaptureSupported ) {
|
380 |
+
// If this is the first virtual mouse binding for the document,
|
381 |
+
// register our touchstart handler on the document.
|
382 |
+
|
383 |
+
activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1;
|
384 |
+
|
385 |
+
if ( activeDocHandlers[ "touchstart" ] === 1 ) {
|
386 |
+
$document.bind( "touchstart", handleTouchStart )
|
387 |
+
.bind( "touchend", handleTouchEnd )
|
388 |
+
|
389 |
+
// On touch platforms, touching the screen and then dragging your finger
|
390 |
+
// causes the window content to scroll after some distance threshold is
|
391 |
+
// exceeded. On these platforms, a scroll prevents a click event from being
|
392 |
+
// dispatched, and on some platforms, even the touchend is suppressed. To
|
393 |
+
// mimic the suppression of the click event, we need to watch for a scroll
|
394 |
+
// event. Unfortunately, some platforms like iOS don't dispatch scroll
|
395 |
+
// events until *AFTER* the user lifts their finger (touchend). This means
|
396 |
+
// we need to watch both scroll and touchmove events to figure out whether
|
397 |
+
// or not a scroll happenens before the touchend event is fired.
|
398 |
+
|
399 |
+
.bind( "touchmove", handleTouchMove )
|
400 |
+
.bind( "scroll", handleScroll );
|
401 |
+
}
|
402 |
+
}
|
403 |
+
},
|
404 |
+
|
405 |
+
teardown: function(/* data, namespace */) {
|
406 |
+
// If this is the last virtual binding for this eventType,
|
407 |
+
// remove its global handler from the document.
|
408 |
+
|
409 |
+
--activeDocHandlers[ eventType ];
|
410 |
+
|
411 |
+
if ( !activeDocHandlers[ eventType ] ) {
|
412 |
+
$document.unbind( realType, mouseEventCallback );
|
413 |
+
}
|
414 |
+
|
415 |
+
if ( eventCaptureSupported ) {
|
416 |
+
// If this is the last virtual mouse binding in existence,
|
417 |
+
// remove our document touchstart listener.
|
418 |
+
|
419 |
+
--activeDocHandlers[ "touchstart" ];
|
420 |
+
|
421 |
+
if ( !activeDocHandlers[ "touchstart" ] ) {
|
422 |
+
$document.unbind( "touchstart", handleTouchStart )
|
423 |
+
.unbind( "touchmove", handleTouchMove )
|
424 |
+
.unbind( "touchend", handleTouchEnd )
|
425 |
+
.unbind( "scroll", handleScroll );
|
426 |
+
}
|
427 |
+
}
|
428 |
+
|
429 |
+
var $this = $( this ),
|
430 |
+
bindings = $.data( this, dataPropertyName );
|
431 |
+
|
432 |
+
// teardown may be called when an element was
|
433 |
+
// removed from the DOM. If this is the case,
|
434 |
+
// jQuery core may have already stripped the element
|
435 |
+
// of any data bindings so we need to check it before
|
436 |
+
// using it.
|
437 |
+
if ( bindings ) {
|
438 |
+
bindings[ eventType ] = false;
|
439 |
+
}
|
440 |
+
|
441 |
+
// Unregister the dummy event handler.
|
442 |
+
|
443 |
+
$this.unbind( realType, dummyMouseHandler );
|
444 |
+
|
445 |
+
// If this is the last virtual mouse binding on the
|
446 |
+
// element, remove the binding data from the element.
|
447 |
+
|
448 |
+
if ( !hasVirtualBindings( this ) ) {
|
449 |
+
$this.removeData( dataPropertyName );
|
450 |
+
}
|
451 |
+
}
|
452 |
+
};
|
453 |
+
}
|
454 |
+
|
455 |
+
// Expose our custom events to the jQuery bind/unbind mechanism.
|
456 |
+
|
457 |
+
for ( i = 0; i < virtualEventNames.length; i++ ) {
|
458 |
+
$.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] );
|
459 |
+
}
|
460 |
+
|
461 |
+
// Add a capture click handler to block clicks.
|
462 |
+
// Note that we require event capture support for this so if the device
|
463 |
+
// doesn't support it, we punt for now and rely solely on mouse events.
|
464 |
+
if ( eventCaptureSupported ) {
|
465 |
+
document.addEventListener( "click", function( e ) {
|
466 |
+
var cnt = clickBlockList.length,
|
467 |
+
target = e.target,
|
468 |
+
x, y, ele, i, o, touchID;
|
469 |
+
|
470 |
+
if ( cnt ) {
|
471 |
+
x = e.clientX;
|
472 |
+
y = e.clientY;
|
473 |
+
threshold = $.vmouse.clickDistanceThreshold;
|
474 |
+
|
475 |
+
// The idea here is to run through the clickBlockList to see if
|
476 |
+
// the current click event is in the proximity of one of our
|
477 |
+
// vclick events that had preventDefault() called on it. If we find
|
478 |
+
// one, then we block the click.
|
479 |
+
//
|
480 |
+
// Why do we have to rely on proximity?
|
481 |
+
//
|
482 |
+
// Because the target of the touch event that triggered the vclick
|
483 |
+
// can be different from the target of the click event synthesized
|
484 |
+
// by the browser. The target of a mouse/click event that is synthesized
|
485 |
+
// from a touch event seems to be implementation specific. For example,
|
486 |
+
// some browsers will fire mouse/click events for a link that is near
|
487 |
+
// a touch event, even though the target of the touchstart/touchend event
|
488 |
+
// says the user touched outside the link. Also, it seems that with most
|
489 |
+
// browsers, the target of the mouse/click event is not calculated until the
|
490 |
+
// time it is dispatched, so if you replace an element that you touched
|
491 |
+
// with another element, the target of the mouse/click will be the new
|
492 |
+
// element underneath that point.
|
493 |
+
//
|
494 |
+
// Aside from proximity, we also check to see if the target and any
|
495 |
+
// of its ancestors were the ones that blocked a click. This is necessary
|
496 |
+
// because of the strange mouse/click target calculation done in the
|
497 |
+
// Android 2.1 browser, where if you click on an element, and there is a
|
498 |
+
// mouse/click handler on one of its ancestors, the target will be the
|
499 |
+
// innermost child of the touched element, even if that child is no where
|
500 |
+
// near the point of touch.
|
501 |
+
|
502 |
+
ele = target;
|
503 |
+
|
504 |
+
while ( ele ) {
|
505 |
+
for ( i = 0; i < cnt; i++ ) {
|
506 |
+
o = clickBlockList[ i ];
|
507 |
+
touchID = 0;
|
508 |
+
|
509 |
+
if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
|
510 |
+
$.data( ele, touchTargetPropertyName ) === o.touchID ) {
|
511 |
+
// XXX: We may want to consider removing matches from the block list
|
512 |
+
// instead of waiting for the reset timer to fire.
|
513 |
+
e.preventDefault();
|
514 |
+
e.stopPropagation();
|
515 |
+
return;
|
516 |
+
}
|
517 |
+
}
|
518 |
+
ele = ele.parentNode;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
}, true);
|
522 |
+
}
|
523 |
+
})( jQuery, window, document );
|
524 |
+
|
525 |
+
(function( $ ) {
|
526 |
+
$.mobile = {};
|
527 |
+
}( jQuery ));
|
528 |
+
|
529 |
+
(function( $, undefined ) {
|
530 |
+
var support = {
|
531 |
+
touch: "ontouchend" in document
|
532 |
+
};
|
533 |
+
|
534 |
+
$.mobile.support = $.mobile.support || {};
|
535 |
+
$.extend( $.support, support );
|
536 |
+
$.extend( $.mobile.support, support );
|
537 |
+
}( jQuery ));
|
538 |
+
|
539 |
+
|
540 |
+
(function( $, window, undefined ) {
|
541 |
+
var $document = $( document ),
|
542 |
+
supportTouch = $.mobile.support.touch,
|
543 |
+
scrollEvent = "touchmove scroll",
|
544 |
+
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
|
545 |
+
touchStopEvent = supportTouch ? "touchend" : "mouseup",
|
546 |
+
touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
|
547 |
+
|
548 |
+
// setup new event shortcuts
|
549 |
+
$.each( ( "touchstart touchmove touchend " +
|
550 |
+
"tap taphold " +
|
551 |
+
"swipe swipeleft swiperight " +
|
552 |
+
"scrollstart scrollstop" ).split( " " ), function( i, name ) {
|
553 |
+
|
554 |
+
$.fn[ name ] = function( fn ) {
|
555 |
+
return fn ? this.bind( name, fn ) : this.trigger( name );
|
556 |
+
};
|
557 |
+
|
558 |
+
// jQuery < 1.8
|
559 |
+
if ( $.attrFn ) {
|
560 |
+
$.attrFn[ name ] = true;
|
561 |
+
}
|
562 |
+
});
|
563 |
+
|
564 |
+
function triggerCustomEvent( obj, eventType, event, bubble ) {
|
565 |
+
var originalType = event.type;
|
566 |
+
event.type = eventType;
|
567 |
+
if ( bubble ) {
|
568 |
+
$.event.trigger( event, undefined, obj );
|
569 |
+
} else {
|
570 |
+
$.event.dispatch.call( obj, event );
|
571 |
+
}
|
572 |
+
event.type = originalType;
|
573 |
+
}
|
574 |
+
|
575 |
+
// also handles scrollstop
|
576 |
+
$.event.special.scrollstart = {
|
577 |
+
|
578 |
+
enabled: true,
|
579 |
+
setup: function() {
|
580 |
+
|
581 |
+
var thisObject = this,
|
582 |
+
$this = $( thisObject ),
|
583 |
+
scrolling,
|
584 |
+
timer;
|
585 |
+
|
586 |
+
function trigger( event, state ) {
|
587 |
+
scrolling = state;
|
588 |
+
triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event );
|
589 |
+
}
|
590 |
+
|
591 |
+
// iPhone triggers scroll after a small delay; use touchmove instead
|
592 |
+
$this.bind( scrollEvent, function( event ) {
|
593 |
+
|
594 |
+
if ( !$.event.special.scrollstart.enabled ) {
|
595 |
+
return;
|
596 |
+
}
|
597 |
+
|
598 |
+
if ( !scrolling ) {
|
599 |
+
trigger( event, true );
|
600 |
+
}
|
601 |
+
|
602 |
+
clearTimeout( timer );
|
603 |
+
timer = setTimeout( function() {
|
604 |
+
trigger( event, false );
|
605 |
+
}, 50 );
|
606 |
+
});
|
607 |
+
},
|
608 |
+
teardown: function() {
|
609 |
+
$( this ).unbind( scrollEvent );
|
610 |
+
}
|
611 |
+
};
|
612 |
+
|
613 |
+
// also handles taphold
|
614 |
+
$.event.special.tap = {
|
615 |
+
tapholdThreshold: 750,
|
616 |
+
emitTapOnTaphold: true,
|
617 |
+
setup: function() {
|
618 |
+
var thisObject = this,
|
619 |
+
$this = $( thisObject ),
|
620 |
+
isTaphold = false;
|
621 |
+
|
622 |
+
$this.bind( "vmousedown", function( event ) {
|
623 |
+
isTaphold = false;
|
624 |
+
if ( event.which && event.which !== 1 ) {
|
625 |
+
return false;
|
626 |
+
}
|
627 |
+
|
628 |
+
var origTarget = event.target,
|
629 |
+
timer;
|
630 |
+
|
631 |
+
function clearTapTimer() {
|
632 |
+
clearTimeout( timer );
|
633 |
+
}
|
634 |
+
|
635 |
+
function clearTapHandlers() {
|
636 |
+
clearTapTimer();
|
637 |
+
|
638 |
+
$this.unbind( "vclick", clickHandler )
|
639 |
+
.unbind( "vmouseup", clearTapTimer );
|
640 |
+
$document.unbind( "vmousecancel", clearTapHandlers );
|
641 |
+
}
|
642 |
+
|
643 |
+
function clickHandler( event ) {
|
644 |
+
clearTapHandlers();
|
645 |
+
|
646 |
+
// ONLY trigger a 'tap' event if the start target is
|
647 |
+
// the same as the stop target.
|
648 |
+
if ( !isTaphold && origTarget === event.target ) {
|
649 |
+
triggerCustomEvent( thisObject, "tap", event );
|
650 |
+
} else if ( isTaphold ) {
|
651 |
+
event.preventDefault();
|
652 |
+
}
|
653 |
+
}
|
654 |
+
|
655 |
+
$this.bind( "vmouseup", clearTapTimer )
|
656 |
+
.bind( "vclick", clickHandler );
|
657 |
+
$document.bind( "vmousecancel", clearTapHandlers );
|
658 |
+
|
659 |
+
timer = setTimeout( function() {
|
660 |
+
if ( !$.event.special.tap.emitTapOnTaphold ) {
|
661 |
+
isTaphold = true;
|
662 |
+
}
|
663 |
+
triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
|
664 |
+
}, $.event.special.tap.tapholdThreshold );
|
665 |
+
});
|
666 |
+
},
|
667 |
+
teardown: function() {
|
668 |
+
$( this ).unbind( "vmousedown" ).unbind( "vclick" ).unbind( "vmouseup" );
|
669 |
+
$document.unbind( "vmousecancel" );
|
670 |
+
}
|
671 |
+
};
|
672 |
+
|
673 |
+
// Also handles swipeleft, swiperight
|
674 |
+
$.event.special.swipe = {
|
675 |
+
|
676 |
+
// More than this horizontal displacement, and we will suppress scrolling.
|
677 |
+
scrollSupressionThreshold: 30,
|
678 |
+
|
679 |
+
// More time than this, and it isn't a swipe.
|
680 |
+
durationThreshold: 1000,
|
681 |
+
|
682 |
+
// Swipe horizontal displacement must be more than this.
|
683 |
+
horizontalDistanceThreshold: 30,
|
684 |
+
|
685 |
+
// Swipe vertical displacement must be less than this.
|
686 |
+
verticalDistanceThreshold: 30,
|
687 |
+
|
688 |
+
getLocation: function ( event ) {
|
689 |
+
var winPageX = window.pageXOffset,
|
690 |
+
winPageY = window.pageYOffset,
|
691 |
+
x = event.clientX,
|
692 |
+
y = event.clientY;
|
693 |
+
|
694 |
+
if ( event.pageY === 0 && Math.floor( y ) > Math.floor( event.pageY ) ||
|
695 |
+
event.pageX === 0 && Math.floor( x ) > Math.floor( event.pageX ) ) {
|
696 |
+
|
697 |
+
// iOS4 clientX/clientY have the value that should have been
|
698 |
+
// in pageX/pageY. While pageX/page/ have the value 0
|
699 |
+
x = x - winPageX;
|
700 |
+
y = y - winPageY;
|
701 |
+
} else if ( y < ( event.pageY - winPageY) || x < ( event.pageX - winPageX ) ) {
|
702 |
+
|
703 |
+
// Some Android browsers have totally bogus values for clientX/Y
|
704 |
+
// when scrolling/zooming a page. Detectable since clientX/clientY
|
705 |
+
// should never be smaller than pageX/pageY minus page scroll
|
706 |
+
x = event.pageX - winPageX;
|
707 |
+
y = event.pageY - winPageY;
|
708 |
+
}
|
709 |
+
|
710 |
+
return {
|
711 |
+
x: x,
|
712 |
+
y: y
|
713 |
+
};
|
714 |
+
},
|
715 |
+
|
716 |
+
start: function( event ) {
|
717 |
+
var data = event.originalEvent.touches ?
|
718 |
+
event.originalEvent.touches[ 0 ] : event,
|
719 |
+
location = $.event.special.swipe.getLocation( data );
|
720 |
+
return {
|
721 |
+
time: ( new Date() ).getTime(),
|
722 |
+
coords: [ location.x, location.y ],
|
723 |
+
origin: $( event.target )
|
724 |
+
};
|
725 |
+
},
|
726 |
+
|
727 |
+
stop: function( event ) {
|
728 |
+
var data = event.originalEvent.touches ?
|
729 |
+
event.originalEvent.touches[ 0 ] : event,
|
730 |
+
location = $.event.special.swipe.getLocation( data );
|
731 |
+
return {
|
732 |
+
time: ( new Date() ).getTime(),
|
733 |
+
coords: [ location.x, location.y ]
|
734 |
+
};
|
735 |
+
},
|
736 |
+
|
737 |
+
handleSwipe: function( start, stop, thisObject, origTarget ) {
|
738 |
+
if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
|
739 |
+
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
|
740 |
+
Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
|
741 |
+
var direction = start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight";
|
742 |
+
|
743 |
+
triggerCustomEvent( thisObject, "swipe", $.Event( "swipe", { target: origTarget, swipestart: start, swipestop: stop }), true );
|
744 |
+
triggerCustomEvent( thisObject, direction,$.Event( direction, { target: origTarget, swipestart: start, swipestop: stop } ), true );
|
745 |
+
return true;
|
746 |
+
}
|
747 |
+
return false;
|
748 |
+
|
749 |
+
},
|
750 |
+
|
751 |
+
// This serves as a flag to ensure that at most one swipe event event is
|
752 |
+
// in work at any given time
|
753 |
+
eventInProgress: false,
|
754 |
+
|
755 |
+
setup: function() {
|
756 |
+
var events,
|
757 |
+
thisObject = this,
|
758 |
+
$this = $( thisObject ),
|
759 |
+
context = {};
|
760 |
+
|
761 |
+
// Retrieve the events data for this element and add the swipe context
|
762 |
+
events = $.data( this, "mobile-events" );
|
763 |
+
if ( !events ) {
|
764 |
+
events = { length: 0 };
|
765 |
+
$.data( this, "mobile-events", events );
|
766 |
+
}
|
767 |
+
events.length++;
|
768 |
+
events.swipe = context;
|
769 |
+
|
770 |
+
context.start = function( event ) {
|
771 |
+
|
772 |
+
// Bail if we're already working on a swipe event
|
773 |
+
if ( $.event.special.swipe.eventInProgress ) {
|
774 |
+
return;
|
775 |
+
}
|
776 |
+
$.event.special.swipe.eventInProgress = true;
|
777 |
+
|
778 |
+
var stop,
|
779 |
+
start = $.event.special.swipe.start( event ),
|
780 |
+
origTarget = event.target,
|
781 |
+
emitted = false;
|
782 |
+
|
783 |
+
context.move = function( event ) {
|
784 |
+
if ( !start || event.isDefaultPrevented() ) {
|
785 |
+
return;
|
786 |
+
}
|
787 |
+
|
788 |
+
stop = $.event.special.swipe.stop( event );
|
789 |
+
if ( !emitted ) {
|
790 |
+
emitted = $.event.special.swipe.handleSwipe( start, stop, thisObject, origTarget );
|
791 |
+
if ( emitted ) {
|
792 |
+
|
793 |
+
// Reset the context to make way for the next swipe event
|
794 |
+
$.event.special.swipe.eventInProgress = false;
|
795 |
+
}
|
796 |
+
}
|
797 |
+
// prevent scrolling
|
798 |
+
if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
|
799 |
+
event.preventDefault();
|
800 |
+
}
|
801 |
+
};
|
802 |
+
|
803 |
+
context.stop = function() {
|
804 |
+
emitted = true;
|
805 |
+
|
806 |
+
// Reset the context to make way for the next swipe event
|
807 |
+
$.event.special.swipe.eventInProgress = false;
|
808 |
+
$document.off( touchMoveEvent, context.move );
|
809 |
+
context.move = null;
|
810 |
+
};
|
811 |
+
|
812 |
+
$document.on( touchMoveEvent, context.move )
|
813 |
+
.one( touchStopEvent, context.stop );
|
814 |
+
};
|
815 |
+
$this.on( touchStartEvent, context.start );
|
816 |
+
},
|
817 |
+
|
818 |
+
teardown: function() {
|
819 |
+
var events, context;
|
820 |
+
|
821 |
+
events = $.data( this, "mobile-events" );
|
822 |
+
if ( events ) {
|
823 |
+
context = events.swipe;
|
824 |
+
delete events.swipe;
|
825 |
+
events.length--;
|
826 |
+
if ( events.length === 0 ) {
|
827 |
+
$.removeData( this, "mobile-events" );
|
828 |
+
}
|
829 |
+
}
|
830 |
+
|
831 |
+
if ( context ) {
|
832 |
+
if ( context.start ) {
|
833 |
+
$( this ).off( touchStartEvent, context.start );
|
834 |
+
}
|
835 |
+
if ( context.move ) {
|
836 |
+
$document.off( touchMoveEvent, context.move );
|
837 |
+
}
|
838 |
+
if ( context.stop ) {
|
839 |
+
$document.off( touchStopEvent, context.stop );
|
840 |
+
}
|
841 |
+
}
|
842 |
+
}
|
843 |
+
};
|
844 |
+
$.each({
|
845 |
+
scrollstop: "scrollstart",
|
846 |
+
taphold: "tap",
|
847 |
+
swipeleft: "swipe.left",
|
848 |
+
swiperight: "swipe.right"
|
849 |
+
}, function( event, sourceEvent ) {
|
850 |
+
|
851 |
+
$.event.special[ event ] = {
|
852 |
+
setup: function() {
|
853 |
+
$( this ).bind( sourceEvent, $.noop );
|
854 |
+
},
|
855 |
+
teardown: function() {
|
856 |
+
$( this ).unbind( sourceEvent );
|
857 |
+
}
|
858 |
+
};
|
859 |
+
});
|
860 |
+
|
861 |
+
})( jQuery, this );
|
862 |
+
|
863 |
+
|
864 |
+
}));
|
resources/jquery.mobile.custom-1.4.5.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */
|
2 |
+
|
3 |
+
(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)});
|
resources/jquery.mobile.custom.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/*
|
2 |
-
* jQuery Mobile v1.
|
3 |
* http://jquerymobile.com
|
4 |
*
|
5 |
-
* Copyright
|
6 |
* Released under the MIT license.
|
7 |
* http://jquery.org/license
|
8 |
*
|
@@ -19,7 +19,124 @@
|
|
19 |
// Browser globals
|
20 |
factory( root.jQuery, root, doc );
|
21 |
}
|
22 |
-
}( this, document, function ( jQuery, window, document, undefined ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
// events so that developers don't have to worry about which method of input
|
24 |
// the device their document is loaded on supports.
|
25 |
//
|
@@ -34,14 +151,26 @@
|
|
34 |
// The current version exposes the following virtual events to jQuery bind methods:
|
35 |
// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
|
36 |
|
37 |
-
(function(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
var dataPropertyName = "virtualMouseBindings",
|
40 |
touchTargetPropertyName = "virtualTouchID",
|
41 |
-
virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
|
42 |
touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
|
|
|
|
|
|
|
43 |
mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],
|
44 |
-
mouseEventProps =
|
45 |
activeDocHandlers = {},
|
46 |
resetTimerID = 0,
|
47 |
startX = 0,
|
@@ -59,7 +188,8 @@ var dataPropertyName = "virtualMouseBindings",
|
|
59 |
$.vmouse = {
|
60 |
moveDistanceThreshold: 10,
|
61 |
clickDistanceThreshold: 10,
|
62 |
-
resetTimerDuration: 1500
|
|
|
63 |
};
|
64 |
|
65 |
function getNativeEvent( event ) {
|
@@ -79,7 +209,7 @@ function createVirtualEvent( event, eventType ) {
|
|
79 |
event.type = eventType;
|
80 |
|
81 |
oe = event.originalEvent;
|
82 |
-
props =
|
83 |
|
84 |
// addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
|
85 |
// https://github.com/jquery/jquery-mobile/issues/3280
|
@@ -91,7 +221,7 @@ function createVirtualEvent( event, eventType ) {
|
|
91 |
// this would happen if we could call $.event.fix instead of $.Event
|
92 |
// but we don't have a way to force an event to be fixed multiple times
|
93 |
if ( oe ) {
|
94 |
-
for ( i = props.length
|
95 |
prop = props[ --i ];
|
96 |
event[ prop ] = oe[ prop ];
|
97 |
}
|
@@ -99,18 +229,18 @@ function createVirtualEvent( event, eventType ) {
|
|
99 |
|
100 |
// make sure that if the mouse and click virtual events are generated
|
101 |
// without a .which one is defined
|
102 |
-
if ( t.search(/mouse(down|up)|click/) > -1 && !event.which ) {
|
103 |
event.which = 1;
|
104 |
}
|
105 |
|
106 |
-
if ( t.search(/^touch/) !== -1 ) {
|
107 |
ne = getNativeEvent( oe );
|
108 |
t = ne.touches;
|
109 |
ct = ne.changedTouches;
|
110 |
-
touch = ( t && t.length ) ? t[0] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );
|
111 |
|
112 |
if ( touch ) {
|
113 |
-
for ( j = 0, len = touchEventProps.length; j < len; j++) {
|
114 |
prop = touchEventProps[ j ];
|
115 |
event[ prop ] = touch[ prop ];
|
116 |
}
|
@@ -129,7 +259,7 @@ function getVirtualBindingFlags( element ) {
|
|
129 |
|
130 |
b = $.data( element, dataPropertyName );
|
131 |
|
132 |
-
for (
|
133 |
if ( b[ k ] ) {
|
134 |
flags[ k ] = flags.hasVirtualBinding = true;
|
135 |
}
|
@@ -177,6 +307,13 @@ function disableMouseBindings() {
|
|
177 |
enableTouchBindings();
|
178 |
}
|
179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
function startResetTimer() {
|
181 |
clearResetTimer();
|
182 |
resetTimerID = setTimeout( function() {
|
@@ -185,22 +322,15 @@ function startResetTimer() {
|
|
185 |
}, $.vmouse.resetTimerDuration );
|
186 |
}
|
187 |
|
188 |
-
function clearResetTimer() {
|
189 |
-
if ( resetTimerID ) {
|
190 |
-
clearTimeout( resetTimerID );
|
191 |
-
resetTimerID = 0;
|
192 |
-
}
|
193 |
-
}
|
194 |
-
|
195 |
function triggerVirtualEvent( eventType, event, flags ) {
|
196 |
var ve;
|
197 |
|
198 |
if ( ( flags && flags[ eventType ] ) ||
|
199 |
-
|
200 |
|
201 |
ve = createVirtualEvent( event, eventType );
|
202 |
|
203 |
-
$( event.target).trigger( ve );
|
204 |
}
|
205 |
|
206 |
return ve;
|
@@ -210,6 +340,22 @@ function mouseEventCallback( event ) {
|
|
210 |
var touchID = $.data( event.target, touchTargetPropertyName ),
|
211 |
ve;
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) {
|
214 |
ve = triggerVirtualEvent( "v" + event.type, event );
|
215 |
if ( ve ) {
|
@@ -236,6 +382,8 @@ function handleTouchStart( event ) {
|
|
236 |
target = event.target;
|
237 |
flags = getVirtualBindingFlags( target );
|
238 |
|
|
|
|
|
239 |
if ( flags.hasVirtualBinding ) {
|
240 |
|
241 |
lastTouchID = nextTouchID++;
|
@@ -265,6 +413,8 @@ function handleScroll( event ) {
|
|
265 |
triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) );
|
266 |
}
|
267 |
|
|
|
|
|
268 |
didScroll = true;
|
269 |
startResetTimer();
|
270 |
}
|
@@ -279,9 +429,11 @@ function handleTouchMove( event ) {
|
|
279 |
moveThreshold = $.vmouse.moveDistanceThreshold,
|
280 |
flags = getVirtualBindingFlags( event.target );
|
281 |
|
282 |
-
|
283 |
-
|
284 |
-
|
|
|
|
|
285 |
|
286 |
if ( didScroll && !didCancel ) {
|
287 |
triggerVirtualEvent( "vmousecancel", event, flags );
|
@@ -292,11 +444,12 @@ function handleTouchMove( event ) {
|
|
292 |
}
|
293 |
|
294 |
function handleTouchEnd( event ) {
|
295 |
-
if ( blockTouchTriggers ) {
|
296 |
return;
|
297 |
}
|
298 |
|
299 |
disableTouchBindings();
|
|
|
300 |
|
301 |
var flags = getVirtualBindingFlags( event.target ),
|
302 |
ve, t;
|
@@ -310,18 +463,18 @@ function handleTouchEnd( event ) {
|
|
310 |
// touch. This means we need to rely on coordinates for blocking
|
311 |
// any click that is generated.
|
312 |
t = getNativeEvent( event ).changedTouches[ 0 ];
|
313 |
-
clickBlockList.push({
|
314 |
touchID: lastTouchID,
|
315 |
x: t.clientX,
|
316 |
y: t.clientY
|
317 |
-
});
|
318 |
|
319 |
// Prevent any mouse events that follow from triggering
|
320 |
// virtual event notifications.
|
321 |
blockMouseTriggers = true;
|
322 |
}
|
323 |
}
|
324 |
-
triggerVirtualEvent( "vmouseout", event, flags);
|
325 |
didScroll = false;
|
326 |
|
327 |
startResetTimer();
|
@@ -341,13 +494,14 @@ function hasVirtualBindings( ele ) {
|
|
341 |
return false;
|
342 |
}
|
343 |
|
344 |
-
function dummyMouseHandler() {
|
|
|
345 |
|
346 |
function getSpecialEventObject( eventType ) {
|
347 |
var realType = eventType.substr( 1 );
|
348 |
|
349 |
return {
|
350 |
-
setup: function(/* data, namespace */) {
|
351 |
// If this is the first virtual mouse binding for this element,
|
352 |
// add a bindings object to its data.
|
353 |
|
@@ -380,7 +534,7 @@ function getSpecialEventObject( eventType ) {
|
|
380 |
// If this is the first virtual mouse binding for the document,
|
381 |
// register our touchstart handler on the document.
|
382 |
|
383 |
-
activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1;
|
384 |
|
385 |
if ( activeDocHandlers[ "touchstart" ] === 1 ) {
|
386 |
$document.bind( "touchstart", handleTouchStart )
|
@@ -402,11 +556,11 @@ function getSpecialEventObject( eventType ) {
|
|
402 |
}
|
403 |
},
|
404 |
|
405 |
-
teardown: function(/* data, namespace */) {
|
406 |
// If this is the last virtual binding for this eventType,
|
407 |
// remove its global handler from the document.
|
408 |
|
409 |
-
--activeDocHandlers[
|
410 |
|
411 |
if ( !activeDocHandlers[ eventType ] ) {
|
412 |
$document.unbind( realType, mouseEventCallback );
|
@@ -416,7 +570,7 @@ function getSpecialEventObject( eventType ) {
|
|
416 |
// If this is the last virtual mouse binding in existence,
|
417 |
// remove our document touchstart listener.
|
418 |
|
419 |
-
--activeDocHandlers[
|
420 |
|
421 |
if ( !activeDocHandlers[ "touchstart" ] ) {
|
422 |
$document.unbind( "touchstart", handleTouchStart )
|
@@ -507,7 +661,7 @@ if ( eventCaptureSupported ) {
|
|
507 |
touchID = 0;
|
508 |
|
509 |
if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
|
510 |
-
|
511 |
// XXX: We may want to consider removing matches from the block list
|
512 |
// instead of waiting for the reset timer to fire.
|
513 |
e.preventDefault();
|
@@ -518,347 +672,1278 @@ if ( eventCaptureSupported ) {
|
|
518 |
ele = ele.parentNode;
|
519 |
}
|
520 |
}
|
521 |
-
}, true);
|
522 |
}
|
523 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
|
525 |
-
|
526 |
-
|
527 |
-
}
|
528 |
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
|
534 |
-
|
535 |
-
$.extend( $.support, support );
|
536 |
-
$.extend( $.mobile.support, support );
|
537 |
-
}( jQuery ));
|
538 |
|
|
|
|
|
539 |
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
|
|
547 |
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
"swipe swipeleft swiperight " +
|
552 |
-
"scrollstart scrollstop" ).split( " " ), function( i, name ) {
|
553 |
|
554 |
-
|
555 |
-
|
556 |
-
};
|
557 |
|
558 |
-
//
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
}
|
563 |
|
564 |
-
|
565 |
-
|
566 |
-
event.type = eventType;
|
567 |
-
if ( bubble ) {
|
568 |
-
$.event.trigger( event, undefined, obj );
|
569 |
-
} else {
|
570 |
-
$.event.dispatch.call( obj, event );
|
571 |
-
}
|
572 |
-
event.type = originalType;
|
573 |
}
|
|
|
574 |
|
575 |
-
|
576 |
-
|
|
|
577 |
|
578 |
-
|
579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
|
|
|
|
585 |
|
586 |
-
|
587 |
-
|
588 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
}
|
590 |
|
591 |
-
|
592 |
-
|
593 |
|
594 |
-
|
595 |
-
|
|
|
|
|
596 |
}
|
|
|
597 |
|
598 |
-
|
599 |
-
|
600 |
-
}
|
601 |
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
});
|
607 |
-
},
|
608 |
-
teardown: function() {
|
609 |
-
$( this ).unbind( scrollEvent );
|
610 |
-
}
|
611 |
-
};
|
612 |
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
isTaphold
|
621 |
-
|
622 |
-
$this.bind( "vmousedown", function( event ) {
|
623 |
-
isTaphold = false;
|
624 |
-
if ( event.which && event.which !== 1 ) {
|
625 |
-
return false;
|
626 |
}
|
|
|
627 |
|
628 |
-
|
629 |
-
timer;
|
630 |
|
631 |
-
|
632 |
-
|
|
|
|
|
|
|
633 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
|
635 |
-
|
636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
|
638 |
-
|
639 |
-
|
640 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
641 |
}
|
642 |
|
643 |
-
|
644 |
-
|
|
|
|
|
645 |
|
646 |
-
|
647 |
-
|
648 |
-
if ( !isTaphold && origTarget === event.target ) {
|
649 |
-
triggerCustomEvent( thisObject, "tap", event );
|
650 |
-
} else if ( isTaphold ) {
|
651 |
-
event.preventDefault();
|
652 |
}
|
653 |
}
|
|
|
|
|
|
|
|
|
|
|
654 |
|
655 |
-
|
656 |
-
|
657 |
-
$document.bind( "vmousecancel", clearTapHandlers );
|
658 |
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
},
|
667 |
teardown: function() {
|
668 |
-
$( this ).unbind(
|
669 |
-
$document.unbind( "vmousecancel" );
|
670 |
}
|
671 |
};
|
|
|
672 |
|
673 |
-
|
674 |
-
|
675 |
|
676 |
-
// More than this horizontal displacement, and we will suppress scrolling.
|
677 |
-
scrollSupressionThreshold: 30,
|
678 |
|
679 |
-
|
680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
|
682 |
-
|
683 |
-
|
|
|
|
|
|
|
684 |
|
685 |
-
|
686 |
-
|
687 |
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
|
694 |
-
|
695 |
-
|
|
|
|
|
696 |
|
697 |
-
|
698 |
-
// in pageX/pageY. While pageX/page/ have the value 0
|
699 |
-
x = x - winPageX;
|
700 |
-
y = y - winPageY;
|
701 |
-
} else if ( y < ( event.pageY - winPageY) || x < ( event.pageX - winPageX ) ) {
|
702 |
-
|
703 |
-
// Some Android browsers have totally bogus values for clientX/Y
|
704 |
-
// when scrolling/zooming a page. Detectable since clientX/clientY
|
705 |
-
// should never be smaller than pageX/pageY minus page scroll
|
706 |
-
x = event.pageX - winPageX;
|
707 |
-
y = event.pageY - winPageY;
|
708 |
-
}
|
709 |
|
710 |
-
|
711 |
-
x: x,
|
712 |
-
y: y
|
713 |
-
};
|
714 |
-
},
|
715 |
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
};
|
|
|
|
|
|
|
735 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
}
|
747 |
-
return false;
|
748 |
|
749 |
-
|
|
|
|
|
750 |
|
751 |
-
|
752 |
-
|
753 |
-
|
|
|
754 |
|
755 |
-
|
756 |
-
|
757 |
-
thisObject = this,
|
758 |
-
$this = $( thisObject ),
|
759 |
-
context = {};
|
760 |
-
|
761 |
-
// Retrieve the events data for this element and add the swipe context
|
762 |
-
events = $.data( this, "mobile-events" );
|
763 |
-
if ( !events ) {
|
764 |
-
events = { length: 0 };
|
765 |
-
$.data( this, "mobile-events", events );
|
766 |
-
}
|
767 |
-
events.length++;
|
768 |
-
events.swipe = context;
|
769 |
|
770 |
-
|
|
|
771 |
|
772 |
-
|
773 |
-
|
774 |
-
return;
|
775 |
-
}
|
776 |
-
$.event.special.swipe.eventInProgress = true;
|
777 |
|
778 |
-
|
779 |
-
|
780 |
-
origTarget = event.target,
|
781 |
-
emitted = false;
|
782 |
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
|
793 |
-
|
794 |
-
|
795 |
-
}
|
796 |
-
}
|
797 |
-
// prevent scrolling
|
798 |
-
if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
|
799 |
-
event.preventDefault();
|
800 |
-
}
|
801 |
-
};
|
802 |
|
803 |
-
|
804 |
-
|
805 |
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
};
|
811 |
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
$this.on( touchStartEvent, context.start );
|
816 |
-
},
|
817 |
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
}
|
|
|
|
|
829 |
}
|
830 |
|
831 |
-
if (
|
832 |
-
|
833 |
-
$( this ).off( touchStartEvent, context.start );
|
834 |
-
}
|
835 |
-
if ( context.move ) {
|
836 |
-
$document.off( touchMoveEvent, context.move );
|
837 |
-
}
|
838 |
-
if ( context.stop ) {
|
839 |
-
$document.off( touchStopEvent, context.stop );
|
840 |
-
}
|
841 |
}
|
842 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
843 |
};
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
857 |
}
|
858 |
-
};
|
859 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
860 |
|
861 |
-
|
|
|
862 |
|
863 |
|
864 |
}));
|
1 |
/*
|
2 |
+
* jQuery Mobile v1.5.0-rc1
|
3 |
* http://jquerymobile.com
|
4 |
*
|
5 |
+
* Copyright jQuery Foundation, Inc. and other contributors
|
6 |
* Released under the MIT license.
|
7 |
* http://jquery.org/license
|
8 |
*
|
19 |
// Browser globals
|
20 |
factory( root.jQuery, root, doc );
|
21 |
}
|
22 |
+
}( this, document, function ( jQuery, window, document, undefined ) {
|
23 |
+
/*!
|
24 |
+
* jQuery Mobile Scroll Events @VERSION
|
25 |
+
* http://jquerymobile.com
|
26 |
+
*
|
27 |
+
* Copyright jQuery Foundation and other contributors
|
28 |
+
* Released under the MIT license.
|
29 |
+
* http://jquery.org/license
|
30 |
+
*/
|
31 |
+
|
32 |
+
//>>label: Scroll
|
33 |
+
//>>group: Events
|
34 |
+
//>>description: Scroll events including: scrollstart, scrollstop
|
35 |
+
|
36 |
+
( function( factory ) {
|
37 |
+
if ( typeof define === "function" && define.amd ) {
|
38 |
+
|
39 |
+
// AMD. Register as an anonymous module.
|
40 |
+
define( 'events/scroll',[ "jquery" ], factory );
|
41 |
+
} else {
|
42 |
+
|
43 |
+
// Browser globals
|
44 |
+
factory( jQuery );
|
45 |
+
}
|
46 |
+
} )( function( $ ) {
|
47 |
+
|
48 |
+
var scrollEvent = "touchmove scroll";
|
49 |
+
|
50 |
+
// setup new event shortcuts
|
51 |
+
$.each( [ "scrollstart", "scrollstop" ], function( i, name ) {
|
52 |
+
|
53 |
+
$.fn[ name ] = function( fn ) {
|
54 |
+
return fn ? this.bind( name, fn ) : this.trigger( name );
|
55 |
+
};
|
56 |
+
|
57 |
+
// jQuery < 1.8
|
58 |
+
if ( $.attrFn ) {
|
59 |
+
$.attrFn[ name ] = true;
|
60 |
+
}
|
61 |
+
} );
|
62 |
+
|
63 |
+
// also handles scrollstop
|
64 |
+
$.event.special.scrollstart = {
|
65 |
+
|
66 |
+
enabled: true,
|
67 |
+
setup: function() {
|
68 |
+
|
69 |
+
var thisObject = this,
|
70 |
+
$this = $( thisObject ),
|
71 |
+
scrolling,
|
72 |
+
timer;
|
73 |
+
|
74 |
+
function trigger( event, state ) {
|
75 |
+
var originalEventType = event.type;
|
76 |
+
|
77 |
+
scrolling = state;
|
78 |
+
|
79 |
+
event.type = scrolling ? "scrollstart" : "scrollstop";
|
80 |
+
$.event.dispatch.call( thisObject, event );
|
81 |
+
event.type = originalEventType;
|
82 |
+
}
|
83 |
+
|
84 |
+
var scrollStartHandler = $.event.special.scrollstart.handler = function ( event ) {
|
85 |
+
|
86 |
+
if ( !$.event.special.scrollstart.enabled ) {
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
|
90 |
+
if ( !scrolling ) {
|
91 |
+
trigger( event, true );
|
92 |
+
}
|
93 |
+
|
94 |
+
clearTimeout( timer );
|
95 |
+
timer = setTimeout( function() {
|
96 |
+
trigger( event, false );
|
97 |
+
}, 50 );
|
98 |
+
};
|
99 |
+
|
100 |
+
// iPhone triggers scroll after a small delay; use touchmove instead
|
101 |
+
$this.on( scrollEvent, scrollStartHandler );
|
102 |
+
},
|
103 |
+
teardown: function() {
|
104 |
+
$( this ).off( scrollEvent, $.event.special.scrollstart.handler );
|
105 |
+
}
|
106 |
+
};
|
107 |
+
|
108 |
+
$.each( {
|
109 |
+
scrollstop: "scrollstart"
|
110 |
+
}, function( event, sourceEvent ) {
|
111 |
+
|
112 |
+
$.event.special[ event ] = {
|
113 |
+
setup: function() {
|
114 |
+
$( this ).bind( sourceEvent, $.noop );
|
115 |
+
},
|
116 |
+
teardown: function() {
|
117 |
+
$( this ).unbind( sourceEvent );
|
118 |
+
}
|
119 |
+
};
|
120 |
+
} );
|
121 |
+
|
122 |
+
return $.event.special;
|
123 |
+
} );
|
124 |
+
|
125 |
+
/*!
|
126 |
+
* jQuery Mobile Virtual Mouse @VERSION
|
127 |
+
* http://jquerymobile.com
|
128 |
+
*
|
129 |
+
* Copyright jQuery Foundation and other contributors
|
130 |
+
* Released under the MIT license.
|
131 |
+
* http://jquery.org/license
|
132 |
+
*/
|
133 |
+
|
134 |
+
//>>label: Virtual Mouse (vmouse) Bindings
|
135 |
+
//>>group: Core
|
136 |
+
//>>description: Normalizes touch/mouse events.
|
137 |
+
//>>docs: http://api.jquerymobile.com/?s=vmouse
|
138 |
+
|
139 |
+
// This plugin is an experiment for abstracting away the touch and mouse
|
140 |
// events so that developers don't have to worry about which method of input
|
141 |
// the device their document is loaded on supports.
|
142 |
//
|
151 |
// The current version exposes the following virtual events to jQuery bind methods:
|
152 |
// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
|
153 |
|
154 |
+
( function( factory ) {
|
155 |
+
if ( typeof define === "function" && define.amd ) {
|
156 |
+
|
157 |
+
// AMD. Register as an anonymous module.
|
158 |
+
define( 'vmouse',[ "jquery" ], factory );
|
159 |
+
} else {
|
160 |
+
|
161 |
+
// Browser globals
|
162 |
+
factory( jQuery );
|
163 |
+
}
|
164 |
+
} )( function( $ ) {
|
165 |
|
166 |
var dataPropertyName = "virtualMouseBindings",
|
167 |
touchTargetPropertyName = "virtualTouchID",
|
|
|
168 |
touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
|
169 |
+
virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
|
170 |
+
generalProps = ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
|
171 |
+
"metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
|
172 |
mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],
|
173 |
+
mouseEventProps = generalProps.concat( mouseHookProps ),
|
174 |
activeDocHandlers = {},
|
175 |
resetTimerID = 0,
|
176 |
startX = 0,
|
188 |
$.vmouse = {
|
189 |
moveDistanceThreshold: 10,
|
190 |
clickDistanceThreshold: 10,
|
191 |
+
resetTimerDuration: 1500,
|
192 |
+
maximumTimeBetweenTouches: 100
|
193 |
};
|
194 |
|
195 |
function getNativeEvent( event ) {
|
209 |
event.type = eventType;
|
210 |
|
211 |
oe = event.originalEvent;
|
212 |
+
props = generalProps;
|
213 |
|
214 |
// addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
|
215 |
// https://github.com/jquery/jquery-mobile/issues/3280
|
221 |
// this would happen if we could call $.event.fix instead of $.Event
|
222 |
// but we don't have a way to force an event to be fixed multiple times
|
223 |
if ( oe ) {
|
224 |
+
for ( i = props.length; i; ) {
|
225 |
prop = props[ --i ];
|
226 |
event[ prop ] = oe[ prop ];
|
227 |
}
|
229 |
|
230 |
// make sure that if the mouse and click virtual events are generated
|
231 |
// without a .which one is defined
|
232 |
+
if ( t.search( /mouse(down|up)|click/ ) > -1 && !event.which ) {
|
233 |
event.which = 1;
|
234 |
}
|
235 |
|
236 |
+
if ( t.search( /^touch/ ) !== -1 ) {
|
237 |
ne = getNativeEvent( oe );
|
238 |
t = ne.touches;
|
239 |
ct = ne.changedTouches;
|
240 |
+
touch = ( t && t.length ) ? t[ 0 ] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );
|
241 |
|
242 |
if ( touch ) {
|
243 |
+
for ( j = 0, len = touchEventProps.length; j < len; j++ ) {
|
244 |
prop = touchEventProps[ j ];
|
245 |
event[ prop ] = touch[ prop ];
|
246 |
}
|
259 |
|
260 |
b = $.data( element, dataPropertyName );
|
261 |
|
262 |
+
for ( k in b ) {
|
263 |
if ( b[ k ] ) {
|
264 |
flags[ k ] = flags.hasVirtualBinding = true;
|
265 |
}
|
307 |
enableTouchBindings();
|
308 |
}
|
309 |
|
310 |
+
function clearResetTimer() {
|
311 |
+
if ( resetTimerID ) {
|
312 |
+
clearTimeout( resetTimerID );
|
313 |
+
resetTimerID = 0;
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
function startResetTimer() {
|
318 |
clearResetTimer();
|
319 |
resetTimerID = setTimeout( function() {
|
322 |
}, $.vmouse.resetTimerDuration );
|
323 |
}
|
324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
function triggerVirtualEvent( eventType, event, flags ) {
|
326 |
var ve;
|
327 |
|
328 |
if ( ( flags && flags[ eventType ] ) ||
|
329 |
+
( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) {
|
330 |
|
331 |
ve = createVirtualEvent( event, eventType );
|
332 |
|
333 |
+
$( event.target ).trigger( ve );
|
334 |
}
|
335 |
|
336 |
return ve;
|
340 |
var touchID = $.data( event.target, touchTargetPropertyName ),
|
341 |
ve;
|
342 |
|
343 |
+
// It is unexpected if a click event is received before a touchend
|
344 |
+
// or touchmove event, however this is a known behavior in Mobile
|
345 |
+
// Safari when Mobile VoiceOver (as of iOS 8) is enabled and the user
|
346 |
+
// double taps to activate a link element. In these cases if a touch
|
347 |
+
// event is not received within the maximum time between touches,
|
348 |
+
// re-enable mouse bindings and call the mouse event handler again.
|
349 |
+
if ( event.type === "click" && $.data( event.target, "lastTouchType" ) === "touchstart" ) {
|
350 |
+
setTimeout( function() {
|
351 |
+
if ( $.data( event.target, "lastTouchType" ) === "touchstart" ) {
|
352 |
+
enableMouseBindings();
|
353 |
+
delete $.data( event.target ).lastTouchType;
|
354 |
+
mouseEventCallback( event );
|
355 |
+
}
|
356 |
+
}, $.vmouse.maximumTimeBetweenTouches );
|
357 |
+
}
|
358 |
+
|
359 |
if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) {
|
360 |
ve = triggerVirtualEvent( "v" + event.type, event );
|
361 |
if ( ve ) {
|
382 |
target = event.target;
|
383 |
flags = getVirtualBindingFlags( target );
|
384 |
|
385 |
+
$.data( event.target, "lastTouchType", event.type );
|
386 |
+
|
387 |
if ( flags.hasVirtualBinding ) {
|
388 |
|
389 |
lastTouchID = nextTouchID++;
|
413 |
triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) );
|
414 |
}
|
415 |
|
416 |
+
$.data( event.target, "lastTouchType", event.type );
|
417 |
+
|
418 |
didScroll = true;
|
419 |
startResetTimer();
|
420 |
}
|
429 |
moveThreshold = $.vmouse.moveDistanceThreshold,
|
430 |
flags = getVirtualBindingFlags( event.target );
|
431 |
|
432 |
+
$.data( event.target, "lastTouchType", event.type );
|
433 |
+
|
434 |
+
didScroll = didScroll ||
|
435 |
+
( Math.abs( t.pageX - startX ) > moveThreshold ||
|
436 |
+
Math.abs( t.pageY - startY ) > moveThreshold );
|
437 |
|
438 |
if ( didScroll && !didCancel ) {
|
439 |
triggerVirtualEvent( "vmousecancel", event, flags );
|
444 |
}
|
445 |
|
446 |
function handleTouchEnd( event ) {
|
447 |
+
if ( blockTouchTriggers || $.data( event.target, "lastTouchType" ) === undefined ) {
|
448 |
return;
|
449 |
}
|
450 |
|
451 |
disableTouchBindings();
|
452 |
+
delete $.data( event.target ).lastTouchType;
|
453 |
|
454 |
var flags = getVirtualBindingFlags( event.target ),
|
455 |
ve, t;
|
463 |
// touch. This means we need to rely on coordinates for blocking
|
464 |
// any click that is generated.
|
465 |
t = getNativeEvent( event ).changedTouches[ 0 ];
|
466 |
+
clickBlockList.push( {
|
467 |
touchID: lastTouchID,
|
468 |
x: t.clientX,
|
469 |
y: t.clientY
|
470 |
+
} );
|
471 |
|
472 |
// Prevent any mouse events that follow from triggering
|
473 |
// virtual event notifications.
|
474 |
blockMouseTriggers = true;
|
475 |
}
|
476 |
}
|
477 |
+
triggerVirtualEvent( "vmouseout", event, flags );
|
478 |
didScroll = false;
|
479 |
|
480 |
startResetTimer();
|
494 |
return false;
|
495 |
}
|
496 |
|
497 |
+
function dummyMouseHandler() {
|
498 |
+
}
|
499 |
|
500 |
function getSpecialEventObject( eventType ) {
|
501 |
var realType = eventType.substr( 1 );
|
502 |
|
503 |
return {
|
504 |
+
setup: function( /* data, namespace */ ) {
|
505 |
// If this is the first virtual mouse binding for this element,
|
506 |
// add a bindings object to its data.
|
507 |
|
534 |
// If this is the first virtual mouse binding for the document,
|
535 |
// register our touchstart handler on the document.
|
536 |
|
537 |
+
activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0 ) + 1;
|
538 |
|
539 |
if ( activeDocHandlers[ "touchstart" ] === 1 ) {
|
540 |
$document.bind( "touchstart", handleTouchStart )
|
556 |
}
|
557 |
},
|
558 |
|
559 |
+
teardown: function( /* data, namespace */ ) {
|
560 |
// If this is the last virtual binding for this eventType,
|
561 |
// remove its global handler from the document.
|
562 |
|
563 |
+
--activeDocHandlers[eventType];
|
564 |
|
565 |
if ( !activeDocHandlers[ eventType ] ) {
|
566 |
$document.unbind( realType, mouseEventCallback );
|
570 |
// If this is the last virtual mouse binding in existence,
|
571 |
// remove our document touchstart listener.
|
572 |
|
573 |
+
--activeDocHandlers["touchstart"];
|
574 |
|
575 |
if ( !activeDocHandlers[ "touchstart" ] ) {
|
576 |
$document.unbind( "touchstart", handleTouchStart )
|
661 |
touchID = 0;
|
662 |
|
663 |
if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
|
664 |
+
$.data( ele, touchTargetPropertyName ) === o.touchID ) {
|
665 |
// XXX: We may want to consider removing matches from the block list
|
666 |
// instead of waiting for the reset timer to fire.
|
667 |
e.preventDefault();
|
672 |
ele = ele.parentNode;
|
673 |
}
|
674 |
}
|
675 |
+
}, true );
|
676 |
}
|
677 |
+
} );
|
678 |
+
|
679 |
+
/*!
|
680 |
+
* jQuery Mobile Namespace @VERSION
|
681 |
+
* http://jquerymobile.com
|
682 |
+
*
|
683 |
+
* Copyright jQuery Foundation and other contributors
|
684 |
+
* Released under the MIT license.
|
685 |
+
* http://jquery.org/license
|
686 |
+
*/
|
687 |
+
|
688 |
+
//>>label: Namespace
|
689 |
+
//>>group: Core
|
690 |
+
//>>description: The mobile namespace on the jQuery object
|
691 |
+
|
692 |
+
( function( factory ) {
|
693 |
+
if ( typeof define === "function" && define.amd ) {
|
694 |
|
695 |
+
// AMD. Register as an anonymous module.
|
696 |
+
define( 'ns',[ "jquery" ], factory );
|
697 |
+
} else {
|
698 |
|
699 |
+
// Browser globals
|
700 |
+
factory( jQuery );
|
701 |
+
}
|
702 |
+
} )( function( $ ) {
|
703 |
|
704 |
+
$.mobile = { version: "@VERSION" };
|
|
|
|
|
|
|
705 |
|
706 |
+
return $.mobile;
|
707 |
+
} );
|
708 |
|
709 |
+
/*!
|
710 |
+
* jQuery Mobile Touch Support Test @VERSION
|
711 |
+
* http://jquerymobile.com
|
712 |
+
*
|
713 |
+
* Copyright jQuery Foundation and other contributors
|
714 |
+
* Released under the MIT license.
|
715 |
+
* http://jquery.org/license
|
716 |
+
*/
|
717 |
|
718 |
+
//>>label: Touch support test
|
719 |
+
//>>group: Core
|
720 |
+
//>>description: Touch feature test
|
|
|
|
|
721 |
|
722 |
+
( function( factory ) {
|
723 |
+
if ( typeof define === "function" && define.amd ) {
|
|
|
724 |
|
725 |
+
// AMD. Register as an anonymous module.
|
726 |
+
define( 'support/touch',[
|
727 |
+
"jquery",
|
728 |
+
"../ns" ], factory );
|
729 |
+
} else {
|
730 |
|
731 |
+
// Browser globals
|
732 |
+
factory( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
733 |
}
|
734 |
+
} )( function( $ ) {
|
735 |
|
736 |
+
var support = {
|
737 |
+
touch: "ontouchend" in document
|
738 |
+
};
|
739 |
|
740 |
+
$.mobile.support = $.mobile.support || {};
|
741 |
+
$.extend( $.support, support );
|
742 |
+
$.extend( $.mobile.support, support );
|
743 |
+
|
744 |
+
return $.support;
|
745 |
+
} );
|
746 |
+
|
747 |
+
/*!
|
748 |
+
* jQuery Mobile Touch Events @VERSION
|
749 |
+
* http://jquerymobile.com
|
750 |
+
*
|
751 |
+
* Copyright jQuery Foundation and other contributors
|
752 |
+
* Released under the MIT license.
|
753 |
+
* http://jquery.org/license
|
754 |
+
*/
|
755 |
+
|
756 |
+
//>>label: Touch
|
757 |
+
//>>group: Events
|
758 |
+
//>>description: Touch events including: touchstart, touchmove, touchend, tap, taphold, swipe, swipeleft, swiperight
|
759 |
+
|
760 |
+
( function( factory ) {
|
761 |
+
if ( typeof define === "function" && define.amd ) {
|
762 |
|
763 |
+
// AMD. Register as an anonymous module.
|
764 |
+
define( 'events/touch',[
|
765 |
+
"jquery",
|
766 |
+
"../vmouse",
|
767 |
+
"../support/touch" ], factory );
|
768 |
+
} else {
|
769 |
|
770 |
+
// Browser globals
|
771 |
+
factory( jQuery );
|
772 |
+
}
|
773 |
+
} )( function( $ ) {
|
774 |
+
var $document = $( document ),
|
775 |
+
supportTouch = $.mobile.support.touch,
|
776 |
+
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
|
777 |
+
touchStopEvent = supportTouch ? "touchend" : "mouseup",
|
778 |
+
touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
|
779 |
+
|
780 |
+
// setup new event shortcuts
|
781 |
+
$.each( ( "touchstart touchmove touchend " +
|
782 |
+
"tap taphold " +
|
783 |
+
"swipe swipeleft swiperight" ).split( " " ), function( i, name ) {
|
784 |
+
|
785 |
+
$.fn[ name ] = function( fn ) {
|
786 |
+
return fn ? this.bind( name, fn ) : this.trigger( name );
|
787 |
+
};
|
788 |
+
|
789 |
+
// jQuery < 1.8
|
790 |
+
if ( $.attrFn ) {
|
791 |
+
$.attrFn[ name ] = true;
|
792 |
+
}
|
793 |
+
} );
|
794 |
+
|
795 |
+
function triggerCustomEvent( obj, eventType, event, bubble ) {
|
796 |
+
var originalType = event.type;
|
797 |
+
event.type = eventType;
|
798 |
+
if ( bubble ) {
|
799 |
+
$.event.trigger( event, undefined, obj );
|
800 |
+
} else {
|
801 |
+
$.event.dispatch.call( obj, event );
|
802 |
+
}
|
803 |
+
event.type = originalType;
|
804 |
+
}
|
805 |
+
|
806 |
+
// also handles taphold
|
807 |
+
$.event.special.tap = {
|
808 |
+
tapholdThreshold: 750,
|
809 |
+
emitTapOnTaphold: true,
|
810 |
+
setup: function() {
|
811 |
+
var thisObject = this,
|
812 |
+
$this = $( thisObject ),
|
813 |
+
isTaphold = false;
|
814 |
+
|
815 |
+
$this.bind( "vmousedown", function( event ) {
|
816 |
+
isTaphold = false;
|
817 |
+
if ( event.which && event.which !== 1 ) {
|
818 |
+
return true;
|
819 |
}
|
820 |
|
821 |
+
var origTarget = event.target,
|
822 |
+
timer, clickHandler;
|
823 |
|
824 |
+
function clearTapTimer() {
|
825 |
+
if ( timer ) {
|
826 |
+
$this.bind( "vclick", clickHandler );
|
827 |
+
clearTimeout( timer );
|
828 |
}
|
829 |
+
}
|
830 |
|
831 |
+
function clearTapHandlers() {
|
832 |
+
clearTapTimer();
|
|
|
833 |
|
834 |
+
$this.unbind( "vclick", clickHandler )
|
835 |
+
.unbind( "vmouseup", clearTapTimer );
|
836 |
+
$document.unbind( "vmousecancel", clearTapHandlers );
|
837 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
838 |
|
839 |
+
clickHandler = function( event ) {
|
840 |
+
clearTapHandlers();
|
841 |
+
|
842 |
+
// ONLY trigger a 'tap' event if the start target is
|
843 |
+
// the same as the stop target.
|
844 |
+
if ( !isTaphold && origTarget === event.target ) {
|
845 |
+
triggerCustomEvent( thisObject, "tap", event );
|
846 |
+
} else if ( isTaphold ) {
|
847 |
+
event.preventDefault();
|
|
|
|
|
|
|
|
|
848 |
}
|
849 |
+
};
|
850 |
|
851 |
+
$this.bind( "vmouseup", clearTapTimer );
|
|
|
852 |
|
853 |
+
$document.bind( "vmousecancel", clearTapHandlers );
|
854 |
+
|
855 |
+
timer = setTimeout( function() {
|
856 |
+
if ( !$.event.special.tap.emitTapOnTaphold ) {
|
857 |
+
isTaphold = true;
|
858 |
}
|
859 |
+
timer = 0;
|
860 |
+
triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
|
861 |
+
}, $.event.special.tap.tapholdThreshold );
|
862 |
+
} );
|
863 |
+
},
|
864 |
+
teardown: function() {
|
865 |
+
$( this ).unbind( "vmousedown" ).unbind( "vclick" ).unbind( "vmouseup" );
|
866 |
+
$document.unbind( "vmousecancel" );
|
867 |
+
}
|
868 |
+
};
|
869 |
+
|
870 |
+
// Also handles swipeleft, swiperight
|
871 |
+
$.event.special.swipe = {
|
872 |
+
|
873 |
+
// More than this horizontal displacement, and we will suppress scrolling.
|
874 |
+
scrollSupressionThreshold: 30,
|
875 |
+
|
876 |
+
// More time than this, and it isn't a swipe.
|
877 |
+
durationThreshold: 1000,
|
878 |
+
|
879 |
+
// Swipe horizontal displacement must be more than this.
|
880 |
+
horizontalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30,
|
881 |
+
|
882 |
+
// Swipe vertical displacement must be less than this.
|
883 |
+
verticalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30,
|
884 |
+
|
885 |
+
getLocation: function( event ) {
|
886 |
+
var winPageX = window.pageXOffset,
|
887 |
+
winPageY = window.pageYOffset,
|
888 |
+
x = event.clientX,
|
889 |
+
y = event.clientY;
|
890 |
+
|
891 |
+
if ( event.pageY === 0 && Math.floor( y ) > Math.floor( event.pageY ) ||
|
892 |
+
event.pageX === 0 && Math.floor( x ) > Math.floor( event.pageX ) ) {
|
893 |
+
|
894 |
+
// iOS4 clientX/clientY have the value that should have been
|
895 |
+
// in pageX/pageY. While pageX/page/ have the value 0
|
896 |
+
x = x - winPageX;
|
897 |
+
y = y - winPageY;
|
898 |
+
} else if ( y < ( event.pageY - winPageY ) || x < ( event.pageX - winPageX ) ) {
|
899 |
+
|
900 |
+
// Some Android browsers have totally bogus values for clientX/Y
|
901 |
+
// when scrolling/zooming a page. Detectable since clientX/clientY
|
902 |
+
// should never be smaller than pageX/pageY minus page scroll
|
903 |
+
x = event.pageX - winPageX;
|
904 |
+
y = event.pageY - winPageY;
|
905 |
+
}
|
906 |
+
|
907 |
+
return {
|
908 |
+
x: x,
|
909 |
+
y: y
|
910 |
+
};
|
911 |
+
},
|
912 |
+
|
913 |
+
start: function( event ) {
|
914 |
+
var data = event.originalEvent.touches ?
|
915 |
+
event.originalEvent.touches[ 0 ] : event,
|
916 |
+
location = $.event.special.swipe.getLocation( data );
|
917 |
+
return {
|
918 |
+
time: ( new Date() ).getTime(),
|
919 |
+
coords: [ location.x, location.y ],
|
920 |
+
origin: $( event.target )
|
921 |
+
};
|
922 |
+
},
|
923 |
+
|
924 |
+
stop: function( event ) {
|
925 |
+
var data = event.originalEvent.touches ?
|
926 |
+
event.originalEvent.touches[ 0 ] : event,
|
927 |
+
location = $.event.special.swipe.getLocation( data );
|
928 |
+
return {
|
929 |
+
time: ( new Date() ).getTime(),
|
930 |
+
coords: [ location.x, location.y ]
|
931 |
+
};
|
932 |
+
},
|
933 |
+
|
934 |
+
handleSwipe: function( start, stop, thisObject, origTarget ) {
|
935 |
+
if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
|
936 |
+
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
|
937 |
+
Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
|
938 |
+
var direction = start.coords[ 0 ] > stop.coords[ 0 ] ? "swipeleft" : "swiperight";
|
939 |
|
940 |
+
triggerCustomEvent( thisObject, "swipe", $.Event( "swipe", { target: origTarget, swipestart: start, swipestop: stop } ), true );
|
941 |
+
triggerCustomEvent( thisObject, direction, $.Event( direction, { target: origTarget, swipestart: start, swipestop: stop } ), true );
|
942 |
+
return true;
|
943 |
+
}
|
944 |
+
return false;
|
945 |
+
|
946 |
+
},
|
947 |
+
|
948 |
+
// This serves as a flag to ensure that at most one swipe event event is
|
949 |
+
// in work at any given time
|
950 |
+
eventInProgress: false,
|
951 |
+
|
952 |
+
setup: function() {
|
953 |
+
var events,
|
954 |
+
thisObject = this,
|
955 |
+
$this = $( thisObject ),
|
956 |
+
context = {};
|
957 |
+
|
958 |
+
// Retrieve the events data for this element and add the swipe context
|
959 |
+
events = $.data( this, "mobile-events" );
|
960 |
+
if ( !events ) {
|
961 |
+
events = { length: 0 };
|
962 |
+
$.data( this, "mobile-events", events );
|
963 |
+
}
|
964 |
+
events.length++;
|
965 |
+
events.swipe = context;
|
966 |
+
|
967 |
+
context.start = function( event ) {
|
968 |
|
969 |
+
// Bail if we're already working on a swipe event
|
970 |
+
if ( $.event.special.swipe.eventInProgress ) {
|
971 |
+
return;
|
972 |
+
}
|
973 |
+
$.event.special.swipe.eventInProgress = true;
|
974 |
+
|
975 |
+
var stop,
|
976 |
+
start = $.event.special.swipe.start( event ),
|
977 |
+
origTarget = event.target,
|
978 |
+
emitted = false;
|
979 |
+
|
980 |
+
context.move = function( event ) {
|
981 |
+
if ( !start || event.isDefaultPrevented() ) {
|
982 |
+
return;
|
983 |
}
|
984 |
|
985 |
+
stop = $.event.special.swipe.stop( event );
|
986 |
+
if ( !emitted ) {
|
987 |
+
emitted = $.event.special.swipe.handleSwipe( start, stop, thisObject, origTarget );
|
988 |
+
if ( emitted ) {
|
989 |
|
990 |
+
// Reset the context to make way for the next swipe event
|
991 |
+
$.event.special.swipe.eventInProgress = false;
|
|
|
|
|
|
|
|
|
992 |
}
|
993 |
}
|
994 |
+
// prevent scrolling
|
995 |
+
if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
|
996 |
+
event.preventDefault();
|
997 |
+
}
|
998 |
+
};
|
999 |
|
1000 |
+
context.stop = function() {
|
1001 |
+
emitted = true;
|
|
|
1002 |
|
1003 |
+
// Reset the context to make way for the next swipe event
|
1004 |
+
$.event.special.swipe.eventInProgress = false;
|
1005 |
+
$document.off( touchMoveEvent, context.move );
|
1006 |
+
context.move = null;
|
1007 |
+
};
|
1008 |
+
|
1009 |
+
$document.on( touchMoveEvent, context.move )
|
1010 |
+
.one( touchStopEvent, context.stop );
|
1011 |
+
};
|
1012 |
+
$this.on( touchStartEvent, context.start );
|
1013 |
+
},
|
1014 |
+
|
1015 |
+
teardown: function() {
|
1016 |
+
var events, context;
|
1017 |
+
|
1018 |
+
events = $.data( this, "mobile-events" );
|
1019 |
+
if ( events ) {
|
1020 |
+
context = events.swipe;
|
1021 |
+
delete events.swipe;
|
1022 |
+
events.length--;
|
1023 |
+
if ( events.length === 0 ) {
|
1024 |
+
$.removeData( this, "mobile-events" );
|
1025 |
+
}
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
if ( context ) {
|
1029 |
+
if ( context.start ) {
|
1030 |
+
$( this ).off( touchStartEvent, context.start );
|
1031 |
+
}
|
1032 |
+
if ( context.move ) {
|
1033 |
+
$document.off( touchMoveEvent, context.move );
|
1034 |
+
}
|
1035 |
+
if ( context.stop ) {
|
1036 |
+
$document.off( touchStopEvent, context.stop );
|
1037 |
+
}
|
1038 |
+
}
|
1039 |
+
}
|
1040 |
+
};
|
1041 |
+
$.each( {
|
1042 |
+
taphold: "tap",
|
1043 |
+
swipeleft: "swipe.left",
|
1044 |
+
swiperight: "swipe.right"
|
1045 |
+
}, function( event, sourceEvent ) {
|
1046 |
+
|
1047 |
+
$.event.special[ event ] = {
|
1048 |
+
setup: function() {
|
1049 |
+
$( this ).bind( sourceEvent, $.noop );
|
1050 |
},
|
1051 |
teardown: function() {
|
1052 |
+
$( this ).unbind( sourceEvent );
|
|
|
1053 |
}
|
1054 |
};
|
1055 |
+
} );
|
1056 |
|
1057 |
+
return $.event.special;
|
1058 |
+
} );
|
1059 |
|
|
|
|
|
1060 |
|
1061 |
+
/*!
|
1062 |
+
* jQuery Mobile Defaults @VERSION
|
1063 |
+
* http://jquerymobile.com
|
1064 |
+
*
|
1065 |
+
* Copyright jQuery Foundation and other contributors
|
1066 |
+
* Released under the MIT license.
|
1067 |
+
* http://jquery.org/license
|
1068 |
+
*/
|
1069 |
|
1070 |
+
//>>label: Defaults
|
1071 |
+
//>>group: Core
|
1072 |
+
//>>description: Default values for jQuery Mobile
|
1073 |
+
//>>css.structure: ../css/structure/jquery.mobile.core.css
|
1074 |
+
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
|
1075 |
|
1076 |
+
( function( factory ) {
|
1077 |
+
if ( typeof define === "function" && define.amd ) {
|
1078 |
|
1079 |
+
// AMD. Register as an anonymous module.
|
1080 |
+
define( 'defaults',[
|
1081 |
+
"jquery",
|
1082 |
+
"./ns" ], factory );
|
1083 |
+
} else {
|
1084 |
|
1085 |
+
// Browser globals
|
1086 |
+
factory( jQuery );
|
1087 |
+
}
|
1088 |
+
} )( function( $ ) {
|
1089 |
|
1090 |
+
return $.extend( $.mobile, {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
|
1092 |
+
hideUrlBar: true,
|
|
|
|
|
|
|
|
|
1093 |
|
1094 |
+
// Keepnative Selector
|
1095 |
+
keepNative: ":jqmData(role='none'), :jqmData(role='nojs')",
|
1096 |
+
|
1097 |
+
// Automatically handle clicks and form submissions through Ajax, when same-domain
|
1098 |
+
ajaxEnabled: true,
|
1099 |
+
|
1100 |
+
// Automatically load and show pages based on location.hash
|
1101 |
+
hashListeningEnabled: true,
|
1102 |
+
|
1103 |
+
// disable to prevent jquery from bothering with links
|
1104 |
+
linkBindingEnabled: true,
|
1105 |
+
|
1106 |
+
// Set default page transition - 'none' for no transitions
|
1107 |
+
defaultPageTransition: "fade",
|
1108 |
+
|
1109 |
+
// Set maximum window width for transitions to apply - 'false' for no limit
|
1110 |
+
maxTransitionWidth: false,
|
1111 |
+
|
1112 |
+
// Set default dialog transition - 'none' for no transitions
|
1113 |
+
defaultDialogTransition: "pop",
|
1114 |
+
|
1115 |
+
// Error response message - appears when an Ajax page request fails
|
1116 |
+
pageLoadErrorMessage: "Error Loading Page",
|
1117 |
+
|
1118 |
+
// For error messages, which theme does the box use?
|
1119 |
+
pageLoadErrorMessageTheme: "a",
|
1120 |
+
|
1121 |
+
// replace calls to window.history.back with phonegaps navigation helper
|
1122 |
+
// where it is provided on the window object
|
1123 |
+
phonegapNavigationEnabled: false,
|
1124 |
+
|
1125 |
+
//automatically initialize the DOM when it's ready
|
1126 |
+
autoInitializePage: true,
|
1127 |
+
|
1128 |
+
pushStateEnabled: true,
|
1129 |
+
|
1130 |
+
// allows users to opt in to ignoring content by marking a parent element as
|
1131 |
+
// data-ignored
|
1132 |
+
ignoreContentEnabled: false,
|
1133 |
+
|
1134 |
+
// default the property to remove dependency on assignment in init module
|
1135 |
+
pageContainer: $(),
|
1136 |
|
1137 |
+
//enable cross-domain page support
|
1138 |
+
allowCrossDomainPages: false,
|
1139 |
+
|
1140 |
+
dialogHashKey: "&ui-state=dialog"
|
1141 |
+
} );
|
1142 |
+
} );
|
1143 |
+
|
1144 |
+
/*!
|
1145 |
+
* jQuery Mobile Data @VERSION
|
1146 |
+
* http://jquerymobile.com
|
1147 |
+
*
|
1148 |
+
* Copyright jQuery Foundation and other contributors
|
1149 |
+
* Released under the MIT license.
|
1150 |
+
* http://jquery.org/license
|
1151 |
+
*/
|
1152 |
+
|
1153 |
+
//>>label: jqmData
|
1154 |
+
//>>group: Core
|
1155 |
+
//>>description: Mobile versions of Data functions to allow for namespaceing
|
1156 |
+
//>>css.structure: ../css/structure/jquery.mobile.core.css
|
1157 |
+
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
|
1158 |
+
|
1159 |
+
( function( factory ) {
|
1160 |
+
if ( typeof define === "function" && define.amd ) {
|
1161 |
+
|
1162 |
+
// AMD. Register as an anonymous module.
|
1163 |
+
define( 'data',[
|
1164 |
+
"jquery",
|
1165 |
+
"./ns" ], factory );
|
1166 |
+
} else {
|
1167 |
+
|
1168 |
+
// Browser globals
|
1169 |
+
factory( jQuery );
|
1170 |
+
}
|
1171 |
+
} )( function( $ ) {
|
1172 |
+
|
1173 |
+
var nsNormalizeDict = {},
|
1174 |
+
oldFind = $.find,
|
1175 |
+
rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
|
1176 |
+
jqmDataRE = /:jqmData\(([^)]*)\)/g;
|
1177 |
+
|
1178 |
+
$.extend( $.mobile, {
|
1179 |
+
|
1180 |
+
// Namespace used framework-wide for data-attrs. Default is no namespace
|
1181 |
+
|
1182 |
+
ns: $.mobileBackcompat === false ? "ui-" : "",
|
1183 |
+
|
1184 |
+
// Retrieve an attribute from an element and perform some massaging of the value
|
1185 |
+
|
1186 |
+
getAttribute: function( element, key ) {
|
1187 |
+
var data;
|
1188 |
+
|
1189 |
+
element = element.jquery ? element[ 0 ] : element;
|
1190 |
+
|
1191 |
+
if ( element && element.getAttribute ) {
|
1192 |
+
data = element.getAttribute( "data-" + $.mobile.ns + key );
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
// Copied from core's src/data.js:dataAttr()
|
1196 |
+
// Convert from a string to a proper data type
|
1197 |
+
try {
|
1198 |
+
data = data === "true" ? true :
|
1199 |
+
data === "false" ? false :
|
1200 |
+
data === "null" ? null :
|
1201 |
+
// Only convert to a number if it doesn't change the string
|
1202 |
+
+data + "" === data ? +data :
|
1203 |
+
rbrace.test( data ) ? window.JSON.parse( data ) :
|
1204 |
+
data;
|
1205 |
+
} catch ( err ) {}
|
1206 |
+
|
1207 |
+
return data;
|
1208 |
+
},
|
1209 |
+
|
1210 |
+
// Expose our cache for testing purposes.
|
1211 |
+
nsNormalizeDict: nsNormalizeDict,
|
1212 |
+
|
1213 |
+
// Take a data attribute property, prepend the namespace
|
1214 |
+
// and then camel case the attribute string. Add the result
|
1215 |
+
// to our nsNormalizeDict so we don't have to do this again.
|
1216 |
+
nsNormalize: function( prop ) {
|
1217 |
+
return nsNormalizeDict[ prop ] ||
|
1218 |
+
( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
|
1219 |
+
},
|
1220 |
+
|
1221 |
+
// Find the closest javascript page element to gather settings data jsperf test
|
1222 |
+
// http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
|
1223 |
+
// possibly naive, but it shows that the parsing overhead for *just* the page selector vs
|
1224 |
+
// the page and dialog selector is negligable. This could probably be speed up by
|
1225 |
+
// doing a similar parent node traversal to the one found in the inherited theme code above
|
1226 |
+
closestPageData: function( $target ) {
|
1227 |
+
return $target
|
1228 |
+
.closest( ":jqmData(role='page'), :jqmData(role='dialog')" )
|
1229 |
+
.data( "mobile-page" );
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
} );
|
1233 |
+
|
1234 |
+
// Mobile version of data and removeData and hasData methods
|
1235 |
+
// ensures all data is set and retrieved using jQuery Mobile's data namespace
|
1236 |
+
$.fn.jqmData = function( prop, value ) {
|
1237 |
+
var result;
|
1238 |
+
if ( typeof prop !== "undefined" ) {
|
1239 |
+
if ( prop ) {
|
1240 |
+
prop = $.mobile.nsNormalize( prop );
|
1241 |
+
}
|
1242 |
+
|
1243 |
+
// undefined is permitted as an explicit input for the second param
|
1244 |
+
// in this case it returns the value and does not set it to undefined
|
1245 |
+
if ( arguments.length < 2 || value === undefined ) {
|
1246 |
+
result = this.data( prop );
|
1247 |
+
} else {
|
1248 |
+
result = this.data( prop, value );
|
1249 |
+
}
|
1250 |
+
}
|
1251 |
+
return result;
|
1252 |
+
};
|
1253 |
+
|
1254 |
+
$.jqmData = function( elem, prop, value ) {
|
1255 |
+
var result;
|
1256 |
+
if ( typeof prop !== "undefined" ) {
|
1257 |
+
result = $.data( elem, prop ? $.mobile.nsNormalize( prop ) : prop, value );
|
1258 |
+
}
|
1259 |
+
return result;
|
1260 |
+
};
|
1261 |
+
|
1262 |
+
$.fn.jqmRemoveData = function( prop ) {
|
1263 |
+
return this.removeData( $.mobile.nsNormalize( prop ) );
|
1264 |
+
};
|
1265 |
+
|
1266 |
+
$.jqmRemoveData = function( elem, prop ) {
|
1267 |
+
return $.removeData( elem, $.mobile.nsNormalize( prop ) );
|
1268 |
+
};
|
1269 |
+
|
1270 |
+
$.find = function( selector, context, ret, extra ) {
|
1271 |
+
if ( selector.indexOf( ":jqmData" ) > -1 ) {
|
1272 |
+
selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
|
1273 |
+
}
|
1274 |
+
|
1275 |
+
return oldFind.call( this, selector, context, ret, extra );
|
1276 |
+
};
|
1277 |
+
|
1278 |
+
$.extend( $.find, oldFind );
|
1279 |
+
|
1280 |
+
return $.mobile;
|
1281 |
+
} );
|
1282 |
+
|
1283 |
+
( function( factory ) {
|
1284 |
+
if ( typeof define === "function" && define.amd ) {
|
1285 |
+
|
1286 |
+
// AMD. Register as an anonymous module.
|
1287 |
+
define( 'jquery-ui/version',[ "jquery" ], factory );
|
1288 |
+
} else {
|
1289 |
+
|
1290 |
+
// Browser globals
|
1291 |
+
factory( jQuery );
|
1292 |
+
}
|
1293 |
+
} ( function( $ ) {
|
1294 |
+
|
1295 |
+
$.ui = $.ui || {};
|
1296 |
+
|
1297 |
+
return $.ui.version = "1.12.1";
|
1298 |
+
|
1299 |
+
} ) );
|
1300 |
+
|
1301 |
+
/*!
|
1302 |
+
* jQuery UI Keycode 1.12.1
|
1303 |
+
* http://jqueryui.com
|
1304 |
+
*
|
1305 |
+
* Copyright jQuery Foundation and other contributors
|
1306 |
+
* Released under the MIT license.
|
1307 |
+
* http://jquery.org/license
|
1308 |
+
*/
|
1309 |
+
|
1310 |
+
//>>label: Keycode
|
1311 |
+
//>>group: Core
|
1312 |
+
//>>description: Provide keycodes as keynames
|
1313 |
+
//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
|
1314 |
+
|
1315 |
+
( function( factory ) {
|
1316 |
+
if ( typeof define === "function" && define.amd ) {
|
1317 |
+
|
1318 |
+
// AMD. Register as an anonymous module.
|
1319 |
+
define( 'jquery-ui/keycode',[ "jquery", "./version" ], factory );
|
1320 |
+
} else {
|
1321 |
+
|
1322 |
+
// Browser globals
|
1323 |
+
factory( jQuery );
|
1324 |
+
}
|
1325 |
+
} ( function( $ ) {
|
1326 |
+
return $.ui.keyCode = {
|
1327 |
+
BACKSPACE: 8,
|
1328 |
+
COMMA: 188,
|
1329 |
+
DELETE: 46,
|
1330 |
+
DOWN: 40,
|
1331 |
+
END: 35,
|
1332 |
+
ENTER: 13,
|
1333 |
+
ESCAPE: 27,
|
1334 |
+
HOME: 36,
|
1335 |
+
LEFT: 37,
|
1336 |
+
PAGE_DOWN: 34,
|
1337 |
+
PAGE_UP: 33,
|
1338 |
+
PERIOD: 190,
|
1339 |
+
RIGHT: 39,
|
1340 |
+
SPACE: 32,
|
1341 |
+
TAB: 9,
|
1342 |
+
UP: 38
|
1343 |
+
};
|
1344 |
+
|
1345 |
+
} ) );
|
1346 |
+
|
1347 |
+
/*!
|
1348 |
+
* jQuery Mobile Helpers @VERSION
|
1349 |
+
* http://jquerymobile.com
|
1350 |
+
*
|
1351 |
+
* Copyright jQuery Foundation and other contributors
|
1352 |
+
* Released under the MIT license.
|
1353 |
+
* http://jquery.org/license
|
1354 |
+
*/
|
1355 |
+
|
1356 |
+
//>>label: Helpers
|
1357 |
+
//>>group: Core
|
1358 |
+
//>>description: Helper functions and references
|
1359 |
+
//>>css.structure: ../css/structure/jquery.mobile.core.css
|
1360 |
+
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
|
1361 |
+
|
1362 |
+
( function( factory ) {
|
1363 |
+
if ( typeof define === "function" && define.amd ) {
|
1364 |
+
|
1365 |
+
// AMD. Register as an anonymous module.
|
1366 |
+
define( 'helpers',[
|
1367 |
+
"jquery",
|
1368 |
+
"./ns",
|
1369 |
+
"jquery-ui/keycode" ], factory );
|
1370 |
+
} else {
|
1371 |
+
|
1372 |
+
// Browser globals
|
1373 |
+
factory( jQuery );
|
1374 |
+
}
|
1375 |
+
} )( function( $ ) {
|
1376 |
+
|
1377 |
+
// Subtract the height of external toolbars from the page height, if the page does not have
|
1378 |
+
// internal toolbars of the same type. We take care to use the widget options if we find a
|
1379 |
+
// widget instance and the element's data-attributes otherwise.
|
1380 |
+
var compensateToolbars = function( page, desiredHeight ) {
|
1381 |
+
var pageParent = page.parent(),
|
1382 |
+
toolbarsAffectingHeight = [],
|
1383 |
+
|
1384 |
+
// We use this function to filter fixed toolbars with option updatePagePadding set to
|
1385 |
+
// true (which is the default) from our height subtraction, because fixed toolbars with
|
1386 |
+
// option updatePagePadding set to true compensate for their presence by adding padding
|
1387 |
+
// to the active page. We want to avoid double-counting by also subtracting their
|
1388 |
+
// height from the desired page height.
|
1389 |
+
noPadders = function() {
|
1390 |
+
var theElement = $( this ),
|
1391 |
+
widgetOptions = $.mobile.toolbar && theElement.data( "mobile-toolbar" ) ?
|
1392 |
+
theElement.toolbar( "option" ) : {
|
1393 |
+
position: theElement.attr( "data-" + $.mobile.ns + "position" ),
|
1394 |
+
updatePagePadding: ( theElement.attr( "data-" + $.mobile.ns +
|
1395 |
+
"update-page-padding" ) !== false )
|
1396 |
};
|
1397 |
+
|
1398 |
+
return !( widgetOptions.position === "fixed" &&
|
1399 |
+
widgetOptions.updatePagePadding === true );
|
1400 |
},
|
1401 |
+
externalHeaders = pageParent.children( ":jqmData(type='header')" ).filter( noPadders ),
|
1402 |
+
internalHeaders = page.children( ":jqmData(type='header')" ),
|
1403 |
+
externalFooters = pageParent.children( ":jqmData(type='footer')" ).filter( noPadders ),
|
1404 |
+
internalFooters = page.children( ":jqmData(type='footer')" );
|
1405 |
+
|
1406 |
+
// If we have no internal headers, but we do have external headers, then their height
|
1407 |
+
// reduces the page height
|
1408 |
+
if ( internalHeaders.length === 0 && externalHeaders.length > 0 ) {
|
1409 |
+
toolbarsAffectingHeight = toolbarsAffectingHeight.concat( externalHeaders.toArray() );
|
1410 |
+
}
|
1411 |
|
1412 |
+
// If we have no internal footers, but we do have external footers, then their height
|
1413 |
+
// reduces the page height
|
1414 |
+
if ( internalFooters.length === 0 && externalFooters.length > 0 ) {
|
1415 |
+
toolbarsAffectingHeight = toolbarsAffectingHeight.concat( externalFooters.toArray() );
|
1416 |
+
}
|
1417 |
|
1418 |
+
$.each( toolbarsAffectingHeight, function( index, value ) {
|
1419 |
+
desiredHeight -= $( value ).outerHeight();
|
1420 |
+
} );
|
|
|
|
|
1421 |
|
1422 |
+
// Height must be at least zero
|
1423 |
+
return Math.max( 0, desiredHeight );
|
1424 |
+
};
|
1425 |
|
1426 |
+
$.extend( $.mobile, {
|
1427 |
+
// define the window and the document objects
|
1428 |
+
window: $( window ),
|
1429 |
+
document: $( document ),
|
1430 |
|
1431 |
+
// TODO: Remove and use $.ui.keyCode directly
|
1432 |
+
keyCode: $.ui.keyCode,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1433 |
|
1434 |
+
// Place to store various widget extensions
|
1435 |
+
behaviors: {},
|
1436 |
|
1437 |
+
// Custom logic for giving focus to a page
|
1438 |
+
focusPage: function( page ) {
|
|
|
|
|
|
|
1439 |
|
1440 |
+
// First, look for an element explicitly marked for page focus
|
1441 |
+
var focusElement = page.find( "[autofocus]" );
|
|
|
|
|
1442 |
|
1443 |
+
// If we do not find an element with the "autofocus" attribute, look for the page title
|
1444 |
+
if ( !focusElement.length ) {
|
1445 |
+
focusElement = page.find( ".ui-title" ).eq( 0 );
|
1446 |
+
}
|
1447 |
|
1448 |
+
// Finally, fall back to focusing the page itself
|
1449 |
+
if ( !focusElement.length ) {
|
1450 |
+
focusElement = page;
|
1451 |
+
}
|
1452 |
|
1453 |
+
focusElement.focus();
|
1454 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1455 |
|
1456 |
+
// Scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
|
1457 |
+
silentScroll: function( ypos ) {
|
1458 |
|
1459 |
+
// If user has already scrolled then do nothing
|
1460 |
+
if ( $.mobile.window.scrollTop() > 0 ) {
|
1461 |
+
return;
|
1462 |
+
}
|
|
|
1463 |
|
1464 |
+
if ( $.type( ypos ) !== "number" ) {
|
1465 |
+
ypos = $.mobile.defaultHomeScroll;
|
1466 |
+
}
|
|
|
|
|
1467 |
|
1468 |
+
// prevent scrollstart and scrollstop events
|
1469 |
+
$.event.special.scrollstart.enabled = false;
|
1470 |
+
|
1471 |
+
setTimeout( function() {
|
1472 |
+
window.scrollTo( 0, ypos );
|
1473 |
+
$.mobile.document.trigger( "silentscroll", { x: 0, y: ypos } );
|
1474 |
+
}, 20 );
|
1475 |
+
|
1476 |
+
setTimeout( function() {
|
1477 |
+
$.event.special.scrollstart.enabled = true;
|
1478 |
+
}, 150 );
|
1479 |
+
},
|
1480 |
+
|
1481 |
+
getClosestBaseUrl: function( ele ) {
|
1482 |
+
// Find the closest page and extract out its url.
|
1483 |
+
var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
|
1484 |
+
base = $.mobile.path.documentBase.hrefNoHash;
|
1485 |
+
|
1486 |
+
if ( !$.mobile.base.dynamicBaseEnabled || !url || !$.mobile.path.isPath( url ) ) {
|
1487 |
+
url = base;
|
1488 |
+
}
|
1489 |
+
|
1490 |
+
return $.mobile.path.makeUrlAbsolute( url, base );
|
1491 |
+
},
|
1492 |
+
removeActiveLinkClass: function( forceRemoval ) {
|
1493 |
+
if ( !!$.mobile.activeClickedLink &&
|
1494 |
+
( !$.mobile.activeClickedLink.closest( ".ui-page-active" ).length ||
|
1495 |
+
forceRemoval ) ) {
|
1496 |
+
|
1497 |
+
$.mobile.activeClickedLink.removeClass( "ui-button-active" );
|
1498 |
+
}
|
1499 |
+
$.mobile.activeClickedLink = null;
|
1500 |
+
},
|
1501 |
+
|
1502 |
+
enhanceable: function( elements ) {
|
1503 |
+
return this.haveParents( elements, "enhance" );
|
1504 |
+
},
|
1505 |
+
|
1506 |
+
hijackable: function( elements ) {
|
1507 |
+
return this.haveParents( elements, "ajax" );
|
1508 |
+
},
|
1509 |
+
|
1510 |
+
haveParents: function( elements, attr ) {
|
1511 |
+
if ( !$.mobile.ignoreContentEnabled ) {
|
1512 |
+
return elements;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
var count = elements.length,
|
1516 |
+
$newSet = $(),
|
1517 |
+
e, $element, excluded,
|
1518 |
+
i, c;
|
1519 |
+
|
1520 |
+
for ( i = 0; i < count; i++ ) {
|
1521 |
+
$element = elements.eq( i );
|
1522 |
+
excluded = false;
|
1523 |
+
e = elements[ i ];
|
1524 |
+
|
1525 |
+
while ( e ) {
|
1526 |
+
c = e.getAttribute ? e.getAttribute( "data-" + $.mobile.ns + attr ) : "";
|
1527 |
+
|
1528 |
+
if ( c === "false" ) {
|
1529 |
+
excluded = true;
|
1530 |
+
break;
|
1531 |
}
|
1532 |
+
|
1533 |
+
e = e.parentNode;
|
1534 |
}
|
1535 |
|
1536 |
+
if ( !excluded ) {
|
1537 |
+
$newSet = $newSet.add( $element );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1538 |
}
|
1539 |
}
|
1540 |
+
|
1541 |
+
return $newSet;
|
1542 |
+
},
|
1543 |
+
|
1544 |
+
getScreenHeight: function() {
|
1545 |
+
// Native innerHeight returns more accurate value for this across platforms,
|
1546 |
+
// jQuery version is here as a normalized fallback for platforms like Symbian
|
1547 |
+
return window.innerHeight || $.mobile.window.height();
|
1548 |
+
},
|
1549 |
+
|
1550 |
+
//simply set the active page's minimum height to screen height, depending on orientation
|
1551 |
+
resetActivePageHeight: function( height ) {
|
1552 |
+
var page = $( ".ui-page-active" ),
|
1553 |
+
pageHeight = page.height(),
|
1554 |
+
pageOuterHeight = page.outerHeight( true );
|
1555 |
+
|
1556 |
+
height = compensateToolbars( page,
|
1557 |
+
( typeof height === "number" ) ? height : $( window ).height() );
|
1558 |
+
|
1559 |
+
// Remove any previous min-height setting
|
1560 |
+
page.css( "min-height", "" );
|
1561 |
+
|
1562 |
+
// Set the minimum height only if the height as determined by CSS is insufficient
|
1563 |
+
if ( page.height() < height ) {
|
1564 |
+
page.css( "min-height", height - ( pageOuterHeight - pageHeight ) );
|
1565 |
+
}
|
1566 |
+
},
|
1567 |
+
|
1568 |
+
loading: function() {
|
1569 |
+
// If this is the first call to this function, instantiate a loader widget
|
1570 |
+
var loader = this.loading._widget || $.mobile.loader().element,
|
1571 |
+
|
1572 |
+
// Call the appropriate method on the loader
|
1573 |
+
returnValue = loader.loader.apply( loader, arguments );
|
1574 |
+
|
1575 |
+
// Make sure the loader is retained for future calls to this function.
|
1576 |
+
this.loading._widget = loader;
|
1577 |
+
|
1578 |
+
return returnValue;
|
1579 |
+
},
|
1580 |
+
|
1581 |
+
isElementCurrentlyVisible: function( el ) {
|
1582 |
+
el = typeof el === "string" ? $( el )[ 0 ] : el[ 0 ];
|
1583 |
+
|
1584 |
+
if( !el ) {
|
1585 |
+
return true;
|
1586 |
+
}
|
1587 |
+
|
1588 |
+
var rect = el.getBoundingClientRect();
|
1589 |
+
|
1590 |
+
return (
|
1591 |
+
rect.bottom > 0 &&
|
1592 |
+
rect.right > 0 &&
|
1593 |
+
rect.top <
|
1594 |
+
( window.innerHeight || document.documentElement.clientHeight ) &&
|
1595 |
+
rect.left <
|
1596 |
+
( window.innerWidth || document.documentElement.clientWidth ) );
|
1597 |
+
}
|
1598 |
+
} );
|
1599 |
+
|
1600 |
+
$.addDependents = function( elem, newDependents ) {
|
1601 |
+
var $elem = $( elem ),
|
1602 |
+
dependents = $elem.jqmData( "dependents" ) || $();
|
1603 |
+
|
1604 |
+
$elem.jqmData( "dependents", $( dependents ).add( newDependents ) );
|
1605 |
+
};
|
1606 |
+
|
1607 |
+
// plugins
|
1608 |
+
$.fn.extend( {
|
1609 |
+
removeWithDependents: function() {
|
1610 |
+
$.removeWithDependents( this );
|
1611 |
+
},
|
1612 |
+
|
1613 |
+
addDependents: function( newDependents ) {
|
1614 |
+
$.addDependents( this, newDependents );
|
1615 |
+
},
|
1616 |
+
|
1617 |
+
// note that this helper doesn't attempt to handle the callback
|
1618 |
+
// or setting of an html element's text, its only purpose is
|
1619 |
+
// to return the html encoded version of the text in all cases. (thus the name)
|
1620 |
+
getEncodedText: function() {
|
1621 |
+
return $( "<a>" ).text( this.text() ).html();
|
1622 |
+
},
|
1623 |
+
|
1624 |
+
// fluent helper function for the mobile namespaced equivalent
|
1625 |
+
jqmEnhanceable: function() {
|
1626 |
+
return $.mobile.enhanceable( this );
|
1627 |
+
},
|
1628 |
+
|
1629 |
+
jqmHijackable: function() {
|
1630 |
+
return $.mobile.hijackable( this );
|
1631 |
+
}
|
1632 |
+
} );
|
1633 |
+
|
1634 |
+
$.removeWithDependents = function( nativeElement ) {
|
1635 |
+
var element = $( nativeElement );
|
1636 |
+
|
1637 |
+
( element.jqmData( "dependents" ) || $() ).remove();
|
1638 |
+
element.remove();
|
1639 |
+
};
|
1640 |
+
$.addDependents = function( nativeElement, newDependents ) {
|
1641 |
+
var element = $( nativeElement ),
|
1642 |
+
dependents = element.jqmData( "dependents" ) || $();
|
1643 |
+
|
1644 |
+
element.jqmData( "dependents", $( dependents ).add( newDependents ) );
|
1645 |
+
};
|
1646 |
+
|
1647 |
+
$.find.matches = function( expr, set ) {
|
1648 |
+
return $.find( expr, null, null, set );
|
1649 |
+
};
|
1650 |
+
|
1651 |
+
$.find.matchesSelector = function( node, expr ) {
|
1652 |
+
return $.find( expr, null, null, [ node ] ).length > 0;
|
1653 |
+
};
|
1654 |
+
|
1655 |
+
return $.mobile;
|
1656 |
+
} );
|
1657 |
+
|
1658 |
+
/*!
|
1659 |
+
* jQuery Mobile Core @VERSION
|
1660 |
+
* http://jquerymobile.com
|
1661 |
+
*
|
1662 |
+
* Copyright jQuery Foundation and other contributors
|
1663 |
+
* Released under the MIT license.
|
1664 |
+
* http://jquery.org/license
|
1665 |
+
*/
|
1666 |
+
|
1667 |
+
//>>group: exclude
|
1668 |
+
|
1669 |
+
( function( factory ) {
|
1670 |
+
if ( typeof define === "function" && define.amd ) {
|
1671 |
+
|
1672 |
+
// AMD. Register as an anonymous module.
|
1673 |
+
define( 'core',[
|
1674 |
+
"./defaults",
|
1675 |
+
"./data",
|
1676 |
+
"./helpers" ], factory );
|
1677 |
+
} else {
|
1678 |
+
|
1679 |
+
// Browser globals
|
1680 |
+
factory( jQuery );
|
1681 |
+
}
|
1682 |
+
} )( function() {} );
|
1683 |
+
|
1684 |
+
/*!
|
1685 |
+
* jQuery Mobile Match Media Polyfill @VERSION
|
1686 |
+
* http://jquerymobile.com
|
1687 |
+
*
|
1688 |
+
* Copyright jQuery Foundation and other contributors
|
1689 |
+
* Released under the MIT license.
|
1690 |
+
* http://jquery.org/license
|
1691 |
+
*/
|
1692 |
+
|
1693 |
+
//>>label: Match Media Polyfill
|
1694 |
+
//>>group: Utilities
|
1695 |
+
//>>description: A workaround for browsers without window.matchMedia
|
1696 |
+
|
1697 |
+
( function( factory ) {
|
1698 |
+
if ( typeof define === "function" && define.amd ) {
|
1699 |
+
|
1700 |
+
// AMD. Register as an anonymous module.
|
1701 |
+
define( 'media',[
|
1702 |
+
"jquery",
|
1703 |
+
"./core" ], factory );
|
1704 |
+
} else {
|
1705 |
+
|
1706 |
+
// Browser globals
|
1707 |
+
factory( jQuery );
|
1708 |
+
}
|
1709 |
+
} )( function( $ ) {
|
1710 |
+
|
1711 |
+
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
1712 |
+
window.matchMedia = window.matchMedia || ( function( doc, undefined ) {
|
1713 |
+
|
1714 |
+
var bool,
|
1715 |
+
docElem = doc.documentElement,
|
1716 |
+
refNode = docElem.firstElementChild || docElem.firstChild,
|
1717 |
+
// fakeBody required for <FF4 when executed in <head>
|
1718 |
+
fakeBody = doc.createElement( "body" ),
|
1719 |
+
div = doc.createElement( "div" );
|
1720 |
+
|
1721 |
+
div.id = "mq-test-1";
|
1722 |
+
div.style.cssText = "position:absolute;top:-100em";
|
1723 |
+
fakeBody.style.background = "none";
|
1724 |
+
fakeBody.appendChild( div );
|
1725 |
+
|
1726 |
+
return function( q ) {
|
1727 |
+
|
1728 |
+
div.innerHTML = "­<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
|
1729 |
+
|
1730 |
+
docElem.insertBefore( fakeBody, refNode );
|
1731 |
+
bool = div.offsetWidth === 42;
|
1732 |
+
docElem.removeChild( fakeBody );
|
1733 |
+
|
1734 |
+
return {
|
1735 |
+
matches: bool,
|
1736 |
+
media: q
|
1737 |
+
};
|
1738 |
+
|
1739 |
};
|
1740 |
+
|
1741 |
+
}( document ) );
|
1742 |
+
|
1743 |
+
// $.mobile.media uses matchMedia to return a boolean.
|
1744 |
+
$.mobile.media = function( q ) {
|
1745 |
+
var mediaQueryList = window.matchMedia( q );
|
1746 |
+
// Firefox returns null in a hidden iframe
|
1747 |
+
return mediaQueryList && mediaQueryList.matches;
|
1748 |
+
};
|
1749 |
+
|
1750 |
+
return $.mobile.media;
|
1751 |
+
|
1752 |
+
} );
|
1753 |
+
|
1754 |
+
/*!
|
1755 |
+
* jQuery Mobile Enhancer @VERSION
|
1756 |
+
* http://jquerymobile.com
|
1757 |
+
*
|
1758 |
+
* Copyright jQuery Foundation and other contributors
|
1759 |
+
* Released under the MIT license.
|
1760 |
+
* http://jquery.org/license
|
1761 |
+
*/
|
1762 |
+
|
1763 |
+
//>>label: Enhancer
|
1764 |
+
//>>group: Widgets
|
1765 |
+
//>>description: Enhables declarative initalization of widgets
|
1766 |
+
//>>docs: http://api.jquerymobile.com/enhancer/
|
1767 |
+
|
1768 |
+
( function( factory ) {
|
1769 |
+
if ( typeof define === "function" && define.amd ) {
|
1770 |
+
|
1771 |
+
// AMD. Register as an anonymous module.
|
1772 |
+
define( 'widgets/enhancer',[
|
1773 |
+
"jquery" ], factory );
|
1774 |
+
} else {
|
1775 |
+
|
1776 |
+
// Browser globals
|
1777 |
+
factory( jQuery );
|
1778 |
+
}
|
1779 |
+
} )( function( $ ) {
|
1780 |
+
|
1781 |
+
var widgetBaseClass,
|
1782 |
+
installed = false;
|
1783 |
+
|
1784 |
+
$.fn.extend( {
|
1785 |
+
enhance: function() {
|
1786 |
+
return $.enhance.enhance( this );
|
1787 |
+
},
|
1788 |
+
enhanceWithin: function() {
|
1789 |
+
this.children().enhance();
|
1790 |
+
return this;
|
1791 |
+
},
|
1792 |
+
enhanceOptions: function() {
|
1793 |
+
return $.enhance.getOptions( this );
|
1794 |
+
},
|
1795 |
+
enhanceRoles: function() {
|
1796 |
+
return $.enhance.getRoles( this );
|
1797 |
+
}
|
1798 |
+
} );
|
1799 |
+
$.enhance = $.enhance || {};
|
1800 |
+
$.extend( $.enhance, {
|
1801 |
+
|
1802 |
+
enhance: function( elem ) {
|
1803 |
+
var i,
|
1804 |
+
enhanceables = elem.find( "[" + $.enhance.defaultProp() + "]" ).addBack();
|
1805 |
+
|
1806 |
+
if ( $.enhance._filter ) {
|
1807 |
+
enhanceables = $.enhance._filter( enhanceables );
|
1808 |
+
}
|
1809 |
+
|
1810 |
+
// Loop over and execute any hooks that exist
|
1811 |
+
for ( i = 0; i < $.enhance.hooks.length; i++ ) {
|
1812 |
+
$.enhance.hooks[ i ].call( elem, enhanceables );
|
1813 |
+
}
|
1814 |
+
|
1815 |
+
// Call the default enhancer function
|
1816 |
+
$.enhance.defaultFunction.call( elem, enhanceables );
|
1817 |
+
|
1818 |
+
return elem;
|
1819 |
+
},
|
1820 |
+
|
1821 |
+
// Check if the enhancer has already been defined if it has copy its hooks if not
|
1822 |
+
// define an empty array
|
1823 |
+
hooks: $.enhance.hooks || [],
|
1824 |
+
|
1825 |
+
_filter: $.enhance._filter || false,
|
1826 |
+
|
1827 |
+
defaultProp: $.enhance.defaultProp || function() { return "data-ui-role"; },
|
1828 |
+
|
1829 |
+
defaultFunction: function( enhanceables ) {
|
1830 |
+
enhanceables.each( function() {
|
1831 |
+
var i,
|
1832 |
+
roles = $( this ).enhanceRoles();
|
1833 |
+
|
1834 |
+
for ( i = 0; i < roles.length; i++ ) {
|
1835 |
+
if ( $.fn[ roles[ i ] ] ) {
|
1836 |
+
$( this )[ roles[ i ] ]();
|
1837 |
+
}
|
1838 |
}
|
1839 |
+
} );
|
1840 |
+
},
|
1841 |
+
|
1842 |
+
cache: true,
|
1843 |
+
|
1844 |
+
roleCache: {},
|
1845 |
+
|
1846 |
+
getRoles: function( element ) {
|
1847 |
+
if ( !element.length ) {
|
1848 |
+
return [];
|
1849 |
+
}
|
1850 |
+
|
1851 |
+
var role,
|
1852 |
+
|
1853 |
+
// Look for cached roles
|
1854 |
+
roles = $.enhance.roleCache[ !!element[ 0 ].id ? element[ 0 ].id : undefined ];
|
1855 |
+
|
1856 |
+
// We already have done this return the roles
|
1857 |
+
if ( roles ) {
|
1858 |
+
return roles;
|
1859 |
+
}
|
1860 |
+
|
1861 |
+
// This is our first time get the attribute and parse it
|
1862 |
+
role = element.attr( $.enhance.defaultProp() );
|
1863 |
+
roles = role ? role.match( /\S+/g ) : [];
|
1864 |
+
|
1865 |
+
// Caches the array of roles for next time
|
1866 |
+
$.enhance.roleCache[ element[ 0 ].id ] = roles;
|
1867 |
+
|
1868 |
+
// Return the roles
|
1869 |
+
return roles;
|
1870 |
+
},
|
1871 |
+
|
1872 |
+
optionCache: {},
|
1873 |
+
|
1874 |
+
getOptions: function( element ) {
|
1875 |
+
var options = $.enhance.optionCache[ !!element[ 0 ].id ? element[ 0 ].id : undefined ],
|
1876 |
+
ns;
|
1877 |
+
|
1878 |
+
// Been there done that return what we already found
|
1879 |
+
if ( !!options ) {
|
1880 |
+
return options;
|
1881 |
+
}
|
1882 |
+
|
1883 |
+
// This is the first time lets compile the options object
|
1884 |
+
options = {};
|
1885 |
+
ns = ( $.mobile.ns || "ui-" ).replace( "-", "" );
|
1886 |
+
|
1887 |
+
$.each( $( element ).data(), function( option, value ) {
|
1888 |
+
option = option.replace( ns, "" );
|
1889 |
+
|
1890 |
+
option = option.charAt( 0 ).toLowerCase() + option.slice( 1 );
|
1891 |
+
options[ option ] = value;
|
1892 |
+
} );
|
1893 |
+
|
1894 |
+
// Cache the options for next time
|
1895 |
+
$.enhance.optionCache[ element[ 0 ].id ] = options;
|
1896 |
+
|
1897 |
+
// Return the options
|
1898 |
+
return options;
|
1899 |
+
},
|
1900 |
+
|
1901 |
+
_installWidget: function() {
|
1902 |
+
if ( $.Widget && !installed ) {
|
1903 |
+
$.extend( $.Widget.prototype, {
|
1904 |
+
_getCreateOptions: function( options ) {
|
1905 |
+
var option, value,
|
1906 |
+
dataOptions = this.element.enhanceOptions();
|
1907 |
+
|
1908 |
+
options = options || {};
|
1909 |
+
|
1910 |
+
// Translate data-attributes to options
|
1911 |
+
for ( option in this.options ) {
|
1912 |
+
value = dataOptions[ option ];
|
1913 |
+
if ( value !== undefined ) {
|
1914 |
+
options[ option ] = value;
|
1915 |
+
}
|
1916 |
+
}
|
1917 |
+
return options;
|
1918 |
+
}
|
1919 |
+
} );
|
1920 |
+
installed = true;
|
1921 |
+
}
|
1922 |
+
}
|
1923 |
+
} );
|
1924 |
+
|
1925 |
+
if ( !$.Widget ) {
|
1926 |
+
Object.defineProperty( $, "Widget", {
|
1927 |
+
configurable: true,
|
1928 |
+
enumerable: true,
|
1929 |
+
get: function() {
|
1930 |
+
return widgetBaseClass;
|
1931 |
+
},
|
1932 |
+
set: function( newValue ) {
|
1933 |
+
if ( newValue ) {
|
1934 |
+
widgetBaseClass = newValue;
|
1935 |
+
setTimeout( function() {
|
1936 |
+
$.enhance._installWidget();
|
1937 |
+
} );
|
1938 |
+
}
|
1939 |
+
}
|
1940 |
+
} );
|
1941 |
+
} else {
|
1942 |
+
$.enhance._installWidget();
|
1943 |
+
}
|
1944 |
|
1945 |
+
return $.enhance;
|
1946 |
+
} );
|
1947 |
|
1948 |
|
1949 |
}));
|
resources/jquery.mobile.custom.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! jQuery Mobile v1.
|
2 |
|
3 |
-
(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)});
|
1 |
+
/*! jQuery Mobile v1.5.0-rc1 | Copyright jQuery Foundation, Inc. | jquery.org/license */
|
2 |
|
3 |
+
!function(e,t,n){"function"==typeof define&&define.amd?define(["jquery"],function(i){return n(i,e,t),i.mobile}):n(e.jQuery,e,t)}(this,document,function(e,t,n,i){!function(t){"function"==typeof define&&define.amd?define("events/scroll",["jquery"],t):t(e)}(function(e){return e.each(["scrollstart","scrollstop"],function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function t(t,i){var a=t.type;n=i,t.type=n?"scrollstart":"scrollstop",e.event.dispatch.call(o,t),t.type=a}var n,i,o=this,a=e(o),r=e.event.special.scrollstart.handler=function(o){e.event.special.scrollstart.enabled&&(n||t(o,!0),clearTimeout(i),i=setTimeout(function(){t(o,!1)},50))};a.on("touchmove scroll",r)},teardown:function(){e(this).off("touchmove scroll",e.event.special.scrollstart.handler)}},e.each({scrollstop:"scrollstart"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}}),e.event.special}),function(t){"function"==typeof define&&define.amd?define("vmouse",["jquery"],t):t(e)}(function(e){function t(e){for(;e&&void 0!==e.originalEvent;)e=e.originalEvent;return e}function o(n,o){var a,r,s,c,u,l,d,h,f,p=n.type;if(n=e.Event(n),n.type=o,a=n.originalEvent,r=k,p.search(/^(mouse|click)/)>-1&&(r=x),a)for(d=r.length;d;)c=r[--d],n[c]=a[c];if(p.search(/mouse(down|up)|click/)>-1&&!n.which&&(n.which=1),-1!==p.search(/^touch/)&&(s=t(a),p=s.touches,u=s.changedTouches,l=p&&p.length?p[0]:u&&u.length?u[0]:i))for(h=0,f=P.length;h<f;h++)c=P[h],n[c]=l[c];return n}function a(t){for(var n,i,o={};t;){n=e.data(t,E);for(i in n)n[i]&&(o[i]=o.hasVirtualBinding=!0);t=t.parentNode}return o}function r(t,n){for(var i;t;){if((i=e.data(t,E))&&(!n||i[n]))return t;t=t.parentNode}return null}function s(){B=!1}function c(){B=!0}function u(){X=0,O.length=0,W=!1,c()}function l(){s()}function d(){S&&(clearTimeout(S),S=0)}function h(){d(),S=setTimeout(function(){S=0,u()},e.vmouse.resetTimerDuration)}function f(t,n,i){var a;return(i&&i[t]||!i&&r(n.target,t))&&(a=o(n,t),e(n.target).trigger(a)),a}function p(t){var n,i=e.data(t.target,j);"click"===t.type&&"touchstart"===e.data(t.target,"lastTouchType")&&setTimeout(function(){"touchstart"===e.data(t.target,"lastTouchType")&&(u(),delete e.data(t.target).lastTouchType,p(t))},e.vmouse.maximumTimeBetweenTouches),W||X&&X===i||(n=f("v"+t.type,t))&&(n.isDefaultPrevented()&&t.preventDefault(),n.isPropagationStopped()&&t.stopPropagation(),n.isImmediatePropagationStopped()&&t.stopImmediatePropagation())}function m(n){var i,o,r,s=t(n).touches;s&&1===s.length&&(i=n.target,o=a(i),e.data(n.target,"lastTouchType",n.type),o.hasVirtualBinding&&(X=R++,e.data(i,j,X),d(),l(),L=!1,r=t(n).touches[0],A=r.pageX,N=r.pageY,f("vmouseover",n,o),f("vmousedown",n,o)))}function v(t){B||(L||f("vmousecancel",t,a(t.target)),e.data(t.target,"lastTouchType",t.type),L=!0,h())}function g(n){if(!B){var i=t(n).touches[0],o=L,r=e.vmouse.moveDistanceThreshold,s=a(n.target);e.data(n.target,"lastTouchType",n.type),L=L||Math.abs(i.pageX-A)>r||Math.abs(i.pageY-N)>r,L&&!o&&f("vmousecancel",n,s),f("vmousemove",n,s),h()}}function b(n){if(!B&&e.data(n.target,"lastTouchType")!==i){c(),delete e.data(n.target).lastTouchType;var o,r,s=a(n.target);f("vmouseup",n,s),L||(o=f("vclick",n,s))&&o.isDefaultPrevented()&&(r=t(n).changedTouches[0],O.push({touchID:X,x:r.clientX,y:r.clientY}),W=!0),f("vmouseout",n,s),L=!1,h()}}function y(t){var n,i=e.data(t,E);if(i)for(n in i)if(i[n])return!0;return!1}function T(){}var w,D,E="virtualMouseBindings",j="virtualTouchID",P="clientX clientY pageX pageY screenX screenY".split(" "),q="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),k="altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),C=e.event.mouseHooks?e.event.mouseHooks.props:[],x=k.concat(C),M={},S=0,A=0,N=0,L=!1,O=[],W=!1,B=!1,H="addEventListener"in n,I=e(n),R=1,X=0;for(e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500,maximumTimeBetweenTouches:100},D=0;D<q.length;D++)e.event.special[q[D]]=function(t){var n=t.substr(1);return{setup:function(){y(this)||e.data(this,E,{}),e.data(this,E)[t]=!0,M[t]=(M[t]||0)+1,1===M[t]&&I.bind(n,p),e(this).bind(n,T),H&&(M.touchstart=(M.touchstart||0)+1,1===M.touchstart&&I.bind("touchstart",m).bind("touchend",b).bind("touchmove",g).bind("scroll",v))},teardown:function(){--M[t],M[t]||I.unbind(n,p),H&&(--M.touchstart||I.unbind("touchstart",m).unbind("touchmove",g).unbind("touchend",b).unbind("scroll",v));var i=e(this),o=e.data(this,E);o&&(o[t]=!1),i.unbind(n,T),y(this)||i.removeData(E)}}}(q[D]);H&&n.addEventListener("click",function(t){var n,i,o,a,r,s=O.length,c=t.target;if(s)for(n=t.clientX,i=t.clientY,w=e.vmouse.clickDistanceThreshold,o=c;o;){for(a=0;a<s;a++)if(r=O[a],0,o===c&&Math.abs(r.x-n)<w&&Math.abs(r.y-i)<w||e.data(o,j)===r.touchID)return t.preventDefault(),void t.stopPropagation();o=o.parentNode}},!0)}),function(t){"function"==typeof define&&define.amd?define("ns",["jquery"],t):t(e)}(function(e){return e.mobile={version:"@VERSION"},e.mobile}),function(t){"function"==typeof define&&define.amd?define("support/touch",["jquery","../ns"],t):t(e)}(function(e){var t={touch:"ontouchend"in n};return e.mobile.support=e.mobile.support||{},e.extend(e.support,t),e.extend(e.mobile.support,t),e.support}),function(t){"function"==typeof define&&define.amd?define("events/touch",["jquery","../vmouse","../support/touch"],t):t(e)}(function(e){function o(t,n,o,a){var r=o.type;o.type=n,a?e.event.trigger(o,i,t):e.event.dispatch.call(t,o),o.type=r}var a=e(n),r=e.mobile.support.touch,s=r?"touchstart":"mousedown",c=r?"touchend":"mouseup",u=r?"touchmove":"mousemove";return e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),i=!1;n.bind("vmousedown",function(r){function s(){u&&(n.bind("vclick",l),clearTimeout(u))}function c(){s(),n.unbind("vclick",l).unbind("vmouseup",s),a.unbind("vmousecancel",c)}if(i=!1,r.which&&1!==r.which)return!0;var u,l,d=r.target;l=function(e){c(),i||d!==e.target?i&&e.preventDefault():o(t,"tap",e)},n.bind("vmouseup",s),a.bind("vmousecancel",c),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(i=!0),u=0,o(t,"taphold",e.Event("taphold",{target:d}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),a.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:t.devicePixelRatio>=2?15:30,verticalDistanceThreshold:t.devicePixelRatio>=2?15:30,getLocation:function(e){var n=t.pageXOffset,i=t.pageYOffset,o=e.clientX,a=e.clientY;return 0===e.pageY&&Math.floor(a)>Math.floor(e.pageY)||0===e.pageX&&Math.floor(o)>Math.floor(e.pageX)?(o-=n,a-=i):(a<e.pageY-i||o<e.pageX-n)&&(o=e.pageX-n,a=e.pageY-i),{x:o,y:a}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,i=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[i.x,i.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,i=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[i.x,i.y]}},handleSwipe:function(t,n,i,a){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var r=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return o(i,"swipe",e.Event("swipe",{target:a,swipestart:t,swipestop:n}),!0),o(i,r,e.Event(r,{target:a,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,i=e(n),o={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=o,o.start=function(t){if(!e.event.special.swipe.eventInProgress){e.event.special.swipe.eventInProgress=!0;var i,r=e.event.special.swipe.start(t),s=t.target,l=!1;o.move=function(t){r&&!t.isDefaultPrevented()&&(i=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(r,i,n,s))&&(e.event.special.swipe.eventInProgress=!1),Math.abs(r.coords[0]-i.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault())},o.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,a.off(u,o.move),o.move=null},a.on(u,o.move).one(c,o.stop)}},i.on(s,o.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,0===--t.length&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(s,n.start),n.move&&a.off(u,n.move),n.stop&&a.off(c,n.stop))}},e.each({taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}}),e.event.special}),function(t){"function"==typeof define&&define.amd?define("defaults",["jquery","./ns"],t):t(e)}(function(e){return e.extend(e.mobile,{hideUrlBar:!0,keepNative:":jqmData(role='none'), :jqmData(role='nojs')",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"a",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,pageContainer:e(),allowCrossDomainPages:!1,dialogHashKey:"&ui-state=dialog"})}),function(t){"function"==typeof define&&define.amd?define("data",["jquery","./ns"],t):t(e)}(function(e){var n={},o=e.find,a=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,r=/:jqmData\(([^)]*)\)/g;return e.extend(e.mobile,{ns:!1===e.mobileBackcompat?"ui-":"",getAttribute:function(n,i){var o;(n=n.jquery?n[0]:n)&&n.getAttribute&&(o=n.getAttribute("data-"+e.mobile.ns+i));try{o="true"===o||"false"!==o&&("null"===o?null:+o+""===o?+o:a.test(o)?t.JSON.parse(o):o)}catch(e){}return o},nsNormalizeDict:n,nsNormalize:function(t){return n[t]||(n[t]=e.camelCase(e.mobile.ns+t))},closestPageData:function(e){return e.closest(":jqmData(role='page'), :jqmData(role='dialog')").data("mobile-page")}}),e.fn.jqmData=function(t,n){var o;return void 0!==t&&(t&&(t=e.mobile.nsNormalize(t)),o=arguments.length<2||n===i?this.data(t):this.data(t,n)),o},e.jqmData=function(t,n,i){var o;return void 0!==n&&(o=e.data(t,n?e.mobile.nsNormalize(n):n,i)),o},e.fn.jqmRemoveData=function(t){return this.removeData(e.mobile.nsNormalize(t))},e.jqmRemoveData=function(t,n){return e.removeData(t,e.mobile.nsNormalize(n))},e.find=function(t,n,i,a){return t.indexOf(":jqmData")>-1&&(t=t.replace(r,"[data-"+(e.mobile.ns||"")+"$1]")),o.call(this,t,n,i,a)},e.extend(e.find,o),e.mobile}),function(t){"function"==typeof define&&define.amd?define("jquery-ui/version",["jquery"],t):t(e)}(function(e){return e.ui=e.ui||{},e.ui.version="1.12.1"}),function(t){"function"==typeof define&&define.amd?define("jquery-ui/keycode",["jquery","./version"],t):t(e)}(function(e){return e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),function(t){"function"==typeof define&&define.amd?define("helpers",["jquery","./ns","jquery-ui/keycode"],t):t(e)}(function(e){var i=function(t,n){var i=t.parent(),o=[],a=function(){var t=e(this),n=e.mobile.toolbar&&t.data("mobile-toolbar")?t.toolbar("option"):{position:t.attr("data-"+e.mobile.ns+"position"),updatePagePadding:!1!==t.attr("data-"+e.mobile.ns+"update-page-padding")};return!("fixed"===n.position&&!0===n.updatePagePadding)},r=i.children(":jqmData(type='header')").filter(a),s=t.children(":jqmData(type='header')"),c=i.children(":jqmData(type='footer')").filter(a),u=t.children(":jqmData(type='footer')");return 0===s.length&&r.length>0&&(o=o.concat(r.toArray())),0===u.length&&c.length>0&&(o=o.concat(c.toArray())),e.each(o,function(t,i){n-=e(i).outerHeight()}),Math.max(0,n)};return e.extend(e.mobile,{window:e(t),document:e(n),keyCode:e.ui.keyCode,behaviors:{},focusPage:function(e){var t=e.find("[autofocus]");t.length||(t=e.find(".ui-title").eq(0)),t.length||(t=e),t.focus()},silentScroll:function(n){e.mobile.window.scrollTop()>0||("number"!==e.type(n)&&(n=e.mobile.defaultHomeScroll),e.event.special.scrollstart.enabled=!1,setTimeout(function(){t.scrollTo(0,n),e.mobile.document.trigger("silentscroll",{x:0,y:n})},20),setTimeout(function(){e.event.special.scrollstart.enabled=!0},150))},getClosestBaseUrl:function(t){var n=e(t).closest(".ui-page").jqmData("url"),i=e.mobile.path.documentBase.hrefNoHash;return e.mobile.base.dynamicBaseEnabled&&n&&e.mobile.path.isPath(n)||(n=i),e.mobile.path.makeUrlAbsolute(n,i)},removeActiveLinkClass:function(t){!e.mobile.activeClickedLink||e.mobile.activeClickedLink.closest(".ui-page-active").length&&!t||e.mobile.activeClickedLink.removeClass("ui-button-active"),e.mobile.activeClickedLink=null},enhanceable:function(e){return this.haveParents(e,"enhance")},hijackable:function(e){return this.haveParents(e,"ajax")},haveParents:function(t,n){if(!e.mobile.ignoreContentEnabled)return t;var i,o,a,r,s=t.length,c=e();for(r=0;r<s;r++){for(o=t.eq(r),a=!1,i=t[r];i;){if("false"===(i.getAttribute?i.getAttribute("data-"+e.mobile.ns+n):"")){a=!0;break}i=i.parentNode}a||(c=c.add(o))}return c},getScreenHeight:function(){return t.innerHeight||e.mobile.window.height()},resetActivePageHeight:function(n){var o=e(".ui-page-active"),a=o.height(),r=o.outerHeight(!0);n=i(o,"number"==typeof n?n:e(t).height()),o.css("min-height",""),o.height()<n&&o.css("min-height",n-(r-a))},loading:function(){var t=this.loading._widget||e.mobile.loader().element,n=t.loader.apply(t,arguments);return this.loading._widget=t,n},isElementCurrentlyVisible:function(i){if(!(i="string"==typeof i?e(i)[0]:i[0]))return!0;var o=i.getBoundingClientRect();return o.bottom>0&&o.right>0&&o.top<(t.innerHeight||n.documentElement.clientHeight)&&o.left<(t.innerWidth||n.documentElement.clientWidth)}}),e.addDependents=function(t,n){var i=e(t),o=i.jqmData("dependents")||e();i.jqmData("dependents",e(o).add(n))},e.fn.extend({removeWithDependents:function(){e.removeWithDependents(this)},addDependents:function(t){e.addDependents(this,t)},getEncodedText:function(){return e("<a>").text(this.text()).html()},jqmEnhanceable:function(){return e.mobile.enhanceable(this)},jqmHijackable:function(){return e.mobile.hijackable(this)}}),e.removeWithDependents=function(t){var n=e(t);(n.jqmData("dependents")||e()).remove(),n.remove()},e.addDependents=function(t,n){var i=e(t),o=i.jqmData("dependents")||e();i.jqmData("dependents",e(o).add(n))},e.find.matches=function(t,n){return e.find(t,null,null,n)},e.find.matchesSelector=function(t,n){return e.find(n,null,null,[t]).length>0},e.mobile}),function(e){"function"==typeof define&&define.amd&&define("core",["./defaults","./data","./helpers"],e)}(function(){}),function(t){"function"==typeof define&&define.amd?define("media",["jquery","./core"],t):t(e)}(function(e){return t.matchMedia=t.matchMedia||function(e,t){var n,i=e.documentElement,o=i.firstElementChild||i.firstChild,a=e.createElement("body"),r=e.createElement("div");return r.id="mq-test-1",r.style.cssText="position:absolute;top:-100em",a.style.background="none",a.appendChild(r),function(e){return r.innerHTML='­<style media="'+e+'"> #mq-test-1 { width: 42px; }</style>',i.insertBefore(a,o),n=42===r.offsetWidth,i.removeChild(a),{matches:n,media:e}}}(n),e.mobile.media=function(e){var n=t.matchMedia(e);return n&&n.matches},e.mobile.media}),function(t){"function"==typeof define&&define.amd?define("widgets/enhancer",["jquery"],t):t(e)}(function(e){var t,n=!1;return e.fn.extend({enhance:function(){return e.enhance.enhance(this)},enhanceWithin:function(){return this.children().enhance(),this},enhanceOptions:function(){return e.enhance.getOptions(this)},enhanceRoles:function(){return e.enhance.getRoles(this)}}),e.enhance=e.enhance||{},e.extend(e.enhance,{enhance:function(t){var n,i=t.find("["+e.enhance.defaultProp()+"]").addBack();for(e.enhance._filter&&(i=e.enhance._filter(i)),n=0;n<e.enhance.hooks.length;n++)e.enhance.hooks[n].call(t,i);return e.enhance.defaultFunction.call(t,i),t},hooks:e.enhance.hooks||[],_filter:e.enhance._filter||!1,defaultProp:e.enhance.defaultProp||function(){return"data-ui-role"},defaultFunction:function(t){t.each(function(){var t,n=e(this).enhanceRoles();for(t=0;t<n.length;t++)e.fn[n[t]]&&e(this)[n[t]]()})},cache:!0,roleCache:{},getRoles:function(t){if(!t.length)return[];var n,o=e.enhance.roleCache[t[0].id?t[0].id:i];return o||(n=t.attr(e.enhance.defaultProp()),o=n?n.match(/\S+/g):[],e.enhance.roleCache[t[0].id]=o,o)},optionCache:{},getOptions:function(t){var n,o=e.enhance.optionCache[t[0].id?t[0].id:i];return o||(o={},n=(e.mobile.ns||"ui-").replace("-",""),e.each(e(t).data(),function(e,t){e=e.replace(n,""),e=e.charAt(0).toLowerCase()+e.slice(1),o[e]=t}),e.enhance.optionCache[t[0].id]=o,o)},_installWidget:function(){e.Widget&&!n&&(e.extend(e.Widget.prototype,{_getCreateOptions:function(e){var t,n,o=this.element.enhanceOptions();e=e||{};for(t in this.options)(n=o[t])!==i&&(e[t]=n);return e}}),n=!0)}}),e.Widget?e.enhance._installWidget():Object.defineProperty(e,"Widget",{configurable:!0,enumerable:!0,get:function(){return t},set:function(n){n&&(t=n,setTimeout(function(){e.enhance._installWidget()}))}}),e.enhance})});
|
resources/style.css
CHANGED
@@ -63,7 +63,7 @@
|
|
63 |
[class*=" sicon-"] {
|
64 |
/* use !important to prevent issues with browser extensions that change fonts */
|
65 |
font-family: 'serioussliderglyphs' !important;
|
66 |
-
speak:
|
67 |
font-style: normal;
|
68 |
font-weight: normal;
|
69 |
font-variant: normal;
|
@@ -1808,6 +1808,10 @@
|
|
1808 |
max-width: none;
|
1809 |
width: auto;
|
1810 |
}
|
|
|
|
|
|
|
|
|
1811 |
|
1812 |
.seriousslider-control {
|
1813 |
font-size: 20px;
|
63 |
[class*=" sicon-"] {
|
64 |
/* use !important to prevent issues with browser extensions that change fonts */
|
65 |
font-family: 'serioussliderglyphs' !important;
|
66 |
+
speak: never;
|
67 |
font-style: normal;
|
68 |
font-weight: normal;
|
69 |
font-variant: normal;
|
1808 |
max-width: none;
|
1809 |
width: auto;
|
1810 |
}
|
1811 |
+
|
1812 |
+
.seriousslider-sizing2 .seriousslider-inner > .item img.item-image {
|
1813 |
+
max-height: none;
|
1814 |
+
}
|
1815 |
|
1816 |
.seriousslider-control {
|
1817 |
font-size: 20px;
|