File Manager - Version 3.0.0

Version Description

  • Bug fixed and Interface updated.
Download this release

Release Info

Developer aihimel
Plugin Icon 128x128 File Manager
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.2.4 to 3.0.0

Files changed (71) hide show
  1. BootStart/BootStart.php +55 -70
  2. BootStart/CSV.php +1 -2
  3. BootStart/CacheEngine.php +0 -111
  4. BootStart/Debug.php +0 -19
  5. BootStart/FTP.php +0 -136
  6. BootStart/HL7.php +0 -113
  7. BootStart/OptionsManager.php +1 -3
  8. BootStart/REST.php +0 -153
  9. BootStart/__init__.php +1 -10
  10. changelog.txt +13 -0
  11. css/admin-style.css +204 -0
  12. css/front-style.css +0 -0
  13. elFinder/Changelog +0 -173
  14. elFinder/composer.json +0 -40
  15. elFinder/elFinder.php +54 -0
  16. elFinder/elfinder.html +0 -42
  17. elFinder/files/.gitkeep +0 -0
  18. elFinder/files/car-1.jpeg +0 -0
  19. elFinder/files/car3.jpg +0 -0
  20. elFinder/files/crop.gif +0 -0
  21. elFinder/files/dialogs.png +0 -0
  22. elFinder/files/file-2.jpg +0 -0
  23. elFinder/files/icons-big.png +0 -0
  24. elFinder/files/icons-small.png +0 -0
  25. elFinder/files/logo.png +0 -0
  26. elFinder/files/progress.gif +0 -0
  27. elFinder/files/quicklook-bg.png +0 -0
  28. elFinder/files/quicklook-icons.png +0 -0
  29. elFinder/files/resize.png +0 -0
  30. elFinder/files/spinner-mini.gif +0 -0
  31. elFinder/files/toolbar.png +0 -0
  32. elFinder/js/elfinder.full.js +14 -2
  33. elFinder/php/connector.minimal (copy).php +0 -64
  34. elFinder/php/connector.minimal.php +0 -65
  35. elFinder/php/connector.php-dist +0 -64
  36. elFinder/php/elFinder.class.php +6 -0
  37. elFinder/php/elFinderConnector.class.php +9 -0
  38. elFinder/php/elFinderVolumeDriver.class.php +7 -0
  39. elFinder/php/elFinderVolumeDropbox.class.php +6 -0
  40. elFinder/php/elFinderVolumeFTP.class.php +6 -0
  41. elFinder/php/elFinderVolumeFTPIIS.class.php +6 -0
  42. elFinder/php/elFinderVolumeLocalFileSystem.class.php +6 -0
  43. elFinder/php/elFinderVolumeMySQL.class.php +6 -0
  44. elFinder/php/elFinderVolumeS3.class.php +6 -0
  45. elFinder/php/plugins/AutoResize/plugin.php +7 -0
  46. elFinder/php/plugins/Normalizer/plugin.php +7 -0
  47. elFinder/php/plugins/Sanitizer/plugin.php +7 -0
  48. elFinder/php/plugins/Watermark/plugin.php +7 -0
  49. file-manager.php +31 -63
  50. img/icon-24x24.png +0 -0
  51. img/permission-system-backend.png +0 -0
  52. jquery-ui-1.11.4/external/jquery/jquery.js +0 -9789
  53. jquery-ui-1.11.4/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  54. jquery-ui-1.11.4/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  55. jquery-ui-1.11.4/images/ui-bg_flat_10_000000_40x100.png +0 -0
  56. jquery-ui-1.11.4/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  57. jquery-ui-1.11.4/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  58. jquery-ui-1.11.4/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  59. jquery-ui-1.11.4/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  60. jquery-ui-1.11.4/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  61. jquery-ui-1.11.4/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  62. jquery-ui-1.11.4/images/ui-icons_222222_256x240.png +0 -0
  63. jquery-ui-1.11.4/images/ui-icons_228ef1_256x240.png +0 -0
  64. jquery-ui-1.11.4/images/ui-icons_ef8c08_256x240.png +0 -0
  65. jquery-ui-1.11.4/images/ui-icons_ffd27a_256x240.png +0 -0
  66. jquery-ui-1.11.4/images/ui-icons_ffffff_256x240.png +0 -0
  67. jquery-ui-1.11.4/index.html +0 -513
  68. jquery-ui-1.11.4/jquery-ui.css +0 -0
  69. jquery-ui-1.11.4/jquery-ui.js +0 -16617
  70. jquery-ui-1.11.4/jquery-ui.min.css +0 -0
  71. jquery-ui-1.11.4/jquery-ui.min.js +0 -13
BootStart/BootStart.php CHANGED
@@ -8,9 +8,7 @@
8
  * @since version 0.1.1
9
  *
10
  * */
11
- namespace BootStart_1_0_0;
12
- use OptionsManager_1_0_0 as OM;
13
- use CacheEngine_1_0_0 as CE;
14
  /**
15
  *
16
  * Holds almost all the functionality that this nano framework supports.
@@ -19,7 +17,7 @@ use CacheEngine_1_0_0 as CE;
19
  * We will eventually add more detailed description later.
20
  *
21
  * */
22
- abstract class BootStart{
23
 
24
  /**
25
  *
@@ -75,7 +73,14 @@ abstract class BootStart{
75
  * @var string $upload_path :: This variable holds the path of the default upload folder
76
  *
77
  * */
78
- protected $upload_path;
 
 
 
 
 
 
 
79
 
80
  /**
81
  *
@@ -84,13 +89,6 @@ abstract class BootStart{
84
  * */
85
  protected $menu_data;
86
 
87
- /**
88
- *
89
- * @var CE Cache Engine object
90
- *
91
- * */
92
- protected $CE;
93
-
94
  /**
95
  *
96
  * Constructor function
@@ -116,49 +114,36 @@ abstract class BootStart{
116
  // Assigning DevEnv
117
  $this->devEnv = false;
118
 
119
- // Upload file path
120
- $this->upload_path = ABSPATH . 'wp-content/uploads/' . $this->prefix;
 
 
 
 
 
121
 
122
  // Setting php.ini variables
123
  $this->php_ini_settings();
124
 
125
  // Loading Options
126
 
127
- $this->options = new OM\OptionsManager($this->name);
128
 
129
  // Creating upload folder.
130
  $this->upload_folder();
131
-
132
- // Cache Object
133
- $this->CE = new CE\CacheEngine($this->prefix, $this->upload_path);
134
 
135
  // Frontend asset loading
136
  add_action('wp_enqueue_scripts', array(&$this, 'assets') );
137
 
138
- // Admin Panel asset loading
139
- add_action('admin_enqueue_scripts', array(&$this, 'admin_assets') );
140
-
141
  // Adding a menu at admin area
142
  add_action( 'admin_menu', array(&$this, 'menu') );
143
 
144
- // Adding uninstall hook
145
-
146
-
147
- // Adding Ajax hooks
148
-
149
-
150
  // Custom post hook
151
  add_action( 'init', array(&$this, 'custom_post') );
152
 
153
  // Shortcode hook
154
  add_action( 'init', array(&$this, 'shortcode') );
155
 
156
- // Registering activation hook
157
- register_activation_hook(__FILE__, array('BootStart', 'activate') );
158
-
159
- // Registering deactivation hook
160
- register_deactivation_hook(__FILE__, array('BootStart', 'deactivate') );
161
-
162
  }
163
 
164
  /**
@@ -177,31 +162,8 @@ abstract class BootStart{
177
  * ## Turn on error if of php if debugging variable is defined and set to true.
178
  *
179
  * */
180
-
181
- }
182
-
183
- /**
184
- *
185
- * Activation hook function
186
- *
187
- * @todo Add dependency check
188
- *
189
- * */
190
- public static function activate(){
191
-
192
- // Nothing yet
193
-
194
- }
195
-
196
- /**
197
- *
198
- * Deactivation hook function
199
- *
200
- * */
201
- public static function deactivate(){
202
-
203
- // Nothing is added here yet.
204
-
205
  }
206
 
207
  /**
@@ -219,10 +181,7 @@ abstract class BootStart{
219
 
220
  // Including media for media upload
221
  wp_enqueue_media();
222
-
223
- // Including magnific popup
224
- wp_enqueue_script( $this->__( 'movies-magnific-popup-js' ), $this->url( 'magnific-popup/jquery.magnific-popup.min.js' ), array( 'jquery' ) );
225
-
226
  }
227
 
228
  /*
@@ -235,6 +194,9 @@ abstract class BootStart{
235
  // Jquery UI CSS
236
  wp_enqueue_style( $this->__('jquery-ui-css'), $this->url('jquery-ui-1.11.4/jquery-ui.min.css') );
237
 
 
 
 
238
  // elFinder CSS
239
  wp_enqueue_style( $this->__('elfinder-css'), $this->url('elFinder/css/elfinder.min.css') );
240
 
@@ -244,17 +206,14 @@ abstract class BootStart{
244
  // Including admin-style.css
245
  wp_enqueue_style( $this->__('admin-style'), $this->url('css/admin-style.css') );
246
 
247
- // Including utility.php
248
- wp_enqueue_script( $this->__('utility-script'), $this->url('js/utility.php') );
249
-
250
  // Including admin-script.js
251
  wp_enqueue_script( $this->__('admin-script'), $this->url('js/admin-script.js'), array('jquery') );
252
 
253
- // Jquery UI scripts
254
- wp_enqueue_script( $this->__('jquery-ui-script'), $this->url('jquery-ui-1.11.4/jquery-ui.min.js'), array('jquery') );
255
 
256
- // elFinder Scripts
257
- wp_enqueue_script( $this->__('elfinder-script'), $this->url('elFinder/js/elfinder.full.js'), array('jquery') );
258
 
259
  }
260
 
@@ -269,7 +228,7 @@ abstract class BootStart{
269
 
270
  if($this->menu_data['type'] == 'menu'){
271
  // @ add_menu_page( $this->name, $this->name, 'manage_options', $this->prefix, array($this, 'admin_page'));
272
- add_menu_page( $this->name, $this->name, 'manage_options', $this->prefix.'_settings', array(&$this, 'admin_panel'), '', 7 );
273
  // @ add_posts_page( 'V Movies', 'V Movies', 'manage_options', 'v-movies', array($this, 'admin_panel') );
274
  }
275
 
@@ -464,4 +423,30 @@ abstract class BootStart{
464
  if( !is_dir($this->upload_path ) ) mkdir( $this->upload_path , 0777 );
465
 
466
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  }
8
  * @since version 0.1.1
9
  *
10
  * */
11
+
 
 
12
  /**
13
  *
14
  * Holds almost all the functionality that this nano framework supports.
17
  * We will eventually add more detailed description later.
18
  *
19
  * */
20
+ abstract class FM_BootStart{
21
 
22
  /**
23
  *
73
  * @var string $upload_path :: This variable holds the path of the default upload folder
74
  *
75
  * */
76
+ public $upload_path;
77
+
78
+ /**
79
+ *
80
+ * @var string $upload_url :: This variable holds the url of the default upload folder
81
+ *
82
+ * */
83
+ public $upload_url;
84
 
85
  /**
86
  *
89
  * */
90
  protected $menu_data;
91
 
 
 
 
 
 
 
 
92
  /**
93
  *
94
  * Constructor function
114
  // Assigning DevEnv
115
  $this->devEnv = false;
116
 
117
+ // Upload folder path
118
+ $upload = wp_upload_dir();
119
+ $this->upload_path = $upload['basedir'] . '/' . $this->prefix;
120
+
121
+ // Upload folder url
122
+ $upload = wp_upload_dir();
123
+ $this->upload_url = $upload['baseurl'] . '/' . $this->prefix;
124
 
125
  // Setting php.ini variables
126
  $this->php_ini_settings();
127
 
128
  // Loading Options
129
 
130
+ $this->options = new FM_OptionsManager($this->name);
131
 
132
  // Creating upload folder.
133
  $this->upload_folder();
 
 
 
134
 
135
  // Frontend asset loading
136
  add_action('wp_enqueue_scripts', array(&$this, 'assets') );
137
 
 
 
 
138
  // Adding a menu at admin area
139
  add_action( 'admin_menu', array(&$this, 'menu') );
140
 
 
 
 
 
 
 
141
  // Custom post hook
142
  add_action( 'init', array(&$this, 'custom_post') );
143
 
144
  // Shortcode hook
145
  add_action( 'init', array(&$this, 'shortcode') );
146
 
 
 
 
 
 
 
147
  }
148
 
149
  /**
162
  * ## Turn on error if of php if debugging variable is defined and set to true.
163
  *
164
  * */
165
+ ini_set('post_max_size', '128M');
166
+ ini_set('upload_max_filesize', '128M');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  }
168
 
169
  /**
181
 
182
  // Including media for media upload
183
  wp_enqueue_media();
184
+
 
 
 
185
  }
186
 
187
  /*
194
  // Jquery UI CSS
195
  wp_enqueue_style( $this->__('jquery-ui-css'), $this->url('jquery-ui-1.11.4/jquery-ui.min.css') );
196
 
197
+ // Jquery UI theme
198
+ wp_enqueue_style( $this->__('jquery-ui-css-theme'), $this->url('jquery-ui-1.11.4/jquery-ui.theme.css') );
199
+
200
  // elFinder CSS
201
  wp_enqueue_style( $this->__('elfinder-css'), $this->url('elFinder/css/elfinder.min.css') );
202
 
206
  // Including admin-style.css
207
  wp_enqueue_style( $this->__('admin-style'), $this->url('css/admin-style.css') );
208
 
 
 
 
209
  // Including admin-script.js
210
  wp_enqueue_script( $this->__('admin-script'), $this->url('js/admin-script.js'), array('jquery') );
211
 
212
+ // elFinder Scripts depends on jQuery UI core, selectable, draggable, droppable, resizable, dialog and slider.
213
+ wp_enqueue_script( $this->__('elfinder-script'), $this->url('elFinder/js/elfinder.full.js'), array('jquery', 'jquery-ui-core', 'jquery-ui-selectable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-slider', ) );
214
 
215
+ // Adding lightbox plugin for jquery
216
+ wp_enqueue_script( $this->__('fmp-lightbox-js'), $this->url('lightbox/js/lightbox.min.js'), array( 'jquery' ) );
217
 
218
  }
219
 
228
 
229
  if($this->menu_data['type'] == 'menu'){
230
  // @ add_menu_page( $this->name, $this->name, 'manage_options', $this->prefix, array($this, 'admin_page'));
231
+ add_menu_page( $this->name, $this->name, 'manage_options', $this->prefix.'_settings', array(&$this, 'admin_panel'), $this->url('img/icon-24x24.png'), 7 );
232
  // @ add_posts_page( 'V Movies', 'V Movies', 'manage_options', 'v-movies', array($this, 'admin_panel') );
233
  }
234
 
423
  if( !is_dir($this->upload_path ) ) mkdir( $this->upload_path , 0777 );
424
 
425
  }
426
+
427
+ /**
428
+ *
429
+ * For persentable version of slugs
430
+ *
431
+ * */
432
+ public function __p($string){
433
+ $string = str_replace('_', ' ', $string);
434
+ $string = str_replace('-', ' ', $string);
435
+ $string[0] = strtoupper($string[0]);
436
+ return $string;
437
+ }
438
+
439
+ /**
440
+ *
441
+ * string compression function
442
+ *
443
+ * */
444
+ public function zip($string){
445
+
446
+ $string = trim($string);
447
+ $string = str_replace(' ', '-', $string);
448
+ $string = strtolower($string);
449
+ return $string;
450
+
451
+ }
452
  }
BootStart/CSV.php CHANGED
@@ -18,9 +18,8 @@
18
  *
19
  *
20
  * */
21
- namespace CSV_1_0_0;
22
 
23
- class CSV{
24
 
25
  /**
26
  *
18
  *
19
  *
20
  * */
 
21
 
22
+ class FM_CSV{
23
 
24
  /**
25
  *
BootStart/CacheEngine.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
-
3
- namespace CacheEngine_1_0_0;
4
- /**
5
- *
6
- * This class creates and saves a cache file on upload directory and provides necessary function to access special type of data as JSON.
7
- *
8
- * */
9
- class CacheEngine{
10
-
11
- /**
12
- *
13
- * @var $plugin_prefix prefix of the plugin that the CacheEngine will be used.
14
- *
15
- * */
16
- public $plugin_prefix;
17
-
18
- /**
19
- *
20
- * @var $upload_url upload path for the plugin
21
- *
22
- * */
23
- public $upload_path;
24
-
25
- /**
26
- * Constructor function
27
- *
28
- * Checks if the upload derictory is created, and creates a subdirectory called "cache" to save the cache files.
29
- *
30
- * @param $plugin_prefix prefix of the plugin that will hold the cache engine data.
31
- *
32
- * @param $upload_path path of the upload directory
33
- *
34
- * */
35
- public function __construct($plugin_prefix, $upload_path){
36
-
37
- // Initializing the class-global $plugin_prefix variable
38
- $this->plugin_prefix = $plugin_prefix;
39
-
40
- // Initializing the class-global $upload_url variable
41
- $this->upload_path = $upload_path;
42
-
43
- // Creates cache folder
44
- $this->create_cache_folder();
45
-
46
- // Creating the default text file
47
- $this->create_storage();
48
- }
49
-
50
- /**
51
- *
52
- * Creates the cache folder to save the data file
53
- *
54
- * */
55
- protected function create_cache_folder(){
56
-
57
- if( !is_dir($this->upload_path.'/cache/' ) ) mkdir( $this->upload_path.'/cache/' , 0777 );
58
-
59
- }
60
-
61
-
62
- /**
63
- *
64
- * Create the data storeage file if not created
65
- *
66
- * */
67
- public function create_storage($file_name = null){
68
-
69
- if($file_name == null) $file_name = $this->plugin_prefix;
70
-
71
- $file_path = $this->upload_path.'/cache/'.$file_name.'.txt';
72
- if(!file_exists($file_path)) fopen($file_path, 'w');
73
-
74
- }
75
-
76
- /**
77
- *
78
- * Load the javascript array
79
- *
80
- * @param $file_name Name of the file to fetch data form.
81
- *
82
- * @param $as_array if the data is shown as array.
83
- *
84
- * */
85
- public function get_data($file_name = null, $as_array = true){
86
-
87
- if($file_name == null) $file_name = $this->plugin_prefix;
88
- $file_path = $this->upload_path.'/cache/'.$file_name.'.txt';
89
- //~ if(!file_exists($file_path)) fopen($file_path, 'r');
90
-
91
- return json_decode(file_get_contents($file_path), $as_array);
92
-
93
-
94
- }
95
-
96
- /**
97
- *
98
- * Updates the data file
99
- *
100
- * @param $array array data to be saved.
101
- *
102
- * @param $file_name Name of the file.
103
- *
104
- * */
105
- public function set_data($array, $file_name = null){
106
-
107
- if($file_name == null) $file_name = $this->plugin_prefix;
108
- $file_path = $this->upload_path.'/cache/'.$file_name.'.txt';
109
-
110
- }
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
BootStart/Debug.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- namespace Debug_1_0_0;
4
-
5
- class Debug{
6
-
7
- public static function P($variable){
8
-
9
- if( !defined('B_DEBUG') || !B_DEBUG) return;
10
-
11
- echo "<pre>";
12
- print_r($variable);
13
- echo "</pre>";
14
-
15
- }
16
-
17
- }
18
-
19
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
BootStart/FTP.php DELETED
@@ -1,136 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Downloads file to local server for later use.
5
- *
6
- * @package BootStart_0_1_0
7
- *
8
- * @since version 0.1.0
9
- *
10
- *
11
- *
12
- * @name CSV
13
- *
14
- * @author Aftabul Islam <toaihimel@gmail.com>
15
- *
16
- * @license GNU/GPLv3 or later
17
- *
18
- *
19
- *
20
- * */
21
- namespace FTP_1_0_0;
22
-
23
- class FTP{
24
-
25
- /**
26
- *
27
- * @var string $server :: Name of the remote file server where the file resides.
28
- *
29
- * */
30
- protected $server;
31
-
32
- /**
33
- *
34
- * @var string $username :: Username
35
- *
36
- * */
37
- protected $username;
38
-
39
- /**
40
- *
41
- * @var string $password :: Password of the associated username.
42
- *
43
- * */
44
- protected $password;
45
-
46
- /**
47
- *
48
- * @var pointer $connect :: The server connection.
49
- *
50
- * */
51
- protected $connect;
52
-
53
- /**
54
- *
55
- * @var constant $file_transfer_mode :: File transfer mode FTP_ASCII and FTP_BINARY
56
- *
57
- * */
58
- protected $file_transfer_mode;
59
-
60
- /**
61
- *
62
- * @var string $message :: Any message that the class has to show.
63
- *
64
- * */
65
- protected $message;
66
-
67
- /**
68
- *
69
- * Constructor function
70
- *
71
- * */
72
- public function __construct( $server = null, $username = null, $password = null){
73
-
74
- // Populating Global Variables
75
- $this->server = $server;
76
- $this->username = $username;
77
- $this->password = $password;
78
- $this->stablish_connection();
79
- }
80
-
81
- /**
82
- *
83
- * stablish_connection
84
- *
85
- * Stablishes connection
86
- *
87
- * */
88
- public function stablish_connection(){
89
- // Connecting
90
- $this->connect = ftp_connect( $this->server );
91
-
92
- // Populating Local Variables
93
- $login = ftp_login( $this->connect, $this->username, $this->password );
94
- }
95
-
96
- /**
97
- *
98
- * get_file function
99
- *
100
- * This function gets the row of the .csv file.
101
- *
102
- * */
103
- public function get_file($file_location_local, $file_location_remote, $file_transfer_mode = FTP_ASCII){
104
-
105
- $response = ftp_get( $this->connect, $file_location_local, $file_location_remote, $file_transfer_mode );
106
- ftp_close($this->connect);
107
- return $response;
108
- }
109
-
110
- /**
111
- *
112
- * get_files
113
- *
114
- * Gets all the file list in a directory
115
- *
116
- * */
117
- public function get_files($directory_path){
118
-
119
- $file_list = ftp_nlist( $this->connect, $directory_path );
120
-
121
- return $file_list;
122
-
123
- }
124
-
125
- /**
126
- *
127
- * delete_file
128
- *
129
- * Deletes single file from the remote server
130
- *
131
- * */
132
- public function delete_file($file_path){
133
- return ftp_delete($this->connect, $file_path);
134
- }
135
-
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
BootStart/HL7.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Workis with .hl7 extension file
5
- *
6
- * @package BootStart_0_1_1
7
- *
8
- * @since version 0.1.1
9
- *
10
- *
11
- *
12
- * @name HL7
13
- *
14
- * @author Aftabul Islam <toaihimel@gmail.com>
15
- *
16
- * @license GNU/GPLv3 or later
17
- *
18
- * TERMINOLOGY FOR HL7 FILE
19
- * MSH = Message Id
20
- * PID = Paitent Identity
21
- * OBR = Exam/Digonostic Information
22
- * ORC = Commor Order Request
23
- * OBX = Transmit single observation
24
- *
25
- * */
26
- namespace HL7_1_0_0;
27
-
28
- class HL7{
29
-
30
- /**
31
- *
32
- * @var array $data :: This variable holds the entire data
33
- *
34
- * */
35
- protected $data;
36
-
37
- /**
38
- *
39
- * @var string $path :: This variable is the file path of the .hl7 file.
40
- *
41
- * */
42
- protected $path;
43
-
44
- /**
45
- *
46
- * @var string $token :: The token that devides the column of the .hl7.
47
- *
48
- * */
49
- protected $token;
50
-
51
- /**
52
- *
53
- * @var file-pointer $fp :: The pointer of the .hl7 file.
54
- *
55
- * */
56
- protected $fp;
57
-
58
- /**
59
- *
60
- * @var array $headers :: The headers of the .hl7 file.
61
- *
62
- * */
63
- public $headers;
64
-
65
- /**
66
- *
67
- * @var string $message :: Any message that the class has to show.
68
- *
69
- * */
70
- protected $message;
71
-
72
- /**
73
- *
74
- * Constructor function
75
- *
76
- * @param string $path :: Path of the .hl7 file. The path should be absolute path of the file.
77
- *
78
- * @param array $callback_function :: This is used to callback a function with the row array.
79
- *
80
- * @param string $token :: The token that devides the .hl7 columns
81
- *
82
- * */
83
- public function __construct( $path = null, $token = '|' ){
84
-
85
- // Checks if the file path is valid.
86
- if( !$path ){
87
- $this->message .= '<br/>Error: File Path is empty. It is essential that you input a valid file path.<br/>';
88
- return;
89
- }
90
-
91
- $this->path = $path;
92
- $this->token = $token;
93
-
94
- // Opening the file
95
- $this->fp = fopen( $path, "r" );
96
-
97
- }
98
-
99
- /**
100
- *
101
- * get_row function
102
- *
103
- * This function gets the row of the .hl7 file.
104
- *
105
- * */
106
- public function parse_data(){
107
-
108
- while ( $data = fgetcsv( $this->fp, 0, $this->token ) ) $this->data[$data[0]][] = $data;
109
-
110
- return $this->data;
111
- }
112
-
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
BootStart/OptionsManager.php CHANGED
@@ -18,10 +18,8 @@
18
  *
19
  *
20
  * */
21
- namespace OptionsManager_1_0_0;
22
 
23
-
24
- class OptionsManager{
25
 
26
  /**
27
  *
18
  *
19
  *
20
  * */
 
21
 
22
+ class FM_OptionsManager{
 
23
 
24
  /**
25
  *
BootStart/REST.php DELETED
@@ -1,153 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Works with REST. Recives REST data.
5
- *
6
- * @package BootStart_0_1_0
7
- *
8
- * @since version 0.1.0
9
- *
10
- *
11
- *
12
- * @name CSV
13
- *
14
- * @author Aftabul Islam <toaihimel@gmail.com>
15
- *
16
- * @license GNU/GPLv3 or later
17
- *
18
- *
19
- *
20
- * */
21
- namespace REST_1_0_0;
22
-
23
- class REST{
24
-
25
- /**
26
- *
27
- * @var array $post The post data that has to be sent to the the remove server.
28
- *
29
- * */
30
- protected $post;
31
-
32
- /**
33
- *
34
- * @var string $url URL of the request.
35
- *
36
- * */
37
- protected $url;
38
-
39
- /**
40
- *
41
- * @var array $header Header data that is to be included.
42
- *
43
- * */
44
- protected $header;
45
-
46
- /**
47
- *
48
- * @var string $response_type What type of response does the request return JSON/XML
49
- *
50
- * */
51
- protected $return_type;
52
-
53
- /**
54
- *
55
- * @var string $prefix The prefix of this class to store cached data in the database.
56
- *
57
- * */
58
- protected $prefix;
59
-
60
- /**
61
- *
62
- * @var array $cache The cached data will be stored here.
63
- *
64
- * */
65
- protected $cache;
66
-
67
- /**
68
- *
69
- * Constructor function
70
- *
71
- * @param string $url URL of the request
72
- *
73
- * @param array $post The post data that had to be sent
74
- *
75
- * @param string $return_type The response type
76
- *
77
- * @param string $prefix Prefix to be used for saving cached data.
78
- *
79
- * */
80
- function __construct($url, $return_type = 'JSON', $post = null, $header = null, $prefix = 'REST_'){
81
-
82
- $this->url = $url;
83
-
84
- $this->post = $post;
85
-
86
- $this->return_type = $return_type;
87
-
88
- $this->header = $header;
89
-
90
- $this->prefix = $prefix;
91
-
92
- // Loading cached data
93
- $this->cache = get_option($this->prefix);
94
- $this->cache = !empty($this->cache) ? $this->cache : array();
95
-
96
- // Registering function
97
- register_shutdown_function( array($this, 'destruct') );
98
-
99
- }
100
-
101
- /**
102
- *
103
- * Get the response from the remote server.
104
- *
105
- * @param bool $from_cache Should the result be retirved from cache.
106
- *
107
- * @return array $response The data fetched from the request.
108
- *
109
- * */
110
- public function get_response($from_cache = false){
111
-
112
- $key = $this->url.$this->return_type.serialize($this->post).serialize($this->header);
113
-
114
- // Should the data be returned from cahce
115
- if($from_cache){
116
-
117
- if( isset($this->cache["{$key}"]) && !empty($this->cache["{$key}"]) ) return $this->cache["{$key}"];
118
-
119
- }
120
-
121
- $ch = curl_init();
122
-
123
- curl_setopt($ch, CURLOPT_URL, $this->url);
124
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
125
-
126
- // Setting header information
127
- if( !empty($this->header) ) curl_setopt( $ch, CURLOPT_HTTPHEADER, $this->header );
128
-
129
- $response = curl_exec($ch);
130
-
131
-
132
-
133
- curl_close($ch);
134
-
135
- $data = json_decode($response);
136
-
137
- $this->cache["{$key}"] = $data;
138
-
139
- return $data;
140
- }
141
-
142
- /**
143
- *
144
- * Destructor function
145
- *
146
- * */
147
- function destruct(){
148
-
149
- update_option($this->prefix, $this->cache);
150
-
151
- }
152
-
153
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
BootStart/__init__.php CHANGED
@@ -4,23 +4,14 @@
4
  *
5
  * Initialize and loads the entire framework
6
  *
7
- * @package BootStart_1_0_0
8
- *
9
- * @since version 0.1.0
10
  *
11
  * */
12
- namespace BootStart_1_0_0;
13
 
14
  $modules = array(
15
 
16
  'BootStart',
17
  'OptionsManager',
18
- 'CSV',
19
- 'HL7',
20
- 'FTP',
21
- 'REST',
22
- 'Debug',
23
- 'CacheEngine'
24
 
25
  );
26
 
4
  *
5
  * Initialize and loads the entire framework
6
  *
7
+ * @package plugin-name
 
 
8
  *
9
  * */
 
10
 
11
  $modules = array(
12
 
13
  'BootStart',
14
  'OptionsManager',
 
 
 
 
 
 
15
 
16
  );
17
 
changelog.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Version 2.2.1
2
+ - BootStart/HL7.php
3
+ - BootStart/FTP.php
4
+ - BootStart/REST.php
5
+ - BootStart/Debug.php
6
+ - BootStart/ChacheEngine.php
7
+ - views/admin/settings.php
8
+ - views/404.php
9
+ - views/access-denied.php
10
+ - views/shortcode_name_view.php
11
+
12
+ Version 2.2.2
13
+ - BootStart/CSV.php
css/admin-style.css CHANGED
@@ -36,3 +36,207 @@
36
  .bootstart-admin-navigation ul li a{
37
  text-decoration: none;
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  .bootstart-admin-navigation ul li a{
37
  text-decoration: none;
38
  }
39
+
40
+ .bootstart-admin-footer{
41
+ text-align: center;
42
+ font-size: 130%;
43
+ padding: 5px;
44
+ margin: 5px;
45
+ }
46
+
47
+ .bootstart-admin-content{
48
+ margin: 10px;
49
+ padding: 10px;
50
+ }
51
+
52
+ .bootstart-admin-content input{
53
+ display: inline;
54
+ }
55
+
56
+ .bootstart-admin-content label{
57
+ font-size: 120%;
58
+ font-weight: bold;
59
+ margin-right: 10px;
60
+ }
61
+
62
+ .form-blokc{
63
+ display: block;
64
+ margin: 10px;
65
+ padding: 10px;
66
+ }
67
+
68
+ .form-blokc small{
69
+ color: gray;
70
+ }
71
+
72
+ .bootstart-admin-content input[type='submit']{
73
+ padding: 10px;
74
+ border-radius: 10px;
75
+ font-size: 120%;
76
+ background-color: #31A6CB;
77
+ color: white;
78
+ font-weight: bold;
79
+ box-shadow: unset;
80
+ }
81
+
82
+ .bootstart-admin-footer{
83
+ border-top: 2px solid gray;
84
+ margin-top: 20px;
85
+ padding: 10px;
86
+ padding-top: 20px;
87
+ }
88
+
89
+ .bootstart-admin-footer span a{
90
+ text-decoration: none;
91
+ color: white;
92
+ }
93
+
94
+ .file-manager-shortcode-table{
95
+ margin: 10px;
96
+ padding: 10px;
97
+ }
98
+
99
+ .file-manager-shortcode-table td{
100
+ margin: 5px;
101
+ padding: 5px;
102
+ }
103
+
104
+ .file-manager-shortcode-table-shortcode{
105
+ font-weight: bold;
106
+ font-size: 120%;
107
+ }
108
+
109
+ .bootstart-admin-footer ul li{
110
+ display: inline-block;
111
+ margin: 5px;
112
+ padding: 15px;
113
+ }
114
+
115
+ .bootstart-admin-footer ul li a{
116
+ text-decoration: none;
117
+ }
118
+
119
+ .fmp_extend{
120
+ background-color: #31A6CB;
121
+ color: white;
122
+ }
123
+
124
+ .fmp_extend a{
125
+ color: white;
126
+ }
127
+
128
+ .fm_permission_system_advert img{
129
+ width: 25%;
130
+ border: 2px solid cyan;
131
+ display: inline-block;
132
+ margin: 5px;
133
+ padding: 5px;
134
+ margin-bottom: 0px;
135
+ display: block;
136
+ margin-left: auto;
137
+ margin-right: auto;
138
+ }
139
+
140
+ .fm_permission_system_advert span{
141
+ width: 100%;
142
+ display: inline-block;
143
+ margin: 10px;
144
+ padding: 10px;
145
+ text-align: center;
146
+ }
147
+
148
+ input[type=checkbox]
149
+ {
150
+ -webkit-appearance:checkbox !important;
151
+ }
152
+
153
+ input[type=radio]
154
+ {
155
+ -webkit-appearance:radio !important;
156
+ }
157
+
158
+ .footer-sticky-button{
159
+ background: none;
160
+ margin: 0;
161
+ position: fixed;
162
+ bottom: 0;
163
+ right: 0;
164
+ z-index: 100;
165
+ background-color: #B10C0C;
166
+ padding: 10px;
167
+ border-radius: 5px;
168
+ }
169
+
170
+ .footer-sticky-button a{
171
+ text-decoration: none;
172
+ color: white;
173
+ font-size: 1.5em;
174
+ }
175
+
176
+ .bootstart-admin-content{
177
+ max-width: 73%;
178
+ min-width: 73%;
179
+ margin-right: 2%;
180
+ float: left;
181
+ display: inline-block;
182
+ }
183
+
184
+ .bootstart-admin-sidebar{
185
+ max-width: 22%;
186
+ min-width: 22%;
187
+ display: inline-block;
188
+ min-height: 480px;
189
+ padding-top: 18px;
190
+ }
191
+
192
+ .sidebar-highlight{
193
+ text-align: center;
194
+ color: #B10C0C;
195
+ padding: 10px 0px 10px 0px;
196
+ font-size: 1.2em;
197
+ border-bottom: 2px solid #B10C0C;
198
+ }
199
+
200
+ .sidebar-highlight ul li{
201
+ border-bottom: 1px solid #B10C0C;
202
+ }
203
+
204
+ .badge-pro{
205
+ position: relative;
206
+ }
207
+
208
+ .badge-pro[data-badge]:after {
209
+ content:attr(data-badge);
210
+ position:absolute;
211
+ top:-10px;
212
+ right:-10px;
213
+ font-size: 1em;
214
+ background:#B10C0C;
215
+ color:white;
216
+ width:24px;
217
+ height:24px;
218
+ text-align:center;
219
+ line-height:24px;
220
+ border-radius:50%;
221
+ box-shadow:0 0 1px #333;
222
+ }
223
+
224
+ .badge-free{
225
+ position: relative;
226
+ }
227
+
228
+ .badge-free[data-badge]:after {
229
+ content:attr(data-badge);
230
+ position:absolute;
231
+ top:-10px;
232
+ right:-10px;
233
+ font-size: 1em;
234
+ background: white;
235
+ color: black;
236
+ width:24px;
237
+ height:24px;
238
+ text-align:center;
239
+ line-height:24px;
240
+ border-radius:50%;
241
+ box-shadow:0 0 1px #333;
242
+ }
css/front-style.css CHANGED
File without changes
elFinder/Changelog DELETED
@@ -1,173 +0,0 @@
1
- 2016-01-19 Naoki Sawada <hypweb@gmail.com>
2
-
3
- * elFinder (2.1.6):
4
- - Fixed #1074 startPath for multi volumes
5
- - Fixed #1172 enbug-fix of rename command
6
- - Fixed #1174 support for multi-instance on the same connector
7
- - Plugin: AutoResize New option `preserveExif`
8
- - Fixed #179 JPEG quality specifiable
9
- - Fixed #1176 auto-sync check with HTTP long polling/inotifywait
10
- - Fixed #1181 case insensitive search problem of LocalFileSystem driver
11
- - Added an autosync button into contextmenu `Reload`
12
- - Added new client configuration `syncStart`
13
- - Search result view optimization
14
- - Adddd new volume root option `searchTimeout` (default 30s)
15
- - Added new crient command `opendir` - opens selected item's parent folder at search result
16
- - Sortable "Places" (your favorites)
17
- - Fixed #1193 open the file at direct URL if possible
18
- - And some minor bug fixes
19
-
20
-
21
- 2015-12-26 Naoki Sawada <hypweb@gmail.com>
22
-
23
- * elFinder (2.1.5):
24
- - Fixed bug that can't in writable with `chmod`
25
- - Show remove item info in confirm dialog on `rm` action
26
- - Fixed #1165, MIME types maintenance (doc, dot, xlt, xla)
27
- - Fixed problem if filename included character that can't be json encode
28
- - Added option `convmap` to Normalizer plugin
29
- - And some minor bug fixes
30
-
31
-
32
- 2015-12-16 Naoki Sawada <hypweb@gmail.com>
33
-
34
- * elFinder (2.1.4):
35
- - Fixed #1163 Dropbox driver supported windows server
36
- - Fixed search problem on Windows server
37
-
38
-
39
- 2015-12-13 Naoki Sawada <hypweb@gmail.com>
40
-
41
- * elFinder (2.1.3):
42
- - Auto configure `customHeaders`, `xhrFields` for CORS
43
- - Allow set elFinder::$volumesCnt by HTTP header "X-elFinder-VolumesCntStart"
44
- - Resolved #1145, Configurable keyboard shortcuts of any command
45
- - Force non-overwrite on URL uploading
46
- - Supported Drag out function with [Shift] + Drag of file item (with out IE)
47
- - Drag and Drop copy from elFinder(A) to elFinder(B)
48
- - Make list of download url to Text editor
49
- - Drag and Drop download with Chrome (Single file only)
50
- - etc.
51
- - Choosable "backup" at pasting of same name files
52
- - Show confirm at uploading of same name file exists
53
- - Show URL link icon on Download menu in contextmenu
54
- - This icon is clickable as normal link, shows context menu and drag out
55
- - Added more feedback sign of jQuery DnD drag icon
56
- - Others, some minor bug fixes
57
-
58
-
59
- 2015-11-23 Naoki Sawada <hypweb@gmail.com>
60
-
61
- * elFinder (2.1.2):
62
- - [security-fix] vulnerability of the MIME type quarantine
63
- - Multi-line filename editing on icon view
64
- - Auto expands filename editing on list view
65
- - Fixed #1124, Uploading problem exactly 20MiB/30MiB/40MiB...
66
- - Marged #1125, Fix file permissions for MySQL LOAD_FILE command
67
- - Fixed #1127, Supported full path including the drive letter of the Windows server
68
- - Marged #1131, #1132, Complete Romanian(ro) translation
69
- - Fixed symbolic link file stats `mtime`, `size`
70
- - Marged #1133, Complete German(de) translation
71
- - Marged #1139, Complete Türkçe(tr) translation
72
- - Marged #1141, Plugin Normalizer function: make filename lowercase
73
- - Others, some minor bug fixes
74
-
75
-
76
- 2015-11-23 Naoki Sawada <hypweb@gmail.com>
77
-
78
- * elFinder (2.0.4):
79
- - [security-fix] vulnerability of the MIME type quarantine
80
-
81
-
82
- 2015-11-10 Naoki Sawada <hypweb@gmail.com>
83
-
84
- * elFinder (2.1.1):
85
- - More High performance server backend and light client UI
86
- - Connector plugin
87
- - AutoResize : Auto resize on file upload.
88
- - Normalizer : UTF-8 Normalizer of file-name and file-path etc.
89
- - Sanitizer : Sanitizer of file-name and file-path etc.
90
- - Watermark : Print watermark on file upload.
91
- - Folder upload with Chrome
92
- - Chunked file upload
93
- - Upload directly to the folder
94
- - Creating the archive by specifying the file name
95
- - Direct extraction to the current working directory (you do not want to create a folder)
96
- - Support Dropbox.com© (Configurable & As network volume)
97
- - Supports custom information in info dialog
98
- - Configuable columns of list view
99
- - Supports custom CSS class function of tree view
100
-
101
-
102
- 2015-11-10 Naoki Sawada <hypweb@gmail.com>
103
-
104
- * elFinder (2.0.3):
105
- - jQuery 1.9+ support
106
- - 350+ bugs fixed since rc1 version
107
- - Modify translations and some new translations
108
- - Netmount volume function
109
-
110
-
111
- 2012-04-10 Troex Nevelin <troex@fury.scancode.ru>
112
-
113
- * elFinder (2.0 rc1):
114
- - Major code refactor
115
- - 200+ bugs fixed since beta version
116
- - 14 new translations
117
- - FTP volume driver
118
- - Advanced image editing dialog
119
-
120
-
121
- 2011-07-10 Troex Nevelin <troex@fury.scancode.ru>
122
-
123
- * elFinder (2.0 beta):
124
- - New branch 2.x, total rewrite from scratch
125
- - MySQL volume driver support (as file storage)
126
- - Full drag & drop support with HTML5 upload
127
-
128
-
129
- 2011-06-20 Troex Nevelin <troex@fury.scancode.ru>
130
-
131
- * elFinder (1.2):
132
- - jQuery and UI updated
133
- - Python connector improvements
134
- - QuickLook fixed
135
- - CSS fixes
136
- - New icons from http://pixel-mixer.com/
137
- - New languages: Czech, Dutch, German, Greek, French, Hungarian,
138
- Italian, Japanese, Latvian, Polish, Brazilian Portuguese,
139
- Slovak, Thai, Turkish, Vietnamese, Simplified Chinese,
140
- Traditional Chinese
141
-
142
-
143
- 2010-03-11 Troex Nevelin <troex@fury.scancode.ru>
144
-
145
- * elFinder (1.1):
146
- - Total rewrite from scratch.
147
- - New PHP connector.
148
- - Python connector.
149
- - Create/Extract archives.
150
- - QuickLook.
151
- - "Places" for favorites.
152
- - Background thumbnails creation.
153
- - Exteneded configuration options of connector and client.
154
- - Spanish localization.
155
- - JSON API description.
156
- - Full documentation in English, Russian and Spanish.
157
- - No more use of jquery plugins.
158
- - Website update.
159
- - [bugfix] All known bugs fixed.
160
-
161
-
162
- 2009-11-09 Dmitry Levashov <dio@std42.ru>
163
-
164
- * elFinder (1.0.1):
165
- - In directory tree panel added arrows to open/close directories
166
- without entering in.
167
- - Added shortcut support for copy/cut/paste/delete files and
168
- folders. For Mac users added Command+Backspace support.
169
- - Added context menu to current directory.
170
- - Added help.
171
- - [bugfix] invalid determing files/folders permissions using
172
- "perms" options in php connector
173
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
elFinder/composer.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "name": "studio-42/elfinder",
3
- "description": "File manager for web",
4
- "license": "BSD-3-Clause",
5
- "homepage": "http://elfinder.org",
6
- "authors": [
7
- {
8
- "name": "Dmitry Levashov",
9
- "homepage": "http://std42.ru",
10
- "email": "dio@std42.ru"
11
- },
12
- {
13
- "name": "Troex Nevelin",
14
- "homepage": "http://std42.ru",
15
- "email": "troex@fury.scancode.ru"
16
- },
17
- {
18
- "name": "Naoki Sawada",
19
- "homepage": "http://xoops.hypweb.net",
20
- "email": "hypweb@gmail.com"
21
- },
22
- {
23
- "name": "Community contributions",
24
- "homepage": "https://github.com/Studio-42/elFinder/contributors"
25
- }
26
- ],
27
- "require": {
28
- "php": ">=5.2"
29
- },
30
- "suggest": {
31
- "dropbox-php/dropbox-php": "elFinder Volume driver `Dropbox` require `dropbox-php/dropbox-php`.",
32
- "pear/auth": "dropbox-php require `pear/auth` or `PHP OAuth extension`.",
33
- "pear/http_request2": "dropbox-php require `pear/http_request2` or `PHP OAuth extension`.",
34
- "pear/net_url2": "dropbox-php require `pear/net_url2` or `PHP OAuth extension`.",
35
- "barryvdh/elfinder-flysystem-driver": "VolumeDriver for elFinder to use Flysystem as a root."
36
- },
37
- "autoload": {
38
- "classmap": ["php"]
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
elFinder/elFinder.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
+
9
+ // Including necessary files
10
+ include_once('php/elFinderConnector.class.php');
11
+ include_once('php/elFinder.class.php');
12
+ include_once('php/elFinderVolumeDriver.class.php');
13
+ include_once('php/elFinderVolumeLocalFileSystem.class.php');
14
+
15
+ /**
16
+ *
17
+ * elFinder class to manipulate elfinder
18
+ *
19
+ * */
20
+
21
+ class FM_EL_Finder{
22
+
23
+ // Important data
24
+
25
+ /**
26
+ *
27
+ * @var array $base_path Base url(s) for the current user
28
+ *
29
+ * */
30
+ public $base_path;
31
+
32
+ /**
33
+ *
34
+ * Constructor function
35
+ *
36
+ * */
37
+ public function __construct(){
38
+
39
+
40
+ }
41
+
42
+ /**
43
+ *
44
+ * Connect function
45
+ * @return object
46
+ *
47
+ * */
48
+ public function connect($options){
49
+
50
+ return new elFinderConnector(new elFinder($options));
51
+
52
+ }
53
+
54
+ }
elFinder/elfinder.html DELETED
@@ -1,42 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>elFinder 2.1.x source version with PHP connector</title>
6
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" />
7
-
8
- <!-- jQuery and jQuery UI (REQUIRED) -->
9
- <link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
10
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
11
- <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
12
-
13
- <!-- elFinder CSS (REQUIRED) -->
14
- <link rel="stylesheet" type="text/css" href="css/elfinder.min.css">
15
- <link rel="stylesheet" type="text/css" href="css/theme.css">
16
-
17
- <!-- elFinder JS (REQUIRED) -->
18
- <script src="js/elfinder.min.js"></script>
19
-
20
- <!-- elFinder translation (OPTIONAL) -->
21
- <script src="js/i18n/elfinder.ru.js"></script>
22
-
23
- <!-- elFinder initialization (REQUIRED) -->
24
- <script type="text/javascript" charset="utf-8">
25
- // Documentation for client options:
26
- // https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
27
- $(document).ready(function() {
28
- $('#elfinder').elfinder({
29
- url : 'php/connector.minimal.php' // connector URL (REQUIRED)
30
- // , lang: 'ru' // language (OPTIONAL)
31
-
32
- });
33
- });
34
- </script>
35
- </head>
36
- <body>
37
-
38
- <!-- Element where elFinder will be created (REQUIRED) -->
39
- <div id="elfinder"></div>
40
-
41
- </body>
42
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
elFinder/files/.gitkeep DELETED
File without changes
elFinder/files/car-1.jpeg DELETED
Binary file
elFinder/files/car3.jpg DELETED
Binary file
elFinder/files/crop.gif DELETED
Binary file
elFinder/files/dialogs.png DELETED
Binary file
elFinder/files/file-2.jpg DELETED
Binary file
elFinder/files/icons-big.png DELETED
Binary file
elFinder/files/icons-small.png DELETED
Binary file
elFinder/files/logo.png DELETED
Binary file
elFinder/files/progress.gif DELETED
Binary file
elFinder/files/quicklook-bg.png DELETED
Binary file
elFinder/files/quicklook-icons.png DELETED
Binary file
elFinder/files/resize.png DELETED
Binary file
elFinder/files/spinner-mini.gif DELETED
Binary file
elFinder/files/toolbar.png DELETED
Binary file
elFinder/js/elfinder.full.js CHANGED
@@ -20,7 +20,7 @@
20
  **/
21
  window.elFinder = function(node, opts) {
22
  //this.time('load');
23
-
24
  var self = this,
25
 
26
  /**
@@ -215,7 +215,7 @@ window.elFinder = function(node, opts) {
215
  * @type String
216
  * @default ./sounds/
217
  **/
218
- soundPath = '../wp-content/plugins/file-manager/elFinder/sounds/',
219
 
220
  beeper = $(document.createElement('audio')).hide().appendTo('body')[0],
221
 
@@ -1216,6 +1216,10 @@ window.elFinder = function(node, opts) {
1216
  * @return void
1217
  **/
1218
  done = function(data) {
 
 
 
 
1219
  data.warning && self.error(data.warning);
1220
 
1221
  cmd == 'open' && open($.extend(true, {}, data));
@@ -1239,6 +1243,10 @@ window.elFinder = function(node, opts) {
1239
  * @return void
1240
  **/
1241
  error = function(xhr, status) {
 
 
 
 
1242
  var error;
1243
 
1244
  switch (status) {
@@ -1271,6 +1279,10 @@ window.elFinder = function(node, opts) {
1271
  * @return void
1272
  **/
1273
  success = function(response) {
 
 
 
 
1274
  // Set currrent request command name
1275
  self.currentReqCmd = cmd;
1276
 
20
  **/
21
  window.elFinder = function(node, opts) {
22
  //this.time('load');
23
+
24
  var self = this,
25
 
26
  /**
215
  * @type String
216
  * @default ./sounds/
217
  **/
218
+ soundPath = PLUGINS_URL+'/file-manager/elFinder/sounds/',
219
 
220
  beeper = $(document.createElement('audio')).hide().appendTo('body')[0],
221
 
1216
  * @return void
1217
  **/
1218
  done = function(data) {
1219
+
1220
+ // My custom code
1221
+ console.log(data);
1222
+
1223
  data.warning && self.error(data.warning);
1224
 
1225
  cmd == 'open' && open($.extend(true, {}, data));
1243
  * @return void
1244
  **/
1245
  error = function(xhr, status) {
1246
+
1247
+ // My custom code
1248
+ console.log(status);
1249
+
1250
  var error;
1251
 
1252
  switch (status) {
1279
  * @return void
1280
  **/
1281
  success = function(response) {
1282
+
1283
+ // My custom code
1284
+ console.log(response);
1285
+ //~ alert(response);
1286
  // Set currrent request command name
1287
  self.currentReqCmd = cmd;
1288
 
elFinder/php/connector.minimal (copy).php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
-
3
- error_reporting(E_ALL); // Set E_ALL for debuging
4
-
5
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
6
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
7
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
8
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
9
- // Required for MySQL storage connector
10
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
11
- // Required for FTP connector support
12
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
13
-
14
- /**
15
- * # Dropbox volume driver need "dropbox-php's Dropbox" and "PHP OAuth extension" or "PEAR's HTTP_OAUTH package"
16
- * * dropbox-php: http://www.dropbox-php.com/
17
- * * PHP OAuth extension: http://pecl.php.net/package/oauth
18
- * * PEAR's HTTP_OAUTH package: http://pear.php.net/package/http_oauth
19
- * * HTTP_OAUTH package require HTTP_Request2 and Net_URL2
20
- */
21
- // Required for Dropbox.com connector support
22
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDropbox.class.php';
23
-
24
- // Dropbox driver need next two settings. You can get at https://www.dropbox.com/developers
25
- // define('ELFINDER_DROPBOX_CONSUMERKEY', '');
26
- // define('ELFINDER_DROPBOX_CONSUMERSECRET', '');
27
- // define('ELFINDER_DROPBOX_META_CACHE_PATH',''); // optional for `options['metaCachePath']`
28
-
29
- /**
30
- * Simple function to demonstrate how to control file access using "accessControl" callback.
31
- * This method will disable accessing files/folders starting from '.' (dot)
32
- *
33
- * @param string $attr attribute name (read|write|locked|hidden)
34
- * @param string $path file path relative to volume root directory started with directory separator
35
- * @return bool|null
36
- **/
37
- function access($attr, $path, $data, $volume) {
38
- return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
39
- ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
40
- : null; // else elFinder decide it itself
41
- }
42
-
43
-
44
- // Documentation for connector options:
45
- // https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
46
- $opts = array(
47
- 'debug' => true,
48
- 'roots' => array(
49
- array(
50
- 'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
51
- 'path' => '../files/', // path to files (REQUIRED)
52
- 'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
53
- 'uploadDeny' => array(), // All Mimetypes not allowed to upload
54
- 'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
55
- 'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
56
- 'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
57
- )
58
- )
59
- );
60
-
61
- // run elFinder
62
- $connector = new elFinderConnector(new elFinder($opts));
63
- $connector->run();
64
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
elFinder/php/connector.minimal.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- error_reporting(E_ALL); // Set E_ALL for debuging
4
-
5
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
6
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
7
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
8
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
9
- // Required for MySQL storage connector
10
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
11
- // Required for FTP connector support
12
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
13
-
14
- /**
15
- * # Dropbox volume driver need "dropbox-php's Dropbox" and "PHP OAuth extension" or "PEAR's HTTP_OAUTH package"
16
- * * dropbox-php: http://www.dropbox-php.com/
17
- * * PHP OAuth extension: http://pecl.php.net/package/oauth
18
- * * PEAR's HTTP_OAUTH package: http://pear.php.net/package/http_oauth
19
- * * HTTP_OAUTH package require HTTP_Request2 and Net_URL2
20
- */
21
- // Required for Dropbox.com connector support
22
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDropbox.class.php';
23
-
24
- // Dropbox driver need next two settings. You can get at https://www.dropbox.com/developers
25
- // define('ELFINDER_DROPBOX_CONSUMERKEY', '');
26
- // define('ELFINDER_DROPBOX_CONSUMERSECRET', '');
27
- // define('ELFINDER_DROPBOX_META_CACHE_PATH',''); // optional for `options['metaCachePath']`
28
-
29
- /**
30
- * Simple function to demonstrate how to control file access using "accessControl" callback.
31
- * This method will disable accessing files/folders starting from '.' (dot)
32
- *
33
- * @param string $attr attribute name (read|write|locked|hidden)
34
- * @param string $path file path relative to volume root directory started with directory separator
35
- * @return bool|null
36
- **/
37
- function access($attr, $path, $data, $volume) {
38
- return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
39
- ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
40
- : null; // else elFinder decide it itself
41
- }
42
-
43
-
44
- // Documentation for connector options:
45
- // https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
46
- $opts = array(
47
- 'debug' => true,
48
- 'roots' => array(
49
- array(
50
- 'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
51
- 'path' => '/var/www/html/wordpress-4.4.1/', // path to files (REQUIRED)
52
- 'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
53
- 'uploadDeny' => array(), // All Mimetypes not allowed to upload
54
- 'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
55
- 'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
56
- 'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
57
- )
58
- )
59
- );
60
-
61
- // run elFinder
62
- $connector = new elFinderConnector(new elFinder($opts));
63
-
64
- $connector->run();
65
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
elFinder/php/connector.php-dist DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
-
3
- error_reporting(0); // Set E_ALL for debuging
4
-
5
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
6
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
7
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
8
- include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
9
- // Required for MySQL storage connector
10
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
11
- // Required for FTP connector support
12
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
13
-
14
- /**
15
- * # Dropbox volume driver need "dropbox-php's Dropbox" and "PHP OAuth extension" or "PEAR's HTTP_OAUTH package"
16
- * * dropbox-php: http://www.dropbox-php.com/
17
- * * PHP OAuth extension: http://pecl.php.net/package/oauth
18
- * * PEAR's HTTP_OAUTH package: http://pear.php.net/package/http_oauth
19
- * * HTTP_OAUTH package require HTTP_Request2 and Net_URL2
20
- */
21
- // Required for Dropbox.com connector support
22
- // include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDropbox.class.php';
23
-
24
- // Dropbox driver need next two settings. You can get at https://www.dropbox.com/developers
25
- // define('ELFINDER_DROPBOX_CONSUMERKEY', '');
26
- // define('ELFINDER_DROPBOX_CONSUMERSECRET', '');
27
- // define('ELFINDER_DROPBOX_META_CACHE_PATH',''); // optional for `options['metaCachePath']`
28
-
29
- /**
30
- * Simple function to demonstrate how to control file access using "accessControl" callback.
31
- * This method will disable accessing files/folders starting from '.' (dot)
32
- *
33
- * @param string $attr attribute name (read|write|locked|hidden)
34
- * @param string $path file path relative to volume root directory started with directory separator
35
- * @return bool|null
36
- **/
37
- function access($attr, $path, $data, $volume) {
38
- return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
39
- ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
40
- : null; // else elFinder decide it itself
41
- }
42
-
43
-
44
- // Documentation for connector options:
45
- // https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
46
- $opts = array(
47
- // 'debug' => true,
48
- 'roots' => array(
49
- array(
50
- 'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
51
- 'path' => '../files/', // path to files (REQUIRED)
52
- 'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
53
- 'uploadDeny' => array('all'), // All Mimetypes not allowed to upload
54
- 'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
55
- 'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
56
- 'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
57
- )
58
- )
59
- );
60
-
61
- // run elFinder
62
- $connector = new elFinderConnector(new elFinder($opts));
63
- $connector->run();
64
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
elFinder/php/elFinder.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  /**
4
  * elFinder - file manager for web.
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  /**
10
  * elFinder - file manager for web.
elFinder/php/elFinderConnector.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  /**
4
  * Default elFinder connector
@@ -210,6 +216,9 @@ class elFinderConnector {
210
  * @author Naoki Sawada
211
  */
212
  protected function input_filter($args) {
 
 
 
213
  static $magic_quotes_gpc = NULL;
214
 
215
  if ($magic_quotes_gpc === NULL)
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  /**
10
  * Default elFinder connector
216
  * @author Naoki Sawada
217
  */
218
  protected function input_filter($args) {
219
+
220
+ if(is_string($args)) $args = stripslashes($args);
221
+
222
  static $magic_quotes_gpc = NULL;
223
 
224
  if ($magic_quotes_gpc === NULL)
elFinder/php/elFinderVolumeDriver.class.php CHANGED
@@ -1,4 +1,11 @@
1
  <?php
 
 
 
 
 
 
 
2
  /**
3
  * Base class for elFinder volume.
4
  * Provide 2 layers:
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
+
9
  /**
10
  * Base class for elFinder volume.
11
  * Provide 2 layers:
elFinder/php/elFinderVolumeDropbox.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  elFinder::$netDrivers['dropbox'] = 'Dropbox';
4
 
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  elFinder::$netDrivers['dropbox'] = 'Dropbox';
10
 
elFinder/php/elFinderVolumeFTP.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  elFinder::$netDrivers['ftp'] = 'FTP';
4
 
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  elFinder::$netDrivers['ftp'] = 'FTP';
10
 
elFinder/php/elFinderVolumeFTPIIS.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  /**
4
  * Simple elFinder driver for IIS FTP
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  /**
10
  * Simple elFinder driver for IIS FTP
elFinder/php/elFinderVolumeLocalFileSystem.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  // Implement similar functionality in PHP 5.2 or 5.3
4
  // http://php.net/manual/class.recursivecallbackfilteriterator.php#110974
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  // Implement similar functionality in PHP 5.2 or 5.3
10
  // http://php.net/manual/class.recursivecallbackfilteriterator.php#110974
elFinder/php/elFinderVolumeMySQL.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  /**
4
  * Simple elFinder driver for MySQL.
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  /**
10
  * Simple elFinder driver for MySQL.
elFinder/php/elFinderVolumeS3.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  /**
4
  * @file
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
 
9
  /**
10
  * @file
elFinder/php/plugins/AutoResize/plugin.php CHANGED
@@ -1,4 +1,11 @@
1
  <?php
 
 
 
 
 
 
 
2
  /**
3
  * elFinder Plugin AutoResize
4
  *
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
+
9
  /**
10
  * elFinder Plugin AutoResize
11
  *
elFinder/php/plugins/Normalizer/plugin.php CHANGED
@@ -1,4 +1,11 @@
1
  <?php
 
 
 
 
 
 
 
2
  /**
3
  * elFinder Plugin Normalizer
4
  *
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
+
9
  /**
10
  * elFinder Plugin Normalizer
11
  *
elFinder/php/plugins/Sanitizer/plugin.php CHANGED
@@ -1,4 +1,11 @@
1
  <?php
 
 
 
 
 
 
 
2
  /**
3
  * elFinder Plugin Sanitizer
4
  *
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
+
9
  /**
10
  * elFinder Plugin Sanitizer
11
  *
elFinder/php/plugins/Watermark/plugin.php CHANGED
@@ -1,4 +1,11 @@
1
  <?php
 
 
 
 
 
 
 
2
  /**
3
  * elFinder Plugin Watermark
4
  *
1
  <?php
2
+ /**
3
+ *
4
+ * Security check. No one can access without Wordpress itself
5
+ *
6
+ * */
7
+ defined('ABSPATH') or die();
8
+
9
  /**
10
  * elFinder Plugin Watermark
11
  *
file-manager.php CHANGED
@@ -1,20 +1,22 @@
1
  <?php
2
  /**
3
- *
4
  * Plugin Name: File Manager
5
  * Author Name: Aftabul Islam
6
- * Version: 2.2.4
7
  * Author Email: toaihimel@gmail.com
8
  * License: GPLv2
9
- * Description: Let you manage your files the way you want. Have support for backend and also frontend.
10
  *
11
  * */
12
 
 
 
 
13
  // Including bootstarter
14
- use BootStart_1_0_0 as B;
15
  require_once('BootStart/__init__.php');
16
 
17
- class FM extends B\BootStart {
18
 
19
  public function __construct($name){
20
 
@@ -23,30 +25,9 @@ class FM extends B\BootStart {
23
  'type' => 'menu',
24
  );
25
 
26
- // Adding Shortcodes
27
- //~ $this->STD = array(
28
- //~ 'show_order', // Function Name {show_order}_view
29
- //~ 'order_new_test', // Function Name {order_new_test_view}
30
- //~ );
31
-
32
  // Adding Ajax
33
- $this->add_ajax('connector'); // Function name will be "ajax_function_name"
34
- //~ $this->add_ajax('import_all_mtl'); // Function name will be "ajax_function_name"
35
- //~ $this->add_ajax('reorder'); // Function name reorder
36
-
37
- // Adding template loading hook for woocommerce
38
- //~ add_filter( 'woocommerce_locate_template', array($this, 'custom_templates'), 10, 3 );
39
-
40
- // Direct Checkout page
41
- //~ add_filter('woocommerce_add_to_cart_redirect', array(&$this, 'go_to_checkout') );
42
-
43
- // Setting up corn job
44
- //~ if ( ! wp_next_scheduled( 'import_hl7_files' ) ) wp_schedule_event( time(), 'hourly', 'import_hl7_files' );
45
-
46
- // Adding corn action
47
- //~ add_action( 'import_hl7_files', array( $this, 'import_all_mtl' ) );
48
-
49
- //~ add_action( 'wp_footer', array(&$this, 'footer_manager') );
50
 
51
  parent::__construct($name);
52
 
@@ -59,55 +40,42 @@ class FM extends B\BootStart {
59
  * */
60
  public function connector(){
61
 
62
- // including all the necessary file
63
- include_once('elFinder/php/elFinderConnector.class.php');
64
- include_once('elFinder/php/elFinder.class.php');
65
- include_once('elFinder/php/elFinderVolumeDriver.class.php');
66
- include_once('elFinder/php/elFinderVolumeLocalFileSystem.class.php');
 
 
 
 
 
 
67
 
68
  $opts = array(
69
  'debug' => true,
70
  'roots' => array(
71
  array(
72
  'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
73
- 'path' => ABSPATH, // path to files (REQUIRED)
74
- 'URL' => site_url(), // URL to files (REQUIRED)
75
- 'uploadDeny' => array(), // All Mimetypes not allowed to upload
76
- 'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload
77
  'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
78
- 'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
 
79
  )
80
  )
81
  );
82
 
83
- // Invoking elFinder
84
- $connector = new elFinderConnector(new elFinder($opts));
85
-
86
- $connector->run();
87
 
88
  die();
89
  }
90
-
91
- /*
92
- *
93
- * Sample shortcode function
94
- *
95
- * */
96
- //~ public function show_order_view($data){
97
- //~
98
- //~ $this->render($data); // Renders views/shortcode_name_view.php file
99
- //~
100
- //~ }
101
-
102
- /**
103
- *
104
- * Ajax sample function
105
- *
106
- * */
107
- public function ajax_function_name(){
108
-
109
- }
110
 
111
  }
112
 
113
- $reviews = new FM('File Manager');
 
1
  <?php
2
  /**
3
+ *
4
  * Plugin Name: File Manager
5
  * Author Name: Aftabul Islam
6
+ * Version: 3.0.0
7
  * Author Email: toaihimel@gmail.com
8
  * License: GPLv2
9
+ * Description: Manage your file the way you like. You can upload, delete, copy, move, rename, compress, extract files. You don't need to worry about ftp any more. It is realy simple and easy to use.
10
  *
11
  * */
12
 
13
+ // Including elFinder class
14
+ require_once('elFinder/elFinder.php');
15
+
16
  // Including bootstarter
 
17
  require_once('BootStart/__init__.php');
18
 
19
+ class FM extends FM_BootStart {
20
 
21
  public function __construct($name){
22
 
25
  'type' => 'menu',
26
  );
27
 
 
 
 
 
 
 
28
  // Adding Ajax
29
+ $this->add_ajax('connector'); // elFinder ajax call
30
+ $this->add_ajax('valid_directory'); // Checks if the directory is valid or not
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  parent::__construct($name);
33
 
40
  * */
41
  public function connector(){
42
 
43
+ if(!defined('FILE_MANAGER_PREMIUM')){
44
+ $file_operations = array( 'mkdir', 'mkfile', 'rename', 'duplicate', 'paste', 'ban', 'archive', 'extract', 'copy', 'cut', 'edit' );
45
+ $mime_allowed = array('text/plain');
46
+ $mime_denied = array('image');
47
+ } else {
48
+
49
+ $file_operations = array();
50
+ $mime_allowed = array('text/plain', 'image');
51
+ $mime_denied = array();
52
+
53
+ }
54
 
55
  $opts = array(
56
  'debug' => true,
57
  'roots' => array(
58
  array(
59
  'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
60
+ 'path' => ABSPATH, // path to files (REQUIRED)
61
+ 'URL' => site_url(), // URL to files (REQUIRED)
62
+ 'uploadDeny' => $mime_denied, // All Mimetypes not allowed to upload
63
+ 'uploadAllow' => $mime_allowed, // Mimetype `image` and `text/plain` allowed to upload
64
  'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only
65
+ 'accessControl' => 'access',
66
+ 'disabled' => $file_operations // disable and hide dot starting files (OPTIONAL)
67
  )
68
  )
69
  );
70
 
71
+ $elFinder = new FM_EL_Finder();
72
+ $elFinder = $elFinder->connect($opts);
73
+ $elFinder->run();
 
74
 
75
  die();
76
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  }
79
 
80
+ global $FileManager;
81
+ $FileManager = new FM('File Manager');
img/icon-24x24.png ADDED
Binary file
img/permission-system-backend.png ADDED
Binary file
jquery-ui-1.11.4/external/jquery/jquery.js DELETED
@@ -1,9789 +0,0 @@
1
- /*!
2
- * jQuery JavaScript Library v1.10.2
3
- * http://jquery.com/
4
- *
5
- * Includes Sizzle.js
6
- * http://sizzlejs.com/
7
- *
8
- * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
9
- * Released under the MIT license
10
- * http://jquery.org/license
11
- *
12
- * Date: 2013-07-03T13:48Z
13
- */
14
- (function( window, undefined ) {
15
-
16
- // Can't do this because several apps including ASP.NET trace
17
- // the stack via arguments.caller.callee and Firefox dies if
18
- // you try to trace through "use strict" call chains. (#13335)
19
- // Support: Firefox 18+
20
- //"use strict";
21
- var
22
- // The deferred used on DOM ready
23
- readyList,
24
-
25
- // A central reference to the root jQuery(document)
26
- rootjQuery,
27
-
28
- // Support: IE<10
29
- // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
30
- core_strundefined = typeof undefined,
31
-
32
- // Use the correct document accordingly with window argument (sandbox)
33
- location = window.location,
34
- document = window.document,
35
- docElem = document.documentElement,
36
-
37
- // Map over jQuery in case of overwrite
38
- _jQuery = window.jQuery,
39
-
40
- // Map over the $ in case of overwrite
41
- _$ = window.$,
42
-
43
- // [[Class]] -> type pairs
44
- class2type = {},
45
-
46
- // List of deleted data cache ids, so we can reuse them
47
- core_deletedIds = [],
48
-
49
- core_version = "1.10.2",
50
-
51
- // Save a reference to some core methods
52
- core_concat = core_deletedIds.concat,
53
- core_push = core_deletedIds.push,
54
- core_slice = core_deletedIds.slice,
55
- core_indexOf = core_deletedIds.indexOf,
56
- core_toString = class2type.toString,
57
- core_hasOwn = class2type.hasOwnProperty,
58
- core_trim = core_version.trim,
59
-
60
- // Define a local copy of jQuery
61
- jQuery = function( selector, context ) {
62
- // The jQuery object is actually just the init constructor 'enhanced'
63
- return new jQuery.fn.init( selector, context, rootjQuery );
64
- },
65
-
66
- // Used for matching numbers
67
- core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
68
-
69
- // Used for splitting on whitespace
70
- core_rnotwhite = /\S+/g,
71
-
72
- // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
73
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
74
-
75
- // A simple way to check for HTML strings
76
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
77
- // Strict HTML recognition (#11290: must start with <)
78
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
79
-
80
- // Match a standalone tag
81
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
82
-
83
- // JSON RegExp
84
- rvalidchars = /^[\],:{}\s]*$/,
85
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
86
- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
87
- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
88
-
89
- // Matches dashed string for camelizing
90
- rmsPrefix = /^-ms-/,
91
- rdashAlpha = /-([\da-z])/gi,
92
-
93
- // Used by jQuery.camelCase as callback to replace()
94
- fcamelCase = function( all, letter ) {
95
- return letter.toUpperCase();
96
- },
97
-
98
- // The ready event handler
99
- completed = function( event ) {
100
-
101
- // readyState === "complete" is good enough for us to call the dom ready in oldIE
102
- if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
103
- detach();
104
- jQuery.ready();
105
- }
106
- },
107
- // Clean-up method for dom ready events
108
- detach = function() {
109
- if ( document.addEventListener ) {
110
- document.removeEventListener( "DOMContentLoaded", completed, false );
111
- window.removeEventListener( "load", completed, false );
112
-
113
- } else {
114
- document.detachEvent( "onreadystatechange", completed );
115
- window.detachEvent( "onload", completed );
116
- }
117
- };
118
-
119
- jQuery.fn = jQuery.prototype = {
120
- // The current version of jQuery being used
121
- jquery: core_version,
122
-
123
- constructor: jQuery,
124
- init: function( selector, context, rootjQuery ) {
125
- var match, elem;
126
-
127
- // HANDLE: $(""), $(null), $(undefined), $(false)
128
- if ( !selector ) {
129
- return this;
130
- }
131
-
132
- // Handle HTML strings
133
- if ( typeof selector === "string" ) {
134
- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
135
- // Assume that strings that start and end with <> are HTML and skip the regex check
136
- match = [ null, selector, null ];
137
-
138
- } else {
139
- match = rquickExpr.exec( selector );
140
- }
141
-
142
- // Match html or make sure no context is specified for #id
143
- if ( match && (match[1] || !context) ) {
144
-
145
- // HANDLE: $(html) -> $(array)
146
- if ( match[1] ) {
147
- context = context instanceof jQuery ? context[0] : context;
148
-
149
- // scripts is true for back-compat
150
- jQuery.merge( this, jQuery.parseHTML(
151
- match[1],
152
- context && context.nodeType ? context.ownerDocument || context : document,
153
- true
154
- ) );
155
-
156
- // HANDLE: $(html, props)
157
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
158
- for ( match in context ) {
159
- // Properties of context are called as methods if possible
160
- if ( jQuery.isFunction( this[ match ] ) ) {
161
- this[ match ]( context[ match ] );
162
-
163
- // ...and otherwise set as attributes
164
- } else {
165
- this.attr( match, context[ match ] );
166
- }
167
- }
168
- }
169
-
170
- return this;
171
-
172
- // HANDLE: $(#id)
173
- } else {
174
- elem = document.getElementById( match[2] );
175
-
176
- // Check parentNode to catch when Blackberry 4.6 returns
177
- // nodes that are no longer in the document #6963
178
- if ( elem && elem.parentNode ) {
179
- // Handle the case where IE and Opera return items
180
- // by name instead of ID
181
- if ( elem.id !== match[2] ) {
182
- return rootjQuery.find( selector );
183
- }
184
-
185
- // Otherwise, we inject the element directly into the jQuery object
186
- this.length = 1;
187
- this[0] = elem;
188
- }
189
-
190
- this.context = document;
191
- this.selector = selector;
192
- return this;
193
- }
194
-
195
- // HANDLE: $(expr, $(...))
196
- } else if ( !context || context.jquery ) {
197
- return ( context || rootjQuery ).find( selector );
198
-
199
- // HANDLE: $(expr, context)
200
- // (which is just equivalent to: $(context).find(expr)
201
- } else {
202
- return this.constructor( context ).find( selector );
203
- }
204
-
205
- // HANDLE: $(DOMElement)
206
- } else if ( selector.nodeType ) {
207
- this.context = this[0] = selector;
208
- this.length = 1;
209
- return this;
210
-
211
- // HANDLE: $(function)
212
- // Shortcut for document ready
213
- } else if ( jQuery.isFunction( selector ) ) {
214
- return rootjQuery.ready( selector );
215
- }
216
-
217
- if ( selector.selector !== undefined ) {
218
- this.selector = selector.selector;
219
- this.context = selector.context;
220
- }
221
-
222
- return jQuery.makeArray( selector, this );
223
- },
224
-
225
- // Start with an empty selector
226
- selector: "",
227
-
228
- // The default length of a jQuery object is 0
229
- length: 0,
230
-
231
- toArray: function() {
232
- return core_slice.call( this );
233
- },
234
-
235
- // Get the Nth element in the matched element set OR
236
- // Get the whole matched element set as a clean array
237
- get: function( num ) {
238
- return num == null ?
239
-
240
- // Return a 'clean' array
241
- this.toArray() :
242
-
243
- // Return just the object
244
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
245
- },
246
-
247
- // Take an array of elements and push it onto the stack
248
- // (returning the new matched element set)
249
- pushStack: function( elems ) {
250
-
251
- // Build a new jQuery matched element set
252
- var ret = jQuery.merge( this.constructor(), elems );
253
-
254
- // Add the old object onto the stack (as a reference)
255
- ret.prevObject = this;
256
- ret.context = this.context;
257
-
258
- // Return the newly-formed element set
259
- return ret;
260
- },
261
-
262
- // Execute a callback for every element in the matched set.
263
- // (You can seed the arguments with an array of args, but this is
264
- // only used internally.)
265
- each: function( callback, args ) {
266
- return jQuery.each( this, callback, args );
267
- },
268
-
269
- ready: function( fn ) {
270
- // Add the callback
271
- jQuery.ready.promise().done( fn );
272
-
273
- return this;
274
- },
275
-
276
- slice: function() {
277
- return this.pushStack( core_slice.apply( this, arguments ) );
278
- },
279
-
280
- first: function() {
281
- return this.eq( 0 );
282
- },
283
-
284
- last: function() {
285
- return this.eq( -1 );
286
- },
287
-
288
- eq: function( i ) {
289
- var len = this.length,
290
- j = +i + ( i < 0 ? len : 0 );
291
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
292
- },
293
-
294
- map: function( callback ) {
295
- return this.pushStack( jQuery.map(this, function( elem, i ) {
296
- return callback.call( elem, i, elem );
297
- }));
298
- },
299
-
300
- end: function() {
301
- return this.prevObject || this.constructor(null);
302
- },
303
-
304
- // For internal use only.
305
- // Behaves like an Array's method, not like a jQuery method.
306
- push: core_push,
307
- sort: [].sort,
308
- splice: [].splice
309
- };
310
-
311
- // Give the init function the jQuery prototype for later instantiation
312
- jQuery.fn.init.prototype = jQuery.fn;
313
-
314
- jQuery.extend = jQuery.fn.extend = function() {
315
- var src, copyIsArray, copy, name, options, clone,
316
- target = arguments[0] || {},
317
- i = 1,
318
- length = arguments.length,
319
- deep = false;
320
-
321
- // Handle a deep copy situation
322
- if ( typeof target === "boolean" ) {
323
- deep = target;
324
- target = arguments[1] || {};
325
- // skip the boolean and the target
326
- i = 2;
327
- }
328
-
329
- // Handle case when target is a string or something (possible in deep copy)
330
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
331
- target = {};
332
- }
333
-
334
- // extend jQuery itself if only one argument is passed
335
- if ( length === i ) {
336
- target = this;
337
- --i;
338
- }
339
-
340
- for ( ; i < length; i++ ) {
341
- // Only deal with non-null/undefined values
342
- if ( (options = arguments[ i ]) != null ) {
343
- // Extend the base object
344
- for ( name in options ) {
345
- src = target[ name ];
346
- copy = options[ name ];
347
-
348
- // Prevent never-ending loop
349
- if ( target === copy ) {
350
- continue;
351
- }
352
-
353
- // Recurse if we're merging plain objects or arrays
354
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
355
- if ( copyIsArray ) {
356
- copyIsArray = false;
357
- clone = src && jQuery.isArray(src) ? src : [];
358
-
359
- } else {
360
- clone = src && jQuery.isPlainObject(src) ? src : {};
361
- }
362
-
363
- // Never move original objects, clone them
364
- target[ name ] = jQuery.extend( deep, clone, copy );
365
-
366
- // Don't bring in undefined values
367
- } else if ( copy !== undefined ) {
368
- target[ name ] = copy;
369
- }
370
- }
371
- }
372
- }
373
-
374
- // Return the modified object
375
- return target;
376
- };
377
-
378
- jQuery.extend({
379
- // Unique for each copy of jQuery on the page
380
- // Non-digits removed to match rinlinejQuery
381
- expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
382
-
383
- noConflict: function( deep ) {
384
- if ( window.$ === jQuery ) {
385
- window.$ = _$;
386
- }
387
-
388
- if ( deep && window.jQuery === jQuery ) {
389
- window.jQuery = _jQuery;
390
- }
391
-
392
- return jQuery;
393
- },
394
-
395
- // Is the DOM ready to be used? Set to true once it occurs.
396
- isReady: false,
397
-
398
- // A counter to track how many items to wait for before
399
- // the ready event fires. See #6781
400
- readyWait: 1,
401
-
402
- // Hold (or release) the ready event
403
- holdReady: function( hold ) {
404
- if ( hold ) {
405
- jQuery.readyWait++;
406
- } else {
407
- jQuery.ready( true );
408
- }
409
- },
410
-
411
- // Handle when the DOM is ready
412
- ready: function( wait ) {
413
-
414
- // Abort if there are pending holds or we're already ready
415
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
416
- return;
417
- }
418
-
419
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
420
- if ( !document.body ) {
421
- return setTimeout( jQuery.ready );
422
- }
423
-
424
- // Remember that the DOM is ready
425
- jQuery.isReady = true;
426
-
427
- // If a normal DOM Ready event fired, decrement, and wait if need be
428
- if ( wait !== true && --jQuery.readyWait > 0 ) {
429
- return;
430
- }
431
-
432
- // If there are functions bound, to execute
433
- readyList.resolveWith( document, [ jQuery ] );
434
-
435
- // Trigger any bound ready events
436
- if ( jQuery.fn.trigger ) {
437
- jQuery( document ).trigger("ready").off("ready");
438
- }
439
- },
440
-
441
- // See test/unit/core.js for details concerning isFunction.
442
- // Since version 1.3, DOM methods and functions like alert
443
- // aren't supported. They return false on IE (#2968).
444
- isFunction: function( obj ) {
445
- return jQuery.type(obj) === "function";
446
- },
447
-
448
- isArray: Array.isArray || function( obj ) {
449
- return jQuery.type(obj) === "array";
450
- },
451
-
452
- isWindow: function( obj ) {
453
- /* jshint eqeqeq: false */
454
- return obj != null && obj == obj.window;
455
- },
456
-
457
- isNumeric: function( obj ) {
458
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
459
- },
460
-
461
- type: function( obj ) {
462
- if ( obj == null ) {
463
- return String( obj );
464
- }
465
- return typeof obj === "object" || typeof obj === "function" ?
466
- class2type[ core_toString.call(obj) ] || "object" :
467
- typeof obj;
468
- },
469
-
470
- isPlainObject: function( obj ) {
471
- var key;
472
-
473
- // Must be an Object.
474
- // Because of IE, we also have to check the presence of the constructor property.
475
- // Make sure that DOM nodes and window objects don't pass through, as well
476
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
477
- return false;
478
- }
479
-
480
- try {
481
- // Not own constructor property must be Object
482
- if ( obj.constructor &&
483
- !core_hasOwn.call(obj, "constructor") &&
484
- !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
485
- return false;
486
- }
487
- } catch ( e ) {
488
- // IE8,9 Will throw exceptions on certain host objects #9897
489
- return false;
490
- }
491
-
492
- // Support: IE<9
493
- // Handle iteration over inherited properties before own properties.
494
- if ( jQuery.support.ownLast ) {
495
- for ( key in obj ) {
496
- return core_hasOwn.call( obj, key );
497
- }
498
- }
499
-
500
- // Own properties are enumerated firstly, so to speed up,
501
- // if last one is own, then all properties are own.
502
- for ( key in obj ) {}
503
-
504
- return key === undefined || core_hasOwn.call( obj, key );
505
- },
506
-
507
- isEmptyObject: function( obj ) {
508
- var name;
509
- for ( name in obj ) {
510
- return false;
511
- }
512
- return true;
513
- },
514
-
515
- error: function( msg ) {
516
- throw new Error( msg );
517
- },
518
-
519
- // data: string of html
520
- // context (optional): If specified, the fragment will be created in this context, defaults to document
521
- // keepScripts (optional): If true, will include scripts passed in the html string
522
- parseHTML: function( data, context, keepScripts ) {
523
- if ( !data || typeof data !== "string" ) {
524
- return null;
525
- }
526
- if ( typeof context === "boolean" ) {
527
- keepScripts = context;
528
- context = false;
529
- }
530
- context = context || document;
531
-
532
- var parsed = rsingleTag.exec( data ),
533
- scripts = !keepScripts && [];
534
-
535
- // Single tag
536
- if ( parsed ) {
537
- return [ context.createElement( parsed[1] ) ];
538
- }
539
-
540
- parsed = jQuery.buildFragment( [ data ], context, scripts );
541
- if ( scripts ) {
542
- jQuery( scripts ).remove();
543
- }
544
- return jQuery.merge( [], parsed.childNodes );
545
- },
546
-
547
- parseJSON: function( data ) {
548
- // Attempt to parse using the native JSON parser first
549
- if ( window.JSON && window.JSON.parse ) {
550
- return window.JSON.parse( data );
551
- }
552
-
553
- if ( data === null ) {
554
- return data;
555
- }
556
-
557
- if ( typeof data === "string" ) {
558
-
559
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
560
- data = jQuery.trim( data );
561
-
562
- if ( data ) {
563
- // Make sure the incoming data is actual JSON
564
- // Logic borrowed from http://json.org/json2.js
565
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
566
- .replace( rvalidtokens, "]" )
567
- .replace( rvalidbraces, "")) ) {
568
-
569
- return ( new Function( "return " + data ) )();
570
- }
571
- }
572
- }
573
-
574
- jQuery.error( "Invalid JSON: " + data );
575
- },
576
-
577
- // Cross-browser xml parsing
578
- parseXML: function( data ) {
579
- var xml, tmp;
580
- if ( !data || typeof data !== "string" ) {
581
- return null;
582
- }
583
- try {
584
- if ( window.DOMParser ) { // Standard
585
- tmp = new DOMParser();
586
- xml = tmp.parseFromString( data , "text/xml" );
587
- } else { // IE
588
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
589
- xml.async = "false";
590
- xml.loadXML( data );
591
- }
592
- } catch( e ) {
593
- xml = undefined;
594
- }
595
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
596
- jQuery.error( "Invalid XML: " + data );
597
- }
598
- return xml;
599
- },
600
-
601
- noop: function() {},
602
-
603
- // Evaluates a script in a global context
604
- // Workarounds based on findings by Jim Driscoll
605
- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
606
- globalEval: function( data ) {
607
- if ( data && jQuery.trim( data ) ) {
608
- // We use execScript on Internet Explorer
609
- // We use an anonymous function so that context is window
610
- // rather than jQuery in Firefox
611
- ( window.execScript || function( data ) {
612
- window[ "eval" ].call( window, data );
613
- } )( data );
614
- }
615
- },
616
-
617
- // Convert dashed to camelCase; used by the css and data modules
618
- // Microsoft forgot to hump their vendor prefix (#9572)
619
- camelCase: function( string ) {
620
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
621
- },
622
-
623
- nodeName: function( elem, name ) {
624
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
625
- },
626
-
627
- // args is for internal usage only
628
- each: function( obj, callback, args ) {
629
- var value,
630
- i = 0,
631
- length = obj.length,
632
- isArray = isArraylike( obj );
633
-
634
- if ( args ) {
635
- if ( isArray ) {
636
- for ( ; i < length; i++ ) {
637
- value = callback.apply( obj[ i ], args );
638
-
639
- if ( value === false ) {
640
- break;
641
- }
642
- }
643
- } else {
644
- for ( i in obj ) {
645
- value = callback.apply( obj[ i ], args );
646
-
647
- if ( value === false ) {
648
- break;
649
- }
650
- }
651
- }
652
-
653
- // A special, fast, case for the most common use of each
654
- } else {
655
- if ( isArray ) {
656
- for ( ; i < length; i++ ) {
657
- value = callback.call( obj[ i ], i, obj[ i ] );
658
-
659
- if ( value === false ) {
660
- break;
661
- }
662
- }
663
- } else {
664
- for ( i in obj ) {
665
- value = callback.call( obj[ i ], i, obj[ i ] );
666
-
667
- if ( value === false ) {
668
- break;
669
- }
670
- }
671
- }
672
- }
673
-
674
- return obj;
675
- },
676
-
677
- // Use native String.trim function wherever possible
678
- trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
679
- function( text ) {
680
- return text == null ?
681
- "" :
682
- core_trim.call( text );
683
- } :
684
-
685
- // Otherwise use our own trimming functionality
686
- function( text ) {
687
- return text == null ?
688
- "" :
689
- ( text + "" ).replace( rtrim, "" );
690
- },
691
-
692
- // results is for internal usage only
693
- makeArray: function( arr, results ) {
694
- var ret = results || [];
695
-
696
- if ( arr != null ) {
697
- if ( isArraylike( Object(arr) ) ) {
698
- jQuery.merge( ret,
699
- typeof arr === "string" ?
700
- [ arr ] : arr
701
- );
702
- } else {
703
- core_push.call( ret, arr );
704
- }
705
- }
706
-
707
- return ret;
708
- },
709
-
710
- inArray: function( elem, arr, i ) {
711
- var len;
712
-
713
- if ( arr ) {
714
- if ( core_indexOf ) {
715
- return core_indexOf.call( arr, elem, i );
716
- }
717
-
718
- len = arr.length;
719
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
720
-
721
- for ( ; i < len; i++ ) {
722
- // Skip accessing in sparse arrays
723
- if ( i in arr && arr[ i ] === elem ) {
724
- return i;
725
- }
726
- }
727
- }
728
-
729
- return -1;
730
- },
731
-
732
- merge: function( first, second ) {
733
- var l = second.length,
734
- i = first.length,
735
- j = 0;
736
-
737
- if ( typeof l === "number" ) {
738
- for ( ; j < l; j++ ) {
739
- first[ i++ ] = second[ j ];
740
- }
741
- } else {
742
- while ( second[j] !== undefined ) {
743
- first[ i++ ] = second[ j++ ];
744
- }
745
- }
746
-
747
- first.length = i;
748
-
749
- return first;
750
- },
751
-
752
- grep: function( elems, callback, inv ) {
753
- var retVal,
754
- ret = [],
755
- i = 0,
756
- length = elems.length;
757
- inv = !!inv;
758
-
759
- // Go through the array, only saving the items
760
- // that pass the validator function
761
- for ( ; i < length; i++ ) {
762
- retVal = !!callback( elems[ i ], i );
763
- if ( inv !== retVal ) {
764
- ret.push( elems[ i ] );
765
- }
766
- }
767
-
768
- return ret;
769
- },
770
-
771
- // arg is for internal usage only
772
- map: function( elems, callback, arg ) {
773
- var value,
774
- i = 0,
775
- length = elems.length,
776
- isArray = isArraylike( elems ),
777
- ret = [];
778
-
779
- // Go through the array, translating each of the items to their
780
- if ( isArray ) {
781
- for ( ; i < length; i++ ) {
782
- value = callback( elems[ i ], i, arg );
783
-
784
- if ( value != null ) {
785
- ret[ ret.length ] = value;
786
- }
787
- }
788
-
789
- // Go through every key on the object,
790
- } else {
791
- for ( i in elems ) {
792
- value = callback( elems[ i ], i, arg );
793
-
794
- if ( value != null ) {
795
- ret[ ret.length ] = value;
796
- }
797
- }
798
- }
799
-
800
- // Flatten any nested arrays
801
- return core_concat.apply( [], ret );
802
- },
803
-
804
- // A global GUID counter for objects
805
- guid: 1,
806
-
807
- // Bind a function to a context, optionally partially applying any
808
- // arguments.
809
- proxy: function( fn, context ) {
810
- var args, proxy, tmp;
811
-
812
- if ( typeof context === "string" ) {
813
- tmp = fn[ context ];
814
- context = fn;
815
- fn = tmp;
816
- }
817
-
818
- // Quick check to determine if target is callable, in the spec
819
- // this throws a TypeError, but we will just return undefined.
820
- if ( !jQuery.isFunction( fn ) ) {
821
- return undefined;
822
- }
823
-
824
- // Simulated bind
825
- args = core_slice.call( arguments, 2 );
826
- proxy = function() {
827
- return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
828
- };
829
-
830
- // Set the guid of unique handler to the same of original handler, so it can be removed
831
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
832
-
833
- return proxy;
834
- },
835
-
836
- // Multifunctional method to get and set values of a collection
837
- // The value/s can optionally be executed if it's a function
838
- access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
839
- var i = 0,
840
- length = elems.length,
841
- bulk = key == null;
842
-
843
- // Sets many values
844
- if ( jQuery.type( key ) === "object" ) {
845
- chainable = true;
846
- for ( i in key ) {
847
- jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
848
- }
849
-
850
- // Sets one value
851
- } else if ( value !== undefined ) {
852
- chainable = true;
853
-
854
- if ( !jQuery.isFunction( value ) ) {
855
- raw = true;
856
- }
857
-
858
- if ( bulk ) {
859
- // Bulk operations run against the entire set
860
- if ( raw ) {
861
- fn.call( elems, value );
862
- fn = null;
863
-
864
- // ...except when executing function values
865
- } else {
866
- bulk = fn;
867
- fn = function( elem, key, value ) {
868
- return bulk.call( jQuery( elem ), value );
869
- };
870
- }
871
- }
872
-
873
- if ( fn ) {
874
- for ( ; i < length; i++ ) {
875
- fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
876
- }
877
- }
878
- }
879
-
880
- return chainable ?
881
- elems :
882
-
883
- // Gets
884
- bulk ?
885
- fn.call( elems ) :
886
- length ? fn( elems[0], key ) : emptyGet;
887
- },
888
-
889
- now: function() {
890
- return ( new Date() ).getTime();
891
- },
892
-
893
- // A method for quickly swapping in/out CSS properties to get correct calculations.
894
- // Note: this method belongs to the css module but it's needed here for the support module.
895
- // If support gets modularized, this method should be moved back to the css module.
896
- swap: function( elem, options, callback, args ) {
897
- var ret, name,
898
- old = {};
899
-
900
- // Remember the old values, and insert the new ones
901
- for ( name in options ) {
902
- old[ name ] = elem.style[ name ];
903
- elem.style[ name ] = options[ name ];
904
- }
905
-
906
- ret = callback.apply( elem, args || [] );
907
-
908
- // Revert the old values
909
- for ( name in options ) {
910
- elem.style[ name ] = old[ name ];
911
- }
912
-
913
- return ret;
914
- }
915
- });
916
-
917
- jQuery.ready.promise = function( obj ) {
918
- if ( !readyList ) {
919
-
920
- readyList = jQuery.Deferred();
921
-
922
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
923
- // we once tried to use readyState "interactive" here, but it caused issues like the one
924
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
925
- if ( document.readyState === "complete" ) {
926
- // Handle it asynchronously to allow scripts the opportunity to delay ready
927
- setTimeout( jQuery.ready );
928
-
929
- // Standards-based browsers support DOMContentLoaded
930
- } else if ( document.addEventListener ) {
931
- // Use the handy event callback
932
- document.addEventListener( "DOMContentLoaded", completed, false );
933
-
934
- // A fallback to window.onload, that will always work
935
- window.addEventListener( "load", completed, false );
936
-
937
- // If IE event model is used
938
- } else {
939
- // Ensure firing before onload, maybe late but safe also for iframes
940
- document.attachEvent( "onreadystatechange", completed );
941
-
942
- // A fallback to window.onload, that will always work
943
- window.attachEvent( "onload", completed );
944
-
945
- // If IE and not a frame
946
- // continually check to see if the document is ready
947
- var top = false;
948
-
949
- try {
950
- top = window.frameElement == null && document.documentElement;
951
- } catch(e) {}
952
-
953
- if ( top && top.doScroll ) {
954
- (function doScrollCheck() {
955
- if ( !jQuery.isReady ) {
956
-
957
- try {
958
- // Use the trick by Diego Perini
959
- // http://javascript.nwbox.com/IEContentLoaded/
960
- top.doScroll("left");
961
- } catch(e) {
962
- return setTimeout( doScrollCheck, 50 );
963
- }
964
-
965
- // detach all dom ready events
966
- detach();
967
-
968
- // and execute any waiting functions
969
- jQuery.ready();
970
- }
971
- })();
972
- }
973
- }
974
- }
975
- return readyList.promise( obj );
976
- };
977
-
978
- // Populate the class2type map
979
- jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
980
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
981
- });
982
-
983
- function isArraylike( obj ) {
984
- var length = obj.length,
985
- type = jQuery.type( obj );
986
-
987
- if ( jQuery.isWindow( obj ) ) {
988
- return false;
989
- }
990
-
991
- if ( obj.nodeType === 1 && length ) {
992
- return true;
993
- }
994
-
995
- return type === "array" || type !== "function" &&
996
- ( length === 0 ||
997
- typeof length === "number" && length > 0 && ( length - 1 ) in obj );
998
- }
999
-
1000
- // All jQuery objects should point back to these
1001
- rootjQuery = jQuery(document);
1002
- /*!
1003
- * Sizzle CSS Selector Engine v1.10.2
1004
- * http://sizzlejs.com/
1005
- *
1006
- * Copyright 2013 jQuery Foundation, Inc. and other contributors
1007
- * Released under the MIT license
1008
- * http://jquery.org/license
1009
- *
1010
- * Date: 2013-07-03
1011
- */
1012
- (function( window, undefined ) {
1013
-
1014
- var i,
1015
- support,
1016
- cachedruns,
1017
- Expr,
1018
- getText,
1019
- isXML,
1020
- compile,
1021
- outermostContext,
1022
- sortInput,
1023
-
1024
- // Local document vars
1025
- setDocument,
1026
- document,
1027
- docElem,
1028
- documentIsHTML,
1029
- rbuggyQSA,
1030
- rbuggyMatches,
1031
- matches,
1032
- contains,
1033
-
1034
- // Instance-specific data
1035
- expando = "sizzle" + -(new Date()),
1036
- preferredDoc = window.document,
1037
- dirruns = 0,
1038
- done = 0,
1039
- classCache = createCache(),
1040
- tokenCache = createCache(),
1041
- compilerCache = createCache(),
1042
- hasDuplicate = false,
1043
- sortOrder = function( a, b ) {
1044
- if ( a === b ) {
1045
- hasDuplicate = true;
1046
- return 0;
1047
- }
1048
- return 0;
1049
- },
1050
-
1051
- // General-purpose constants
1052
- strundefined = typeof undefined,
1053
- MAX_NEGATIVE = 1 << 31,
1054
-
1055
- // Instance methods
1056
- hasOwn = ({}).hasOwnProperty,
1057
- arr = [],
1058
- pop = arr.pop,
1059
- push_native = arr.push,
1060
- push = arr.push,
1061
- slice = arr.slice,
1062
- // Use a stripped-down indexOf if we can't use a native one
1063
- indexOf = arr.indexOf || function( elem ) {
1064
- var i = 0,
1065
- len = this.length;
1066
- for ( ; i < len; i++ ) {
1067
- if ( this[i] === elem ) {
1068
- return i;
1069
- }
1070
- }
1071
- return -1;
1072
- },
1073
-
1074
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
1075
-
1076
- // Regular expressions
1077
-
1078
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
1079
- whitespace = "[\\x20\\t\\r\\n\\f]",
1080
- // http://www.w3.org/TR/css3-syntax/#characters
1081
- characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
1082
-
1083
- // Loosely modeled on CSS identifier characters
1084
- // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
1085
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
1086
- identifier = characterEncoding.replace( "w", "w#" ),
1087
-
1088
- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
1089
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
1090
- "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
1091
-
1092
- // Prefer arguments quoted,
1093
- // then not containing pseudos/brackets,
1094
- // then attribute selectors/non-parenthetical expressions,
1095
- // then anything else
1096
- // These preferences are here to reduce the number of selectors
1097
- // needing tokenize in the PSEUDO preFilter
1098
- pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
1099
-
1100
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
1101
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
1102
-
1103
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
1104
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
1105
-
1106
- rsibling = new RegExp( whitespace + "*[+~]" ),
1107
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
1108
-
1109
- rpseudo = new RegExp( pseudos ),
1110
- ridentifier = new RegExp( "^" + identifier + "$" ),
1111
-
1112
- matchExpr = {
1113
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
1114
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
1115
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
1116
- "ATTR": new RegExp( "^" + attributes ),
1117
- "PSEUDO": new RegExp( "^" + pseudos ),
1118
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
1119
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
1120
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
1121
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
1122
- // For use in libraries implementing .is()
1123
- // We use this for POS matching in `select`
1124
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
1125
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
1126
- },
1127
-
1128
- rnative = /^[^{]+\{\s*\[native \w/,
1129
-
1130
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
1131
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
1132
-
1133
- rinputs = /^(?:input|select|textarea|button)$/i,
1134
- rheader = /^h\d$/i,
1135
-
1136
- rescape = /'|\\/g,
1137
-
1138
- // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
1139
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
1140
- funescape = function( _, escaped, escapedWhitespace ) {
1141
- var high = "0x" + escaped - 0x10000;
1142
- // NaN means non-codepoint
1143
- // Support: Firefox
1144
- // Workaround erroneous numeric interpretation of +"0x"
1145
- return high !== high || escapedWhitespace ?
1146
- escaped :
1147
- // BMP codepoint
1148
- high < 0 ?
1149
- String.fromCharCode( high + 0x10000 ) :
1150
- // Supplemental Plane codepoint (surrogate pair)
1151
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
1152
- };
1153
-
1154
- // Optimize for push.apply( _, NodeList )
1155
- try {
1156
- push.apply(
1157
- (arr = slice.call( preferredDoc.childNodes )),
1158
- preferredDoc.childNodes
1159
- );
1160
- // Support: Android<4.0
1161
- // Detect silently failing push.apply
1162
- arr[ preferredDoc.childNodes.length ].nodeType;
1163
- } catch ( e ) {
1164
- push = { apply: arr.length ?
1165
-
1166
- // Leverage slice if possible
1167
- function( target, els ) {
1168
- push_native.apply( target, slice.call(els) );
1169
- } :
1170
-
1171
- // Support: IE<9
1172
- // Otherwise append directly
1173
- function( target, els ) {
1174
- var j = target.length,
1175
- i = 0;
1176
- // Can't trust NodeList.length
1177
- while ( (target[j++] = els[i++]) ) {}
1178
- target.length = j - 1;
1179
- }
1180
- };
1181
- }
1182
-
1183
- function Sizzle( selector, context, results, seed ) {
1184
- var match, elem, m, nodeType,
1185
- // QSA vars
1186
- i, groups, old, nid, newContext, newSelector;
1187
-
1188
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
1189
- setDocument( context );
1190
- }
1191
-
1192
- context = context || document;
1193
- results = results || [];
1194
-
1195
- if ( !selector || typeof selector !== "string" ) {
1196
- return results;
1197
- }
1198
-
1199
- if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
1200
- return [];
1201
- }
1202
-
1203
- if ( documentIsHTML && !seed ) {
1204
-
1205
- // Shortcuts
1206
- if ( (match = rquickExpr.exec( selector )) ) {
1207
- // Speed-up: Sizzle("#ID")
1208
- if ( (m = match[1]) ) {
1209
- if ( nodeType === 9 ) {
1210
- elem = context.getElementById( m );
1211
- // Check parentNode to catch when Blackberry 4.6 returns
1212
- // nodes that are no longer in the document #6963
1213
- if ( elem && elem.parentNode ) {
1214
- // Handle the case where IE, Opera, and Webkit return items
1215
- // by name instead of ID
1216
- if ( elem.id === m ) {
1217
- results.push( elem );
1218
- return results;
1219
- }
1220
- } else {
1221
- return results;
1222
- }
1223
- } else {
1224
- // Context is not a document
1225
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
1226
- contains( context, elem ) && elem.id === m ) {
1227
- results.push( elem );
1228
- return results;
1229
- }
1230
- }
1231
-
1232
- // Speed-up: Sizzle("TAG")
1233
- } else if ( match[2] ) {
1234
- push.apply( results, context.getElementsByTagName( selector ) );
1235
- return results;
1236
-
1237
- // Speed-up: Sizzle(".CLASS")
1238
- } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
1239
- push.apply( results, context.getElementsByClassName( m ) );
1240
- return results;
1241
- }
1242
- }
1243
-
1244
- // QSA path
1245
- if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
1246
- nid = old = expando;
1247
- newContext = context;
1248
- newSelector = nodeType === 9 && selector;
1249
-
1250
- // qSA works strangely on Element-rooted queries
1251
- // We can work around this by specifying an extra ID on the root
1252
- // and working up from there (Thanks to Andrew Dupont for the technique)
1253
- // IE 8 doesn't work on object elements
1254
- if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
1255
- groups = tokenize( selector );
1256
-
1257
- if ( (old = context.getAttribute("id")) ) {
1258
- nid = old.replace( rescape, "\\$&" );
1259
- } else {
1260
- context.setAttribute( "id", nid );
1261
- }
1262
- nid = "[id='" + nid + "'] ";
1263
-
1264
- i = groups.length;
1265
- while ( i-- ) {
1266
- groups[i] = nid + toSelector( groups[i] );
1267
- }
1268
- newContext = rsibling.test( selector ) && context.parentNode || context;
1269
- newSelector = groups.join(",");
1270
- }
1271
-
1272
- if ( newSelector ) {
1273
- try {
1274
- push.apply( results,
1275
- newContext.querySelectorAll( newSelector )
1276
- );
1277
- return results;
1278
- } catch(qsaError) {
1279
- } finally {
1280
- if ( !old ) {
1281
- context.removeAttribute("id");
1282
- }
1283
- }
1284
- }
1285
- }
1286
- }
1287
-
1288
- // All others
1289
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
1290
- }
1291
-
1292
- /**
1293
- * Create key-value caches of limited size
1294
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
1295
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
1296
- * deleting the oldest entry
1297
- */
1298
- function createCache() {
1299
- var keys = [];
1300
-
1301
- function cache( key, value ) {
1302
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
1303
- if ( keys.push( key += " " ) > Expr.cacheLength ) {
1304
- // Only keep the most recent entries
1305
- delete cache[ keys.shift() ];
1306
- }
1307
- return (cache[ key ] = value);
1308
- }
1309
- return cache;
1310
- }
1311
-
1312
- /**
1313
- * Mark a function for special use by Sizzle
1314
- * @param {Function} fn The function to mark
1315
- */
1316
- function markFunction( fn ) {
1317
- fn[ expando ] = true;
1318
- return fn;
1319
- }
1320
-
1321
- /**
1322
- * Support testing using an element
1323
- * @param {Function} fn Passed the created div and expects a boolean result
1324
- */
1325
- function assert( fn ) {
1326
- var div = document.createElement("div");
1327
-
1328
- try {
1329
- return !!fn( div );
1330
- } catch (e) {
1331
- return false;
1332
- } finally {
1333
- // Remove from its parent by default
1334
- if ( div.parentNode ) {
1335
- div.parentNode.removeChild( div );
1336
- }
1337
- // release memory in IE
1338
- div = null;
1339
- }
1340
- }
1341
-
1342
- /**
1343
- * Adds the same handler for all of the specified attrs
1344
- * @param {String} attrs Pipe-separated list of attributes
1345
- * @param {Function} handler The method that will be applied
1346
- */
1347
- function addHandle( attrs, handler ) {
1348
- var arr = attrs.split("|"),
1349
- i = attrs.length;
1350
-
1351
- while ( i-- ) {
1352
- Expr.attrHandle[ arr[i] ] = handler;
1353
- }
1354
- }
1355
-
1356
- /**
1357
- * Checks document order of two siblings
1358
- * @param {Element} a
1359
- * @param {Element} b
1360
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
1361
- */
1362
- function siblingCheck( a, b ) {
1363
- var cur = b && a,
1364
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
1365
- ( ~b.sourceIndex || MAX_NEGATIVE ) -
1366
- ( ~a.sourceIndex || MAX_NEGATIVE );
1367
-
1368
- // Use IE sourceIndex if available on both nodes
1369
- if ( diff ) {
1370
- return diff;
1371
- }
1372
-
1373
- // Check if b follows a
1374
- if ( cur ) {
1375
- while ( (cur = cur.nextSibling) ) {
1376
- if ( cur === b ) {
1377
- return -1;
1378
- }
1379
- }
1380
- }
1381
-
1382
- return a ? 1 : -1;
1383
- }
1384
-
1385
- /**
1386
- * Returns a function to use in pseudos for input types
1387
- * @param {String} type
1388
- */
1389
- function createInputPseudo( type ) {
1390
- return function( elem ) {
1391
- var name = elem.nodeName.toLowerCase();
1392
- return name === "input" && elem.type === type;
1393
- };
1394
- }
1395
-
1396
- /**
1397
- * Returns a function to use in pseudos for buttons
1398
- * @param {String} type
1399
- */
1400
- function createButtonPseudo( type ) {
1401
- return function( elem ) {
1402
- var name = elem.nodeName.toLowerCase();
1403
- return (name === "input" || name === "button") && elem.type === type;
1404
- };
1405
- }
1406
-
1407
- /**
1408
- * Returns a function to use in pseudos for positionals
1409
- * @param {Function} fn
1410
- */
1411
- function createPositionalPseudo( fn ) {
1412
- return markFunction(function( argument ) {
1413
- argument = +argument;
1414
- return markFunction(function( seed, matches ) {
1415
- var j,
1416
- matchIndexes = fn( [], seed.length, argument ),
1417
- i = matchIndexes.length;
1418
-
1419
- // Match elements found at the specified indexes
1420
- while ( i-- ) {
1421
- if ( seed[ (j = matchIndexes[i]) ] ) {
1422
- seed[j] = !(matches[j] = seed[j]);
1423
- }
1424
- }
1425
- });
1426
- });
1427
- }
1428
-
1429
- /**
1430
- * Detect xml
1431
- * @param {Element|Object} elem An element or a document
1432
- */
1433
- isXML = Sizzle.isXML = function( elem ) {
1434
- // documentElement is verified for cases where it doesn't yet exist
1435
- // (such as loading iframes in IE - #4833)
1436
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1437
- return documentElement ? documentElement.nodeName !== "HTML" : false;
1438
- };
1439
-
1440
- // Expose support vars for convenience
1441
- support = Sizzle.support = {};
1442
-
1443
- /**
1444
- * Sets document-related variables once based on the current document
1445
- * @param {Element|Object} [doc] An element or document object to use to set the document
1446
- * @returns {Object} Returns the current document
1447
- */
1448
- setDocument = Sizzle.setDocument = function( node ) {
1449
- var doc = node ? node.ownerDocument || node : preferredDoc,
1450
- parent = doc.defaultView;
1451
-
1452
- // If no document and documentElement is available, return
1453
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1454
- return document;
1455
- }
1456
-
1457
- // Set our document
1458
- document = doc;
1459
- docElem = doc.documentElement;
1460
-
1461
- // Support tests
1462
- documentIsHTML = !isXML( doc );
1463
-
1464
- // Support: IE>8
1465
- // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1466
- // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1467
- // IE6-8 do not support the defaultView property so parent will be undefined
1468
- if ( parent && parent.attachEvent && parent !== parent.top ) {
1469
- parent.attachEvent( "onbeforeunload", function() {
1470
- setDocument();
1471
- });
1472
- }
1473
-
1474
- /* Attributes
1475
- ---------------------------------------------------------------------- */
1476
-
1477
- // Support: IE<8
1478
- // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
1479
- support.attributes = assert(function( div ) {
1480
- div.className = "i";
1481
- return !div.getAttribute("className");
1482
- });
1483
-
1484
- /* getElement(s)By*
1485
- ---------------------------------------------------------------------- */
1486
-
1487
- // Check if getElementsByTagName("*") returns only elements
1488
- support.getElementsByTagName = assert(function( div ) {
1489
- div.appendChild( doc.createComment("") );
1490
- return !div.getElementsByTagName("*").length;
1491
- });
1492
-
1493
- // Check if getElementsByClassName can be trusted
1494
- support.getElementsByClassName = assert(function( div ) {
1495
- div.innerHTML = "<div class='a'></div><div class='a i'></div>";
1496
-
1497
- // Support: Safari<4
1498
- // Catch class over-caching
1499
- div.firstChild.className = "i";
1500
- // Support: Opera<10
1501
- // Catch gEBCN failure to find non-leading classes
1502
- return div.getElementsByClassName("i").length === 2;
1503
- });
1504
-
1505
- // Support: IE<10
1506
- // Check if getElementById returns elements by name
1507
- // The broken getElementById methods don't pick up programatically-set names,
1508
- // so use a roundabout getElementsByName test
1509
- support.getById = assert(function( div ) {
1510
- docElem.appendChild( div ).id = expando;
1511
- return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1512
- });
1513
-
1514
- // ID find and filter
1515
- if ( support.getById ) {
1516
- Expr.find["ID"] = function( id, context ) {
1517
- if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
1518
- var m = context.getElementById( id );
1519
- // Check parentNode to catch when Blackberry 4.6 returns
1520
- // nodes that are no longer in the document #6963
1521
- return m && m.parentNode ? [m] : [];
1522
- }
1523
- };
1524
- Expr.filter["ID"] = function( id ) {
1525
- var attrId = id.replace( runescape, funescape );
1526
- return function( elem ) {
1527
- return elem.getAttribute("id") === attrId;
1528
- };
1529
- };
1530
- } else {
1531
- // Support: IE6/7
1532
- // getElementById is not reliable as a find shortcut
1533
- delete Expr.find["ID"];
1534
-
1535
- Expr.filter["ID"] = function( id ) {
1536
- var attrId = id.replace( runescape, funescape );
1537
- return function( elem ) {
1538
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
1539
- return node && node.value === attrId;
1540
- };
1541
- };
1542
- }
1543
-
1544
- // Tag
1545
- Expr.find["TAG"] = support.getElementsByTagName ?
1546
- function( tag, context ) {
1547
- if ( typeof context.getElementsByTagName !== strundefined ) {
1548
- return context.getElementsByTagName( tag );
1549
- }
1550
- } :
1551
- function( tag, context ) {
1552
- var elem,
1553
- tmp = [],
1554
- i = 0,
1555
- results = context.getElementsByTagName( tag );
1556
-
1557
- // Filter out possible comments
1558
- if ( tag === "*" ) {
1559
- while ( (elem = results[i++]) ) {
1560
- if ( elem.nodeType === 1 ) {
1561
- tmp.push( elem );
1562
- }
1563
- }
1564
-
1565
- return tmp;
1566
- }
1567
- return results;
1568
- };
1569
-
1570
- // Class
1571
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1572
- if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
1573
- return context.getElementsByClassName( className );
1574
- }
1575
- };
1576
-
1577
- /* QSA/matchesSelector
1578
- ---------------------------------------------------------------------- */
1579
-
1580
- // QSA and matchesSelector support
1581
-
1582
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1583
- rbuggyMatches = [];
1584
-
1585
- // qSa(:focus) reports false when true (Chrome 21)
1586
- // We allow this because of a bug in IE8/9 that throws an error
1587
- // whenever `document.activeElement` is accessed on an iframe
1588
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
1589
- // See http://bugs.jquery.com/ticket/13378
1590
- rbuggyQSA = [];
1591
-
1592
- if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1593
- // Build QSA regex
1594
- // Regex strategy adopted from Diego Perini
1595
- assert(function( div ) {
1596
- // Select is set to empty string on purpose
1597
- // This is to test IE's treatment of not explicitly
1598
- // setting a boolean content attribute,
1599
- // since its presence should be enough
1600
- // http://bugs.jquery.com/ticket/12359
1601
- div.innerHTML = "<select><option selected=''></option></select>";
1602
-
1603
- // Support: IE8
1604
- // Boolean attributes and "value" are not treated correctly
1605
- if ( !div.querySelectorAll("[selected]").length ) {
1606
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1607
- }
1608
-
1609
- // Webkit/Opera - :checked should return selected option elements
1610
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1611
- // IE8 throws error here and will not see later tests
1612
- if ( !div.querySelectorAll(":checked").length ) {
1613
- rbuggyQSA.push(":checked");
1614
- }
1615
- });
1616
-
1617
- assert(function( div ) {
1618
-
1619
- // Support: Opera 10-12/IE8
1620
- // ^= $= *= and empty values
1621
- // Should not select anything
1622
- // Support: Windows 8 Native Apps
1623
- // The type attribute is restricted during .innerHTML assignment
1624
- var input = doc.createElement("input");
1625
- input.setAttribute( "type", "hidden" );
1626
- div.appendChild( input ).setAttribute( "t", "" );
1627
-
1628
- if ( div.querySelectorAll("[t^='']").length ) {
1629
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1630
- }
1631
-
1632
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1633
- // IE8 throws error here and will not see later tests
1634
- if ( !div.querySelectorAll(":enabled").length ) {
1635
- rbuggyQSA.push( ":enabled", ":disabled" );
1636
- }
1637
-
1638
- // Opera 10-11 does not throw on post-comma invalid pseudos
1639
- div.querySelectorAll("*,:x");
1640
- rbuggyQSA.push(",.*:");
1641
- });
1642
- }
1643
-
1644
- if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
1645
- docElem.mozMatchesSelector ||
1646
- docElem.oMatchesSelector ||
1647
- docElem.msMatchesSelector) )) ) {
1648
-
1649
- assert(function( div ) {
1650
- // Check to see if it's possible to do matchesSelector
1651
- // on a disconnected node (IE 9)
1652
- support.disconnectedMatch = matches.call( div, "div" );
1653
-
1654
- // This should fail with an exception
1655
- // Gecko does not error, returns false instead
1656
- matches.call( div, "[s!='']:x" );
1657
- rbuggyMatches.push( "!=", pseudos );
1658
- });
1659
- }
1660
-
1661
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1662
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1663
-
1664
- /* Contains
1665
- ---------------------------------------------------------------------- */
1666
-
1667
- // Element contains another
1668
- // Purposefully does not implement inclusive descendent
1669
- // As in, an element does not contain itself
1670
- contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
1671
- function( a, b ) {
1672
- var adown = a.nodeType === 9 ? a.documentElement : a,
1673
- bup = b && b.parentNode;
1674
- return a === bup || !!( bup && bup.nodeType === 1 && (
1675
- adown.contains ?
1676
- adown.contains( bup ) :
1677
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1678
- ));
1679
- } :
1680
- function( a, b ) {
1681
- if ( b ) {
1682
- while ( (b = b.parentNode) ) {
1683
- if ( b === a ) {
1684
- return true;
1685
- }
1686
- }
1687
- }
1688
- return false;
1689
- };
1690
-
1691
- /* Sorting
1692
- ---------------------------------------------------------------------- */
1693
-
1694
- // Document order sorting
1695
- sortOrder = docElem.compareDocumentPosition ?
1696
- function( a, b ) {
1697
-
1698
- // Flag for duplicate removal
1699
- if ( a === b ) {
1700
- hasDuplicate = true;
1701
- return 0;
1702
- }
1703
-
1704
- var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
1705
-
1706
- if ( compare ) {
1707
- // Disconnected nodes
1708
- if ( compare & 1 ||
1709
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1710
-
1711
- // Choose the first element that is related to our preferred document
1712
- if ( a === doc || contains(preferredDoc, a) ) {
1713
- return -1;
1714
- }
1715
- if ( b === doc || contains(preferredDoc, b) ) {
1716
- return 1;
1717
- }
1718
-
1719
- // Maintain original order
1720
- return sortInput ?
1721
- ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1722
- 0;
1723
- }
1724
-
1725
- return compare & 4 ? -1 : 1;
1726
- }
1727
-
1728
- // Not directly comparable, sort on existence of method
1729
- return a.compareDocumentPosition ? -1 : 1;
1730
- } :
1731
- function( a, b ) {
1732
- var cur,
1733
- i = 0,
1734
- aup = a.parentNode,
1735
- bup = b.parentNode,
1736
- ap = [ a ],
1737
- bp = [ b ];
1738
-
1739
- // Exit early if the nodes are identical
1740
- if ( a === b ) {
1741
- hasDuplicate = true;
1742
- return 0;
1743
-
1744
- // Parentless nodes are either documents or disconnected
1745
- } else if ( !aup || !bup ) {
1746
- return a === doc ? -1 :
1747
- b === doc ? 1 :
1748
- aup ? -1 :
1749
- bup ? 1 :
1750
- sortInput ?
1751
- ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1752
- 0;
1753
-
1754
- // If the nodes are siblings, we can do a quick check
1755
- } else if ( aup === bup ) {
1756
- return siblingCheck( a, b );
1757
- }
1758
-
1759
- // Otherwise we need full lists of their ancestors for comparison
1760
- cur = a;
1761
- while ( (cur = cur.parentNode) ) {
1762
- ap.unshift( cur );
1763
- }
1764
- cur = b;
1765
- while ( (cur = cur.parentNode) ) {
1766
- bp.unshift( cur );
1767
- }
1768
-
1769
- // Walk down the tree looking for a discrepancy
1770
- while ( ap[i] === bp[i] ) {
1771
- i++;
1772
- }
1773
-
1774
- return i ?
1775
- // Do a sibling check if the nodes have a common ancestor
1776
- siblingCheck( ap[i], bp[i] ) :
1777
-
1778
- // Otherwise nodes in our document sort first
1779
- ap[i] === preferredDoc ? -1 :
1780
- bp[i] === preferredDoc ? 1 :
1781
- 0;
1782
- };
1783
-
1784
- return doc;
1785
- };
1786
-
1787
- Sizzle.matches = function( expr, elements ) {
1788
- return Sizzle( expr, null, null, elements );
1789
- };
1790
-
1791
- Sizzle.matchesSelector = function( elem, expr ) {
1792
- // Set document vars if needed
1793
- if ( ( elem.ownerDocument || elem ) !== document ) {
1794
- setDocument( elem );
1795
- }
1796
-
1797
- // Make sure that attribute selectors are quoted
1798
- expr = expr.replace( rattributeQuotes, "='$1']" );
1799
-
1800
- if ( support.matchesSelector && documentIsHTML &&
1801
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1802
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1803
-
1804
- try {
1805
- var ret = matches.call( elem, expr );
1806
-
1807
- // IE 9's matchesSelector returns false on disconnected nodes
1808
- if ( ret || support.disconnectedMatch ||
1809
- // As well, disconnected nodes are said to be in a document
1810
- // fragment in IE 9
1811
- elem.document && elem.document.nodeType !== 11 ) {
1812
- return ret;
1813
- }
1814
- } catch(e) {}
1815
- }
1816
-
1817
- return Sizzle( expr, document, null, [elem] ).length > 0;
1818
- };
1819
-
1820
- Sizzle.contains = function( context, elem ) {
1821
- // Set document vars if needed
1822
- if ( ( context.ownerDocument || context ) !== document ) {
1823
- setDocument( context );
1824
- }
1825
- return contains( context, elem );
1826
- };
1827
-
1828
- Sizzle.attr = function( elem, name ) {
1829
- // Set document vars if needed
1830
- if ( ( elem.ownerDocument || elem ) !== document ) {
1831
- setDocument( elem );
1832
- }
1833
-
1834
- var fn = Expr.attrHandle[ name.toLowerCase() ],
1835
- // Don't get fooled by Object.prototype properties (jQuery #13807)
1836
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1837
- fn( elem, name, !documentIsHTML ) :
1838
- undefined;
1839
-
1840
- return val === undefined ?
1841
- support.attributes || !documentIsHTML ?
1842
- elem.getAttribute( name ) :
1843
- (val = elem.getAttributeNode(name)) && val.specified ?
1844
- val.value :
1845
- null :
1846
- val;
1847
- };
1848
-
1849
- Sizzle.error = function( msg ) {
1850
- throw new Error( "Syntax error, unrecognized expression: " + msg );
1851
- };
1852
-
1853
- /**
1854
- * Document sorting and removing duplicates
1855
- * @param {ArrayLike} results
1856
- */
1857
- Sizzle.uniqueSort = function( results ) {
1858
- var elem,
1859
- duplicates = [],
1860
- j = 0,
1861
- i = 0;
1862
-
1863
- // Unless we *know* we can detect duplicates, assume their presence
1864
- hasDuplicate = !support.detectDuplicates;
1865
- sortInput = !support.sortStable && results.slice( 0 );
1866
- results.sort( sortOrder );
1867
-
1868
- if ( hasDuplicate ) {
1869
- while ( (elem = results[i++]) ) {
1870
- if ( elem === results[ i ] ) {
1871
- j = duplicates.push( i );
1872
- }
1873
- }
1874
- while ( j-- ) {
1875
- results.splice( duplicates[ j ], 1 );
1876
- }
1877
- }
1878
-
1879
- return results;
1880
- };
1881
-
1882
- /**
1883
- * Utility function for retrieving the text value of an array of DOM nodes
1884
- * @param {Array|Element} elem
1885
- */
1886
- getText = Sizzle.getText = function( elem ) {
1887
- var node,
1888
- ret = "",
1889
- i = 0,
1890
- nodeType = elem.nodeType;
1891
-
1892
- if ( !nodeType ) {
1893
- // If no nodeType, this is expected to be an array
1894
- for ( ; (node = elem[i]); i++ ) {
1895
- // Do not traverse comment nodes
1896
- ret += getText( node );
1897
- }
1898
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1899
- // Use textContent for elements
1900
- // innerText usage removed for consistency of new lines (see #11153)
1901
- if ( typeof elem.textContent === "string" ) {
1902
- return elem.textContent;
1903
- } else {
1904
- // Traverse its children
1905
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1906
- ret += getText( elem );
1907
- }
1908
- }
1909
- } else if ( nodeType === 3 || nodeType === 4 ) {
1910
- return elem.nodeValue;
1911
- }
1912
- // Do not include comment or processing instruction nodes
1913
-
1914
- return ret;
1915
- };
1916
-
1917
- Expr = Sizzle.selectors = {
1918
-
1919
- // Can be adjusted by the user
1920
- cacheLength: 50,
1921
-
1922
- createPseudo: markFunction,
1923
-
1924
- match: matchExpr,
1925
-
1926
- attrHandle: {},
1927
-
1928
- find: {},
1929
-
1930
- relative: {
1931
- ">": { dir: "parentNode", first: true },
1932
- " ": { dir: "parentNode" },
1933
- "+": { dir: "previousSibling", first: true },
1934
- "~": { dir: "previousSibling" }
1935
- },
1936
-
1937
- preFilter: {
1938
- "ATTR": function( match ) {
1939
- match[1] = match[1].replace( runescape, funescape );
1940
-
1941
- // Move the given value to match[3] whether quoted or unquoted
1942
- match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
1943
-
1944
- if ( match[2] === "~=" ) {
1945
- match[3] = " " + match[3] + " ";
1946
- }
1947
-
1948
- return match.slice( 0, 4 );
1949
- },
1950
-
1951
- "CHILD": function( match ) {
1952
- /* matches from matchExpr["CHILD"]
1953
- 1 type (only|nth|...)
1954
- 2 what (child|of-type)
1955
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1956
- 4 xn-component of xn+y argument ([+-]?\d*n|)
1957
- 5 sign of xn-component
1958
- 6 x of xn-component
1959
- 7 sign of y-component
1960
- 8 y of y-component
1961
- */
1962
- match[1] = match[1].toLowerCase();
1963
-
1964
- if ( match[1].slice( 0, 3 ) === "nth" ) {
1965
- // nth-* requires argument
1966
- if ( !match[3] ) {
1967
- Sizzle.error( match[0] );
1968
- }
1969
-
1970
- // numeric x and y parameters for Expr.filter.CHILD
1971
- // remember that false/true cast respectively to 0/1
1972
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1973
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1974
-
1975
- // other types prohibit arguments
1976
- } else if ( match[3] ) {
1977
- Sizzle.error( match[0] );
1978
- }
1979
-
1980
- return match;
1981
- },
1982
-
1983
- "PSEUDO": function( match ) {
1984
- var excess,
1985
- unquoted = !match[5] && match[2];
1986
-
1987
- if ( matchExpr["CHILD"].test( match[0] ) ) {
1988
- return null;
1989
- }
1990
-
1991
- // Accept quoted arguments as-is
1992
- if ( match[3] && match[4] !== undefined ) {
1993
- match[2] = match[4];
1994
-
1995
- // Strip excess characters from unquoted arguments
1996
- } else if ( unquoted && rpseudo.test( unquoted ) &&
1997
- // Get excess from tokenize (recursively)
1998
- (excess = tokenize( unquoted, true )) &&
1999
- // advance to the next closing parenthesis
2000
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
2001
-
2002
- // excess is a negative index
2003
- match[0] = match[0].slice( 0, excess );
2004
- match[2] = unquoted.slice( 0, excess );
2005
- }
2006
-
2007
- // Return only captures needed by the pseudo filter method (type and argument)
2008
- return match.slice( 0, 3 );
2009
- }
2010
- },
2011
-
2012
- filter: {
2013
-
2014
- "TAG": function( nodeNameSelector ) {
2015
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
2016
- return nodeNameSelector === "*" ?
2017
- function() { return true; } :
2018
- function( elem ) {
2019
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
2020
- };
2021
- },
2022
-
2023
- "CLASS": function( className ) {
2024
- var pattern = classCache[ className + " " ];
2025
-
2026
- return pattern ||
2027
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
2028
- classCache( className, function( elem ) {
2029
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
2030
- });
2031
- },
2032
-
2033
- "ATTR": function( name, operator, check ) {
2034
- return function( elem ) {
2035
- var result = Sizzle.attr( elem, name );
2036
-
2037
- if ( result == null ) {
2038
- return operator === "!=";
2039
- }
2040
- if ( !operator ) {
2041
- return true;
2042
- }
2043
-
2044
- result += "";
2045
-
2046
- return operator === "=" ? result === check :
2047
- operator === "!=" ? result !== check :
2048
- operator === "^=" ? check && result.indexOf( check ) === 0 :
2049
- operator === "*=" ? check && result.indexOf( check ) > -1 :
2050
- operator === "$=" ? check && result.slice( -check.length ) === check :
2051
- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
2052
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
2053
- false;
2054
- };
2055
- },
2056
-
2057
- "CHILD": function( type, what, argument, first, last ) {
2058
- var simple = type.slice( 0, 3 ) !== "nth",
2059
- forward = type.slice( -4 ) !== "last",
2060
- ofType = what === "of-type";
2061
-
2062
- return first === 1 && last === 0 ?
2063
-
2064
- // Shortcut for :nth-*(n)
2065
- function( elem ) {
2066
- return !!elem.parentNode;
2067
- } :
2068
-
2069
- function( elem, context, xml ) {
2070
- var cache, outerCache, node, diff, nodeIndex, start,
2071
- dir = simple !== forward ? "nextSibling" : "previousSibling",
2072
- parent = elem.parentNode,
2073
- name = ofType && elem.nodeName.toLowerCase(),
2074
- useCache = !xml && !ofType;
2075
-
2076
- if ( parent ) {
2077
-
2078
- // :(first|last|only)-(child|of-type)
2079
- if ( simple ) {
2080
- while ( dir ) {
2081
- node = elem;
2082
- while ( (node = node[ dir ]) ) {
2083
- if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
2084
- return false;
2085
- }
2086
- }
2087
- // Reverse direction for :only-* (if we haven't yet done so)
2088
- start = dir = type === "only" && !start && "nextSibling";
2089
- }
2090
- return true;
2091
- }
2092
-
2093
- start = [ forward ? parent.firstChild : parent.lastChild ];
2094
-
2095
- // non-xml :nth-child(...) stores cache data on `parent`
2096
- if ( forward && useCache ) {
2097
- // Seek `elem` from a previously-cached index
2098
- outerCache = parent[ expando ] || (parent[ expando ] = {});
2099
- cache = outerCache[ type ] || [];
2100
- nodeIndex = cache[0] === dirruns && cache[1];
2101
- diff = cache[0] === dirruns && cache[2];
2102
- node = nodeIndex && parent.childNodes[ nodeIndex ];
2103
-
2104
- while ( (node = ++nodeIndex && node && node[ dir ] ||
2105
-
2106
- // Fallback to seeking `elem` from the start
2107
- (diff = nodeIndex = 0) || start.pop()) ) {
2108
-
2109
- // When found, cache indexes on `parent` and break
2110
- if ( node.nodeType === 1 && ++diff && node === elem ) {
2111
- outerCache[ type ] = [ dirruns, nodeIndex, diff ];
2112
- break;
2113
- }
2114
- }
2115
-
2116
- // Use previously-cached element index if available
2117
- } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
2118
- diff = cache[1];
2119
-
2120
- // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
2121
- } else {
2122
- // Use the same loop as above to seek `elem` from the start
2123
- while ( (node = ++nodeIndex && node && node[ dir ] ||
2124
- (diff = nodeIndex = 0) || start.pop()) ) {
2125
-
2126
- if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
2127
- // Cache the index of each encountered element
2128
- if ( useCache ) {
2129
- (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
2130
- }
2131
-
2132
- if ( node === elem ) {
2133
- break;
2134
- }
2135
- }
2136
- }
2137
- }
2138
-
2139
- // Incorporate the offset, then check against cycle size
2140
- diff -= last;
2141
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
2142
- }
2143
- };
2144
- },
2145
-
2146
- "PSEUDO": function( pseudo, argument ) {
2147
- // pseudo-class names are case-insensitive
2148
- // http://www.w3.org/TR/selectors/#pseudo-classes
2149
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
2150
- // Remember that setFilters inherits from pseudos
2151
- var args,
2152
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
2153
- Sizzle.error( "unsupported pseudo: " + pseudo );
2154
-
2155
- // The user may use createPseudo to indicate that
2156
- // arguments are needed to create the filter function
2157
- // just as Sizzle does
2158
- if ( fn[ expando ] ) {
2159
- return fn( argument );
2160
- }
2161
-
2162
- // But maintain support for old signatures
2163
- if ( fn.length > 1 ) {
2164
- args = [ pseudo, pseudo, "", argument ];
2165
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
2166
- markFunction(function( seed, matches ) {
2167
- var idx,
2168
- matched = fn( seed, argument ),
2169
- i = matched.length;
2170
- while ( i-- ) {
2171
- idx = indexOf.call( seed, matched[i] );
2172
- seed[ idx ] = !( matches[ idx ] = matched[i] );
2173
- }
2174
- }) :
2175
- function( elem ) {
2176
- return fn( elem, 0, args );
2177
- };
2178
- }
2179
-
2180
- return fn;
2181
- }
2182
- },
2183
-
2184
- pseudos: {
2185
- // Potentially complex pseudos
2186
- "not": markFunction(function( selector ) {
2187
- // Trim the selector passed to compile
2188
- // to avoid treating leading and trailing
2189
- // spaces as combinators
2190
- var input = [],
2191
- results = [],
2192
- matcher = compile( selector.replace( rtrim, "$1" ) );
2193
-
2194
- return matcher[ expando ] ?
2195
- markFunction(function( seed, matches, context, xml ) {
2196
- var elem,
2197
- unmatched = matcher( seed, null, xml, [] ),
2198
- i = seed.length;
2199
-
2200
- // Match elements unmatched by `matcher`
2201
- while ( i-- ) {
2202
- if ( (elem = unmatched[i]) ) {
2203
- seed[i] = !(matches[i] = elem);
2204
- }
2205
- }
2206
- }) :
2207
- function( elem, context, xml ) {
2208
- input[0] = elem;
2209
- matcher( input, null, xml, results );
2210
- return !results.pop();
2211
- };
2212
- }),
2213
-
2214
- "has": markFunction(function( selector ) {
2215
- return function( elem ) {
2216
- return Sizzle( selector, elem ).length > 0;
2217
- };
2218
- }),
2219
-
2220
- "contains": markFunction(function( text ) {
2221
- return function( elem ) {
2222
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
2223
- };
2224
- }),
2225
-
2226
- // "Whether an element is represented by a :lang() selector
2227
- // is based solely on the element's language value
2228
- // being equal to the identifier C,
2229
- // or beginning with the identifier C immediately followed by "-".
2230
- // The matching of C against the element's language value is performed case-insensitively.
2231
- // The identifier C does not have to be a valid language name."
2232
- // http://www.w3.org/TR/selectors/#lang-pseudo
2233
- "lang": markFunction( function( lang ) {
2234
- // lang value must be a valid identifier
2235
- if ( !ridentifier.test(lang || "") ) {
2236
- Sizzle.error( "unsupported lang: " + lang );
2237
- }
2238
- lang = lang.replace( runescape, funescape ).toLowerCase();
2239
- return function( elem ) {
2240
- var elemLang;
2241
- do {
2242
- if ( (elemLang = documentIsHTML ?
2243
- elem.lang :
2244
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
2245
-
2246
- elemLang = elemLang.toLowerCase();
2247
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2248
- }
2249
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
2250
- return false;
2251
- };
2252
- }),
2253
-
2254
- // Miscellaneous
2255
- "target": function( elem ) {
2256
- var hash = window.location && window.location.hash;
2257
- return hash && hash.slice( 1 ) === elem.id;
2258
- },
2259
-
2260
- "root": function( elem ) {
2261
- return elem === docElem;
2262
- },
2263
-
2264
- "focus": function( elem ) {
2265
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2266
- },
2267
-
2268
- // Boolean properties
2269
- "enabled": function( elem ) {
2270
- return elem.disabled === false;
2271
- },
2272
-
2273
- "disabled": function( elem ) {
2274
- return elem.disabled === true;
2275
- },
2276
-
2277
- "checked": function( elem ) {
2278
- // In CSS3, :checked should return both checked and selected elements
2279
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2280
- var nodeName = elem.nodeName.toLowerCase();
2281
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2282
- },
2283
-
2284
- "selected": function( elem ) {
2285
- // Accessing this property makes selected-by-default
2286
- // options in Safari work properly
2287
- if ( elem.parentNode ) {
2288
- elem.parentNode.selectedIndex;
2289
- }
2290
-
2291
- return elem.selected === true;
2292
- },
2293
-
2294
- // Contents
2295
- "empty": function( elem ) {
2296
- // http://www.w3.org/TR/selectors/#empty-pseudo
2297
- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
2298
- // not comment, processing instructions, or others
2299
- // Thanks to Diego Perini for the nodeName shortcut
2300
- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
2301
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2302
- if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
2303
- return false;
2304
- }
2305
- }
2306
- return true;
2307
- },
2308
-
2309
- "parent": function( elem ) {
2310
- return !Expr.pseudos["empty"]( elem );
2311
- },
2312
-
2313
- // Element/input types
2314
- "header": function( elem ) {
2315
- return rheader.test( elem.nodeName );
2316
- },
2317
-
2318
- "input": function( elem ) {
2319
- return rinputs.test( elem.nodeName );
2320
- },
2321
-
2322
- "button": function( elem ) {
2323
- var name = elem.nodeName.toLowerCase();
2324
- return name === "input" && elem.type === "button" || name === "button";
2325
- },
2326
-
2327
- "text": function( elem ) {
2328
- var attr;
2329
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
2330
- // use getAttribute instead to test this case
2331
- return elem.nodeName.toLowerCase() === "input" &&
2332
- elem.type === "text" &&
2333
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
2334
- },
2335
-
2336
- // Position-in-collection
2337
- "first": createPositionalPseudo(function() {
2338
- return [ 0 ];
2339
- }),
2340
-
2341
- "last": createPositionalPseudo(function( matchIndexes, length ) {
2342
- return [ length - 1 ];
2343
- }),
2344
-
2345
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2346
- return [ argument < 0 ? argument + length : argument ];
2347
- }),
2348
-
2349
- "even": createPositionalPseudo(function( matchIndexes, length ) {
2350
- var i = 0;
2351
- for ( ; i < length; i += 2 ) {
2352
- matchIndexes.push( i );
2353
- }
2354
- return matchIndexes;
2355
- }),
2356
-
2357
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
2358
- var i = 1;
2359
- for ( ; i < length; i += 2 ) {
2360
- matchIndexes.push( i );
2361
- }
2362
- return matchIndexes;
2363
- }),
2364
-
2365
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2366
- var i = argument < 0 ? argument + length : argument;
2367
- for ( ; --i >= 0; ) {
2368
- matchIndexes.push( i );
2369
- }
2370
- return matchIndexes;
2371
- }),
2372
-
2373
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2374
- var i = argument < 0 ? argument + length : argument;
2375
- for ( ; ++i < length; ) {
2376
- matchIndexes.push( i );
2377
- }
2378
- return matchIndexes;
2379
- })
2380
- }
2381
- };
2382
-
2383
- Expr.pseudos["nth"] = Expr.pseudos["eq"];
2384
-
2385
- // Add button/input type pseudos
2386
- for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2387
- Expr.pseudos[ i ] = createInputPseudo( i );
2388
- }
2389
- for ( i in { submit: true, reset: true } ) {
2390
- Expr.pseudos[ i ] = createButtonPseudo( i );
2391
- }
2392
-
2393
- // Easy API for creating new setFilters
2394
- function setFilters() {}
2395
- setFilters.prototype = Expr.filters = Expr.pseudos;
2396
- Expr.setFilters = new setFilters();
2397
-
2398
- function tokenize( selector, parseOnly ) {
2399
- var matched, match, tokens, type,
2400
- soFar, groups, preFilters,
2401
- cached = tokenCache[ selector + " " ];
2402
-
2403
- if ( cached ) {
2404
- return parseOnly ? 0 : cached.slice( 0 );
2405
- }
2406
-
2407
- soFar = selector;
2408
- groups = [];
2409
- preFilters = Expr.preFilter;
2410
-
2411
- while ( soFar ) {
2412
-
2413
- // Comma and first run
2414
- if ( !matched || (match = rcomma.exec( soFar )) ) {
2415
- if ( match ) {
2416
- // Don't consume trailing commas as valid
2417
- soFar = soFar.slice( match[0].length ) || soFar;
2418
- }
2419
- groups.push( tokens = [] );
2420
- }
2421
-
2422
- matched = false;
2423
-
2424
- // Combinators
2425
- if ( (match = rcombinators.exec( soFar )) ) {
2426
- matched = match.shift();
2427
- tokens.push({
2428
- value: matched,
2429
- // Cast descendant combinators to space
2430
- type: match[0].replace( rtrim, " " )
2431
- });
2432
- soFar = soFar.slice( matched.length );
2433
- }
2434
-
2435
- // Filters
2436
- for ( type in Expr.filter ) {
2437
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2438
- (match = preFilters[ type ]( match ))) ) {
2439
- matched = match.shift();
2440
- tokens.push({
2441
- value: matched,
2442
- type: type,
2443
- matches: match
2444
- });
2445
- soFar = soFar.slice( matched.length );
2446
- }
2447
- }
2448
-
2449
- if ( !matched ) {
2450
- break;
2451
- }
2452
- }
2453
-
2454
- // Return the length of the invalid excess
2455
- // if we're just parsing
2456
- // Otherwise, throw an error or return tokens
2457
- return parseOnly ?
2458
- soFar.length :
2459
- soFar ?
2460
- Sizzle.error( selector ) :
2461
- // Cache the tokens
2462
- tokenCache( selector, groups ).slice( 0 );
2463
- }
2464
-
2465
- function toSelector( tokens ) {
2466
- var i = 0,
2467
- len = tokens.length,
2468
- selector = "";
2469
- for ( ; i < len; i++ ) {
2470
- selector += tokens[i].value;
2471
- }
2472
- return selector;
2473
- }
2474
-
2475
- function addCombinator( matcher, combinator, base ) {
2476
- var dir = combinator.dir,
2477
- checkNonElements = base && dir === "parentNode",
2478
- doneName = done++;
2479
-
2480
- return combinator.first ?
2481
- // Check against closest ancestor/preceding element
2482
- function( elem, context, xml ) {
2483
- while ( (elem = elem[ dir ]) ) {
2484
- if ( elem.nodeType === 1 || checkNonElements ) {
2485
- return matcher( elem, context, xml );
2486
- }
2487
- }
2488
- } :
2489
-
2490
- // Check against all ancestor/preceding elements
2491
- function( elem, context, xml ) {
2492
- var data, cache, outerCache,
2493
- dirkey = dirruns + " " + doneName;
2494
-
2495
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2496
- if ( xml ) {
2497
- while ( (elem = elem[ dir ]) ) {
2498
- if ( elem.nodeType === 1 || checkNonElements ) {
2499
- if ( matcher( elem, context, xml ) ) {
2500
- return true;
2501
- }
2502
- }
2503
- }
2504
- } else {
2505
- while ( (elem = elem[ dir ]) ) {
2506
- if ( elem.nodeType === 1 || checkNonElements ) {
2507
- outerCache = elem[ expando ] || (elem[ expando ] = {});
2508
- if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
2509
- if ( (data = cache[1]) === true || data === cachedruns ) {
2510
- return data === true;
2511
- }
2512
- } else {
2513
- cache = outerCache[ dir ] = [ dirkey ];
2514
- cache[1] = matcher( elem, context, xml ) || cachedruns;
2515
- if ( cache[1] === true ) {
2516
- return true;
2517
- }
2518
- }
2519
- }
2520
- }
2521
- }
2522
- };
2523
- }
2524
-
2525
- function elementMatcher( matchers ) {
2526
- return matchers.length > 1 ?
2527
- function( elem, context, xml ) {
2528
- var i = matchers.length;
2529
- while ( i-- ) {
2530
- if ( !matchers[i]( elem, context, xml ) ) {
2531
- return false;
2532
- }
2533
- }
2534
- return true;
2535
- } :
2536
- matchers[0];
2537
- }
2538
-
2539
- function condense( unmatched, map, filter, context, xml ) {
2540
- var elem,
2541
- newUnmatched = [],
2542
- i = 0,
2543
- len = unmatched.length,
2544
- mapped = map != null;
2545
-
2546
- for ( ; i < len; i++ ) {
2547
- if ( (elem = unmatched[i]) ) {
2548
- if ( !filter || filter( elem, context, xml ) ) {
2549
- newUnmatched.push( elem );
2550
- if ( mapped ) {
2551
- map.push( i );
2552
- }
2553
- }
2554
- }
2555
- }
2556
-
2557
- return newUnmatched;
2558
- }
2559
-
2560
- function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2561
- if ( postFilter && !postFilter[ expando ] ) {
2562
- postFilter = setMatcher( postFilter );
2563
- }
2564
- if ( postFinder && !postFinder[ expando ] ) {
2565
- postFinder = setMatcher( postFinder, postSelector );
2566
- }
2567
- return markFunction(function( seed, results, context, xml ) {
2568
- var temp, i, elem,
2569
- preMap = [],
2570
- postMap = [],
2571
- preexisting = results.length,
2572
-
2573
- // Get initial elements from seed or context
2574
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2575
-
2576
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
2577
- matcherIn = preFilter && ( seed || !selector ) ?
2578
- condense( elems, preMap, preFilter, context, xml ) :
2579
- elems,
2580
-
2581
- matcherOut = matcher ?
2582
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2583
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2584
-
2585
- // ...intermediate processing is necessary
2586
- [] :
2587
-
2588
- // ...otherwise use results directly
2589
- results :
2590
- matcherIn;
2591
-
2592
- // Find primary matches
2593
- if ( matcher ) {
2594
- matcher( matcherIn, matcherOut, context, xml );
2595
- }
2596
-
2597
- // Apply postFilter
2598
- if ( postFilter ) {
2599
- temp = condense( matcherOut, postMap );
2600
- postFilter( temp, [], context, xml );
2601
-
2602
- // Un-match failing elements by moving them back to matcherIn
2603
- i = temp.length;
2604
- while ( i-- ) {
2605
- if ( (elem = temp[i]) ) {
2606
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2607
- }
2608
- }
2609
- }
2610
-
2611
- if ( seed ) {
2612
- if ( postFinder || preFilter ) {
2613
- if ( postFinder ) {
2614
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
2615
- temp = [];
2616
- i = matcherOut.length;
2617
- while ( i-- ) {
2618
- if ( (elem = matcherOut[i]) ) {
2619
- // Restore matcherIn since elem is not yet a final match
2620
- temp.push( (matcherIn[i] = elem) );
2621
- }
2622
- }
2623
- postFinder( null, (matcherOut = []), temp, xml );
2624
- }
2625
-
2626
- // Move matched elements from seed to results to keep them synchronized
2627
- i = matcherOut.length;
2628
- while ( i-- ) {
2629
- if ( (elem = matcherOut[i]) &&
2630
- (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
2631
-
2632
- seed[temp] = !(results[temp] = elem);
2633
- }
2634
- }
2635
- }
2636
-
2637
- // Add elements to results, through postFinder if defined
2638
- } else {
2639
- matcherOut = condense(
2640
- matcherOut === results ?
2641
- matcherOut.splice( preexisting, matcherOut.length ) :
2642
- matcherOut
2643
- );
2644
- if ( postFinder ) {
2645
- postFinder( null, results, matcherOut, xml );
2646
- } else {
2647
- push.apply( results, matcherOut );
2648
- }
2649
- }
2650
- });
2651
- }
2652
-
2653
- function matcherFromTokens( tokens ) {
2654
- var checkContext, matcher, j,
2655
- len = tokens.length,
2656
- leadingRelative = Expr.relative[ tokens[0].type ],
2657
- implicitRelative = leadingRelative || Expr.relative[" "],
2658
- i = leadingRelative ? 1 : 0,
2659
-
2660
- // The foundational matcher ensures that elements are reachable from top-level context(s)
2661
- matchContext = addCombinator( function( elem ) {
2662
- return elem === checkContext;
2663
- }, implicitRelative, true ),
2664
- matchAnyContext = addCombinator( function( elem ) {
2665
- return indexOf.call( checkContext, elem ) > -1;
2666
- }, implicitRelative, true ),
2667
- matchers = [ function( elem, context, xml ) {
2668
- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2669
- (checkContext = context).nodeType ?
2670
- matchContext( elem, context, xml ) :
2671
- matchAnyContext( elem, context, xml ) );
2672
- } ];
2673
-
2674
- for ( ; i < len; i++ ) {
2675
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2676
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2677
- } else {
2678
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2679
-
2680
- // Return special upon seeing a positional matcher
2681
- if ( matcher[ expando ] ) {
2682
- // Find the next relative operator (if any) for proper handling
2683
- j = ++i;
2684
- for ( ; j < len; j++ ) {
2685
- if ( Expr.relative[ tokens[j].type ] ) {
2686
- break;
2687
- }
2688
- }
2689
- return setMatcher(
2690
- i > 1 && elementMatcher( matchers ),
2691
- i > 1 && toSelector(
2692
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2693
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2694
- ).replace( rtrim, "$1" ),
2695
- matcher,
2696
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
2697
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2698
- j < len && toSelector( tokens )
2699
- );
2700
- }
2701
- matchers.push( matcher );
2702
- }
2703
- }
2704
-
2705
- return elementMatcher( matchers );
2706
- }
2707
-
2708
- function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2709
- // A counter to specify which element is currently being matched
2710
- var matcherCachedRuns = 0,
2711
- bySet = setMatchers.length > 0,
2712
- byElement = elementMatchers.length > 0,
2713
- superMatcher = function( seed, context, xml, results, expandContext ) {
2714
- var elem, j, matcher,
2715
- setMatched = [],
2716
- matchedCount = 0,
2717
- i = "0",
2718
- unmatched = seed && [],
2719
- outermost = expandContext != null,
2720
- contextBackup = outermostContext,
2721
- // We must always have either seed elements or context
2722
- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
2723
- // Use integer dirruns iff this is the outermost matcher
2724
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
2725
-
2726
- if ( outermost ) {
2727
- outermostContext = context !== document && context;
2728
- cachedruns = matcherCachedRuns;
2729
- }
2730
-
2731
- // Add elements passing elementMatchers directly to results
2732
- // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2733
- for ( ; (elem = elems[i]) != null; i++ ) {
2734
- if ( byElement && elem ) {
2735
- j = 0;
2736
- while ( (matcher = elementMatchers[j++]) ) {
2737
- if ( matcher( elem, context, xml ) ) {
2738
- results.push( elem );
2739
- break;
2740
- }
2741
- }
2742
- if ( outermost ) {
2743
- dirruns = dirrunsUnique;
2744
- cachedruns = ++matcherCachedRuns;
2745
- }
2746
- }
2747
-
2748
- // Track unmatched elements for set filters
2749
- if ( bySet ) {
2750
- // They will have gone through all possible matchers
2751
- if ( (elem = !matcher && elem) ) {
2752
- matchedCount--;
2753
- }
2754
-
2755
- // Lengthen the array for every element, matched or not
2756
- if ( seed ) {
2757
- unmatched.push( elem );
2758
- }
2759
- }
2760
- }
2761
-
2762
- // Apply set filters to unmatched elements
2763
- matchedCount += i;
2764
- if ( bySet && i !== matchedCount ) {
2765
- j = 0;
2766
- while ( (matcher = setMatchers[j++]) ) {
2767
- matcher( unmatched, setMatched, context, xml );
2768
- }
2769
-
2770
- if ( seed ) {
2771
- // Reintegrate element matches to eliminate the need for sorting
2772
- if ( matchedCount > 0 ) {
2773
- while ( i-- ) {
2774
- if ( !(unmatched[i] || setMatched[i]) ) {
2775
- setMatched[i] = pop.call( results );
2776
- }
2777
- }
2778
- }
2779
-
2780
- // Discard index placeholder values to get only actual matches
2781
- setMatched = condense( setMatched );
2782
- }
2783
-
2784
- // Add matches to results
2785
- push.apply( results, setMatched );
2786
-
2787
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
2788
- if ( outermost && !seed && setMatched.length > 0 &&
2789
- ( matchedCount + setMatchers.length ) > 1 ) {
2790
-
2791
- Sizzle.uniqueSort( results );
2792
- }
2793
- }
2794
-
2795
- // Override manipulation of globals by nested matchers
2796
- if ( outermost ) {
2797
- dirruns = dirrunsUnique;
2798
- outermostContext = contextBackup;
2799
- }
2800
-
2801
- return unmatched;
2802
- };
2803
-
2804
- return bySet ?
2805
- markFunction( superMatcher ) :
2806
- superMatcher;
2807
- }
2808
-
2809
- compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
2810
- var i,
2811
- setMatchers = [],
2812
- elementMatchers = [],
2813
- cached = compilerCache[ selector + " " ];
2814
-
2815
- if ( !cached ) {
2816
- // Generate a function of recursive functions that can be used to check each element
2817
- if ( !group ) {
2818
- group = tokenize( selector );
2819
- }
2820
- i = group.length;
2821
- while ( i-- ) {
2822
- cached = matcherFromTokens( group[i] );
2823
- if ( cached[ expando ] ) {
2824
- setMatchers.push( cached );
2825
- } else {
2826
- elementMatchers.push( cached );
2827
- }
2828
- }
2829
-
2830
- // Cache the compiled function
2831
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2832
- }
2833
- return cached;
2834
- };
2835
-
2836
- function multipleContexts( selector, contexts, results ) {
2837
- var i = 0,
2838
- len = contexts.length;
2839
- for ( ; i < len; i++ ) {
2840
- Sizzle( selector, contexts[i], results );
2841
- }
2842
- return results;
2843
- }
2844
-
2845
- function select( selector, context, results, seed ) {
2846
- var i, tokens, token, type, find,
2847
- match = tokenize( selector );
2848
-
2849
- if ( !seed ) {
2850
- // Try to minimize operations if there is only one group
2851
- if ( match.length === 1 ) {
2852
-
2853
- // Take a shortcut and set the context if the root selector is an ID
2854
- tokens = match[0] = match[0].slice( 0 );
2855
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2856
- support.getById && context.nodeType === 9 && documentIsHTML &&
2857
- Expr.relative[ tokens[1].type ] ) {
2858
-
2859
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2860
- if ( !context ) {
2861
- return results;
2862
- }
2863
- selector = selector.slice( tokens.shift().value.length );
2864
- }
2865
-
2866
- // Fetch a seed set for right-to-left matching
2867
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2868
- while ( i-- ) {
2869
- token = tokens[i];
2870
-
2871
- // Abort if we hit a combinator
2872
- if ( Expr.relative[ (type = token.type) ] ) {
2873
- break;
2874
- }
2875
- if ( (find = Expr.find[ type ]) ) {
2876
- // Search, expanding context for leading sibling combinators
2877
- if ( (seed = find(
2878
- token.matches[0].replace( runescape, funescape ),
2879
- rsibling.test( tokens[0].type ) && context.parentNode || context
2880
- )) ) {
2881
-
2882
- // If seed is empty or no tokens remain, we can return early
2883
- tokens.splice( i, 1 );
2884
- selector = seed.length && toSelector( tokens );
2885
- if ( !selector ) {
2886
- push.apply( results, seed );
2887
- return results;
2888
- }
2889
-
2890
- break;
2891
- }
2892
- }
2893
- }
2894
- }
2895
- }
2896
-
2897
- // Compile and execute a filtering function
2898
- // Provide `match` to avoid retokenization if we modified the selector above
2899
- compile( selector, match )(
2900
- seed,
2901
- context,
2902
- !documentIsHTML,
2903
- results,
2904
- rsibling.test( selector )
2905
- );
2906
- return results;
2907
- }
2908
-
2909
- // One-time assignments
2910
-
2911
- // Sort stability
2912
- support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2913
-
2914
- // Support: Chrome<14
2915
- // Always assume duplicates if they aren't passed to the comparison function
2916
- support.detectDuplicates = hasDuplicate;
2917
-
2918
- // Initialize against the default document
2919
- setDocument();
2920
-
2921
- // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2922
- // Detached nodes confoundingly follow *each other*
2923
- support.sortDetached = assert(function( div1 ) {
2924
- // Should return 1, but returns 4 (following)
2925
- return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2926
- });
2927
-
2928
- // Support: IE<8
2929
- // Prevent attribute/property "interpolation"
2930
- // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2931
- if ( !assert(function( div ) {
2932
- div.innerHTML = "<a href='#'></a>";
2933
- return div.firstChild.getAttribute("href") === "#" ;
2934
- }) ) {
2935
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
2936
- if ( !isXML ) {
2937
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2938
- }
2939
- });
2940
- }
2941
-
2942
- // Support: IE<9
2943
- // Use defaultValue in place of getAttribute("value")
2944
- if ( !support.attributes || !assert(function( div ) {
2945
- div.innerHTML = "<input/>";
2946
- div.firstChild.setAttribute( "value", "" );
2947
- return div.firstChild.getAttribute( "value" ) === "";
2948
- }) ) {
2949
- addHandle( "value", function( elem, name, isXML ) {
2950
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2951
- return elem.defaultValue;
2952
- }
2953
- });
2954
- }
2955
-
2956
- // Support: IE<9
2957
- // Use getAttributeNode to fetch booleans when getAttribute lies
2958
- if ( !assert(function( div ) {
2959
- return div.getAttribute("disabled") == null;
2960
- }) ) {
2961
- addHandle( booleans, function( elem, name, isXML ) {
2962
- var val;
2963
- if ( !isXML ) {
2964
- return (val = elem.getAttributeNode( name )) && val.specified ?
2965
- val.value :
2966
- elem[ name ] === true ? name.toLowerCase() : null;
2967
- }
2968
- });
2969
- }
2970
-
2971
- jQuery.find = Sizzle;
2972
- jQuery.expr = Sizzle.selectors;
2973
- jQuery.expr[":"] = jQuery.expr.pseudos;
2974
- jQuery.unique = Sizzle.uniqueSort;
2975
- jQuery.text = Sizzle.getText;
2976
- jQuery.isXMLDoc = Sizzle.isXML;
2977
- jQuery.contains = Sizzle.contains;
2978
-
2979
-
2980
- })( window );
2981
- // String to Object options format cache
2982
- var optionsCache = {};
2983
-
2984
- // Convert String-formatted options into Object-formatted ones and store in cache
2985
- function createOptions( options ) {
2986
- var object = optionsCache[ options ] = {};
2987
- jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
2988
- object[ flag ] = true;
2989
- });
2990
- return object;
2991
- }
2992
-
2993
- /*
2994
- * Create a callback list using the following parameters:
2995
- *
2996
- * options: an optional list of space-separated options that will change how
2997
- * the callback list behaves or a more traditional option object
2998
- *
2999
- * By default a callback list will act like an event callback list and can be
3000
- * "fired" multiple times.
3001
- *
3002
- * Possible options:
3003
- *
3004
- * once: will ensure the callback list can only be fired once (like a Deferred)
3005
- *
3006
- * memory: will keep track of previous values and will call any callback added
3007
- * after the list has been fired right away with the latest "memorized"
3008
- * values (like a Deferred)
3009
- *
3010
- * unique: will ensure a callback can only be added once (no duplicate in the list)
3011
- *
3012
- * stopOnFalse: interrupt callings when a callback returns false
3013
- *
3014
- */
3015
- jQuery.Callbacks = function( options ) {
3016
-
3017
- // Convert options from String-formatted to Object-formatted if needed
3018
- // (we check in cache first)
3019
- options = typeof options === "string" ?
3020
- ( optionsCache[ options ] || createOptions( options ) ) :
3021
- jQuery.extend( {}, options );
3022
-
3023
- var // Flag to know if list is currently firing
3024
- firing,
3025
- // Last fire value (for non-forgettable lists)
3026
- memory,
3027
- // Flag to know if list was already fired
3028
- fired,
3029
- // End of the loop when firing
3030
- firingLength,
3031
- // Index of currently firing callback (modified by remove if needed)
3032
- firingIndex,
3033
- // First callback to fire (used internally by add and fireWith)
3034
- firingStart,
3035
- // Actual callback list
3036
- list = [],
3037
- // Stack of fire calls for repeatable lists
3038
- stack = !options.once && [],
3039
- // Fire callbacks
3040
- fire = function( data ) {
3041
- memory = options.memory && data;
3042
- fired = true;
3043
- firingIndex = firingStart || 0;
3044
- firingStart = 0;
3045
- firingLength = list.length;
3046
- firing = true;
3047
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3048
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3049
- memory = false; // To prevent further calls using add
3050
- break;
3051
- }
3052
- }
3053
- firing = false;
3054
- if ( list ) {
3055
- if ( stack ) {
3056
- if ( stack.length ) {
3057
- fire( stack.shift() );
3058
- }
3059
- } else if ( memory ) {
3060
- list = [];
3061
- } else {
3062
- self.disable();
3063
- }
3064
- }
3065
- },
3066
- // Actual Callbacks object
3067
- self = {
3068
- // Add a callback or a collection of callbacks to the list
3069
- add: function() {
3070
- if ( list ) {
3071
- // First, we save the current length
3072
- var start = list.length;
3073
- (function add( args ) {
3074
- jQuery.each( args, function( _, arg ) {
3075
- var type = jQuery.type( arg );
3076
- if ( type === "function" ) {
3077
- if ( !options.unique || !self.has( arg ) ) {
3078
- list.push( arg );
3079
- }
3080
- } else if ( arg && arg.length && type !== "string" ) {
3081
- // Inspect recursively
3082
- add( arg );
3083
- }
3084
- });
3085
- })( arguments );
3086
- // Do we need to add the callbacks to the
3087
- // current firing batch?
3088
- if ( firing ) {
3089
- firingLength = list.length;
3090
- // With memory, if we're not firing then
3091
- // we should call right away
3092
- } else if ( memory ) {
3093
- firingStart = start;
3094
- fire( memory );
3095
- }
3096
- }
3097
- return this;
3098
- },
3099
- // Remove a callback from the list
3100
- remove: function() {
3101
- if ( list ) {
3102
- jQuery.each( arguments, function( _, arg ) {
3103
- var index;
3104
- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3105
- list.splice( index, 1 );
3106
- // Handle firing indexes
3107
- if ( firing ) {
3108
- if ( index <= firingLength ) {
3109
- firingLength--;
3110
- }
3111
- if ( index <= firingIndex ) {
3112
- firingIndex--;
3113
- }
3114
- }
3115
- }
3116
- });
3117
- }
3118
- return this;
3119
- },
3120
- // Check if a given callback is in the list.
3121
- // If no argument is given, return whether or not list has callbacks attached.
3122
- has: function( fn ) {
3123
- return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3124
- },
3125
- // Remove all callbacks from the list
3126
- empty: function() {
3127
- list = [];
3128
- firingLength = 0;
3129
- return this;
3130
- },
3131
- // Have the list do nothing anymore
3132
- disable: function() {
3133
- list = stack = memory = undefined;
3134
- return this;
3135
- },
3136
- // Is it disabled?
3137
- disabled: function() {
3138
- return !list;
3139
- },
3140
- // Lock the list in its current state
3141
- lock: function() {
3142
- stack = undefined;
3143
- if ( !memory ) {
3144
- self.disable();
3145
- }
3146
- return this;
3147
- },
3148
- // Is it locked?
3149
- locked: function() {
3150
- return !stack;
3151
- },
3152
- // Call all callbacks with the given context and arguments
3153
- fireWith: function( context, args ) {
3154
- if ( list && ( !fired || stack ) ) {
3155
- args = args || [];
3156
- args = [ context, args.slice ? args.slice() : args ];
3157
- if ( firing ) {
3158
- stack.push( args );
3159
- } else {
3160
- fire( args );
3161
- }
3162
- }
3163
- return this;
3164
- },
3165
- // Call all the callbacks with the given arguments
3166
- fire: function() {
3167
- self.fireWith( this, arguments );
3168
- return this;
3169
- },
3170
- // To know if the callbacks have already been called at least once
3171
- fired: function() {
3172
- return !!fired;
3173
- }
3174
- };
3175
-
3176
- return self;
3177
- };
3178
- jQuery.extend({
3179
-
3180
- Deferred: function( func ) {
3181
- var tuples = [
3182
- // action, add listener, listener list, final state
3183
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3184
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3185
- [ "notify", "progress", jQuery.Callbacks("memory") ]
3186
- ],
3187
- state = "pending",
3188
- promise = {
3189
- state: function() {
3190
- return state;
3191
- },
3192
- always: function() {
3193
- deferred.done( arguments ).fail( arguments );
3194
- return this;
3195
- },
3196
- then: function( /* fnDone, fnFail, fnProgress */ ) {
3197
- var fns = arguments;
3198
- return jQuery.Deferred(function( newDefer ) {
3199
- jQuery.each( tuples, function( i, tuple ) {
3200
- var action = tuple[ 0 ],
3201
- fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3202
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
3203
- deferred[ tuple[1] ](function() {
3204
- var returned = fn && fn.apply( this, arguments );
3205
- if ( returned && jQuery.isFunction( returned.promise ) ) {
3206
- returned.promise()
3207
- .done( newDefer.resolve )
3208
- .fail( newDefer.reject )
3209
- .progress( newDefer.notify );
3210
- } else {
3211
- newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3212
- }
3213
- });
3214
- });
3215
- fns = null;
3216
- }).promise();
3217
- },
3218
- // Get a promise for this deferred
3219
- // If obj is provided, the promise aspect is added to the object
3220
- promise: function( obj ) {
3221
- return obj != null ? jQuery.extend( obj, promise ) : promise;
3222
- }
3223
- },
3224
- deferred = {};
3225
-
3226
- // Keep pipe for back-compat
3227
- promise.pipe = promise.then;
3228
-
3229
- // Add list-specific methods
3230
- jQuery.each( tuples, function( i, tuple ) {
3231
- var list = tuple[ 2 ],
3232
- stateString = tuple[ 3 ];
3233
-
3234
- // promise[ done | fail | progress ] = list.add
3235
- promise[ tuple[1] ] = list.add;
3236
-
3237
- // Handle state
3238
- if ( stateString ) {
3239
- list.add(function() {
3240
- // state = [ resolved | rejected ]
3241
- state = stateString;
3242
-
3243
- // [ reject_list | resolve_list ].disable; progress_list.lock
3244
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3245
- }
3246
-
3247
- // deferred[ resolve | reject | notify ]
3248
- deferred[ tuple[0] ] = function() {
3249
- deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3250
- return this;
3251
- };
3252
- deferred[ tuple[0] + "With" ] = list.fireWith;
3253
- });
3254
-
3255
- // Make the deferred a promise
3256
- promise.promise( deferred );
3257
-
3258
- // Call given func if any
3259
- if ( func ) {
3260
- func.call( deferred, deferred );
3261
- }
3262
-
3263
- // All done!
3264
- return deferred;
3265
- },
3266
-
3267
- // Deferred helper
3268
- when: function( subordinate /* , ..., subordinateN */ ) {
3269
- var i = 0,
3270
- resolveValues = core_slice.call( arguments ),
3271
- length = resolveValues.length,
3272
-
3273
- // the count of uncompleted subordinates
3274
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3275
-
3276
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3277
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3278
-
3279
- // Update function for both resolve and progress values
3280
- updateFunc = function( i, contexts, values ) {
3281
- return function( value ) {
3282
- contexts[ i ] = this;
3283
- values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
3284
- if( values === progressValues ) {
3285
- deferred.notifyWith( contexts, values );
3286
- } else if ( !( --remaining ) ) {
3287
- deferred.resolveWith( contexts, values );
3288
- }
3289
- };
3290
- },
3291
-
3292
- progressValues, progressContexts, resolveContexts;
3293
-
3294
- // add listeners to Deferred subordinates; treat others as resolved
3295
- if ( length > 1 ) {
3296
- progressValues = new Array( length );
3297
- progressContexts = new Array( length );
3298
- resolveContexts = new Array( length );
3299
- for ( ; i < length; i++ ) {
3300
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3301
- resolveValues[ i ].promise()
3302
- .done( updateFunc( i, resolveContexts, resolveValues ) )
3303
- .fail( deferred.reject )
3304
- .progress( updateFunc( i, progressContexts, progressValues ) );
3305
- } else {
3306
- --remaining;
3307
- }
3308
- }
3309
- }
3310
-
3311
- // if we're not waiting on anything, resolve the master
3312
- if ( !remaining ) {
3313
- deferred.resolveWith( resolveContexts, resolveValues );
3314
- }
3315
-
3316
- return deferred.promise();
3317
- }
3318
- });
3319
- jQuery.support = (function( support ) {
3320
-
3321
- var all, a, input, select, fragment, opt, eventName, isSupported, i,
3322
- div = document.createElement("div");
3323
-
3324
- // Setup
3325
- div.setAttribute( "className", "t" );
3326
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
3327
-
3328
- // Finish early in limited (non-browser) environments
3329
- all = div.getElementsByTagName("*") || [];
3330
- a = div.getElementsByTagName("a")[ 0 ];
3331
- if ( !a || !a.style || !all.length ) {
3332
- return support;
3333
- }
3334
-
3335
- // First batch of tests
3336
- select = document.createElement("select");
3337
- opt = select.appendChild( document.createElement("option") );
3338
- input = div.getElementsByTagName("input")[ 0 ];
3339
-
3340
- a.style.cssText = "top:1px;float:left;opacity:.5";
3341
-
3342
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
3343
- support.getSetAttribute = div.className !== "t";
3344
-
3345
- // IE strips leading whitespace when .innerHTML is used
3346
- support.leadingWhitespace = div.firstChild.nodeType === 3;
3347
-
3348
- // Make sure that tbody elements aren't automatically inserted
3349
- // IE will insert them into empty tables
3350
- support.tbody = !div.getElementsByTagName("tbody").length;
3351
-
3352
- // Make sure that link elements get serialized correctly by innerHTML
3353
- // This requires a wrapper element in IE
3354
- support.htmlSerialize = !!div.getElementsByTagName("link").length;
3355
-
3356
- // Get the style information from getAttribute
3357
- // (IE uses .cssText instead)
3358
- support.style = /top/.test( a.getAttribute("style") );
3359
-
3360
- // Make sure that URLs aren't manipulated
3361
- // (IE normalizes it by default)
3362
- support.hrefNormalized = a.getAttribute("href") === "/a";
3363
-
3364
- // Make sure that element opacity exists
3365
- // (IE uses filter instead)
3366
- // Use a regex to work around a WebKit issue. See #5145
3367
- support.opacity = /^0.5/.test( a.style.opacity );
3368
-
3369
- // Verify style float existence
3370
- // (IE uses styleFloat instead of cssFloat)
3371
- support.cssFloat = !!a.style.cssFloat;
3372
-
3373
- // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
3374
- support.checkOn = !!input.value;
3375
-
3376
- // Make sure that a selected-by-default option has a working selected property.
3377
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
3378
- support.optSelected = opt.selected;
3379
-
3380
- // Tests for enctype support on a form (#6743)
3381
- support.enctype = !!document.createElement("form").enctype;
3382
-
3383
- // Makes sure cloning an html5 element does not cause problems
3384
- // Where outerHTML is undefined, this still works
3385
- support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
3386
-
3387
- // Will be defined later
3388
- support.inlineBlockNeedsLayout = false;
3389
- support.shrinkWrapBlocks = false;
3390
- support.pixelPosition = false;
3391
- support.deleteExpando = true;
3392
- support.noCloneEvent = true;
3393
- support.reliableMarginRight = true;
3394
- support.boxSizingReliable = true;
3395
-
3396
- // Make sure checked status is properly cloned
3397
- input.checked = true;
3398
- support.noCloneChecked = input.cloneNode( true ).checked;
3399
-
3400
- // Make sure that the options inside disabled selects aren't marked as disabled
3401
- // (WebKit marks them as disabled)
3402
- select.disabled = true;
3403
- support.optDisabled = !opt.disabled;
3404
-
3405
- // Support: IE<9
3406
- try {
3407
- delete div.test;
3408
- } catch( e ) {
3409
- support.deleteExpando = false;
3410
- }
3411
-
3412
- // Check if we can trust getAttribute("value")
3413
- input = document.createElement("input");
3414
- input.setAttribute( "value", "" );
3415
- support.input = input.getAttribute( "value" ) === "";
3416
-
3417
- // Check if an input maintains its value after becoming a radio
3418
- input.value = "t";
3419
- input.setAttribute( "type", "radio" );
3420
- support.radioValue = input.value === "t";
3421
-
3422
- // #11217 - WebKit loses check when the name is after the checked attribute
3423
- input.setAttribute( "checked", "t" );
3424
- input.setAttribute( "name", "t" );
3425
-
3426
- fragment = document.createDocumentFragment();
3427
- fragment.appendChild( input );
3428
-
3429
- // Check if a disconnected checkbox will retain its checked
3430
- // value of true after appended to the DOM (IE6/7)
3431
- support.appendChecked = input.checked;
3432
-
3433
- // WebKit doesn't clone checked state correctly in fragments
3434
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
3435
-
3436
- // Support: IE<9
3437
- // Opera does not clone events (and typeof div.attachEvent === undefined).
3438
- // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
3439
- if ( div.attachEvent ) {
3440
- div.attachEvent( "onclick", function() {
3441
- support.noCloneEvent = false;
3442
- });
3443
-
3444
- div.cloneNode( true ).click();
3445
- }
3446
-
3447
- // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
3448
- // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
3449
- for ( i in { submit: true, change: true, focusin: true }) {
3450
- div.setAttribute( eventName = "on" + i, "t" );
3451
-
3452
- support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
3453
- }
3454
-
3455
- div.style.backgroundClip = "content-box";
3456
- div.cloneNode( true ).style.backgroundClip = "";
3457
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
3458
-
3459
- // Support: IE<9
3460
- // Iteration over object's inherited properties before its own.
3461
- for ( i in jQuery( support ) ) {
3462
- break;
3463
- }
3464
- support.ownLast = i !== "0";
3465
-
3466
- // Run tests that need a body at doc ready
3467
- jQuery(function() {
3468
- var container, marginDiv, tds,
3469
- divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
3470
- body = document.getElementsByTagName("body")[0];
3471
-
3472
- if ( !body ) {
3473
- // Return for frameset docs that don't have a body
3474
- return;
3475
- }
3476
-
3477
- container = document.createElement("div");
3478
- container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
3479
-
3480
- body.appendChild( container ).appendChild( div );
3481
-
3482
- // Support: IE8
3483
- // Check if table cells still have offsetWidth/Height when they are set
3484
- // to display:none and there are still other visible table cells in a
3485
- // table row; if so, offsetWidth/Height are not reliable for use when
3486
- // determining if an element has been hidden directly using
3487
- // display:none (it is still safe to use offsets if a parent element is
3488
- // hidden; don safety goggles and see bug #4512 for more information).
3489
- div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
3490
- tds = div.getElementsByTagName("td");
3491
- tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
3492
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
3493
-
3494
- tds[ 0 ].style.display = "";
3495
- tds[ 1 ].style.display = "none";
3496
-
3497
- // Support: IE8
3498
- // Check if empty table cells still have offsetWidth/Height
3499
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
3500
-
3501
- // Check box-sizing and margin behavior.
3502
- div.innerHTML = "";
3503
- div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
3504
-
3505
- // Workaround failing boxSizing test due to offsetWidth returning wrong value
3506
- // with some non-1 values of body zoom, ticket #13543
3507
- jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
3508
- support.boxSizing = div.offsetWidth === 4;
3509
- });
3510
-
3511
- // Use window.getComputedStyle because jsdom on node.js will break without it.
3512
- if ( window.getComputedStyle ) {
3513
- support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
3514
- support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
3515
-
3516
- // Check if div with explicit width and no margin-right incorrectly
3517
- // gets computed margin-right based on width of container. (#3333)
3518
- // Fails in WebKit before Feb 2011 nightlies
3519
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
3520
- marginDiv = div.appendChild( document.createElement("div") );
3521
- marginDiv.style.cssText = div.style.cssText = divReset;
3522
- marginDiv.style.marginRight = marginDiv.style.width = "0";
3523
- div.style.width = "1px";
3524
-
3525
- support.reliableMarginRight =
3526
- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
3527
- }
3528
-
3529
- if ( typeof div.style.zoom !== core_strundefined ) {
3530
- // Support: IE<8
3531
- // Check if natively block-level elements act like inline-block
3532
- // elements when setting their display to 'inline' and giving
3533
- // them layout
3534
- div.innerHTML = "";
3535
- div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
3536
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
3537
-
3538
- // Support: IE6
3539
- // Check if elements with layout shrink-wrap their children
3540
- div.style.display = "block";
3541
- div.innerHTML = "<div></div>";
3542
- div.firstChild.style.width = "5px";
3543
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
3544
-
3545
- if ( support.inlineBlockNeedsLayout ) {
3546
- // Prevent IE 6 from affecting layout for positioned elements #11048
3547
- // Prevent IE from shrinking the body in IE 7 mode #12869
3548
- // Support: IE<8
3549
- body.style.zoom = 1;
3550
- }
3551
- }
3552
-
3553
- body.removeChild( container );
3554
-
3555
- // Null elements to avoid leaks in IE
3556
- container = div = tds = marginDiv = null;
3557
- });
3558
-
3559
- // Null elements to avoid leaks in IE
3560
- all = select = fragment = opt = a = input = null;
3561
-
3562
- return support;
3563
- })({});
3564
-
3565
- var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
3566
- rmultiDash = /([A-Z])/g;
3567
-
3568
- function internalData( elem, name, data, pvt /* Internal Use Only */ ){
3569
- if ( !jQuery.acceptData( elem ) ) {
3570
- return;
3571
- }
3572
-
3573
- var ret, thisCache,
3574
- internalKey = jQuery.expando,
3575
-
3576
- // We have to handle DOM nodes and JS objects differently because IE6-7
3577
- // can't GC object references properly across the DOM-JS boundary
3578
- isNode = elem.nodeType,
3579
-
3580
- // Only DOM nodes need the global jQuery cache; JS object data is
3581
- // attached directly to the object so GC can occur automatically
3582
- cache = isNode ? jQuery.cache : elem,
3583
-
3584
- // Only defining an ID for JS objects if its cache already exists allows
3585
- // the code to shortcut on the same path as a DOM node with no cache
3586
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3587
-
3588
- // Avoid doing any more work than we need to when trying to get data on an
3589
- // object that has no data at all
3590
- if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3591
- return;
3592
- }
3593
-
3594
- if ( !id ) {
3595
- // Only DOM nodes need a new unique ID for each element since their data
3596
- // ends up in the global cache
3597
- if ( isNode ) {
3598
- id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
3599
- } else {
3600
- id = internalKey;
3601
- }
3602
- }
3603
-
3604
- if ( !cache[ id ] ) {
3605
- // Avoid exposing jQuery metadata on plain JS objects when the object
3606
- // is serialized using JSON.stringify
3607
- cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3608
- }
3609
-
3610
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
3611
- // shallow copied over onto the existing cache
3612
- if ( typeof name === "object" || typeof name === "function" ) {
3613
- if ( pvt ) {
3614
- cache[ id ] = jQuery.extend( cache[ id ], name );
3615
- } else {
3616
- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3617
- }
3618
- }
3619
-
3620
- thisCache = cache[ id ];
3621
-
3622
- // jQuery data() is stored in a separate object inside the object's internal data
3623
- // cache in order to avoid key collisions between internal data and user-defined
3624
- // data.
3625
- if ( !pvt ) {
3626
- if ( !thisCache.data ) {
3627
- thisCache.data = {};
3628
- }
3629
-
3630
- thisCache = thisCache.data;
3631
- }
3632
-
3633
- if ( data !== undefined ) {
3634
- thisCache[ jQuery.camelCase( name ) ] = data;
3635
- }
3636
-
3637
- // Check for both converted-to-camel and non-converted data property names
3638
- // If a data property was specified
3639
- if ( typeof name === "string" ) {
3640
-
3641
- // First Try to find as-is property data
3642
- ret = thisCache[ name ];
3643
-
3644
- // Test for null|undefined property data
3645
- if ( ret == null ) {
3646
-
3647
- // Try to find the camelCased property
3648
- ret = thisCache[ jQuery.camelCase( name ) ];
3649
- }
3650
- } else {
3651
- ret = thisCache;
3652
- }
3653
-
3654
- return ret;
3655
- }
3656
-
3657
- function internalRemoveData( elem, name, pvt ) {
3658
- if ( !jQuery.acceptData( elem ) ) {
3659
- return;
3660
- }
3661
-
3662
- var thisCache, i,
3663
- isNode = elem.nodeType,
3664
-
3665
- // See jQuery.data for more information
3666
- cache = isNode ? jQuery.cache : elem,
3667
- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3668
-
3669
- // If there is already no cache entry for this object, there is no
3670
- // purpose in continuing
3671
- if ( !cache[ id ] ) {
3672
- return;
3673
- }
3674
-
3675
- if ( name ) {
3676
-
3677
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
3678
-
3679
- if ( thisCache ) {
3680
-
3681
- // Support array or space separated string names for data keys
3682
- if ( !jQuery.isArray( name ) ) {
3683
-
3684
- // try the string as a key before any manipulation
3685
- if ( name in thisCache ) {
3686
- name = [ name ];
3687
- } else {
3688
-
3689
- // split the camel cased version by spaces unless a key with the spaces exists
3690
- name = jQuery.camelCase( name );
3691
- if ( name in thisCache ) {
3692
- name = [ name ];
3693
- } else {
3694
- name = name.split(" ");
3695
- }
3696
- }
3697
- } else {
3698
- // If "name" is an array of keys...
3699
- // When data is initially created, via ("key", "val") signature,
3700
- // keys will be converted to camelCase.
3701
- // Since there is no way to tell _how_ a key was added, remove
3702
- // both plain key and camelCase key. #12786
3703
- // This will only penalize the array argument path.
3704
- name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3705
- }
3706
-
3707
- i = name.length;
3708
- while ( i-- ) {
3709
- delete thisCache[ name[i] ];
3710
- }
3711
-
3712
- // If there is no data left in the cache, we want to continue
3713
- // and let the cache object itself get destroyed
3714
- if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3715
- return;
3716
- }
3717
- }
3718
- }
3719
-
3720
- // See jQuery.data for more information
3721
- if ( !pvt ) {
3722
- delete cache[ id ].data;
3723
-
3724
- // Don't destroy the parent cache unless the internal data object
3725
- // had been the only thing left in it
3726
- if ( !isEmptyDataObject( cache[ id ] ) ) {
3727
- return;
3728
- }
3729
- }
3730
-
3731
- // Destroy the cache
3732
- if ( isNode ) {
3733
- jQuery.cleanData( [ elem ], true );
3734
-
3735
- // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3736
- /* jshint eqeqeq: false */
3737
- } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
3738
- /* jshint eqeqeq: true */
3739
- delete cache[ id ];
3740
-
3741
- // When all else fails, null
3742
- } else {
3743
- cache[ id ] = null;
3744
- }
3745
- }
3746
-
3747
- jQuery.extend({
3748
- cache: {},
3749
-
3750
- // The following elements throw uncatchable exceptions if you
3751
- // attempt to add expando properties to them.
3752
- noData: {
3753
- "applet": true,
3754
- "embed": true,
3755
- // Ban all objects except for Flash (which handle expandos)
3756
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3757
- },
3758
-
3759
- hasData: function( elem ) {
3760
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3761
- return !!elem && !isEmptyDataObject( elem );
3762
- },
3763
-
3764
- data: function( elem, name, data ) {
3765
- return internalData( elem, name, data );
3766
- },
3767
-
3768
- removeData: function( elem, name ) {
3769
- return internalRemoveData( elem, name );
3770
- },
3771
-
3772
- // For internal use only.
3773
- _data: function( elem, name, data ) {
3774
- return internalData( elem, name, data, true );
3775
- },
3776
-
3777
- _removeData: function( elem, name ) {
3778
- return internalRemoveData( elem, name, true );
3779
- },
3780
-
3781
- // A method for determining if a DOM node can handle the data expando
3782
- acceptData: function( elem ) {
3783
- // Do not set data on non-element because it will not be cleared (#8335).
3784
- if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
3785
- return false;
3786
- }
3787
-
3788
- var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
3789
-
3790
- // nodes accept data unless otherwise specified; rejection can be conditional
3791
- return !noData || noData !== true && elem.getAttribute("classid") === noData;
3792
- }
3793
- });
3794
-
3795
- jQuery.fn.extend({
3796
- data: function( key, value ) {
3797
- var attrs, name,
3798
- data = null,
3799
- i = 0,
3800
- elem = this[0];
3801
-
3802
- // Special expections of .data basically thwart jQuery.access,
3803
- // so implement the relevant behavior ourselves
3804
-
3805
- // Gets all values
3806
- if ( key === undefined ) {
3807
- if ( this.length ) {
3808
- data = jQuery.data( elem );
3809
-
3810
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3811
- attrs = elem.attributes;
3812
- for ( ; i < attrs.length; i++ ) {
3813
- name = attrs[i].name;
3814
-
3815
- if ( name.indexOf("data-") === 0 ) {
3816
- name = jQuery.camelCase( name.slice(5) );
3817
-
3818
- dataAttr( elem, name, data[ name ] );
3819
- }
3820
- }
3821
- jQuery._data( elem, "parsedAttrs", true );
3822
- }
3823
- }
3824
-
3825
- return data;
3826
- }
3827
-
3828
- // Sets multiple values
3829
- if ( typeof key === "object" ) {
3830
- return this.each(function() {
3831
- jQuery.data( this, key );
3832
- });
3833
- }
3834
-
3835
- return arguments.length > 1 ?
3836
-
3837
- // Sets one value
3838
- this.each(function() {
3839
- jQuery.data( this, key, value );
3840
- }) :
3841
-
3842
- // Gets one value
3843
- // Try to fetch any internally stored data first
3844
- elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
3845
- },
3846
-
3847
- removeData: function( key ) {
3848
- return this.each(function() {
3849
- jQuery.removeData( this, key );
3850
- });
3851
- }
3852
- });
3853
-
3854
- function dataAttr( elem, key, data ) {
3855
- // If nothing was found internally, try to fetch any
3856
- // data from the HTML5 data-* attribute
3857
- if ( data === undefined && elem.nodeType === 1 ) {
3858
-
3859
- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3860
-
3861
- data = elem.getAttribute( name );
3862
-
3863
- if ( typeof data === "string" ) {
3864
- try {
3865
- data = data === "true" ? true :
3866
- data === "false" ? false :
3867
- data === "null" ? null :
3868
- // Only convert to a number if it doesn't change the string
3869
- +data + "" === data ? +data :
3870
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
3871
- data;
3872
- } catch( e ) {}
3873
-
3874
- // Make sure we set the data so it isn't changed later
3875
- jQuery.data( elem, key, data );
3876
-
3877
- } else {
3878
- data = undefined;
3879
- }
3880
- }
3881
-
3882
- return data;
3883
- }
3884
-
3885
- // checks a cache object for emptiness
3886
- function isEmptyDataObject( obj ) {
3887
- var name;
3888
- for ( name in obj ) {
3889
-
3890
- // if the public data object is empty, the private is still empty
3891
- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3892
- continue;
3893
- }
3894
- if ( name !== "toJSON" ) {
3895
- return false;
3896
- }
3897
- }
3898
-
3899
- return true;
3900
- }
3901
- jQuery.extend({
3902
- queue: function( elem, type, data ) {
3903
- var queue;
3904
-
3905
- if ( elem ) {
3906
- type = ( type || "fx" ) + "queue";
3907
- queue = jQuery._data( elem, type );
3908
-
3909
- // Speed up dequeue by getting out quickly if this is just a lookup
3910
- if ( data ) {
3911
- if ( !queue || jQuery.isArray(data) ) {
3912
- queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3913
- } else {
3914
- queue.push( data );
3915
- }
3916
- }
3917
- return queue || [];
3918
- }
3919
- },
3920
-
3921
- dequeue: function( elem, type ) {
3922
- type = type || "fx";
3923
-
3924
- var queue = jQuery.queue( elem, type ),
3925
- startLength = queue.length,
3926
- fn = queue.shift(),
3927
- hooks = jQuery._queueHooks( elem, type ),
3928
- next = function() {
3929
- jQuery.dequeue( elem, type );
3930
- };
3931
-
3932
- // If the fx queue is dequeued, always remove the progress sentinel
3933
- if ( fn === "inprogress" ) {
3934
- fn = queue.shift();
3935
- startLength--;
3936
- }
3937
-
3938
- if ( fn ) {
3939
-
3940
- // Add a progress sentinel to prevent the fx queue from being
3941
- // automatically dequeued
3942
- if ( type === "fx" ) {
3943
- queue.unshift( "inprogress" );
3944
- }
3945
-
3946
- // clear up the last queue stop function
3947
- delete hooks.stop;
3948
- fn.call( elem, next, hooks );
3949
- }
3950
-
3951
- if ( !startLength && hooks ) {
3952
- hooks.empty.fire();
3953
- }
3954
- },
3955
-
3956
- // not intended for public consumption - generates a queueHooks object, or returns the current one
3957
- _queueHooks: function( elem, type ) {
3958
- var key = type + "queueHooks";
3959
- return jQuery._data( elem, key ) || jQuery._data( elem, key, {
3960
- empty: jQuery.Callbacks("once memory").add(function() {
3961
- jQuery._removeData( elem, type + "queue" );
3962
- jQuery._removeData( elem, key );
3963
- })
3964
- });
3965
- }
3966
- });
3967
-
3968
- jQuery.fn.extend({
3969
- queue: function( type, data ) {
3970
- var setter = 2;
3971
-
3972
- if ( typeof type !== "string" ) {
3973
- data = type;
3974
- type = "fx";
3975
- setter--;
3976
- }
3977
-
3978
- if ( arguments.length < setter ) {
3979
- return jQuery.queue( this[0], type );
3980
- }
3981
-
3982
- return data === undefined ?
3983
- this :
3984
- this.each(function() {
3985
- var queue = jQuery.queue( this, type, data );
3986
-
3987
- // ensure a hooks for this queue
3988
- jQuery._queueHooks( this, type );
3989
-
3990
- if ( type === "fx" && queue[0] !== "inprogress" ) {
3991
- jQuery.dequeue( this, type );
3992
- }
3993
- });
3994
- },
3995
- dequeue: function( type ) {
3996
- return this.each(function() {
3997
- jQuery.dequeue( this, type );
3998
- });
3999
- },
4000
- // Based off of the plugin by Clint Helfers, with permission.
4001
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
4002
- delay: function( time, type ) {
4003
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
4004
- type = type || "fx";
4005
-
4006
- return this.queue( type, function( next, hooks ) {
4007
- var timeout = setTimeout( next, time );
4008
- hooks.stop = function() {
4009
- clearTimeout( timeout );
4010
- };
4011
- });
4012
- },
4013
- clearQueue: function( type ) {
4014
- return this.queue( type || "fx", [] );
4015
- },
4016
- // Get a promise resolved when queues of a certain type
4017
- // are emptied (fx is the type by default)
4018
- promise: function( type, obj ) {
4019
- var tmp,
4020
- count = 1,
4021
- defer = jQuery.Deferred(),
4022
- elements = this,
4023
- i = this.length,
4024
- resolve = function() {
4025
- if ( !( --count ) ) {
4026
- defer.resolveWith( elements, [ elements ] );
4027
- }
4028
- };
4029
-
4030
- if ( typeof type !== "string" ) {
4031
- obj = type;
4032
- type = undefined;
4033
- }
4034
- type = type || "fx";
4035
-
4036
- while( i-- ) {
4037
- tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4038
- if ( tmp && tmp.empty ) {
4039
- count++;
4040
- tmp.empty.add( resolve );
4041
- }
4042
- }
4043
- resolve();
4044
- return defer.promise( obj );
4045
- }
4046
- });
4047
- var nodeHook, boolHook,
4048
- rclass = /[\t\r\n\f]/g,
4049
- rreturn = /\r/g,
4050
- rfocusable = /^(?:input|select|textarea|button|object)$/i,
4051
- rclickable = /^(?:a|area)$/i,
4052
- ruseDefault = /^(?:checked|selected)$/i,
4053
- getSetAttribute = jQuery.support.getSetAttribute,
4054
- getSetInput = jQuery.support.input;
4055
-
4056
- jQuery.fn.extend({
4057
- attr: function( name, value ) {
4058
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
4059
- },
4060
-
4061
- removeAttr: function( name ) {
4062
- return this.each(function() {
4063
- jQuery.removeAttr( this, name );
4064
- });
4065
- },
4066
-
4067
- prop: function( name, value ) {
4068
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
4069
- },
4070
-
4071
- removeProp: function( name ) {
4072
- name = jQuery.propFix[ name ] || name;
4073
- return this.each(function() {
4074
- // try/catch handles cases where IE balks (such as removing a property on window)
4075
- try {
4076
- this[ name ] = undefined;
4077
- delete this[ name ];
4078
- } catch( e ) {}
4079
- });
4080
- },
4081
-
4082
- addClass: function( value ) {
4083
- var classes, elem, cur, clazz, j,
4084
- i = 0,
4085
- len = this.length,
4086
- proceed = typeof value === "string" && value;
4087
-
4088
- if ( jQuery.isFunction( value ) ) {
4089
- return this.each(function( j ) {
4090
- jQuery( this ).addClass( value.call( this, j, this.className ) );
4091
- });
4092
- }
4093
-
4094
- if ( proceed ) {
4095
- // The disjunction here is for better compressibility (see removeClass)
4096
- classes = ( value || "" ).match( core_rnotwhite ) || [];
4097
-
4098
- for ( ; i < len; i++ ) {
4099
- elem = this[ i ];
4100
- cur = elem.nodeType === 1 && ( elem.className ?
4101
- ( " " + elem.className + " " ).replace( rclass, " " ) :
4102
- " "
4103
- );
4104
-
4105
- if ( cur ) {
4106
- j = 0;
4107
- while ( (clazz = classes[j++]) ) {
4108
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
4109
- cur += clazz + " ";
4110
- }
4111
- }
4112
- elem.className = jQuery.trim( cur );
4113
-
4114
- }
4115
- }
4116
- }
4117
-
4118
- return this;
4119
- },
4120
-
4121
- removeClass: function( value ) {
4122
- var classes, elem, cur, clazz, j,
4123
- i = 0,
4124
- len = this.length,
4125
- proceed = arguments.length === 0 || typeof value === "string" && value;
4126
-
4127
- if ( jQuery.isFunction( value ) ) {
4128
- return this.each(function( j ) {
4129
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
4130
- });
4131
- }
4132
- if ( proceed ) {
4133
- classes = ( value || "" ).match( core_rnotwhite ) || [];
4134
-
4135
- for ( ; i < len; i++ ) {
4136
- elem = this[ i ];
4137
- // This expression is here for better compressibility (see addClass)
4138
- cur = elem.nodeType === 1 && ( elem.className ?
4139
- ( " " + elem.className + " " ).replace( rclass, " " ) :
4140
- ""
4141
- );
4142
-
4143
- if ( cur ) {
4144
- j = 0;
4145
- while ( (clazz = classes[j++]) ) {
4146
- // Remove *all* instances
4147
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
4148
- cur = cur.replace( " " + clazz + " ", " " );
4149
- }
4150
- }
4151
- elem.className = value ? jQuery.trim( cur ) : "";
4152
- }
4153
- }
4154
- }
4155
-
4156
- return this;
4157
- },
4158
-
4159
- toggleClass: function( value, stateVal ) {
4160
- var type = typeof value;
4161
-
4162
- if ( typeof stateVal === "boolean" && type === "string" ) {
4163
- return stateVal ? this.addClass( value ) : this.removeClass( value );
4164
- }
4165
-
4166
- if ( jQuery.isFunction( value ) ) {
4167
- return this.each(function( i ) {
4168
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
4169
- });
4170
- }
4171
-
4172
- return this.each(function() {
4173
- if ( type === "string" ) {
4174
- // toggle individual class names
4175
- var className,
4176
- i = 0,
4177
- self = jQuery( this ),
4178
- classNames = value.match( core_rnotwhite ) || [];
4179
-
4180
- while ( (className = classNames[ i++ ]) ) {
4181
- // check each className given, space separated list
4182
- if ( self.hasClass( className ) ) {
4183
- self.removeClass( className );
4184
- } else {
4185
- self.addClass( className );
4186
- }
4187
- }
4188
-
4189
- // Toggle whole class name
4190
- } else if ( type === core_strundefined || type === "boolean" ) {
4191
- if ( this.className ) {
4192
- // store className if set
4193
- jQuery._data( this, "__className__", this.className );
4194
- }
4195
-
4196
- // If the element has a class name or if we're passed "false",
4197
- // then remove the whole classname (if there was one, the above saved it).
4198
- // Otherwise bring back whatever was previously saved (if anything),
4199
- // falling back to the empty string if nothing was stored.
4200
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
4201
- }
4202
- });
4203
- },
4204
-
4205
- hasClass: function( selector ) {
4206
- var className = " " + selector + " ",
4207
- i = 0,
4208
- l = this.length;
4209
- for ( ; i < l; i++ ) {
4210
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
4211
- return true;
4212
- }
4213
- }
4214
-
4215
- return false;
4216
- },
4217
-
4218
- val: function( value ) {
4219
- var ret, hooks, isFunction,
4220
- elem = this[0];
4221
-
4222
- if ( !arguments.length ) {
4223
- if ( elem ) {
4224
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
4225
-
4226
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
4227
- return ret;
4228
- }
4229
-
4230
- ret = elem.value;
4231
-
4232
- return typeof ret === "string" ?
4233
- // handle most common string cases
4234
- ret.replace(rreturn, "") :
4235
- // handle cases where value is null/undef or number
4236
- ret == null ? "" : ret;
4237
- }
4238
-
4239
- return;
4240
- }
4241
-
4242
- isFunction = jQuery.isFunction( value );
4243
-
4244
- return this.each(function( i ) {
4245
- var val;
4246
-
4247
- if ( this.nodeType !== 1 ) {
4248
- return;
4249
- }
4250
-
4251
- if ( isFunction ) {
4252
- val = value.call( this, i, jQuery( this ).val() );
4253
- } else {
4254
- val = value;
4255
- }
4256
-
4257
- // Treat null/undefined as ""; convert numbers to string
4258
- if ( val == null ) {
4259
- val = "";
4260
- } else if ( typeof val === "number" ) {
4261
- val += "";
4262
- } else if ( jQuery.isArray( val ) ) {
4263
- val = jQuery.map(val, function ( value ) {
4264
- return value == null ? "" : value + "";
4265
- });
4266
- }
4267
-
4268
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
4269
-
4270
- // If set returns undefined, fall back to normal setting
4271
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
4272
- this.value = val;
4273
- }
4274
- });
4275
- }
4276
- });
4277
-
4278
- jQuery.extend({
4279
- valHooks: {
4280
- option: {
4281
- get: function( elem ) {
4282
- // Use proper attribute retrieval(#6932, #12072)
4283
- var val = jQuery.find.attr( elem, "value" );
4284
- return val != null ?
4285
- val :
4286
- elem.text;
4287
- }
4288
- },
4289
- select: {
4290
- get: function( elem ) {
4291
- var value, option,
4292
- options = elem.options,
4293
- index = elem.selectedIndex,
4294
- one = elem.type === "select-one" || index < 0,
4295
- values = one ? null : [],
4296
- max = one ? index + 1 : options.length,
4297
- i = index < 0 ?
4298
- max :
4299
- one ? index : 0;
4300
-
4301
- // Loop through all the selected options
4302
- for ( ; i < max; i++ ) {
4303
- option = options[ i ];
4304
-
4305
- // oldIE doesn't update selected after form reset (#2551)
4306
- if ( ( option.selected || i === index ) &&
4307
- // Don't return options that are disabled or in a disabled optgroup
4308
- ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
4309
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
4310
-
4311
- // Get the specific value for the option
4312
- value = jQuery( option ).val();
4313
-
4314
- // We don't need an array for one selects
4315
- if ( one ) {
4316
- return value;
4317
- }
4318
-
4319
- // Multi-Selects return an array
4320
- values.push( value );
4321
- }
4322
- }
4323
-
4324
- return values;
4325
- },
4326
-
4327
- set: function( elem, value ) {
4328
- var optionSet, option,
4329
- options = elem.options,
4330
- values = jQuery.makeArray( value ),
4331
- i = options.length;
4332
-
4333
- while ( i-- ) {
4334
- option = options[ i ];
4335
- if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
4336
- optionSet = true;
4337
- }
4338
- }
4339
-
4340
- // force browsers to behave consistently when non-matching value is set
4341
- if ( !optionSet ) {
4342
- elem.selectedIndex = -1;
4343
- }
4344
- return values;
4345
- }
4346
- }
4347
- },
4348
-
4349
- attr: function( elem, name, value ) {
4350
- var hooks, ret,
4351
- nType = elem.nodeType;
4352
-
4353
- // don't get/set attributes on text, comment and attribute nodes
4354
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
4355
- return;
4356
- }
4357
-
4358
- // Fallback to prop when attributes are not supported
4359
- if ( typeof elem.getAttribute === core_strundefined ) {
4360
- return jQuery.prop( elem, name, value );
4361
- }
4362
-
4363
- // All attributes are lowercase
4364
- // Grab necessary hook if one is defined
4365
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
4366
- name = name.toLowerCase();
4367
- hooks = jQuery.attrHooks[ name ] ||
4368
- ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
4369
- }
4370
-
4371
- if ( value !== undefined ) {
4372
-
4373
- if ( value === null ) {
4374
- jQuery.removeAttr( elem, name );
4375
-
4376
- } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
4377
- return ret;
4378
-
4379
- } else {
4380
- elem.setAttribute( name, value + "" );
4381
- return value;
4382
- }
4383
-
4384
- } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
4385
- return ret;
4386
-
4387
- } else {
4388
- ret = jQuery.find.attr( elem, name );
4389
-
4390
- // Non-existent attributes return null, we normalize to undefined
4391
- return ret == null ?
4392
- undefined :
4393
- ret;
4394
- }
4395
- },
4396
-
4397
- removeAttr: function( elem, value ) {
4398
- var name, propName,
4399
- i = 0,
4400
- attrNames = value && value.match( core_rnotwhite );
4401
-
4402
- if ( attrNames && elem.nodeType === 1 ) {
4403
- while ( (name = attrNames[i++]) ) {
4404
- propName = jQuery.propFix[ name ] || name;
4405
-
4406
- // Boolean attributes get special treatment (#10870)
4407
- if ( jQuery.expr.match.bool.test( name ) ) {
4408
- // Set corresponding property to false
4409
- if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
4410
- elem[ propName ] = false;
4411
- // Support: IE<9
4412
- // Also clear defaultChecked/defaultSelected (if appropriate)
4413
- } else {
4414
- elem[ jQuery.camelCase( "default-" + name ) ] =
4415
- elem[ propName ] = false;
4416
- }
4417
-
4418
- // See #9699 for explanation of this approach (setting first, then removal)
4419
- } else {
4420
- jQuery.attr( elem, name, "" );
4421
- }
4422
-
4423
- elem.removeAttribute( getSetAttribute ? name : propName );
4424
- }
4425
- }
4426
- },
4427
-
4428
- attrHooks: {
4429
- type: {
4430
- set: function( elem, value ) {
4431
- if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
4432
- // Setting the type on a radio button after the value resets the value in IE6-9
4433
- // Reset value to default in case type is set after value during creation
4434
- var val = elem.value;
4435
- elem.setAttribute( "type", value );
4436
- if ( val ) {
4437
- elem.value = val;
4438
- }
4439
- return value;
4440
- }
4441
- }
4442
- }
4443
- },
4444
-
4445
- propFix: {
4446
- "for": "htmlFor",
4447
- "class": "className"
4448
- },
4449
-
4450
- prop: function( elem, name, value ) {
4451
- var ret, hooks, notxml,
4452
- nType = elem.nodeType;
4453
-
4454
- // don't get/set properties on text, comment and attribute nodes
4455
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
4456
- return;
4457
- }
4458
-
4459
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
4460
-
4461
- if ( notxml ) {
4462
- // Fix name and attach hooks
4463
- name = jQuery.propFix[ name ] || name;
4464
- hooks = jQuery.propHooks[ name ];
4465
- }
4466
-
4467
- if ( value !== undefined ) {
4468
- return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
4469
- ret :
4470
- ( elem[ name ] = value );
4471
-
4472
- } else {
4473
- return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
4474
- ret :
4475
- elem[ name ];
4476
- }
4477
- },
4478
-
4479
- propHooks: {
4480
- tabIndex: {
4481
- get: function( elem ) {
4482
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
4483
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
4484
- // Use proper attribute retrieval(#12072)
4485
- var tabindex = jQuery.find.attr( elem, "tabindex" );
4486
-
4487
- return tabindex ?
4488
- parseInt( tabindex, 10 ) :
4489
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
4490
- 0 :
4491
- -1;
4492
- }
4493
- }
4494
- }
4495
- });
4496
-
4497
- // Hooks for boolean attributes
4498
- boolHook = {
4499
- set: function( elem, value, name ) {
4500
- if ( value === false ) {
4501
- // Remove boolean attributes when set to false
4502
- jQuery.removeAttr( elem, name );
4503
- } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
4504
- // IE<8 needs the *property* name
4505
- elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
4506
-
4507
- // Use defaultChecked and defaultSelected for oldIE
4508
- } else {
4509
- elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
4510
- }
4511
-
4512
- return name;
4513
- }
4514
- };
4515
- jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
4516
- var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
4517
-
4518
- jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
4519
- function( elem, name, isXML ) {
4520
- var fn = jQuery.expr.attrHandle[ name ],
4521
- ret = isXML ?
4522
- undefined :
4523
- /* jshint eqeqeq: false */
4524
- (jQuery.expr.attrHandle[ name ] = undefined) !=
4525
- getter( elem, name, isXML ) ?
4526
-
4527
- name.toLowerCase() :
4528
- null;
4529
- jQuery.expr.attrHandle[ name ] = fn;
4530
- return ret;
4531
- } :
4532
- function( elem, name, isXML ) {
4533
- return isXML ?
4534
- undefined :
4535
- elem[ jQuery.camelCase( "default-" + name ) ] ?
4536
- name.toLowerCase() :
4537
- null;
4538
- };
4539
- });
4540
-
4541
- // fix oldIE attroperties
4542
- if ( !getSetInput || !getSetAttribute ) {
4543
- jQuery.attrHooks.value = {
4544
- set: function( elem, value, name ) {
4545
- if ( jQuery.nodeName( elem, "input" ) ) {
4546
- // Does not return so that setAttribute is also used
4547
- elem.defaultValue = value;
4548
- } else {
4549
- // Use nodeHook if defined (#1954); otherwise setAttribute is fine
4550
- return nodeHook && nodeHook.set( elem, value, name );
4551
- }
4552
- }
4553
- };
4554
- }
4555
-
4556
- // IE6/7 do not support getting/setting some attributes with get/setAttribute
4557
- if ( !getSetAttribute ) {
4558
-
4559
- // Use this for any attribute in IE6/7
4560
- // This fixes almost every IE6/7 issue
4561
- nodeHook = {
4562
- set: function( elem, value, name ) {
4563
- // Set the existing or create a new attribute node
4564
- var ret = elem.getAttributeNode( name );
4565
- if ( !ret ) {
4566
- elem.setAttributeNode(
4567
- (ret = elem.ownerDocument.createAttribute( name ))
4568
- );
4569
- }
4570
-
4571
- ret.value = value += "";
4572
-
4573
- // Break association with cloned elements by also using setAttribute (#9646)
4574
- return name === "value" || value === elem.getAttribute( name ) ?
4575
- value :
4576
- undefined;
4577
- }
4578
- };
4579
- jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
4580
- // Some attributes are constructed with empty-string values when not defined
4581
- function( elem, name, isXML ) {
4582
- var ret;
4583
- return isXML ?
4584
- undefined :
4585
- (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
4586
- ret.value :
4587
- null;
4588
- };
4589
- jQuery.valHooks.button = {
4590
- get: function( elem, name ) {
4591
- var ret = elem.getAttributeNode( name );
4592
- return ret && ret.specified ?
4593
- ret.value :
4594
- undefined;
4595
- },
4596
- set: nodeHook.set
4597
- };
4598
-
4599
- // Set contenteditable to false on removals(#10429)
4600
- // Setting to empty string throws an error as an invalid value
4601
- jQuery.attrHooks.contenteditable = {
4602
- set: function( elem, value, name ) {
4603
- nodeHook.set( elem, value === "" ? false : value, name );
4604
- }
4605
- };
4606
-
4607
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
4608
- // This is for removals
4609
- jQuery.each([ "width", "height" ], function( i, name ) {
4610
- jQuery.attrHooks[ name ] = {
4611
- set: function( elem, value ) {
4612
- if ( value === "" ) {
4613
- elem.setAttribute( name, "auto" );
4614
- return value;
4615
- }
4616
- }
4617
- };
4618
- });
4619
- }
4620
-
4621
-
4622
- // Some attributes require a special call on IE
4623
- // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
4624
- if ( !jQuery.support.hrefNormalized ) {
4625
- // href/src property should get the full normalized URL (#10299/#12915)
4626
- jQuery.each([ "href", "src" ], function( i, name ) {
4627
- jQuery.propHooks[ name ] = {
4628
- get: function( elem ) {
4629
- return elem.getAttribute( name, 4 );
4630
- }
4631
- };
4632
- });
4633
- }
4634
-
4635
- if ( !jQuery.support.style ) {
4636
- jQuery.attrHooks.style = {
4637
- get: function( elem ) {
4638
- // Return undefined in the case of empty string
4639
- // Note: IE uppercases css property names, but if we were to .toLowerCase()
4640
- // .cssText, that would destroy case senstitivity in URL's, like in "background"
4641
- return elem.style.cssText || undefined;
4642
- },
4643
- set: function( elem, value ) {
4644
- return ( elem.style.cssText = value + "" );
4645
- }
4646
- };
4647
- }
4648
-
4649
- // Safari mis-reports the default selected property of an option
4650
- // Accessing the parent's selectedIndex property fixes it
4651
- if ( !jQuery.support.optSelected ) {
4652
- jQuery.propHooks.selected = {
4653
- get: function( elem ) {
4654
- var parent = elem.parentNode;
4655
-
4656
- if ( parent ) {
4657
- parent.selectedIndex;
4658
-
4659
- // Make sure that it also works with optgroups, see #5701
4660
- if ( parent.parentNode ) {
4661
- parent.parentNode.selectedIndex;
4662
- }
4663
- }
4664
- return null;
4665
- }
4666
- };
4667
- }
4668
-
4669
- jQuery.each([
4670
- "tabIndex",
4671
- "readOnly",
4672
- "maxLength",
4673
- "cellSpacing",
4674
- "cellPadding",
4675
- "rowSpan",
4676
- "colSpan",
4677
- "useMap",
4678
- "frameBorder",
4679
- "contentEditable"
4680
- ], function() {
4681
- jQuery.propFix[ this.toLowerCase() ] = this;
4682
- });
4683
-
4684
- // IE6/7 call enctype encoding
4685
- if ( !jQuery.support.enctype ) {
4686
- jQuery.propFix.enctype = "encoding";
4687
- }
4688
-
4689
- // Radios and checkboxes getter/setter
4690
- jQuery.each([ "radio", "checkbox" ], function() {
4691
- jQuery.valHooks[ this ] = {
4692
- set: function( elem, value ) {
4693
- if ( jQuery.isArray( value ) ) {
4694
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
4695
- }
4696
- }
4697
- };
4698
- if ( !jQuery.support.checkOn ) {
4699
- jQuery.valHooks[ this ].get = function( elem ) {
4700
- // Support: Webkit
4701
- // "" is returned instead of "on" if a value isn't specified
4702
- return elem.getAttribute("value") === null ? "on" : elem.value;
4703
- };
4704
- }
4705
- });
4706
- var rformElems = /^(?:input|select|textarea)$/i,
4707
- rkeyEvent = /^key/,
4708
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
4709
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4710
- rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4711
-
4712
- function returnTrue() {
4713
- return true;
4714
- }
4715
-
4716
- function returnFalse() {
4717
- return false;
4718
- }
4719
-
4720
- function safeActiveElement() {
4721
- try {
4722
- return document.activeElement;
4723
- } catch ( err ) { }
4724
- }
4725
-
4726
- /*
4727
- * Helper functions for managing events -- not part of the public interface.
4728
- * Props to Dean Edwards' addEvent library for many of the ideas.
4729
- */
4730
- jQuery.event = {
4731
-
4732
- global: {},
4733
-
4734
- add: function( elem, types, handler, data, selector ) {
4735
- var tmp, events, t, handleObjIn,
4736
- special, eventHandle, handleObj,
4737
- handlers, type, namespaces, origType,
4738
- elemData = jQuery._data( elem );
4739
-
4740
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
4741
- if ( !elemData ) {
4742
- return;
4743
- }
4744
-
4745
- // Caller can pass in an object of custom data in lieu of the handler
4746
- if ( handler.handler ) {
4747
- handleObjIn = handler;
4748
- handler = handleObjIn.handler;
4749
- selector = handleObjIn.selector;
4750
- }
4751
-
4752
- // Make sure that the handler has a unique ID, used to find/remove it later
4753
- if ( !handler.guid ) {
4754
- handler.guid = jQuery.guid++;
4755
- }
4756
-
4757
- // Init the element's event structure and main handler, if this is the first
4758
- if ( !(events = elemData.events) ) {
4759
- events = elemData.events = {};
4760
- }
4761
- if ( !(eventHandle = elemData.handle) ) {
4762
- eventHandle = elemData.handle = function( e ) {
4763
- // Discard the second event of a jQuery.event.trigger() and
4764
- // when an event is called after a page has unloaded
4765
- return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
4766
- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4767
- undefined;
4768
- };
4769
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4770
- eventHandle.elem = elem;
4771
- }
4772
-
4773
- // Handle multiple events separated by a space
4774
- types = ( types || "" ).match( core_rnotwhite ) || [""];
4775
- t = types.length;
4776
- while ( t-- ) {
4777
- tmp = rtypenamespace.exec( types[t] ) || [];
4778
- type = origType = tmp[1];
4779
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
4780
-
4781
- // There *must* be a type, no attaching namespace-only handlers
4782
- if ( !type ) {
4783
- continue;
4784
- }
4785
-
4786
- // If event changes its type, use the special event handlers for the changed type
4787
- special = jQuery.event.special[ type ] || {};
4788
-
4789
- // If selector defined, determine special event api type, otherwise given type
4790
- type = ( selector ? special.delegateType : special.bindType ) || type;
4791
-
4792
- // Update special based on newly reset type
4793
- special = jQuery.event.special[ type ] || {};
4794
-
4795
- // handleObj is passed to all event handlers
4796
- handleObj = jQuery.extend({
4797
- type: type,
4798
- origType: origType,
4799
- data: data,
4800
- handler: handler,
4801
- guid: handler.guid,
4802
- selector: selector,
4803
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4804
- namespace: namespaces.join(".")
4805
- }, handleObjIn );
4806
-
4807
- // Init the event handler queue if we're the first
4808
- if ( !(handlers = events[ type ]) ) {
4809
- handlers = events[ type ] = [];
4810
- handlers.delegateCount = 0;
4811
-
4812
- // Only use addEventListener/attachEvent if the special events handler returns false
4813
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4814
- // Bind the global event handler to the element
4815
- if ( elem.addEventListener ) {
4816
- elem.addEventListener( type, eventHandle, false );
4817
-
4818
- } else if ( elem.attachEvent ) {
4819
- elem.attachEvent( "on" + type, eventHandle );
4820
- }
4821
- }
4822
- }
4823
-
4824
- if ( special.add ) {
4825
- special.add.call( elem, handleObj );
4826
-
4827
- if ( !handleObj.handler.guid ) {
4828
- handleObj.handler.guid = handler.guid;
4829
- }
4830
- }
4831
-
4832
- // Add to the element's handler list, delegates in front
4833
- if ( selector ) {
4834
- handlers.splice( handlers.delegateCount++, 0, handleObj );
4835
- } else {
4836
- handlers.push( handleObj );
4837
- }
4838
-
4839
- // Keep track of which events have ever been used, for event optimization
4840
- jQuery.event.global[ type ] = true;
4841
- }
4842
-
4843
- // Nullify elem to prevent memory leaks in IE
4844
- elem = null;
4845
- },
4846
-
4847
- // Detach an event or set of events from an element
4848
- remove: function( elem, types, handler, selector, mappedTypes ) {
4849
- var j, handleObj, tmp,
4850
- origCount, t, events,
4851
- special, handlers, type,
4852
- namespaces, origType,
4853
- elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4854
-
4855
- if ( !elemData || !(events = elemData.events) ) {
4856
- return;
4857
- }
4858
-
4859
- // Once for each type.namespace in types; type may be omitted
4860
- types = ( types || "" ).match( core_rnotwhite ) || [""];
4861
- t = types.length;
4862
- while ( t-- ) {
4863
- tmp = rtypenamespace.exec( types[t] ) || [];
4864
- type = origType = tmp[1];
4865
- namespaces = ( tmp[2] || "" ).split( "." ).sort();
4866
-
4867
- // Unbind all events (on this namespace, if provided) for the element
4868
- if ( !type ) {
4869
- for ( type in events ) {
4870
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4871
- }
4872
- continue;
4873
- }
4874
-
4875
- special = jQuery.event.special[ type ] || {};
4876
- type = ( selector ? special.delegateType : special.bindType ) || type;
4877
- handlers = events[ type ] || [];
4878
- tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4879
-
4880
- // Remove matching events
4881
- origCount = j = handlers.length;
4882
- while ( j-- ) {
4883
- handleObj = handlers[ j ];
4884
-
4885
- if ( ( mappedTypes || origType === handleObj.origType ) &&
4886
- ( !handler || handler.guid === handleObj.guid ) &&
4887
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
4888
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4889
- handlers.splice( j, 1 );
4890
-
4891
- if ( handleObj.selector ) {
4892
- handlers.delegateCount--;
4893
- }
4894
- if ( special.remove ) {
4895
- special.remove.call( elem, handleObj );
4896
- }
4897
- }
4898
- }
4899
-
4900
- // Remove generic event handler if we removed something and no more handlers exist
4901
- // (avoids potential for endless recursion during removal of special event handlers)
4902
- if ( origCount && !handlers.length ) {
4903
- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4904
- jQuery.removeEvent( elem, type, elemData.handle );
4905
- }
4906
-
4907
- delete events[ type ];
4908
- }
4909
- }
4910
-
4911
- // Remove the expando if it's no longer used
4912
- if ( jQuery.isEmptyObject( events ) ) {
4913
- delete elemData.handle;
4914
-
4915
- // removeData also checks for emptiness and clears the expando if empty
4916
- // so use it instead of delete
4917
- jQuery._removeData( elem, "events" );
4918
- }
4919
- },
4920
-
4921
- trigger: function( event, data, elem, onlyHandlers ) {
4922
- var handle, ontype, cur,
4923
- bubbleType, special, tmp, i,
4924
- eventPath = [ elem || document ],
4925
- type = core_hasOwn.call( event, "type" ) ? event.type : event,
4926
- namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4927
-
4928
- cur = tmp = elem = elem || document;
4929
-
4930
- // Don't do events on text and comment nodes
4931
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4932
- return;
4933
- }
4934
-
4935
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
4936
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4937
- return;
4938
- }
4939
-
4940
- if ( type.indexOf(".") >= 0 ) {
4941
- // Namespaced trigger; create a regexp to match event type in handle()
4942
- namespaces = type.split(".");
4943
- type = namespaces.shift();
4944
- namespaces.sort();
4945
- }
4946
- ontype = type.indexOf(":") < 0 && "on" + type;
4947
-
4948
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
4949
- event = event[ jQuery.expando ] ?
4950
- event :
4951
- new jQuery.Event( type, typeof event === "object" && event );
4952
-
4953
- // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4954
- event.isTrigger = onlyHandlers ? 2 : 3;
4955
- event.namespace = namespaces.join(".");
4956
- event.namespace_re = event.namespace ?
4957
- new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4958
- null;
4959
-
4960
- // Clean up the event in case it is being reused
4961
- event.result = undefined;
4962
- if ( !event.target ) {
4963
- event.target = elem;
4964
- }
4965
-
4966
- // Clone any incoming data and prepend the event, creating the handler arg list
4967
- data = data == null ?
4968
- [ event ] :
4969
- jQuery.makeArray( data, [ event ] );
4970
-
4971
- // Allow special events to draw outside the lines
4972
- special = jQuery.event.special[ type ] || {};
4973
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4974
- return;
4975
- }
4976
-
4977
- // Determine event propagation path in advance, per W3C events spec (#9951)
4978
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4979
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4980
-
4981
- bubbleType = special.delegateType || type;
4982
- if ( !rfocusMorph.test( bubbleType + type ) ) {
4983
- cur = cur.parentNode;
4984
- }
4985
- for ( ; cur; cur = cur.parentNode ) {
4986
- eventPath.push( cur );
4987
- tmp = cur;
4988
- }
4989
-
4990
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
4991
- if ( tmp === (elem.ownerDocument || document) ) {
4992
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4993
- }
4994
- }
4995
-
4996
- // Fire handlers on the event path
4997
- i = 0;
4998
- while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4999
-
5000
- event.type = i > 1 ?
5001
- bubbleType :
5002
- special.bindType || type;
5003
-
5004
- // jQuery handler
5005
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
5006
- if ( handle ) {
5007
- handle.apply( cur, data );
5008
- }
5009
-
5010
- // Native handler
5011
- handle = ontype && cur[ ontype ];
5012
- if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
5013
- event.preventDefault();
5014
- }
5015
- }
5016
- event.type = type;
5017
-
5018
- // If nobody prevented the default action, do it now
5019
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
5020
-
5021
- if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
5022
- jQuery.acceptData( elem ) ) {
5023
-
5024
- // Call a native DOM method on the target with the same name name as the event.
5025
- // Can't use an .isFunction() check here because IE6/7 fails that test.
5026
- // Don't do default actions on window, that's where global variables be (#6170)
5027
- if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
5028
-
5029
- // Don't re-trigger an onFOO event when we call its FOO() method
5030
- tmp = elem[ ontype ];
5031
-
5032
- if ( tmp ) {
5033
- elem[ ontype ] = null;
5034
- }
5035
-
5036
- // Prevent re-triggering of the same event, since we already bubbled it above
5037
- jQuery.event.triggered = type;
5038
- try {
5039
- elem[ type ]();
5040
- } catch ( e ) {
5041
- // IE<9 dies on focus/blur to hidden element (#1486,#12518)
5042
- // only reproducible on winXP IE8 native, not IE9 in IE8 mode
5043
- }
5044
- jQuery.event.triggered = undefined;
5045
-
5046
- if ( tmp ) {
5047
- elem[ ontype ] = tmp;
5048
- }
5049
- }
5050
- }
5051
- }
5052
-
5053
- return event.result;
5054
- },
5055
-
5056
- dispatch: function( event ) {
5057
-
5058
- // Make a writable jQuery.Event from the native event object
5059
- event = jQuery.event.fix( event );
5060
-
5061
- var i, ret, handleObj, matched, j,
5062
- handlerQueue = [],
5063
- args = core_slice.call( arguments ),
5064
- handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
5065
- special = jQuery.event.special[ event.type ] || {};
5066
-
5067
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
5068
- args[0] = event;
5069
- event.delegateTarget = this;
5070
-
5071
- // Call the preDispatch hook for the mapped type, and let it bail if desired
5072
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5073
- return;
5074
- }
5075
-
5076
- // Determine handlers
5077
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5078
-
5079
- // Run delegates first; they may want to stop propagation beneath us
5080
- i = 0;
5081
- while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
5082
- event.currentTarget = matched.elem;
5083
-
5084
- j = 0;
5085
- while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
5086
-
5087
- // Triggered event must either 1) have no namespace, or
5088
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
5089
- if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
5090
-
5091
- event.handleObj = handleObj;
5092
- event.data = handleObj.data;
5093
-
5094
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
5095
- .apply( matched.elem, args );
5096
-
5097
- if ( ret !== undefined ) {
5098
- if ( (event.result = ret) === false ) {
5099
- event.preventDefault();
5100
- event.stopPropagation();
5101
- }
5102
- }
5103
- }
5104
- }
5105
- }
5106
-
5107
- // Call the postDispatch hook for the mapped type
5108
- if ( special.postDispatch ) {
5109
- special.postDispatch.call( this, event );
5110
- }
5111
-
5112
- return event.result;
5113
- },
5114
-
5115
- handlers: function( event, handlers ) {
5116
- var sel, handleObj, matches, i,
5117
- handlerQueue = [],
5118
- delegateCount = handlers.delegateCount,
5119
- cur = event.target;
5120
-
5121
- // Find delegate handlers
5122
- // Black-hole SVG <use> instance trees (#13180)
5123
- // Avoid non-left-click bubbling in Firefox (#3861)
5124
- if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
5125
-
5126
- /* jshint eqeqeq: false */
5127
- for ( ; cur != this; cur = cur.parentNode || this ) {
5128
- /* jshint eqeqeq: true */
5129
-
5130
- // Don't check non-elements (#13208)
5131
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5132
- if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
5133
- matches = [];
5134
- for ( i = 0; i < delegateCount; i++ ) {
5135
- handleObj = handlers[ i ];
5136
-
5137
- // Don't conflict with Object.prototype properties (#13203)
5138
- sel = handleObj.selector + " ";
5139
-
5140
- if ( matches[ sel ] === undefined ) {
5141
- matches[ sel ] = handleObj.needsContext ?
5142
- jQuery( sel, this ).index( cur ) >= 0 :
5143
- jQuery.find( sel, this, null, [ cur ] ).length;
5144
- }
5145
- if ( matches[ sel ] ) {
5146
- matches.push( handleObj );
5147
- }
5148
- }
5149
- if ( matches.length ) {
5150
- handlerQueue.push({ elem: cur, handlers: matches });
5151
- }
5152
- }
5153
- }
5154
- }
5155
-
5156
- // Add the remaining (directly-bound) handlers
5157
- if ( delegateCount < handlers.length ) {
5158
- handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
5159
- }
5160
-
5161
- return handlerQueue;
5162
- },
5163
-
5164
- fix: function( event ) {
5165
- if ( event[ jQuery.expando ] ) {
5166
- return event;
5167
- }
5168
-
5169
- // Create a writable copy of the event object and normalize some properties
5170
- var i, prop, copy,
5171
- type = event.type,
5172
- originalEvent = event,
5173
- fixHook = this.fixHooks[ type ];
5174
-
5175
- if ( !fixHook ) {
5176
- this.fixHooks[ type ] = fixHook =
5177
- rmouseEvent.test( type ) ? this.mouseHooks :
5178
- rkeyEvent.test( type ) ? this.keyHooks :
5179
- {};
5180
- }
5181
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
5182
-
5183
- event = new jQuery.Event( originalEvent );
5184
-
5185
- i = copy.length;
5186
- while ( i-- ) {
5187
- prop = copy[ i ];
5188
- event[ prop ] = originalEvent[ prop ];
5189
- }
5190
-
5191
- // Support: IE<9
5192
- // Fix target property (#1925)
5193
- if ( !event.target ) {
5194
- event.target = originalEvent.srcElement || document;
5195
- }
5196
-
5197
- // Support: Chrome 23+, Safari?
5198
- // Target should not be a text node (#504, #13143)
5199
- if ( event.target.nodeType === 3 ) {
5200
- event.target = event.target.parentNode;
5201
- }
5202
-
5203
- // Support: IE<9
5204
- // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
5205
- event.metaKey = !!event.metaKey;
5206
-
5207
- return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
5208
- },
5209
-
5210
- // Includes some event props shared by KeyEvent and MouseEvent
5211
- props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
5212
-
5213
- fixHooks: {},
5214
-
5215
- keyHooks: {
5216
- props: "char charCode key keyCode".split(" "),
5217
- filter: function( event, original ) {
5218
-
5219
- // Add which for key events
5220
- if ( event.which == null ) {
5221
- event.which = original.charCode != null ? original.charCode : original.keyCode;
5222
- }
5223
-
5224
- return event;
5225
- }
5226
- },
5227
-
5228
- mouseHooks: {
5229
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
5230
- filter: function( event, original ) {
5231
- var body, eventDoc, doc,
5232
- button = original.button,
5233
- fromElement = original.fromElement;
5234
-
5235
- // Calculate pageX/Y if missing and clientX/Y available
5236
- if ( event.pageX == null && original.clientX != null ) {
5237
- eventDoc = event.target.ownerDocument || document;
5238
- doc = eventDoc.documentElement;
5239
- body = eventDoc.body;
5240
-
5241
- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
5242
- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
5243
- }
5244
-
5245
- // Add relatedTarget, if necessary
5246
- if ( !event.relatedTarget && fromElement ) {
5247
- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
5248
- }
5249
-
5250
- // Add which for click: 1 === left; 2 === middle; 3 === right
5251
- // Note: button is not normalized, so don't use it
5252
- if ( !event.which && button !== undefined ) {
5253
- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
5254
- }
5255
-
5256
- return event;
5257
- }
5258
- },
5259
-
5260
- special: {
5261
- load: {
5262
- // Prevent triggered image.load events from bubbling to window.load
5263
- noBubble: true
5264
- },
5265
- focus: {
5266
- // Fire native event if possible so blur/focus sequence is correct
5267
- trigger: function() {
5268
- if ( this !== safeActiveElement() && this.focus ) {
5269
- try {
5270
- this.focus();
5271
- return false;
5272
- } catch ( e ) {
5273
- // Support: IE<9
5274
- // If we error on focus to hidden element (#1486, #12518),
5275
- // let .trigger() run the handlers
5276
- }
5277
- }
5278
- },
5279
- delegateType: "focusin"
5280
- },
5281
- blur: {
5282
- trigger: function() {
5283
- if ( this === safeActiveElement() && this.blur ) {
5284
- this.blur();
5285
- return false;
5286
- }
5287
- },
5288
- delegateType: "focusout"
5289
- },
5290
- click: {
5291
- // For checkbox, fire native event so checked state will be right
5292
- trigger: function() {
5293
- if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
5294
- this.click();
5295
- return false;
5296
- }
5297
- },
5298
-
5299
- // For cross-browser consistency, don't fire native .click() on links
5300
- _default: function( event ) {
5301
- return jQuery.nodeName( event.target, "a" );
5302
- }
5303
- },
5304
-
5305
- beforeunload: {
5306
- postDispatch: function( event ) {
5307
-
5308
- // Even when returnValue equals to undefined Firefox will still show alert
5309
- if ( event.result !== undefined ) {
5310
- event.originalEvent.returnValue = event.result;
5311
- }
5312
- }
5313
- }
5314
- },
5315
-
5316
- simulate: function( type, elem, event, bubble ) {
5317
- // Piggyback on a donor event to simulate a different one.
5318
- // Fake originalEvent to avoid donor's stopPropagation, but if the
5319
- // simulated event prevents default then we do the same on the donor.
5320
- var e = jQuery.extend(
5321
- new jQuery.Event(),
5322
- event,
5323
- {
5324
- type: type,
5325
- isSimulated: true,
5326
- originalEvent: {}
5327
- }
5328
- );
5329
- if ( bubble ) {
5330
- jQuery.event.trigger( e, null, elem );
5331
- } else {
5332
- jQuery.event.dispatch.call( elem, e );
5333
- }
5334
- if ( e.isDefaultPrevented() ) {
5335
- event.preventDefault();
5336
- }
5337
- }
5338
- };
5339
-
5340
- jQuery.removeEvent = document.removeEventListener ?
5341
- function( elem, type, handle ) {
5342
- if ( elem.removeEventListener ) {
5343
- elem.removeEventListener( type, handle, false );
5344
- }
5345
- } :
5346
- function( elem, type, handle ) {
5347
- var name = "on" + type;
5348
-
5349
- if ( elem.detachEvent ) {
5350
-
5351
- // #8545, #7054, preventing memory leaks for custom events in IE6-8
5352
- // detachEvent needed property on element, by name of that event, to properly expose it to GC
5353
- if ( typeof elem[ name ] === core_strundefined ) {
5354
- elem[ name ] = null;
5355
- }
5356
-
5357
- elem.detachEvent( name, handle );
5358
- }
5359
- };
5360
-
5361
- jQuery.Event = function( src, props ) {
5362
- // Allow instantiation without the 'new' keyword
5363
- if ( !(this instanceof jQuery.Event) ) {
5364
- return new jQuery.Event( src, props );
5365
- }
5366
-
5367
- // Event object
5368
- if ( src && src.type ) {
5369
- this.originalEvent = src;
5370
- this.type = src.type;
5371
-
5372
- // Events bubbling up the document may have been marked as prevented
5373
- // by a handler lower down the tree; reflect the correct value.
5374
- this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
5375
- src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
5376
-
5377
- // Event type
5378
- } else {
5379
- this.type = src;
5380
- }
5381
-
5382
- // Put explicitly provided properties onto the event object
5383
- if ( props ) {
5384
- jQuery.extend( this, props );
5385
- }
5386
-
5387
- // Create a timestamp if incoming event doesn't have one
5388
- this.timeStamp = src && src.timeStamp || jQuery.now();
5389
-
5390
- // Mark it as fixed
5391
- this[ jQuery.expando ] = true;
5392
- };
5393
-
5394
- // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5395
- // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5396
- jQuery.Event.prototype = {
5397
- isDefaultPrevented: returnFalse,
5398
- isPropagationStopped: returnFalse,
5399
- isImmediatePropagationStopped: returnFalse,
5400
-
5401
- preventDefault: function() {
5402
- var e = this.originalEvent;
5403
-
5404
- this.isDefaultPrevented = returnTrue;
5405
- if ( !e ) {
5406
- return;
5407
- }
5408
-
5409
- // If preventDefault exists, run it on the original event
5410
- if ( e.preventDefault ) {
5411
- e.preventDefault();
5412
-
5413
- // Support: IE
5414
- // Otherwise set the returnValue property of the original event to false
5415
- } else {
5416
- e.returnValue = false;
5417
- }
5418
- },
5419
- stopPropagation: function() {
5420
- var e = this.originalEvent;
5421
-
5422
- this.isPropagationStopped = returnTrue;
5423
- if ( !e ) {
5424
- return;
5425
- }
5426
- // If stopPropagation exists, run it on the original event
5427
- if ( e.stopPropagation ) {
5428
- e.stopPropagation();
5429
- }
5430
-
5431
- // Support: IE
5432
- // Set the cancelBubble property of the original event to true
5433
- e.cancelBubble = true;
5434
- },
5435
- stopImmediatePropagation: function() {
5436
- this.isImmediatePropagationStopped = returnTrue;
5437
- this.stopPropagation();
5438
- }
5439
- };
5440
-
5441
- // Create mouseenter/leave events using mouseover/out and event-time checks
5442
- jQuery.each({
5443
- mouseenter: "mouseover",
5444
- mouseleave: "mouseout"
5445
- }, function( orig, fix ) {
5446
- jQuery.event.special[ orig ] = {
5447
- delegateType: fix,
5448
- bindType: fix,
5449
-
5450
- handle: function( event ) {
5451
- var ret,
5452
- target = this,
5453
- related = event.relatedTarget,
5454
- handleObj = event.handleObj;
5455
-
5456
- // For mousenter/leave call the handler if related is outside the target.
5457
- // NB: No relatedTarget if the mouse left/entered the browser window
5458
- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5459
- event.type = handleObj.origType;
5460
- ret = handleObj.handler.apply( this, arguments );
5461
- event.type = fix;
5462
- }
5463
- return ret;
5464
- }
5465
- };
5466
- });
5467
-
5468
- // IE submit delegation
5469
- if ( !jQuery.support.submitBubbles ) {
5470
-
5471
- jQuery.event.special.submit = {
5472
- setup: function() {
5473
- // Only need this for delegated form submit events
5474
- if ( jQuery.nodeName( this, "form" ) ) {
5475
- return false;
5476
- }
5477
-
5478
- // Lazy-add a submit handler when a descendant form may potentially be submitted
5479
- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5480
- // Node name check avoids a VML-related crash in IE (#9807)
5481
- var elem = e.target,
5482
- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5483
- if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5484
- jQuery.event.add( form, "submit._submit", function( event ) {
5485
- event._submit_bubble = true;
5486
- });
5487
- jQuery._data( form, "submitBubbles", true );
5488
- }
5489
- });
5490
- // return undefined since we don't need an event listener
5491
- },
5492
-
5493
- postDispatch: function( event ) {
5494
- // If form was submitted by the user, bubble the event up the tree
5495
- if ( event._submit_bubble ) {
5496
- delete event._submit_bubble;
5497
- if ( this.parentNode && !event.isTrigger ) {
5498
- jQuery.event.simulate( "submit", this.parentNode, event, true );
5499
- }
5500
- }
5501
- },
5502
-
5503
- teardown: function() {
5504
- // Only need this for delegated form submit events
5505
- if ( jQuery.nodeName( this, "form" ) ) {
5506
- return false;
5507
- }
5508
-
5509
- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5510
- jQuery.event.remove( this, "._submit" );
5511
- }
5512
- };
5513
- }
5514
-
5515
- // IE change delegation and checkbox/radio fix
5516
- if ( !jQuery.support.changeBubbles ) {
5517
-
5518
- jQuery.event.special.change = {
5519
-
5520
- setup: function() {
5521
-
5522
- if ( rformElems.test( this.nodeName ) ) {
5523
- // IE doesn't fire change on a check/radio until blur; trigger it on click
5524
- // after a propertychange. Eat the blur-change in special.change.handle.
5525
- // This still fires onchange a second time for check/radio after blur.
5526
- if ( this.type === "checkbox" || this.type === "radio" ) {
5527
- jQuery.event.add( this, "propertychange._change", function( event ) {
5528
- if ( event.originalEvent.propertyName === "checked" ) {
5529
- this._just_changed = true;
5530
- }
5531
- });
5532
- jQuery.event.add( this, "click._change", function( event ) {
5533
- if ( this._just_changed && !event.isTrigger ) {
5534
- this._just_changed = false;
5535
- }
5536
- // Allow triggered, simulated change events (#11500)
5537
- jQuery.event.simulate( "change", this, event, true );
5538
- });
5539
- }
5540
- return false;
5541
- }
5542
- // Delegated event; lazy-add a change handler on descendant inputs
5543
- jQuery.event.add( this, "beforeactivate._change", function( e ) {
5544
- var elem = e.target;
5545
-
5546
- if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5547
- jQuery.event.add( elem, "change._change", function( event ) {
5548
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5549
- jQuery.event.simulate( "change", this.parentNode, event, true );
5550
- }
5551
- });
5552
- jQuery._data( elem, "changeBubbles", true );
5553
- }
5554
- });
5555
- },
5556
-
5557
- handle: function( event ) {
5558
- var elem = event.target;
5559
-
5560
- // Swallow native change events from checkbox/radio, we already triggered them above
5561
- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5562
- return event.handleObj.handler.apply( this, arguments );
5563
- }
5564
- },
5565
-
5566
- teardown: function() {
5567
- jQuery.event.remove( this, "._change" );
5568
-
5569
- return !rformElems.test( this.nodeName );
5570
- }
5571
- };
5572
- }
5573
-
5574
- // Create "bubbling" focus and blur events
5575
- if ( !jQuery.support.focusinBubbles ) {
5576
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5577
-
5578
- // Attach a single capturing handler while someone wants focusin/focusout
5579
- var attaches = 0,
5580
- handler = function( event ) {
5581
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5582
- };
5583
-
5584
- jQuery.event.special[ fix ] = {
5585
- setup: function() {
5586
- if ( attaches++ === 0 ) {
5587
- document.addEventListener( orig, handler, true );
5588
- }
5589
- },
5590
- teardown: function() {
5591
- if ( --attaches === 0 ) {
5592
- document.removeEventListener( orig, handler, true );
5593
- }
5594
- }
5595
- };
5596
- });
5597
- }
5598
-
5599
- jQuery.fn.extend({
5600
-
5601
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5602
- var type, origFn;
5603
-
5604
- // Types can be a map of types/handlers
5605
- if ( typeof types === "object" ) {
5606
- // ( types-Object, selector, data )
5607
- if ( typeof selector !== "string" ) {
5608
- // ( types-Object, data )
5609
- data = data || selector;
5610
- selector = undefined;
5611
- }
5612
- for ( type in types ) {
5613
- this.on( type, selector, data, types[ type ], one );
5614
- }
5615
- return this;
5616
- }
5617
-
5618
- if ( data == null && fn == null ) {
5619
- // ( types, fn )
5620
- fn = selector;
5621
- data = selector = undefined;
5622
- } else if ( fn == null ) {
5623
- if ( typeof selector === "string" ) {
5624
- // ( types, selector, fn )
5625
- fn = data;
5626
- data = undefined;
5627
- } else {
5628
- // ( types, data, fn )
5629
- fn = data;
5630
- data = selector;
5631
- selector = undefined;
5632
- }
5633
- }
5634
- if ( fn === false ) {
5635
- fn = returnFalse;
5636
- } else if ( !fn ) {
5637
- return this;
5638
- }
5639
-
5640
- if ( one === 1 ) {
5641
- origFn = fn;
5642
- fn = function( event ) {
5643
- // Can use an empty set, since event contains the info
5644
- jQuery().off( event );
5645
- return origFn.apply( this, arguments );
5646
- };
5647
- // Use same guid so caller can remove using origFn
5648
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5649
- }
5650
- return this.each( function() {
5651
- jQuery.event.add( this, types, fn, data, selector );
5652
- });
5653
- },
5654
- one: function( types, selector, data, fn ) {
5655
- return this.on( types, selector, data, fn, 1 );
5656
- },
5657
- off: function( types, selector, fn ) {
5658
- var handleObj, type;
5659
- if ( types && types.preventDefault && types.handleObj ) {
5660
- // ( event ) dispatched jQuery.Event
5661
- handleObj = types.handleObj;
5662
- jQuery( types.delegateTarget ).off(
5663
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5664
- handleObj.selector,
5665
- handleObj.handler
5666
- );
5667
- return this;
5668
- }
5669
- if ( typeof types === "object" ) {
5670
- // ( types-object [, selector] )
5671
- for ( type in types ) {
5672
- this.off( type, selector, types[ type ] );
5673
- }
5674
- return this;
5675
- }
5676
- if ( selector === false || typeof selector === "function" ) {
5677
- // ( types [, fn] )
5678
- fn = selector;
5679
- selector = undefined;
5680
- }
5681
- if ( fn === false ) {
5682
- fn = returnFalse;
5683
- }
5684
- return this.each(function() {
5685
- jQuery.event.remove( this, types, fn, selector );
5686
- });
5687
- },
5688
-
5689
- trigger: function( type, data ) {
5690
- return this.each(function() {
5691
- jQuery.event.trigger( type, data, this );
5692
- });
5693
- },
5694
- triggerHandler: function( type, data ) {
5695
- var elem = this[0];
5696
- if ( elem ) {
5697
- return jQuery.event.trigger( type, data, elem, true );
5698
- }
5699
- }
5700
- });
5701
- var isSimple = /^.[^:#\[\.,]*$/,
5702
- rparentsprev = /^(?:parents|prev(?:Until|All))/,
5703
- rneedsContext = jQuery.expr.match.needsContext,
5704
- // methods guaranteed to produce a unique set when starting from a unique set
5705
- guaranteedUnique = {
5706
- children: true,
5707
- contents: true,
5708
- next: true,
5709
- prev: true
5710
- };
5711
-
5712
- jQuery.fn.extend({
5713
- find: function( selector ) {
5714
- var i,
5715
- ret = [],
5716
- self = this,
5717
- len = self.length;
5718
-
5719
- if ( typeof selector !== "string" ) {
5720
- return this.pushStack( jQuery( selector ).filter(function() {
5721
- for ( i = 0; i < len; i++ ) {
5722
- if ( jQuery.contains( self[ i ], this ) ) {
5723
- return true;
5724
- }
5725
- }
5726
- }) );
5727
- }
5728
-
5729
- for ( i = 0; i < len; i++ ) {
5730
- jQuery.find( selector, self[ i ], ret );
5731
- }
5732
-
5733
- // Needed because $( selector, context ) becomes $( context ).find( selector )
5734
- ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
5735
- ret.selector = this.selector ? this.selector + " " + selector : selector;
5736
- return ret;
5737
- },
5738
-
5739
- has: function( target ) {
5740
- var i,
5741
- targets = jQuery( target, this ),
5742
- len = targets.length;
5743
-
5744
- return this.filter(function() {
5745
- for ( i = 0; i < len; i++ ) {
5746
- if ( jQuery.contains( this, targets[i] ) ) {
5747
- return true;
5748
- }
5749
- }
5750
- });
5751
- },
5752
-
5753
- not: function( selector ) {
5754
- return this.pushStack( winnow(this, selector || [], true) );
5755
- },
5756
-
5757
- filter: function( selector ) {
5758
- return this.pushStack( winnow(this, selector || [], false) );
5759
- },
5760
-
5761
- is: function( selector ) {
5762
- return !!winnow(
5763
- this,
5764
-
5765
- // If this is a positional/relative selector, check membership in the returned set
5766
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
5767
- typeof selector === "string" && rneedsContext.test( selector ) ?
5768
- jQuery( selector ) :
5769
- selector || [],
5770
- false
5771
- ).length;
5772
- },
5773
-
5774
- closest: function( selectors, context ) {
5775
- var cur,
5776
- i = 0,
5777
- l = this.length,
5778
- ret = [],
5779
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
5780
- jQuery( selectors, context || this.context ) :
5781
- 0;
5782
-
5783
- for ( ; i < l; i++ ) {
5784
- for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
5785
- // Always skip document fragments
5786
- if ( cur.nodeType < 11 && (pos ?
5787
- pos.index(cur) > -1 :
5788
-
5789
- // Don't pass non-elements to Sizzle
5790
- cur.nodeType === 1 &&
5791
- jQuery.find.matchesSelector(cur, selectors)) ) {
5792
-
5793
- cur = ret.push( cur );
5794
- break;
5795
- }
5796
- }
5797
- }
5798
-
5799
- return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
5800
- },
5801
-
5802
- // Determine the position of an element within
5803
- // the matched set of elements
5804
- index: function( elem ) {
5805
-
5806
- // No argument, return index in parent
5807
- if ( !elem ) {
5808
- return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
5809
- }
5810
-
5811
- // index in selector
5812
- if ( typeof elem === "string" ) {
5813
- return jQuery.inArray( this[0], jQuery( elem ) );
5814
- }
5815
-
5816
- // Locate the position of the desired element
5817
- return jQuery.inArray(
5818
- // If it receives a jQuery object, the first element is used
5819
- elem.jquery ? elem[0] : elem, this );
5820
- },
5821
-
5822
- add: function( selector, context ) {
5823
- var set = typeof selector === "string" ?
5824
- jQuery( selector, context ) :
5825
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
5826
- all = jQuery.merge( this.get(), set );
5827
-
5828
- return this.pushStack( jQuery.unique(all) );
5829
- },
5830
-
5831
- addBack: function( selector ) {
5832
- return this.add( selector == null ?
5833
- this.prevObject : this.prevObject.filter(selector)
5834
- );
5835
- }
5836
- });
5837
-
5838
- function sibling( cur, dir ) {
5839
- do {
5840
- cur = cur[ dir ];
5841
- } while ( cur && cur.nodeType !== 1 );
5842
-
5843
- return cur;
5844
- }
5845
-
5846
- jQuery.each({
5847
- parent: function( elem ) {
5848
- var parent = elem.parentNode;
5849
- return parent && parent.nodeType !== 11 ? parent : null;
5850
- },
5851
- parents: function( elem ) {
5852
- return jQuery.dir( elem, "parentNode" );
5853
- },
5854
- parentsUntil: function( elem, i, until ) {
5855
- return jQuery.dir( elem, "parentNode", until );
5856
- },
5857
- next: function( elem ) {
5858
- return sibling( elem, "nextSibling" );
5859
- },
5860
- prev: function( elem ) {
5861
- return sibling( elem, "previousSibling" );
5862
- },
5863
- nextAll: function( elem ) {
5864
- return jQuery.dir( elem, "nextSibling" );
5865
- },
5866
- prevAll: function( elem ) {
5867
- return jQuery.dir( elem, "previousSibling" );
5868
- },
5869
- nextUntil: function( elem, i, until ) {
5870
- return jQuery.dir( elem, "nextSibling", until );
5871
- },
5872
- prevUntil: function( elem, i, until ) {
5873
- return jQuery.dir( elem, "previousSibling", until );
5874
- },
5875
- siblings: function( elem ) {
5876
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
5877
- },
5878
- children: function( elem ) {
5879
- return jQuery.sibling( elem.firstChild );
5880
- },
5881
- contents: function( elem ) {
5882
- return jQuery.nodeName( elem, "iframe" ) ?
5883
- elem.contentDocument || elem.contentWindow.document :
5884
- jQuery.merge( [], elem.childNodes );
5885
- }
5886
- }, function( name, fn ) {
5887
- jQuery.fn[ name ] = function( until, selector ) {
5888
- var ret = jQuery.map( this, fn, until );
5889
-
5890
- if ( name.slice( -5 ) !== "Until" ) {
5891
- selector = until;
5892
- }
5893
-
5894
- if ( selector && typeof selector === "string" ) {
5895
- ret = jQuery.filter( selector, ret );
5896
- }
5897
-
5898
- if ( this.length > 1 ) {
5899
- // Remove duplicates
5900
- if ( !guaranteedUnique[ name ] ) {
5901
- ret = jQuery.unique( ret );
5902
- }
5903
-
5904
- // Reverse order for parents* and prev-derivatives
5905
- if ( rparentsprev.test( name ) ) {
5906
- ret = ret.reverse();
5907
- }
5908
- }
5909
-
5910
- return this.pushStack( ret );
5911
- };
5912
- });
5913
-
5914
- jQuery.extend({
5915
- filter: function( expr, elems, not ) {
5916
- var elem = elems[ 0 ];
5917
-
5918
- if ( not ) {
5919
- expr = ":not(" + expr + ")";
5920
- }
5921
-
5922
- return elems.length === 1 && elem.nodeType === 1 ?
5923
- jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
5924
- jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
5925
- return elem.nodeType === 1;
5926
- }));
5927
- },
5928
-
5929
- dir: function( elem, dir, until ) {
5930
- var matched = [],
5931
- cur = elem[ dir ];
5932
-
5933
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
5934
- if ( cur.nodeType === 1 ) {
5935
- matched.push( cur );
5936
- }
5937
- cur = cur[dir];
5938
- }
5939
- return matched;
5940
- },
5941
-
5942
- sibling: function( n, elem ) {
5943
- var r = [];
5944
-
5945
- for ( ; n; n = n.nextSibling ) {
5946
- if ( n.nodeType === 1 && n !== elem ) {
5947
- r.push( n );
5948
- }
5949
- }
5950
-
5951
- return r;
5952
- }
5953
- });
5954
-
5955
- // Implement the identical functionality for filter and not
5956
- function winnow( elements, qualifier, not ) {
5957
- if ( jQuery.isFunction( qualifier ) ) {
5958
- return jQuery.grep( elements, function( elem, i ) {
5959
- /* jshint -W018 */
5960
- return !!qualifier.call( elem, i, elem ) !== not;
5961
- });
5962
-
5963
- }
5964
-
5965
- if ( qualifier.nodeType ) {
5966
- return jQuery.grep( elements, function( elem ) {
5967
- return ( elem === qualifier ) !== not;
5968
- });
5969
-
5970
- }
5971
-
5972
- if ( typeof qualifier === "string" ) {
5973
- if ( isSimple.test( qualifier ) ) {
5974
- return jQuery.filter( qualifier, elements, not );
5975
- }
5976
-
5977
- qualifier = jQuery.filter( qualifier, elements );
5978
- }
5979
-
5980
- return jQuery.grep( elements, function( elem ) {
5981
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
5982
- });
5983
- }
5984
- function createSafeFragment( document ) {
5985
- var list = nodeNames.split( "|" ),
5986
- safeFrag = document.createDocumentFragment();
5987
-
5988
- if ( safeFrag.createElement ) {
5989
- while ( list.length ) {
5990
- safeFrag.createElement(
5991
- list.pop()
5992
- );
5993
- }
5994
- }
5995
- return safeFrag;
5996
- }
5997
-
5998
- var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5999
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
6000
- rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
6001
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
6002
- rleadingWhitespace = /^\s+/,
6003
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
6004
- rtagName = /<([\w:]+)/,
6005
- rtbody = /<tbody/i,
6006
- rhtml = /<|&#?\w+;/,
6007
- rnoInnerhtml = /<(?:script|style|link)/i,
6008
- manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
6009
- // checked="checked" or checked
6010
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
6011
- rscriptType = /^$|\/(?:java|ecma)script/i,
6012
- rscriptTypeMasked = /^true\/(.*)/,
6013
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
6014
-
6015
- // We have to close these tags to support XHTML (#13200)
6016
- wrapMap = {
6017
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
6018
- legend: [ 1, "<fieldset>", "</fieldset>" ],
6019
- area: [ 1, "<map>", "</map>" ],
6020
- param: [ 1, "<object>", "</object>" ],
6021
- thead: [ 1, "<table>", "</table>" ],
6022
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
6023
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
6024
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
6025
-
6026
- // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
6027
- // unless wrapped in a div with non-breaking characters in front of it.
6028
- _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
6029
- },
6030
- safeFragment = createSafeFragment( document ),
6031
- fragmentDiv = safeFragment.appendChild( document.createElement("div") );
6032
-
6033
- wrapMap.optgroup = wrapMap.option;
6034
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
6035
- wrapMap.th = wrapMap.td;
6036
-
6037
- jQuery.fn.extend({
6038
- text: function( value ) {
6039
- return jQuery.access( this, function( value ) {
6040
- return value === undefined ?
6041
- jQuery.text( this ) :
6042
- this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
6043
- }, null, value, arguments.length );
6044
- },
6045
-
6046
- append: function() {
6047
- return this.domManip( arguments, function( elem ) {
6048
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6049
- var target = manipulationTarget( this, elem );
6050
- target.appendChild( elem );
6051
- }
6052
- });
6053
- },
6054
-
6055
- prepend: function() {
6056
- return this.domManip( arguments, function( elem ) {
6057
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6058
- var target = manipulationTarget( this, elem );
6059
- target.insertBefore( elem, target.firstChild );
6060
- }
6061
- });
6062
- },
6063
-
6064
- before: function() {
6065
- return this.domManip( arguments, function( elem ) {
6066
- if ( this.parentNode ) {
6067
- this.parentNode.insertBefore( elem, this );
6068
- }
6069
- });
6070
- },
6071
-
6072
- after: function() {
6073
- return this.domManip( arguments, function( elem ) {
6074
- if ( this.parentNode ) {
6075
- this.parentNode.insertBefore( elem, this.nextSibling );
6076
- }
6077
- });
6078
- },
6079
-
6080
- // keepData is for internal use only--do not document
6081
- remove: function( selector, keepData ) {
6082
- var elem,
6083
- elems = selector ? jQuery.filter( selector, this ) : this,
6084
- i = 0;
6085
-
6086
- for ( ; (elem = elems[i]) != null; i++ ) {
6087
-
6088
- if ( !keepData && elem.nodeType === 1 ) {
6089
- jQuery.cleanData( getAll( elem ) );
6090
- }
6091
-
6092
- if ( elem.parentNode ) {
6093
- if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
6094
- setGlobalEval( getAll( elem, "script" ) );
6095
- }
6096
- elem.parentNode.removeChild( elem );
6097
- }
6098
- }
6099
-
6100
- return this;
6101
- },
6102
-
6103
- empty: function() {
6104
- var elem,
6105
- i = 0;
6106
-
6107
- for ( ; (elem = this[i]) != null; i++ ) {
6108
- // Remove element nodes and prevent memory leaks
6109
- if ( elem.nodeType === 1 ) {
6110
- jQuery.cleanData( getAll( elem, false ) );
6111
- }
6112
-
6113
- // Remove any remaining nodes
6114
- while ( elem.firstChild ) {
6115
- elem.removeChild( elem.firstChild );
6116
- }
6117
-
6118
- // If this is a select, ensure that it displays empty (#12336)
6119
- // Support: IE<9
6120
- if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
6121
- elem.options.length = 0;
6122
- }
6123
- }
6124
-
6125
- return this;
6126
- },
6127
-
6128
- clone: function( dataAndEvents, deepDataAndEvents ) {
6129
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6130
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6131
-
6132
- return this.map( function () {
6133
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6134
- });
6135
- },
6136
-
6137
- html: function( value ) {
6138
- return jQuery.access( this, function( value ) {
6139
- var elem = this[0] || {},
6140
- i = 0,
6141
- l = this.length;
6142
-
6143
- if ( value === undefined ) {
6144
- return elem.nodeType === 1 ?
6145
- elem.innerHTML.replace( rinlinejQuery, "" ) :
6146
- undefined;
6147
- }
6148
-
6149
- // See if we can take a shortcut and just use innerHTML
6150
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6151
- ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
6152
- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
6153
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
6154
-
6155
- value = value.replace( rxhtmlTag, "<$1></$2>" );
6156
-
6157
- try {
6158
- for (; i < l; i++ ) {
6159
- // Remove element nodes and prevent memory leaks
6160
- elem = this[i] || {};
6161
- if ( elem.nodeType === 1 ) {
6162
- jQuery.cleanData( getAll( elem, false ) );
6163
- elem.innerHTML = value;
6164
- }
6165
- }
6166
-
6167
- elem = 0;
6168
-
6169
- // If using innerHTML throws an exception, use the fallback method
6170
- } catch(e) {}
6171
- }
6172
-
6173
- if ( elem ) {
6174
- this.empty().append( value );
6175
- }
6176
- }, null, value, arguments.length );
6177
- },
6178
-
6179
- replaceWith: function() {
6180
- var
6181
- // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
6182
- args = jQuery.map( this, function( elem ) {
6183
- return [ elem.nextSibling, elem.parentNode ];
6184
- }),
6185
- i = 0;
6186
-
6187
- // Make the changes, replacing each context element with the new content
6188
- this.domManip( arguments, function( elem ) {
6189
- var next = args[ i++ ],
6190
- parent = args[ i++ ];
6191
-
6192
- if ( parent ) {
6193
- // Don't use the snapshot next if it has moved (#13810)
6194
- if ( next && next.parentNode !== parent ) {
6195
- next = this.nextSibling;
6196
- }
6197
- jQuery( this ).remove();
6198
- parent.insertBefore( elem, next );
6199
- }
6200
- // Allow new content to include elements from the context set
6201
- }, true );
6202
-
6203
- // Force removal if there was no new content (e.g., from empty arguments)
6204
- return i ? this : this.remove();
6205
- },
6206
-
6207
- detach: function( selector ) {
6208
- return this.remove( selector, true );
6209
- },
6210
-
6211
- domManip: function( args, callback, allowIntersection ) {
6212
-
6213
- // Flatten any nested arrays
6214
- args = core_concat.apply( [], args );
6215
-
6216
- var first, node, hasScripts,
6217
- scripts, doc, fragment,
6218
- i = 0,
6219
- l = this.length,
6220
- set = this,
6221
- iNoClone = l - 1,
6222
- value = args[0],
6223
- isFunction = jQuery.isFunction( value );
6224
-
6225
- // We can't cloneNode fragments that contain checked, in WebKit
6226
- if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
6227
- return this.each(function( index ) {
6228
- var self = set.eq( index );
6229
- if ( isFunction ) {
6230
- args[0] = value.call( this, index, self.html() );
6231
- }
6232
- self.domManip( args, callback, allowIntersection );
6233
- });
6234
- }
6235
-
6236
- if ( l ) {
6237
- fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
6238
- first = fragment.firstChild;
6239
-
6240
- if ( fragment.childNodes.length === 1 ) {
6241
- fragment = first;
6242
- }
6243
-
6244
- if ( first ) {
6245
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
6246
- hasScripts = scripts.length;
6247
-
6248
- // Use the original fragment for the last item instead of the first because it can end up
6249
- // being emptied incorrectly in certain situations (#8070).
6250
- for ( ; i < l; i++ ) {
6251
- node = fragment;
6252
-
6253
- if ( i !== iNoClone ) {
6254
- node = jQuery.clone( node, true, true );
6255
-
6256
- // Keep references to cloned scripts for later restoration
6257
- if ( hasScripts ) {
6258
- jQuery.merge( scripts, getAll( node, "script" ) );
6259
- }
6260
- }
6261
-
6262
- callback.call( this[i], node, i );
6263
- }
6264
-
6265
- if ( hasScripts ) {
6266
- doc = scripts[ scripts.length - 1 ].ownerDocument;
6267
-
6268
- // Reenable scripts
6269
- jQuery.map( scripts, restoreScript );
6270
-
6271
- // Evaluate executable scripts on first document insertion
6272
- for ( i = 0; i < hasScripts; i++ ) {
6273
- node = scripts[ i ];
6274
- if ( rscriptType.test( node.type || "" ) &&
6275
- !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
6276
-
6277
- if ( node.src ) {
6278
- // Hope ajax is available...
6279
- jQuery._evalUrl( node.src );
6280
- } else {
6281
- jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
6282
- }
6283
- }
6284
- }
6285
- }
6286
-
6287
- // Fix #11809: Avoid leaking memory
6288
- fragment = first = null;
6289
- }
6290
- }
6291
-
6292
- return this;
6293
- }
6294
- });
6295
-
6296
- // Support: IE<8
6297
- // Manipulating tables requires a tbody
6298
- function manipulationTarget( elem, content ) {
6299
- return jQuery.nodeName( elem, "table" ) &&
6300
- jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
6301
-
6302
- elem.getElementsByTagName("tbody")[0] ||
6303
- elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
6304
- elem;
6305
- }
6306
-
6307
- // Replace/restore the type attribute of script elements for safe DOM manipulation
6308
- function disableScript( elem ) {
6309
- elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
6310
- return elem;
6311
- }
6312
- function restoreScript( elem ) {
6313
- var match = rscriptTypeMasked.exec( elem.type );
6314
- if ( match ) {
6315
- elem.type = match[1];
6316
- } else {
6317
- elem.removeAttribute("type");
6318
- }
6319
- return elem;
6320
- }
6321
-
6322
- // Mark scripts as having already been evaluated
6323
- function setGlobalEval( elems, refElements ) {
6324
- var elem,
6325
- i = 0;
6326
- for ( ; (elem = elems[i]) != null; i++ ) {
6327
- jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
6328
- }
6329
- }
6330
-
6331
- function cloneCopyEvent( src, dest ) {
6332
-
6333
- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
6334
- return;
6335
- }
6336
-
6337
- var type, i, l,
6338
- oldData = jQuery._data( src ),
6339
- curData = jQuery._data( dest, oldData ),
6340
- events = oldData.events;
6341
-
6342
- if ( events ) {
6343
- delete curData.handle;
6344
- curData.events = {};
6345
-
6346
- for ( type in events ) {
6347
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6348
- jQuery.event.add( dest, type, events[ type ][ i ] );
6349
- }
6350
- }
6351
- }
6352
-
6353
- // make the cloned public data object a copy from the original
6354
- if ( curData.data ) {
6355
- curData.data = jQuery.extend( {}, curData.data );
6356
- }
6357
- }
6358
-
6359
- function fixCloneNodeIssues( src, dest ) {
6360
- var nodeName, e, data;
6361
-
6362
- // We do not need to do anything for non-Elements
6363
- if ( dest.nodeType !== 1 ) {
6364
- return;
6365
- }
6366
-
6367
- nodeName = dest.nodeName.toLowerCase();
6368
-
6369
- // IE6-8 copies events bound via attachEvent when using cloneNode.
6370
- if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
6371
- data = jQuery._data( dest );
6372
-
6373
- for ( e in data.events ) {
6374
- jQuery.removeEvent( dest, e, data.handle );
6375
- }
6376
-
6377
- // Event data gets referenced instead of copied if the expando gets copied too
6378
- dest.removeAttribute( jQuery.expando );
6379
- }
6380
-
6381
- // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
6382
- if ( nodeName === "script" && dest.text !== src.text ) {
6383
- disableScript( dest ).text = src.text;
6384
- restoreScript( dest );
6385
-
6386
- // IE6-10 improperly clones children of object elements using classid.
6387
- // IE10 throws NoModificationAllowedError if parent is null, #12132.
6388
- } else if ( nodeName === "object" ) {
6389
- if ( dest.parentNode ) {
6390
- dest.outerHTML = src.outerHTML;
6391
- }
6392
-
6393
- // This path appears unavoidable for IE9. When cloning an object
6394
- // element in IE9, the outerHTML strategy above is not sufficient.
6395
- // If the src has innerHTML and the destination does not,
6396
- // copy the src.innerHTML into the dest.innerHTML. #10324
6397
- if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
6398
- dest.innerHTML = src.innerHTML;
6399
- }
6400
-
6401
- } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
6402
- // IE6-8 fails to persist the checked state of a cloned checkbox
6403
- // or radio button. Worse, IE6-7 fail to give the cloned element
6404
- // a checked appearance if the defaultChecked value isn't also set
6405
-
6406
- dest.defaultChecked = dest.checked = src.checked;
6407
-
6408
- // IE6-7 get confused and end up setting the value of a cloned
6409
- // checkbox/radio button to an empty string instead of "on"
6410
- if ( dest.value !== src.value ) {
6411
- dest.value = src.value;
6412
- }
6413
-
6414
- // IE6-8 fails to return the selected option to the default selected
6415
- // state when cloning options
6416
- } else if ( nodeName === "option" ) {
6417
- dest.defaultSelected = dest.selected = src.defaultSelected;
6418
-
6419
- // IE6-8 fails to set the defaultValue to the correct value when
6420
- // cloning other types of input fields
6421
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
6422
- dest.defaultValue = src.defaultValue;
6423
- }
6424
- }
6425
-
6426
- jQuery.each({
6427
- appendTo: "append",
6428
- prependTo: "prepend",
6429
- insertBefore: "before",
6430
- insertAfter: "after",
6431
- replaceAll: "replaceWith"
6432
- }, function( name, original ) {
6433
- jQuery.fn[ name ] = function( selector ) {
6434
- var elems,
6435
- i = 0,
6436
- ret = [],
6437
- insert = jQuery( selector ),
6438
- last = insert.length - 1;
6439
-
6440
- for ( ; i <= last; i++ ) {
6441
- elems = i === last ? this : this.clone(true);
6442
- jQuery( insert[i] )[ original ]( elems );
6443
-
6444
- // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6445
- core_push.apply( ret, elems.get() );
6446
- }
6447
-
6448
- return this.pushStack( ret );
6449
- };
6450
- });
6451
-
6452
- function getAll( context, tag ) {
6453
- var elems, elem,
6454
- i = 0,
6455
- found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
6456
- typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
6457
- undefined;
6458
-
6459
- if ( !found ) {
6460
- for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
6461
- if ( !tag || jQuery.nodeName( elem, tag ) ) {
6462
- found.push( elem );
6463
- } else {
6464
- jQuery.merge( found, getAll( elem, tag ) );
6465
- }
6466
- }
6467
- }
6468
-
6469
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
6470
- jQuery.merge( [ context ], found ) :
6471
- found;
6472
- }
6473
-
6474
- // Used in buildFragment, fixes the defaultChecked property
6475
- function fixDefaultChecked( elem ) {
6476
- if ( manipulation_rcheckableType.test( elem.type ) ) {
6477
- elem.defaultChecked = elem.checked;
6478
- }
6479
- }
6480
-
6481
- jQuery.extend({
6482
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6483
- var destElements, node, clone, i, srcElements,
6484
- inPage = jQuery.contains( elem.ownerDocument, elem );
6485
-
6486
- if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
6487
- clone = elem.cloneNode( true );
6488
-
6489
- // IE<=8 does not properly clone detached, unknown element nodes
6490
- } else {
6491
- fragmentDiv.innerHTML = elem.outerHTML;
6492
- fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
6493
- }
6494
-
6495
- if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
6496
- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
6497
-
6498
- // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
6499
- destElements = getAll( clone );
6500
- srcElements = getAll( elem );
6501
-
6502
- // Fix all IE cloning issues
6503
- for ( i = 0; (node = srcElements[i]) != null; ++i ) {
6504
- // Ensure that the destination node is not null; Fixes #9587
6505
- if ( destElements[i] ) {
6506
- fixCloneNodeIssues( node, destElements[i] );
6507
- }
6508
- }
6509
- }
6510
-
6511
- // Copy the events from the original to the clone
6512
- if ( dataAndEvents ) {
6513
- if ( deepDataAndEvents ) {
6514
- srcElements = srcElements || getAll( elem );
6515
- destElements = destElements || getAll( clone );
6516
-
6517
- for ( i = 0; (node = srcElements[i]) != null; i++ ) {
6518
- cloneCopyEvent( node, destElements[i] );
6519
- }
6520
- } else {
6521
- cloneCopyEvent( elem, clone );
6522
- }
6523
- }
6524
-
6525
- // Preserve script evaluation history
6526
- destElements = getAll( clone, "script" );
6527
- if ( destElements.length > 0 ) {
6528
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6529
- }
6530
-
6531
- destElements = srcElements = node = null;
6532
-
6533
- // Return the cloned set
6534
- return clone;
6535
- },
6536
-
6537
- buildFragment: function( elems, context, scripts, selection ) {
6538
- var j, elem, contains,
6539
- tmp, tag, tbody, wrap,
6540
- l = elems.length,
6541
-
6542
- // Ensure a safe fragment
6543
- safe = createSafeFragment( context ),
6544
-
6545
- nodes = [],
6546
- i = 0;
6547
-
6548
- for ( ; i < l; i++ ) {
6549
- elem = elems[ i ];
6550
-
6551
- if ( elem || elem === 0 ) {
6552
-
6553
- // Add nodes directly
6554
- if ( jQuery.type( elem ) === "object" ) {
6555
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
6556
-
6557
- // Convert non-html into a text node
6558
- } else if ( !rhtml.test( elem ) ) {
6559
- nodes.push( context.createTextNode( elem ) );
6560
-
6561
- // Convert html into DOM nodes
6562
- } else {
6563
- tmp = tmp || safe.appendChild( context.createElement("div") );
6564
-
6565
- // Deserialize a standard representation
6566
- tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
6567
- wrap = wrapMap[ tag ] || wrapMap._default;
6568
-
6569
- tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
6570
-
6571
- // Descend through wrappers to the right content
6572
- j = wrap[0];
6573
- while ( j-- ) {
6574
- tmp = tmp.lastChild;
6575
- }
6576
-
6577
- // Manually add leading whitespace removed by IE
6578
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
6579
- nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
6580
- }
6581
-
6582
- // Remove IE's autoinserted <tbody> from table fragments
6583
- if ( !jQuery.support.tbody ) {
6584
-
6585
- // String was a <table>, *may* have spurious <tbody>
6586
- elem = tag === "table" && !rtbody.test( elem ) ?
6587
- tmp.firstChild :
6588
-
6589
- // String was a bare <thead> or <tfoot>
6590
- wrap[1] === "<table>" && !rtbody.test( elem ) ?
6591
- tmp :
6592
- 0;
6593
-
6594
- j = elem && elem.childNodes.length;
6595
- while ( j-- ) {
6596
- if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
6597
- elem.removeChild( tbody );
6598
- }
6599
- }
6600
- }
6601
-
6602
- jQuery.merge( nodes, tmp.childNodes );
6603
-
6604
- // Fix #12392 for WebKit and IE > 9
6605
- tmp.textContent = "";
6606
-
6607
- // Fix #12392 for oldIE
6608
- while ( tmp.firstChild ) {
6609
- tmp.removeChild( tmp.firstChild );
6610
- }
6611
-
6612
- // Remember the top-level container for proper cleanup
6613
- tmp = safe.lastChild;
6614
- }
6615
- }
6616
- }
6617
-
6618
- // Fix #11356: Clear elements from fragment
6619
- if ( tmp ) {
6620
- safe.removeChild( tmp );
6621
- }
6622
-
6623
- // Reset defaultChecked for any radios and checkboxes
6624
- // about to be appended to the DOM in IE 6/7 (#8060)
6625
- if ( !jQuery.support.appendChecked ) {
6626
- jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
6627
- }
6628
-
6629
- i = 0;
6630
- while ( (elem = nodes[ i++ ]) ) {
6631
-
6632
- // #4087 - If origin and destination elements are the same, and this is
6633
- // that element, do not do anything
6634
- if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
6635
- continue;
6636
- }
6637
-
6638
- contains = jQuery.contains( elem.ownerDocument, elem );
6639
-
6640
- // Append to fragment
6641
- tmp = getAll( safe.appendChild( elem ), "script" );
6642
-
6643
- // Preserve script evaluation history
6644
- if ( contains ) {
6645
- setGlobalEval( tmp );
6646
- }
6647
-
6648
- // Capture executables
6649
- if ( scripts ) {
6650
- j = 0;
6651
- while ( (elem = tmp[ j++ ]) ) {
6652
- if ( rscriptType.test( elem.type || "" ) ) {
6653
- scripts.push( elem );
6654
- }
6655
- }
6656
- }
6657
- }
6658
-
6659
- tmp = null;
6660
-
6661
- return safe;
6662
- },
6663
-
6664
- cleanData: function( elems, /* internal */ acceptData ) {
6665
- var elem, type, id, data,
6666
- i = 0,
6667
- internalKey = jQuery.expando,
6668
- cache = jQuery.cache,
6669
- deleteExpando = jQuery.support.deleteExpando,
6670
- special = jQuery.event.special;
6671
-
6672
- for ( ; (elem = elems[i]) != null; i++ ) {
6673
-
6674
- if ( acceptData || jQuery.acceptData( elem ) ) {
6675
-
6676
- id = elem[ internalKey ];
6677
- data = id && cache[ id ];
6678
-
6679
- if ( data ) {
6680
- if ( data.events ) {
6681
- for ( type in data.events ) {
6682
- if ( special[ type ] ) {
6683
- jQuery.event.remove( elem, type );
6684
-
6685
- // This is a shortcut to avoid jQuery.event.remove's overhead
6686
- } else {
6687
- jQuery.removeEvent( elem, type, data.handle );
6688
- }
6689
- }
6690
- }
6691
-
6692
- // Remove cache only if it was not already removed by jQuery.event.remove
6693
- if ( cache[ id ] ) {
6694
-
6695
- delete cache[ id ];
6696
-
6697
- // IE does not allow us to delete expando properties from nodes,
6698
- // nor does it have a removeAttribute function on Document nodes;
6699
- // we must handle all of these cases
6700
- if ( deleteExpando ) {
6701
- delete elem[ internalKey ];
6702
-
6703
- } else if ( typeof elem.removeAttribute !== core_strundefined ) {
6704
- elem.removeAttribute( internalKey );
6705
-
6706
- } else {
6707
- elem[ internalKey ] = null;
6708
- }
6709
-
6710
- core_deletedIds.push( id );
6711
- }
6712
- }
6713
- }
6714
- }
6715
- },
6716
-
6717
- _evalUrl: function( url ) {
6718
- return jQuery.ajax({
6719
- url: url,
6720
- type: "GET",
6721
- dataType: "script",
6722
- async: false,
6723
- global: false,
6724
- "throws": true
6725
- });
6726
- }
6727
- });
6728
- jQuery.fn.extend({
6729
- wrapAll: function( html ) {
6730
- if ( jQuery.isFunction( html ) ) {
6731
- return this.each(function(i) {
6732
- jQuery(this).wrapAll( html.call(this, i) );
6733
- });
6734
- }
6735
-
6736
- if ( this[0] ) {
6737
- // The elements to wrap the target around
6738
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
6739
-
6740
- if ( this[0].parentNode ) {
6741
- wrap.insertBefore( this[0] );
6742
- }
6743
-
6744
- wrap.map(function() {
6745
- var elem = this;
6746
-
6747
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
6748
- elem = elem.firstChild;
6749
- }
6750
-
6751
- return elem;
6752
- }).append( this );
6753
- }
6754
-
6755
- return this;
6756
- },
6757
-
6758
- wrapInner: function( html ) {
6759
- if ( jQuery.isFunction( html ) ) {
6760
- return this.each(function(i) {
6761
- jQuery(this).wrapInner( html.call(this, i) );
6762
- });
6763
- }
6764
-
6765
- return this.each(function() {
6766
- var self = jQuery( this ),
6767
- contents = self.contents();
6768
-
6769
- if ( contents.length ) {
6770
- contents.wrapAll( html );
6771
-
6772
- } else {
6773
- self.append( html );
6774
- }
6775
- });
6776
- },
6777
-
6778
- wrap: function( html ) {
6779
- var isFunction = jQuery.isFunction( html );
6780
-
6781
- return this.each(function(i) {
6782
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
6783
- });
6784
- },
6785
-
6786
- unwrap: function() {
6787
- return this.parent().each(function() {
6788
- if ( !jQuery.nodeName( this, "body" ) ) {
6789
- jQuery( this ).replaceWith( this.childNodes );
6790
- }
6791
- }).end();
6792
- }
6793
- });
6794
- var iframe, getStyles, curCSS,
6795
- ralpha = /alpha\([^)]*\)/i,
6796
- ropacity = /opacity\s*=\s*([^)]*)/,
6797
- rposition = /^(top|right|bottom|left)$/,
6798
- // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6799
- // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6800
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6801
- rmargin = /^margin/,
6802
- rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
6803
- rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
6804
- rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
6805
- elemdisplay = { BODY: "block" },
6806
-
6807
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6808
- cssNormalTransform = {
6809
- letterSpacing: 0,
6810
- fontWeight: 400
6811
- },
6812
-
6813
- cssExpand = [ "Top", "Right", "Bottom", "Left" ],
6814
- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6815
-
6816
- // return a css property mapped to a potentially vendor prefixed property
6817
- function vendorPropName( style, name ) {
6818
-
6819
- // shortcut for names that are not vendor prefixed
6820
- if ( name in style ) {
6821
- return name;
6822
- }
6823
-
6824
- // check for vendor prefixed names
6825
- var capName = name.charAt(0).toUpperCase() + name.slice(1),
6826
- origName = name,
6827
- i = cssPrefixes.length;
6828
-
6829
- while ( i-- ) {
6830
- name = cssPrefixes[ i ] + capName;
6831
- if ( name in style ) {
6832
- return name;
6833
- }
6834
- }
6835
-
6836
- return origName;
6837
- }
6838
-
6839
- function isHidden( elem, el ) {
6840
- // isHidden might be called from jQuery#filter function;
6841
- // in that case, element will be second argument
6842
- elem = el || elem;
6843
- return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
6844
- }
6845
-
6846
- function showHide( elements, show ) {
6847
- var display, elem, hidden,
6848
- values = [],
6849
- index = 0,
6850
- length = elements.length;
6851
-
6852
- for ( ; index < length; index++ ) {
6853
- elem = elements[ index ];
6854
- if ( !elem.style ) {
6855
- continue;
6856
- }
6857
-
6858
- values[ index ] = jQuery._data( elem, "olddisplay" );
6859
- display = elem.style.display;
6860
- if ( show ) {
6861
- // Reset the inline display of this element to learn if it is
6862
- // being hidden by cascaded rules or not
6863
- if ( !values[ index ] && display === "none" ) {
6864
- elem.style.display = "";
6865
- }
6866
-
6867
- // Set elements which have been overridden with display: none
6868
- // in a stylesheet to whatever the default browser style is
6869
- // for such an element
6870
- if ( elem.style.display === "" && isHidden( elem ) ) {
6871
- values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
6872
- }
6873
- } else {
6874
-
6875
- if ( !values[ index ] ) {
6876
- hidden = isHidden( elem );
6877
-
6878
- if ( display && display !== "none" || !hidden ) {
6879
- jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6880
- }
6881
- }
6882
- }
6883
- }
6884
-
6885
- // Set the display of most of the elements in a second loop
6886
- // to avoid the constant reflow
6887
- for ( index = 0; index < length; index++ ) {
6888
- elem = elements[ index ];
6889
- if ( !elem.style ) {
6890
- continue;
6891
- }
6892
- if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6893
- elem.style.display = show ? values[ index ] || "" : "none";
6894
- }
6895
- }
6896
-
6897
- return elements;
6898
- }
6899
-
6900
- jQuery.fn.extend({
6901
- css: function( name, value ) {
6902
- return jQuery.access( this, function( elem, name, value ) {
6903
- var len, styles,
6904
- map = {},
6905
- i = 0;
6906
-
6907
- if ( jQuery.isArray( name ) ) {
6908
- styles = getStyles( elem );
6909
- len = name.length;
6910
-
6911
- for ( ; i < len; i++ ) {
6912
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6913
- }
6914
-
6915
- return map;
6916
- }
6917
-
6918
- return value !== undefined ?
6919
- jQuery.style( elem, name, value ) :
6920
- jQuery.css( elem, name );
6921
- }, name, value, arguments.length > 1 );
6922
- },
6923
- show: function() {
6924
- return showHide( this, true );
6925
- },
6926
- hide: function() {
6927
- return showHide( this );
6928
- },
6929
- toggle: function( state ) {
6930
- if ( typeof state === "boolean" ) {
6931
- return state ? this.show() : this.hide();
6932
- }
6933
-
6934
- return this.each(function() {
6935
- if ( isHidden( this ) ) {
6936
- jQuery( this ).show();
6937
- } else {
6938
- jQuery( this ).hide();
6939
- }
6940
- });
6941
- }
6942
- });
6943
-
6944
- jQuery.extend({
6945
- // Add in style property hooks for overriding the default
6946
- // behavior of getting and setting a style property
6947
- cssHooks: {
6948
- opacity: {
6949
- get: function( elem, computed ) {
6950
- if ( computed ) {
6951
- // We should always get a number back from opacity
6952
- var ret = curCSS( elem, "opacity" );
6953
- return ret === "" ? "1" : ret;
6954
- }
6955
- }
6956
- }
6957
- },
6958
-
6959
- // Don't automatically add "px" to these possibly-unitless properties
6960
- cssNumber: {
6961
- "columnCount": true,
6962
- "fillOpacity": true,
6963
- "fontWeight": true,
6964
- "lineHeight": true,
6965
- "opacity": true,
6966
- "order": true,
6967
- "orphans": true,
6968
- "widows": true,
6969
- "zIndex": true,
6970
- "zoom": true
6971
- },
6972
-
6973
- // Add in properties whose names you wish to fix before
6974
- // setting or getting the value
6975
- cssProps: {
6976
- // normalize float css property
6977
- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
6978
- },
6979
-
6980
- // Get and set the style property on a DOM Node
6981
- style: function( elem, name, value, extra ) {
6982
- // Don't set styles on text and comment nodes
6983
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6984
- return;
6985
- }
6986
-
6987
- // Make sure that we're working with the right name
6988
- var ret, type, hooks,
6989
- origName = jQuery.camelCase( name ),
6990
- style = elem.style;
6991
-
6992
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6993
-
6994
- // gets hook for the prefixed version
6995
- // followed by the unprefixed version
6996
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6997
-
6998
- // Check if we're setting a value
6999
- if ( value !== undefined ) {
7000
- type = typeof value;
7001
-
7002
- // convert relative number strings (+= or -=) to relative numbers. #7345
7003
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
7004
- value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
7005
- // Fixes bug #9237
7006
- type = "number";
7007
- }
7008
-
7009
- // Make sure that NaN and null values aren't set. See: #7116
7010
- if ( value == null || type === "number" && isNaN( value ) ) {
7011
- return;
7012
- }
7013
-
7014
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
7015
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
7016
- value += "px";
7017
- }
7018
-
7019
- // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
7020
- // but it would mean to define eight (for every problematic property) identical functions
7021
- if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
7022
- style[ name ] = "inherit";
7023
- }
7024
-
7025
- // If a hook was provided, use that value, otherwise just set the specified value
7026
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
7027
-
7028
- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
7029
- // Fixes bug #5509
7030
- try {
7031
- style[ name ] = value;
7032
- } catch(e) {}
7033
- }
7034
-
7035
- } else {
7036
- // If a hook was provided get the non-computed value from there
7037
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
7038
- return ret;
7039
- }
7040
-
7041
- // Otherwise just get the value from the style object
7042
- return style[ name ];
7043
- }
7044
- },
7045
-
7046
- css: function( elem, name, extra, styles ) {
7047
- var num, val, hooks,
7048
- origName = jQuery.camelCase( name );
7049
-
7050
- // Make sure that we're working with the right name
7051
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
7052
-
7053
- // gets hook for the prefixed version
7054
- // followed by the unprefixed version
7055
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7056
-
7057
- // If a hook was provided get the computed value from there
7058
- if ( hooks && "get" in hooks ) {
7059
- val = hooks.get( elem, true, extra );
7060
- }
7061
-
7062
- // Otherwise, if a way to get the computed value exists, use that
7063
- if ( val === undefined ) {
7064
- val = curCSS( elem, name, styles );
7065
- }
7066
-
7067
- //convert "normal" to computed value
7068
- if ( val === "normal" && name in cssNormalTransform ) {
7069
- val = cssNormalTransform[ name ];
7070
- }
7071
-
7072
- // Return, converting to number if forced or a qualifier was provided and val looks numeric
7073
- if ( extra === "" || extra ) {
7074
- num = parseFloat( val );
7075
- return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
7076
- }
7077
- return val;
7078
- }
7079
- });
7080
-
7081
- // NOTE: we've included the "window" in window.getComputedStyle
7082
- // because jsdom on node.js will break without it.
7083
- if ( window.getComputedStyle ) {
7084
- getStyles = function( elem ) {
7085
- return window.getComputedStyle( elem, null );
7086
- };
7087
-
7088
- curCSS = function( elem, name, _computed ) {
7089
- var width, minWidth, maxWidth,
7090
- computed = _computed || getStyles( elem ),
7091
-
7092
- // getPropertyValue is only needed for .css('filter') in IE9, see #12537
7093
- ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
7094
- style = elem.style;
7095
-
7096
- if ( computed ) {
7097
-
7098
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
7099
- ret = jQuery.style( elem, name );
7100
- }
7101
-
7102
- // A tribute to the "awesome hack by Dean Edwards"
7103
- // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
7104
- // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
7105
- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
7106
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
7107
-
7108
- // Remember the original values
7109
- width = style.width;
7110
- minWidth = style.minWidth;
7111
- maxWidth = style.maxWidth;
7112
-
7113
- // Put in the new values to get a computed value out
7114
- style.minWidth = style.maxWidth = style.width = ret;
7115
- ret = computed.width;
7116
-
7117
- // Revert the changed values
7118
- style.width = width;
7119
- style.minWidth = minWidth;
7120
- style.maxWidth = maxWidth;
7121
- }
7122
- }
7123
-
7124
- return ret;
7125
- };
7126
- } else if ( document.documentElement.currentStyle ) {
7127
- getStyles = function( elem ) {
7128
- return elem.currentStyle;
7129
- };
7130
-
7131
- curCSS = function( elem, name, _computed ) {
7132
- var left, rs, rsLeft,
7133
- computed = _computed || getStyles( elem ),
7134
- ret = computed ? computed[ name ] : undefined,
7135
- style = elem.style;
7136
-
7137
- // Avoid setting ret to empty string here
7138
- // so we don't default to auto
7139
- if ( ret == null && style && style[ name ] ) {
7140
- ret = style[ name ];
7141
- }
7142
-
7143
- // From the awesome hack by Dean Edwards
7144
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
7145
-
7146
- // If we're not dealing with a regular pixel number
7147
- // but a number that has a weird ending, we need to convert it to pixels
7148
- // but not position css attributes, as those are proportional to the parent element instead
7149
- // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
7150
- if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
7151
-
7152
- // Remember the original values
7153
- left = style.left;
7154
- rs = elem.runtimeStyle;
7155
- rsLeft = rs && rs.left;
7156
-
7157
- // Put in the new values to get a computed value out
7158
- if ( rsLeft ) {
7159
- rs.left = elem.currentStyle.left;
7160
- }
7161
- style.left = name === "fontSize" ? "1em" : ret;
7162
- ret = style.pixelLeft + "px";
7163
-
7164
- // Revert the changed values
7165
- style.left = left;
7166
- if ( rsLeft ) {
7167
- rs.left = rsLeft;
7168
- }
7169
- }
7170
-
7171
- return ret === "" ? "auto" : ret;
7172
- };
7173
- }
7174
-
7175
- function setPositiveNumber( elem, value, subtract ) {
7176
- var matches = rnumsplit.exec( value );
7177
- return matches ?
7178
- // Guard against undefined "subtract", e.g., when used as in cssHooks
7179
- Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
7180
- value;
7181
- }
7182
-
7183
- function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
7184
- var i = extra === ( isBorderBox ? "border" : "content" ) ?
7185
- // If we already have the right measurement, avoid augmentation
7186
- 4 :
7187
- // Otherwise initialize for horizontal or vertical properties
7188
- name === "width" ? 1 : 0,
7189
-
7190
- val = 0;
7191
-
7192
- for ( ; i < 4; i += 2 ) {
7193
- // both box models exclude margin, so add it if we want it
7194
- if ( extra === "margin" ) {
7195
- val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
7196
- }
7197
-
7198
- if ( isBorderBox ) {
7199
- // border-box includes padding, so remove it if we want content
7200
- if ( extra === "content" ) {
7201
- val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7202
- }
7203
-
7204
- // at this point, extra isn't border nor margin, so remove border
7205
- if ( extra !== "margin" ) {
7206
- val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7207
- }
7208
- } else {
7209
- // at this point, extra isn't content, so add padding
7210
- val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7211
-
7212
- // at this point, extra isn't content nor padding, so add border
7213
- if ( extra !== "padding" ) {
7214
- val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7215
- }
7216
- }
7217
- }
7218
-
7219
- return val;
7220
- }
7221
-
7222
- function getWidthOrHeight( elem, name, extra ) {
7223
-
7224
- // Start with offset property, which is equivalent to the border-box value
7225
- var valueIsBorderBox = true,
7226
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
7227
- styles = getStyles( elem ),
7228
- isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
7229
-
7230
- // some non-html elements return undefined for offsetWidth, so check for null/undefined
7231
- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
7232
- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
7233
- if ( val <= 0 || val == null ) {
7234
- // Fall back to computed then uncomputed css if necessary
7235
- val = curCSS( elem, name, styles );
7236
- if ( val < 0 || val == null ) {
7237
- val = elem.style[ name ];
7238
- }
7239
-
7240
- // Computed unit is not pixels. Stop here and return.
7241
- if ( rnumnonpx.test(val) ) {
7242
- return val;
7243
- }
7244
-
7245
- // we need the check for style in case a browser which returns unreliable values
7246
- // for getComputedStyle silently falls back to the reliable elem.style
7247
- valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
7248
-
7249
- // Normalize "", auto, and prepare for extra
7250
- val = parseFloat( val ) || 0;
7251
- }
7252
-
7253
- // use the active box-sizing model to add/subtract irrelevant styles
7254
- return ( val +
7255
- augmentWidthOrHeight(
7256
- elem,
7257
- name,
7258
- extra || ( isBorderBox ? "border" : "content" ),
7259
- valueIsBorderBox,
7260
- styles
7261
- )
7262
- ) + "px";
7263
- }
7264
-
7265
- // Try to determine the default display value of an element
7266
- function css_defaultDisplay( nodeName ) {
7267
- var doc = document,
7268
- display = elemdisplay[ nodeName ];
7269
-
7270
- if ( !display ) {
7271
- display = actualDisplay( nodeName, doc );
7272
-
7273
- // If the simple way fails, read from inside an iframe
7274
- if ( display === "none" || !display ) {
7275
- // Use the already-created iframe if possible
7276
- iframe = ( iframe ||
7277
- jQuery("<iframe frameborder='0' width='0' height='0'/>")
7278
- .css( "cssText", "display:block !important" )
7279
- ).appendTo( doc.documentElement );
7280
-
7281
- // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
7282
- doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
7283
- doc.write("<!doctype html><html><body>");
7284
- doc.close();
7285
-
7286
- display = actualDisplay( nodeName, doc );
7287
- iframe.detach();
7288
- }
7289
-
7290
- // Store the correct default display
7291
- elemdisplay[ nodeName ] = display;
7292
- }
7293
-
7294
- return display;
7295
- }
7296
-
7297
- // Called ONLY from within css_defaultDisplay
7298
- function actualDisplay( name, doc ) {
7299
- var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
7300
- display = jQuery.css( elem[0], "display" );
7301
- elem.remove();
7302
- return display;
7303
- }
7304
-
7305
- jQuery.each([ "height", "width" ], function( i, name ) {
7306
- jQuery.cssHooks[ name ] = {
7307
- get: function( elem, computed, extra ) {
7308
- if ( computed ) {
7309
- // certain elements can have dimension info if we invisibly show them
7310
- // however, it must have a current display style that would benefit from this
7311
- return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
7312
- jQuery.swap( elem, cssShow, function() {
7313
- return getWidthOrHeight( elem, name, extra );
7314
- }) :
7315
- getWidthOrHeight( elem, name, extra );
7316
- }
7317
- },
7318
-
7319
- set: function( elem, value, extra ) {
7320
- var styles = extra && getStyles( elem );
7321
- return setPositiveNumber( elem, value, extra ?
7322
- augmentWidthOrHeight(
7323
- elem,
7324
- name,
7325
- extra,
7326
- jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
7327
- styles
7328
- ) : 0
7329
- );
7330
- }
7331
- };
7332
- });
7333
-
7334
- if ( !jQuery.support.opacity ) {
7335
- jQuery.cssHooks.opacity = {
7336
- get: function( elem, computed ) {
7337
- // IE uses filters for opacity
7338
- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
7339
- ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
7340
- computed ? "1" : "";
7341
- },
7342
-
7343
- set: function( elem, value ) {
7344
- var style = elem.style,
7345
- currentStyle = elem.currentStyle,
7346
- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
7347
- filter = currentStyle && currentStyle.filter || style.filter || "";
7348
-
7349
- // IE has trouble with opacity if it does not have layout
7350
- // Force it by setting the zoom level
7351
- style.zoom = 1;
7352
-
7353
- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
7354
- // if value === "", then remove inline opacity #12685
7355
- if ( ( value >= 1 || value === "" ) &&
7356
- jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
7357
- style.removeAttribute ) {
7358
-
7359
- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
7360
- // if "filter:" is present at all, clearType is disabled, we want to avoid this
7361
- // style.removeAttribute is IE Only, but so apparently is this code path...
7362
- style.removeAttribute( "filter" );
7363
-
7364
- // if there is no filter style applied in a css rule or unset inline opacity, we are done
7365
- if ( value === "" || currentStyle && !currentStyle.filter ) {
7366
- return;
7367
- }
7368
- }
7369
-
7370
- // otherwise, set new filter values
7371
- style.filter = ralpha.test( filter ) ?
7372
- filter.replace( ralpha, opacity ) :
7373
- filter + " " + opacity;
7374
- }
7375
- };
7376
- }
7377
-
7378
- // These hooks cannot be added until DOM ready because the support test
7379
- // for it is not run until after DOM ready
7380
- jQuery(function() {
7381
- if ( !jQuery.support.reliableMarginRight ) {
7382
- jQuery.cssHooks.marginRight = {
7383
- get: function( elem, computed ) {
7384
- if ( computed ) {
7385
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
7386
- // Work around by temporarily setting element display to inline-block
7387
- return jQuery.swap( elem, { "display": "inline-block" },
7388
- curCSS, [ elem, "marginRight" ] );
7389
- }
7390
- }
7391
- };
7392
- }
7393
-
7394
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
7395
- // getComputedStyle returns percent when specified for top/left/bottom/right
7396
- // rather than make the css module depend on the offset module, we just check for it here
7397
- if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
7398
- jQuery.each( [ "top", "left" ], function( i, prop ) {
7399
- jQuery.cssHooks[ prop ] = {
7400
- get: function( elem, computed ) {
7401
- if ( computed ) {
7402
- computed = curCSS( elem, prop );
7403
- // if curCSS returns percentage, fallback to offset
7404
- return rnumnonpx.test( computed ) ?
7405
- jQuery( elem ).position()[ prop ] + "px" :
7406
- computed;
7407
- }
7408
- }
7409
- };
7410
- });
7411
- }
7412
-
7413
- });
7414
-
7415
- if ( jQuery.expr && jQuery.expr.filters ) {
7416
- jQuery.expr.filters.hidden = function( elem ) {
7417
- // Support: Opera <= 12.12
7418
- // Opera reports offsetWidths and offsetHeights less than zero on some elements
7419
- return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
7420
- (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
7421
- };
7422
-
7423
- jQuery.expr.filters.visible = function( elem ) {
7424
- return !jQuery.expr.filters.hidden( elem );
7425
- };
7426
- }
7427
-
7428
- // These hooks are used by animate to expand properties
7429
- jQuery.each({
7430
- margin: "",
7431
- padding: "",
7432
- border: "Width"
7433
- }, function( prefix, suffix ) {
7434
- jQuery.cssHooks[ prefix + suffix ] = {
7435
- expand: function( value ) {
7436
- var i = 0,
7437
- expanded = {},
7438
-
7439
- // assumes a single number if not a string
7440
- parts = typeof value === "string" ? value.split(" ") : [ value ];
7441
-
7442
- for ( ; i < 4; i++ ) {
7443
- expanded[ prefix + cssExpand[ i ] + suffix ] =
7444
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
7445
- }
7446
-
7447
- return expanded;
7448
- }
7449
- };
7450
-
7451
- if ( !rmargin.test( prefix ) ) {
7452
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
7453
- }
7454
- });
7455
- var r20 = /%20/g,
7456
- rbracket = /\[\]$/,
7457
- rCRLF = /\r?\n/g,
7458
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
7459
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
7460
-
7461
- jQuery.fn.extend({
7462
- serialize: function() {
7463
- return jQuery.param( this.serializeArray() );
7464
- },
7465
- serializeArray: function() {
7466
- return this.map(function(){
7467
- // Can add propHook for "elements" to filter or add form elements
7468
- var elements = jQuery.prop( this, "elements" );
7469
- return elements ? jQuery.makeArray( elements ) : this;
7470
- })
7471
- .filter(function(){
7472
- var type = this.type;
7473
- // Use .is(":disabled") so that fieldset[disabled] works
7474
- return this.name && !jQuery( this ).is( ":disabled" ) &&
7475
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
7476
- ( this.checked || !manipulation_rcheckableType.test( type ) );
7477
- })
7478
- .map(function( i, elem ){
7479
- var val = jQuery( this ).val();
7480
-
7481
- return val == null ?
7482
- null :
7483
- jQuery.isArray( val ) ?
7484
- jQuery.map( val, function( val ){
7485
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7486
- }) :
7487
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7488
- }).get();
7489
- }
7490
- });
7491
-
7492
- //Serialize an array of form elements or a set of
7493
- //key/values into a query string
7494
- jQuery.param = function( a, traditional ) {
7495
- var prefix,
7496
- s = [],
7497
- add = function( key, value ) {
7498
- // If value is a function, invoke it and return its value
7499
- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
7500
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
7501
- };
7502
-
7503
- // Set traditional to true for jQuery <= 1.3.2 behavior.
7504
- if ( traditional === undefined ) {
7505
- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
7506
- }
7507
-
7508
- // If an array was passed in, assume that it is an array of form elements.
7509
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
7510
- // Serialize the form elements
7511
- jQuery.each( a, function() {
7512
- add( this.name, this.value );
7513
- });
7514
-
7515
- } else {
7516
- // If traditional, encode the "old" way (the way 1.3.2 or older
7517
- // did it), otherwise encode params recursively.
7518
- for ( prefix in a ) {
7519
- buildParams( prefix, a[ prefix ], traditional, add );
7520
- }
7521
- }
7522
-
7523
- // Return the resulting serialization
7524
- return s.join( "&" ).replace( r20, "+" );
7525
- };
7526
-
7527
- function buildParams( prefix, obj, traditional, add ) {
7528
- var name;
7529
-
7530
- if ( jQuery.isArray( obj ) ) {
7531
- // Serialize array item.
7532
- jQuery.each( obj, function( i, v ) {
7533
- if ( traditional || rbracket.test( prefix ) ) {
7534
- // Treat each array item as a scalar.
7535
- add( prefix, v );
7536
-
7537
- } else {
7538
- // Item is non-scalar (array or object), encode its numeric index.
7539
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7540
- }
7541
- });
7542
-
7543
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
7544
- // Serialize object item.
7545
- for ( name in obj ) {
7546
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7547
- }
7548
-
7549
- } else {
7550
- // Serialize scalar item.
7551
- add( prefix, obj );
7552
- }
7553
- }
7554
- jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
7555
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7556
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
7557
-
7558
- // Handle event binding
7559
- jQuery.fn[ name ] = function( data, fn ) {
7560
- return arguments.length > 0 ?
7561
- this.on( name, null, data, fn ) :
7562
- this.trigger( name );
7563
- };
7564
- });
7565
-
7566
- jQuery.fn.extend({
7567
- hover: function( fnOver, fnOut ) {
7568
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7569
- },
7570
-
7571
- bind: function( types, data, fn ) {
7572
- return this.on( types, null, data, fn );
7573
- },
7574
- unbind: function( types, fn ) {
7575
- return this.off( types, null, fn );
7576
- },
7577
-
7578
- delegate: function( selector, types, data, fn ) {
7579
- return this.on( types, selector, data, fn );
7580
- },
7581
- undelegate: function( selector, types, fn ) {
7582
- // ( namespace ) or ( selector, types [, fn] )
7583
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
7584
- }
7585
- });
7586
- var
7587
- // Document location
7588
- ajaxLocParts,
7589
- ajaxLocation,
7590
- ajax_nonce = jQuery.now(),
7591
-
7592
- ajax_rquery = /\?/,
7593
- rhash = /#.*$/,
7594
- rts = /([?&])_=[^&]*/,
7595
- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
7596
- // #7653, #8125, #8152: local protocol detection
7597
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
7598
- rnoContent = /^(?:GET|HEAD)$/,
7599
- rprotocol = /^\/\//,
7600
- rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
7601
-
7602
- // Keep a copy of the old load method
7603
- _load = jQuery.fn.load,
7604
-
7605
- /* Prefilters
7606
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
7607
- * 2) These are called:
7608
- * - BEFORE asking for a transport
7609
- * - AFTER param serialization (s.data is a string if s.processData is true)
7610
- * 3) key is the dataType
7611
- * 4) the catchall symbol "*" can be used
7612
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
7613
- */
7614
- prefilters = {},
7615
-
7616
- /* Transports bindings
7617
- * 1) key is the dataType
7618
- * 2) the catchall symbol "*" can be used
7619
- * 3) selection will start with transport dataType and THEN go to "*" if needed
7620
- */
7621
- transports = {},
7622
-
7623
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7624
- allTypes = "*/".concat("*");
7625
-
7626
- // #8138, IE may throw an exception when accessing
7627
- // a field from window.location if document.domain has been set
7628
- try {
7629
- ajaxLocation = location.href;
7630
- } catch( e ) {
7631
- // Use the href attribute of an A element
7632
- // since IE will modify it given document.location
7633
- ajaxLocation = document.createElement( "a" );
7634
- ajaxLocation.href = "";
7635
- ajaxLocation = ajaxLocation.href;
7636
- }
7637
-
7638
- // Segment location into parts
7639
- ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7640
-
7641
- // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7642
- function addToPrefiltersOrTransports( structure ) {
7643
-
7644
- // dataTypeExpression is optional and defaults to "*"
7645
- return function( dataTypeExpression, func ) {
7646
-
7647
- if ( typeof dataTypeExpression !== "string" ) {
7648
- func = dataTypeExpression;
7649
- dataTypeExpression = "*";
7650
- }
7651
-
7652
- var dataType,
7653
- i = 0,
7654
- dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
7655
-
7656
- if ( jQuery.isFunction( func ) ) {
7657
- // For each dataType in the dataTypeExpression
7658
- while ( (dataType = dataTypes[i++]) ) {
7659
- // Prepend if requested
7660
- if ( dataType[0] === "+" ) {
7661
- dataType = dataType.slice( 1 ) || "*";
7662
- (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
7663
-
7664
- // Otherwise append
7665
- } else {
7666
- (structure[ dataType ] = structure[ dataType ] || []).push( func );
7667
- }
7668
- }
7669
- }
7670
- };
7671
- }
7672
-
7673
- // Base inspection function for prefilters and transports
7674
- function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
7675
-
7676
- var inspected = {},
7677
- seekingTransport = ( structure === transports );
7678
-
7679
- function inspect( dataType ) {
7680
- var selected;
7681
- inspected[ dataType ] = true;
7682
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
7683
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
7684
- if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
7685
- options.dataTypes.unshift( dataTypeOrTransport );
7686
- inspect( dataTypeOrTransport );
7687
- return false;
7688
- } else if ( seekingTransport ) {
7689
- return !( selected = dataTypeOrTransport );
7690
- }
7691
- });
7692
- return selected;
7693
- }
7694
-
7695
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
7696
- }
7697
-
7698
- // A special extend for ajax options
7699
- // that takes "flat" options (not to be deep extended)
7700
- // Fixes #9887
7701
- function ajaxExtend( target, src ) {
7702
- var deep, key,
7703
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
7704
-
7705
- for ( key in src ) {
7706
- if ( src[ key ] !== undefined ) {
7707
- ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
7708
- }
7709
- }
7710
- if ( deep ) {
7711
- jQuery.extend( true, target, deep );
7712
- }
7713
-
7714
- return target;
7715
- }
7716
-
7717
- jQuery.fn.load = function( url, params, callback ) {
7718
- if ( typeof url !== "string" && _load ) {
7719
- return _load.apply( this, arguments );
7720
- }
7721
-
7722
- var selector, response, type,
7723
- self = this,
7724
- off = url.indexOf(" ");
7725
-
7726
- if ( off >= 0 ) {
7727
- selector = url.slice( off, url.length );
7728
- url = url.slice( 0, off );
7729
- }
7730
-
7731
- // If it's a function
7732
- if ( jQuery.isFunction( params ) ) {
7733
-
7734
- // We assume that it's the callback
7735
- callback = params;
7736
- params = undefined;
7737
-
7738
- // Otherwise, build a param string
7739
- } else if ( params && typeof params === "object" ) {
7740
- type = "POST";
7741
- }
7742
-
7743
- // If we have elements to modify, make the request
7744
- if ( self.length > 0 ) {
7745
- jQuery.ajax({
7746
- url: url,
7747
-
7748
- // if "type" variable is undefined, then "GET" method will be used
7749
- type: type,
7750
- dataType: "html",
7751
- data: params
7752
- }).done(function( responseText ) {
7753
-
7754
- // Save response for use in complete callback
7755
- response = arguments;
7756
-
7757
- self.html( selector ?
7758
-
7759
- // If a selector was specified, locate the right elements in a dummy div
7760
- // Exclude scripts to avoid IE 'Permission Denied' errors
7761
- jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
7762
-
7763
- // Otherwise use the full result
7764
- responseText );
7765
-
7766
- }).complete( callback && function( jqXHR, status ) {
7767
- self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
7768
- });
7769
- }
7770
-
7771
- return this;
7772
- };
7773
-
7774
- // Attach a bunch of functions for handling common AJAX events
7775
- jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
7776
- jQuery.fn[ type ] = function( fn ){
7777
- return this.on( type, fn );
7778
- };
7779
- });
7780
-
7781
- jQuery.extend({
7782
-
7783
- // Counter for holding the number of active queries
7784
- active: 0,
7785
-
7786
- // Last-Modified header cache for next request
7787
- lastModified: {},
7788
- etag: {},
7789
-
7790
- ajaxSettings: {
7791
- url: ajaxLocation,
7792
- type: "GET",
7793
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7794
- global: true,
7795
- processData: true,
7796
- async: true,
7797
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7798
- /*
7799
- timeout: 0,
7800
- data: null,
7801
- dataType: null,
7802
- username: null,
7803
- password: null,
7804
- cache: null,
7805
- throws: false,
7806
- traditional: false,
7807
- headers: {},
7808
- */
7809
-
7810
- accepts: {
7811
- "*": allTypes,
7812
- text: "text/plain",
7813
- html: "text/html",
7814
- xml: "application/xml, text/xml",
7815
- json: "application/json, text/javascript"
7816
- },
7817
-
7818
- contents: {
7819
- xml: /xml/,
7820
- html: /html/,
7821
- json: /json/
7822
- },
7823
-
7824
- responseFields: {
7825
- xml: "responseXML",
7826
- text: "responseText",
7827
- json: "responseJSON"
7828
- },
7829
-
7830
- // Data converters
7831
- // Keys separate source (or catchall "*") and destination types with a single space
7832
- converters: {
7833
-
7834
- // Convert anything to text
7835
- "* text": String,
7836
-
7837
- // Text to html (true = no transformation)
7838
- "text html": true,
7839
-
7840
- // Evaluate text as a json expression
7841
- "text json": jQuery.parseJSON,
7842
-
7843
- // Parse text as xml
7844
- "text xml": jQuery.parseXML
7845
- },
7846
-
7847
- // For options that shouldn't be deep extended:
7848
- // you can add your own custom options here if
7849
- // and when you create one that shouldn't be
7850
- // deep extended (see ajaxExtend)
7851
- flatOptions: {
7852
- url: true,
7853
- context: true
7854
- }
7855
- },
7856
-
7857
- // Creates a full fledged settings object into target
7858
- // with both ajaxSettings and settings fields.
7859
- // If target is omitted, writes into ajaxSettings.
7860
- ajaxSetup: function( target, settings ) {
7861
- return settings ?
7862
-
7863
- // Building a settings object
7864
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
7865
-
7866
- // Extending ajaxSettings
7867
- ajaxExtend( jQuery.ajaxSettings, target );
7868
- },
7869
-
7870
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7871
- ajaxTransport: addToPrefiltersOrTransports( transports ),
7872
-
7873
- // Main method
7874
- ajax: function( url, options ) {
7875
-
7876
- // If url is an object, simulate pre-1.5 signature
7877
- if ( typeof url === "object" ) {
7878
- options = url;
7879
- url = undefined;
7880
- }
7881
-
7882
- // Force options to be an object
7883
- options = options || {};
7884
-
7885
- var // Cross-domain detection vars
7886
- parts,
7887
- // Loop variable
7888
- i,
7889
- // URL without anti-cache param
7890
- cacheURL,
7891
- // Response headers as string
7892
- responseHeadersString,
7893
- // timeout handle
7894
- timeoutTimer,
7895
-
7896
- // To know if global events are to be dispatched
7897
- fireGlobals,
7898
-
7899
- transport,
7900
- // Response headers
7901
- responseHeaders,
7902
- // Create the final options object
7903
- s = jQuery.ajaxSetup( {}, options ),
7904
- // Callbacks context
7905
- callbackContext = s.context || s,
7906
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
7907
- globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
7908
- jQuery( callbackContext ) :
7909
- jQuery.event,
7910
- // Deferreds
7911
- deferred = jQuery.Deferred(),
7912
- completeDeferred = jQuery.Callbacks("once memory"),
7913
- // Status-dependent callbacks
7914
- statusCode = s.statusCode || {},
7915
- // Headers (they are sent all at once)
7916
- requestHeaders = {},
7917
- requestHeadersNames = {},
7918
- // The jqXHR state
7919
- state = 0,
7920
- // Default abort message
7921
- strAbort = "canceled",
7922
- // Fake xhr
7923
- jqXHR = {
7924
- readyState: 0,
7925
-
7926
- // Builds headers hashtable if needed
7927
- getResponseHeader: function( key ) {
7928
- var match;
7929
- if ( state === 2 ) {
7930
- if ( !responseHeaders ) {
7931
- responseHeaders = {};
7932
- while ( (match = rheaders.exec( responseHeadersString )) ) {
7933
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7934
- }
7935
- }
7936
- match = responseHeaders[ key.toLowerCase() ];
7937
- }
7938
- return match == null ? null : match;
7939
- },
7940
-
7941
- // Raw string
7942
- getAllResponseHeaders: function() {
7943
- return state === 2 ? responseHeadersString : null;
7944
- },
7945
-
7946
- // Caches the header
7947
- setRequestHeader: function( name, value ) {
7948
- var lname = name.toLowerCase();
7949
- if ( !state ) {
7950
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7951
- requestHeaders[ name ] = value;
7952
- }
7953
- return this;
7954
- },
7955
-
7956
- // Overrides response content-type header
7957
- overrideMimeType: function( type ) {
7958
- if ( !state ) {
7959
- s.mimeType = type;
7960
- }
7961
- return this;
7962
- },
7963
-
7964
- // Status-dependent callbacks
7965
- statusCode: function( map ) {
7966
- var code;
7967
- if ( map ) {
7968
- if ( state < 2 ) {
7969
- for ( code in map ) {
7970
- // Lazy-add the new callback in a way that preserves old ones
7971
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
7972
- }
7973
- } else {
7974
- // Execute the appropriate callbacks
7975
- jqXHR.always( map[ jqXHR.status ] );
7976
- }
7977
- }
7978
- return this;
7979
- },
7980
-
7981
- // Cancel the request
7982
- abort: function( statusText ) {
7983
- var finalText = statusText || strAbort;
7984
- if ( transport ) {
7985
- transport.abort( finalText );
7986
- }
7987
- done( 0, finalText );
7988
- return this;
7989
- }
7990
- };
7991
-
7992
- // Attach deferreds
7993
- deferred.promise( jqXHR ).complete = completeDeferred.add;
7994
- jqXHR.success = jqXHR.done;
7995
- jqXHR.error = jqXHR.fail;
7996
-
7997
- // Remove hash character (#7531: and string promotion)
7998
- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
7999
- // Handle falsy url in the settings object (#10093: consistency with old signature)
8000
- // We also use the url parameter if available
8001
- s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
8002
-
8003
- // Alias method option to type as per ticket #12004
8004
- s.type = options.method || options.type || s.method || s.type;
8005
-
8006
- // Extract dataTypes list
8007
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
8008
-
8009
- // A cross-domain request is in order when we have a protocol:host:port mismatch
8010
- if ( s.crossDomain == null ) {
8011
- parts = rurl.exec( s.url.toLowerCase() );
8012
- s.crossDomain = !!( parts &&
8013
- ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
8014
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
8015
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
8016
- );
8017
- }
8018
-
8019
- // Convert data if not already a string
8020
- if ( s.data && s.processData && typeof s.data !== "string" ) {
8021
- s.data = jQuery.param( s.data, s.traditional );
8022
- }
8023
-
8024
- // Apply prefilters
8025
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8026
-
8027
- // If request was aborted inside a prefilter, stop there
8028
- if ( state === 2 ) {
8029
- return jqXHR;
8030
- }
8031
-
8032
- // We can fire global events as of now if asked to
8033
- fireGlobals = s.global;
8034
-
8035
- // Watch for a new set of requests
8036
- if ( fireGlobals && jQuery.active++ === 0 ) {
8037
- jQuery.event.trigger("ajaxStart");
8038
- }
8039
-
8040
- // Uppercase the type
8041
- s.type = s.type.toUpperCase();
8042
-
8043
- // Determine if request has content
8044
- s.hasContent = !rnoContent.test( s.type );
8045
-
8046
- // Save the URL in case we're toying with the If-Modified-Since
8047
- // and/or If-None-Match header later on
8048
- cacheURL = s.url;
8049
-
8050
- // More options handling for requests with no content
8051
- if ( !s.hasContent ) {
8052
-
8053
- // If data is available, append data to url
8054
- if ( s.data ) {
8055
- cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
8056
- // #9682: remove data so that it's not used in an eventual retry
8057
- delete s.data;
8058
- }
8059
-
8060
- // Add anti-cache in url if needed
8061
- if ( s.cache === false ) {
8062
- s.url = rts.test( cacheURL ) ?
8063
-
8064
- // If there is already a '_' parameter, set its value
8065
- cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
8066
-
8067
- // Otherwise add one to the end
8068
- cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
8069
- }
8070
- }
8071
-
8072
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8073
- if ( s.ifModified ) {
8074
- if ( jQuery.lastModified[ cacheURL ] ) {
8075
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8076
- }
8077
- if ( jQuery.etag[ cacheURL ] ) {
8078
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
8079
- }
8080
- }
8081
-
8082
- // Set the correct header, if data is being sent
8083
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
8084
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
8085
- }
8086
-
8087
- // Set the Accepts header for the server, depending on the dataType
8088
- jqXHR.setRequestHeader(
8089
- "Accept",
8090
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
8091
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
8092
- s.accepts[ "*" ]
8093
- );
8094
-
8095
- // Check for headers option
8096
- for ( i in s.headers ) {
8097
- jqXHR.setRequestHeader( i, s.headers[ i ] );
8098
- }
8099
-
8100
- // Allow custom headers/mimetypes and early abort
8101
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
8102
- // Abort if not done already and return
8103
- return jqXHR.abort();
8104
- }
8105
-
8106
- // aborting is no longer a cancellation
8107
- strAbort = "abort";
8108
-
8109
- // Install callbacks on deferreds
8110
- for ( i in { success: 1, error: 1, complete: 1 } ) {
8111
- jqXHR[ i ]( s[ i ] );
8112
- }
8113
-
8114
- // Get transport
8115
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8116
-
8117
- // If no transport, we auto-abort
8118
- if ( !transport ) {
8119
- done( -1, "No Transport" );
8120
- } else {
8121
- jqXHR.readyState = 1;
8122
-
8123
- // Send global event
8124
- if ( fireGlobals ) {
8125
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
8126
- }
8127
- // Timeout
8128
- if ( s.async && s.timeout > 0 ) {
8129
- timeoutTimer = setTimeout(function() {
8130
- jqXHR.abort("timeout");
8131
- }, s.timeout );
8132
- }
8133
-
8134
- try {
8135
- state = 1;
8136
- transport.send( requestHeaders, done );
8137
- } catch ( e ) {
8138
- // Propagate exception as error if not done
8139
- if ( state < 2 ) {
8140
- done( -1, e );
8141
- // Simply rethrow otherwise
8142
- } else {
8143
- throw e;
8144
- }
8145
- }
8146
- }
8147
-
8148
- // Callback for when everything is done
8149
- function done( status, nativeStatusText, responses, headers ) {
8150
- var isSuccess, success, error, response, modified,
8151
- statusText = nativeStatusText;
8152
-
8153
- // Called once
8154
- if ( state === 2 ) {
8155
- return;
8156
- }
8157
-
8158
- // State is "done" now
8159
- state = 2;
8160
-
8161
- // Clear timeout if it exists
8162
- if ( timeoutTimer ) {
8163
- clearTimeout( timeoutTimer );
8164
- }
8165
-
8166
- // Dereference transport for early garbage collection
8167
- // (no matter how long the jqXHR object will be used)
8168
- transport = undefined;
8169
-
8170
- // Cache response headers
8171
- responseHeadersString = headers || "";
8172
-
8173
- // Set readyState
8174
- jqXHR.readyState = status > 0 ? 4 : 0;
8175
-
8176
- // Determine if successful
8177
- isSuccess = status >= 200 && status < 300 || status === 304;
8178
-
8179
- // Get response data
8180
- if ( responses ) {
8181
- response = ajaxHandleResponses( s, jqXHR, responses );
8182
- }
8183
-
8184
- // Convert no matter what (that way responseXXX fields are always set)
8185
- response = ajaxConvert( s, response, jqXHR, isSuccess );
8186
-
8187
- // If successful, handle type chaining
8188
- if ( isSuccess ) {
8189
-
8190
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8191
- if ( s.ifModified ) {
8192
- modified = jqXHR.getResponseHeader("Last-Modified");
8193
- if ( modified ) {
8194
- jQuery.lastModified[ cacheURL ] = modified;
8195
- }
8196
- modified = jqXHR.getResponseHeader("etag");
8197
- if ( modified ) {
8198
- jQuery.etag[ cacheURL ] = modified;
8199
- }
8200
- }
8201
-
8202
- // if no content
8203
- if ( status === 204 || s.type === "HEAD" ) {
8204
- statusText = "nocontent";
8205
-
8206
- // if not modified
8207
- } else if ( status === 304 ) {
8208
- statusText = "notmodified";
8209
-
8210
- // If we have data, let's convert it
8211
- } else {
8212
- statusText = response.state;
8213
- success = response.data;
8214
- error = response.error;
8215
- isSuccess = !error;
8216
- }
8217
- } else {
8218
- // We extract error from statusText
8219
- // then normalize statusText and status for non-aborts
8220
- error = statusText;
8221
- if ( status || !statusText ) {
8222
- statusText = "error";
8223
- if ( status < 0 ) {
8224
- status = 0;
8225
- }
8226
- }
8227
- }
8228
-
8229
- // Set data for the fake xhr object
8230
- jqXHR.status = status;
8231
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
8232
-
8233
- // Success/Error
8234
- if ( isSuccess ) {
8235
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8236
- } else {
8237
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8238
- }
8239
-
8240
- // Status-dependent callbacks
8241
- jqXHR.statusCode( statusCode );
8242
- statusCode = undefined;
8243
-
8244
- if ( fireGlobals ) {
8245
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
8246
- [ jqXHR, s, isSuccess ? success : error ] );
8247
- }
8248
-
8249
- // Complete
8250
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8251
-
8252
- if ( fireGlobals ) {
8253
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
8254
- // Handle the global AJAX counter
8255
- if ( !( --jQuery.active ) ) {
8256
- jQuery.event.trigger("ajaxStop");
8257
- }
8258
- }
8259
- }
8260
-
8261
- return jqXHR;
8262
- },
8263
-
8264
- getJSON: function( url, data, callback ) {
8265
- return jQuery.get( url, data, callback, "json" );
8266
- },
8267
-
8268
- getScript: function( url, callback ) {
8269
- return jQuery.get( url, undefined, callback, "script" );
8270
- }
8271
- });
8272
-
8273
- jQuery.each( [ "get", "post" ], function( i, method ) {
8274
- jQuery[ method ] = function( url, data, callback, type ) {
8275
- // shift arguments if data argument was omitted
8276
- if ( jQuery.isFunction( data ) ) {
8277
- type = type || callback;
8278
- callback = data;
8279
- data = undefined;
8280
- }
8281
-
8282
- return jQuery.ajax({
8283
- url: url,
8284
- type: method,
8285
- dataType: type,
8286
- data: data,
8287
- success: callback
8288
- });
8289
- };
8290
- });
8291
-
8292
- /* Handles responses to an ajax request:
8293
- * - finds the right dataType (mediates between content-type and expected dataType)
8294
- * - returns the corresponding response
8295
- */
8296
- function ajaxHandleResponses( s, jqXHR, responses ) {
8297
- var firstDataType, ct, finalDataType, type,
8298
- contents = s.contents,
8299
- dataTypes = s.dataTypes;
8300
-
8301
- // Remove auto dataType and get content-type in the process
8302
- while( dataTypes[ 0 ] === "*" ) {
8303
- dataTypes.shift();
8304
- if ( ct === undefined ) {
8305
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8306
- }
8307
- }
8308
-
8309
- // Check if we're dealing with a known content-type
8310
- if ( ct ) {
8311
- for ( type in contents ) {
8312
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
8313
- dataTypes.unshift( type );
8314
- break;
8315
- }
8316
- }
8317
- }
8318
-
8319
- // Check to see if we have a response for the expected dataType
8320
- if ( dataTypes[ 0 ] in responses ) {
8321
- finalDataType = dataTypes[ 0 ];
8322
- } else {
8323
- // Try convertible dataTypes
8324
- for ( type in responses ) {
8325
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8326
- finalDataType = type;
8327
- break;
8328
- }
8329
- if ( !firstDataType ) {
8330
- firstDataType = type;
8331
- }
8332
- }
8333
- // Or just use first one
8334
- finalDataType = finalDataType || firstDataType;
8335
- }
8336
-
8337
- // If we found a dataType
8338
- // We add the dataType to the list if needed
8339
- // and return the corresponding response
8340
- if ( finalDataType ) {
8341
- if ( finalDataType !== dataTypes[ 0 ] ) {
8342
- dataTypes.unshift( finalDataType );
8343
- }
8344
- return responses[ finalDataType ];
8345
- }
8346
- }
8347
-
8348
- /* Chain conversions given the request and the original response
8349
- * Also sets the responseXXX fields on the jqXHR instance
8350
- */
8351
- function ajaxConvert( s, response, jqXHR, isSuccess ) {
8352
- var conv2, current, conv, tmp, prev,
8353
- converters = {},
8354
- // Work with a copy of dataTypes in case we need to modify it for conversion
8355
- dataTypes = s.dataTypes.slice();
8356
-
8357
- // Create converters map with lowercased keys
8358
- if ( dataTypes[ 1 ] ) {
8359
- for ( conv in s.converters ) {
8360
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
8361
- }
8362
- }
8363
-
8364
- current = dataTypes.shift();
8365
-
8366
- // Convert to each sequential dataType
8367
- while ( current ) {
8368
-
8369
- if ( s.responseFields[ current ] ) {
8370
- jqXHR[ s.responseFields[ current ] ] = response;
8371
- }
8372
-
8373
- // Apply the dataFilter if provided
8374
- if ( !prev && isSuccess && s.dataFilter ) {
8375
- response = s.dataFilter( response, s.dataType );
8376
- }
8377
-
8378
- prev = current;
8379
- current = dataTypes.shift();
8380
-
8381
- if ( current ) {
8382
-
8383
- // There's only work to do if current dataType is non-auto
8384
- if ( current === "*" ) {
8385
-
8386
- current = prev;
8387
-
8388
- // Convert response if prev dataType is non-auto and differs from current
8389
- } else if ( prev !== "*" && prev !== current ) {
8390
-
8391
- // Seek a direct converter
8392
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8393
-
8394
- // If none found, seek a pair
8395
- if ( !conv ) {
8396
- for ( conv2 in converters ) {
8397
-
8398
- // If conv2 outputs current
8399
- tmp = conv2.split( " " );
8400
- if ( tmp[ 1 ] === current ) {
8401
-
8402
- // If prev can be converted to accepted input
8403
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
8404
- converters[ "* " + tmp[ 0 ] ];
8405
- if ( conv ) {
8406
- // Condense equivalence converters
8407
- if ( conv === true ) {
8408
- conv = converters[ conv2 ];
8409
-
8410
- // Otherwise, insert the intermediate dataType
8411
- } else if ( converters[ conv2 ] !== true ) {
8412
- current = tmp[ 0 ];
8413
- dataTypes.unshift( tmp[ 1 ] );
8414
- }
8415
- break;
8416
- }
8417
- }
8418
- }
8419
- }
8420
-
8421
- // Apply converter (if not an equivalence)
8422
- if ( conv !== true ) {
8423
-
8424
- // Unless errors are allowed to bubble, catch and return them
8425
- if ( conv && s[ "throws" ] ) {
8426
- response = conv( response );
8427
- } else {
8428
- try {
8429
- response = conv( response );
8430
- } catch ( e ) {
8431
- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8432
- }
8433
- }
8434
- }
8435
- }
8436
- }
8437
- }
8438
-
8439
- return { state: "success", data: response };
8440
- }
8441
- // Install script dataType
8442
- jQuery.ajaxSetup({
8443
- accepts: {
8444
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8445
- },
8446
- contents: {
8447
- script: /(?:java|ecma)script/
8448
- },
8449
- converters: {
8450
- "text script": function( text ) {
8451
- jQuery.globalEval( text );
8452
- return text;
8453
- }
8454
- }
8455
- });
8456
-
8457
- // Handle cache's special case and global
8458
- jQuery.ajaxPrefilter( "script", function( s ) {
8459
- if ( s.cache === undefined ) {
8460
- s.cache = false;
8461
- }
8462
- if ( s.crossDomain ) {
8463
- s.type = "GET";
8464
- s.global = false;
8465
- }
8466
- });
8467
-
8468
- // Bind script tag hack transport
8469
- jQuery.ajaxTransport( "script", function(s) {
8470
-
8471
- // This transport only deals with cross domain requests
8472
- if ( s.crossDomain ) {
8473
-
8474
- var script,
8475
- head = document.head || jQuery("head")[0] || document.documentElement;
8476
-
8477
- return {
8478
-
8479
- send: function( _, callback ) {
8480
-
8481
- script = document.createElement("script");
8482
-
8483
- script.async = true;
8484
-
8485
- if ( s.scriptCharset ) {
8486
- script.charset = s.scriptCharset;
8487
- }
8488
-
8489
- script.src = s.url;
8490
-
8491
- // Attach handlers for all browsers
8492
- script.onload = script.onreadystatechange = function( _, isAbort ) {
8493
-
8494
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
8495
-
8496
- // Handle memory leak in IE
8497
- script.onload = script.onreadystatechange = null;
8498
-
8499
- // Remove the script
8500
- if ( script.parentNode ) {
8501
- script.parentNode.removeChild( script );
8502
- }
8503
-
8504
- // Dereference the script
8505
- script = null;
8506
-
8507
- // Callback if not abort
8508
- if ( !isAbort ) {
8509
- callback( 200, "success" );
8510
- }
8511
- }
8512
- };
8513
-
8514
- // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
8515
- // Use native DOM manipulation to avoid our domManip AJAX trickery
8516
- head.insertBefore( script, head.firstChild );
8517
- },
8518
-
8519
- abort: function() {
8520
- if ( script ) {
8521
- script.onload( undefined, true );
8522
- }
8523
- }
8524
- };
8525
- }
8526
- });
8527
- var oldCallbacks = [],
8528
- rjsonp = /(=)\?(?=&|$)|\?\?/;
8529
-
8530
- // Default jsonp settings
8531
- jQuery.ajaxSetup({
8532
- jsonp: "callback",
8533
- jsonpCallback: function() {
8534
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
8535
- this[ callback ] = true;
8536
- return callback;
8537
- }
8538
- });
8539
-
8540
- // Detect, normalize options and install callbacks for jsonp requests
8541
- jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
8542
-
8543
- var callbackName, overwritten, responseContainer,
8544
- jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
8545
- "url" :
8546
- typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
8547
- );
8548
-
8549
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
8550
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
8551
-
8552
- // Get callback name, remembering preexisting value associated with it
8553
- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
8554
- s.jsonpCallback() :
8555
- s.jsonpCallback;
8556
-
8557
- // Insert callback into url or form data
8558
- if ( jsonProp ) {
8559
- s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
8560
- } else if ( s.jsonp !== false ) {
8561
- s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
8562
- }
8563
-
8564
- // Use data converter to retrieve json after script execution
8565
- s.converters["script json"] = function() {
8566
- if ( !responseContainer ) {
8567
- jQuery.error( callbackName + " was not called" );
8568
- }
8569
- return responseContainer[ 0 ];
8570
- };
8571
-
8572
- // force json dataType
8573
- s.dataTypes[ 0 ] = "json";
8574
-
8575
- // Install callback
8576
- overwritten = window[ callbackName ];
8577
- window[ callbackName ] = function() {
8578
- responseContainer = arguments;
8579
- };
8580
-
8581
- // Clean-up function (fires after converters)
8582
- jqXHR.always(function() {
8583
- // Restore preexisting value
8584
- window[ callbackName ] = overwritten;
8585
-
8586
- // Save back as free
8587
- if ( s[ callbackName ] ) {
8588
- // make sure that re-using the options doesn't screw things around
8589
- s.jsonpCallback = originalSettings.jsonpCallback;
8590
-
8591
- // save the callback name for future use
8592
- oldCallbacks.push( callbackName );
8593
- }
8594
-
8595
- // Call if it was a function and we have a response
8596
- if ( responseContainer && jQuery.isFunction( overwritten ) ) {
8597
- overwritten( responseContainer[ 0 ] );
8598
- }
8599
-
8600
- responseContainer = overwritten = undefined;
8601
- });
8602
-
8603
- // Delegate to script
8604
- return "script";
8605
- }
8606
- });
8607
- var xhrCallbacks, xhrSupported,
8608
- xhrId = 0,
8609
- // #5280: Internet Explorer will keep connections alive if we don't abort on unload
8610
- xhrOnUnloadAbort = window.ActiveXObject && function() {
8611
- // Abort all pending requests
8612
- var key;
8613
- for ( key in xhrCallbacks ) {
8614
- xhrCallbacks[ key ]( undefined, true );
8615
- }
8616
- };
8617
-
8618
- // Functions to create xhrs
8619
- function createStandardXHR() {
8620
- try {
8621
- return new window.XMLHttpRequest();
8622
- } catch( e ) {}
8623
- }
8624
-
8625
- function createActiveXHR() {
8626
- try {
8627
- return new window.ActiveXObject("Microsoft.XMLHTTP");
8628
- } catch( e ) {}
8629
- }
8630
-
8631
- // Create the request object
8632
- // (This is still attached to ajaxSettings for backward compatibility)
8633
- jQuery.ajaxSettings.xhr = window.ActiveXObject ?
8634
- /* Microsoft failed to properly
8635
- * implement the XMLHttpRequest in IE7 (can't request local files),
8636
- * so we use the ActiveXObject when it is available
8637
- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
8638
- * we need a fallback.
8639
- */
8640
- function() {
8641
- return !this.isLocal && createStandardXHR() || createActiveXHR();
8642
- } :
8643
- // For all other browsers, use the standard XMLHttpRequest object
8644
- createStandardXHR;
8645
-
8646
- // Determine support properties
8647
- xhrSupported = jQuery.ajaxSettings.xhr();
8648
- jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
8649
- xhrSupported = jQuery.support.ajax = !!xhrSupported;
8650
-
8651
- // Create transport if the browser can provide an xhr
8652
- if ( xhrSupported ) {
8653
-
8654
- jQuery.ajaxTransport(function( s ) {
8655
- // Cross domain only allowed if supported through XMLHttpRequest
8656
- if ( !s.crossDomain || jQuery.support.cors ) {
8657
-
8658
- var callback;
8659
-
8660
- return {
8661
- send: function( headers, complete ) {
8662
-
8663
- // Get a new xhr
8664
- var handle, i,
8665
- xhr = s.xhr();
8666
-
8667
- // Open the socket
8668
- // Passing null username, generates a login popup on Opera (#2865)
8669
- if ( s.username ) {
8670
- xhr.open( s.type, s.url, s.async, s.username, s.password );
8671
- } else {
8672
- xhr.open( s.type, s.url, s.async );
8673
- }
8674
-
8675
- // Apply custom fields if provided
8676
- if ( s.xhrFields ) {
8677
- for ( i in s.xhrFields ) {
8678
- xhr[ i ] = s.xhrFields[ i ];
8679
- }
8680
- }
8681
-
8682
- // Override mime type if needed
8683
- if ( s.mimeType && xhr.overrideMimeType ) {
8684
- xhr.overrideMimeType( s.mimeType );
8685
- }
8686
-
8687
- // X-Requested-With header
8688
- // For cross-domain requests, seeing as conditions for a preflight are
8689
- // akin to a jigsaw puzzle, we simply never set it to be sure.
8690
- // (it can always be set on a per-request basis or even using ajaxSetup)
8691
- // For same-domain requests, won't change header if already provided.
8692
- if ( !s.crossDomain && !headers["X-Requested-With"] ) {
8693
- headers["X-Requested-With"] = "XMLHttpRequest";
8694
- }
8695
-
8696
- // Need an extra try/catch for cross domain requests in Firefox 3
8697
- try {
8698
- for ( i in headers ) {
8699
- xhr.setRequestHeader( i, headers[ i ] );
8700
- }
8701
- } catch( err ) {}
8702
-
8703
- // Do send the request
8704
- // This may raise an exception which is actually
8705
- // handled in jQuery.ajax (so no try/catch here)
8706
- xhr.send( ( s.hasContent && s.data ) || null );
8707
-
8708
- // Listener
8709
- callback = function( _, isAbort ) {
8710
- var status, responseHeaders, statusText, responses;
8711
-
8712
- // Firefox throws exceptions when accessing properties
8713
- // of an xhr when a network error occurred
8714
- // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
8715
- try {
8716
-
8717
- // Was never called and is aborted or complete
8718
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
8719
-
8720
- // Only called once
8721
- callback = undefined;
8722
-
8723
- // Do not keep as active anymore
8724
- if ( handle ) {
8725
- xhr.onreadystatechange = jQuery.noop;
8726
- if ( xhrOnUnloadAbort ) {
8727
- delete xhrCallbacks[ handle ];
8728
- }
8729
- }
8730
-
8731
- // If it's an abort
8732
- if ( isAbort ) {
8733
- // Abort it manually if needed
8734
- if ( xhr.readyState !== 4 ) {
8735
- xhr.abort();
8736
- }
8737
- } else {
8738
- responses = {};
8739
- status = xhr.status;
8740
- responseHeaders = xhr.getAllResponseHeaders();
8741
-
8742
- // When requesting binary data, IE6-9 will throw an exception
8743
- // on any attempt to access responseText (#11426)
8744
- if ( typeof xhr.responseText === "string" ) {
8745
- responses.text = xhr.responseText;
8746
- }
8747
-
8748
- // Firefox throws an exception when accessing
8749
- // statusText for faulty cross-domain requests
8750
- try {
8751
- statusText = xhr.statusText;
8752
- } catch( e ) {
8753
- // We normalize with Webkit giving an empty statusText
8754
- statusText = "";
8755
- }
8756
-
8757
- // Filter status for non standard behaviors
8758
-
8759
- // If the request is local and we have data: assume a success
8760
- // (success with no data won't get notified, that's the best we
8761
- // can do given current implementations)
8762
- if ( !status && s.isLocal && !s.crossDomain ) {
8763
- status = responses.text ? 200 : 404;
8764
- // IE - #1450: sometimes returns 1223 when it should be 204
8765
- } else if ( status === 1223 ) {
8766
- status = 204;
8767
- }
8768
- }
8769
- }
8770
- } catch( firefoxAccessException ) {
8771
- if ( !isAbort ) {
8772
- complete( -1, firefoxAccessException );
8773
- }
8774
- }
8775
-
8776
- // Call complete if needed
8777
- if ( responses ) {
8778
- complete( status, statusText, responses, responseHeaders );
8779
- }
8780
- };
8781
-
8782
- if ( !s.async ) {
8783
- // if we're in sync mode we fire the callback
8784
- callback();
8785
- } else if ( xhr.readyState === 4 ) {
8786
- // (IE6 & IE7) if it's in cache and has been
8787
- // retrieved directly we need to fire the callback
8788
- setTimeout( callback );
8789
- } else {
8790
- handle = ++xhrId;
8791
- if ( xhrOnUnloadAbort ) {
8792
- // Create the active xhrs callbacks list if needed
8793
- // and attach the unload handler
8794
- if ( !xhrCallbacks ) {
8795
- xhrCallbacks = {};
8796
- jQuery( window ).unload( xhrOnUnloadAbort );
8797
- }
8798
- // Add to list of active xhrs callbacks
8799
- xhrCallbacks[ handle ] = callback;
8800
- }
8801
- xhr.onreadystatechange = callback;
8802
- }
8803
- },
8804
-
8805
- abort: function() {
8806
- if ( callback ) {
8807
- callback( undefined, true );
8808
- }
8809
- }
8810
- };
8811
- }
8812
- });
8813
- }
8814
- var fxNow, timerId,
8815
- rfxtypes = /^(?:toggle|show|hide)$/,
8816
- rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
8817
- rrun = /queueHooks$/,
8818
- animationPrefilters = [ defaultPrefilter ],
8819
- tweeners = {
8820
- "*": [function( prop, value ) {
8821
- var tween = this.createTween( prop, value ),
8822
- target = tween.cur(),
8823
- parts = rfxnum.exec( value ),
8824
- unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
8825
-
8826
- // Starting value computation is required for potential unit mismatches
8827
- start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
8828
- rfxnum.exec( jQuery.css( tween.elem, prop ) ),
8829
- scale = 1,
8830
- maxIterations = 20;
8831
-
8832
- if ( start && start[ 3 ] !== unit ) {
8833
- // Trust units reported by jQuery.css
8834
- unit = unit || start[ 3 ];
8835
-
8836
- // Make sure we update the tween properties later on
8837
- parts = parts || [];
8838
-
8839
- // Iteratively approximate from a nonzero starting point
8840
- start = +target || 1;
8841
-
8842
- do {
8843
- // If previous iteration zeroed out, double until we get *something*
8844
- // Use a string for doubling factor so we don't accidentally see scale as unchanged below
8845
- scale = scale || ".5";
8846
-
8847
- // Adjust and apply
8848
- start = start / scale;
8849
- jQuery.style( tween.elem, prop, start + unit );
8850
-
8851
- // Update scale, tolerating zero or NaN from tween.cur()
8852
- // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
8853
- } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
8854
- }
8855
-
8856
- // Update tween properties
8857
- if ( parts ) {
8858
- start = tween.start = +start || +target || 0;
8859
- tween.unit = unit;
8860
- // If a +=/-= token was provided, we're doing a relative animation
8861
- tween.end = parts[ 1 ] ?
8862
- start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
8863
- +parts[ 2 ];
8864
- }
8865
-
8866
- return tween;
8867
- }]
8868
- };
8869
-
8870
- // Animations created synchronously will run synchronously
8871
- function createFxNow() {
8872
- setTimeout(function() {
8873
- fxNow = undefined;
8874
- });
8875
- return ( fxNow = jQuery.now() );
8876
- }
8877
-
8878
- function createTween( value, prop, animation ) {
8879
- var tween,
8880
- collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
8881
- index = 0,
8882
- length = collection.length;
8883
- for ( ; index < length; index++ ) {
8884
- if ( (tween = collection[ index ].call( animation, prop, value )) ) {
8885
-
8886
- // we're done with this property
8887
- return tween;
8888
- }
8889
- }
8890
- }
8891
-
8892
- function Animation( elem, properties, options ) {
8893
- var result,
8894
- stopped,
8895
- index = 0,
8896
- length = animationPrefilters.length,
8897
- deferred = jQuery.Deferred().always( function() {
8898
- // don't match elem in the :animated selector
8899
- delete tick.elem;
8900
- }),
8901
- tick = function() {
8902
- if ( stopped ) {
8903
- return false;
8904
- }
8905
- var currentTime = fxNow || createFxNow(),
8906
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
8907
- // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
8908
- temp = remaining / animation.duration || 0,
8909
- percent = 1 - temp,
8910
- index = 0,
8911
- length = animation.tweens.length;
8912
-
8913
- for ( ; index < length ; index++ ) {
8914
- animation.tweens[ index ].run( percent );
8915
- }
8916
-
8917
- deferred.notifyWith( elem, [ animation, percent, remaining ]);
8918
-
8919
- if ( percent < 1 && length ) {
8920
- return remaining;
8921
- } else {
8922
- deferred.resolveWith( elem, [ animation ] );
8923
- return false;
8924
- }
8925
- },
8926
- animation = deferred.promise({
8927
- elem: elem,
8928
- props: jQuery.extend( {}, properties ),
8929
- opts: jQuery.extend( true, { specialEasing: {} }, options ),
8930
- originalProperties: properties,
8931
- originalOptions: options,
8932
- startTime: fxNow || createFxNow(),
8933
- duration: options.duration,
8934
- tweens: [],
8935
- createTween: function( prop, end ) {
8936
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
8937
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
8938
- animation.tweens.push( tween );
8939
- return tween;
8940
- },
8941
- stop: function( gotoEnd ) {
8942
- var index = 0,
8943
- // if we are going to the end, we want to run all the tweens
8944
- // otherwise we skip this part
8945
- length = gotoEnd ? animation.tweens.length : 0;
8946
- if ( stopped ) {
8947
- return this;
8948
- }
8949
- stopped = true;
8950
- for ( ; index < length ; index++ ) {
8951
- animation.tweens[ index ].run( 1 );
8952
- }
8953
-
8954
- // resolve when we played the last frame
8955
- // otherwise, reject
8956
- if ( gotoEnd ) {
8957
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
8958
- } else {
8959
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
8960
- }
8961
- return this;
8962
- }
8963
- }),
8964
- props = animation.props;
8965
-
8966
- propFilter( props, animation.opts.specialEasing );
8967
-
8968
- for ( ; index < length ; index++ ) {
8969
- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
8970
- if ( result ) {
8971
- return result;
8972
- }
8973
- }
8974
-
8975
- jQuery.map( props, createTween, animation );
8976
-
8977
- if ( jQuery.isFunction( animation.opts.start ) ) {
8978
- animation.opts.start.call( elem, animation );
8979
- }
8980
-
8981
- jQuery.fx.timer(
8982
- jQuery.extend( tick, {
8983
- elem: elem,
8984
- anim: animation,
8985
- queue: animation.opts.queue
8986
- })
8987
- );
8988
-
8989
- // attach callbacks from options
8990
- return animation.progress( animation.opts.progress )
8991
- .done( animation.opts.done, animation.opts.complete )
8992
- .fail( animation.opts.fail )
8993
- .always( animation.opts.always );
8994
- }
8995
-
8996
- function propFilter( props, specialEasing ) {
8997
- var index, name, easing, value, hooks;
8998
-
8999
- // camelCase, specialEasing and expand cssHook pass
9000
- for ( index in props ) {
9001
- name = jQuery.camelCase( index );
9002
- easing = specialEasing[ name ];
9003
- value = props[ index ];
9004
- if ( jQuery.isArray( value ) ) {
9005
- easing = value[ 1 ];
9006
- value = props[ index ] = value[ 0 ];
9007
- }
9008
-
9009
- if ( index !== name ) {
9010
- props[ name ] = value;
9011
- delete props[ index ];
9012
- }
9013
-
9014
- hooks = jQuery.cssHooks[ name ];
9015
- if ( hooks && "expand" in hooks ) {
9016
- value = hooks.expand( value );
9017
- delete props[ name ];
9018
-
9019
- // not quite $.extend, this wont overwrite keys already present.
9020
- // also - reusing 'index' from above because we have the correct "name"
9021
- for ( index in value ) {
9022
- if ( !( index in props ) ) {
9023
- props[ index ] = value[ index ];
9024
- specialEasing[ index ] = easing;
9025
- }
9026
- }
9027
- } else {
9028
- specialEasing[ name ] = easing;
9029
- }
9030
- }
9031
- }
9032
-
9033
- jQuery.Animation = jQuery.extend( Animation, {
9034
-
9035
- tweener: function( props, callback ) {
9036
- if ( jQuery.isFunction( props ) ) {
9037
- callback = props;
9038
- props = [ "*" ];
9039
- } else {
9040
- props = props.split(" ");
9041
- }
9042
-
9043
- var prop,
9044
- index = 0,
9045
- length = props.length;
9046
-
9047
- for ( ; index < length ; index++ ) {
9048
- prop = props[ index ];
9049
- tweeners[ prop ] = tweeners[ prop ] || [];
9050
- tweeners[ prop ].unshift( callback );
9051
- }
9052
- },
9053
-
9054
- prefilter: function( callback, prepend ) {
9055
- if ( prepend ) {
9056
- animationPrefilters.unshift( callback );
9057
- } else {
9058
- animationPrefilters.push( callback );
9059
- }
9060
- }
9061
- });
9062
-
9063
- function defaultPrefilter( elem, props, opts ) {
9064
- /* jshint validthis: true */
9065
- var prop, value, toggle, tween, hooks, oldfire,
9066
- anim = this,
9067
- orig = {},
9068
- style = elem.style,
9069
- hidden = elem.nodeType && isHidden( elem ),
9070
- dataShow = jQuery._data( elem, "fxshow" );
9071
-
9072
- // handle queue: false promises
9073
- if ( !opts.queue ) {
9074
- hooks = jQuery._queueHooks( elem, "fx" );
9075
- if ( hooks.unqueued == null ) {
9076
- hooks.unqueued = 0;
9077
- oldfire = hooks.empty.fire;
9078
- hooks.empty.fire = function() {
9079
- if ( !hooks.unqueued ) {
9080
- oldfire();
9081
- }
9082
- };
9083
- }
9084
- hooks.unqueued++;
9085
-
9086
- anim.always(function() {
9087
- // doing this makes sure that the complete handler will be called
9088
- // before this completes
9089
- anim.always(function() {
9090
- hooks.unqueued--;
9091
- if ( !jQuery.queue( elem, "fx" ).length ) {
9092
- hooks.empty.fire();
9093
- }
9094
- });
9095
- });
9096
- }
9097
-
9098
- // height/width overflow pass
9099
- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
9100
- // Make sure that nothing sneaks out
9101
- // Record all 3 overflow attributes because IE does not
9102
- // change the overflow attribute when overflowX and
9103
- // overflowY are set to the same value
9104
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
9105
-
9106
- // Set display property to inline-block for height/width
9107
- // animations on inline elements that are having width/height animated
9108
- if ( jQuery.css( elem, "display" ) === "inline" &&
9109
- jQuery.css( elem, "float" ) === "none" ) {
9110
-
9111
- // inline-level elements accept inline-block;
9112
- // block-level elements need to be inline with layout
9113
- if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
9114
- style.display = "inline-block";
9115
-
9116
- } else {
9117
- style.zoom = 1;
9118
- }
9119
- }
9120
- }
9121
-
9122
- if ( opts.overflow ) {
9123
- style.overflow = "hidden";
9124
- if ( !jQuery.support.shrinkWrapBlocks ) {
9125
- anim.always(function() {
9126
- style.overflow = opts.overflow[ 0 ];
9127
- style.overflowX = opts.overflow[ 1 ];
9128
- style.overflowY = opts.overflow[ 2 ];
9129
- });
9130
- }
9131
- }
9132
-
9133
-
9134
- // show/hide pass
9135
- for ( prop in props ) {
9136
- value = props[ prop ];
9137
- if ( rfxtypes.exec( value ) ) {
9138
- delete props[ prop ];
9139
- toggle = toggle || value === "toggle";
9140
- if ( value === ( hidden ? "hide" : "show" ) ) {
9141
- continue;
9142
- }
9143
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
9144
- }
9145
- }
9146
-
9147
- if ( !jQuery.isEmptyObject( orig ) ) {
9148
- if ( dataShow ) {
9149
- if ( "hidden" in dataShow ) {
9150
- hidden = dataShow.hidden;
9151
- }
9152
- } else {
9153
- dataShow = jQuery._data( elem, "fxshow", {} );
9154
- }
9155
-
9156
- // store state if its toggle - enables .stop().toggle() to "reverse"
9157
- if ( toggle ) {
9158
- dataShow.hidden = !hidden;
9159
- }
9160
- if ( hidden ) {
9161
- jQuery( elem ).show();
9162
- } else {
9163
- anim.done(function() {
9164
- jQuery( elem ).hide();
9165
- });
9166
- }
9167
- anim.done(function() {
9168
- var prop;
9169
- jQuery._removeData( elem, "fxshow" );
9170
- for ( prop in orig ) {
9171
- jQuery.style( elem, prop, orig[ prop ] );
9172
- }
9173
- });
9174
- for ( prop in orig ) {
9175
- tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
9176
-
9177
- if ( !( prop in dataShow ) ) {
9178
- dataShow[ prop ] = tween.start;
9179
- if ( hidden ) {
9180
- tween.end = tween.start;
9181
- tween.start = prop === "width" || prop === "height" ? 1 : 0;
9182
- }
9183
- }
9184
- }
9185
- }
9186
- }
9187
-
9188
- function Tween( elem, options, prop, end, easing ) {
9189
- return new Tween.prototype.init( elem, options, prop, end, easing );
9190
- }
9191
- jQuery.Tween = Tween;
9192
-
9193
- Tween.prototype = {
9194
- constructor: Tween,
9195
- init: function( elem, options, prop, end, easing, unit ) {
9196
- this.elem = elem;
9197
- this.prop = prop;
9198
- this.easing = easing || "swing";
9199
- this.options = options;
9200
- this.start = this.now = this.cur();
9201
- this.end = end;
9202
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
9203
- },
9204
- cur: function() {
9205
- var hooks = Tween.propHooks[ this.prop ];
9206
-
9207
- return hooks && hooks.get ?
9208
- hooks.get( this ) :
9209
- Tween.propHooks._default.get( this );
9210
- },
9211
- run: function( percent ) {
9212
- var eased,
9213
- hooks = Tween.propHooks[ this.prop ];
9214
-
9215
- if ( this.options.duration ) {
9216
- this.pos = eased = jQuery.easing[ this.easing ](
9217
- percent, this.options.duration * percent, 0, 1, this.options.duration
9218
- );
9219
- } else {
9220
- this.pos = eased = percent;
9221
- }
9222
- this.now = ( this.end - this.start ) * eased + this.start;
9223
-
9224
- if ( this.options.step ) {
9225
- this.options.step.call( this.elem, this.now, this );
9226
- }
9227
-
9228
- if ( hooks && hooks.set ) {
9229
- hooks.set( this );
9230
- } else {
9231
- Tween.propHooks._default.set( this );
9232
- }
9233
- return this;
9234
- }
9235
- };
9236
-
9237
- Tween.prototype.init.prototype = Tween.prototype;
9238
-
9239
- Tween.propHooks = {
9240
- _default: {
9241
- get: function( tween ) {
9242
- var result;
9243
-
9244
- if ( tween.elem[ tween.prop ] != null &&
9245
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
9246
- return tween.elem[ tween.prop ];
9247
- }
9248
-
9249
- // passing an empty string as a 3rd parameter to .css will automatically
9250
- // attempt a parseFloat and fallback to a string if the parse fails
9251
- // so, simple values such as "10px" are parsed to Float.
9252
- // complex values such as "rotate(1rad)" are returned as is.
9253
- result = jQuery.css( tween.elem, tween.prop, "" );
9254
- // Empty strings, null, undefined and "auto" are converted to 0.
9255
- return !result || result === "auto" ? 0 : result;
9256
- },
9257
- set: function( tween ) {
9258
- // use step hook for back compat - use cssHook if its there - use .style if its
9259
- // available and use plain properties where available
9260
- if ( jQuery.fx.step[ tween.prop ] ) {
9261
- jQuery.fx.step[ tween.prop ]( tween );
9262
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
9263
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
9264
- } else {
9265
- tween.elem[ tween.prop ] = tween.now;
9266
- }
9267
- }
9268
- }
9269
- };
9270
-
9271
- // Support: IE <=9
9272
- // Panic based approach to setting things on disconnected nodes
9273
-
9274
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
9275
- set: function( tween ) {
9276
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
9277
- tween.elem[ tween.prop ] = tween.now;
9278
- }
9279
- }
9280
- };
9281
-
9282
- jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
9283
- var cssFn = jQuery.fn[ name ];
9284
- jQuery.fn[ name ] = function( speed, easing, callback ) {
9285
- return speed == null || typeof speed === "boolean" ?
9286
- cssFn.apply( this, arguments ) :
9287
- this.animate( genFx( name, true ), speed, easing, callback );
9288
- };
9289
- });
9290
-
9291
- jQuery.fn.extend({
9292
- fadeTo: function( speed, to, easing, callback ) {
9293
-
9294
- // show any hidden elements after setting opacity to 0
9295
- return this.filter( isHidden ).css( "opacity", 0 ).show()
9296
-
9297
- // animate to the value specified
9298
- .end().animate({ opacity: to }, speed, easing, callback );
9299
- },
9300
- animate: function( prop, speed, easing, callback ) {
9301
- var empty = jQuery.isEmptyObject( prop ),
9302
- optall = jQuery.speed( speed, easing, callback ),
9303
- doAnimation = function() {
9304
- // Operate on a copy of prop so per-property easing won't be lost
9305
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
9306
-
9307
- // Empty animations, or finishing resolves immediately
9308
- if ( empty || jQuery._data( this, "finish" ) ) {
9309
- anim.stop( true );
9310
- }
9311
- };
9312
- doAnimation.finish = doAnimation;
9313
-
9314
- return empty || optall.queue === false ?
9315
- this.each( doAnimation ) :
9316
- this.queue( optall.queue, doAnimation );
9317
- },
9318
- stop: function( type, clearQueue, gotoEnd ) {
9319
- var stopQueue = function( hooks ) {
9320
- var stop = hooks.stop;
9321
- delete hooks.stop;
9322
- stop( gotoEnd );
9323
- };
9324
-
9325
- if ( typeof type !== "string" ) {
9326
- gotoEnd = clearQueue;
9327
- clearQueue = type;
9328
- type = undefined;
9329
- }
9330
- if ( clearQueue && type !== false ) {
9331
- this.queue( type || "fx", [] );
9332
- }
9333
-
9334
- return this.each(function() {
9335
- var dequeue = true,
9336
- index = type != null && type + "queueHooks",
9337
- timers = jQuery.timers,
9338
- data = jQuery._data( this );
9339
-
9340
- if ( index ) {
9341
- if ( data[ index ] && data[ index ].stop ) {
9342
- stopQueue( data[ index ] );
9343
- }
9344
- } else {
9345
- for ( index in data ) {
9346
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
9347
- stopQueue( data[ index ] );
9348
- }
9349
- }
9350
- }
9351
-
9352
- for ( index = timers.length; index--; ) {
9353
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
9354
- timers[ index ].anim.stop( gotoEnd );
9355
- dequeue = false;
9356
- timers.splice( index, 1 );
9357
- }
9358
- }
9359
-
9360
- // start the next in the queue if the last step wasn't forced
9361
- // timers currently will call their complete callbacks, which will dequeue
9362
- // but only if they were gotoEnd
9363
- if ( dequeue || !gotoEnd ) {
9364
- jQuery.dequeue( this, type );
9365
- }
9366
- });
9367
- },
9368
- finish: function( type ) {
9369
- if ( type !== false ) {
9370
- type = type || "fx";
9371
- }
9372
- return this.each(function() {
9373
- var index,
9374
- data = jQuery._data( this ),
9375
- queue = data[ type + "queue" ],
9376
- hooks = data[ type + "queueHooks" ],
9377
- timers = jQuery.timers,
9378
- length = queue ? queue.length : 0;
9379
-
9380
- // enable finishing flag on private data
9381
- data.finish = true;
9382
-
9383
- // empty the queue first
9384
- jQuery.queue( this, type, [] );
9385
-
9386
- if ( hooks && hooks.stop ) {
9387
- hooks.stop.call( this, true );
9388
- }
9389
-
9390
- // look for any active animations, and finish them
9391
- for ( index = timers.length; index--; ) {
9392
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
9393
- timers[ index ].anim.stop( true );
9394
- timers.splice( index, 1 );
9395
- }
9396
- }
9397
-
9398
- // look for any animations in the old queue and finish them
9399
- for ( index = 0; index < length; index++ ) {
9400
- if ( queue[ index ] && queue[ index ].finish ) {
9401
- queue[ index ].finish.call( this );
9402
- }
9403
- }
9404
-
9405
- // turn off finishing flag
9406
- delete data.finish;
9407
- });
9408
- }
9409
- });
9410
-
9411
- // Generate parameters to create a standard animation
9412
- function genFx( type, includeWidth ) {
9413
- var which,
9414
- attrs = { height: type },
9415
- i = 0;
9416
-
9417
- // if we include width, step value is 1 to do all cssExpand values,
9418
- // if we don't include width, step value is 2 to skip over Left and Right
9419
- includeWidth = includeWidth? 1 : 0;
9420
- for( ; i < 4 ; i += 2 - includeWidth ) {
9421
- which = cssExpand[ i ];
9422
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
9423
- }
9424
-
9425
- if ( includeWidth ) {
9426
- attrs.opacity = attrs.width = type;
9427
- }
9428
-
9429
- return attrs;
9430
- }
9431
-
9432
- // Generate shortcuts for custom animations
9433
- jQuery.each({
9434
- slideDown: genFx("show"),
9435
- slideUp: genFx("hide"),
9436
- slideToggle: genFx("toggle"),
9437
- fadeIn: { opacity: "show" },
9438
- fadeOut: { opacity: "hide" },
9439
- fadeToggle: { opacity: "toggle" }
9440
- }, function( name, props ) {
9441
- jQuery.fn[ name ] = function( speed, easing, callback ) {
9442
- return this.animate( props, speed, easing, callback );
9443
- };
9444
- });
9445
-
9446
- jQuery.speed = function( speed, easing, fn ) {
9447
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
9448
- complete: fn || !fn && easing ||
9449
- jQuery.isFunction( speed ) && speed,
9450
- duration: speed,
9451
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
9452
- };
9453
-
9454
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
9455
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
9456
-
9457
- // normalize opt.queue - true/undefined/null -> "fx"
9458
- if ( opt.queue == null || opt.queue === true ) {
9459
- opt.queue = "fx";
9460
- }
9461
-
9462
- // Queueing
9463
- opt.old = opt.complete;
9464
-
9465
- opt.complete = function() {
9466
- if ( jQuery.isFunction( opt.old ) ) {
9467
- opt.old.call( this );
9468
- }
9469
-
9470
- if ( opt.queue ) {
9471
- jQuery.dequeue( this, opt.queue );
9472
- }
9473
- };
9474
-
9475
- return opt;
9476
- };
9477
-
9478
- jQuery.easing = {
9479
- linear: function( p ) {
9480
- return p;
9481
- },
9482
- swing: function( p ) {
9483
- return 0.5 - Math.cos( p*Math.PI ) / 2;
9484
- }
9485
- };
9486
-
9487
- jQuery.timers = [];
9488
- jQuery.fx = Tween.prototype.init;
9489
- jQuery.fx.tick = function() {
9490
- var timer,
9491
- timers = jQuery.timers,
9492
- i = 0;
9493
-
9494
- fxNow = jQuery.now();
9495
-
9496
- for ( ; i < timers.length; i++ ) {
9497
- timer = timers[ i ];
9498
- // Checks the timer has not already been removed
9499
- if ( !timer() && timers[ i ] === timer ) {
9500
- timers.splice( i--, 1 );
9501
- }
9502
- }
9503
-
9504
- if ( !timers.length ) {
9505
- jQuery.fx.stop();
9506
- }
9507
- fxNow = undefined;
9508
- };
9509
-
9510
- jQuery.fx.timer = function( timer ) {
9511
- if ( timer() && jQuery.timers.push( timer ) ) {
9512
- jQuery.fx.start();
9513
- }
9514
- };
9515
-
9516
- jQuery.fx.interval = 13;
9517
-
9518
- jQuery.fx.start = function() {
9519
- if ( !timerId ) {
9520
- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
9521
- }
9522
- };
9523
-
9524
- jQuery.fx.stop = function() {
9525
- clearInterval( timerId );
9526
- timerId = null;
9527
- };
9528
-
9529
- jQuery.fx.speeds = {
9530
- slow: 600,
9531
- fast: 200,
9532
- // Default speed
9533
- _default: 400
9534
- };
9535
-
9536
- // Back Compat <1.8 extension point
9537
- jQuery.fx.step = {};
9538
-
9539
- if ( jQuery.expr && jQuery.expr.filters ) {
9540
- jQuery.expr.filters.animated = function( elem ) {
9541
- return jQuery.grep(jQuery.timers, function( fn ) {
9542
- return elem === fn.elem;
9543
- }).length;
9544
- };
9545
- }
9546
- jQuery.fn.offset = function( options ) {
9547
- if ( arguments.length ) {
9548
- return options === undefined ?
9549
- this :
9550
- this.each(function( i ) {
9551
- jQuery.offset.setOffset( this, options, i );
9552
- });
9553
- }
9554
-
9555
- var docElem, win,
9556
- box = { top: 0, left: 0 },
9557
- elem = this[ 0 ],
9558
- doc = elem && elem.ownerDocument;
9559
-
9560
- if ( !doc ) {
9561
- return;
9562
- }
9563
-
9564
- docElem = doc.documentElement;
9565
-
9566
- // Make sure it's not a disconnected DOM node
9567
- if ( !jQuery.contains( docElem, elem ) ) {
9568
- return box;
9569
- }
9570
-
9571
- // If we don't have gBCR, just use 0,0 rather than error
9572
- // BlackBerry 5, iOS 3 (original iPhone)
9573
- if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
9574
- box = elem.getBoundingClientRect();
9575
- }
9576
- win = getWindow( doc );
9577
- return {
9578
- top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
9579
- left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
9580
- };
9581
- };
9582
-
9583
- jQuery.offset = {
9584
-
9585
- setOffset: function( elem, options, i ) {
9586
- var position = jQuery.css( elem, "position" );
9587
-
9588
- // set position first, in-case top/left are set even on static elem
9589
- if ( position === "static" ) {
9590
- elem.style.position = "relative";
9591
- }
9592
-
9593
- var curElem = jQuery( elem ),
9594
- curOffset = curElem.offset(),
9595
- curCSSTop = jQuery.css( elem, "top" ),
9596
- curCSSLeft = jQuery.css( elem, "left" ),
9597
- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
9598
- props = {}, curPosition = {}, curTop, curLeft;
9599
-
9600
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
9601
- if ( calculatePosition ) {
9602
- curPosition = curElem.position();
9603
- curTop = curPosition.top;
9604
- curLeft = curPosition.left;
9605
- } else {
9606
- curTop = parseFloat( curCSSTop ) || 0;
9607
- curLeft = parseFloat( curCSSLeft ) || 0;
9608
- }
9609
-
9610
- if ( jQuery.isFunction( options ) ) {
9611
- options = options.call( elem, i, curOffset );
9612
- }
9613
-
9614
- if ( options.top != null ) {
9615
- props.top = ( options.top - curOffset.top ) + curTop;
9616
- }
9617
- if ( options.left != null ) {
9618
- props.left = ( options.left - curOffset.left ) + curLeft;
9619
- }
9620
-
9621
- if ( "using" in options ) {
9622
- options.using.call( elem, props );
9623
- } else {
9624
- curElem.css( props );
9625
- }
9626
- }
9627
- };
9628
-
9629
-
9630
- jQuery.fn.extend({
9631
-
9632
- position: function() {
9633
- if ( !this[ 0 ] ) {
9634
- return;
9635
- }
9636
-
9637
- var offsetParent, offset,
9638
- parentOffset = { top: 0, left: 0 },
9639
- elem = this[ 0 ];
9640
-
9641
- // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
9642
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
9643
- // we assume that getBoundingClientRect is available when computed position is fixed
9644
- offset = elem.getBoundingClientRect();
9645
- } else {
9646
- // Get *real* offsetParent
9647
- offsetParent = this.offsetParent();
9648
-
9649
- // Get correct offsets
9650
- offset = this.offset();
9651
- if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9652
- parentOffset = offsetParent.offset();
9653
- }
9654
-
9655
- // Add offsetParent borders
9656
- parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
9657
- parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
9658
- }
9659
-
9660
- // Subtract parent offsets and element margins
9661
- // note: when an element has margin: auto the offsetLeft and marginLeft
9662
- // are the same in Safari causing offset.left to incorrectly be 0
9663
- return {
9664
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9665
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
9666
- };
9667
- },
9668
-
9669
- offsetParent: function() {
9670
- return this.map(function() {
9671
- var offsetParent = this.offsetParent || docElem;
9672
- while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
9673
- offsetParent = offsetParent.offsetParent;
9674
- }
9675
- return offsetParent || docElem;
9676
- });
9677
- }
9678
- });
9679
-
9680
-
9681
- // Create scrollLeft and scrollTop methods
9682
- jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
9683
- var top = /Y/.test( prop );
9684
-
9685
- jQuery.fn[ method ] = function( val ) {
9686
- return jQuery.access( this, function( elem, method, val ) {
9687
- var win = getWindow( elem );
9688
-
9689
- if ( val === undefined ) {
9690
- return win ? (prop in win) ? win[ prop ] :
9691
- win.document.documentElement[ method ] :
9692
- elem[ method ];
9693
- }
9694
-
9695
- if ( win ) {
9696
- win.scrollTo(
9697
- !top ? val : jQuery( win ).scrollLeft(),
9698
- top ? val : jQuery( win ).scrollTop()
9699
- );
9700
-
9701
- } else {
9702
- elem[ method ] = val;
9703
- }
9704
- }, method, val, arguments.length, null );
9705
- };
9706
- });
9707
-
9708
- function getWindow( elem ) {
9709
- return jQuery.isWindow( elem ) ?
9710
- elem :
9711
- elem.nodeType === 9 ?
9712
- elem.defaultView || elem.parentWindow :
9713
- false;
9714
- }
9715
- // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9716
- jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9717
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
9718
- // margin is only for outerHeight, outerWidth
9719
- jQuery.fn[ funcName ] = function( margin, value ) {
9720
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9721
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9722
-
9723
- return jQuery.access( this, function( elem, type, value ) {
9724
- var doc;
9725
-
9726
- if ( jQuery.isWindow( elem ) ) {
9727
- // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
9728
- // isn't a whole lot we can do. See pull request at this URL for discussion:
9729
- // https://github.com/jquery/jquery/pull/764
9730
- return elem.document.documentElement[ "client" + name ];
9731
- }
9732
-
9733
- // Get document width or height
9734
- if ( elem.nodeType === 9 ) {
9735
- doc = elem.documentElement;
9736
-
9737
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
9738
- // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
9739
- return Math.max(
9740
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9741
- elem.body[ "offset" + name ], doc[ "offset" + name ],
9742
- doc[ "client" + name ]
9743
- );
9744
- }
9745
-
9746
- return value === undefined ?
9747
- // Get width or height on the element, requesting but not forcing parseFloat
9748
- jQuery.css( elem, type, extra ) :
9749
-
9750
- // Set width or height on the element
9751
- jQuery.style( elem, type, value, extra );
9752
- }, type, chainable ? margin : undefined, chainable, null );
9753
- };
9754
- });
9755
- });
9756
- // Limit scope pollution from any deprecated API
9757
- // (function() {
9758
-
9759
- // The number of elements contained in the matched element set
9760
- jQuery.fn.size = function() {
9761
- return this.length;
9762
- };
9763
-
9764
- jQuery.fn.andSelf = jQuery.fn.addBack;
9765
-
9766
- // })();
9767
- if ( typeof module === "object" && module && typeof module.exports === "object" ) {
9768
- // Expose jQuery as module.exports in loaders that implement the Node
9769
- // module pattern (including browserify). Do not create the global, since
9770
- // the user will be storing it themselves locally, and globals are frowned
9771
- // upon in the Node module world.
9772
- module.exports = jQuery;
9773
- } else {
9774
- // Otherwise expose jQuery to the global object as usual
9775
- window.jQuery = window.$ = jQuery;
9776
-
9777
- // Register as a named AMD module, since jQuery can be concatenated with other
9778
- // files that may use define, but not via a proper concatenation script that
9779
- // understands anonymous AMD modules. A named AMD is safest and most robust
9780
- // way to register. Lowercase jquery is used because AMD module names are
9781
- // derived from file names, and jQuery is normally delivered in a lowercase
9782
- // file name. Do this after creating the global so that if an AMD module wants
9783
- // to call noConflict to hide this version of jQuery, it will work.
9784
- if ( typeof define === "function" && define.amd ) {
9785
- define( "jquery", [], function () { return jQuery; } );
9786
- }
9787
- }
9788
-
9789
- })( window );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
jquery-ui-1.11.4/images/ui-bg_diagonals-thick_18_b81900_40x40.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_diagonals-thick_20_666666_40x40.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_flat_10_000000_40x100.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_glass_100_f6f6f6_1x400.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_glass_100_fdf5ce_1x400.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_gloss-wave_35_f6a828_500x100.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_highlight-soft_100_eeeeee_1x100.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-bg_highlight-soft_75_ffe45c_1x100.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-icons_222222_256x240.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-icons_228ef1_256x240.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-icons_ef8c08_256x240.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-icons_ffd27a_256x240.png CHANGED
File without changes
jquery-ui-1.11.4/images/ui-icons_ffffff_256x240.png CHANGED
File without changes
jquery-ui-1.11.4/index.html DELETED
@@ -1,513 +0,0 @@
1
- <!doctype html>
2
- <html lang="us">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>jQuery UI Example Page</title>
6
- <link href="jquery-ui.css" rel="stylesheet">
7
- <style>
8
- body{
9
- font: 62.5% "Trebuchet MS", sans-serif;
10
- margin: 50px;
11
- }
12
- .demoHeaders {
13
- margin-top: 2em;
14
- }
15
- #dialog-link {
16
- padding: .4em 1em .4em 20px;
17
- text-decoration: none;
18
- position: relative;
19
- }
20
- #dialog-link span.ui-icon {
21
- margin: 0 5px 0 0;
22
- position: absolute;
23
- left: .2em;
24
- top: 50%;
25
- margin-top: -8px;
26
- }
27
- #icons {
28
- margin: 0;
29
- padding: 0;
30
- }
31
- #icons li {
32
- margin: 2px;
33
- position: relative;
34
- padding: 4px 0;
35
- cursor: pointer;
36
- float: left;
37
- list-style: none;
38
- }
39
- #icons span.ui-icon {
40
- float: left;
41
- margin: 0 4px;
42
- }
43
- .fakewindowcontain .ui-widget-overlay {
44
- position: absolute;
45
- }
46
- select {
47
- width: 200px;
48
- }
49
- </style>
50
- </head>
51
- <body>
52
-
53
- <h1>Welcome to jQuery UI!</h1>
54
-
55
- <div class="ui-widget">
56
- <p>This page demonstrates the widgets and theme you selected in Download Builder. Please make sure you are using them with a compatible jQuery version.</p>
57
- </div>
58
-
59
- <h1>YOUR COMPONENTS:</h1>
60
-
61
-
62
- <!-- Accordion -->
63
- <h2 class="demoHeaders">Accordion</h2>
64
- <div id="accordion">
65
- <h3>First</h3>
66
- <div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>
67
- <h3>Second</h3>
68
- <div>Phasellus mattis tincidunt nibh.</div>
69
- <h3>Third</h3>
70
- <div>Nam dui erat, auctor a, dignissim quis.</div>
71
- </div>
72
-
73
-
74
-
75
- <!-- Autocomplete -->
76
- <h2 class="demoHeaders">Autocomplete</h2>
77
- <div>
78
- <input id="autocomplete" title="type &quot;a&quot;">
79
- </div>
80
-
81
-
82
-
83
- <!-- Button -->
84
- <h2 class="demoHeaders">Button</h2>
85
- <button id="button">A button element</button>
86
- <form style="margin-top: 1em;">
87
- <div id="radioset">
88
- <input type="radio" id="radio1" name="radio"><label for="radio1">Choice 1</label>
89
- <input type="radio" id="radio2" name="radio" checked="checked"><label for="radio2">Choice 2</label>
90
- <input type="radio" id="radio3" name="radio"><label for="radio3">Choice 3</label>
91
- </div>
92
- </form>
93
-
94
-
95
-
96
- <!-- Tabs -->
97
- <h2 class="demoHeaders">Tabs</h2>
98
- <div id="tabs">
99
- <ul>
100
- <li><a href="#tabs-1">First</a></li>
101
- <li><a href="#tabs-2">Second</a></li>
102
- <li><a href="#tabs-3">Third</a></li>
103
- </ul>
104
- <div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
105
- <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div>
106
- <div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>
107
- </div>
108
-
109
-
110
-
111
- <!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller-->
112
- <h2 class="demoHeaders">Dialog</h2>
113
- <p><a href="#" id="dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a></p>
114
-
115
- <h2 class="demoHeaders">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2>
116
- <div style="position: relative; width: 96%; height: 200px; padding:1% 2%; overflow:hidden;" class="fakewindowcontain">
117
- <p>Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. </p><p>Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. </p><p>Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. </p><p>Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. </p>
118
-
119
- <!-- ui-dialog -->
120
- <div class="ui-overlay"><div class="ui-widget-overlay"></div><div class="ui-widget-shadow ui-corner-all" style="width: 302px; height: 152px; position: absolute; left: 50px; top: 30px;"></div></div>
121
- <div style="position: absolute; width: 280px; height: 130px;left: 50px; top: 30px; padding: 10px;" class="ui-widget ui-widget-content ui-corner-all">
122
- <div class="ui-dialog-content ui-widget-content" style="background: none; border: 0;">
123
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
124
- </div>
125
- </div>
126
-
127
- </div>
128
-
129
- <!-- ui-dialog -->
130
- <div id="dialog" title="Dialog Title">
131
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
132
- </div>
133
-
134
-
135
-
136
- <h2 class="demoHeaders">Framework Icons (content color preview)</h2>
137
- <ul id="icons" class="ui-widget ui-helper-clearfix">
138
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></li>
139
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></li>
140
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-e"><span class="ui-icon ui-icon-carat-1-e"></span></li>
141
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-se"><span class="ui-icon ui-icon-carat-1-se"></span></li>
142
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-s"><span class="ui-icon ui-icon-carat-1-s"></span></li>
143
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-sw"><span class="ui-icon ui-icon-carat-1-sw"></span></li>
144
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-w"><span class="ui-icon ui-icon-carat-1-w"></span></li>
145
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-nw"><span class="ui-icon ui-icon-carat-1-nw"></span></li>
146
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-n-s"><span class="ui-icon ui-icon-carat-2-n-s"></span></li>
147
- <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-e-w"><span class="ui-icon ui-icon-carat-2-e-w"></span></li>
148
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></li>
149
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></li>
150
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></li>
151
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></li>
152
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></li>
153
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-sw"><span class="ui-icon ui-icon-triangle-1-sw"></span></li>
154
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-w"><span class="ui-icon ui-icon-triangle-1-w"></span></li>
155
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-nw"><span class="ui-icon ui-icon-triangle-1-nw"></span></li>
156
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></li>
157
- <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></li>
158
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></li>
159
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></li>
160
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></li>
161
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></li>
162
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-s"><span class="ui-icon ui-icon-arrow-1-s"></span></li>
163
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-sw"><span class="ui-icon ui-icon-arrow-1-sw"></span></li>
164
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-w"><span class="ui-icon ui-icon-arrow-1-w"></span></li>
165
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></li>
166
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></li>
167
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></li>
168
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></li>
169
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></li>
170
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li>
171
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-e"><span class="ui-icon ui-icon-arrowstop-1-e"></span></li>
172
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-s"><span class="ui-icon ui-icon-arrowstop-1-s"></span></li>
173
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-w"><span class="ui-icon ui-icon-arrowstop-1-w"></span></li>
174
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></li>
175
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></li>
176
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></li>
177
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></li>
178
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></li>
179
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></li>
180
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-w"><span class="ui-icon ui-icon-arrowthick-1-w"></span></li>
181
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-nw"><span class="ui-icon ui-icon-arrowthick-1-nw"></span></li>
182
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-n-s"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></li>
183
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></li>
184
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></li>
185
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></li>
186
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></li>
187
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></li>
188
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></li>
189
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-w"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span></li>
190
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-w"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span></li>
191
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-n"><span class="ui-icon ui-icon-arrowreturnthick-1-n"></span></li>
192
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li>
193
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></li>
194
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></li>
195
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></li>
196
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></li>
197
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></li>
198
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-w"><span class="ui-icon ui-icon-arrowrefresh-1-w"></span></li>
199
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-n"><span class="ui-icon ui-icon-arrowrefresh-1-n"></span></li>
200
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-e"><span class="ui-icon ui-icon-arrowrefresh-1-e"></span></li>
201
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></li>
202
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></li>
203
- <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></li>
204
- <li class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></li>
205
- <li class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></li>
206
- <li class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></li>
207
- <li class="ui-state-default ui-corner-all" title=".ui-icon-shuffle"><span class="ui-icon ui-icon-shuffle"></span></li>
208
- <li class="ui-state-default ui-corner-all" title=".ui-icon-transfer-e-w"><span class="ui-icon ui-icon-transfer-e-w"></span></li>
209
- <li class="ui-state-default ui-corner-all" title=".ui-icon-transferthick-e-w"><span class="ui-icon ui-icon-transferthick-e-w"></span></li>
210
- <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></li>
211
- <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></li>
212
- <li class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></li>
213
- <li class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></li>
214
- <li class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></li>
215
- <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></li>
216
- <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-open"><span class="ui-icon ui-icon-mail-open"></span></li>
217
- <li class="ui-state-default ui-corner-all" title=".ui-icon-suitcase"><span class="ui-icon ui-icon-suitcase"></span></li>
218
- <li class="ui-state-default ui-corner-all" title=".ui-icon-comment"><span class="ui-icon ui-icon-comment"></span></li>
219
- <li class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></li>
220
- <li class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></li>
221
- <li class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></li>
222
- <li class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></li>
223
- <li class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></li>
224
- <li class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></li>
225
- <li class="ui-state-default ui-corner-all" title=".ui-icon-tag"><span class="ui-icon ui-icon-tag"></span></li>
226
- <li class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></li>
227
- <li class="ui-state-default ui-corner-all" title=".ui-icon-flag"><span class="ui-icon ui-icon-flag"></span></li>
228
- <li class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></li>
229
- <li class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></li>
230
- <li class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></li>
231
- <li class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li>
232
- <li class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></li>
233
- <li class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></li>
234
- <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomin"><span class="ui-icon ui-icon-zoomin"></span></li>
235
- <li class="ui-state-default ui-corner-all" title=".ui-icon-zoomout"><span class="ui-icon ui-icon-zoomout"></span></li>
236
- <li class="ui-state-default ui-corner-all" title=".ui-icon-search"><span class="ui-icon ui-icon-search"></span></li>
237
- <li class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></li>
238
- <li class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></li>
239
- <li class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></li>
240
- <li class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></li>
241
- <li class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></li>
242
- <li class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></li>
243
- <li class="ui-state-default ui-corner-all" title=".ui-icon-plus"><span class="ui-icon ui-icon-plus"></span></li>
244
- <li class="ui-state-default ui-corner-all" title=".ui-icon-plusthick"><span class="ui-icon ui-icon-plusthick"></span></li>
245
- <li class="ui-state-default ui-corner-all" title=".ui-icon-minus"><span class="ui-icon ui-icon-minus"></span></li>
246
- <li class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></li>
247
- <li class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></li>
248
- <li class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></li>
249
- <li class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></li>
250
- <li class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></li>
251
- <li class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></li>
252
- <li class="ui-state-default ui-corner-all" title=".ui-icon-clipboard"><span class="ui-icon ui-icon-clipboard"></span></li>
253
- <li class="ui-state-default ui-corner-all" title=".ui-icon-copy"><span class="ui-icon ui-icon-copy"></span></li>
254
- <li class="ui-state-default ui-corner-all" title=".ui-icon-contact"><span class="ui-icon ui-icon-contact"></span></li>
255
- <li class="ui-state-default ui-corner-all" title=".ui-icon-image"><span class="ui-icon ui-icon-image"></span></li>
256
- <li class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></li>
257
- <li class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></li>
258
- <li class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></li>
259
- <li class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></li>
260
- <li class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></li>
261
- <li class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></li>
262
- <li class="ui-state-default ui-corner-all" title=".ui-icon-check"><span class="ui-icon ui-icon-check"></span></li>
263
- <li class="ui-state-default ui-corner-all" title=".ui-icon-bullet"><span class="ui-icon ui-icon-bullet"></span></li>
264
- <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-off"><span class="ui-icon ui-icon-radio-off"></span></li>
265
- <li class="ui-state-default ui-corner-all" title=".ui-icon-radio-on"><span class="ui-icon ui-icon-radio-on"></span></li>
266
- <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-w"><span class="ui-icon ui-icon-pin-w"></span></li>
267
- <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></li>
268
- <li class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></li>
269
- <li class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></li>
270
- <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></li>
271
- <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></li>
272
- <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></li>
273
- <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-first"><span class="ui-icon ui-icon-seek-first"></span></li>
274
- <li class="ui-state-default ui-corner-all" title=".ui-icon-stop"><span class="ui-icon ui-icon-stop"></span></li>
275
- <li class="ui-state-default ui-corner-all" title=".ui-icon-eject"><span class="ui-icon ui-icon-eject"></span></li>
276
- <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></li>
277
- <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></li>
278
- <li class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></li>
279
- <li class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></li>
280
- <li class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></li>
281
- <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></li>
282
- <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-1"><span class="ui-icon ui-icon-battery-1"></span></li>
283
- <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-2"><span class="ui-icon ui-icon-battery-2"></span></li>
284
- <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-3"><span class="ui-icon ui-icon-battery-3"></span></li>
285
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></li>
286
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></li>
287
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></li>
288
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></li>
289
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></li>
290
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></li>
291
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-n"><span class="ui-icon ui-icon-circle-triangle-n"></span></li>
292
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-e"><span class="ui-icon ui-icon-circle-arrow-e"></span></li>
293
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-s"><span class="ui-icon ui-icon-circle-arrow-s"></span></li>
294
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></li>
295
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></li>
296
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></li>
297
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></li>
298
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></li>
299
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></li>
300
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-minus"><span class="ui-icon ui-icon-circlesmall-minus"></span></li>
301
- <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-close"><span class="ui-icon ui-icon-circlesmall-close"></span></li>
302
- <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-plus"><span class="ui-icon ui-icon-squaresmall-plus"></span></li>
303
- <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></li>
304
- <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></li>
305
- <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li>
306
- <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></li>
307
- <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></li>
308
- <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></li>
309
- <li class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></li>
310
- <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></li>
311
- </ul>
312
-
313
-
314
- <!-- Slider -->
315
- <h2 class="demoHeaders">Slider</h2>
316
- <div id="slider"></div>
317
-
318
-
319
-
320
- <!-- Datepicker -->
321
- <h2 class="demoHeaders">Datepicker</h2>
322
- <div id="datepicker"></div>
323
-
324
-
325
-
326
- <!-- Progressbar -->
327
- <h2 class="demoHeaders">Progressbar</h2>
328
- <div id="progressbar"></div>
329
-
330
-
331
-
332
- <!-- Progressbar -->
333
- <h2 class="demoHeaders">Selectmenu</h2>
334
- <select id="selectmenu">
335
- <option>Slower</option>
336
- <option>Slow</option>
337
- <option selected="selected">Medium</option>
338
- <option>Fast</option>
339
- <option>Faster</option>
340
- </select>
341
-
342
-
343
-
344
- <!-- Spinner -->
345
- <h2 class="demoHeaders">Spinner</h2>
346
- <input id="spinner">
347
-
348
-
349
-
350
- <!-- Menu -->
351
- <h2 class="demoHeaders">Menu</h2>
352
- <ul style="width:100px;" id="menu">
353
- <li>Item 1</li>
354
- <li>Item 2</li>
355
- <li>Item 3
356
- <ul>
357
- <li>Item 3-1</li>
358
- <li>Item 3-2</li>
359
- <li>Item 3-3</li>
360
- <li>Item 3-4</li>
361
- <li>Item 3-5</li>
362
- </ul>
363
- </li>
364
- <li>Item 4</li>
365
- <li>Item 5</li>
366
- </ul>
367
-
368
-
369
-
370
- <!-- Tooltip -->
371
- <h2 class="demoHeaders">Tooltip</h2>
372
- <p id="tooltip">
373
- <a href="#" title="That&apos;s what this widget is">Tooltips</a> can be attached to any element. When you hover
374
- the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
375
- </p>
376
-
377
-
378
- <!-- Highlight / Error -->
379
- <h2 class="demoHeaders">Highlight / Error</h2>
380
- <div class="ui-widget">
381
- <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
382
- <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
383
- <strong>Hey!</strong> Sample ui-state-highlight style.</p>
384
- </div>
385
- </div>
386
- <br>
387
- <div class="ui-widget">
388
- <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
389
- <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
390
- <strong>Alert:</strong> Sample ui-state-error style.</p>
391
- </div>
392
- </div>
393
-
394
- <script src="external/jquery/jquery.js"></script>
395
- <script src="jquery-ui.js"></script>
396
- <script>
397
-
398
- $( "#accordion" ).accordion();
399
-
400
-
401
-
402
- var availableTags = [
403
- "ActionScript",
404
- "AppleScript",
405
- "Asp",
406
- "BASIC",
407
- "C",
408
- "C++",
409
- "Clojure",
410
- "COBOL",
411
- "ColdFusion",
412
- "Erlang",
413
- "Fortran",
414
- "Groovy",
415
- "Haskell",
416
- "Java",
417
- "JavaScript",
418
- "Lisp",
419
- "Perl",
420
- "PHP",
421
- "Python",
422
- "Ruby",
423
- "Scala",
424
- "Scheme"
425
- ];
426
- $( "#autocomplete" ).autocomplete({
427
- source: availableTags
428
- });
429
-
430
-
431
-
432
- $( "#button" ).button();
433
- $( "#radioset" ).buttonset();
434
-
435
-
436
-
437
- $( "#tabs" ).tabs();
438
-
439
-
440
-
441
- $( "#dialog" ).dialog({
442
- autoOpen: false,
443
- width: 400,
444
- buttons: [
445
- {
446
- text: "Ok",
447
- click: function() {
448
- $( this ).dialog( "close" );
449
- }
450
- },
451
- {
452
- text: "Cancel",
453
- click: function() {
454
- $( this ).dialog( "close" );
455
- }
456
- }
457
- ]
458
- });
459
-
460
- // Link to open the dialog
461
- $( "#dialog-link" ).click(function( event ) {
462
- $( "#dialog" ).dialog( "open" );
463
- event.preventDefault();
464
- });
465
-
466
-
467
-
468
- $( "#datepicker" ).datepicker({
469
- inline: true
470
- });
471
-
472
-
473
-
474
- $( "#slider" ).slider({
475
- range: true,
476
- values: [ 17, 67 ]
477
- });
478
-
479
-
480
-
481
- $( "#progressbar" ).progressbar({
482
- value: 20
483
- });
484
-
485
-
486
-
487
- $( "#spinner" ).spinner();
488
-
489
-
490
-
491
- $( "#menu" ).menu();
492
-
493
-
494
-
495
- $( "#tooltip" ).tooltip();
496
-
497
-
498
-
499
- $( "#selectmenu" ).selectmenu();
500
-
501
-
502
- // Hover states on the static widgets
503
- $( "#dialog-link, #icons li" ).hover(
504
- function() {
505
- $( this ).addClass( "ui-state-hover" );
506
- },
507
- function() {
508
- $( this ).removeClass( "ui-state-hover" );
509
- }
510
- );
511
- </script>
512
- </body>
513
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
jquery-ui-1.11.4/jquery-ui.css CHANGED
File without changes
jquery-ui-1.11.4/jquery-ui.js DELETED
@@ -1,16617 +0,0 @@
1
- /*! jQuery UI - v1.11.4 - 2015-03-11
2
- * http://jqueryui.com
3
- * Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
4
- * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
5
-
6
- (function( factory ) {
7
- if ( typeof define === "function" && define.amd ) {
8
-
9
- // AMD. Register as an anonymous module.
10
- define([ "jquery" ], factory );
11
- } else {
12
-
13
- // Browser globals
14
- factory( jQuery );
15
- }
16
- }(function( $ ) {
17
- /*!
18
- * jQuery UI Core 1.11.4
19
- * http://jqueryui.com
20
- *
21
- * Copyright jQuery Foundation and other contributors
22
- * Released under the MIT license.
23
- * http://jquery.org/license
24
- *
25
- * http://api.jqueryui.com/category/ui-core/
26
- */
27
-
28
-
29
- // $.ui might exist from components with no dependencies, e.g., $.ui.position
30
- $.ui = $.ui || {};
31
-
32
- $.extend( $.ui, {
33
- version: "1.11.4",
34
-
35
- keyCode: {
36
- BACKSPACE: 8,
37
- COMMA: 188,
38
- DELETE: 46,
39
- DOWN: 40,
40
- END: 35,
41
- ENTER: 13,
42
- ESCAPE: 27,
43
- HOME: 36,
44
- LEFT: 37,
45
- PAGE_DOWN: 34,
46
- PAGE_UP: 33,
47
- PERIOD: 190,
48
- RIGHT: 39,
49
- SPACE: 32,
50
- TAB: 9,
51
- UP: 38
52
- }
53
- });
54
-
55
- // plugins
56
- $.fn.extend({
57
- scrollParent: function( includeHidden ) {
58
- var position = this.css( "position" ),
59
- excludeStaticParent = position === "absolute",
60
- overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
61
- scrollParent = this.parents().filter( function() {
62
- var parent = $( this );
63
- if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
64
- return false;
65
- }
66
- return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
67
- }).eq( 0 );
68
-
69
- return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
70
- },
71
-
72
- uniqueId: (function() {
73
- var uuid = 0;
74
-
75
- return function() {
76
- return this.each(function() {
77
- if ( !this.id ) {
78
- this.id = "ui-id-" + ( ++uuid );
79
- }
80
- });
81
- };
82
- })(),
83
-
84
- removeUniqueId: function() {
85
- return this.each(function() {
86
- if ( /^ui-id-\d+$/.test( this.id ) ) {
87
- $( this ).removeAttr( "id" );
88
- }
89
- });
90
- }
91
- });
92
-
93
- // selectors
94
- function focusable( element, isTabIndexNotNaN ) {
95
- var map, mapName, img,
96
- nodeName = element.nodeName.toLowerCase();
97
- if ( "area" === nodeName ) {
98
- map = element.parentNode;
99
- mapName = map.name;
100
- if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
101
- return false;
102
- }
103
- img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
104
- return !!img && visible( img );
105
- }
106
- return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
107
- !element.disabled :
108
- "a" === nodeName ?
109
- element.href || isTabIndexNotNaN :
110
- isTabIndexNotNaN) &&
111
- // the element and all of its ancestors must be visible
112
- visible( element );
113
- }
114
-
115
- function visible( element ) {
116
- return $.expr.filters.visible( element ) &&
117
- !$( element ).parents().addBack().filter(function() {
118
- return $.css( this, "visibility" ) === "hidden";
119
- }).length;
120
- }
121
-
122
- $.extend( $.expr[ ":" ], {
123
- data: $.expr.createPseudo ?
124
- $.expr.createPseudo(function( dataName ) {
125
- return function( elem ) {
126
- return !!$.data( elem, dataName );
127
- };
128
- }) :
129
- // support: jQuery <1.8
130
- function( elem, i, match ) {
131
- return !!$.data( elem, match[ 3 ] );
132
- },
133
-
134
- focusable: function( element ) {
135
- return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
136
- },
137
-
138
- tabbable: function( element ) {
139
- var tabIndex = $.attr( element, "tabindex" ),
140
- isTabIndexNaN = isNaN( tabIndex );
141
- return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
142
- }
143
- });
144
-
145
- // support: jQuery <1.8
146
- if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
147
- $.each( [ "Width", "Height" ], function( i, name ) {
148
- var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
149
- type = name.toLowerCase(),
150
- orig = {
151
- innerWidth: $.fn.innerWidth,
152
- innerHeight: $.fn.innerHeight,
153
- outerWidth: $.fn.outerWidth,
154
- outerHeight: $.fn.outerHeight
155
- };
156
-
157
- function reduce( elem, size, border, margin ) {
158
- $.each( side, function() {
159
- size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
160
- if ( border ) {
161
- size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
162
- }
163
- if ( margin ) {
164
- size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
165
- }
166
- });
167
- return size;
168
- }
169
-
170
- $.fn[ "inner" + name ] = function( size ) {
171
- if ( size === undefined ) {
172
- return orig[ "inner" + name ].call( this );
173
- }
174
-
175
- return this.each(function() {
176
- $( this ).css( type, reduce( this, size ) + "px" );
177
- });
178
- };
179
-
180
- $.fn[ "outer" + name] = function( size, margin ) {
181
- if ( typeof size !== "number" ) {
182
- return orig[ "outer" + name ].call( this, size );
183
- }
184
-
185
- return this.each(function() {
186
- $( this).css( type, reduce( this, size, true, margin ) + "px" );
187
- });
188
- };
189
- });
190
- }
191
-
192
- // support: jQuery <1.8
193
- if ( !$.fn.addBack ) {
194
- $.fn.addBack = function( selector ) {
195
- return this.add( selector == null ?
196
- this.prevObject : this.prevObject.filter( selector )
197
- );
198
- };
199
- }
200
-
201
- // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
202
- if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
203
- $.fn.removeData = (function( removeData ) {
204
- return function( key ) {
205
- if ( arguments.length ) {
206
- return removeData.call( this, $.camelCase( key ) );
207
- } else {
208
- return removeData.call( this );
209
- }
210
- };
211
- })( $.fn.removeData );
212
- }
213
-
214
- // deprecated
215
- $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
216
-
217
- $.fn.extend({
218
- focus: (function( orig ) {
219
- return function( delay, fn ) {
220
- return typeof delay === "number" ?
221
- this.each(function() {
222
- var elem = this;
223
- setTimeout(function() {
224
- $( elem ).focus();
225
- if ( fn ) {
226
- fn.call( elem );
227
- }
228
- }, delay );
229
- }) :
230
- orig.apply( this, arguments );
231
- };
232
- })( $.fn.focus ),
233
-
234
- disableSelection: (function() {
235
- var eventType = "onselectstart" in document.createElement( "div" ) ?
236
- "selectstart" :
237
- "mousedown";
238
-
239
- return function() {
240
- return this.bind( eventType + ".ui-disableSelection", function( event ) {
241
- event.preventDefault();
242
- });
243
- };
244
- })(),
245
-
246
- enableSelection: function() {
247
- return this.unbind( ".ui-disableSelection" );
248
- },
249
-
250
- zIndex: function( zIndex ) {
251
- if ( zIndex !== undefined ) {
252
- return this.css( "zIndex", zIndex );
253
- }
254
-
255
- if ( this.length ) {
256
- var elem = $( this[ 0 ] ), position, value;
257
- while ( elem.length && elem[ 0 ] !== document ) {
258
- // Ignore z-index if position is set to a value where z-index is ignored by the browser
259
- // This makes behavior of this function consistent across browsers
260
- // WebKit always returns auto if the element is positioned
261
- position = elem.css( "position" );
262
- if ( position === "absolute" || position === "relative" || position === "fixed" ) {
263
- // IE returns 0 when zIndex is not specified
264
- // other browsers return a string
265
- // we ignore the case of nested elements with an explicit value of 0
266
- // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
267
- value = parseInt( elem.css( "zIndex" ), 10 );
268
- if ( !isNaN( value ) && value !== 0 ) {
269
- return value;
270
- }
271
- }
272
- elem = elem.parent();
273
- }
274
- }
275
-
276
- return 0;
277
- }
278
- });
279
-
280
- // $.ui.plugin is deprecated. Use $.widget() extensions instead.
281
- $.ui.plugin = {
282
- add: function( module, option, set ) {
283
- var i,
284
- proto = $.ui[ module ].prototype;
285
- for ( i in set ) {
286
- proto.plugins[ i ] = proto.plugins[ i ] || [];
287
- proto.plugins[ i ].push( [ option, set[ i ] ] );
288
- }
289
- },
290
- call: function( instance, name, args, allowDisconnected ) {
291
- var i,
292
- set = instance.plugins[ name ];
293
-
294
- if ( !set ) {
295
- return;
296
- }
297
-
298
- if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
299
- return;
300
- }
301
-
302
- for ( i = 0; i < set.length; i++ ) {
303
- if ( instance.options[ set[ i ][ 0 ] ] ) {
304
- set[ i ][ 1 ].apply( instance.element, args );
305
- }
306
- }
307
- }
308
- };
309
-
310
-
311
- /*!
312
- * jQuery UI Widget 1.11.4
313
- * http://jqueryui.com
314
- *
315
- * Copyright jQuery Foundation and other contributors
316
- * Released under the MIT license.
317
- * http://jquery.org/license
318
- *
319
- * http://api.jqueryui.com/jQuery.widget/
320
- */
321
-
322
-
323
- var widget_uuid = 0,
324
- widget_slice = Array.prototype.slice;
325
-
326
- $.cleanData = (function( orig ) {
327
- return function( elems ) {
328
- var events, elem, i;
329
- for ( i = 0; (elem = elems[i]) != null; i++ ) {
330
- try {
331
-
332
- // Only trigger remove when necessary to save time
333
- events = $._data( elem, "events" );
334
- if ( events && events.remove ) {
335
- $( elem ).triggerHandler( "remove" );
336
- }
337
-
338
- // http://bugs.jquery.com/ticket/8235
339
- } catch ( e ) {}
340
- }
341
- orig( elems );
342
- };
343
- })( $.cleanData );
344
-
345
- $.widget = function( name, base, prototype ) {
346
- var fullName, existingConstructor, constructor, basePrototype,
347
- // proxiedPrototype allows the provided prototype to remain unmodified
348
- // so that it can be used as a mixin for multiple widgets (#8876)
349
- proxiedPrototype = {},
350
- namespace = name.split( "." )[ 0 ];
351
-
352
- name = name.split( "." )[ 1 ];
353
- fullName = namespace + "-" + name;
354
-
355
- if ( !prototype ) {
356
- prototype = base;
357
- base = $.Widget;
358
- }
359
-
360
- // create selector for plugin
361
- $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
362
- return !!$.data( elem, fullName );
363
- };
364
-
365
- $[ namespace ] = $[ namespace ] || {};
366
- existingConstructor = $[ namespace ][ name ];
367
- constructor = $[ namespace ][ name ] = function( options, element ) {
368
- // allow instantiation without "new" keyword
369
- if ( !this._createWidget ) {
370
- return new constructor( options, element );
371
- }
372
-
373
- // allow instantiation without initializing for simple inheritance
374
- // must use "new" keyword (the code above always passes args)
375
- if ( arguments.length ) {
376
- this._createWidget( options, element );
377
- }
378
- };
379
- // extend with the existing constructor to carry over any static properties
380
- $.extend( constructor, existingConstructor, {
381
- version: prototype.version,
382
- // copy the object used to create the prototype in case we need to
383
- // redefine the widget later
384
- _proto: $.extend( {}, prototype ),
385
- // track widgets that inherit from this widget in case this widget is
386
- // redefined after a widget inherits from it
387
- _childConstructors: []
388
- });
389
-
390
- basePrototype = new base();
391
- // we need to make the options hash a property directly on the new instance
392
- // otherwise we'll modify the options hash on the prototype that we're
393
- // inheriting from
394
- basePrototype.options = $.widget.extend( {}, basePrototype.options );
395
- $.each( prototype, function( prop, value ) {
396
- if ( !$.isFunction( value ) ) {
397
- proxiedPrototype[ prop ] = value;
398
- return;
399
- }
400
- proxiedPrototype[ prop ] = (function() {
401
- var _super = function() {
402
- return base.prototype[ prop ].apply( this, arguments );
403
- },
404
- _superApply = function( args ) {
405
- return base.prototype[ prop ].apply( this, args );
406
- };
407
- return function() {
408
- var __super = this._super,
409
- __superApply = this._superApply,
410
- returnValue;
411
-
412
- this._super = _super;
413
- this._superApply = _superApply;
414
-
415
- returnValue = value.apply( this, arguments );
416
-
417
- this._super = __super;
418
- this._superApply = __superApply;
419
-
420
- return returnValue;
421
- };
422
- })();
423
- });
424
- constructor.prototype = $.widget.extend( basePrototype, {
425
- // TODO: remove support for widgetEventPrefix
426
- // always use the name + a colon as the prefix, e.g., draggable:start
427
- // don't prefix for widgets that aren't DOM-based
428
- widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
429
- }, proxiedPrototype, {
430
- constructor: constructor,
431
- namespace: namespace,
432
- widgetName: name,
433
- widgetFullName: fullName
434
- });
435
-
436
- // If this widget is being redefined then we need to find all widgets that
437
- // are inheriting from it and redefine all of them so that they inherit from
438
- // the new version of this widget. We're essentially trying to replace one
439
- // level in the prototype chain.
440
- if ( existingConstructor ) {
441
- $.each( existingConstructor._childConstructors, function( i, child ) {
442
- var childPrototype = child.prototype;
443
-
444
- // redefine the child widget using the same prototype that was
445
- // originally used, but inherit from the new version of the base
446
- $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
447
- });
448
- // remove the list of existing child constructors from the old constructor
449
- // so the old child constructors can be garbage collected
450
- delete existingConstructor._childConstructors;
451
- } else {
452
- base._childConstructors.push( constructor );
453
- }
454
-
455
- $.widget.bridge( name, constructor );
456
-
457
- return constructor;
458
- };
459
-
460
- $.widget.extend = function( target ) {
461
- var input = widget_slice.call( arguments, 1 ),
462
- inputIndex = 0,
463
- inputLength = input.length,
464
- key,
465
- value;
466
- for ( ; inputIndex < inputLength; inputIndex++ ) {
467
- for ( key in input[ inputIndex ] ) {
468
- value = input[ inputIndex ][ key ];
469
- if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
470
- // Clone objects
471
- if ( $.isPlainObject( value ) ) {
472
- target[ key ] = $.isPlainObject( target[ key ] ) ?
473
- $.widget.extend( {}, target[ key ], value ) :
474
- // Don't extend strings, arrays, etc. with objects
475
- $.widget.extend( {}, value );
476
- // Copy everything else by reference
477
- } else {
478
- target[ key ] = value;
479
- }
480
- }
481
- }
482
- }
483
- return target;
484
- };
485
-
486
- $.widget.bridge = function( name, object ) {
487
- var fullName = object.prototype.widgetFullName || name;
488
- $.fn[ name ] = function( options ) {
489
- var isMethodCall = typeof options === "string",
490
- args = widget_slice.call( arguments, 1 ),
491
- returnValue = this;
492
-
493
- if ( isMethodCall ) {
494
- this.each(function() {
495
- var methodValue,
496
- instance = $.data( this, fullName );
497
- if ( options === "instance" ) {
498
- returnValue = instance;
499
- return false;
500
- }
501
- if ( !instance ) {
502
- return $.error( "cannot call methods on " + name + " prior to initialization; " +
503
- "attempted to call method '" + options + "'" );
504
- }
505
- if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
506
- return $.error( "no such method '" + options + "' for " + name + " widget instance" );
507
- }
508
- methodValue = instance[ options ].apply( instance, args );
509
- if ( methodValue !== instance && methodValue !== undefined ) {
510
- returnValue = methodValue && methodValue.jquery ?
511
- returnValue.pushStack( methodValue.get() ) :
512
- methodValue;
513
- return false;
514
- }
515
- });
516
- } else {
517
-
518
- // Allow multiple hashes to be passed on init
519
- if ( args.length ) {
520
- options = $.widget.extend.apply( null, [ options ].concat(args) );
521
- }
522
-
523
- this.each(function() {
524
- var instance = $.data( this, fullName );
525
- if ( instance ) {
526
- instance.option( options || {} );
527
- if ( instance._init ) {
528
- instance._init();
529
- }
530
- } else {
531
- $.data( this, fullName, new object( options, this ) );
532
- }
533
- });
534
- }
535
-
536
- return returnValue;
537
- };
538
- };
539
-
540
- $.Widget = function( /* options, element */ ) {};
541
- $.Widget._childConstructors = [];
542
-
543
- $.Widget.prototype = {
544
- widgetName: "widget",
545
- widgetEventPrefix: "",
546
- defaultElement: "<div>",
547
- options: {
548
- disabled: false,
549
-
550
- // callbacks
551
- create: null
552
- },
553
- _createWidget: function( options, element ) {
554
- element = $( element || this.defaultElement || this )[ 0 ];
555
- this.element = $( element );
556
- this.uuid = widget_uuid++;
557
- this.eventNamespace = "." + this.widgetName + this.uuid;
558
-
559
- this.bindings = $();
560
- this.hoverable = $();
561
- this.focusable = $();
562
-
563
- if ( element !== this ) {
564
- $.data( element, this.widgetFullName, this );
565
- this._on( true, this.element, {
566
- remove: function( event ) {
567
- if ( event.target === element ) {
568
- this.destroy();
569
- }
570
- }
571
- });
572
- this.document = $( element.style ?
573
- // element within the document
574
- element.ownerDocument :
575
- // element is window or document
576
- element.document || element );
577
- this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
578
- }
579
-
580
- this.options = $.widget.extend( {},
581
- this.options,
582
- this._getCreateOptions(),
583
- options );
584
-
585
- this._create();
586
- this._trigger( "create", null, this._getCreateEventData() );
587
- this._init();
588
- },
589
- _getCreateOptions: $.noop,
590
- _getCreateEventData: $.noop,
591
- _create: $.noop,
592
- _init: $.noop,
593
-
594
- destroy: function() {
595
- this._destroy();
596
- // we can probably remove the unbind calls in 2.0
597
- // all event bindings should go through this._on()
598
- this.element
599
- .unbind( this.eventNamespace )
600
- .removeData( this.widgetFullName )
601
- // support: jquery <1.6.3
602
- // http://bugs.jquery.com/ticket/9413
603
- .removeData( $.camelCase( this.widgetFullName ) );
604
- this.widget()
605
- .unbind( this.eventNamespace )
606
- .removeAttr( "aria-disabled" )
607
- .removeClass(
608
- this.widgetFullName + "-disabled " +
609
- "ui-state-disabled" );
610
-
611
- // clean up events and states
612
- this.bindings.unbind( this.eventNamespace );
613
- this.hoverable.removeClass( "ui-state-hover" );
614
- this.focusable.removeClass( "ui-state-focus" );
615
- },
616
- _destroy: $.noop,
617
-
618
- widget: function() {
619
- return this.element;
620
- },
621
-
622
- option: function( key, value ) {
623
- var options = key,
624
- parts,
625
- curOption,
626
- i;
627
-
628
- if ( arguments.length === 0 ) {
629
- // don't return a reference to the internal hash
630
- return $.widget.extend( {}, this.options );
631
- }
632
-
633
- if ( typeof key === "string" ) {
634
- // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
635
- options = {};
636
- parts = key.split( "." );
637
- key = parts.shift();
638
- if ( parts.length ) {
639
- curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
640
- for ( i = 0; i < parts.length - 1; i++ ) {
641
- curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
642
- curOption = curOption[ parts[ i ] ];
643
- }
644
- key = parts.pop();
645
- if ( arguments.length === 1 ) {
646
- return curOption[ key ] === undefined ? null : curOption[ key ];
647
- }
648
- curOption[ key ] = value;
649
- } else {
650
- if ( arguments.length === 1 ) {
651
- return this.options[ key ] === undefined ? null : this.options[ key ];
652
- }
653
- options[ key ] = value;
654
- }
655
- }
656
-
657
- this._setOptions( options );
658
-
659
- return this;
660
- },
661
- _setOptions: function( options ) {
662
- var key;
663
-
664
- for ( key in options ) {
665
- this._setOption( key, options[ key ] );
666
- }
667
-
668
- return this;
669
- },
670
- _setOption: function( key, value ) {
671
- this.options[ key ] = value;
672
-
673
- if ( key === "disabled" ) {
674
- this.widget()
675
- .toggleClass( this.widgetFullName + "-disabled", !!value );
676
-
677
- // If the widget is becoming disabled, then nothing is interactive
678
- if ( value ) {
679
- this.hoverable.removeClass( "ui-state-hover" );
680
- this.focusable.removeClass( "ui-state-focus" );
681
- }
682
- }
683
-
684
- return this;
685
- },
686
-
687
- enable: function() {
688
- return this._setOptions({ disabled: false });
689
- },
690
- disable: function() {
691
- return this._setOptions({ disabled: true });
692
- },
693
-
694
- _on: function( suppressDisabledCheck, element, handlers ) {
695
- var delegateElement,
696
- instance = this;
697
-
698
- // no suppressDisabledCheck flag, shuffle arguments
699
- if ( typeof suppressDisabledCheck !== "boolean" ) {
700
- handlers = element;
701
- element = suppressDisabledCheck;
702
- suppressDisabledCheck = false;
703
- }
704
-
705
- // no element argument, shuffle and use this.element
706
- if ( !handlers ) {
707
- handlers = element;
708
- element = this.element;
709
- delegateElement = this.widget();
710
- } else {
711
- element = delegateElement = $( element );
712
- this.bindings = this.bindings.add( element );
713
- }
714
-
715
- $.each( handlers, function( event, handler ) {
716
- function handlerProxy() {
717
- // allow widgets to customize the disabled handling
718
- // - disabled as an array instead of boolean
719
- // - disabled class as method for disabling individual parts
720
- if ( !suppressDisabledCheck &&
721
- ( instance.options.disabled === true ||
722
- $( this ).hasClass( "ui-state-disabled" ) ) ) {
723
- return;
724
- }
725
- return ( typeof handler === "string" ? instance[ handler ] : handler )
726
- .apply( instance, arguments );
727
- }
728
-
729
- // copy the guid so direct unbinding works
730
- if ( typeof handler !== "string" ) {
731
- handlerProxy.guid = handler.guid =
732
- handler.guid || handlerProxy.guid || $.guid++;
733
- }
734
-
735
- var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
736
- eventName = match[1] + instance.eventNamespace,
737
- selector = match[2];
738
- if ( selector ) {
739
- delegateElement.delegate( selector, eventName, handlerProxy );
740
- } else {
741
- element.bind( eventName, handlerProxy );
742
- }
743
- });
744
- },
745
-
746
- _off: function( element, eventName ) {
747
- eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
748
- this.eventNamespace;
749
- element.unbind( eventName ).undelegate( eventName );
750
-
751
- // Clear the stack to avoid memory leaks (#10056)
752
- this.bindings = $( this.bindings.not( element ).get() );
753
- this.focusable = $( this.focusable.not( element ).get() );
754
- this.hoverable = $( this.hoverable.not( element ).get() );
755
- },
756
-
757
- _delay: function( handler, delay ) {
758
- function handlerProxy() {
759
- return ( typeof handler === "string" ? instance[ handler ] : handler )
760
- .apply( instance, arguments );
761
- }
762
- var instance = this;
763
- return setTimeout( handlerProxy, delay || 0 );
764
- },
765
-
766
- _hoverable: function( element ) {
767
- this.hoverable = this.hoverable.add( element );
768
- this._on( element, {
769
- mouseenter: function( event ) {
770
- $( event.currentTarget ).addClass( "ui-state-hover" );
771
- },
772
- mouseleave: function( event ) {
773
- $( event.currentTarget ).removeClass( "ui-state-hover" );
774
- }
775
- });
776
- },
777
-
778
- _focusable: function( element ) {
779
- this.focusable = this.focusable.add( element );
780
- this._on( element, {
781
- focusin: function( event ) {
782
- $( event.currentTarget ).addClass( "ui-state-focus" );
783
- },
784
- focusout: function( event ) {
785
- $( event.currentTarget ).removeClass( "ui-state-focus" );
786
- }
787
- });
788
- },
789
-
790
- _trigger: function( type, event, data ) {
791
- var prop, orig,
792
- callback = this.options[ type ];
793
-
794
- data = data || {};
795
- event = $.Event( event );
796
- event.type = ( type === this.widgetEventPrefix ?
797
- type :
798
- this.widgetEventPrefix + type ).toLowerCase();
799
- // the original event may come from any element
800
- // so we need to reset the target on the new event
801
- event.target = this.element[ 0 ];
802
-
803
- // copy original event properties over to the new event
804
- orig = event.originalEvent;
805
- if ( orig ) {
806
- for ( prop in orig ) {
807
- if ( !( prop in event ) ) {
808
- event[ prop ] = orig[ prop ];
809
- }
810
- }
811
- }
812
-
813
- this.element.trigger( event, data );
814
- return !( $.isFunction( callback ) &&
815
- callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
816
- event.isDefaultPrevented() );
817
- }
818
- };
819
-
820
- $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
821
- $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
822
- if ( typeof options === "string" ) {
823
- options = { effect: options };
824
- }
825
- var hasOptions,
826
- effectName = !options ?
827
- method :
828
- options === true || typeof options === "number" ?
829
- defaultEffect :
830
- options.effect || defaultEffect;
831
- options = options || {};
832
- if ( typeof options === "number" ) {
833
- options = { duration: options };
834
- }
835
- hasOptions = !$.isEmptyObject( options );
836
- options.complete = callback;
837
- if ( options.delay ) {
838
- element.delay( options.delay );
839
- }
840
- if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
841
- element[ method ]( options );
842
- } else if ( effectName !== method && element[ effectName ] ) {
843
- element[ effectName ]( options.duration, options.easing, callback );
844
- } else {
845
- element.queue(function( next ) {
846
- $( this )[ method ]();
847
- if ( callback ) {
848
- callback.call( element[ 0 ] );
849
- }
850
- next();
851
- });
852
- }
853
- };
854
- });
855
-
856
- var widget = $.widget;
857
-
858
-
859
- /*!
860
- * jQuery UI Mouse 1.11.4
861
- * http://jqueryui.com
862
- *
863
- * Copyright jQuery Foundation and other contributors
864
- * Released under the MIT license.
865
- * http://jquery.org/license
866
- *
867
- * http://api.jqueryui.com/mouse/
868
- */
869
-
870
-
871
- var mouseHandled = false;
872
- $( document ).mouseup( function() {
873
- mouseHandled = false;
874
- });
875
-
876
- var mouse = $.widget("ui.mouse", {
877
- version: "1.11.4",
878
- options: {
879
- cancel: "input,textarea,button,select,option",
880
- distance: 1,
881
- delay: 0
882
- },
883
- _mouseInit: function() {
884
- var that = this;
885
-
886
- this.element
887
- .bind("mousedown." + this.widgetName, function(event) {
888
- return that._mouseDown(event);
889
- })
890
- .bind("click." + this.widgetName, function(event) {
891
- if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
892
- $.removeData(event.target, that.widgetName + ".preventClickEvent");
893
- event.stopImmediatePropagation();
894
- return false;
895
- }
896
- });
897
-
898
- this.started = false;
899
- },
900
-
901
- // TODO: make sure destroying one instance of mouse doesn't mess with
902
- // other instances of mouse
903
- _mouseDestroy: function() {
904
- this.element.unbind("." + this.widgetName);
905
- if ( this._mouseMoveDelegate ) {
906
- this.document
907
- .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
908
- .unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
909
- }
910
- },
911
-
912
- _mouseDown: function(event) {
913
- // don't let more than one widget handle mouseStart
914
- if ( mouseHandled ) {
915
- return;
916
- }
917
-
918
- this._mouseMoved = false;
919
-
920
- // we may have missed mouseup (out of window)
921
- (this._mouseStarted && this._mouseUp(event));
922
-
923
- this._mouseDownEvent = event;
924
-
925
- var that = this,
926
- btnIsLeft = (event.which === 1),
927
- // event.target.nodeName works around a bug in IE 8 with
928
- // disabled inputs (#7620)
929
- elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
930
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
931
- return true;
932
- }
933
-
934
- this.mouseDelayMet = !this.options.delay;
935
- if (!this.mouseDelayMet) {
936
- this._mouseDelayTimer = setTimeout(function() {
937
- that.mouseDelayMet = true;
938
- }, this.options.delay);
939
- }
940
-
941
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
942
- this._mouseStarted = (this._mouseStart(event) !== false);
943
- if (!this._mouseStarted) {
944
- event.preventDefault();
945
- return true;
946
- }
947
- }
948
-
949
- // Click event may never have fired (Gecko & Opera)
950
- if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
951
- $.removeData(event.target, this.widgetName + ".preventClickEvent");
952
- }
953
-
954
- // these delegates are required to keep context
955
- this._mouseMoveDelegate = function(event) {
956
- return that._mouseMove(event);
957
- };
958
- this._mouseUpDelegate = function(event) {
959
- return that._mouseUp(event);
960
- };
961
-
962
- this.document
963
- .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
964
- .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
965
-
966
- event.preventDefault();
967
-
968
- mouseHandled = true;
969
- return true;
970
- },
971
-
972
- _mouseMove: function(event) {
973
- // Only check for mouseups outside the document if you've moved inside the document
974
- // at least once. This prevents the firing of mouseup in the case of IE<9, which will
975
- // fire a mousemove event if content is placed under the cursor. See #7778
976
- // Support: IE <9
977
- if ( this._mouseMoved ) {
978
- // IE mouseup check - mouseup happened when mouse was out of window
979
- if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
980
- return this._mouseUp(event);
981
-
982
- // Iframe mouseup check - mouseup occurred in another document
983
- } else if ( !event.which ) {
984
- return this._mouseUp( event );
985
- }
986
- }
987
-
988
- if ( event.which || event.button ) {
989
- this._mouseMoved = true;
990
- }
991
-
992
- if (this._mouseStarted) {
993
- this._mouseDrag(event);
994
- return event.preventDefault();
995
- }
996
-
997
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
998
- this._mouseStarted =
999
- (this._mouseStart(this._mouseDownEvent, event) !== false);
1000
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1001
- }
1002
-
1003
- return !this._mouseStarted;
1004
- },
1005
-
1006
- _mouseUp: function(event) {
1007
- this.document
1008
- .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
1009
- .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
1010
-
1011
- if (this._mouseStarted) {
1012
- this._mouseStarted = false;
1013
-
1014
- if (event.target === this._mouseDownEvent.target) {
1015
- $.data(event.target, this.widgetName + ".preventClickEvent", true);
1016
- }
1017
-
1018
- this._mouseStop(event);
1019
- }
1020
-
1021
- mouseHandled = false;
1022
- return false;
1023
- },
1024
-
1025
- _mouseDistanceMet: function(event) {
1026
- return (Math.max(
1027
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
1028
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
1029
- ) >= this.options.distance
1030
- );
1031
- },
1032
-
1033
- _mouseDelayMet: function(/* event */) {
1034
- return this.mouseDelayMet;
1035
- },
1036
-
1037
- // These are placeholder methods, to be overriden by extending plugin
1038
- _mouseStart: function(/* event */) {},
1039
- _mouseDrag: function(/* event */) {},
1040
- _mouseStop: function(/* event */) {},
1041
- _mouseCapture: function(/* event */) { return true; }
1042
- });
1043
-
1044
-
1045
- /*!
1046
- * jQuery UI Position 1.11.4
1047
- * http://jqueryui.com
1048
- *
1049
- * Copyright jQuery Foundation and other contributors
1050
- * Released under the MIT license.
1051
- * http://jquery.org/license
1052
- *
1053
- * http://api.jqueryui.com/position/
1054
- */
1055
-
1056
- (function() {
1057
-
1058
- $.ui = $.ui || {};
1059
-
1060
- var cachedScrollbarWidth, supportsOffsetFractions,
1061
- max = Math.max,
1062
- abs = Math.abs,
1063
- round = Math.round,
1064
- rhorizontal = /left|center|right/,
1065
- rvertical = /top|center|bottom/,
1066
- roffset = /[\+\-]\d+(\.[\d]+)?%?/,
1067
- rposition = /^\w+/,
1068
- rpercent = /%$/,
1069
- _position = $.fn.position;
1070
-
1071
- function getOffsets( offsets, width, height ) {
1072
- return [
1073
- parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
1074
- parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
1075
- ];
1076
- }
1077
-
1078
- function parseCss( element, property ) {
1079
- return parseInt( $.css( element, property ), 10 ) || 0;
1080
- }
1081
-
1082
- function getDimensions( elem ) {
1083
- var raw = elem[0];
1084
- if ( raw.nodeType === 9 ) {
1085
- return {
1086
- width: elem.width(),
1087
- height: elem.height(),
1088
- offset: { top: 0, left: 0 }
1089
- };
1090
- }
1091
- if ( $.isWindow( raw ) ) {
1092
- return {
1093
- width: elem.width(),
1094
- height: elem.height(),
1095
- offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1096
- };
1097
- }
1098
- if ( raw.preventDefault ) {
1099
- return {
1100
- width: 0,
1101
- height: 0,
1102
- offset: { top: raw.pageY, left: raw.pageX }
1103
- };
1104
- }
1105
- return {
1106
- width: elem.outerWidth(),
1107
- height: elem.outerHeight(),
1108
- offset: elem.offset()
1109
- };
1110
- }
1111
-
1112
- $.position = {
1113
- scrollbarWidth: function() {
1114
- if ( cachedScrollbarWidth !== undefined ) {
1115
- return cachedScrollbarWidth;
1116
- }
1117
- var w1, w2,
1118
- div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
1119
- innerDiv = div.children()[0];
1120
-
1121
- $( "body" ).append( div );
1122
- w1 = innerDiv.offsetWidth;
1123
- div.css( "overflow", "scroll" );
1124
-
1125
- w2 = innerDiv.offsetWidth;
1126
-
1127
- if ( w1 === w2 ) {
1128
- w2 = div[0].clientWidth;
1129
- }
1130
-
1131
- div.remove();
1132
-
1133
- return (cachedScrollbarWidth = w1 - w2);
1134
- },
1135
- getScrollInfo: function( within ) {
1136
- var overflowX = within.isWindow || within.isDocument ? "" :
1137
- within.element.css( "overflow-x" ),
1138
- overflowY = within.isWindow || within.isDocument ? "" :
1139
- within.element.css( "overflow-y" ),
1140
- hasOverflowX = overflowX === "scroll" ||
1141
- ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
1142
- hasOverflowY = overflowY === "scroll" ||
1143
- ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
1144
- return {
1145
- width: hasOverflowY ? $.position.scrollbarWidth() : 0,
1146
- height: hasOverflowX ? $.position.scrollbarWidth() : 0
1147
- };
1148
- },
1149
- getWithinInfo: function( element ) {
1150
- var withinElement = $( element || window ),
1151
- isWindow = $.isWindow( withinElement[0] ),
1152
- isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
1153
- return {
1154
- element: withinElement,
1155
- isWindow: isWindow,
1156
- isDocument: isDocument,
1157
- offset: withinElement.offset() || { left: 0, top: 0 },
1158
- scrollLeft: withinElement.scrollLeft(),
1159
- scrollTop: withinElement.scrollTop(),
1160
-
1161
- // support: jQuery 1.6.x
1162
- // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
1163
- width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
1164
- height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
1165
- };
1166
- }
1167
- };
1168
-
1169
- $.fn.position = function( options ) {
1170
- if ( !options || !options.of ) {
1171
- return _position.apply( this, arguments );
1172
- }
1173
-
1174
- // make a copy, we don't want to modify arguments
1175
- options = $.extend( {}, options );
1176
-
1177
- var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
1178
- target = $( options.of ),
1179
- within = $.position.getWithinInfo( options.within ),
1180
- scrollInfo = $.position.getScrollInfo( within ),
1181
- collision = ( options.collision || "flip" ).split( " " ),
1182
- offsets = {};
1183
-
1184
- dimensions = getDimensions( target );
1185
- if ( target[0].preventDefault ) {
1186
- // force left top to allow flipping
1187
- options.at = "left top";
1188
- }
1189
- targetWidth = dimensions.width;
1190
- targetHeight = dimensions.height;
1191
- targetOffset = dimensions.offset;
1192
- // clone to reuse original targetOffset later
1193
- basePosition = $.extend( {}, targetOffset );
1194
-
1195
- // force my and at to have valid horizontal and vertical positions
1196
- // if a value is missing or invalid, it will be converted to center
1197
- $.each( [ "my", "at" ], function() {
1198
- var pos = ( options[ this ] || "" ).split( " " ),
1199
- horizontalOffset,
1200
- verticalOffset;
1201
-
1202
- if ( pos.length === 1) {
1203
- pos = rhorizontal.test( pos[ 0 ] ) ?
1204
- pos.concat( [ "center" ] ) :
1205
- rvertical.test( pos[ 0 ] ) ?
1206
- [ "center" ].concat( pos ) :
1207
- [ "center", "center" ];
1208
- }
1209
- pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1210
- pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1211
-
1212
- // calculate offsets
1213
- horizontalOffset = roffset.exec( pos[ 0 ] );
1214
- verticalOffset = roffset.exec( pos[ 1 ] );
1215
- offsets[ this ] = [
1216
- horizontalOffset ? horizontalOffset[ 0 ] : 0,
1217
- verticalOffset ? verticalOffset[ 0 ] : 0
1218
- ];
1219
-
1220
- // reduce to just the positions without the offsets
1221
- options[ this ] = [
1222
- rposition.exec( pos[ 0 ] )[ 0 ],
1223
- rposition.exec( pos[ 1 ] )[ 0 ]
1224
- ];
1225
- });
1226
-
1227
- // normalize collision option
1228
- if ( collision.length === 1 ) {
1229
- collision[ 1 ] = collision[ 0 ];
1230
- }
1231
-
1232
- if ( options.at[ 0 ] === "right" ) {
1233
- basePosition.left += targetWidth;
1234
- } else if ( options.at[ 0 ] === "center" ) {
1235
- basePosition.left += targetWidth / 2;
1236
- }
1237
-
1238
- if ( options.at[ 1 ] === "bottom" ) {
1239
- basePosition.top += targetHeight;
1240
- } else if ( options.at[ 1 ] === "center" ) {
1241
- basePosition.top += targetHeight / 2;
1242
- }
1243
-
1244
- atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1245
- basePosition.left += atOffset[ 0 ];
1246
- basePosition.top += atOffset[ 1 ];
1247
-
1248
- return this.each(function() {
1249
- var collisionPosition, using,
1250
- elem = $( this ),
1251
- elemWidth = elem.outerWidth(),
1252
- elemHeight = elem.outerHeight(),
1253
- marginLeft = parseCss( this, "marginLeft" ),
1254
- marginTop = parseCss( this, "marginTop" ),
1255
- collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1256
- collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
1257
- position = $.extend( {}, basePosition ),
1258
- myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1259
-
1260
- if ( options.my[ 0 ] === "right" ) {
1261
- position.left -= elemWidth;
1262
- } else if ( options.my[ 0 ] === "center" ) {
1263
- position.left -= elemWidth / 2;
1264
- }
1265
-
1266
- if ( options.my[ 1 ] === "bottom" ) {
1267
- position.top -= elemHeight;
1268
- } else if ( options.my[ 1 ] === "center" ) {
1269
- position.top -= elemHeight / 2;
1270
- }
1271
-
1272
- position.left += myOffset[ 0 ];
1273
- position.top += myOffset[ 1 ];
1274
-
1275
- // if the browser doesn't support fractions, then round for consistent results
1276
- if ( !supportsOffsetFractions ) {
1277
- position.left = round( position.left );
1278
- position.top = round( position.top );
1279
- }
1280
-
1281
- collisionPosition = {
1282
- marginLeft: marginLeft,
1283
- marginTop: marginTop
1284
- };
1285
-
1286
- $.each( [ "left", "top" ], function( i, dir ) {
1287
- if ( $.ui.position[ collision[ i ] ] ) {
1288
- $.ui.position[ collision[ i ] ][ dir ]( position, {
1289
- targetWidth: targetWidth,
1290
- targetHeight: targetHeight,
1291
- elemWidth: elemWidth,
1292
- elemHeight: elemHeight,
1293
- collisionPosition: collisionPosition,
1294
- collisionWidth: collisionWidth,
1295
- collisionHeight: collisionHeight,
1296
- offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1297
- my: options.my,
1298
- at: options.at,
1299
- within: within,
1300
- elem: elem
1301
- });
1302
- }
1303
- });
1304
-
1305
- if ( options.using ) {
1306
- // adds feedback as second argument to using callback, if present
1307
- using = function( props ) {
1308
- var left = targetOffset.left - position.left,
1309
- right = left + targetWidth - elemWidth,
1310
- top = targetOffset.top - position.top,
1311
- bottom = top + targetHeight - elemHeight,
1312
- feedback = {
1313
- target: {
1314
- element: target,
1315
- left: targetOffset.left,
1316
- top: targetOffset.top,
1317
- width: targetWidth,
1318
- height: targetHeight
1319
- },
1320
- element: {
1321
- element: elem,
1322
- left: position.left,
1323
- top: position.top,
1324
- width: elemWidth,
1325
- height: elemHeight
1326
- },
1327
- horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1328
- vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1329
- };
1330
- if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1331
- feedback.horizontal = "center";
1332
- }
1333
- if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1334
- feedback.vertical = "middle";
1335
- }
1336
- if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1337
- feedback.important = "horizontal";
1338
- } else {
1339
- feedback.important = "vertical";
1340
- }
1341
- options.using.call( this, props, feedback );
1342
- };
1343
- }
1344
-
1345
- elem.offset( $.extend( position, { using: using } ) );
1346
- });
1347
- };
1348
-
1349
- $.ui.position = {
1350
- fit: {
1351
- left: function( position, data ) {
1352
- var within = data.within,
1353
- withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1354
- outerWidth = within.width,
1355
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1356
- overLeft = withinOffset - collisionPosLeft,
1357
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1358
- newOverRight;
1359
-
1360
- // element is wider than within
1361
- if ( data.collisionWidth > outerWidth ) {
1362
- // element is initially over the left side of within
1363
- if ( overLeft > 0 && overRight <= 0 ) {
1364
- newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1365
- position.left += overLeft - newOverRight;
1366
- // element is initially over right side of within
1367
- } else if ( overRight > 0 && overLeft <= 0 ) {
1368
- position.left = withinOffset;
1369
- // element is initially over both left and right sides of within
1370
- } else {
1371
- if ( overLeft > overRight ) {
1372
- position.left = withinOffset + outerWidth - data.collisionWidth;
1373
- } else {
1374
- position.left = withinOffset;
1375
- }
1376
- }
1377
- // too far left -> align with left edge
1378
- } else if ( overLeft > 0 ) {
1379
- position.left += overLeft;
1380
- // too far right -> align with right edge
1381
- } else if ( overRight > 0 ) {
1382
- position.left -= overRight;
1383
- // adjust based on position and margin
1384
- } else {
1385
- position.left = max( position.left - collisionPosLeft, position.left );
1386
- }
1387
- },
1388
- top: function( position, data ) {
1389
- var within = data.within,
1390
- withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1391
- outerHeight = data.within.height,
1392
- collisionPosTop = position.top - data.collisionPosition.marginTop,
1393
- overTop = withinOffset - collisionPosTop,
1394
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1395
- newOverBottom;
1396
-
1397
- // element is taller than within
1398
- if ( data.collisionHeight > outerHeight ) {
1399
- // element is initially over the top of within
1400
- if ( overTop > 0 && overBottom <= 0 ) {
1401
- newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1402
- position.top += overTop - newOverBottom;
1403
- // element is initially over bottom of within
1404
- } else if ( overBottom > 0 && overTop <= 0 ) {
1405
- position.top = withinOffset;
1406
- // element is initially over both top and bottom of within
1407
- } else {
1408
- if ( overTop > overBottom ) {
1409
- position.top = withinOffset + outerHeight - data.collisionHeight;
1410
- } else {
1411
- position.top = withinOffset;
1412
- }
1413
- }
1414
- // too far up -> align with top
1415
- } else if ( overTop > 0 ) {
1416
- position.top += overTop;
1417
- // too far down -> align with bottom edge
1418
- } else if ( overBottom > 0 ) {
1419
- position.top -= overBottom;
1420
- // adjust based on position and margin
1421
- } else {
1422
- position.top = max( position.top - collisionPosTop, position.top );
1423
- }
1424
- }
1425
- },
1426
- flip: {
1427
- left: function( position, data ) {
1428
- var within = data.within,
1429
- withinOffset = within.offset.left + within.scrollLeft,
1430
- outerWidth = within.width,
1431
- offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1432
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1433
- overLeft = collisionPosLeft - offsetLeft,
1434
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1435
- myOffset = data.my[ 0 ] === "left" ?
1436
- -data.elemWidth :
1437
- data.my[ 0 ] === "right" ?
1438
- data.elemWidth :
1439
- 0,
1440
- atOffset = data.at[ 0 ] === "left" ?
1441
- data.targetWidth :
1442
- data.at[ 0 ] === "right" ?
1443
- -data.targetWidth :
1444
- 0,
1445
- offset = -2 * data.offset[ 0 ],
1446
- newOverRight,
1447
- newOverLeft;
1448
-
1449
- if ( overLeft < 0 ) {
1450
- newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1451
- if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1452
- position.left += myOffset + atOffset + offset;
1453
- }
1454
- } else if ( overRight > 0 ) {
1455
- newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1456
- if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1457
- position.left += myOffset + atOffset + offset;
1458
- }
1459
- }
1460
- },
1461
- top: function( position, data ) {
1462
- var within = data.within,
1463
- withinOffset = within.offset.top + within.scrollTop,
1464
- outerHeight = within.height,
1465
- offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1466
- collisionPosTop = position.top - data.collisionPosition.marginTop,
1467
- overTop = collisionPosTop - offsetTop,
1468
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1469
- top = data.my[ 1 ] === "top",
1470
- myOffset = top ?
1471
- -data.elemHeight :
1472
- data.my[ 1 ] === "bottom" ?
1473
- data.elemHeight :
1474
- 0,
1475
- atOffset = data.at[ 1 ] === "top" ?
1476
- data.targetHeight :
1477
- data.at[ 1 ] === "bottom" ?
1478
- -data.targetHeight :
1479
- 0,
1480
- offset = -2 * data.offset[ 1 ],
1481
- newOverTop,
1482
- newOverBottom;
1483
- if ( overTop < 0 ) {
1484
- newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1485
- if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1486
- position.top += myOffset + atOffset + offset;
1487
- }
1488
- } else if ( overBottom > 0 ) {
1489
- newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1490
- if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1491
- position.top += myOffset + atOffset + offset;
1492
- }
1493
- }
1494
- }
1495
- },
1496
- flipfit: {
1497
- left: function() {
1498
- $.ui.position.flip.left.apply( this, arguments );
1499
- $.ui.position.fit.left.apply( this, arguments );
1500
- },
1501
- top: function() {
1502
- $.ui.position.flip.top.apply( this, arguments );
1503
- $.ui.position.fit.top.apply( this, arguments );
1504
- }
1505
- }
1506
- };
1507
-
1508
- // fraction support test
1509
- (function() {
1510
- var testElement, testElementParent, testElementStyle, offsetLeft, i,
1511
- body = document.getElementsByTagName( "body" )[ 0 ],
1512
- div = document.createElement( "div" );
1513
-
1514
- //Create a "fake body" for testing based on method used in jQuery.support
1515
- testElement = document.createElement( body ? "div" : "body" );
1516
- testElementStyle = {
1517
- visibility: "hidden",
1518
- width: 0,
1519
- height: 0,
1520
- border: 0,
1521
- margin: 0,
1522
- background: "none"
1523
- };
1524
- if ( body ) {
1525
- $.extend( testElementStyle, {
1526
- position: "absolute",
1527
- left: "-1000px",
1528
- top: "-1000px"
1529
- });
1530
- }
1531
- for ( i in testElementStyle ) {
1532
- testElement.style[ i ] = testElementStyle[ i ];
1533
- }
1534
- testElement.appendChild( div );
1535
- testElementParent = body || document.documentElement;
1536
- testElementParent.insertBefore( testElement, testElementParent.firstChild );
1537
-
1538
- div.style.cssText = "position: absolute; left: 10.7432222px;";
1539
-
1540
- offsetLeft = $( div ).offset().left;
1541
- supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1542
-
1543
- testElement.innerHTML = "";
1544
- testElementParent.removeChild( testElement );
1545
- })();
1546
-
1547
- })();
1548
-
1549
- var position = $.ui.position;
1550
-
1551
-
1552
- /*!
1553
- * jQuery UI Accordion 1.11.4
1554
- * http://jqueryui.com
1555
- *
1556
- * Copyright jQuery Foundation and other contributors
1557
- * Released under the MIT license.
1558
- * http://jquery.org/license
1559
- *
1560
- * http://api.jqueryui.com/accordion/
1561
- */
1562
-
1563
-
1564
- var accordion = $.widget( "ui.accordion", {
1565
- version: "1.11.4",
1566
- options: {
1567
- active: 0,
1568
- animate: {},
1569
- collapsible: false,
1570
- event: "click",
1571
- header: "> li > :first-child,> :not(li):even",
1572
- heightStyle: "auto",
1573
- icons: {
1574
- activeHeader: "ui-icon-triangle-1-s",
1575
- header: "ui-icon-triangle-1-e"
1576
- },
1577
-
1578
- // callbacks
1579
- activate: null,
1580
- beforeActivate: null
1581
- },
1582
-
1583
- hideProps: {
1584
- borderTopWidth: "hide",
1585
- borderBottomWidth: "hide",
1586
- paddingTop: "hide",
1587
- paddingBottom: "hide",
1588
- height: "hide"
1589
- },
1590
-
1591
- showProps: {
1592
- borderTopWidth: "show",
1593
- borderBottomWidth: "show",
1594
- paddingTop: "show",
1595
- paddingBottom: "show",
1596
- height: "show"
1597
- },
1598
-
1599
- _create: function() {
1600
- var options = this.options;
1601
- this.prevShow = this.prevHide = $();
1602
- this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
1603
- // ARIA
1604
- .attr( "role", "tablist" );
1605
-
1606
- // don't allow collapsible: false and active: false / null
1607
- if ( !options.collapsible && (options.active === false || options.active == null) ) {
1608
- options.active = 0;
1609
- }
1610
-
1611
- this._processPanels();
1612
- // handle negative values
1613
- if ( options.active < 0 ) {
1614
- options.active += this.headers.length;
1615
- }
1616
- this._refresh();
1617
- },
1618
-
1619
- _getCreateEventData: function() {
1620
- return {
1621
- header: this.active,
1622
- panel: !this.active.length ? $() : this.active.next()
1623
- };
1624
- },
1625
-
1626
- _createIcons: function() {
1627
- var icons = this.options.icons;
1628
- if ( icons ) {
1629
- $( "<span>" )
1630
- .addClass( "ui-accordion-header-icon ui-icon " + icons.header )
1631
- .prependTo( this.headers );
1632
- this.active.children( ".ui-accordion-header-icon" )
1633
- .removeClass( icons.header )
1634
- .addClass( icons.activeHeader );
1635
- this.headers.addClass( "ui-accordion-icons" );
1636
- }
1637
- },
1638
-
1639
- _destroyIcons: function() {
1640
- this.headers
1641
- .removeClass( "ui-accordion-icons" )
1642
- .children( ".ui-accordion-header-icon" )
1643
- .remove();
1644
- },
1645
-
1646
- _destroy: function() {
1647
- var contents;
1648
-
1649
- // clean up main element
1650
- this.element
1651
- .removeClass( "ui-accordion ui-widget ui-helper-reset" )
1652
- .removeAttr( "role" );
1653
-
1654
- // clean up headers
1655
- this.headers
1656
- .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
1657
- "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
1658
- .removeAttr( "role" )
1659
- .removeAttr( "aria-expanded" )
1660
- .removeAttr( "aria-selected" )
1661
- .removeAttr( "aria-controls" )
1662
- .removeAttr( "tabIndex" )
1663
- .removeUniqueId();
1664
-
1665
- this._destroyIcons();
1666
-
1667
- // clean up content panels
1668
- contents = this.headers.next()
1669
- .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
1670
- "ui-accordion-content ui-accordion-content-active ui-state-disabled" )
1671
- .css( "display", "" )
1672
- .removeAttr( "role" )
1673
- .removeAttr( "aria-hidden" )
1674
- .removeAttr( "aria-labelledby" )
1675
- .removeUniqueId();
1676
-
1677
- if ( this.options.heightStyle !== "content" ) {
1678
- contents.css( "height", "" );
1679
- }
1680
- },
1681
-
1682
- _setOption: function( key, value ) {
1683
- if ( key === "active" ) {
1684
- // _activate() will handle invalid values and update this.options
1685
- this._activate( value );
1686
- return;
1687
- }
1688
-
1689
- if ( key === "event" ) {
1690
- if ( this.options.event ) {
1691
- this._off( this.headers, this.options.event );
1692
- }
1693
- this._setupEvents( value );
1694
- }
1695
-
1696
- this._super( key, value );
1697
-
1698
- // setting collapsible: false while collapsed; open first panel
1699
- if ( key === "collapsible" && !value && this.options.active === false ) {
1700
- this._activate( 0 );
1701
- }
1702
-
1703
- if ( key === "icons" ) {
1704
- this._destroyIcons();
1705
- if ( value ) {
1706
- this._createIcons();
1707
- }
1708
- }
1709
-
1710
- // #5332 - opacity doesn't cascade to positioned elements in IE
1711
- // so we need to add the disabled class to the headers and panels
1712
- if ( key === "disabled" ) {
1713
- this.element
1714
- .toggleClass( "ui-state-disabled", !!value )
1715
- .attr( "aria-disabled", value );
1716
- this.headers.add( this.headers.next() )
1717
- .toggleClass( "ui-state-disabled", !!value );
1718
- }
1719
- },
1720
-
1721
- _keydown: function( event ) {
1722
- if ( event.altKey || event.ctrlKey ) {
1723
- return;
1724
- }
1725
-
1726
- var keyCode = $.ui.keyCode,
1727
- length = this.headers.length,
1728
- currentIndex = this.headers.index( event.target ),
1729
- toFocus = false;
1730
-
1731
- switch ( event.keyCode ) {
1732
- case keyCode.RIGHT:
1733
- case keyCode.DOWN:
1734
- toFocus = this.headers[ ( currentIndex + 1 ) % length ];
1735
- break;
1736
- case keyCode.LEFT:
1737
- case keyCode.UP:
1738
- toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
1739
- break;
1740
- case keyCode.SPACE:
1741
- case keyCode.ENTER:
1742
- this._eventHandler( event );
1743
- break;
1744
- case keyCode.HOME:
1745
- toFocus = this.headers[ 0 ];
1746
- break;
1747
- case keyCode.END:
1748
- toFocus = this.headers[ length - 1 ];
1749
- break;
1750
- }
1751
-
1752
- if ( toFocus ) {
1753
- $( event.target ).attr( "tabIndex", -1 );
1754
- $( toFocus ).attr( "tabIndex", 0 );
1755
- toFocus.focus();
1756
- event.preventDefault();
1757
- }
1758
- },
1759
-
1760
- _panelKeyDown: function( event ) {
1761
- if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
1762
- $( event.currentTarget ).prev().focus();
1763
- }
1764
- },
1765
-
1766
- refresh: function() {
1767
- var options = this.options;
1768
- this._processPanels();
1769
-
1770
- // was collapsed or no panel
1771
- if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
1772
- options.active = false;
1773
- this.active = $();
1774
- // active false only when collapsible is true
1775
- } else if ( options.active === false ) {
1776
- this._activate( 0 );
1777
- // was active, but active panel is gone
1778
- } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
1779
- // all remaining panel are disabled
1780
- if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
1781
- options.active = false;
1782
- this.active = $();
1783
- // activate previous panel
1784
- } else {
1785
- this._activate( Math.max( 0, options.active - 1 ) );
1786
- }
1787
- // was active, active panel still exists
1788
- } else {
1789
- // make sure active index is correct
1790
- options.active = this.headers.index( this.active );
1791
- }
1792
-
1793
- this._destroyIcons();
1794
-
1795
- this._refresh();
1796
- },
1797
-
1798
- _processPanels: function() {
1799
- var prevHeaders = this.headers,
1800
- prevPanels = this.panels;
1801
-
1802
- this.headers = this.element.find( this.options.header )
1803
- .addClass( "ui-accordion-header ui-state-default ui-corner-all" );
1804
-
1805
- this.panels = this.headers.next()
1806
- .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
1807
- .filter( ":not(.ui-accordion-content-active)" )
1808
- .hide();
1809
-
1810
- // Avoid memory leaks (#10056)
1811
- if ( prevPanels ) {
1812
- this._off( prevHeaders.not( this.headers ) );
1813
- this._off( prevPanels.not( this.panels ) );
1814
- }
1815
- },
1816
-
1817
- _refresh: function() {
1818
- var maxHeight,
1819
- options = this.options,
1820
- heightStyle = options.heightStyle,
1821
- parent = this.element.parent();
1822
-
1823
- this.active = this._findActive( options.active )
1824
- .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
1825
- .removeClass( "ui-corner-all" );
1826
- this.active.next()
1827
- .addClass( "ui-accordion-content-active" )
1828
- .show();
1829
-
1830
- this.headers
1831
- .attr( "role", "tab" )
1832
- .each(function() {
1833
- var header = $( this ),
1834
- headerId = header.uniqueId().attr( "id" ),
1835
- panel = header.next(),
1836
- panelId = panel.uniqueId().attr( "id" );
1837
- header.attr( "aria-controls", panelId );
1838
- panel.attr( "aria-labelledby", headerId );
1839
- })
1840
- .next()
1841
- .attr( "role", "tabpanel" );
1842
-
1843
- this.headers
1844
- .not( this.active )
1845
- .attr({
1846
- "aria-selected": "false",
1847
- "aria-expanded": "false",
1848
- tabIndex: -1
1849
- })
1850
- .next()
1851
- .attr({
1852
- "aria-hidden": "true"
1853
- })
1854
- .hide();
1855
-
1856
- // make sure at least one header is in the tab order
1857
- if ( !this.active.length ) {
1858
- this.headers.eq( 0 ).attr( "tabIndex", 0 );
1859
- } else {
1860
- this.active.attr({
1861
- "aria-selected": "true",
1862
- "aria-expanded": "true",
1863
- tabIndex: 0
1864
- })
1865
- .next()
1866
- .attr({
1867
- "aria-hidden": "false"
1868
- });
1869
- }
1870
-
1871
- this._createIcons();
1872
-
1873
- this._setupEvents( options.event );
1874
-
1875
- if ( heightStyle === "fill" ) {
1876
- maxHeight = parent.height();
1877
- this.element.siblings( ":visible" ).each(function() {
1878
- var elem = $( this ),
1879
- position = elem.css( "position" );
1880
-
1881
- if ( position === "absolute" || position === "fixed" ) {
1882
- return;
1883
- }
1884
- maxHeight -= elem.outerHeight( true );
1885
- });
1886
-
1887
- this.headers.each(function() {
1888
- maxHeight -= $( this ).outerHeight( true );
1889
- });
1890
-
1891
- this.headers.next()
1892
- .each(function() {
1893
- $( this ).height( Math.max( 0, maxHeight -
1894
- $( this ).innerHeight() + $( this ).height() ) );
1895
- })
1896
- .css( "overflow", "auto" );
1897
- } else if ( heightStyle === "auto" ) {
1898
- maxHeight = 0;
1899
- this.headers.next()
1900
- .each(function() {
1901
- maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
1902
- })
1903
- .height( maxHeight );
1904
- }
1905
- },
1906
-
1907
- _activate: function( index ) {
1908
- var active = this._findActive( index )[ 0 ];
1909
-
1910
- // trying to activate the already active panel
1911
- if ( active === this.active[ 0 ] ) {
1912
- return;
1913
- }
1914
-
1915
- // trying to collapse, simulate a click on the currently active header
1916
- active = active || this.active[ 0 ];
1917
-
1918
- this._eventHandler({
1919
- target: active,
1920
- currentTarget: active,
1921
- preventDefault: $.noop
1922
- });
1923
- },
1924
-
1925
- _findActive: function( selector ) {
1926
- return typeof selector === "number" ? this.headers.eq( selector ) : $();
1927
- },
1928
-
1929
- _setupEvents: function( event ) {
1930
- var events = {
1931
- keydown: "_keydown"
1932
- };
1933
- if ( event ) {
1934
- $.each( event.split( " " ), function( index, eventName ) {
1935
- events[ eventName ] = "_eventHandler";
1936
- });
1937
- }
1938
-
1939
- this._off( this.headers.add( this.headers.next() ) );
1940
- this._on( this.headers, events );
1941
- this._on( this.headers.next(), { keydown: "_panelKeyDown" });
1942
- this._hoverable( this.headers );
1943
- this._focusable( this.headers );
1944
- },
1945
-
1946
- _eventHandler: function( event ) {
1947
- var options = this.options,
1948
- active = this.active,
1949
- clicked = $( event.currentTarget ),
1950
- clickedIsActive = clicked[ 0 ] === active[ 0 ],
1951
- collapsing = clickedIsActive && options.collapsible,
1952
- toShow = collapsing ? $() : clicked.next(),
1953
- toHide = active.next(),
1954
- eventData = {
1955
- oldHeader: active,
1956
- oldPanel: toHide,
1957
- newHeader: collapsing ? $() : clicked,
1958
- newPanel: toShow
1959
- };
1960
-
1961
- event.preventDefault();
1962
-
1963
- if (
1964
- // click on active header, but not collapsible
1965
- ( clickedIsActive && !options.collapsible ) ||
1966
- // allow canceling activation
1967
- ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
1968
- return;
1969
- }
1970
-
1971
- options.active = collapsing ? false : this.headers.index( clicked );
1972
-
1973
- // when the call to ._toggle() comes after the class changes
1974
- // it causes a very odd bug in IE 8 (see #6720)
1975
- this.active = clickedIsActive ? $() : clicked;
1976
- this._toggle( eventData );
1977
-
1978
- // switch classes
1979
- // corner classes on the previously active header stay after the animation
1980
- active.removeClass( "ui-accordion-header-active ui-state-active" );
1981
- if ( options.icons ) {
1982
- active.children( ".ui-accordion-header-icon" )
1983
- .removeClass( options.icons.activeHeader )
1984
- .addClass( options.icons.header );
1985
- }
1986
-
1987
- if ( !clickedIsActive ) {
1988
- clicked
1989
- .removeClass( "ui-corner-all" )
1990
- .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
1991
- if ( options.icons ) {
1992
- clicked.children( ".ui-accordion-header-icon" )
1993
- .removeClass( options.icons.header )
1994
- .addClass( options.icons.activeHeader );
1995
- }
1996
-
1997
- clicked
1998
- .next()
1999
- .addClass( "ui-accordion-content-active" );
2000
- }
2001
- },
2002
-
2003
- _toggle: function( data ) {
2004
- var toShow = data.newPanel,
2005
- toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
2006
-
2007
- // handle activating a panel during the animation for another activation
2008
- this.prevShow.add( this.prevHide ).stop( true, true );
2009
- this.prevShow = toShow;
2010
- this.prevHide = toHide;
2011
-
2012
- if ( this.options.animate ) {
2013
- this._animate( toShow, toHide, data );
2014
- } else {
2015
- toHide.hide();
2016
- toShow.show();
2017
- this._toggleComplete( data );
2018
- }
2019
-
2020
- toHide.attr({
2021
- "aria-hidden": "true"
2022
- });
2023
- toHide.prev().attr({
2024
- "aria-selected": "false",
2025
- "aria-expanded": "false"
2026
- });
2027
- // if we're switching panels, remove the old header from the tab order
2028
- // if we're opening from collapsed state, remove the previous header from the tab order
2029
- // if we're collapsing, then keep the collapsing header in the tab order
2030
- if ( toShow.length && toHide.length ) {
2031
- toHide.prev().attr({
2032
- "tabIndex": -1,
2033
- "aria-expanded": "false"
2034
- });
2035
- } else if ( toShow.length ) {
2036
- this.headers.filter(function() {
2037
- return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
2038
- })
2039
- .attr( "tabIndex", -1 );
2040
- }
2041
-
2042
- toShow
2043
- .attr( "aria-hidden", "false" )
2044
- .prev()
2045
- .attr({
2046
- "aria-selected": "true",
2047
- "aria-expanded": "true",
2048
- tabIndex: 0
2049
- });
2050
- },
2051
-
2052
- _animate: function( toShow, toHide, data ) {
2053
- var total, easing, duration,
2054
- that = this,
2055
- adjust = 0,
2056
- boxSizing = toShow.css( "box-sizing" ),
2057
- down = toShow.length &&
2058
- ( !toHide.length || ( toShow.index() < toHide.index() ) ),
2059
- animate = this.options.animate || {},
2060
- options = down && animate.down || animate,
2061
- complete = function() {
2062
- that._toggleComplete( data );
2063
- };
2064
-
2065
- if ( typeof options === "number" ) {
2066
- duration = options;
2067
- }
2068
- if ( typeof options === "string" ) {
2069
- easing = options;
2070
- }
2071
- // fall back from options to animation in case of partial down settings
2072
- easing = easing || options.easing || animate.easing;
2073
- duration = duration || options.duration || animate.duration;
2074
-
2075
- if ( !toHide.length ) {
2076
- return toShow.animate( this.showProps, duration, easing, complete );
2077
- }
2078
- if ( !toShow.length ) {
2079
- return toHide.animate( this.hideProps, duration, easing, complete );
2080
- }
2081
-
2082
- total = toShow.show().outerHeight();
2083
- toHide.animate( this.hideProps, {
2084
- duration: duration,
2085
- easing: easing,
2086
- step: function( now, fx ) {
2087
- fx.now = Math.round( now );
2088
- }
2089
- });
2090
- toShow
2091
- .hide()
2092
- .animate( this.showProps, {
2093
- duration: duration,
2094
- easing: easing,
2095
- complete: complete,
2096
- step: function( now, fx ) {
2097
- fx.now = Math.round( now );
2098
- if ( fx.prop !== "height" ) {
2099
- if ( boxSizing === "content-box" ) {
2100
- adjust += fx.now;
2101
- }
2102
- } else if ( that.options.heightStyle !== "content" ) {
2103
- fx.now = Math.round( total - toHide.outerHeight() - adjust );
2104
- adjust = 0;
2105
- }
2106
- }
2107
- });
2108
- },
2109
-
2110
- _toggleComplete: function( data ) {
2111
- var toHide = data.oldPanel;
2112
-
2113
- toHide
2114
- .removeClass( "ui-accordion-content-active" )
2115
- .prev()
2116
- .removeClass( "ui-corner-top" )
2117
- .addClass( "ui-corner-all" );
2118
-
2119
- // Work around for rendering bug in IE (#5421)
2120
- if ( toHide.length ) {
2121
- toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
2122
- }
2123
- this._trigger( "activate", null, data );
2124
- }
2125
- });
2126
-
2127
-
2128
- /*!
2129
- * jQuery UI Menu 1.11.4
2130
- * http://jqueryui.com
2131
- *
2132
- * Copyright jQuery Foundation and other contributors
2133
- * Released under the MIT license.
2134
- * http://jquery.org/license
2135
- *
2136
- * http://api.jqueryui.com/menu/
2137
- */
2138
-
2139
-
2140
- var menu = $.widget( "ui.menu", {
2141
- version: "1.11.4",
2142
- defaultElement: "<ul>",
2143
- delay: 300,
2144
- options: {
2145
- icons: {
2146
- submenu: "ui-icon-carat-1-e"
2147
- },
2148
- items: "> *",
2149
- menus: "ul",
2150
- position: {
2151
- my: "left-1 top",
2152
- at: "right top"
2153
- },
2154
- role: "menu",
2155
-
2156
- // callbacks
2157
- blur: null,
2158
- focus: null,
2159
- select: null
2160
- },
2161
-
2162
- _create: function() {
2163
- this.activeMenu = this.element;
2164
-
2165
- // Flag used to prevent firing of the click handler
2166
- // as the event bubbles up through nested menus
2167
- this.mouseHandled = false;
2168
- this.element
2169
- .uniqueId()
2170
- .addClass( "ui-menu ui-widget ui-widget-content" )
2171
- .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
2172
- .attr({
2173
- role: this.options.role,
2174
- tabIndex: 0
2175
- });
2176
-
2177
- if ( this.options.disabled ) {
2178
- this.element
2179
- .addClass( "ui-state-disabled" )
2180
- .attr( "aria-disabled", "true" );
2181
- }
2182
-
2183
- this._on({
2184
- // Prevent focus from sticking to links inside menu after clicking
2185
- // them (focus should always stay on UL during navigation).
2186
- "mousedown .ui-menu-item": function( event ) {
2187
- event.preventDefault();
2188
- },
2189
- "click .ui-menu-item": function( event ) {
2190
- var target = $( event.target );
2191
- if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
2192
- this.select( event );
2193
-
2194
- // Only set the mouseHandled flag if the event will bubble, see #9469.
2195
- if ( !event.isPropagationStopped() ) {
2196
- this.mouseHandled = true;
2197
- }
2198
-
2199
- // Open submenu on click
2200
- if ( target.has( ".ui-menu" ).length ) {
2201
- this.expand( event );
2202
- } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
2203
-
2204
- // Redirect focus to the menu
2205
- this.element.trigger( "focus", [ true ] );
2206
-
2207
- // If the active item is on the top level, let it stay active.
2208
- // Otherwise, blur the active item since it is no longer visible.
2209
- if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
2210
- clearTimeout( this.timer );
2211
- }
2212
- }
2213
- }
2214
- },
2215
- "mouseenter .ui-menu-item": function( event ) {
2216
- // Ignore mouse events while typeahead is active, see #10458.
2217
- // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
2218
- // is over an item in the menu
2219
- if ( this.previousFilter ) {
2220
- return;
2221
- }
2222
- var target = $( event.currentTarget );
2223
- // Remove ui-state-active class from siblings of the newly focused menu item
2224
- // to avoid a jump caused by adjacent elements both having a class with a border
2225
- target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
2226
- this.focus( event, target );
2227
- },
2228
- mouseleave: "collapseAll",
2229
- "mouseleave .ui-menu": "collapseAll",
2230
- focus: function( event, keepActiveItem ) {
2231
- // If there's already an active item, keep it active
2232
- // If not, activate the first item
2233
- var item = this.active || this.element.find( this.options.items ).eq( 0 );
2234
-
2235
- if ( !keepActiveItem ) {
2236
- this.focus( event, item );
2237
- }
2238
- },
2239
- blur: function( event ) {
2240
- this._delay(function() {
2241
- if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
2242
- this.collapseAll( event );
2243
- }
2244
- });
2245
- },
2246
- keydown: "_keydown"
2247
- });
2248
-
2249
- this.refresh();
2250
-
2251
- // Clicks outside of a menu collapse any open menus
2252
- this._on( this.document, {
2253
- click: function( event ) {
2254
- if ( this._closeOnDocumentClick( event ) ) {
2255
- this.collapseAll( event );
2256
- }
2257
-
2258
- // Reset the mouseHandled flag
2259
- this.mouseHandled = false;
2260
- }
2261
- });
2262
- },
2263
-
2264
- _destroy: function() {
2265
- // Destroy (sub)menus
2266
- this.element
2267
- .removeAttr( "aria-activedescendant" )
2268
- .find( ".ui-menu" ).addBack()
2269
- .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
2270
- .removeAttr( "role" )
2271
- .removeAttr( "tabIndex" )
2272
- .removeAttr( "aria-labelledby" )
2273
- .removeAttr( "aria-expanded" )
2274
- .removeAttr( "aria-hidden" )
2275
- .removeAttr( "aria-disabled" )
2276
- .removeUniqueId()
2277
- .show();
2278
-
2279
- // Destroy menu items
2280
- this.element.find( ".ui-menu-item" )
2281
- .removeClass( "ui-menu-item" )
2282
- .removeAttr( "role" )
2283
- .removeAttr( "aria-disabled" )
2284
- .removeUniqueId()
2285
- .removeClass( "ui-state-hover" )
2286
- .removeAttr( "tabIndex" )
2287
- .removeAttr( "role" )
2288
- .removeAttr( "aria-haspopup" )
2289
- .children().each( function() {
2290
- var elem = $( this );
2291
- if ( elem.data( "ui-menu-submenu-carat" ) ) {
2292
- elem.remove();
2293
- }
2294
- });
2295
-
2296
- // Destroy menu dividers
2297
- this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
2298
- },
2299
-
2300
- _keydown: function( event ) {
2301
- var match, prev, character, skip,
2302
- preventDefault = true;
2303
-
2304
- switch ( event.keyCode ) {
2305
- case $.ui.keyCode.PAGE_UP:
2306
- this.previousPage( event );
2307
- break;
2308
- case $.ui.keyCode.PAGE_DOWN:
2309
- this.nextPage( event );
2310
- break;
2311
- case $.ui.keyCode.HOME:
2312
- this._move( "first", "first", event );
2313
- break;
2314
- case $.ui.keyCode.END:
2315
- this._move( "last", "last", event );
2316
- break;
2317
- case $.ui.keyCode.UP:
2318
- this.previous( event );
2319
- break;
2320
- case $.ui.keyCode.DOWN:
2321
- this.next( event );
2322
- break;
2323
- case $.ui.keyCode.LEFT:
2324
- this.collapse( event );
2325
- break;
2326
- case $.ui.keyCode.RIGHT:
2327
- if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
2328
- this.expand( event );
2329
- }
2330
- break;
2331
- case $.ui.keyCode.ENTER:
2332
- case $.ui.keyCode.SPACE:
2333
- this._activate( event );
2334
- break;
2335
- case $.ui.keyCode.ESCAPE:
2336
- this.collapse( event );
2337
- break;
2338
- default:
2339
- preventDefault = false;
2340
- prev = this.previousFilter || "";
2341
- character = String.fromCharCode( event.keyCode );
2342
- skip = false;
2343
-
2344
- clearTimeout( this.filterTimer );
2345
-
2346
- if ( character === prev ) {
2347
- skip = true;
2348
- } else {
2349
- character = prev + character;
2350
- }
2351
-
2352
- match = this._filterMenuItems( character );
2353
- match = skip && match.index( this.active.next() ) !== -1 ?
2354
- this.active.nextAll( ".ui-menu-item" ) :
2355
- match;
2356
-
2357
- // If no matches on the current filter, reset to the last character pressed
2358
- // to move down the menu to the first item that starts with that character
2359
- if ( !match.length ) {
2360
- character = String.fromCharCode( event.keyCode );
2361
- match = this._filterMenuItems( character );
2362
- }
2363
-
2364
- if ( match.length ) {
2365
- this.focus( event, match );
2366
- this.previousFilter = character;
2367
- this.filterTimer = this._delay(function() {
2368
- delete this.previousFilter;
2369
- }, 1000 );
2370
- } else {
2371
- delete this.previousFilter;
2372
- }
2373
- }
2374
-
2375
- if ( preventDefault ) {
2376
- event.preventDefault();
2377
- }
2378
- },
2379
-
2380
- _activate: function( event ) {
2381
- if ( !this.active.is( ".ui-state-disabled" ) ) {
2382
- if ( this.active.is( "[aria-haspopup='true']" ) ) {
2383
- this.expand( event );
2384
- } else {
2385
- this.select( event );
2386
- }
2387
- }
2388
- },
2389
-
2390
- refresh: function() {
2391
- var menus, items,
2392
- that = this,
2393
- icon = this.options.icons.submenu,
2394
- submenus = this.element.find( this.options.menus );
2395
-
2396
- this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
2397
-
2398
- // Initialize nested menus
2399
- submenus.filter( ":not(.ui-menu)" )
2400
- .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
2401
- .hide()
2402
- .attr({
2403
- role: this.options.role,
2404
- "aria-hidden": "true",
2405
- "aria-expanded": "false"
2406
- })
2407
- .each(function() {
2408
- var menu = $( this ),
2409
- item = menu.parent(),
2410
- submenuCarat = $( "<span>" )
2411
- .addClass( "ui-menu-icon ui-icon " + icon )
2412
- .data( "ui-menu-submenu-carat", true );
2413
-
2414
- item
2415
- .attr( "aria-haspopup", "true" )
2416
- .prepend( submenuCarat );
2417
- menu.attr( "aria-labelledby", item.attr( "id" ) );
2418
- });
2419
-
2420
- menus = submenus.add( this.element );
2421
- items = menus.find( this.options.items );
2422
-
2423
- // Initialize menu-items containing spaces and/or dashes only as dividers
2424
- items.not( ".ui-menu-item" ).each(function() {
2425
- var item = $( this );
2426
- if ( that._isDivider( item ) ) {
2427
- item.addClass( "ui-widget-content ui-menu-divider" );
2428
- }
2429
- });
2430
-
2431
- // Don't refresh list items that are already adapted
2432
- items.not( ".ui-menu-item, .ui-menu-divider" )
2433
- .addClass( "ui-menu-item" )
2434
- .uniqueId()
2435
- .attr({
2436
- tabIndex: -1,
2437
- role: this._itemRole()
2438
- });
2439
-
2440
- // Add aria-disabled attribute to any disabled menu item
2441
- items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
2442
-
2443
- // If the active item has been removed, blur the menu
2444
- if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
2445
- this.blur();
2446
- }
2447
- },
2448
-
2449
- _itemRole: function() {
2450
- return {
2451
- menu: "menuitem",
2452
- listbox: "option"
2453
- }[ this.options.role ];
2454
- },
2455
-
2456
- _setOption: function( key, value ) {
2457
- if ( key === "icons" ) {
2458
- this.element.find( ".ui-menu-icon" )
2459
- .removeClass( this.options.icons.submenu )
2460
- .addClass( value.submenu );
2461
- }
2462
- if ( key === "disabled" ) {
2463
- this.element
2464
- .toggleClass( "ui-state-disabled", !!value )
2465
- .attr( "aria-disabled", value );
2466
- }
2467
- this._super( key, value );
2468
- },
2469
-
2470
- focus: function( event, item ) {
2471
- var nested, focused;
2472
- this.blur( event, event && event.type === "focus" );
2473
-
2474
- this._scrollIntoView( item );
2475
-
2476
- this.active = item.first();
2477
- focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
2478
- // Only update aria-activedescendant if there's a role
2479
- // otherwise we assume focus is managed elsewhere
2480
- if ( this.options.role ) {
2481
- this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
2482
- }
2483
-
2484
- // Highlight active parent menu item, if any
2485
- this.active
2486
- .parent()
2487
- .closest( ".ui-menu-item" )
2488
- .addClass( "ui-state-active" );
2489
-
2490
- if ( event && event.type === "keydown" ) {
2491
- this._close();
2492
- } else {
2493
- this.timer = this._delay(function() {
2494
- this._close();
2495
- }, this.delay );
2496
- }
2497
-
2498
- nested = item.children( ".ui-menu" );
2499
- if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
2500
- this._startOpening(nested);
2501
- }
2502
- this.activeMenu = item.parent();
2503
-
2504
- this._trigger( "focus", event, { item: item } );
2505
- },
2506
-
2507
- _scrollIntoView: function( item ) {
2508
- var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
2509
- if ( this._hasScroll() ) {
2510
- borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
2511
- paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
2512
- offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
2513
- scroll = this.activeMenu.scrollTop();
2514
- elementHeight = this.activeMenu.height();
2515
- itemHeight = item.outerHeight();
2516
-
2517
- if ( offset < 0 ) {
2518
- this.activeMenu.scrollTop( scroll + offset );
2519
- } else if ( offset + itemHeight > elementHeight ) {
2520
- this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
2521
- }
2522
- }
2523
- },
2524
-
2525
- blur: function( event, fromFocus ) {
2526
- if ( !fromFocus ) {
2527
- clearTimeout( this.timer );
2528
- }
2529
-
2530
- if ( !this.active ) {
2531
- return;
2532
- }
2533
-
2534
- this.active.removeClass( "ui-state-focus" );
2535
- this.active = null;
2536
-
2537
- this._trigger( "blur", event, { item: this.active } );
2538
- },
2539
-
2540
- _startOpening: function( submenu ) {
2541
- clearTimeout( this.timer );
2542
-
2543
- // Don't open if already open fixes a Firefox bug that caused a .5 pixel
2544
- // shift in the submenu position when mousing over the carat icon
2545
- if ( submenu.attr( "aria-hidden" ) !== "true" ) {
2546
- return;
2547
- }
2548
-
2549
- this.timer = this._delay(function() {
2550
- this._close();
2551
- this._open( submenu );
2552
- }, this.delay );
2553
- },
2554
-
2555
- _open: function( submenu ) {
2556
- var position = $.extend({
2557
- of: this.active
2558
- }, this.options.position );
2559
-
2560
- clearTimeout( this.timer );
2561
- this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
2562
- .hide()
2563
- .attr( "aria-hidden", "true" );
2564
-
2565
- submenu
2566
- .show()
2567
- .removeAttr( "aria-hidden" )
2568
- .attr( "aria-expanded", "true" )
2569
- .position( position );
2570
- },
2571
-
2572
- collapseAll: function( event, all ) {
2573
- clearTimeout( this.timer );
2574
- this.timer = this._delay(function() {
2575
- // If we were passed an event, look for the submenu that contains the event
2576
- var currentMenu = all ? this.element :
2577
- $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
2578
-
2579
- // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
2580
- if ( !currentMenu.length ) {
2581
- currentMenu = this.element;
2582
- }
2583
-
2584
- this._close( currentMenu );
2585
-
2586
- this.blur( event );
2587
- this.activeMenu = currentMenu;
2588
- }, this.delay );
2589
- },
2590
-
2591
- // With no arguments, closes the currently active menu - if nothing is active
2592
- // it closes all menus. If passed an argument, it will search for menus BELOW
2593
- _close: function( startMenu ) {
2594
- if ( !startMenu ) {
2595
- startMenu = this.active ? this.active.parent() : this.element;
2596
- }
2597
-
2598
- startMenu
2599
- .find( ".ui-menu" )
2600
- .hide()
2601
- .attr( "aria-hidden", "true" )
2602
- .attr( "aria-expanded", "false" )
2603
- .end()
2604
- .find( ".ui-state-active" ).not( ".ui-state-focus" )
2605
- .removeClass( "ui-state-active" );
2606
- },
2607
-
2608
- _closeOnDocumentClick: function( event ) {
2609
- return !$( event.target ).closest( ".ui-menu" ).length;
2610
- },
2611
-
2612
- _isDivider: function( item ) {
2613
-
2614
- // Match hyphen, em dash, en dash
2615
- return !/[^\-\u2014\u2013\s]/.test( item.text() );
2616
- },
2617
-
2618
- collapse: function( event ) {
2619
- var newItem = this.active &&
2620
- this.active.parent().closest( ".ui-menu-item", this.element );
2621
- if ( newItem && newItem.length ) {
2622
- this._close();
2623
- this.focus( event, newItem );
2624
- }
2625
- },
2626
-
2627
- expand: function( event ) {
2628
- var newItem = this.active &&
2629
- this.active
2630
- .children( ".ui-menu " )
2631
- .find( this.options.items )
2632
- .first();
2633
-
2634
- if ( newItem && newItem.length ) {
2635
- this._open( newItem.parent() );
2636
-
2637
- // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
2638
- this._delay(function() {
2639
- this.focus( event, newItem );
2640
- });
2641
- }
2642
- },
2643
-
2644
- next: function( event ) {
2645
- this._move( "next", "first", event );
2646
- },
2647
-
2648
- previous: function( event ) {
2649
- this._move( "prev", "last", event );
2650
- },
2651
-
2652
- isFirstItem: function() {
2653
- return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
2654
- },
2655
-
2656
- isLastItem: function() {
2657
- return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
2658
- },
2659
-
2660
- _move: function( direction, filter, event ) {
2661
- var next;
2662
- if ( this.active ) {
2663
- if ( direction === "first" || direction === "last" ) {
2664
- next = this.active
2665
- [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
2666
- .eq( -1 );
2667
- } else {
2668
- next = this.active
2669
- [ direction + "All" ]( ".ui-menu-item" )
2670
- .eq( 0 );
2671
- }
2672
- }
2673
- if ( !next || !next.length || !this.active ) {
2674
- next = this.activeMenu.find( this.options.items )[ filter ]();
2675
- }
2676
-
2677
- this.focus( event, next );
2678
- },
2679
-
2680
- nextPage: function( event ) {
2681
- var item, base, height;
2682
-
2683
- if ( !this.active ) {
2684
- this.next( event );
2685
- return;
2686
- }
2687
- if ( this.isLastItem() ) {
2688
- return;
2689
- }
2690
- if ( this._hasScroll() ) {
2691
- base = this.active.offset().top;
2692
- height = this.element.height();
2693
- this.active.nextAll( ".ui-menu-item" ).each(function() {
2694
- item = $( this );
2695
- return item.offset().top - base - height < 0;
2696
- });
2697
-
2698
- this.focus( event, item );
2699
- } else {
2700
- this.focus( event, this.activeMenu.find( this.options.items )
2701
- [ !this.active ? "first" : "last" ]() );
2702
- }
2703
- },
2704
-
2705
- previousPage: function( event ) {
2706
- var item, base, height;
2707
- if ( !this.active ) {
2708
- this.next( event );
2709
- return;
2710
- }
2711
- if ( this.isFirstItem() ) {
2712
- return;
2713
- }
2714
- if ( this._hasScroll() ) {
2715
- base = this.active.offset().top;
2716
- height = this.element.height();
2717
- this.active.prevAll( ".ui-menu-item" ).each(function() {
2718
- item = $( this );
2719
- return item.offset().top - base + height > 0;
2720
- });
2721
-
2722
- this.focus( event, item );
2723
- } else {
2724
- this.focus( event, this.activeMenu.find( this.options.items ).first() );
2725
- }
2726
- },
2727
-
2728
- _hasScroll: function() {
2729
- return this.element.outerHeight() < this.element.prop( "scrollHeight" );
2730
- },
2731
-
2732
- select: function( event ) {
2733
- // TODO: It should never be possible to not have an active item at this
2734
- // point, but the tests don't trigger mouseenter before click.
2735
- this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
2736
- var ui = { item: this.active };
2737
- if ( !this.active.has( ".ui-menu" ).length ) {
2738
- this.collapseAll( event, true );
2739
- }
2740
- this._trigger( "select", event, ui );
2741
- },
2742
-
2743
- _filterMenuItems: function(character) {
2744
- var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
2745
- regex = new RegExp( "^" + escapedCharacter, "i" );
2746
-
2747
- return this.activeMenu
2748
- .find( this.options.items )
2749
-
2750
- // Only match on items, not dividers or other content (#10571)
2751
- .filter( ".ui-menu-item" )
2752
- .filter(function() {
2753
- return regex.test( $.trim( $( this ).text() ) );
2754
- });
2755
- }
2756
- });
2757
-
2758
-
2759
- /*!
2760
- * jQuery UI Autocomplete 1.11.4
2761
- * http://jqueryui.com
2762
- *
2763
- * Copyright jQuery Foundation and other contributors
2764
- * Released under the MIT license.
2765
- * http://jquery.org/license
2766
- *
2767
- * http://api.jqueryui.com/autocomplete/
2768
- */
2769
-
2770
-
2771
- $.widget( "ui.autocomplete", {
2772
- version: "1.11.4",
2773
- defaultElement: "<input>",
2774
- options: {
2775
- appendTo: null,
2776
- autoFocus: false,
2777
- delay: 300,
2778
- minLength: 1,
2779
- position: {
2780
- my: "left top",
2781
- at: "left bottom",
2782
- collision: "none"
2783
- },
2784
- source: null,
2785
-
2786
- // callbacks
2787
- change: null,
2788
- close: null,
2789
- focus: null,
2790
- open: null,
2791
- response: null,
2792
- search: null,
2793
- select: null
2794
- },
2795
-
2796
- requestIndex: 0,
2797
- pending: 0,
2798
-
2799
- _create: function() {
2800
- // Some browsers only repeat keydown events, not keypress events,
2801
- // so we use the suppressKeyPress flag to determine if we've already
2802
- // handled the keydown event. #7269
2803
- // Unfortunately the code for & in keypress is the same as the up arrow,
2804
- // so we use the suppressKeyPressRepeat flag to avoid handling keypress
2805
- // events when we know the keydown event was used to modify the
2806
- // search term. #7799
2807
- var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
2808
- nodeName = this.element[ 0 ].nodeName.toLowerCase(),
2809
- isTextarea = nodeName === "textarea",
2810
- isInput = nodeName === "input";
2811
-
2812
- this.isMultiLine =
2813
- // Textareas are always multi-line
2814
- isTextarea ? true :
2815
- // Inputs are always single-line, even if inside a contentEditable element
2816
- // IE also treats inputs as contentEditable
2817
- isInput ? false :
2818
- // All other element types are determined by whether or not they're contentEditable
2819
- this.element.prop( "isContentEditable" );
2820
-
2821
- this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
2822
- this.isNewMenu = true;
2823
-
2824
- this.element
2825
- .addClass( "ui-autocomplete-input" )
2826
- .attr( "autocomplete", "off" );
2827
-
2828
- this._on( this.element, {
2829
- keydown: function( event ) {
2830
- if ( this.element.prop( "readOnly" ) ) {
2831
- suppressKeyPress = true;
2832
- suppressInput = true;
2833
- suppressKeyPressRepeat = true;
2834
- return;
2835
- }
2836
-
2837
- suppressKeyPress = false;
2838
- suppressInput = false;
2839
- suppressKeyPressRepeat = false;
2840
- var keyCode = $.ui.keyCode;
2841
- switch ( event.keyCode ) {
2842
- case keyCode.PAGE_UP:
2843
- suppressKeyPress = true;
2844
- this._move( "previousPage", event );
2845
- break;
2846
- case keyCode.PAGE_DOWN:
2847
- suppressKeyPress = true;
2848
- this._move( "nextPage", event );
2849
- break;
2850
- case keyCode.UP:
2851
- suppressKeyPress = true;
2852
- this._keyEvent( "previous", event );
2853
- break;
2854
- case keyCode.DOWN:
2855
- suppressKeyPress = true;
2856
- this._keyEvent( "next", event );
2857
- break;
2858
- case keyCode.ENTER:
2859
- // when menu is open and has focus
2860
- if ( this.menu.active ) {
2861
- // #6055 - Opera still allows the keypress to occur
2862
- // which causes forms to submit
2863
- suppressKeyPress = true;
2864
- event.preventDefault();
2865
- this.menu.select( event );
2866
- }
2867
- break;
2868
- case keyCode.TAB:
2869
- if ( this.menu.active ) {
2870
- this.menu.select( event );
2871
- }
2872
- break;
2873
- case keyCode.ESCAPE:
2874
- if ( this.menu.element.is( ":visible" ) ) {
2875
- if ( !this.isMultiLine ) {
2876
- this._value( this.term );
2877
- }
2878
- this.close( event );
2879
- // Different browsers have different default behavior for escape
2880
- // Single press can mean undo or clear
2881
- // Double press in IE means clear the whole form
2882
- event.preventDefault();
2883
- }
2884
- break;
2885
- default:
2886
- suppressKeyPressRepeat = true;
2887
- // search timeout should be triggered before the input value is changed
2888
- this._searchTimeout( event );
2889
- break;
2890
- }
2891
- },
2892
- keypress: function( event ) {
2893
- if ( suppressKeyPress ) {
2894
- suppressKeyPress = false;
2895
- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
2896
- event.preventDefault();
2897
- }
2898
- return;
2899
- }
2900
- if ( suppressKeyPressRepeat ) {
2901
- return;
2902
- }
2903
-
2904
- // replicate some key handlers to allow them to repeat in Firefox and Opera
2905
- var keyCode = $.ui.keyCode;
2906
- switch ( event.keyCode ) {
2907
- case keyCode.PAGE_UP:
2908
- this._move( "previousPage", event );
2909
- break;
2910
- case keyCode.PAGE_DOWN:
2911
- this._move( "nextPage", event );
2912
- break;
2913
- case keyCode.UP:
2914
- this._keyEvent( "previous", event );
2915
- break;
2916
- case keyCode.DOWN:
2917
- this._keyEvent( "next", event );
2918
- break;
2919
- }
2920
- },
2921
- input: function( event ) {
2922
- if ( suppressInput ) {
2923
- suppressInput = false;
2924
- event.preventDefault();
2925
- return;
2926
- }
2927
- this._searchTimeout( event );
2928
- },
2929
- focus: function() {
2930
- this.selectedItem = null;
2931
- this.previous = this._value();
2932
- },
2933
- blur: function( event ) {
2934
- if ( this.cancelBlur ) {
2935
- delete this.cancelBlur;
2936
- return;
2937
- }
2938
-
2939
- clearTimeout( this.searching );
2940
- this.close( event );
2941
- this._change( event );
2942
- }
2943
- });
2944
-
2945
- this._initSource();
2946
- this.menu = $( "<ul>" )
2947
- .addClass( "ui-autocomplete ui-front" )
2948
- .appendTo( this._appendTo() )
2949
- .menu({
2950
- // disable ARIA support, the live region takes care of that
2951
- role: null
2952
- })
2953
- .hide()
2954
- .menu( "instance" );
2955
-
2956
- this._on( this.menu.element, {
2957
- mousedown: function( event ) {
2958
- // prevent moving focus out of the text field
2959
- event.preventDefault();
2960
-
2961
- // IE doesn't prevent moving focus even with event.preventDefault()
2962
- // so we set a flag to know when we should ignore the blur event
2963
- this.cancelBlur = true;
2964
- this._delay(function() {
2965
- delete this.cancelBlur;
2966
- });
2967
-
2968
- // clicking on the scrollbar causes focus to shift to the body
2969
- // but we can't detect a mouseup or a click immediately afterward
2970
- // so we have to track the next mousedown and close the menu if
2971
- // the user clicks somewhere outside of the autocomplete
2972
- var menuElement = this.menu.element[ 0 ];
2973
- if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
2974
- this._delay(function() {
2975
- var that = this;
2976
- this.document.one( "mousedown", function( event ) {
2977
- if ( event.target !== that.element[ 0 ] &&
2978
- event.target !== menuElement &&
2979
- !$.contains( menuElement, event.target ) ) {
2980
- that.close();
2981
- }
2982
- });
2983
- });
2984
- }
2985
- },
2986
- menufocus: function( event, ui ) {
2987
- var label, item;
2988
- // support: Firefox
2989
- // Prevent accidental activation of menu items in Firefox (#7024 #9118)
2990
- if ( this.isNewMenu ) {
2991
- this.isNewMenu = false;
2992
- if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
2993
- this.menu.blur();
2994
-
2995
- this.document.one( "mousemove", function() {
2996
- $( event.target ).trigger( event.originalEvent );
2997
- });
2998
-
2999
- return;
3000
- }
3001
- }
3002
-
3003
- item = ui.item.data( "ui-autocomplete-item" );
3004
- if ( false !== this._trigger( "focus", event, { item: item } ) ) {
3005
- // use value to match what will end up in the input, if it was a key event
3006
- if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
3007
- this._value( item.value );
3008
- }
3009
- }
3010
-
3011
- // Announce the value in the liveRegion
3012
- label = ui.item.attr( "aria-label" ) || item.value;
3013
- if ( label && $.trim( label ).length ) {
3014
- this.liveRegion.children().hide();
3015
- $( "<div>" ).text( label ).appendTo( this.liveRegion );
3016
- }
3017
- },
3018
- menuselect: function( event, ui ) {
3019
- var item = ui.item.data( "ui-autocomplete-item" ),
3020
- previous = this.previous;
3021
-
3022
- // only trigger when focus was lost (click on menu)
3023
- if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
3024
- this.element.focus();
3025
- this.previous = previous;
3026
- // #6109 - IE triggers two focus events and the second
3027
- // is asynchronous, so we need to reset the previous
3028
- // term synchronously and asynchronously :-(
3029
- this._delay(function() {
3030
- this.previous = previous;
3031
- this.selectedItem = item;
3032
- });
3033
- }
3034
-
3035
- if ( false !== this._trigger( "select", event, { item: item } ) ) {
3036
- this._value( item.value );
3037
- }
3038
- // reset the term after the select event
3039
- // this allows custom select handling to work properly
3040
- this.term = this._value();
3041
-
3042
- this.close( event );
3043
- this.selectedItem = item;
3044
- }
3045
- });
3046
-
3047
- this.liveRegion = $( "<span>", {
3048
- role: "status",
3049
- "aria-live": "assertive",
3050
- "aria-relevant": "additions"
3051
- })
3052
- .addClass( "ui-helper-hidden-accessible" )
3053
- .appendTo( this.document[ 0 ].body );
3054
-
3055
- // turning off autocomplete prevents the browser from remembering the
3056
- // value when navigating through history, so we re-enable autocomplete
3057
- // if the page is unloaded before the widget is destroyed. #7790
3058
- this._on( this.window, {
3059
- beforeunload: function() {
3060
- this.element.removeAttr( "autocomplete" );
3061
- }
3062
- });
3063
- },
3064
-
3065
- _destroy: function() {
3066
- clearTimeout( this.searching );
3067
- this.element
3068
- .removeClass( "ui-autocomplete-input" )
3069
- .removeAttr( "autocomplete" );
3070
- this.menu.element.remove();
3071
- this.liveRegion.remove();
3072
- },
3073
-
3074
- _setOption: function( key, value ) {
3075
- this._super( key, value );
3076
- if ( key === "source" ) {
3077
- this._initSource();
3078
- }
3079
- if ( key === "appendTo" ) {
3080
- this.menu.element.appendTo( this._appendTo() );
3081
- }
3082
- if ( key === "disabled" && value && this.xhr ) {
3083
- this.xhr.abort();
3084
- }
3085
- },
3086
-
3087
- _appendTo: function() {
3088
- var element = this.options.appendTo;
3089
-
3090
- if ( element ) {
3091
- element = element.jquery || element.nodeType ?
3092
- $( element ) :
3093
- this.document.find( element ).eq( 0 );
3094
- }
3095
-
3096
- if ( !element || !element[ 0 ] ) {
3097
- element = this.element.closest( ".ui-front" );
3098
- }
3099
-
3100
- if ( !element.length ) {
3101
- element = this.document[ 0 ].body;
3102
- }
3103
-
3104
- return element;
3105
- },
3106
-
3107
- _initSource: function() {
3108
- var array, url,
3109
- that = this;
3110
- if ( $.isArray( this.options.source ) ) {
3111
- array = this.options.source;
3112
- this.source = function( request, response ) {
3113
- response( $.ui.autocomplete.filter( array, request.term ) );
3114
- };
3115
- } else if ( typeof this.options.source === "string" ) {
3116
- url = this.options.source;
3117
- this.source = function( request, response ) {
3118
- if ( that.xhr ) {
3119
- that.xhr.abort();
3120
- }
3121
- that.xhr = $.ajax({
3122
- url: url,
3123
- data: request,
3124
- dataType: "json",
3125
- success: function( data ) {
3126
- response( data );
3127
- },
3128
- error: function() {
3129
- response([]);
3130
- }
3131
- });
3132
- };
3133
- } else {
3134
- this.source = this.options.source;
3135
- }
3136
- },
3137
-
3138
- _searchTimeout: function( event ) {
3139
- clearTimeout( this.searching );
3140
- this.searching = this._delay(function() {
3141
-
3142
- // Search if the value has changed, or if the user retypes the same value (see #7434)
3143
- var equalValues = this.term === this._value(),
3144
- menuVisible = this.menu.element.is( ":visible" ),
3145
- modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
3146
-
3147
- if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
3148
- this.selectedItem = null;
3149
- this.search( null, event );
3150
- }
3151
- }, this.options.delay );
3152
- },
3153
-
3154
- search: function( value, event ) {
3155
- value = value != null ? value : this._value();
3156
-
3157
- // always save the actual value, not the one passed as an argument
3158
- this.term = this._value();
3159
-
3160
- if ( value.length < this.options.minLength ) {
3161
- return this.close( event );
3162
- }
3163
-
3164
- if ( this._trigger( "search", event ) === false ) {
3165
- return;
3166
- }
3167
-
3168
- return this._search( value );
3169
- },
3170
-
3171
- _search: function( value ) {
3172
- this.pending++;
3173
- this.element.addClass( "ui-autocomplete-loading" );
3174
- this.cancelSearch = false;
3175
-
3176
- this.source( { term: value }, this._response() );
3177
- },
3178
-
3179
- _response: function() {
3180
- var index = ++this.requestIndex;
3181
-
3182
- return $.proxy(function( content ) {
3183
- if ( index === this.requestIndex ) {
3184
- this.__response( content );
3185
- }
3186
-
3187
- this.pending--;
3188
- if ( !this.pending ) {
3189
- this.element.removeClass( "ui-autocomplete-loading" );
3190
- }
3191
- }, this );
3192
- },
3193
-
3194
- __response: function( content ) {
3195
- if ( content ) {
3196
- content = this._normalize( content );
3197
- }
3198
- this._trigger( "response", null, { content: content } );
3199
- if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
3200
- this._suggest( content );
3201
- this._trigger( "open" );
3202
- } else {
3203
- // use ._close() instead of .close() so we don't cancel future searches
3204
- this._close();
3205
- }
3206
- },
3207
-
3208
- close: function( event ) {
3209
- this.cancelSearch = true;
3210
- this._close( event );
3211
- },
3212
-
3213
- _close: function( event ) {
3214
- if ( this.menu.element.is( ":visible" ) ) {
3215
- this.menu.element.hide();
3216
- this.menu.blur();
3217
- this.isNewMenu = true;
3218
- this._trigger( "close", event );
3219
- }
3220
- },
3221
-
3222
- _change: function( event ) {
3223
- if ( this.previous !== this._value() ) {
3224
- this._trigger( "change", event, { item: this.selectedItem } );
3225
- }
3226
- },
3227
-
3228
- _normalize: function( items ) {
3229
- // assume all items have the right format when the first item is complete
3230
- if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
3231
- return items;
3232
- }
3233
- return $.map( items, function( item ) {
3234
- if ( typeof item === "string" ) {
3235
- return {
3236
- label: item,
3237
- value: item
3238
- };
3239
- }
3240
- return $.extend( {}, item, {
3241
- label: item.label || item.value,
3242
- value: item.value || item.label
3243
- });
3244
- });
3245
- },
3246
-
3247
- _suggest: function( items ) {
3248
- var ul = this.menu.element.empty();
3249
- this._renderMenu( ul, items );
3250
- this.isNewMenu = true;
3251
- this.menu.refresh();
3252
-
3253
- // size and position menu
3254
- ul.show();
3255
- this._resizeMenu();
3256
- ul.position( $.extend({
3257
- of: this.element
3258
- }, this.options.position ) );
3259
-
3260
- if ( this.options.autoFocus ) {
3261
- this.menu.next();
3262
- }
3263
- },
3264
-
3265
- _resizeMenu: function() {
3266
- var ul = this.menu.element;
3267
- ul.outerWidth( Math.max(
3268
- // Firefox wraps long text (possibly a rounding bug)
3269
- // so we add 1px to avoid the wrapping (#7513)
3270
- ul.width( "" ).outerWidth() + 1,
3271
- this.element.outerWidth()
3272
- ) );
3273
- },
3274
-
3275
- _renderMenu: function( ul, items ) {
3276
- var that = this;
3277
- $.each( items, function( index, item ) {
3278
- that._renderItemData( ul, item );
3279
- });
3280
- },
3281
-
3282
- _renderItemData: function( ul, item ) {
3283
- return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
3284
- },
3285
-
3286
- _renderItem: function( ul, item ) {
3287
- return $( "<li>" ).text( item.label ).appendTo( ul );
3288
- },
3289
-
3290
- _move: function( direction, event ) {
3291
- if ( !this.menu.element.is( ":visible" ) ) {
3292
- this.search( null, event );
3293
- return;
3294
- }
3295
- if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
3296
- this.menu.isLastItem() && /^next/.test( direction ) ) {
3297
-
3298
- if ( !this.isMultiLine ) {
3299
- this._value( this.term );
3300
- }
3301
-
3302
- this.menu.blur();
3303
- return;
3304
- }
3305
- this.menu[ direction ]( event );
3306
- },
3307
-
3308
- widget: function() {
3309
- return this.menu.element;
3310
- },
3311
-
3312
- _value: function() {
3313
- return this.valueMethod.apply( this.element, arguments );
3314
- },
3315
-
3316
- _keyEvent: function( keyEvent, event ) {
3317
- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
3318
- this._move( keyEvent, event );
3319
-
3320
- // prevents moving cursor to beginning/end of the text field in some browsers
3321
- event.preventDefault();
3322
- }
3323
- }
3324
- });
3325
-
3326
- $.extend( $.ui.autocomplete, {
3327
- escapeRegex: function( value ) {
3328
- return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
3329
- },
3330
- filter: function( array, term ) {
3331
- var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
3332
- return $.grep( array, function( value ) {
3333
- return matcher.test( value.label || value.value || value );
3334
- });
3335
- }
3336
- });
3337
-
3338
- // live region extension, adding a `messages` option
3339
- // NOTE: This is an experimental API. We are still investigating
3340
- // a full solution for string manipulation and internationalization.
3341
- $.widget( "ui.autocomplete", $.ui.autocomplete, {
3342
- options: {
3343
- messages: {
3344
- noResults: "No search results.",
3345
- results: function( amount ) {
3346
- return amount + ( amount > 1 ? " results are" : " result is" ) +
3347
- " available, use up and down arrow keys to navigate.";
3348
- }
3349
- }
3350
- },
3351
-
3352
- __response: function( content ) {
3353
- var message;
3354
- this._superApply( arguments );
3355
- if ( this.options.disabled || this.cancelSearch ) {
3356
- return;
3357
- }
3358
- if ( content && content.length ) {
3359
- message = this.options.messages.results( content.length );
3360
- } else {
3361
- message = this.options.messages.noResults;
3362
- }
3363
- this.liveRegion.children().hide();
3364
- $( "<div>" ).text( message ).appendTo( this.liveRegion );
3365
- }
3366
- });
3367
-
3368
- var autocomplete = $.ui.autocomplete;
3369
-
3370
-
3371
- /*!
3372
- * jQuery UI Button 1.11.4
3373
- * http://jqueryui.com
3374
- *
3375
- * Copyright jQuery Foundation and other contributors
3376
- * Released under the MIT license.
3377
- * http://jquery.org/license
3378
- *
3379
- * http://api.jqueryui.com/button/
3380
- */
3381
-
3382
-
3383
- var lastActive,
3384
- baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
3385
- typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
3386
- formResetHandler = function() {
3387
- var form = $( this );
3388
- setTimeout(function() {
3389
- form.find( ":ui-button" ).button( "refresh" );
3390
- }, 1 );
3391
- },
3392
- radioGroup = function( radio ) {
3393
- var name = radio.name,
3394
- form = radio.form,
3395
- radios = $( [] );
3396
- if ( name ) {
3397
- name = name.replace( /'/g, "\\'" );
3398
- if ( form ) {
3399
- radios = $( form ).find( "[name='" + name + "'][type=radio]" );
3400
- } else {
3401
- radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
3402
- .filter(function() {
3403
- return !this.form;
3404
- });
3405
- }
3406
- }
3407
- return radios;
3408
- };
3409
-
3410
- $.widget( "ui.button", {
3411
- version: "1.11.4",
3412
- defaultElement: "<button>",
3413
- options: {
3414
- disabled: null,
3415
- text: true,
3416
- label: null,
3417
- icons: {
3418
- primary: null,
3419
- secondary: null
3420
- }
3421
- },
3422
- _create: function() {
3423
- this.element.closest( "form" )
3424
- .unbind( "reset" + this.eventNamespace )
3425
- .bind( "reset" + this.eventNamespace, formResetHandler );
3426
-
3427
- if ( typeof this.options.disabled !== "boolean" ) {
3428
- this.options.disabled = !!this.element.prop( "disabled" );
3429
- } else {
3430
- this.element.prop( "disabled", this.options.disabled );
3431
- }
3432
-
3433
- this._determineButtonType();
3434
- this.hasTitle = !!this.buttonElement.attr( "title" );
3435
-
3436
- var that = this,
3437
- options = this.options,
3438
- toggleButton = this.type === "checkbox" || this.type === "radio",
3439
- activeClass = !toggleButton ? "ui-state-active" : "";
3440
-
3441
- if ( options.label === null ) {
3442
- options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
3443
- }
3444
-
3445
- this._hoverable( this.buttonElement );
3446
-
3447
- this.buttonElement
3448
- .addClass( baseClasses )
3449
- .attr( "role", "button" )
3450
- .bind( "mouseenter" + this.eventNamespace, function() {
3451
- if ( options.disabled ) {
3452
- return;
3453
- }
3454
- if ( this === lastActive ) {
3455
- $( this ).addClass( "ui-state-active" );
3456
- }
3457
- })
3458
- .bind( "mouseleave" + this.eventNamespace, function() {
3459
- if ( options.disabled ) {
3460
- return;
3461
- }
3462
- $( this ).removeClass( activeClass );
3463
- })
3464
- .bind( "click" + this.eventNamespace, function( event ) {
3465
- if ( options.disabled ) {
3466
- event.preventDefault();
3467
- event.stopImmediatePropagation();
3468
- }
3469
- });
3470
-
3471
- // Can't use _focusable() because the element that receives focus
3472
- // and the element that gets the ui-state-focus class are different
3473
- this._on({
3474
- focus: function() {
3475
- this.buttonElement.addClass( "ui-state-focus" );
3476
- },
3477
- blur: function() {
3478
- this.buttonElement.removeClass( "ui-state-focus" );
3479
- }
3480
- });
3481
-
3482
- if ( toggleButton ) {
3483
- this.element.bind( "change" + this.eventNamespace, function() {
3484
- that.refresh();
3485
- });
3486
- }
3487
-
3488
- if ( this.type === "checkbox" ) {
3489
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
3490
- if ( options.disabled ) {
3491
- return false;
3492
- }
3493
- });
3494
- } else if ( this.type === "radio" ) {
3495
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
3496
- if ( options.disabled ) {
3497
- return false;
3498
- }
3499
- $( this ).addClass( "ui-state-active" );
3500
- that.buttonElement.attr( "aria-pressed", "true" );
3501
-
3502
- var radio = that.element[ 0 ];
3503
- radioGroup( radio )
3504
- .not( radio )
3505
- .map(function() {
3506
- return $( this ).button( "widget" )[ 0 ];
3507
- })
3508
- .removeClass( "ui-state-active" )
3509
- .attr( "aria-pressed", "false" );
3510
- });
3511
- } else {
3512
- this.buttonElement
3513
- .bind( "mousedown" + this.eventNamespace, function() {
3514
- if ( options.disabled ) {
3515
- return false;
3516
- }
3517
- $( this ).addClass( "ui-state-active" );
3518
- lastActive = this;
3519
- that.document.one( "mouseup", function() {
3520
- lastActive = null;
3521
- });
3522
- })
3523
- .bind( "mouseup" + this.eventNamespace, function() {
3524
- if ( options.disabled ) {
3525
- return false;
3526
- }
3527
- $( this ).removeClass( "ui-state-active" );
3528
- })
3529
- .bind( "keydown" + this.eventNamespace, function(event) {
3530
- if ( options.disabled ) {
3531
- return false;
3532
- }
3533
- if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
3534
- $( this ).addClass( "ui-state-active" );
3535
- }
3536
- })
3537
- // see #8559, we bind to blur here in case the button element loses
3538
- // focus between keydown and keyup, it would be left in an "active" state
3539
- .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
3540
- $( this ).removeClass( "ui-state-active" );
3541
- });
3542
-
3543
- if ( this.buttonElement.is("a") ) {
3544
- this.buttonElement.keyup(function(event) {
3545
- if ( event.keyCode === $.ui.keyCode.SPACE ) {
3546
- // TODO pass through original event correctly (just as 2nd argument doesn't work)
3547
- $( this ).click();
3548
- }
3549
- });
3550
- }
3551
- }
3552
-
3553
- this._setOption( "disabled", options.disabled );
3554
- this._resetButton();
3555
- },
3556
-
3557
- _determineButtonType: function() {
3558
- var ancestor, labelSelector, checked;
3559
-
3560
- if ( this.element.is("[type=checkbox]") ) {
3561
- this.type = "checkbox";
3562
- } else if ( this.element.is("[type=radio]") ) {
3563
- this.type = "radio";
3564
- } else if ( this.element.is("input") ) {
3565
- this.type = "input";
3566
- } else {
3567
- this.type = "button";
3568
- }
3569
-
3570
- if ( this.type === "checkbox" || this.type === "radio" ) {
3571
- // we don't search against the document in case the element
3572
- // is disconnected from the DOM
3573
- ancestor = this.element.parents().last();
3574
- labelSelector = "label[for='" + this.element.attr("id") + "']";
3575
- this.buttonElement = ancestor.find( labelSelector );
3576
- if ( !this.buttonElement.length ) {
3577
- ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
3578
- this.buttonElement = ancestor.filter( labelSelector );
3579
- if ( !this.buttonElement.length ) {
3580
- this.buttonElement = ancestor.find( labelSelector );
3581
- }
3582
- }
3583
- this.element.addClass( "ui-helper-hidden-accessible" );
3584
-
3585
- checked = this.element.is( ":checked" );
3586
- if ( checked ) {
3587
- this.buttonElement.addClass( "ui-state-active" );
3588
- }
3589
- this.buttonElement.prop( "aria-pressed", checked );
3590
- } else {
3591
- this.buttonElement = this.element;
3592
- }
3593
- },
3594
-
3595
- widget: function() {
3596
- return this.buttonElement;
3597
- },
3598
-
3599
- _destroy: function() {
3600
- this.element
3601
- .removeClass( "ui-helper-hidden-accessible" );
3602
- this.buttonElement
3603
- .removeClass( baseClasses + " ui-state-active " + typeClasses )
3604
- .removeAttr( "role" )
3605
- .removeAttr( "aria-pressed" )
3606
- .html( this.buttonElement.find(".ui-button-text").html() );
3607
-
3608
- if ( !this.hasTitle ) {
3609
- this.buttonElement.removeAttr( "title" );
3610
- }
3611
- },
3612
-
3613
- _setOption: function( key, value ) {
3614
- this._super( key, value );
3615
- if ( key === "disabled" ) {
3616
- this.widget().toggleClass( "ui-state-disabled", !!value );
3617
- this.element.prop( "disabled", !!value );
3618
- if ( value ) {
3619
- if ( this.type === "checkbox" || this.type === "radio" ) {
3620
- this.buttonElement.removeClass( "ui-state-focus" );
3621
- } else {
3622
- this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
3623
- }
3624
- }
3625
- return;
3626
- }
3627
- this._resetButton();
3628
- },
3629
-
3630
- refresh: function() {
3631
- //See #8237 & #8828
3632
- var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
3633
-
3634
- if ( isDisabled !== this.options.disabled ) {
3635
- this._setOption( "disabled", isDisabled );
3636
- }
3637
- if ( this.type === "radio" ) {
3638
- radioGroup( this.element[0] ).each(function() {
3639
- if ( $( this ).is( ":checked" ) ) {
3640
- $( this ).button( "widget" )
3641
- .addClass( "ui-state-active" )
3642
- .attr( "aria-pressed", "true" );
3643
- } else {
3644
- $( this ).button( "widget" )
3645
- .removeClass( "ui-state-active" )
3646
- .attr( "aria-pressed", "false" );
3647
- }
3648
- });
3649
- } else if ( this.type === "checkbox" ) {
3650
- if ( this.element.is( ":checked" ) ) {
3651
- this.buttonElement
3652
- .addClass( "ui-state-active" )
3653
- .attr( "aria-pressed", "true" );
3654
- } else {
3655
- this.buttonElement
3656
- .removeClass( "ui-state-active" )
3657
- .attr( "aria-pressed", "false" );
3658
- }
3659
- }
3660
- },
3661
-
3662
- _resetButton: function() {
3663
- if ( this.type === "input" ) {
3664
- if ( this.options.label ) {
3665
- this.element.val( this.options.label );
3666
- }
3667
- return;
3668
- }
3669
- var buttonElement = this.buttonElement.removeClass( typeClasses ),
3670
- buttonText = $( "<span></span>", this.document[0] )
3671
- .addClass( "ui-button-text" )
3672
- .html( this.options.label )
3673
- .appendTo( buttonElement.empty() )
3674
- .text(),
3675
- icons = this.options.icons,
3676
- multipleIcons = icons.primary && icons.secondary,
3677
- buttonClasses = [];
3678
-
3679
- if ( icons.primary || icons.secondary ) {
3680
- if ( this.options.text ) {
3681
- buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
3682
- }
3683
-
3684
- if ( icons.primary ) {
3685
- buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
3686
- }
3687
-
3688
- if ( icons.secondary ) {
3689
- buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
3690
- }
3691
-
3692
- if ( !this.options.text ) {
3693
- buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
3694
-
3695
- if ( !this.hasTitle ) {
3696
- buttonElement.attr( "title", $.trim( buttonText ) );
3697
- }
3698
- }
3699
- } else {
3700
- buttonClasses.push( "ui-button-text-only" );
3701
- }
3702
- buttonElement.addClass( buttonClasses.join( " " ) );
3703
- }
3704
- });
3705
-
3706
- $.widget( "ui.buttonset", {
3707
- version: "1.11.4",
3708
- options: {
3709
- items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
3710
- },
3711
-
3712
- _create: function() {
3713
- this.element.addClass( "ui-buttonset" );
3714
- },
3715
-
3716
- _init: function() {
3717
- this.refresh();
3718
- },
3719
-
3720
- _setOption: function( key, value ) {
3721
- if ( key === "disabled" ) {
3722
- this.buttons.button( "option", key, value );
3723
- }
3724
-
3725
- this._super( key, value );
3726
- },
3727
-
3728
- refresh: function() {
3729
- var rtl = this.element.css( "direction" ) === "rtl",
3730
- allButtons = this.element.find( this.options.items ),
3731
- existingButtons = allButtons.filter( ":ui-button" );
3732
-
3733
- // Initialize new buttons
3734
- allButtons.not( ":ui-button" ).button();
3735
-
3736
- // Refresh existing buttons
3737
- existingButtons.button( "refresh" );
3738
-
3739
- this.buttons = allButtons
3740
- .map(function() {
3741
- return $( this ).button( "widget" )[ 0 ];
3742
- })
3743
- .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
3744
- .filter( ":first" )
3745
- .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
3746
- .end()
3747
- .filter( ":last" )
3748
- .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
3749
- .end()
3750
- .end();
3751
- },
3752
-
3753
- _destroy: function() {
3754
- this.element.removeClass( "ui-buttonset" );
3755
- this.buttons
3756
- .map(function() {
3757
- return $( this ).button( "widget" )[ 0 ];
3758
- })
3759
- .removeClass( "ui-corner-left ui-corner-right" )
3760
- .end()
3761
- .button( "destroy" );
3762
- }
3763
- });
3764
-
3765
- var button = $.ui.button;
3766
-
3767
-
3768
- /*!
3769
- * jQuery UI Datepicker 1.11.4
3770
- * http://jqueryui.com
3771
- *
3772
- * Copyright jQuery Foundation and other contributors
3773
- * Released under the MIT license.
3774
- * http://jquery.org/license
3775
- *
3776
- * http://api.jqueryui.com/datepicker/
3777
- */
3778
-
3779
-
3780
- $.extend($.ui, { datepicker: { version: "1.11.4" } });
3781
-
3782
- var datepicker_instActive;
3783
-
3784
- function datepicker_getZindex( elem ) {
3785
- var position, value;
3786
- while ( elem.length && elem[ 0 ] !== document ) {
3787
- // Ignore z-index if position is set to a value where z-index is ignored by the browser
3788
- // This makes behavior of this function consistent across browsers
3789
- // WebKit always returns auto if the element is positioned
3790
- position = elem.css( "position" );
3791
- if ( position === "absolute" || position === "relative" || position === "fixed" ) {
3792
- // IE returns 0 when zIndex is not specified
3793
- // other browsers return a string
3794
- // we ignore the case of nested elements with an explicit value of 0
3795
- // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
3796
- value = parseInt( elem.css( "zIndex" ), 10 );
3797
- if ( !isNaN( value ) && value !== 0 ) {
3798
- return value;
3799
- }
3800
- }
3801
- elem = elem.parent();
3802
- }
3803
-
3804
- return 0;
3805
- }
3806
- /* Date picker manager.
3807
- Use the singleton instance of this class, $.datepicker, to interact with the date picker.
3808
- Settings for (groups of) date pickers are maintained in an instance object,
3809
- allowing multiple different settings on the same page. */
3810
-
3811
- function Datepicker() {
3812
- this._curInst = null; // The current instance in use
3813
- this._keyEvent = false; // If the last event was a key event
3814
- this._disabledInputs = []; // List of date picker inputs that have been disabled
3815
- this._datepickerShowing = false; // True if the popup picker is showing , false if not
3816
- this._inDialog = false; // True if showing within a "dialog", false if not
3817
- this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
3818
- this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
3819
- this._appendClass = "ui-datepicker-append"; // The name of the append marker class
3820
- this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
3821
- this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
3822
- this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
3823
- this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
3824
- this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
3825
- this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
3826
- this.regional = []; // Available regional settings, indexed by language code
3827
- this.regional[""] = { // Default regional settings
3828
- closeText: "Done", // Display text for close link
3829
- prevText: "Prev", // Display text for previous month link
3830
- nextText: "Next", // Display text for next month link
3831
- currentText: "Today", // Display text for current month link
3832
- monthNames: ["January","February","March","April","May","June",
3833
- "July","August","September","October","November","December"], // Names of months for drop-down and formatting
3834
- monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
3835
- dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
3836
- dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
3837
- dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
3838
- weekHeader: "Wk", // Column header for week of the year
3839
- dateFormat: "mm/dd/yy", // See format options on parseDate
3840
- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
3841
- isRTL: false, // True if right-to-left language, false if left-to-right
3842
- showMonthAfterYear: false, // True if the year select precedes month, false for month then year
3843
- yearSuffix: "" // Additional text to append to the year in the month headers
3844
- };
3845
- this._defaults = { // Global defaults for all the date picker instances
3846
- showOn: "focus", // "focus" for popup on focus,
3847
- // "button" for trigger button, or "both" for either
3848
- showAnim: "fadeIn", // Name of jQuery animation for popup
3849
- showOptions: {}, // Options for enhanced animations
3850
- defaultDate: null, // Used when field is blank: actual date,
3851
- // +/-number for offset from today, null for today
3852
- appendText: "", // Display text following the input box, e.g. showing the format
3853
- buttonText: "...", // Text for trigger button
3854
- buttonImage: "", // URL for trigger button image
3855
- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
3856
- hideIfNoPrevNext: false, // True to hide next/previous month links
3857
- // if not applicable, false to just disable them
3858
- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
3859
- gotoCurrent: false, // True if today link goes back to current selection instead
3860
- changeMonth: false, // True if month can be selected directly, false if only prev/next
3861
- changeYear: false, // True if year can be selected directly, false if only prev/next
3862
- yearRange: "c-10:c+10", // Range of years to display in drop-down,
3863
- // either relative to today's year (-nn:+nn), relative to currently displayed year
3864
- // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
3865
- showOtherMonths: false, // True to show dates in other months, false to leave blank
3866
- selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
3867
- showWeek: false, // True to show week of the year, false to not show it
3868
- calculateWeek: this.iso8601Week, // How to calculate the week of the year,
3869
- // takes a Date and returns the number of the week for it
3870
- shortYearCutoff: "+10", // Short year values < this are in the current century,
3871
- // > this are in the previous century,
3872
- // string value starting with "+" for current year + value
3873
- minDate: null, // The earliest selectable date, or null for no limit
3874
- maxDate: null, // The latest selectable date, or null for no limit
3875
- duration: "fast", // Duration of display/closure
3876
- beforeShowDay: null, // Function that takes a date and returns an array with
3877
- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
3878
- // [2] = cell title (optional), e.g. $.datepicker.noWeekends
3879
- beforeShow: null, // Function that takes an input field and
3880
- // returns a set of custom settings for the date picker
3881
- onSelect: null, // Define a callback function when a date is selected
3882
- onChangeMonthYear: null, // Define a callback function when the month or year is changed
3883
- onClose: null, // Define a callback function when the datepicker is closed
3884
- numberOfMonths: 1, // Number of months to show at a time
3885
- showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
3886
- stepMonths: 1, // Number of months to step back/forward
3887
- stepBigMonths: 12, // Number of months to step back/forward for the big links
3888
- altField: "", // Selector for an alternate field to store selected dates into
3889
- altFormat: "", // The date format to use for the alternate field
3890
- constrainInput: true, // The input is constrained by the current date format
3891
- showButtonPanel: false, // True to show button panel, false to not show it
3892
- autoSize: false, // True to size the input for the date format, false to leave as is
3893
- disabled: false // The initial disabled state
3894
- };
3895
- $.extend(this._defaults, this.regional[""]);
3896
- this.regional.en = $.extend( true, {}, this.regional[ "" ]);
3897
- this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
3898
- this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
3899
- }
3900
-
3901
- $.extend(Datepicker.prototype, {
3902
- /* Class name added to elements to indicate already configured with a date picker. */
3903
- markerClassName: "hasDatepicker",
3904
-
3905
- //Keep track of the maximum number of rows displayed (see #7043)
3906
- maxRows: 4,
3907
-
3908
- // TODO rename to "widget" when switching to widget factory
3909
- _widgetDatepicker: function() {
3910
- return this.dpDiv;
3911
- },
3912
-
3913
- /* Override the default settings for all instances of the date picker.
3914
- * @param settings object - the new settings to use as defaults (anonymous object)
3915
- * @return the manager object
3916
- */
3917
- setDefaults: function(settings) {
3918
- datepicker_extendRemove(this._defaults, settings || {});
3919
- return this;
3920
- },
3921
-
3922
- /* Attach the date picker to a jQuery selection.
3923
- * @param target element - the target input field or division or span
3924
- * @param settings object - the new settings to use for this date picker instance (anonymous)
3925
- */
3926
- _attachDatepicker: function(target, settings) {
3927
- var nodeName, inline, inst;
3928
- nodeName = target.nodeName.toLowerCase();
3929
- inline = (nodeName === "div" || nodeName === "span");
3930
- if (!target.id) {
3931
- this.uuid += 1;
3932
- target.id = "dp" + this.uuid;
3933
- }
3934
- inst = this._newInst($(target), inline);
3935
- inst.settings = $.extend({}, settings || {});
3936
- if (nodeName === "input") {
3937
- this._connectDatepicker(target, inst);
3938
- } else if (inline) {
3939
- this._inlineDatepicker(target, inst);
3940
- }
3941
- },
3942
-
3943
- /* Create a new instance object. */
3944
- _newInst: function(target, inline) {
3945
- var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
3946
- return {id: id, input: target, // associated target
3947
- selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
3948
- drawMonth: 0, drawYear: 0, // month being drawn
3949
- inline: inline, // is datepicker inline or not
3950
- dpDiv: (!inline ? this.dpDiv : // presentation div
3951
- datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
3952
- },
3953
-
3954
- /* Attach the date picker to an input field. */
3955
- _connectDatepicker: function(target, inst) {
3956
- var input = $(target);
3957
- inst.append = $([]);
3958
- inst.trigger = $([]);
3959
- if (input.hasClass(this.markerClassName)) {
3960
- return;
3961
- }
3962
- this._attachments(input, inst);
3963
- input.addClass(this.markerClassName).keydown(this._doKeyDown).
3964
- keypress(this._doKeyPress).keyup(this._doKeyUp);
3965
- this._autoSize(inst);
3966
- $.data(target, "datepicker", inst);
3967
- //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
3968
- if( inst.settings.disabled ) {
3969
- this._disableDatepicker( target );
3970
- }
3971
- },
3972
-
3973
- /* Make attachments based on settings. */
3974
- _attachments: function(input, inst) {
3975
- var showOn, buttonText, buttonImage,
3976
- appendText = this._get(inst, "appendText"),
3977
- isRTL = this._get(inst, "isRTL");
3978
-
3979
- if (inst.append) {
3980
- inst.append.remove();
3981
- }
3982
- if (appendText) {
3983
- inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
3984
- input[isRTL ? "before" : "after"](inst.append);
3985
- }
3986
-
3987
- input.unbind("focus", this._showDatepicker);
3988
-
3989
- if (inst.trigger) {
3990
- inst.trigger.remove();
3991
- }
3992
-
3993
- showOn = this._get(inst, "showOn");
3994
- if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
3995
- input.focus(this._showDatepicker);
3996
- }
3997
- if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
3998
- buttonText = this._get(inst, "buttonText");
3999
- buttonImage = this._get(inst, "buttonImage");
4000
- inst.trigger = $(this._get(inst, "buttonImageOnly") ?
4001
- $("<img/>").addClass(this._triggerClass).
4002
- attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
4003
- $("<button type='button'></button>").addClass(this._triggerClass).
4004
- html(!buttonImage ? buttonText : $("<img/>").attr(
4005
- { src:buttonImage, alt:buttonText, title:buttonText })));
4006
- input[isRTL ? "before" : "after"](inst.trigger);
4007
- inst.trigger.click(function() {
4008
- if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
4009
- $.datepicker._hideDatepicker();
4010
- } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
4011
- $.datepicker._hideDatepicker();
4012
- $.datepicker._showDatepicker(input[0]);
4013
- } else {
4014
- $.datepicker._showDatepicker(input[0]);
4015
- }
4016
- return false;
4017
- });
4018
- }
4019
- },
4020
-
4021
- /* Apply the maximum length for the date format. */
4022
- _autoSize: function(inst) {
4023
- if (this._get(inst, "autoSize") && !inst.inline) {
4024
- var findMax, max, maxI, i,
4025
- date = new Date(2009, 12 - 1, 20), // Ensure double digits
4026
- dateFormat = this._get(inst, "dateFormat");
4027
-
4028
- if (dateFormat.match(/[DM]/)) {
4029
- findMax = function(names) {
4030
- max = 0;
4031
- maxI = 0;
4032
- for (i = 0; i < names.length; i++) {
4033
- if (names[i].length > max) {
4034
- max = names[i].length;
4035
- maxI = i;
4036
- }
4037
- }
4038
- return maxI;
4039
- };
4040
- date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
4041
- "monthNames" : "monthNamesShort"))));
4042
- date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
4043
- "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
4044
- }
4045
- inst.input.attr("size", this._formatDate(inst, date).length);
4046
- }
4047
- },
4048
-
4049
- /* Attach an inline date picker to a div. */
4050
- _inlineDatepicker: function(target, inst) {
4051
- var divSpan = $(target);
4052
- if (divSpan.hasClass(this.markerClassName)) {
4053
- return;
4054
- }
4055
- divSpan.addClass(this.markerClassName).append(inst.dpDiv);
4056
- $.data(target, "datepicker", inst);
4057
- this._setDate(inst, this._getDefaultDate(inst), true);
4058
- this._updateDatepicker(inst);
4059
- this._updateAlternate(inst);
4060
- //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
4061
- if( inst.settings.disabled ) {
4062
- this._disableDatepicker( target );
4063
- }
4064
- // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
4065
- // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
4066
- inst.dpDiv.css( "display", "block" );
4067
- },
4068
-
4069
- /* Pop-up the date picker in a "dialog" box.
4070
- * @param input element - ignored
4071
- * @param date string or Date - the initial date to display
4072
- * @param onSelect function - the function to call when a date is selected
4073
- * @param settings object - update the dialog date picker instance's settings (anonymous object)
4074
- * @param pos int[2] - coordinates for the dialog's position within the screen or
4075
- * event - with x/y coordinates or
4076
- * leave empty for default (screen centre)
4077
- * @return the manager object
4078
- */
4079
- _dialogDatepicker: function(input, date, onSelect, settings, pos) {
4080
- var id, browserWidth, browserHeight, scrollX, scrollY,
4081
- inst = this._dialogInst; // internal instance
4082
-
4083
- if (!inst) {
4084
- this.uuid += 1;
4085
- id = "dp" + this.uuid;
4086
- this._dialogInput = $("<input type='text' id='" + id +
4087
- "' style='position: absolute; top: -100px; width: 0px;'/>");
4088
- this._dialogInput.keydown(this._doKeyDown);
4089
- $("body").append(this._dialogInput);
4090
- inst = this._dialogInst = this._newInst(this._dialogInput, false);
4091
- inst.settings = {};
4092
- $.data(this._dialogInput[0], "datepicker", inst);
4093
- }
4094
- datepicker_extendRemove(inst.settings, settings || {});
4095
- date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
4096
- this._dialogInput.val(date);
4097
-
4098
- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
4099
- if (!this._pos) {
4100
- browserWidth = document.documentElement.clientWidth;
4101
- browserHeight = document.documentElement.clientHeight;
4102
- scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
4103
- scrollY = document.documentElement.scrollTop || document.body.scrollTop;
4104
- this._pos = // should use actual width/height below
4105
- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
4106
- }
4107
-
4108
- // move input on screen for focus, but hidden behind dialog
4109
- this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
4110
- inst.settings.onSelect = onSelect;
4111
- this._inDialog = true;
4112
- this.dpDiv.addClass(this._dialogClass);
4113
- this._showDatepicker(this._dialogInput[0]);
4114
- if ($.blockUI) {
4115
- $.blockUI(this.dpDiv);
4116
- }
4117
- $.data(this._dialogInput[0], "datepicker", inst);
4118
- return this;
4119
- },
4120
-
4121
- /* Detach a datepicker from its control.
4122
- * @param target element - the target input field or division or span
4123
- */
4124
- _destroyDatepicker: function(target) {
4125
- var nodeName,
4126
- $target = $(target),
4127
- inst = $.data(target, "datepicker");
4128
-
4129
- if (!$target.hasClass(this.markerClassName)) {
4130
- return;
4131
- }
4132
-
4133
- nodeName = target.nodeName.toLowerCase();
4134
- $.removeData(target, "datepicker");
4135
- if (nodeName === "input") {
4136
- inst.append.remove();
4137
- inst.trigger.remove();
4138
- $target.removeClass(this.markerClassName).
4139
- unbind("focus", this._showDatepicker).
4140
- unbind("keydown", this._doKeyDown).
4141
- unbind("keypress", this._doKeyPress).
4142
- unbind("keyup", this._doKeyUp);
4143
- } else if (nodeName === "div" || nodeName === "span") {
4144
- $target.removeClass(this.markerClassName).empty();
4145
- }
4146
-
4147
- if ( datepicker_instActive === inst ) {
4148
- datepicker_instActive = null;
4149
- }
4150
- },
4151
-
4152
- /* Enable the date picker to a jQuery selection.
4153
- * @param target element - the target input field or division or span
4154
- */
4155
- _enableDatepicker: function(target) {
4156
- var nodeName, inline,
4157
- $target = $(target),
4158
- inst = $.data(target, "datepicker");
4159
-
4160
- if (!$target.hasClass(this.markerClassName)) {
4161
- return;
4162
- }
4163
-
4164
- nodeName = target.nodeName.toLowerCase();
4165
- if (nodeName === "input") {
4166
- target.disabled = false;
4167
- inst.trigger.filter("button").
4168
- each(function() { this.disabled = false; }).end().
4169
- filter("img").css({opacity: "1.0", cursor: ""});
4170
- } else if (nodeName === "div" || nodeName === "span") {
4171
- inline = $target.children("." + this._inlineClass);
4172
- inline.children().removeClass("ui-state-disabled");
4173
- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
4174
- prop("disabled", false);
4175
- }
4176
- this._disabledInputs = $.map(this._disabledInputs,
4177
- function(value) { return (value === target ? null : value); }); // delete entry
4178
- },
4179
-
4180
- /* Disable the date picker to a jQuery selection.
4181
- * @param target element - the target input field or division or span
4182
- */
4183
- _disableDatepicker: function(target) {
4184
- var nodeName, inline,
4185
- $target = $(target),
4186
- inst = $.data(target, "datepicker");
4187
-
4188
- if (!$target.hasClass(this.markerClassName)) {
4189
- return;
4190
- }
4191
-
4192
- nodeName = target.nodeName.toLowerCase();
4193
- if (nodeName === "input") {
4194
- target.disabled = true;
4195
- inst.trigger.filter("button").
4196
- each(function() { this.disabled = true; }).end().
4197
- filter("img").css({opacity: "0.5", cursor: "default"});
4198
- } else if (nodeName === "div" || nodeName === "span") {
4199
- inline = $target.children("." + this._inlineClass);
4200
- inline.children().addClass("ui-state-disabled");
4201
- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
4202
- prop("disabled", true);
4203
- }
4204
- this._disabledInputs = $.map(this._disabledInputs,
4205
- function(value) { return (value === target ? null : value); }); // delete entry
4206
- this._disabledInputs[this._disabledInputs.length] = target;
4207
- },
4208
-
4209
- /* Is the first field in a jQuery collection disabled as a datepicker?
4210
- * @param target element - the target input field or division or span
4211
- * @return boolean - true if disabled, false if enabled
4212
- */
4213
- _isDisabledDatepicker: function(target) {
4214
- if (!target) {
4215
- return false;
4216
- }
4217
- for (var i = 0; i < this._disabledInputs.length; i++) {
4218
- if (this._disabledInputs[i] === target) {
4219
- return true;
4220
- }
4221
- }
4222
- return false;
4223
- },
4224
-
4225
- /* Retrieve the instance data for the target control.
4226
- * @param target element - the target input field or division or span
4227
- * @return object - the associated instance data
4228
- * @throws error if a jQuery problem getting data
4229
- */
4230
- _getInst: function(target) {
4231
- try {
4232
- return $.data(target, "datepicker");
4233
- }
4234
- catch (err) {
4235
- throw "Missing instance data for this datepicker";
4236
- }
4237
- },
4238
-
4239
- /* Update or retrieve the settings for a date picker attached to an input field or division.
4240
- * @param target element - the target input field or division or span
4241
- * @param name object - the new settings to update or
4242
- * string - the name of the setting to change or retrieve,
4243
- * when retrieving also "all" for all instance settings or
4244
- * "defaults" for all global defaults
4245
- * @param value any - the new value for the setting
4246
- * (omit if above is an object or to retrieve a value)
4247
- */
4248
- _optionDatepicker: function(target, name, value) {
4249
- var settings, date, minDate, maxDate,
4250
- inst = this._getInst(target);
4251
-
4252
- if (arguments.length === 2 && typeof name === "string") {
4253
- return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
4254
- (inst ? (name === "all" ? $.extend({}, inst.settings) :
4255
- this._get(inst, name)) : null));
4256
- }
4257
-
4258
- settings = name || {};
4259
- if (typeof name === "string") {
4260
- settings = {};
4261
- settings[name] = value;
4262
- }
4263
-
4264
- if (inst) {
4265
- if (this._curInst === inst) {
4266
- this._hideDatepicker();
4267
- }
4268
-
4269
- date = this._getDateDatepicker(target, true);
4270
- minDate = this._getMinMaxDate(inst, "min");
4271
- maxDate = this._getMinMaxDate(inst, "max");
4272
- datepicker_extendRemove(inst.settings, settings);
4273
- // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
4274
- if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
4275
- inst.settings.minDate = this._formatDate(inst, minDate);
4276
- }
4277
- if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
4278
- inst.settings.maxDate = this._formatDate(inst, maxDate);
4279
- }
4280
- if ( "disabled" in settings ) {
4281
- if ( settings.disabled ) {
4282
- this._disableDatepicker(target);
4283
- } else {
4284
- this._enableDatepicker(target);
4285
- }
4286
- }
4287
- this._attachments($(target), inst);
4288
- this._autoSize(inst);
4289
- this._setDate(inst, date);
4290
- this._updateAlternate(inst);
4291
- this._updateDatepicker(inst);
4292
- }
4293
- },
4294
-
4295
- // change method deprecated
4296
- _changeDatepicker: function(target, name, value) {
4297
- this._optionDatepicker(target, name, value);
4298
- },
4299
-
4300
- /* Redraw the date picker attached to an input field or division.
4301
- * @param target element - the target input field or division or span
4302
- */
4303
- _refreshDatepicker: function(target) {
4304
- var inst = this._getInst(target);
4305
- if (inst) {
4306
- this._updateDatepicker(inst);
4307
- }
4308
- },
4309
-
4310
- /* Set the dates for a jQuery selection.
4311
- * @param target element - the target input field or division or span
4312
- * @param date Date - the new date
4313
- */
4314
- _setDateDatepicker: function(target, date) {
4315
- var inst = this._getInst(target);
4316
- if (inst) {
4317
- this._setDate(inst, date);
4318
- this._updateDatepicker(inst);
4319
- this._updateAlternate(inst);
4320
- }
4321
- },
4322
-
4323
- /* Get the date(s) for the first entry in a jQuery selection.
4324
- * @param target element - the target input field or division or span
4325
- * @param noDefault boolean - true if no default date is to be used
4326
- * @return Date - the current date
4327
- */
4328
- _getDateDatepicker: function(target, noDefault) {
4329
- var inst = this._getInst(target);
4330
- if (inst && !inst.inline) {
4331
- this._setDateFromField(inst, noDefault);
4332
- }
4333
- return (inst ? this._getDate(inst) : null);
4334
- },
4335
-
4336
- /* Handle keystrokes. */
4337
- _doKeyDown: function(event) {
4338
- var onSelect, dateStr, sel,
4339
- inst = $.datepicker._getInst(event.target),
4340
- handled = true,
4341
- isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
4342
-
4343
- inst._keyEvent = true;
4344
- if ($.datepicker._datepickerShowing) {
4345
- switch (event.keyCode) {
4346
- case 9: $.datepicker._hideDatepicker();
4347
- handled = false;
4348
- break; // hide on tab out
4349
- case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
4350
- $.datepicker._currentClass + ")", inst.dpDiv);
4351
- if (sel[0]) {
4352
- $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
4353
- }
4354
-
4355
- onSelect = $.datepicker._get(inst, "onSelect");
4356
- if (onSelect) {
4357
- dateStr = $.datepicker._formatDate(inst);
4358
-
4359
- // trigger custom callback
4360
- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
4361
- } else {
4362
- $.datepicker._hideDatepicker();
4363
- }
4364
-
4365
- return false; // don't submit the form
4366
- case 27: $.datepicker._hideDatepicker();
4367
- break; // hide on escape
4368
- case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4369
- -$.datepicker._get(inst, "stepBigMonths") :
4370
- -$.datepicker._get(inst, "stepMonths")), "M");
4371
- break; // previous month/year on page up/+ ctrl
4372
- case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4373
- +$.datepicker._get(inst, "stepBigMonths") :
4374
- +$.datepicker._get(inst, "stepMonths")), "M");
4375
- break; // next month/year on page down/+ ctrl
4376
- case 35: if (event.ctrlKey || event.metaKey) {
4377
- $.datepicker._clearDate(event.target);
4378
- }
4379
- handled = event.ctrlKey || event.metaKey;
4380
- break; // clear on ctrl or command +end
4381
- case 36: if (event.ctrlKey || event.metaKey) {
4382
- $.datepicker._gotoToday(event.target);
4383
- }
4384
- handled = event.ctrlKey || event.metaKey;
4385
- break; // current on ctrl or command +home
4386
- case 37: if (event.ctrlKey || event.metaKey) {
4387
- $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
4388
- }
4389
- handled = event.ctrlKey || event.metaKey;
4390
- // -1 day on ctrl or command +left
4391
- if (event.originalEvent.altKey) {
4392
- $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4393
- -$.datepicker._get(inst, "stepBigMonths") :
4394
- -$.datepicker._get(inst, "stepMonths")), "M");
4395
- }
4396
- // next month/year on alt +left on Mac
4397
- break;
4398
- case 38: if (event.ctrlKey || event.metaKey) {
4399
- $.datepicker._adjustDate(event.target, -7, "D");
4400
- }
4401
- handled = event.ctrlKey || event.metaKey;
4402
- break; // -1 week on ctrl or command +up
4403
- case 39: if (event.ctrlKey || event.metaKey) {
4404
- $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
4405
- }
4406
- handled = event.ctrlKey || event.metaKey;
4407
- // +1 day on ctrl or command +right
4408
- if (event.originalEvent.altKey) {
4409
- $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4410
- +$.datepicker._get(inst, "stepBigMonths") :
4411
- +$.datepicker._get(inst, "stepMonths")), "M");
4412
- }
4413
- // next month/year on alt +right
4414
- break;
4415
- case 40: if (event.ctrlKey || event.metaKey) {
4416
- $.datepicker._adjustDate(event.target, +7, "D");
4417
- }
4418
- handled = event.ctrlKey || event.metaKey;
4419
- break; // +1 week on ctrl or command +down
4420
- default: handled = false;
4421
- }
4422
- } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
4423
- $.datepicker._showDatepicker(this);
4424
- } else {
4425
- handled = false;
4426
- }
4427
-
4428
- if (handled) {
4429
- event.preventDefault();
4430
- event.stopPropagation();
4431
- }
4432
- },
4433
-
4434
- /* Filter entered characters - based on date format. */
4435
- _doKeyPress: function(event) {
4436
- var chars, chr,
4437
- inst = $.datepicker._getInst(event.target);
4438
-
4439
- if ($.datepicker._get(inst, "constrainInput")) {
4440
- chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
4441
- chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
4442
- return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
4443
- }
4444
- },
4445
-
4446
- /* Synchronise manual entry and field/alternate field. */
4447
- _doKeyUp: function(event) {
4448
- var date,
4449
- inst = $.datepicker._getInst(event.target);
4450
-
4451
- if (inst.input.val() !== inst.lastVal) {
4452
- try {
4453
- date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
4454
- (inst.input ? inst.input.val() : null),
4455
- $.datepicker._getFormatConfig(inst));
4456
-
4457
- if (date) { // only if valid
4458
- $.datepicker._setDateFromField(inst);
4459
- $.datepicker._updateAlternate(inst);
4460
- $.datepicker._updateDatepicker(inst);
4461
- }
4462
- }
4463
- catch (err) {
4464
- }
4465
- }
4466
- return true;
4467
- },
4468
-
4469
- /* Pop-up the date picker for a given input field.
4470
- * If false returned from beforeShow event handler do not show.
4471
- * @param input element - the input field attached to the date picker or
4472
- * event - if triggered by focus
4473
- */
4474
- _showDatepicker: function(input) {
4475
- input = input.target || input;
4476
- if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
4477
- input = $("input", input.parentNode)[0];
4478
- }
4479
-
4480
- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
4481
- return;
4482
- }
4483
-
4484
- var inst, beforeShow, beforeShowSettings, isFixed,
4485
- offset, showAnim, duration;
4486
-
4487
- inst = $.datepicker._getInst(input);
4488
- if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
4489
- $.datepicker._curInst.dpDiv.stop(true, true);
4490
- if ( inst && $.datepicker._datepickerShowing ) {
4491
- $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
4492
- }
4493
- }
4494
-
4495
- beforeShow = $.datepicker._get(inst, "beforeShow");
4496
- beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
4497
- if(beforeShowSettings === false){
4498
- return;
4499
- }
4500
- datepicker_extendRemove(inst.settings, beforeShowSettings);
4501
-
4502
- inst.lastVal = null;
4503
- $.datepicker._lastInput = input;
4504
- $.datepicker._setDateFromField(inst);
4505
-
4506
- if ($.datepicker._inDialog) { // hide cursor
4507
- input.value = "";
4508
- }
4509
- if (!$.datepicker._pos) { // position below input
4510
- $.datepicker._pos = $.datepicker._findPos(input);
4511
- $.datepicker._pos[1] += input.offsetHeight; // add the height
4512
- }
4513
-
4514
- isFixed = false;
4515
- $(input).parents().each(function() {
4516
- isFixed |= $(this).css("position") === "fixed";
4517
- return !isFixed;
4518
- });
4519
-
4520
- offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
4521
- $.datepicker._pos = null;
4522
- //to avoid flashes on Firefox
4523
- inst.dpDiv.empty();
4524
- // determine sizing offscreen
4525
- inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
4526
- $.datepicker._updateDatepicker(inst);
4527
- // fix width for dynamic number of date pickers
4528
- // and adjust position before showing
4529
- offset = $.datepicker._checkOffset(inst, offset, isFixed);
4530
- inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
4531
- "static" : (isFixed ? "fixed" : "absolute")), display: "none",
4532
- left: offset.left + "px", top: offset.top + "px"});
4533
-
4534
- if (!inst.inline) {
4535
- showAnim = $.datepicker._get(inst, "showAnim");
4536
- duration = $.datepicker._get(inst, "duration");
4537
- inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
4538
- $.datepicker._datepickerShowing = true;
4539
-
4540
- if ( $.effects && $.effects.effect[ showAnim ] ) {
4541
- inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
4542
- } else {
4543
- inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
4544
- }
4545
-
4546
- if ( $.datepicker._shouldFocusInput( inst ) ) {
4547
- inst.input.focus();
4548
- }
4549
-
4550
- $.datepicker._curInst = inst;
4551
- }
4552
- },
4553
-
4554
- /* Generate the date picker content. */
4555
- _updateDatepicker: function(inst) {
4556
- this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
4557
- datepicker_instActive = inst; // for delegate hover events
4558
- inst.dpDiv.empty().append(this._generateHTML(inst));
4559
- this._attachHandlers(inst);
4560
-
4561
- var origyearshtml,
4562
- numMonths = this._getNumberOfMonths(inst),
4563
- cols = numMonths[1],
4564
- width = 17,
4565
- activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
4566
-
4567
- if ( activeCell.length > 0 ) {
4568
- datepicker_handleMouseover.apply( activeCell.get( 0 ) );
4569
- }
4570
-
4571
- inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
4572
- if (cols > 1) {
4573
- inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
4574
- }
4575
- inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
4576
- "Class"]("ui-datepicker-multi");
4577
- inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
4578
- "Class"]("ui-datepicker-rtl");
4579
-
4580
- if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
4581
- inst.input.focus();
4582
- }
4583
-
4584
- // deffered render of the years select (to avoid flashes on Firefox)
4585
- if( inst.yearshtml ){
4586
- origyearshtml = inst.yearshtml;
4587
- setTimeout(function(){
4588
- //assure that inst.yearshtml didn't change.
4589
- if( origyearshtml === inst.yearshtml && inst.yearshtml ){
4590
- inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
4591
- }
4592
- origyearshtml = inst.yearshtml = null;
4593
- }, 0);
4594
- }
4595
- },
4596
-
4597
- // #6694 - don't focus the input if it's already focused
4598
- // this breaks the change event in IE
4599
- // Support: IE and jQuery <1.9
4600
- _shouldFocusInput: function( inst ) {
4601
- return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
4602
- },
4603
-
4604
- /* Check positioning to remain on screen. */
4605
- _checkOffset: function(inst, offset, isFixed) {
4606
- var dpWidth = inst.dpDiv.outerWidth(),
4607
- dpHeight = inst.dpDiv.outerHeight(),
4608
- inputWidth = inst.input ? inst.input.outerWidth() : 0,
4609
- inputHeight = inst.input ? inst.input.outerHeight() : 0,
4610
- viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
4611
- viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
4612
-
4613
- offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
4614
- offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
4615
- offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
4616
-
4617
- // now check if datepicker is showing outside window viewport - move to a better place if so.
4618
- offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
4619
- Math.abs(offset.left + dpWidth - viewWidth) : 0);
4620
- offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
4621
- Math.abs(dpHeight + inputHeight) : 0);
4622
-
4623
- return offset;
4624
- },
4625
-
4626
- /* Find an object's position on the screen. */
4627
- _findPos: function(obj) {
4628
- var position,
4629
- inst = this._getInst(obj),
4630
- isRTL = this._get(inst, "isRTL");
4631
-
4632
- while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
4633
- obj = obj[isRTL ? "previousSibling" : "nextSibling"];
4634
- }
4635
-
4636
- position = $(obj).offset();
4637
- return [position.left, position.top];
4638
- },
4639
-
4640
- /* Hide the date picker from view.
4641
- * @param input element - the input field attached to the date picker
4642
- */
4643
- _hideDatepicker: function(input) {
4644
- var showAnim, duration, postProcess, onClose,
4645
- inst = this._curInst;
4646
-
4647
- if (!inst || (input && inst !== $.data(input, "datepicker"))) {
4648
- return;
4649
- }
4650
-
4651
- if (this._datepickerShowing) {
4652
- showAnim = this._get(inst, "showAnim");
4653
- duration = this._get(inst, "duration");
4654
- postProcess = function() {
4655
- $.datepicker._tidyDialog(inst);
4656
- };
4657
-
4658
- // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
4659
- if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
4660
- inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
4661
- } else {
4662
- inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
4663
- (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
4664
- }
4665
-
4666
- if (!showAnim) {
4667
- postProcess();
4668
- }
4669
- this._datepickerShowing = false;
4670
-
4671
- onClose = this._get(inst, "onClose");
4672
- if (onClose) {
4673
- onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
4674
- }
4675
-
4676
- this._lastInput = null;
4677
- if (this._inDialog) {
4678
- this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
4679
- if ($.blockUI) {
4680
- $.unblockUI();
4681
- $("body").append(this.dpDiv);
4682
- }
4683
- }
4684
- this._inDialog = false;
4685
- }
4686
- },
4687
-
4688
- /* Tidy up after a dialog display. */
4689
- _tidyDialog: function(inst) {
4690
- inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
4691
- },
4692
-
4693
- /* Close date picker if clicked elsewhere. */
4694
- _checkExternalClick: function(event) {
4695
- if (!$.datepicker._curInst) {
4696
- return;
4697
- }
4698
-
4699
- var $target = $(event.target),
4700
- inst = $.datepicker._getInst($target[0]);
4701
-
4702
- if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
4703
- $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
4704
- !$target.hasClass($.datepicker.markerClassName) &&
4705
- !$target.closest("." + $.datepicker._triggerClass).length &&
4706
- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
4707
- ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
4708
- $.datepicker._hideDatepicker();
4709
- }
4710
- },
4711
-
4712
- /* Adjust one of the date sub-fields. */
4713
- _adjustDate: function(id, offset, period) {
4714
- var target = $(id),
4715
- inst = this._getInst(target[0]);
4716
-
4717
- if (this._isDisabledDatepicker(target[0])) {
4718
- return;
4719
- }
4720
- this._adjustInstDate(inst, offset +
4721
- (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
4722
- period);
4723
- this._updateDatepicker(inst);
4724
- },
4725
-
4726
- /* Action for current link. */
4727
- _gotoToday: function(id) {
4728
- var date,
4729
- target = $(id),
4730
- inst = this._getInst(target[0]);
4731
-
4732
- if (this._get(inst, "gotoCurrent") && inst.currentDay) {
4733
- inst.selectedDay = inst.currentDay;
4734
- inst.drawMonth = inst.selectedMonth = inst.currentMonth;
4735
- inst.drawYear = inst.selectedYear = inst.currentYear;
4736
- } else {
4737
- date = new Date();
4738
- inst.selectedDay = date.getDate();
4739
- inst.drawMonth = inst.selectedMonth = date.getMonth();
4740
- inst.drawYear = inst.selectedYear = date.getFullYear();
4741
- }
4742
- this._notifyChange(inst);
4743
- this._adjustDate(target);
4744
- },
4745
-
4746
- /* Action for selecting a new month/year. */
4747
- _selectMonthYear: function(id, select, period) {
4748
- var target = $(id),
4749
- inst = this._getInst(target[0]);
4750
-
4751
- inst["selected" + (period === "M" ? "Month" : "Year")] =
4752
- inst["draw" + (period === "M" ? "Month" : "Year")] =
4753
- parseInt(select.options[select.selectedIndex].value,10);
4754
-
4755
- this._notifyChange(inst);
4756
- this._adjustDate(target);
4757
- },
4758
-
4759
- /* Action for selecting a day. */
4760
- _selectDay: function(id, month, year, td) {
4761
- var inst,
4762
- target = $(id);
4763
-
4764
- if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
4765
- return;
4766
- }
4767
-
4768
- inst = this._getInst(target[0]);
4769
- inst.selectedDay = inst.currentDay = $("a", td).html();
4770
- inst.selectedMonth = inst.currentMonth = month;
4771
- inst.selectedYear = inst.currentYear = year;
4772
- this._selectDate(id, this._formatDate(inst,
4773
- inst.currentDay, inst.currentMonth, inst.currentYear));
4774
- },
4775
-
4776
- /* Erase the input field and hide the date picker. */
4777
- _clearDate: function(id) {
4778
- var target = $(id);
4779
- this._selectDate(target, "");
4780
- },
4781
-
4782
- /* Update the input field with the selected date. */
4783
- _selectDate: function(id, dateStr) {
4784
- var onSelect,
4785
- target = $(id),
4786
- inst = this._getInst(target[0]);
4787
-
4788
- dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
4789
- if (inst.input) {
4790
- inst.input.val(dateStr);
4791
- }
4792
- this._updateAlternate(inst);
4793
-
4794
- onSelect = this._get(inst, "onSelect");
4795
- if (onSelect) {
4796
- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
4797
- } else if (inst.input) {
4798
- inst.input.trigger("change"); // fire the change event
4799
- }
4800
-
4801
- if (inst.inline){
4802
- this._updateDatepicker(inst);
4803
- } else {
4804
- this._hideDatepicker();
4805
- this._lastInput = inst.input[0];
4806
- if (typeof(inst.input[0]) !== "object") {
4807
- inst.input.focus(); // restore focus
4808
- }
4809
- this._lastInput = null;
4810
- }
4811
- },
4812
-
4813
- /* Update any alternate field to synchronise with the main field. */
4814
- _updateAlternate: function(inst) {
4815
- var altFormat, date, dateStr,
4816
- altField = this._get(inst, "altField");
4817
-
4818
- if (altField) { // update alternate field too
4819
- altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
4820
- date = this._getDate(inst);
4821
- dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
4822
- $(altField).each(function() { $(this).val(dateStr); });
4823
- }
4824
- },
4825
-
4826
- /* Set as beforeShowDay function to prevent selection of weekends.
4827
- * @param date Date - the date to customise
4828
- * @return [boolean, string] - is this date selectable?, what is its CSS class?
4829
- */
4830
- noWeekends: function(date) {
4831
- var day = date.getDay();
4832
- return [(day > 0 && day < 6), ""];
4833
- },
4834
-
4835
- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
4836
- * @param date Date - the date to get the week for
4837
- * @return number - the number of the week within the year that contains this date
4838
- */
4839
- iso8601Week: function(date) {
4840
- var time,
4841
- checkDate = new Date(date.getTime());
4842
-
4843
- // Find Thursday of this week starting on Monday
4844
- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
4845
-
4846
- time = checkDate.getTime();
4847
- checkDate.setMonth(0); // Compare with Jan 1
4848
- checkDate.setDate(1);
4849
- return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
4850
- },
4851
-
4852
- /* Parse a string value into a date object.
4853
- * See formatDate below for the possible formats.
4854
- *
4855
- * @param format string - the expected format of the date
4856
- * @param value string - the date in the above format
4857
- * @param settings Object - attributes include:
4858
- * shortYearCutoff number - the cutoff year for determining the century (optional)
4859
- * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
4860
- * dayNames string[7] - names of the days from Sunday (optional)
4861
- * monthNamesShort string[12] - abbreviated names of the months (optional)
4862
- * monthNames string[12] - names of the months (optional)
4863
- * @return Date - the extracted date value or null if value is blank
4864
- */
4865
- parseDate: function (format, value, settings) {
4866
- if (format == null || value == null) {
4867
- throw "Invalid arguments";
4868
- }
4869
-
4870
- value = (typeof value === "object" ? value.toString() : value + "");
4871
- if (value === "") {
4872
- return null;
4873
- }
4874
-
4875
- var iFormat, dim, extra,
4876
- iValue = 0,
4877
- shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
4878
- shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
4879
- new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
4880
- dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
4881
- dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
4882
- monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
4883
- monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
4884
- year = -1,
4885
- month = -1,
4886
- day = -1,
4887
- doy = -1,
4888
- literal = false,
4889
- date,
4890
- // Check whether a format character is doubled
4891
- lookAhead = function(match) {
4892
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
4893
- if (matches) {
4894
- iFormat++;
4895
- }
4896
- return matches;
4897
- },
4898
- // Extract a number from the string value
4899
- getNumber = function(match) {
4900
- var isDoubled = lookAhead(match),
4901
- size = (match === "@" ? 14 : (match === "!" ? 20 :
4902
- (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
4903
- minSize = (match === "y" ? size : 1),
4904
- digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
4905
- num = value.substring(iValue).match(digits);
4906
- if (!num) {
4907
- throw "Missing number at position " + iValue;
4908
- }
4909
- iValue += num[0].length;
4910
- return parseInt(num[0], 10);
4911
- },
4912
- // Extract a name from the string value and convert to an index
4913
- getName = function(match, shortNames, longNames) {
4914
- var index = -1,
4915
- names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
4916
- return [ [k, v] ];
4917
- }).sort(function (a, b) {
4918
- return -(a[1].length - b[1].length);
4919
- });
4920
-
4921
- $.each(names, function (i, pair) {
4922
- var name = pair[1];
4923
- if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
4924
- index = pair[0];
4925
- iValue += name.length;
4926
- return false;
4927
- }
4928
- });
4929
- if (index !== -1) {
4930
- return index + 1;
4931
- } else {
4932
- throw "Unknown name at position " + iValue;
4933
- }
4934
- },
4935
- // Confirm that a literal character matches the string value
4936
- checkLiteral = function() {
4937
- if (value.charAt(iValue) !== format.charAt(iFormat)) {
4938
- throw "Unexpected literal at position " + iValue;
4939
- }
4940
- iValue++;
4941
- };
4942
-
4943
- for (iFormat = 0; iFormat < format.length; iFormat++) {
4944
- if (literal) {
4945
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
4946
- literal = false;
4947
- } else {
4948
- checkLiteral();
4949
- }
4950
- } else {
4951
- switch (format.charAt(iFormat)) {
4952
- case "d":
4953
- day = getNumber("d");
4954
- break;
4955
- case "D":
4956
- getName("D", dayNamesShort, dayNames);
4957
- break;
4958
- case "o":
4959
- doy = getNumber("o");
4960
- break;
4961
- case "m":
4962
- month = getNumber("m");
4963
- break;
4964
- case "M":
4965
- month = getName("M", monthNamesShort, monthNames);
4966
- break;
4967
- case "y":
4968
- year = getNumber("y");
4969
- break;
4970
- case "@":
4971
- date = new Date(getNumber("@"));
4972
- year = date.getFullYear();
4973
- month = date.getMonth() + 1;
4974
- day = date.getDate();
4975
- break;
4976
- case "!":
4977
- date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
4978
- year = date.getFullYear();
4979
- month = date.getMonth() + 1;
4980
- day = date.getDate();
4981
- break;
4982
- case "'":
4983
- if (lookAhead("'")){
4984
- checkLiteral();
4985
- } else {
4986
- literal = true;
4987
- }
4988
- break;
4989
- default:
4990
- checkLiteral();
4991
- }
4992
- }
4993
- }
4994
-
4995
- if (iValue < value.length){
4996
- extra = value.substr(iValue);
4997
- if (!/^\s+/.test(extra)) {
4998
- throw "Extra/unparsed characters found in date: " + extra;
4999
- }
5000
- }
5001
-
5002
- if (year === -1) {
5003
- year = new Date().getFullYear();
5004
- } else if (year < 100) {
5005
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
5006
- (year <= shortYearCutoff ? 0 : -100);
5007
- }
5008
-
5009
- if (doy > -1) {
5010
- month = 1;
5011
- day = doy;
5012
- do {
5013
- dim = this._getDaysInMonth(year, month - 1);
5014
- if (day <= dim) {
5015
- break;
5016
- }
5017
- month++;
5018
- day -= dim;
5019
- } while (true);
5020
- }
5021
-
5022
- date = this._daylightSavingAdjust(new Date(year, month - 1, day));
5023
- if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
5024
- throw "Invalid date"; // E.g. 31/02/00
5025
- }
5026
- return date;
5027
- },
5028
-
5029
- /* Standard date formats. */
5030
- ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
5031
- COOKIE: "D, dd M yy",
5032
- ISO_8601: "yy-mm-dd",
5033
- RFC_822: "D, d M y",
5034
- RFC_850: "DD, dd-M-y",
5035
- RFC_1036: "D, d M y",
5036
- RFC_1123: "D, d M yy",
5037
- RFC_2822: "D, d M yy",
5038
- RSS: "D, d M y", // RFC 822
5039
- TICKS: "!",
5040
- TIMESTAMP: "@",
5041
- W3C: "yy-mm-dd", // ISO 8601
5042
-
5043
- _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
5044
- Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
5045
-
5046
- /* Format a date object into a string value.
5047
- * The format can be combinations of the following:
5048
- * d - day of month (no leading zero)
5049
- * dd - day of month (two digit)
5050
- * o - day of year (no leading zeros)
5051
- * oo - day of year (three digit)
5052
- * D - day name short
5053
- * DD - day name long
5054
- * m - month of year (no leading zero)
5055
- * mm - month of year (two digit)
5056
- * M - month name short
5057
- * MM - month name long
5058
- * y - year (two digit)
5059
- * yy - year (four digit)
5060
- * @ - Unix timestamp (ms since 01/01/1970)
5061
- * ! - Windows ticks (100ns since 01/01/0001)
5062
- * "..." - literal text
5063
- * '' - single quote
5064
- *
5065
- * @param format string - the desired format of the date
5066
- * @param date Date - the date value to format
5067
- * @param settings Object - attributes include:
5068
- * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
5069
- * dayNames string[7] - names of the days from Sunday (optional)
5070
- * monthNamesShort string[12] - abbreviated names of the months (optional)
5071
- * monthNames string[12] - names of the months (optional)
5072
- * @return string - the date in the above format
5073
- */
5074
- formatDate: function (format, date, settings) {
5075
- if (!date) {
5076
- return "";
5077
- }
5078
-
5079
- var iFormat,
5080
- dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
5081
- dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
5082
- monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
5083
- monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
5084
- // Check whether a format character is doubled
5085
- lookAhead = function(match) {
5086
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
5087
- if (matches) {
5088
- iFormat++;
5089
- }
5090
- return matches;
5091
- },
5092
- // Format a number, with leading zero if necessary
5093
- formatNumber = function(match, value, len) {
5094
- var num = "" + value;
5095
- if (lookAhead(match)) {
5096
- while (num.length < len) {
5097
- num = "0" + num;
5098
- }
5099
- }
5100
- return num;
5101
- },
5102
- // Format a name, short or long as requested
5103
- formatName = function(match, value, shortNames, longNames) {
5104
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
5105
- },
5106
- output = "",
5107
- literal = false;
5108
-
5109
- if (date) {
5110
- for (iFormat = 0; iFormat < format.length; iFormat++) {
5111
- if (literal) {
5112
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
5113
- literal = false;
5114
- } else {
5115
- output += format.charAt(iFormat);
5116
- }
5117
- } else {
5118
- switch (format.charAt(iFormat)) {
5119
- case "d":
5120
- output += formatNumber("d", date.getDate(), 2);
5121
- break;
5122
- case "D":
5123
- output += formatName("D", date.getDay(), dayNamesShort, dayNames);
5124
- break;
5125
- case "o":
5126
- output += formatNumber("o",
5127
- Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
5128
- break;
5129
- case "m":
5130
- output += formatNumber("m", date.getMonth() + 1, 2);
5131
- break;
5132
- case "M":
5133
- output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
5134
- break;
5135
- case "y":
5136
- output += (lookAhead("y") ? date.getFullYear() :
5137
- (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
5138
- break;
5139
- case "@":
5140
- output += date.getTime();
5141
- break;
5142
- case "!":
5143
- output += date.getTime() * 10000 + this._ticksTo1970;
5144
- break;
5145
- case "'":
5146
- if (lookAhead("'")) {
5147
- output += "'";
5148
- } else {
5149
- literal = true;
5150
- }
5151
- break;
5152
- default:
5153
- output += format.charAt(iFormat);
5154
- }
5155
- }
5156
- }
5157
- }
5158
- return output;
5159
- },
5160
-
5161
- /* Extract all possible characters from the date format. */
5162
- _possibleChars: function (format) {
5163
- var iFormat,
5164
- chars = "",
5165
- literal = false,
5166
- // Check whether a format character is doubled
5167
- lookAhead = function(match) {
5168
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
5169
- if (matches) {
5170
- iFormat++;
5171
- }
5172
- return matches;
5173
- };
5174
-
5175
- for (iFormat = 0; iFormat < format.length; iFormat++) {
5176
- if (literal) {
5177
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
5178
- literal = false;
5179
- } else {
5180
- chars += format.charAt(iFormat);
5181
- }
5182
- } else {
5183
- switch (format.charAt(iFormat)) {
5184
- case "d": case "m": case "y": case "@":
5185
- chars += "0123456789";
5186
- break;
5187
- case "D": case "M":
5188
- return null; // Accept anything
5189
- case "'":
5190
- if (lookAhead("'")) {
5191
- chars += "'";
5192
- } else {
5193
- literal = true;
5194
- }
5195
- break;
5196
- default:
5197
- chars += format.charAt(iFormat);
5198
- }
5199
- }
5200
- }
5201
- return chars;
5202
- },
5203
-
5204
- /* Get a setting value, defaulting if necessary. */
5205
- _get: function(inst, name) {
5206
- return inst.settings[name] !== undefined ?
5207
- inst.settings[name] : this._defaults[name];
5208
- },
5209
-
5210
- /* Parse existing date and initialise date picker. */
5211
- _setDateFromField: function(inst, noDefault) {
5212
- if (inst.input.val() === inst.lastVal) {
5213
- return;
5214
- }
5215
-
5216
- var dateFormat = this._get(inst, "dateFormat"),
5217
- dates = inst.lastVal = inst.input ? inst.input.val() : null,
5218
- defaultDate = this._getDefaultDate(inst),
5219
- date = defaultDate,
5220
- settings = this._getFormatConfig(inst);
5221
-
5222
- try {
5223
- date = this.parseDate(dateFormat, dates, settings) || defaultDate;
5224
- } catch (event) {
5225
- dates = (noDefault ? "" : dates);
5226
- }
5227
- inst.selectedDay = date.getDate();
5228
- inst.drawMonth = inst.selectedMonth = date.getMonth();
5229
- inst.drawYear = inst.selectedYear = date.getFullYear();
5230
- inst.currentDay = (dates ? date.getDate() : 0);
5231
- inst.currentMonth = (dates ? date.getMonth() : 0);
5232
- inst.currentYear = (dates ? date.getFullYear() : 0);
5233
- this._adjustInstDate(inst);
5234
- },
5235
-
5236
- /* Retrieve the default date shown on opening. */
5237
- _getDefaultDate: function(inst) {
5238
- return this._restrictMinMax(inst,
5239
- this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
5240
- },
5241
-
5242
- /* A date may be specified as an exact value or a relative one. */
5243
- _determineDate: function(inst, date, defaultDate) {
5244
- var offsetNumeric = function(offset) {
5245
- var date = new Date();
5246
- date.setDate(date.getDate() + offset);
5247
- return date;
5248
- },
5249
- offsetString = function(offset) {
5250
- try {
5251
- return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
5252
- offset, $.datepicker._getFormatConfig(inst));
5253
- }
5254
- catch (e) {
5255
- // Ignore
5256
- }
5257
-
5258
- var date = (offset.toLowerCase().match(/^c/) ?
5259
- $.datepicker._getDate(inst) : null) || new Date(),
5260
- year = date.getFullYear(),
5261
- month = date.getMonth(),
5262
- day = date.getDate(),
5263
- pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
5264
- matches = pattern.exec(offset);
5265
-
5266
- while (matches) {
5267
- switch (matches[2] || "d") {
5268
- case "d" : case "D" :
5269
- day += parseInt(matches[1],10); break;
5270
- case "w" : case "W" :
5271
- day += parseInt(matches[1],10) * 7; break;
5272
- case "m" : case "M" :
5273
- month += parseInt(matches[1],10);
5274
- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
5275
- break;
5276
- case "y": case "Y" :
5277
- year += parseInt(matches[1],10);
5278
- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
5279
- break;
5280
- }
5281
- matches = pattern.exec(offset);
5282
- }
5283
- return new Date(year, month, day);
5284
- },
5285
- newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
5286
- (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
5287
-
5288
- newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
5289
- if (newDate) {
5290
- newDate.setHours(0);
5291
- newDate.setMinutes(0);
5292
- newDate.setSeconds(0);
5293
- newDate.setMilliseconds(0);
5294
- }
5295
- return this._daylightSavingAdjust(newDate);
5296
- },
5297
-
5298
- /* Handle switch to/from daylight saving.
5299
- * Hours may be non-zero on daylight saving cut-over:
5300
- * > 12 when midnight changeover, but then cannot generate
5301
- * midnight datetime, so jump to 1AM, otherwise reset.
5302
- * @param date (Date) the date to check
5303
- * @return (Date) the corrected date
5304
- */
5305
- _daylightSavingAdjust: function(date) {
5306
- if (!date) {
5307
- return null;
5308
- }
5309
- date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
5310
- return date;
5311
- },
5312
-
5313
- /* Set the date(s) directly. */
5314
- _setDate: function(inst, date, noChange) {
5315
- var clear = !date,
5316
- origMonth = inst.selectedMonth,
5317
- origYear = inst.selectedYear,
5318
- newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
5319
-
5320
- inst.selectedDay = inst.currentDay = newDate.getDate();
5321
- inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
5322
- inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
5323
- if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
5324
- this._notifyChange(inst);
5325
- }
5326
- this._adjustInstDate(inst);
5327
- if (inst.input) {
5328
- inst.input.val(clear ? "" : this._formatDate(inst));
5329
- }
5330
- },
5331
-
5332
- /* Retrieve the date(s) directly. */
5333
- _getDate: function(inst) {
5334
- var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
5335
- this._daylightSavingAdjust(new Date(
5336
- inst.currentYear, inst.currentMonth, inst.currentDay)));
5337
- return startDate;
5338
- },
5339
-
5340
- /* Attach the onxxx handlers. These are declared statically so
5341
- * they work with static code transformers like Caja.
5342
- */
5343
- _attachHandlers: function(inst) {
5344
- var stepMonths = this._get(inst, "stepMonths"),
5345
- id = "#" + inst.id.replace( /\\\\/g, "\\" );
5346
- inst.dpDiv.find("[data-handler]").map(function () {
5347
- var handler = {
5348
- prev: function () {
5349
- $.datepicker._adjustDate(id, -stepMonths, "M");
5350
- },
5351
- next: function () {
5352
- $.datepicker._adjustDate(id, +stepMonths, "M");
5353
- },
5354
- hide: function () {
5355
- $.datepicker._hideDatepicker();
5356
- },
5357
- today: function () {
5358
- $.datepicker._gotoToday(id);
5359
- },
5360
- selectDay: function () {
5361
- $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
5362
- return false;
5363
- },
5364
- selectMonth: function () {
5365
- $.datepicker._selectMonthYear(id, this, "M");
5366
- return false;
5367
- },
5368
- selectYear: function () {
5369
- $.datepicker._selectMonthYear(id, this, "Y");
5370
- return false;
5371
- }
5372
- };
5373
- $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
5374
- });
5375
- },
5376
-
5377
- /* Generate the HTML for the current state of the date picker. */
5378
- _generateHTML: function(inst) {
5379
- var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
5380
- controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
5381
- monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
5382
- selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
5383
- cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
5384
- printDate, dRow, tbody, daySettings, otherMonth, unselectable,
5385
- tempDate = new Date(),
5386
- today = this._daylightSavingAdjust(
5387
- new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
5388
- isRTL = this._get(inst, "isRTL"),
5389
- showButtonPanel = this._get(inst, "showButtonPanel"),
5390
- hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
5391
- navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
5392
- numMonths = this._getNumberOfMonths(inst),
5393
- showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
5394
- stepMonths = this._get(inst, "stepMonths"),
5395
- isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
5396
- currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
5397
- new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
5398
- minDate = this._getMinMaxDate(inst, "min"),
5399
- maxDate = this._getMinMaxDate(inst, "max"),
5400
- drawMonth = inst.drawMonth - showCurrentAtPos,
5401
- drawYear = inst.drawYear;
5402
-
5403
- if (drawMonth < 0) {
5404
- drawMonth += 12;
5405
- drawYear--;
5406
- }
5407
- if (maxDate) {
5408
- maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
5409
- maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
5410
- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
5411
- while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
5412
- drawMonth--;
5413
- if (drawMonth < 0) {
5414
- drawMonth = 11;
5415
- drawYear--;
5416
- }
5417
- }
5418
- }
5419
- inst.drawMonth = drawMonth;
5420
- inst.drawYear = drawYear;
5421
-
5422
- prevText = this._get(inst, "prevText");
5423
- prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
5424
- this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
5425
- this._getFormatConfig(inst)));
5426
-
5427
- prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
5428
- "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
5429
- " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
5430
- (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
5431
-
5432
- nextText = this._get(inst, "nextText");
5433
- nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
5434
- this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
5435
- this._getFormatConfig(inst)));
5436
-
5437
- next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
5438
- "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
5439
- " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
5440
- (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
5441
-
5442
- currentText = this._get(inst, "currentText");
5443
- gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
5444
- currentText = (!navigationAsDateFormat ? currentText :
5445
- this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
5446
-
5447
- controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
5448
- this._get(inst, "closeText") + "</button>" : "");
5449
-
5450
- buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
5451
- (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
5452
- ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
5453
-
5454
- firstDay = parseInt(this._get(inst, "firstDay"),10);
5455
- firstDay = (isNaN(firstDay) ? 0 : firstDay);
5456
-
5457
- showWeek = this._get(inst, "showWeek");
5458
- dayNames = this._get(inst, "dayNames");
5459
- dayNamesMin = this._get(inst, "dayNamesMin");
5460
- monthNames = this._get(inst, "monthNames");
5461
- monthNamesShort = this._get(inst, "monthNamesShort");
5462
- beforeShowDay = this._get(inst, "beforeShowDay");
5463
- showOtherMonths = this._get(inst, "showOtherMonths");
5464
- selectOtherMonths = this._get(inst, "selectOtherMonths");
5465
- defaultDate = this._getDefaultDate(inst);
5466
- html = "";
5467
- dow;
5468
- for (row = 0; row < numMonths[0]; row++) {
5469
- group = "";
5470
- this.maxRows = 4;
5471
- for (col = 0; col < numMonths[1]; col++) {
5472
- selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
5473
- cornerClass = " ui-corner-all";
5474
- calender = "";
5475
- if (isMultiMonth) {
5476
- calender += "<div class='ui-datepicker-group";
5477
- if (numMonths[1] > 1) {
5478
- switch (col) {
5479
- case 0: calender += " ui-datepicker-group-first";
5480
- cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
5481
- case numMonths[1]-1: calender += " ui-datepicker-group-last";
5482
- cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
5483
- default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
5484
- }
5485
- }
5486
- calender += "'>";
5487
- }
5488
- calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
5489
- (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
5490
- (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
5491
- this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
5492
- row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
5493
- "</div><table class='ui-datepicker-calendar'><thead>" +
5494
- "<tr>";
5495
- thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
5496
- for (dow = 0; dow < 7; dow++) { // days of the week
5497
- day = (dow + firstDay) % 7;
5498
- thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
5499
- "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
5500
- }
5501
- calender += thead + "</tr></thead><tbody>";
5502
- daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
5503
- if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
5504
- inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
5505
- }
5506
- leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
5507
- curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
5508
- numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
5509
- this.maxRows = numRows;
5510
- printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
5511
- for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
5512
- calender += "<tr>";
5513
- tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
5514
- this._get(inst, "calculateWeek")(printDate) + "</td>");
5515
- for (dow = 0; dow < 7; dow++) { // create date picker days
5516
- daySettings = (beforeShowDay ?
5517
- beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
5518
- otherMonth = (printDate.getMonth() !== drawMonth);
5519
- unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
5520
- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
5521
- tbody += "<td class='" +
5522
- ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
5523
- (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
5524
- ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
5525
- (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
5526
- // or defaultDate is current printedDate and defaultDate is selectedDate
5527
- " " + this._dayOverClass : "") + // highlight selected day
5528
- (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days
5529
- (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
5530
- (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
5531
- (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
5532
- ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
5533
- (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
5534
- (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
5535
- (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
5536
- (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
5537
- (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
5538
- (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
5539
- "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
5540
- printDate.setDate(printDate.getDate() + 1);
5541
- printDate = this._daylightSavingAdjust(printDate);
5542
- }
5543
- calender += tbody + "</tr>";
5544
- }
5545
- drawMonth++;
5546
- if (drawMonth > 11) {
5547
- drawMonth = 0;
5548
- drawYear++;
5549
- }
5550
- calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
5551
- ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
5552
- group += calender;
5553
- }
5554
- html += group;
5555
- }
5556
- html += buttonPanel;
5557
- inst._keyEvent = false;
5558
- return html;
5559
- },
5560
-
5561
- /* Generate the month and year header. */
5562
- _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
5563
- secondary, monthNames, monthNamesShort) {
5564
-
5565
- var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
5566
- changeMonth = this._get(inst, "changeMonth"),
5567
- changeYear = this._get(inst, "changeYear"),
5568
- showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
5569
- html = "<div class='ui-datepicker-title'>",
5570
- monthHtml = "";
5571
-
5572
- // month selection
5573
- if (secondary || !changeMonth) {
5574
- monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
5575
- } else {
5576
- inMinYear = (minDate && minDate.getFullYear() === drawYear);
5577
- inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
5578
- monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
5579
- for ( month = 0; month < 12; month++) {
5580
- if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
5581
- monthHtml += "<option value='" + month + "'" +
5582
- (month === drawMonth ? " selected='selected'" : "") +
5583
- ">" + monthNamesShort[month] + "</option>";
5584
- }
5585
- }
5586
- monthHtml += "</select>";
5587
- }
5588
-
5589
- if (!showMonthAfterYear) {
5590
- html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
5591
- }
5592
-
5593
- // year selection
5594
- if ( !inst.yearshtml ) {
5595
- inst.yearshtml = "";
5596
- if (secondary || !changeYear) {
5597
- html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
5598
- } else {
5599
- // determine range of years to display
5600
- years = this._get(inst, "yearRange").split(":");
5601
- thisYear = new Date().getFullYear();
5602
- determineYear = function(value) {
5603
- var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
5604
- (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
5605
- parseInt(value, 10)));
5606
- return (isNaN(year) ? thisYear : year);
5607
- };
5608
- year = determineYear(years[0]);
5609
- endYear = Math.max(year, determineYear(years[1] || ""));
5610
- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
5611
- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
5612
- inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
5613
- for (; year <= endYear; year++) {
5614
- inst.yearshtml += "<option value='" + year + "'" +
5615
- (year === drawYear ? " selected='selected'" : "") +
5616
- ">" + year + "</option>";
5617
- }
5618
- inst.yearshtml += "</select>";
5619
-
5620
- html += inst.yearshtml;
5621
- inst.yearshtml = null;
5622
- }
5623
- }
5624
-
5625
- html += this._get(inst, "yearSuffix");
5626
- if (showMonthAfterYear) {
5627
- html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
5628
- }
5629
- html += "</div>"; // Close datepicker_header
5630
- return html;
5631
- },
5632
-
5633
- /* Adjust one of the date sub-fields. */
5634
- _adjustInstDate: function(inst, offset, period) {
5635
- var year = inst.drawYear + (period === "Y" ? offset : 0),
5636
- month = inst.drawMonth + (period === "M" ? offset : 0),
5637
- day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
5638
- date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
5639
-
5640
- inst.selectedDay = date.getDate();
5641
- inst.drawMonth = inst.selectedMonth = date.getMonth();
5642
- inst.drawYear = inst.selectedYear = date.getFullYear();
5643
- if (period === "M" || period === "Y") {
5644
- this._notifyChange(inst);
5645
- }
5646
- },
5647
-
5648
- /* Ensure a date is within any min/max bounds. */
5649
- _restrictMinMax: function(inst, date) {
5650
- var minDate = this._getMinMaxDate(inst, "min"),
5651
- maxDate = this._getMinMaxDate(inst, "max"),
5652
- newDate = (minDate && date < minDate ? minDate : date);
5653
- return (maxDate && newDate > maxDate ? maxDate : newDate);
5654
- },
5655
-
5656
- /* Notify change of month/year. */
5657
- _notifyChange: function(inst) {
5658
- var onChange = this._get(inst, "onChangeMonthYear");
5659
- if (onChange) {
5660
- onChange.apply((inst.input ? inst.input[0] : null),
5661
- [inst.selectedYear, inst.selectedMonth + 1, inst]);
5662
- }
5663
- },
5664
-
5665
- /* Determine the number of months to show. */
5666
- _getNumberOfMonths: function(inst) {
5667
- var numMonths = this._get(inst, "numberOfMonths");
5668
- return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
5669
- },
5670
-
5671
- /* Determine the current maximum date - ensure no time components are set. */
5672
- _getMinMaxDate: function(inst, minMax) {
5673
- return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
5674
- },
5675
-
5676
- /* Find the number of days in a given month. */
5677
- _getDaysInMonth: function(year, month) {
5678
- return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
5679
- },
5680
-
5681
- /* Find the day of the week of the first of a month. */
5682
- _getFirstDayOfMonth: function(year, month) {
5683
- return new Date(year, month, 1).getDay();
5684
- },
5685
-
5686
- /* Determines if we should allow a "next/prev" month display change. */
5687
- _canAdjustMonth: function(inst, offset, curYear, curMonth) {
5688
- var numMonths = this._getNumberOfMonths(inst),
5689
- date = this._daylightSavingAdjust(new Date(curYear,
5690
- curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
5691
-
5692
- if (offset < 0) {
5693
- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
5694
- }
5695
- return this._isInRange(inst, date);
5696
- },
5697
-
5698
- /* Is the given date in the accepted range? */
5699
- _isInRange: function(inst, date) {
5700
- var yearSplit, currentYear,
5701
- minDate = this._getMinMaxDate(inst, "min"),
5702
- maxDate = this._getMinMaxDate(inst, "max"),
5703
- minYear = null,
5704
- maxYear = null,
5705
- years = this._get(inst, "yearRange");
5706
- if (years){
5707
- yearSplit = years.split(":");
5708
- currentYear = new Date().getFullYear();
5709
- minYear = parseInt(yearSplit[0], 10);
5710
- maxYear = parseInt(yearSplit[1], 10);
5711
- if ( yearSplit[0].match(/[+\-].*/) ) {
5712
- minYear += currentYear;
5713
- }
5714
- if ( yearSplit[1].match(/[+\-].*/) ) {
5715
- maxYear += currentYear;
5716
- }
5717
- }
5718
-
5719
- return ((!minDate || date.getTime() >= minDate.getTime()) &&
5720
- (!maxDate || date.getTime() <= maxDate.getTime()) &&
5721
- (!minYear || date.getFullYear() >= minYear) &&
5722
- (!maxYear || date.getFullYear() <= maxYear));
5723
- },
5724
-
5725
- /* Provide the configuration settings for formatting/parsing. */
5726
- _getFormatConfig: function(inst) {
5727
- var shortYearCutoff = this._get(inst, "shortYearCutoff");
5728
- shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
5729
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
5730
- return {shortYearCutoff: shortYearCutoff,
5731
- dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
5732
- monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
5733
- },
5734
-
5735
- /* Format the given date for display. */
5736
- _formatDate: function(inst, day, month, year) {
5737
- if (!day) {
5738
- inst.currentDay = inst.selectedDay;
5739
- inst.currentMonth = inst.selectedMonth;
5740
- inst.currentYear = inst.selectedYear;
5741
- }
5742
- var date = (day ? (typeof day === "object" ? day :
5743
- this._daylightSavingAdjust(new Date(year, month, day))) :
5744
- this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
5745
- return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
5746
- }
5747
- });
5748
-
5749
- /*
5750
- * Bind hover events for datepicker elements.
5751
- * Done via delegate so the binding only occurs once in the lifetime of the parent div.
5752
- * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
5753
- */
5754
- function datepicker_bindHover(dpDiv) {
5755
- var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
5756
- return dpDiv.delegate(selector, "mouseout", function() {
5757
- $(this).removeClass("ui-state-hover");
5758
- if (this.className.indexOf("ui-datepicker-prev") !== -1) {
5759
- $(this).removeClass("ui-datepicker-prev-hover");
5760
- }
5761
- if (this.className.indexOf("ui-datepicker-next") !== -1) {
5762
- $(this).removeClass("ui-datepicker-next-hover");
5763
- }
5764
- })
5765
- .delegate( selector, "mouseover", datepicker_handleMouseover );
5766
- }
5767
-
5768
- function datepicker_handleMouseover() {
5769
- if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
5770
- $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
5771
- $(this).addClass("ui-state-hover");
5772
- if (this.className.indexOf("ui-datepicker-prev") !== -1) {
5773
- $(this).addClass("ui-datepicker-prev-hover");
5774
- }
5775
- if (this.className.indexOf("ui-datepicker-next") !== -1) {
5776
- $(this).addClass("ui-datepicker-next-hover");
5777
- }
5778
- }
5779
- }
5780
-
5781
- /* jQuery extend now ignores nulls! */
5782
- function datepicker_extendRemove(target, props) {
5783
- $.extend(target, props);
5784
- for (var name in props) {
5785
- if (props[name] == null) {
5786
- target[name] = props[name];
5787
- }
5788
- }
5789
- return target;
5790
- }
5791
-
5792
- /* Invoke the datepicker functionality.
5793
- @param options string - a command, optionally followed by additional parameters or
5794
- Object - settings for attaching new datepicker functionality
5795
- @return jQuery object */
5796
- $.fn.datepicker = function(options){
5797
-
5798
- /* Verify an empty collection wasn't passed - Fixes #6976 */
5799
- if ( !this.length ) {
5800
- return this;
5801
- }
5802
-
5803
- /* Initialise the date picker. */
5804
- if (!$.datepicker.initialized) {
5805
- $(document).mousedown($.datepicker._checkExternalClick);
5806
- $.datepicker.initialized = true;
5807
- }
5808
-
5809
- /* Append datepicker main container to body if not exist. */
5810
- if ($("#"+$.datepicker._mainDivId).length === 0) {
5811
- $("body").append($.datepicker.dpDiv);
5812
- }
5813
-
5814
- var otherArgs = Array.prototype.slice.call(arguments, 1);
5815
- if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
5816
- return $.datepicker["_" + options + "Datepicker"].
5817
- apply($.datepicker, [this[0]].concat(otherArgs));
5818
- }
5819
- if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
5820
- return $.datepicker["_" + options + "Datepicker"].
5821
- apply($.datepicker, [this[0]].concat(otherArgs));
5822
- }
5823
- return this.each(function() {
5824
- typeof options === "string" ?
5825
- $.datepicker["_" + options + "Datepicker"].
5826
- apply($.datepicker, [this].concat(otherArgs)) :
5827
- $.datepicker._attachDatepicker(this, options);
5828
- });
5829
- };
5830
-
5831
- $.datepicker = new Datepicker(); // singleton instance
5832
- $.datepicker.initialized = false;
5833
- $.datepicker.uuid = new Date().getTime();
5834
- $.datepicker.version = "1.11.4";
5835
-
5836
- var datepicker = $.datepicker;
5837
-
5838
-
5839
- /*!
5840
- * jQuery UI Draggable 1.11.4
5841
- * http://jqueryui.com
5842
- *
5843
- * Copyright jQuery Foundation and other contributors
5844
- * Released under the MIT license.
5845
- * http://jquery.org/license
5846
- *
5847
- * http://api.jqueryui.com/draggable/
5848
- */
5849
-
5850
-
5851
- $.widget("ui.draggable", $.ui.mouse, {
5852
- version: "1.11.4",
5853
- widgetEventPrefix: "drag",
5854
- options: {
5855
- addClasses: true,
5856
- appendTo: "parent",
5857
- axis: false,
5858
- connectToSortable: false,
5859
- containment: false,
5860
- cursor: "auto",
5861
- cursorAt: false,
5862
- grid: false,
5863
- handle: false,
5864
- helper: "original",
5865
- iframeFix: false,
5866
- opacity: false,
5867
- refreshPositions: false,
5868
- revert: false,
5869
- revertDuration: 500,
5870
- scope: "default",
5871
- scroll: true,
5872
- scrollSensitivity: 20,
5873
- scrollSpeed: 20,
5874
- snap: false,
5875
- snapMode: "both",
5876
- snapTolerance: 20,
5877
- stack: false,
5878
- zIndex: false,
5879
-
5880
- // callbacks
5881
- drag: null,
5882
- start: null,
5883
- stop: null
5884
- },
5885
- _create: function() {
5886
-
5887
- if ( this.options.helper === "original" ) {
5888
- this._setPositionRelative();
5889
- }
5890
- if (this.options.addClasses){
5891
- this.element.addClass("ui-draggable");
5892
- }
5893
- if (this.options.disabled){
5894
- this.element.addClass("ui-draggable-disabled");
5895
- }
5896
- this._setHandleClassName();
5897
-
5898
- this._mouseInit();
5899
- },
5900
-
5901
- _setOption: function( key, value ) {
5902
- this._super( key, value );
5903
- if ( key === "handle" ) {
5904
- this._removeHandleClassName();
5905
- this._setHandleClassName();
5906
- }
5907
- },
5908
-
5909
- _destroy: function() {
5910
- if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
5911
- this.destroyOnClear = true;
5912
- return;
5913
- }
5914
- this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
5915
- this._removeHandleClassName();
5916
- this._mouseDestroy();
5917
- },
5918
-
5919
- _mouseCapture: function(event) {
5920
- var o = this.options;
5921
-
5922
- this._blurActiveElement( event );
5923
-
5924
- // among others, prevent a drag on a resizable-handle
5925
- if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
5926
- return false;
5927
- }
5928
-
5929
- //Quit if we're not on a valid handle
5930
- this.handle = this._getHandle(event);
5931
- if (!this.handle) {
5932
- return false;
5933
- }
5934
-
5935
- this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
5936
-
5937
- return true;
5938
-
5939
- },
5940
-
5941
- _blockFrames: function( selector ) {
5942
- this.iframeBlocks = this.document.find( selector ).map(function() {
5943
- var iframe = $( this );
5944
-
5945
- return $( "<div>" )
5946
- .css( "position", "absolute" )
5947
- .appendTo( iframe.parent() )
5948
- .outerWidth( iframe.outerWidth() )
5949
- .outerHeight( iframe.outerHeight() )
5950
- .offset( iframe.offset() )[ 0 ];
5951
- });
5952
- },
5953
-
5954
- _unblockFrames: function() {
5955
- if ( this.iframeBlocks ) {
5956
- this.iframeBlocks.remove();
5957
- delete this.iframeBlocks;
5958
- }
5959
- },
5960
-
5961
- _blurActiveElement: function( event ) {
5962
- var document = this.document[ 0 ];
5963
-
5964
- // Only need to blur if the event occurred on the draggable itself, see #10527
5965
- if ( !this.handleElement.is( event.target ) ) {
5966
- return;
5967
- }
5968
-
5969
- // support: IE9
5970
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
5971
- try {
5972
-
5973
- // Support: IE9, IE10
5974
- // If the <body> is blurred, IE will switch windows, see #9520
5975
- if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
5976
-
5977
- // Blur any element that currently has focus, see #4261
5978
- $( document.activeElement ).blur();
5979
- }
5980
- } catch ( error ) {}
5981
- },
5982
-
5983
- _mouseStart: function(event) {
5984
-
5985
- var o = this.options;
5986
-
5987
- //Create and append the visible helper
5988
- this.helper = this._createHelper(event);
5989
-
5990
- this.helper.addClass("ui-draggable-dragging");
5991
-
5992
- //Cache the helper size
5993
- this._cacheHelperProportions();
5994
-
5995
- //If ddmanager is used for droppables, set the global draggable
5996
- if ($.ui.ddmanager) {
5997
- $.ui.ddmanager.current = this;
5998
- }
5999
-
6000
- /*
6001
- * - Position generation -
6002
- * This block generates everything position related - it's the core of draggables.
6003
- */
6004
-
6005
- //Cache the margins of the original element
6006
- this._cacheMargins();
6007
-
6008
- //Store the helper's css position
6009
- this.cssPosition = this.helper.css( "position" );
6010
- this.scrollParent = this.helper.scrollParent( true );
6011
- this.offsetParent = this.helper.offsetParent();
6012
- this.hasFixedAncestor = this.helper.parents().filter(function() {
6013
- return $( this ).css( "position" ) === "fixed";
6014
- }).length > 0;
6015
-
6016
- //The element's absolute position on the page minus margins
6017
- this.positionAbs = this.element.offset();
6018
- this._refreshOffsets( event );
6019
-
6020
- //Generate the original position
6021
- this.originalPosition = this.position = this._generatePosition( event, false );
6022
- this.originalPageX = event.pageX;
6023
- this.originalPageY = event.pageY;
6024
-
6025
- //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
6026
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
6027
-
6028
- //Set a containment if given in the options
6029
- this._setContainment();
6030
-
6031
- //Trigger event + callbacks
6032
- if (this._trigger("start", event) === false) {
6033
- this._clear();
6034
- return false;
6035
- }
6036
-
6037
- //Recache the helper size
6038
- this._cacheHelperProportions();
6039
-
6040
- //Prepare the droppable offsets
6041
- if ($.ui.ddmanager && !o.dropBehaviour) {
6042
- $.ui.ddmanager.prepareOffsets(this, event);
6043
- }
6044
-
6045
- // Reset helper's right/bottom css if they're set and set explicit width/height instead
6046
- // as this prevents resizing of elements with right/bottom set (see #7772)
6047
- this._normalizeRightBottom();
6048
-
6049
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
6050
-
6051
- //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
6052
- if ( $.ui.ddmanager ) {
6053
- $.ui.ddmanager.dragStart(this, event);
6054
- }
6055
-
6056
- return true;
6057
- },
6058
-
6059
- _refreshOffsets: function( event ) {
6060
- this.offset = {
6061
- top: this.positionAbs.top - this.margins.top,
6062
- left: this.positionAbs.left - this.margins.left,
6063
- scroll: false,
6064
- parent: this._getParentOffset(),
6065
- relative: this._getRelativeOffset()
6066
- };
6067
-
6068
- this.offset.click = {
6069
- left: event.pageX - this.offset.left,
6070
- top: event.pageY - this.offset.top
6071
- };
6072
- },
6073
-
6074
- _mouseDrag: function(event, noPropagation) {
6075
- // reset any necessary cached properties (see #5009)
6076
- if ( this.hasFixedAncestor ) {
6077
- this.offset.parent = this._getParentOffset();
6078
- }
6079
-
6080
- //Compute the helpers position
6081
- this.position = this._generatePosition( event, true );
6082
- this.positionAbs = this._convertPositionTo("absolute");
6083
-
6084
- //Call plugins and callbacks and use the resulting position if something is returned
6085
- if (!noPropagation) {
6086
- var ui = this._uiHash();
6087
- if (this._trigger("drag", event, ui) === false) {
6088
- this._mouseUp({});
6089
- return false;
6090
- }
6091
- this.position = ui.position;
6092
- }
6093
-
6094
- this.helper[ 0 ].style.left = this.position.left + "px";
6095
- this.helper[ 0 ].style.top = this.position.top + "px";
6096
-
6097
- if ($.ui.ddmanager) {
6098
- $.ui.ddmanager.drag(this, event);
6099
- }
6100
-
6101
- return false;
6102
- },
6103
-
6104
- _mouseStop: function(event) {
6105
-
6106
- //If we are using droppables, inform the manager about the drop
6107
- var that = this,
6108
- dropped = false;
6109
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
6110
- dropped = $.ui.ddmanager.drop(this, event);
6111
- }
6112
-
6113
- //if a drop comes from outside (a sortable)
6114
- if (this.dropped) {
6115
- dropped = this.dropped;
6116
- this.dropped = false;
6117
- }
6118
-
6119
- if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
6120
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
6121
- if (that._trigger("stop", event) !== false) {
6122
- that._clear();
6123
- }
6124
- });
6125
- } else {
6126
- if (this._trigger("stop", event) !== false) {
6127
- this._clear();
6128
- }
6129
- }
6130
-
6131
- return false;
6132
- },
6133
-
6134
- _mouseUp: function( event ) {
6135
- this._unblockFrames();
6136
-
6137
- //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
6138
- if ( $.ui.ddmanager ) {
6139
- $.ui.ddmanager.dragStop(this, event);
6140
- }
6141
-
6142
- // Only need to focus if the event occurred on the draggable itself, see #10527
6143
- if ( this.handleElement.is( event.target ) ) {
6144
- // The interaction is over; whether or not the click resulted in a drag, focus the element
6145
- this.element.focus();
6146
- }
6147
-
6148
- return $.ui.mouse.prototype._mouseUp.call(this, event);
6149
- },
6150
-
6151
- cancel: function() {
6152
-
6153
- if (this.helper.is(".ui-draggable-dragging")) {
6154
- this._mouseUp({});
6155
- } else {
6156
- this._clear();
6157
- }
6158
-
6159
- return this;
6160
-
6161
- },
6162
-
6163
- _getHandle: function(event) {
6164
- return this.options.handle ?
6165
- !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
6166
- true;
6167
- },
6168
-
6169
- _setHandleClassName: function() {
6170
- this.handleElement = this.options.handle ?
6171
- this.element.find( this.options.handle ) : this.element;
6172
- this.handleElement.addClass( "ui-draggable-handle" );
6173
- },
6174
-
6175
- _removeHandleClassName: function() {
6176
- this.handleElement.removeClass( "ui-draggable-handle" );
6177
- },
6178
-
6179
- _createHelper: function(event) {
6180
-
6181
- var o = this.options,
6182
- helperIsFunction = $.isFunction( o.helper ),
6183
- helper = helperIsFunction ?
6184
- $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
6185
- ( o.helper === "clone" ?
6186
- this.element.clone().removeAttr( "id" ) :
6187
- this.element );
6188
-
6189
- if (!helper.parents("body").length) {
6190
- helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
6191
- }
6192
-
6193
- // http://bugs.jqueryui.com/ticket/9446
6194
- // a helper function can return the original element
6195
- // which wouldn't have been set to relative in _create
6196
- if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
6197
- this._setPositionRelative();
6198
- }
6199
-
6200
- if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
6201
- helper.css("position", "absolute");
6202
- }
6203
-
6204
- return helper;
6205
-
6206
- },
6207
-
6208
- _setPositionRelative: function() {
6209
- if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
6210
- this.element[ 0 ].style.position = "relative";
6211
- }
6212
- },
6213
-
6214
- _adjustOffsetFromHelper: function(obj) {
6215
- if (typeof obj === "string") {
6216
- obj = obj.split(" ");
6217
- }
6218
- if ($.isArray(obj)) {
6219
- obj = { left: +obj[0], top: +obj[1] || 0 };
6220
- }
6221
- if ("left" in obj) {
6222
- this.offset.click.left = obj.left + this.margins.left;
6223
- }
6224
- if ("right" in obj) {
6225
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
6226
- }
6227
- if ("top" in obj) {
6228
- this.offset.click.top = obj.top + this.margins.top;
6229
- }
6230
- if ("bottom" in obj) {
6231
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
6232
- }
6233
- },
6234
-
6235
- _isRootNode: function( element ) {
6236
- return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
6237
- },
6238
-
6239
- _getParentOffset: function() {
6240
-
6241
- //Get the offsetParent and cache its position
6242
- var po = this.offsetParent.offset(),
6243
- document = this.document[ 0 ];
6244
-
6245
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
6246
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
6247
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
6248
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
6249
- if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
6250
- po.left += this.scrollParent.scrollLeft();
6251
- po.top += this.scrollParent.scrollTop();
6252
- }
6253
-
6254
- if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
6255
- po = { top: 0, left: 0 };
6256
- }
6257
-
6258
- return {
6259
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
6260
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
6261
- };
6262
-
6263
- },
6264
-
6265
- _getRelativeOffset: function() {
6266
- if ( this.cssPosition !== "relative" ) {
6267
- return { top: 0, left: 0 };
6268
- }
6269
-
6270
- var p = this.element.position(),
6271
- scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
6272
-
6273
- return {
6274
- top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
6275
- left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
6276
- };
6277
-
6278
- },
6279
-
6280
- _cacheMargins: function() {
6281
- this.margins = {
6282
- left: (parseInt(this.element.css("marginLeft"), 10) || 0),
6283
- top: (parseInt(this.element.css("marginTop"), 10) || 0),
6284
- right: (parseInt(this.element.css("marginRight"), 10) || 0),
6285
- bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
6286
- };
6287
- },
6288
-
6289
- _cacheHelperProportions: function() {
6290
- this.helperProportions = {
6291
- width: this.helper.outerWidth(),
6292
- height: this.helper.outerHeight()
6293
- };
6294
- },
6295
-
6296
- _setContainment: function() {
6297
-
6298
- var isUserScrollable, c, ce,
6299
- o = this.options,
6300
- document = this.document[ 0 ];
6301
-
6302
- this.relativeContainer = null;
6303
-
6304
- if ( !o.containment ) {
6305
- this.containment = null;
6306
- return;
6307
- }
6308
-
6309
- if ( o.containment === "window" ) {
6310
- this.containment = [
6311
- $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
6312
- $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
6313
- $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
6314
- $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
6315
- ];
6316
- return;
6317
- }
6318
-
6319
- if ( o.containment === "document") {
6320
- this.containment = [
6321
- 0,
6322
- 0,
6323
- $( document ).width() - this.helperProportions.width - this.margins.left,
6324
- ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
6325
- ];
6326
- return;
6327
- }
6328
-
6329
- if ( o.containment.constructor === Array ) {
6330
- this.containment = o.containment;
6331
- return;
6332
- }
6333
-
6334
- if ( o.containment === "parent" ) {
6335
- o.containment = this.helper[ 0 ].parentNode;
6336
- }
6337
-
6338
- c = $( o.containment );
6339
- ce = c[ 0 ];
6340
-
6341
- if ( !ce ) {
6342
- return;
6343
- }
6344
-
6345
- isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
6346
-
6347
- this.containment = [
6348
- ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
6349
- ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
6350
- ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
6351
- ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
6352
- ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
6353
- this.helperProportions.width -
6354
- this.margins.left -
6355
- this.margins.right,
6356
- ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
6357
- ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
6358
- ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
6359
- this.helperProportions.height -
6360
- this.margins.top -
6361
- this.margins.bottom
6362
- ];
6363
- this.relativeContainer = c;
6364
- },
6365
-
6366
- _convertPositionTo: function(d, pos) {
6367
-
6368
- if (!pos) {
6369
- pos = this.position;
6370
- }
6371
-
6372
- var mod = d === "absolute" ? 1 : -1,
6373
- scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
6374
-
6375
- return {
6376
- top: (
6377
- pos.top + // The absolute mouse position
6378
- this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
6379
- this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
6380
- ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
6381
- ),
6382
- left: (
6383
- pos.left + // The absolute mouse position
6384
- this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
6385
- this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
6386
- ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
6387
- )
6388
- };
6389
-
6390
- },
6391
-
6392
- _generatePosition: function( event, constrainPosition ) {
6393
-
6394
- var containment, co, top, left,
6395
- o = this.options,
6396
- scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
6397
- pageX = event.pageX,
6398
- pageY = event.pageY;
6399
-
6400
- // Cache the scroll
6401
- if ( !scrollIsRootNode || !this.offset.scroll ) {
6402
- this.offset.scroll = {
6403
- top: this.scrollParent.scrollTop(),
6404
- left: this.scrollParent.scrollLeft()
6405
- };
6406
- }
6407
-
6408
- /*
6409
- * - Position constraining -
6410
- * Constrain the position to a mix of grid, containment.
6411
- */
6412
-
6413
- // If we are not dragging yet, we won't check for options
6414
- if ( constrainPosition ) {
6415
- if ( this.containment ) {
6416
- if ( this.relativeContainer ){
6417
- co = this.relativeContainer.offset();
6418
- containment = [
6419
- this.containment[ 0 ] + co.left,
6420
- this.containment[ 1 ] + co.top,
6421
- this.containment[ 2 ] + co.left,
6422
- this.containment[ 3 ] + co.top
6423
- ];
6424
- } else {
6425
- containment = this.containment;
6426
- }
6427
-
6428
- if (event.pageX - this.offset.click.left < containment[0]) {
6429
- pageX = containment[0] + this.offset.click.left;
6430
- }
6431
- if (event.pageY - this.offset.click.top < containment[1]) {
6432
- pageY = containment[1] + this.offset.click.top;
6433
- }
6434
- if (event.pageX - this.offset.click.left > containment[2]) {
6435
- pageX = containment[2] + this.offset.click.left;
6436
- }
6437
- if (event.pageY - this.offset.click.top > containment[3]) {
6438
- pageY = containment[3] + this.offset.click.top;
6439
- }
6440
- }
6441
-
6442
- if (o.grid) {
6443
- //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
6444
- top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
6445
- pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
6446
-
6447
- left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
6448
- pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
6449
- }
6450
-
6451
- if ( o.axis === "y" ) {
6452
- pageX = this.originalPageX;
6453
- }
6454
-
6455
- if ( o.axis === "x" ) {
6456
- pageY = this.originalPageY;
6457
- }
6458
- }
6459
-
6460
- return {
6461
- top: (
6462
- pageY - // The absolute mouse position
6463
- this.offset.click.top - // Click offset (relative to the element)
6464
- this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
6465
- this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
6466
- ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
6467
- ),
6468
- left: (
6469
- pageX - // The absolute mouse position
6470
- this.offset.click.left - // Click offset (relative to the element)
6471
- this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
6472
- this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
6473
- ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
6474
- )
6475
- };
6476
-
6477
- },
6478
-
6479
- _clear: function() {
6480
- this.helper.removeClass("ui-draggable-dragging");
6481
- if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
6482
- this.helper.remove();
6483
- }
6484
- this.helper = null;
6485
- this.cancelHelperRemoval = false;
6486
- if ( this.destroyOnClear ) {
6487
- this.destroy();
6488
- }
6489
- },
6490
-
6491
- _normalizeRightBottom: function() {
6492
- if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
6493
- this.helper.width( this.helper.width() );
6494
- this.helper.css( "right", "auto" );
6495
- }
6496
- if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
6497
- this.helper.height( this.helper.height() );
6498
- this.helper.css( "bottom", "auto" );
6499
- }
6500
- },
6501
-
6502
- // From now on bulk stuff - mainly helpers
6503
-
6504
- _trigger: function( type, event, ui ) {
6505
- ui = ui || this._uiHash();
6506
- $.ui.plugin.call( this, type, [ event, ui, this ], true );
6507
-
6508
- // Absolute position and offset (see #6884 ) have to be recalculated after plugins
6509
- if ( /^(drag|start|stop)/.test( type ) ) {
6510
- this.positionAbs = this._convertPositionTo( "absolute" );
6511
- ui.offset = this.positionAbs;
6512
- }
6513
- return $.Widget.prototype._trigger.call( this, type, event, ui );
6514
- },
6515
-
6516
- plugins: {},
6517
-
6518
- _uiHash: function() {
6519
- return {
6520
- helper: this.helper,
6521
- position: this.position,
6522
- originalPosition: this.originalPosition,
6523
- offset: this.positionAbs
6524
- };
6525
- }
6526
-
6527
- });
6528
-
6529
- $.ui.plugin.add( "draggable", "connectToSortable", {
6530
- start: function( event, ui, draggable ) {
6531
- var uiSortable = $.extend( {}, ui, {
6532
- item: draggable.element
6533
- });
6534
-
6535
- draggable.sortables = [];
6536
- $( draggable.options.connectToSortable ).each(function() {
6537
- var sortable = $( this ).sortable( "instance" );
6538
-
6539
- if ( sortable && !sortable.options.disabled ) {
6540
- draggable.sortables.push( sortable );
6541
-
6542
- // refreshPositions is called at drag start to refresh the containerCache
6543
- // which is used in drag. This ensures it's initialized and synchronized
6544
- // with any changes that might have happened on the page since initialization.
6545
- sortable.refreshPositions();
6546
- sortable._trigger("activate", event, uiSortable);
6547
- }
6548
- });
6549
- },
6550
- stop: function( event, ui, draggable ) {
6551
- var uiSortable = $.extend( {}, ui, {
6552
- item: draggable.element
6553
- });
6554
-
6555
- draggable.cancelHelperRemoval = false;
6556
-
6557
- $.each( draggable.sortables, function() {
6558
- var sortable = this;
6559
-
6560
- if ( sortable.isOver ) {
6561
- sortable.isOver = 0;
6562
-
6563
- // Allow this sortable to handle removing the helper
6564
- draggable.cancelHelperRemoval = true;
6565
- sortable.cancelHelperRemoval = false;
6566
-
6567
- // Use _storedCSS To restore properties in the sortable,
6568
- // as this also handles revert (#9675) since the draggable
6569
- // may have modified them in unexpected ways (#8809)
6570
- sortable._storedCSS = {
6571
- position: sortable.placeholder.css( "position" ),
6572
- top: sortable.placeholder.css( "top" ),
6573
- left: sortable.placeholder.css( "left" )
6574
- };
6575
-
6576
- sortable._mouseStop(event);
6577
-
6578
- // Once drag has ended, the sortable should return to using
6579
- // its original helper, not the shared helper from draggable
6580
- sortable.options.helper = sortable.options._helper;
6581
- } else {
6582
- // Prevent this Sortable from removing the helper.
6583
- // However, don't set the draggable to remove the helper
6584
- // either as another connected Sortable may yet handle the removal.
6585
- sortable.cancelHelperRemoval = true;
6586
-
6587
- sortable._trigger( "deactivate", event, uiSortable );
6588
- }
6589
- });
6590
- },
6591
- drag: function( event, ui, draggable ) {
6592
- $.each( draggable.sortables, function() {
6593
- var innermostIntersecting = false,
6594
- sortable = this;
6595
-
6596
- // Copy over variables that sortable's _intersectsWith uses
6597
- sortable.positionAbs = draggable.positionAbs;
6598
- sortable.helperProportions = draggable.helperProportions;
6599
- sortable.offset.click = draggable.offset.click;
6600
-
6601
- if ( sortable._intersectsWith( sortable.containerCache ) ) {
6602
- innermostIntersecting = true;
6603
-
6604
- $.each( draggable.sortables, function() {
6605
- // Copy over variables that sortable's _intersectsWith uses
6606
- this.positionAbs = draggable.positionAbs;
6607
- this.helperProportions = draggable.helperProportions;
6608
- this.offset.click = draggable.offset.click;
6609
-
6610
- if ( this !== sortable &&
6611
- this._intersectsWith( this.containerCache ) &&
6612
- $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
6613
- innermostIntersecting = false;
6614
- }
6615
-
6616
- return innermostIntersecting;
6617
- });
6618
- }
6619
-
6620
- if ( innermostIntersecting ) {
6621
- // If it intersects, we use a little isOver variable and set it once,
6622
- // so that the move-in stuff gets fired only once.
6623
- if ( !sortable.isOver ) {
6624
- sortable.isOver = 1;
6625
-
6626
- // Store draggable's parent in case we need to reappend to it later.
6627
- draggable._parent = ui.helper.parent();
6628
-
6629
- sortable.currentItem = ui.helper
6630
- .appendTo( sortable.element )
6631
- .data( "ui-sortable-item", true );
6632
-
6633
- // Store helper option to later restore it
6634
- sortable.options._helper = sortable.options.helper;
6635
-
6636
- sortable.options.helper = function() {
6637
- return ui.helper[ 0 ];
6638
- };
6639
-
6640
- // Fire the start events of the sortable with our passed browser event,
6641
- // and our own helper (so it doesn't create a new one)
6642
- event.target = sortable.currentItem[ 0 ];
6643
- sortable._mouseCapture( event, true );
6644
- sortable._mouseStart( event, true, true );
6645
-
6646
- // Because the browser event is way off the new appended portlet,
6647
- // modify necessary variables to reflect the changes
6648
- sortable.offset.click.top = draggable.offset.click.top;
6649
- sortable.offset.click.left = draggable.offset.click.left;
6650
- sortable.offset.parent.left -= draggable.offset.parent.left -
6651
- sortable.offset.parent.left;
6652
- sortable.offset.parent.top -= draggable.offset.parent.top -
6653
- sortable.offset.parent.top;
6654
-
6655
- draggable._trigger( "toSortable", event );
6656
-
6657
- // Inform draggable that the helper is in a valid drop zone,
6658
- // used solely in the revert option to handle "valid/invalid".
6659
- draggable.dropped = sortable.element;
6660
-
6661
- // Need to refreshPositions of all sortables in the case that
6662
- // adding to one sortable changes the location of the other sortables (#9675)
6663
- $.each( draggable.sortables, function() {
6664
- this.refreshPositions();
6665
- });
6666
-
6667
- // hack so receive/update callbacks work (mostly)
6668
- draggable.currentItem = draggable.element;
6669
- sortable.fromOutside = draggable;
6670
- }
6671
-
6672
- if ( sortable.currentItem ) {
6673
- sortable._mouseDrag( event );
6674
- // Copy the sortable's position because the draggable's can potentially reflect
6675
- // a relative position, while sortable is always absolute, which the dragged
6676
- // element has now become. (#8809)
6677
- ui.position = sortable.position;
6678
- }
6679
- } else {
6680
- // If it doesn't intersect with the sortable, and it intersected before,
6681
- // we fake the drag stop of the sortable, but make sure it doesn't remove
6682
- // the helper by using cancelHelperRemoval.
6683
- if ( sortable.isOver ) {
6684
-
6685
- sortable.isOver = 0;
6686
- sortable.cancelHelperRemoval = true;
6687
-
6688
- // Calling sortable's mouseStop would trigger a revert,
6689
- // so revert must be temporarily false until after mouseStop is called.
6690
- sortable.options._revert = sortable.options.revert;
6691
- sortable.options.revert = false;
6692
-
6693
- sortable._trigger( "out", event, sortable._uiHash( sortable ) );
6694
- sortable._mouseStop( event, true );
6695
-
6696
- // restore sortable behaviors that were modfied
6697
- // when the draggable entered the sortable area (#9481)
6698
- sortable.options.revert = sortable.options._revert;
6699
- sortable.options.helper = sortable.options._helper;
6700
-
6701
- if ( sortable.placeholder ) {
6702
- sortable.placeholder.remove();
6703
- }
6704
-
6705
- // Restore and recalculate the draggable's offset considering the sortable
6706
- // may have modified them in unexpected ways. (#8809, #10669)
6707
- ui.helper.appendTo( draggable._parent );
6708
- draggable._refreshOffsets( event );
6709
- ui.position = draggable._generatePosition( event, true );
6710
-
6711
- draggable._trigger( "fromSortable", event );
6712
-
6713
- // Inform draggable that the helper is no longer in a valid drop zone
6714
- draggable.dropped = false;
6715
-
6716
- // Need to refreshPositions of all sortables just in case removing
6717
- // from one sortable changes the location of other sortables (#9675)
6718
- $.each( draggable.sortables, function() {
6719
- this.refreshPositions();
6720
- });
6721
- }
6722
- }
6723
- });
6724
- }
6725
- });
6726
-
6727
- $.ui.plugin.add("draggable", "cursor", {
6728
- start: function( event, ui, instance ) {
6729
- var t = $( "body" ),
6730
- o = instance.options;
6731
-
6732
- if (t.css("cursor")) {
6733
- o._cursor = t.css("cursor");
6734
- }
6735
- t.css("cursor", o.cursor);
6736
- },
6737
- stop: function( event, ui, instance ) {
6738
- var o = instance.options;
6739
- if (o._cursor) {
6740
- $("body").css("cursor", o._cursor);
6741
- }
6742
- }
6743
- });
6744
-
6745
- $.ui.plugin.add("draggable", "opacity", {
6746
- start: function( event, ui, instance ) {
6747
- var t = $( ui.helper ),
6748
- o = instance.options;
6749
- if (t.css("opacity")) {
6750
- o._opacity = t.css("opacity");
6751
- }
6752
- t.css("opacity", o.opacity);
6753
- },
6754
- stop: function( event, ui, instance ) {
6755
- var o = instance.options;
6756
- if (o._opacity) {
6757
- $(ui.helper).css("opacity", o._opacity);
6758
- }
6759
- }
6760
- });
6761
-
6762
- $.ui.plugin.add("draggable", "scroll", {
6763
- start: function( event, ui, i ) {
6764
- if ( !i.scrollParentNotHidden ) {
6765
- i.scrollParentNotHidden = i.helper.scrollParent( false );
6766
- }
6767
-
6768
- if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
6769
- i.overflowOffset = i.scrollParentNotHidden.offset();
6770
- }
6771
- },
6772
- drag: function( event, ui, i ) {
6773
-
6774
- var o = i.options,
6775
- scrolled = false,
6776
- scrollParent = i.scrollParentNotHidden[ 0 ],
6777
- document = i.document[ 0 ];
6778
-
6779
- if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
6780
- if ( !o.axis || o.axis !== "x" ) {
6781
- if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
6782
- scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
6783
- } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
6784
- scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
6785
- }
6786
- }
6787
-
6788
- if ( !o.axis || o.axis !== "y" ) {
6789
- if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
6790
- scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
6791
- } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
6792
- scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
6793
- }
6794
- }
6795
-
6796
- } else {
6797
-
6798
- if (!o.axis || o.axis !== "x") {
6799
- if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
6800
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
6801
- } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
6802
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
6803
- }
6804
- }
6805
-
6806
- if (!o.axis || o.axis !== "y") {
6807
- if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
6808
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
6809
- } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
6810
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
6811
- }
6812
- }
6813
-
6814
- }
6815
-
6816
- if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
6817
- $.ui.ddmanager.prepareOffsets(i, event);
6818
- }
6819
-
6820
- }
6821
- });
6822
-
6823
- $.ui.plugin.add("draggable", "snap", {
6824
- start: function( event, ui, i ) {
6825
-
6826
- var o = i.options;
6827
-
6828
- i.snapElements = [];
6829
-
6830
- $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
6831
- var $t = $(this),
6832
- $o = $t.offset();
6833
- if (this !== i.element[0]) {
6834
- i.snapElements.push({
6835
- item: this,
6836
- width: $t.outerWidth(), height: $t.outerHeight(),
6837
- top: $o.top, left: $o.left
6838
- });
6839
- }
6840
- });
6841
-
6842
- },
6843
- drag: function( event, ui, inst ) {
6844
-
6845
- var ts, bs, ls, rs, l, r, t, b, i, first,
6846
- o = inst.options,
6847
- d = o.snapTolerance,
6848
- x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
6849
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
6850
-
6851
- for (i = inst.snapElements.length - 1; i >= 0; i--){
6852
-
6853
- l = inst.snapElements[i].left - inst.margins.left;
6854
- r = l + inst.snapElements[i].width;
6855
- t = inst.snapElements[i].top - inst.margins.top;
6856
- b = t + inst.snapElements[i].height;
6857
-
6858
- if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
6859
- if (inst.snapElements[i].snapping) {
6860
- (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
6861
- }
6862
- inst.snapElements[i].snapping = false;
6863
- continue;
6864
- }
6865
-
6866
- if (o.snapMode !== "inner") {
6867
- ts = Math.abs(t - y2) <= d;
6868
- bs = Math.abs(b - y1) <= d;
6869
- ls = Math.abs(l - x2) <= d;
6870
- rs = Math.abs(r - x1) <= d;
6871
- if (ts) {
6872
- ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
6873
- }
6874
- if (bs) {
6875
- ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
6876
- }
6877
- if (ls) {
6878
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
6879
- }
6880
- if (rs) {
6881
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
6882
- }
6883
- }
6884
-
6885
- first = (ts || bs || ls || rs);
6886
-
6887
- if (o.snapMode !== "outer") {
6888
- ts = Math.abs(t - y1) <= d;
6889
- bs = Math.abs(b - y2) <= d;
6890
- ls = Math.abs(l - x1) <= d;
6891
- rs = Math.abs(r - x2) <= d;
6892
- if (ts) {
6893
- ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
6894
- }
6895
- if (bs) {
6896
- ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
6897
- }
6898
- if (ls) {
6899
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
6900
- }
6901
- if (rs) {
6902
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
6903
- }
6904
- }
6905
-
6906
- if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
6907
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
6908
- }
6909
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
6910
-
6911
- }
6912
-
6913
- }
6914
- });
6915
-
6916
- $.ui.plugin.add("draggable", "stack", {
6917
- start: function( event, ui, instance ) {
6918
- var min,
6919
- o = instance.options,
6920
- group = $.makeArray($(o.stack)).sort(function(a, b) {
6921
- return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
6922
- });
6923
-
6924
- if (!group.length) { return; }
6925
-
6926
- min = parseInt($(group[0]).css("zIndex"), 10) || 0;
6927
- $(group).each(function(i) {
6928
- $(this).css("zIndex", min + i);
6929
- });
6930
- this.css("zIndex", (min + group.length));
6931
- }
6932
- });
6933
-
6934
- $.ui.plugin.add("draggable", "zIndex", {
6935
- start: function( event, ui, instance ) {
6936
- var t = $( ui.helper ),
6937
- o = instance.options;
6938
-
6939
- if (t.css("zIndex")) {
6940
- o._zIndex = t.css("zIndex");
6941
- }
6942
- t.css("zIndex", o.zIndex);
6943
- },
6944
- stop: function( event, ui, instance ) {
6945
- var o = instance.options;
6946
-
6947
- if (o._zIndex) {
6948
- $(ui.helper).css("zIndex", o._zIndex);
6949
- }
6950
- }
6951
- });
6952
-
6953
- var draggable = $.ui.draggable;
6954
-
6955
-
6956
- /*!
6957
- * jQuery UI Resizable 1.11.4
6958
- * http://jqueryui.com
6959
- *
6960
- * Copyright jQuery Foundation and other contributors
6961
- * Released under the MIT license.
6962
- * http://jquery.org/license
6963
- *
6964
- * http://api.jqueryui.com/resizable/
6965
- */
6966
-
6967
-
6968
- $.widget("ui.resizable", $.ui.mouse, {
6969
- version: "1.11.4",
6970
- widgetEventPrefix: "resize",
6971
- options: {
6972
- alsoResize: false,
6973
- animate: false,
6974
- animateDuration: "slow",
6975
- animateEasing: "swing",
6976
- aspectRatio: false,
6977
- autoHide: false,
6978
- containment: false,
6979
- ghost: false,
6980
- grid: false,
6981
- handles: "e,s,se",
6982
- helper: false,
6983
- maxHeight: null,
6984
- maxWidth: null,
6985
- minHeight: 10,
6986
- minWidth: 10,
6987
- // See #7960
6988
- zIndex: 90,
6989
-
6990
- // callbacks
6991
- resize: null,
6992
- start: null,
6993
- stop: null
6994
- },
6995
-
6996
- _num: function( value ) {
6997
- return parseInt( value, 10 ) || 0;
6998
- },
6999
-
7000
- _isNumber: function( value ) {
7001
- return !isNaN( parseInt( value, 10 ) );
7002
- },
7003
-
7004
- _hasScroll: function( el, a ) {
7005
-
7006
- if ( $( el ).css( "overflow" ) === "hidden") {
7007
- return false;
7008
- }
7009
-
7010
- var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
7011
- has = false;
7012
-
7013
- if ( el[ scroll ] > 0 ) {
7014
- return true;
7015
- }
7016
-
7017
- // TODO: determine which cases actually cause this to happen
7018
- // if the element doesn't have the scroll set, see if it's possible to
7019
- // set the scroll
7020
- el[ scroll ] = 1;
7021
- has = ( el[ scroll ] > 0 );
7022
- el[ scroll ] = 0;
7023
- return has;
7024
- },
7025
-
7026
- _create: function() {
7027
-
7028
- var n, i, handle, axis, hname,
7029
- that = this,
7030
- o = this.options;
7031
- this.element.addClass("ui-resizable");
7032
-
7033
- $.extend(this, {
7034
- _aspectRatio: !!(o.aspectRatio),
7035
- aspectRatio: o.aspectRatio,
7036
- originalElement: this.element,
7037
- _proportionallyResizeElements: [],
7038
- _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
7039
- });
7040
-
7041
- // Wrap the element if it cannot hold child nodes
7042
- if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
7043
-
7044
- this.element.wrap(
7045
- $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
7046
- position: this.element.css("position"),
7047
- width: this.element.outerWidth(),
7048
- height: this.element.outerHeight(),
7049
- top: this.element.css("top"),
7050
- left: this.element.css("left")
7051
- })
7052
- );
7053
-
7054
- this.element = this.element.parent().data(
7055
- "ui-resizable", this.element.resizable( "instance" )
7056
- );
7057
-
7058
- this.elementIsWrapper = true;
7059
-
7060
- this.element.css({
7061
- marginLeft: this.originalElement.css("marginLeft"),
7062
- marginTop: this.originalElement.css("marginTop"),
7063
- marginRight: this.originalElement.css("marginRight"),
7064
- marginBottom: this.originalElement.css("marginBottom")
7065
- });
7066
- this.originalElement.css({
7067
- marginLeft: 0,
7068
- marginTop: 0,
7069
- marginRight: 0,
7070
- marginBottom: 0
7071
- });
7072
- // support: Safari
7073
- // Prevent Safari textarea resize
7074
- this.originalResizeStyle = this.originalElement.css("resize");
7075
- this.originalElement.css("resize", "none");
7076
-
7077
- this._proportionallyResizeElements.push( this.originalElement.css({
7078
- position: "static",
7079
- zoom: 1,
7080
- display: "block"
7081
- }) );
7082
-
7083
- // support: IE9
7084
- // avoid IE jump (hard set the margin)
7085
- this.originalElement.css({ margin: this.originalElement.css("margin") });
7086
-
7087
- this._proportionallyResize();
7088
- }
7089
-
7090
- this.handles = o.handles ||
7091
- ( !$(".ui-resizable-handle", this.element).length ?
7092
- "e,s,se" : {
7093
- n: ".ui-resizable-n",
7094
- e: ".ui-resizable-e",
7095
- s: ".ui-resizable-s",
7096
- w: ".ui-resizable-w",
7097
- se: ".ui-resizable-se",
7098
- sw: ".ui-resizable-sw",
7099
- ne: ".ui-resizable-ne",
7100
- nw: ".ui-resizable-nw"
7101
- } );
7102
-
7103
- this._handles = $();
7104
- if ( this.handles.constructor === String ) {
7105
-
7106
- if ( this.handles === "all") {
7107
- this.handles = "n,e,s,w,se,sw,ne,nw";
7108
- }
7109
-
7110
- n = this.handles.split(",");
7111
- this.handles = {};
7112
-
7113
- for (i = 0; i < n.length; i++) {
7114
-
7115
- handle = $.trim(n[i]);
7116
- hname = "ui-resizable-" + handle;
7117
- axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
7118
-
7119
- axis.css({ zIndex: o.zIndex });
7120
-
7121
- // TODO : What's going on here?
7122
- if ("se" === handle) {
7123
- axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
7124
- }
7125
-
7126
- this.handles[handle] = ".ui-resizable-" + handle;
7127
- this.element.append(axis);
7128
- }
7129
-
7130
- }
7131
-
7132
- this._renderAxis = function(target) {
7133
-
7134
- var i, axis, padPos, padWrapper;
7135
-
7136
- target = target || this.element;
7137
-
7138
- for (i in this.handles) {
7139
-
7140
- if (this.handles[i].constructor === String) {
7141
- this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
7142
- } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
7143
- this.handles[ i ] = $( this.handles[ i ] );
7144
- this._on( this.handles[ i ], { "mousedown": that._mouseDown });
7145
- }
7146
-
7147
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
7148
-
7149
- axis = $(this.handles[i], this.element);
7150
-
7151
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
7152
-
7153
- padPos = [ "padding",
7154
- /ne|nw|n/.test(i) ? "Top" :
7155
- /se|sw|s/.test(i) ? "Bottom" :
7156
- /^e$/.test(i) ? "Right" : "Left" ].join("");
7157
-
7158
- target.css(padPos, padWrapper);
7159
-
7160
- this._proportionallyResize();
7161
- }
7162
-
7163
- this._handles = this._handles.add( this.handles[ i ] );
7164
- }
7165
- };
7166
-
7167
- // TODO: make renderAxis a prototype function
7168
- this._renderAxis(this.element);
7169
-
7170
- this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
7171
- this._handles.disableSelection();
7172
-
7173
- this._handles.mouseover(function() {
7174
- if (!that.resizing) {
7175
- if (this.className) {
7176
- axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
7177
- }
7178
- that.axis = axis && axis[1] ? axis[1] : "se";
7179
- }
7180
- });
7181
-
7182
- if (o.autoHide) {
7183
- this._handles.hide();
7184
- $(this.element)
7185
- .addClass("ui-resizable-autohide")
7186
- .mouseenter(function() {
7187
- if (o.disabled) {
7188
- return;
7189
- }
7190
- $(this).removeClass("ui-resizable-autohide");
7191
- that._handles.show();
7192
- })
7193
- .mouseleave(function() {
7194
- if (o.disabled) {
7195
- return;
7196
- }
7197
- if (!that.resizing) {
7198
- $(this).addClass("ui-resizable-autohide");
7199
- that._handles.hide();
7200
- }
7201
- });
7202
- }
7203
-
7204
- this._mouseInit();
7205
- },
7206
-
7207
- _destroy: function() {
7208
-
7209
- this._mouseDestroy();
7210
-
7211
- var wrapper,
7212
- _destroy = function(exp) {
7213
- $(exp)
7214
- .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
7215
- .removeData("resizable")
7216
- .removeData("ui-resizable")
7217
- .unbind(".resizable")
7218
- .find(".ui-resizable-handle")
7219
- .remove();
7220
- };
7221
-
7222
- // TODO: Unwrap at same DOM position
7223
- if (this.elementIsWrapper) {
7224
- _destroy(this.element);
7225
- wrapper = this.element;
7226
- this.originalElement.css({
7227
- position: wrapper.css("position"),
7228
- width: wrapper.outerWidth(),
7229
- height: wrapper.outerHeight(),
7230
- top: wrapper.css("top"),
7231
- left: wrapper.css("left")
7232
- }).insertAfter( wrapper );
7233
- wrapper.remove();
7234
- }
7235
-
7236
- this.originalElement.css("resize", this.originalResizeStyle);
7237
- _destroy(this.originalElement);
7238
-
7239
- return this;
7240
- },
7241
-
7242
- _mouseCapture: function(event) {
7243
- var i, handle,
7244
- capture = false;
7245
-
7246
- for (i in this.handles) {
7247
- handle = $(this.handles[i])[0];
7248
- if (handle === event.target || $.contains(handle, event.target)) {
7249
- capture = true;
7250
- }
7251
- }
7252
-
7253
- return !this.options.disabled && capture;
7254
- },
7255
-
7256
- _mouseStart: function(event) {
7257
-
7258
- var curleft, curtop, cursor,
7259
- o = this.options,
7260
- el = this.element;
7261
-
7262
- this.resizing = true;
7263
-
7264
- this._renderProxy();
7265
-
7266
- curleft = this._num(this.helper.css("left"));
7267
- curtop = this._num(this.helper.css("top"));
7268
-
7269
- if (o.containment) {
7270
- curleft += $(o.containment).scrollLeft() || 0;
7271
- curtop += $(o.containment).scrollTop() || 0;
7272
- }
7273
-
7274
- this.offset = this.helper.offset();
7275
- this.position = { left: curleft, top: curtop };
7276
-
7277
- this.size = this._helper ? {
7278
- width: this.helper.width(),
7279
- height: this.helper.height()
7280
- } : {
7281
- width: el.width(),
7282
- height: el.height()
7283
- };
7284
-
7285
- this.originalSize = this._helper ? {
7286
- width: el.outerWidth(),
7287
- height: el.outerHeight()
7288
- } : {
7289
- width: el.width(),
7290
- height: el.height()
7291
- };
7292
-
7293
- this.sizeDiff = {
7294
- width: el.outerWidth() - el.width(),
7295
- height: el.outerHeight() - el.height()
7296
- };
7297
-
7298
- this.originalPosition = { left: curleft, top: curtop };
7299
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
7300
-
7301
- this.aspectRatio = (typeof o.aspectRatio === "number") ?
7302
- o.aspectRatio :
7303
- ((this.originalSize.width / this.originalSize.height) || 1);
7304
-
7305
- cursor = $(".ui-resizable-" + this.axis).css("cursor");
7306
- $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
7307
-
7308
- el.addClass("ui-resizable-resizing");
7309
- this._propagate("start", event);
7310
- return true;
7311
- },
7312
-
7313
- _mouseDrag: function(event) {
7314
-
7315
- var data, props,
7316
- smp = this.originalMousePosition,
7317
- a = this.axis,
7318
- dx = (event.pageX - smp.left) || 0,
7319
- dy = (event.pageY - smp.top) || 0,
7320
- trigger = this._change[a];
7321
-
7322
- this._updatePrevProperties();
7323
-
7324
- if (!trigger) {
7325
- return false;
7326
- }
7327
-
7328
- data = trigger.apply(this, [ event, dx, dy ]);
7329
-
7330
- this._updateVirtualBoundaries(event.shiftKey);
7331
- if (this._aspectRatio || event.shiftKey) {
7332
- data = this._updateRatio(data, event);
7333
- }
7334
-
7335
- data = this._respectSize(data, event);
7336
-
7337
- this._updateCache(data);
7338
-
7339
- this._propagate("resize", event);
7340
-
7341
- props = this._applyChanges();
7342
-
7343
- if ( !this._helper && this._proportionallyResizeElements.length ) {
7344
- this._proportionallyResize();
7345
- }
7346
-
7347
- if ( !$.isEmptyObject( props ) ) {
7348
- this._updatePrevProperties();
7349
- this._trigger( "resize", event, this.ui() );
7350
- this._applyChanges();
7351
- }
7352
-
7353
- return false;
7354
- },
7355
-
7356
- _mouseStop: function(event) {
7357
-
7358
- this.resizing = false;
7359
- var pr, ista, soffseth, soffsetw, s, left, top,
7360
- o = this.options, that = this;
7361
-
7362
- if (this._helper) {
7363
-
7364
- pr = this._proportionallyResizeElements;
7365
- ista = pr.length && (/textarea/i).test(pr[0].nodeName);
7366
- soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
7367
- soffsetw = ista ? 0 : that.sizeDiff.width;
7368
-
7369
- s = {
7370
- width: (that.helper.width() - soffsetw),
7371
- height: (that.helper.height() - soffseth)
7372
- };
7373
- left = (parseInt(that.element.css("left"), 10) +
7374
- (that.position.left - that.originalPosition.left)) || null;
7375
- top = (parseInt(that.element.css("top"), 10) +
7376
- (that.position.top - that.originalPosition.top)) || null;
7377
-
7378
- if (!o.animate) {
7379
- this.element.css($.extend(s, { top: top, left: left }));
7380
- }
7381
-
7382
- that.helper.height(that.size.height);
7383
- that.helper.width(that.size.width);
7384
-
7385
- if (this._helper && !o.animate) {
7386
- this._proportionallyResize();
7387
- }
7388
- }
7389
-
7390
- $("body").css("cursor", "auto");
7391
-
7392
- this.element.removeClass("ui-resizable-resizing");
7393
-
7394
- this._propagate("stop", event);
7395
-
7396
- if (this._helper) {
7397
- this.helper.remove();
7398
- }
7399
-
7400
- return false;
7401
-
7402
- },
7403
-
7404
- _updatePrevProperties: function() {
7405
- this.prevPosition = {
7406
- top: this.position.top,
7407
- left: this.position.left
7408
- };
7409
- this.prevSize = {
7410
- width: this.size.width,
7411
- height: this.size.height
7412
- };
7413
- },
7414
-
7415
- _applyChanges: function() {
7416
- var props = {};
7417
-
7418
- if ( this.position.top !== this.prevPosition.top ) {
7419
- props.top = this.position.top + "px";
7420
- }
7421
- if ( this.position.left !== this.prevPosition.left ) {
7422
- props.left = this.position.left + "px";
7423
- }
7424
- if ( this.size.width !== this.prevSize.width ) {
7425
- props.width = this.size.width + "px";
7426
- }
7427
- if ( this.size.height !== this.prevSize.height ) {
7428
- props.height = this.size.height + "px";
7429
- }
7430
-
7431
- this.helper.css( props );
7432
-
7433
- return props;
7434
- },
7435
-
7436
- _updateVirtualBoundaries: function(forceAspectRatio) {
7437
- var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
7438
- o = this.options;
7439
-
7440
- b = {
7441
- minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
7442
- maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
7443
- minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
7444
- maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
7445
- };
7446
-
7447
- if (this._aspectRatio || forceAspectRatio) {
7448
- pMinWidth = b.minHeight * this.aspectRatio;
7449
- pMinHeight = b.minWidth / this.aspectRatio;
7450
- pMaxWidth = b.maxHeight * this.aspectRatio;
7451
- pMaxHeight = b.maxWidth / this.aspectRatio;
7452
-
7453
- if (pMinWidth > b.minWidth) {
7454
- b.minWidth = pMinWidth;
7455
- }
7456
- if (pMinHeight > b.minHeight) {
7457
- b.minHeight = pMinHeight;
7458
- }
7459
- if (pMaxWidth < b.maxWidth) {
7460
- b.maxWidth = pMaxWidth;
7461
- }
7462
- if (pMaxHeight < b.maxHeight) {
7463
- b.maxHeight = pMaxHeight;
7464
- }
7465
- }
7466
- this._vBoundaries = b;
7467
- },
7468
-
7469
- _updateCache: function(data) {
7470
- this.offset = this.helper.offset();
7471
- if (this._isNumber(data.left)) {
7472
- this.position.left = data.left;
7473
- }
7474
- if (this._isNumber(data.top)) {
7475
- this.position.top = data.top;
7476
- }
7477
- if (this._isNumber(data.height)) {
7478
- this.size.height = data.height;
7479
- }
7480
- if (this._isNumber(data.width)) {
7481
- this.size.width = data.width;
7482
- }
7483
- },
7484
-
7485
- _updateRatio: function( data ) {
7486
-
7487
- var cpos = this.position,
7488
- csize = this.size,
7489
- a = this.axis;
7490
-
7491
- if (this._isNumber(data.height)) {
7492
- data.width = (data.height * this.aspectRatio);
7493
- } else if (this._isNumber(data.width)) {
7494
- data.height = (data.width / this.aspectRatio);
7495
- }
7496
-
7497
- if (a === "sw") {
7498
- data.left = cpos.left + (csize.width - data.width);
7499
- data.top = null;
7500
- }
7501
- if (a === "nw") {
7502
- data.top = cpos.top + (csize.height - data.height);
7503
- data.left = cpos.left + (csize.width - data.width);
7504
- }
7505
-
7506
- return data;
7507
- },
7508
-
7509
- _respectSize: function( data ) {
7510
-
7511
- var o = this._vBoundaries,
7512
- a = this.axis,
7513
- ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
7514
- ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
7515
- isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
7516
- isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
7517
- dw = this.originalPosition.left + this.originalSize.width,
7518
- dh = this.position.top + this.size.height,
7519
- cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
7520
- if (isminw) {
7521
- data.width = o.minWidth;
7522
- }
7523
- if (isminh) {
7524
- data.height = o.minHeight;
7525
- }
7526
- if (ismaxw) {
7527
- data.width = o.maxWidth;
7528
- }
7529
- if (ismaxh) {
7530
- data.height = o.maxHeight;
7531
- }
7532
-
7533
- if (isminw && cw) {
7534
- data.left = dw - o.minWidth;
7535
- }
7536
- if (ismaxw && cw) {
7537
- data.left = dw - o.maxWidth;
7538
- }
7539
- if (isminh && ch) {
7540
- data.top = dh - o.minHeight;
7541
- }
7542
- if (ismaxh && ch) {
7543
- data.top = dh - o.maxHeight;
7544
- }
7545
-
7546
- // Fixing jump error on top/left - bug #2330
7547
- if (!data.width && !data.height && !data.left && data.top) {
7548
- data.top = null;
7549
- } else if (!data.width && !data.height && !data.top && data.left) {
7550
- data.left = null;
7551
- }
7552
-
7553
- return data;
7554
- },
7555
-
7556
- _getPaddingPlusBorderDimensions: function( element ) {
7557
- var i = 0,
7558
- widths = [],
7559
- borders = [
7560
- element.css( "borderTopWidth" ),
7561
- element.css( "borderRightWidth" ),
7562
- element.css( "borderBottomWidth" ),
7563
- element.css( "borderLeftWidth" )
7564
- ],
7565
- paddings = [
7566
- element.css( "paddingTop" ),
7567
- element.css( "paddingRight" ),
7568
- element.css( "paddingBottom" ),
7569
- element.css( "paddingLeft" )
7570
- ];
7571
-
7572
- for ( ; i < 4; i++ ) {
7573
- widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
7574
- widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
7575
- }
7576
-
7577
- return {
7578
- height: widths[ 0 ] + widths[ 2 ],
7579
- width: widths[ 1 ] + widths[ 3 ]
7580
- };
7581
- },
7582
-
7583
- _proportionallyResize: function() {
7584
-
7585
- if (!this._proportionallyResizeElements.length) {
7586
- return;
7587
- }
7588
-
7589
- var prel,
7590
- i = 0,
7591
- element = this.helper || this.element;
7592
-
7593
- for ( ; i < this._proportionallyResizeElements.length; i++) {
7594
-
7595
- prel = this._proportionallyResizeElements[i];
7596
-
7597
- // TODO: Seems like a bug to cache this.outerDimensions
7598
- // considering that we are in a loop.
7599
- if (!this.outerDimensions) {
7600
- this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
7601
- }
7602
-
7603
- prel.css({
7604
- height: (element.height() - this.outerDimensions.height) || 0,
7605
- width: (element.width() - this.outerDimensions.width) || 0
7606
- });
7607
-
7608
- }
7609
-
7610
- },
7611
-
7612
- _renderProxy: function() {
7613
-
7614
- var el = this.element, o = this.options;
7615
- this.elementOffset = el.offset();
7616
-
7617
- if (this._helper) {
7618
-
7619
- this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
7620
-
7621
- this.helper.addClass(this._helper).css({
7622
- width: this.element.outerWidth() - 1,
7623
- height: this.element.outerHeight() - 1,
7624
- position: "absolute",
7625
- left: this.elementOffset.left + "px",
7626
- top: this.elementOffset.top + "px",
7627
- zIndex: ++o.zIndex //TODO: Don't modify option
7628
- });
7629
-
7630
- this.helper
7631
- .appendTo("body")
7632
- .disableSelection();
7633
-
7634
- } else {
7635
- this.helper = this.element;
7636
- }
7637
-
7638
- },
7639
-
7640
- _change: {
7641
- e: function(event, dx) {
7642
- return { width: this.originalSize.width + dx };
7643
- },
7644
- w: function(event, dx) {
7645
- var cs = this.originalSize, sp = this.originalPosition;
7646
- return { left: sp.left + dx, width: cs.width - dx };
7647
- },
7648
- n: function(event, dx, dy) {
7649
- var cs = this.originalSize, sp = this.originalPosition;
7650
- return { top: sp.top + dy, height: cs.height - dy };
7651
- },
7652
- s: function(event, dx, dy) {
7653
- return { height: this.originalSize.height + dy };
7654
- },
7655
- se: function(event, dx, dy) {
7656
- return $.extend(this._change.s.apply(this, arguments),
7657
- this._change.e.apply(this, [ event, dx, dy ]));
7658
- },
7659
- sw: function(event, dx, dy) {
7660
- return $.extend(this._change.s.apply(this, arguments),
7661
- this._change.w.apply(this, [ event, dx, dy ]));
7662
- },
7663
- ne: function(event, dx, dy) {
7664
- return $.extend(this._change.n.apply(this, arguments),
7665
- this._change.e.apply(this, [ event, dx, dy ]));
7666
- },
7667
- nw: function(event, dx, dy) {
7668
- return $.extend(this._change.n.apply(this, arguments),
7669
- this._change.w.apply(this, [ event, dx, dy ]));
7670
- }
7671
- },
7672
-
7673
- _propagate: function(n, event) {
7674
- $.ui.plugin.call(this, n, [ event, this.ui() ]);
7675
- (n !== "resize" && this._trigger(n, event, this.ui()));
7676
- },
7677
-
7678
- plugins: {},
7679
-
7680
- ui: function() {
7681
- return {
7682
- originalElement: this.originalElement,
7683
- element: this.element,
7684
- helper: this.helper,
7685
- position: this.position,
7686
- size: this.size,
7687
- originalSize: this.originalSize,
7688
- originalPosition: this.originalPosition
7689
- };
7690
- }
7691
-
7692
- });
7693
-
7694
- /*
7695
- * Resizable Extensions
7696
- */
7697
-
7698
- $.ui.plugin.add("resizable", "animate", {
7699
-
7700
- stop: function( event ) {
7701
- var that = $(this).resizable( "instance" ),
7702
- o = that.options,
7703
- pr = that._proportionallyResizeElements,
7704
- ista = pr.length && (/textarea/i).test(pr[0].nodeName),
7705
- soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
7706
- soffsetw = ista ? 0 : that.sizeDiff.width,
7707
- style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
7708
- left = (parseInt(that.element.css("left"), 10) +
7709
- (that.position.left - that.originalPosition.left)) || null,
7710
- top = (parseInt(that.element.css("top"), 10) +
7711
- (that.position.top - that.originalPosition.top)) || null;
7712
-
7713
- that.element.animate(
7714
- $.extend(style, top && left ? { top: top, left: left } : {}), {
7715
- duration: o.animateDuration,
7716
- easing: o.animateEasing,
7717
- step: function() {
7718
-
7719
- var data = {
7720
- width: parseInt(that.element.css("width"), 10),
7721
- height: parseInt(that.element.css("height"), 10),
7722
- top: parseInt(that.element.css("top"), 10),
7723
- left: parseInt(that.element.css("left"), 10)
7724
- };
7725
-
7726
- if (pr && pr.length) {
7727
- $(pr[0]).css({ width: data.width, height: data.height });
7728
- }
7729
-
7730
- // propagating resize, and updating values for each animation step
7731
- that._updateCache(data);
7732
- that._propagate("resize", event);
7733
-
7734
- }
7735
- }
7736
- );
7737
- }
7738
-
7739
- });
7740
-
7741
- $.ui.plugin.add( "resizable", "containment", {
7742
-
7743
- start: function() {
7744
- var element, p, co, ch, cw, width, height,
7745
- that = $( this ).resizable( "instance" ),
7746
- o = that.options,
7747
- el = that.element,
7748
- oc = o.containment,
7749
- ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
7750
-
7751
- if ( !ce ) {
7752
- return;
7753
- }
7754
-
7755
- that.containerElement = $( ce );
7756
-
7757
- if ( /document/.test( oc ) || oc === document ) {
7758
- that.containerOffset = {
7759
- left: 0,
7760
- top: 0
7761
- };
7762
- that.containerPosition = {
7763
- left: 0,
7764
- top: 0
7765
- };
7766
-
7767
- that.parentData = {
7768
- element: $( document ),
7769
- left: 0,
7770
- top: 0,
7771
- width: $( document ).width(),
7772
- height: $( document ).height() || document.body.parentNode.scrollHeight
7773
- };
7774
- } else {
7775
- element = $( ce );
7776
- p = [];
7777
- $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
7778
- p[ i ] = that._num( element.css( "padding" + name ) );
7779
- });
7780
-
7781
- that.containerOffset = element.offset();
7782
- that.containerPosition = element.position();
7783
- that.containerSize = {
7784
- height: ( element.innerHeight() - p[ 3 ] ),
7785
- width: ( element.innerWidth() - p[ 1 ] )
7786
- };
7787
-
7788
- co = that.containerOffset;
7789
- ch = that.containerSize.height;
7790
- cw = that.containerSize.width;
7791
- width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
7792
- height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
7793
-
7794
- that.parentData = {
7795
- element: ce,
7796
- left: co.left,
7797
- top: co.top,
7798
- width: width,
7799
- height: height
7800
- };
7801
- }
7802
- },
7803
-
7804
- resize: function( event ) {
7805
- var woset, hoset, isParent, isOffsetRelative,
7806
- that = $( this ).resizable( "instance" ),
7807
- o = that.options,
7808
- co = that.containerOffset,
7809
- cp = that.position,
7810
- pRatio = that._aspectRatio || event.shiftKey,
7811
- cop = {
7812
- top: 0,
7813
- left: 0
7814
- },
7815
- ce = that.containerElement,
7816
- continueResize = true;
7817
-
7818
- if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
7819
- cop = co;
7820
- }
7821
-
7822
- if ( cp.left < ( that._helper ? co.left : 0 ) ) {
7823
- that.size.width = that.size.width +
7824
- ( that._helper ?
7825
- ( that.position.left - co.left ) :
7826
- ( that.position.left - cop.left ) );
7827
-
7828
- if ( pRatio ) {
7829
- that.size.height = that.size.width / that.aspectRatio;
7830
- continueResize = false;
7831
- }
7832
- that.position.left = o.helper ? co.left : 0;
7833
- }
7834
-
7835
- if ( cp.top < ( that._helper ? co.top : 0 ) ) {
7836
- that.size.height = that.size.height +
7837
- ( that._helper ?
7838
- ( that.position.top - co.top ) :
7839
- that.position.top );
7840
-
7841
- if ( pRatio ) {
7842
- that.size.width = that.size.height * that.aspectRatio;
7843
- continueResize = false;
7844
- }
7845
- that.position.top = that._helper ? co.top : 0;
7846
- }
7847
-
7848
- isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
7849
- isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
7850
-
7851
- if ( isParent && isOffsetRelative ) {
7852
- that.offset.left = that.parentData.left + that.position.left;
7853
- that.offset.top = that.parentData.top + that.position.top;
7854
- } else {
7855
- that.offset.left = that.element.offset().left;
7856
- that.offset.top = that.element.offset().top;
7857
- }
7858
-
7859
- woset = Math.abs( that.sizeDiff.width +
7860
- (that._helper ?
7861
- that.offset.left - cop.left :
7862
- (that.offset.left - co.left)) );
7863
-
7864
- hoset = Math.abs( that.sizeDiff.height +
7865
- (that._helper ?
7866
- that.offset.top - cop.top :
7867
- (that.offset.top - co.top)) );
7868
-
7869
- if ( woset + that.size.width >= that.parentData.width ) {
7870
- that.size.width = that.parentData.width - woset;
7871
- if ( pRatio ) {
7872
- that.size.height = that.size.width / that.aspectRatio;
7873
- continueResize = false;
7874
- }
7875
- }
7876
-
7877
- if ( hoset + that.size.height >= that.parentData.height ) {
7878
- that.size.height = that.parentData.height - hoset;
7879
- if ( pRatio ) {
7880
- that.size.width = that.size.height * that.aspectRatio;
7881
- continueResize = false;
7882
- }
7883
- }
7884
-
7885
- if ( !continueResize ) {
7886
- that.position.left = that.prevPosition.left;
7887
- that.position.top = that.prevPosition.top;
7888
- that.size.width = that.prevSize.width;
7889
- that.size.height = that.prevSize.height;
7890
- }
7891
- },
7892
-
7893
- stop: function() {
7894
- var that = $( this ).resizable( "instance" ),
7895
- o = that.options,
7896
- co = that.containerOffset,
7897
- cop = that.containerPosition,
7898
- ce = that.containerElement,
7899
- helper = $( that.helper ),
7900
- ho = helper.offset(),
7901
- w = helper.outerWidth() - that.sizeDiff.width,
7902
- h = helper.outerHeight() - that.sizeDiff.height;
7903
-
7904
- if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
7905
- $( this ).css({
7906
- left: ho.left - cop.left - co.left,
7907
- width: w,
7908
- height: h
7909
- });
7910
- }
7911
-
7912
- if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
7913
- $( this ).css({
7914
- left: ho.left - cop.left - co.left,
7915
- width: w,
7916
- height: h
7917
- });
7918
- }
7919
- }
7920
- });
7921
-
7922
- $.ui.plugin.add("resizable", "alsoResize", {
7923
-
7924
- start: function() {
7925
- var that = $(this).resizable( "instance" ),
7926
- o = that.options;
7927
-
7928
- $(o.alsoResize).each(function() {
7929
- var el = $(this);
7930
- el.data("ui-resizable-alsoresize", {
7931
- width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
7932
- left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
7933
- });
7934
- });
7935
- },
7936
-
7937
- resize: function(event, ui) {
7938
- var that = $(this).resizable( "instance" ),
7939
- o = that.options,
7940
- os = that.originalSize,
7941
- op = that.originalPosition,
7942
- delta = {
7943
- height: (that.size.height - os.height) || 0,
7944
- width: (that.size.width - os.width) || 0,
7945
- top: (that.position.top - op.top) || 0,
7946
- left: (that.position.left - op.left) || 0
7947
- };
7948
-
7949
- $(o.alsoResize).each(function() {
7950
- var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
7951
- css = el.parents(ui.originalElement[0]).length ?
7952
- [ "width", "height" ] :
7953
- [ "width", "height", "top", "left" ];
7954
-
7955
- $.each(css, function(i, prop) {
7956
- var sum = (start[prop] || 0) + (delta[prop] || 0);
7957
- if (sum && sum >= 0) {
7958
- style[prop] = sum || null;
7959
- }
7960
- });
7961
-
7962
- el.css(style);
7963
- });
7964
- },
7965
-
7966
- stop: function() {
7967
- $(this).removeData("resizable-alsoresize");
7968
- }
7969
- });
7970
-
7971
- $.ui.plugin.add("resizable", "ghost", {
7972
-
7973
- start: function() {
7974
-
7975
- var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
7976
-
7977
- that.ghost = that.originalElement.clone();
7978
- that.ghost
7979
- .css({
7980
- opacity: 0.25,
7981
- display: "block",
7982
- position: "relative",
7983
- height: cs.height,
7984
- width: cs.width,
7985
- margin: 0,
7986
- left: 0,
7987
- top: 0
7988
- })
7989
- .addClass("ui-resizable-ghost")
7990
- .addClass(typeof o.ghost === "string" ? o.ghost : "");
7991
-
7992
- that.ghost.appendTo(that.helper);
7993
-
7994
- },
7995
-
7996
- resize: function() {
7997
- var that = $(this).resizable( "instance" );
7998
- if (that.ghost) {
7999
- that.ghost.css({
8000
- position: "relative",
8001
- height: that.size.height,
8002
- width: that.size.width
8003
- });
8004
- }
8005
- },
8006
-
8007
- stop: function() {
8008
- var that = $(this).resizable( "instance" );
8009
- if (that.ghost && that.helper) {
8010
- that.helper.get(0).removeChild(that.ghost.get(0));
8011
- }
8012
- }
8013
-
8014
- });
8015
-
8016
- $.ui.plugin.add("resizable", "grid", {
8017
-
8018
- resize: function() {
8019
- var outerDimensions,
8020
- that = $(this).resizable( "instance" ),
8021
- o = that.options,
8022
- cs = that.size,
8023
- os = that.originalSize,
8024
- op = that.originalPosition,
8025
- a = that.axis,
8026
- grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
8027
- gridX = (grid[0] || 1),
8028
- gridY = (grid[1] || 1),
8029
- ox = Math.round((cs.width - os.width) / gridX) * gridX,
8030
- oy = Math.round((cs.height - os.height) / gridY) * gridY,
8031
- newWidth = os.width + ox,
8032
- newHeight = os.height + oy,
8033
- isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
8034
- isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
8035
- isMinWidth = o.minWidth && (o.minWidth > newWidth),
8036
- isMinHeight = o.minHeight && (o.minHeight > newHeight);
8037
-
8038
- o.grid = grid;
8039
-
8040
- if (isMinWidth) {
8041
- newWidth += gridX;
8042
- }
8043
- if (isMinHeight) {
8044
- newHeight += gridY;
8045
- }
8046
- if (isMaxWidth) {
8047
- newWidth -= gridX;
8048
- }
8049
- if (isMaxHeight) {
8050
- newHeight -= gridY;
8051
- }
8052
-
8053
- if (/^(se|s|e)$/.test(a)) {
8054
- that.size.width = newWidth;
8055
- that.size.height = newHeight;
8056
- } else if (/^(ne)$/.test(a)) {
8057
- that.size.width = newWidth;
8058
- that.size.height = newHeight;
8059
- that.position.top = op.top - oy;
8060
- } else if (/^(sw)$/.test(a)) {
8061
- that.size.width = newWidth;
8062
- that.size.height = newHeight;
8063
- that.position.left = op.left - ox;
8064
- } else {
8065
- if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
8066
- outerDimensions = that._getPaddingPlusBorderDimensions( this );
8067
- }
8068
-
8069
- if ( newHeight - gridY > 0 ) {
8070
- that.size.height = newHeight;
8071
- that.position.top = op.top - oy;
8072
- } else {
8073
- newHeight = gridY - outerDimensions.height;
8074
- that.size.height = newHeight;
8075
- that.position.top = op.top + os.height - newHeight;
8076
- }
8077
- if ( newWidth - gridX > 0 ) {
8078
- that.size.width = newWidth;
8079
- that.position.left = op.left - ox;
8080
- } else {
8081
- newWidth = gridX - outerDimensions.width;
8082
- that.size.width = newWidth;
8083
- that.position.left = op.left + os.width - newWidth;
8084
- }
8085
- }
8086
- }
8087
-
8088
- });
8089
-
8090
- var resizable = $.ui.resizable;
8091
-
8092
-
8093
- /*!
8094
- * jQuery UI Dialog 1.11.4
8095
- * http://jqueryui.com
8096
- *
8097
- * Copyright jQuery Foundation and other contributors
8098
- * Released under the MIT license.
8099
- * http://jquery.org/license
8100
- *
8101
- * http://api.jqueryui.com/dialog/
8102
- */
8103
-
8104
-
8105
- var dialog = $.widget( "ui.dialog", {
8106
- version: "1.11.4",
8107
- options: {
8108
- appendTo: "body",
8109
- autoOpen: true,
8110
- buttons: [],
8111
- closeOnEscape: true,
8112
- closeText: "Close",
8113
- dialogClass: "",
8114
- draggable: true,
8115
- hide: null,
8116
- height: "auto",
8117
- maxHeight: null,
8118
- maxWidth: null,
8119
- minHeight: 150,
8120
- minWidth: 150,
8121
- modal: false,
8122
- position: {
8123
- my: "center",
8124
- at: "center",
8125
- of: window,
8126
- collision: "fit",
8127
- // Ensure the titlebar is always visible
8128
- using: function( pos ) {
8129
- var topOffset = $( this ).css( pos ).offset().top;
8130
- if ( topOffset < 0 ) {
8131
- $( this ).css( "top", pos.top - topOffset );
8132
- }
8133
- }
8134
- },
8135
- resizable: true,
8136
- show: null,
8137
- title: null,
8138
- width: 300,
8139
-
8140
- // callbacks
8141
- beforeClose: null,
8142
- close: null,
8143
- drag: null,
8144
- dragStart: null,
8145
- dragStop: null,
8146
- focus: null,
8147
- open: null,
8148
- resize: null,
8149
- resizeStart: null,
8150
- resizeStop: null
8151
- },
8152
-
8153
- sizeRelatedOptions: {
8154
- buttons: true,
8155
- height: true,
8156
- maxHeight: true,
8157
- maxWidth: true,
8158
- minHeight: true,
8159
- minWidth: true,
8160
- width: true
8161
- },
8162
-
8163
- resizableRelatedOptions: {
8164
- maxHeight: true,
8165
- maxWidth: true,
8166
- minHeight: true,
8167
- minWidth: true
8168
- },
8169
-
8170
- _create: function() {
8171
- this.originalCss = {
8172
- display: this.element[ 0 ].style.display,
8173
- width: this.element[ 0 ].style.width,
8174
- minHeight: this.element[ 0 ].style.minHeight,
8175
- maxHeight: this.element[ 0 ].style.maxHeight,
8176
- height: this.element[ 0 ].style.height
8177
- };
8178
- this.originalPosition = {
8179
- parent: this.element.parent(),
8180
- index: this.element.parent().children().index( this.element )
8181
- };
8182
- this.originalTitle = this.element.attr( "title" );
8183
- this.options.title = this.options.title || this.originalTitle;
8184
-
8185
- this._createWrapper();
8186
-
8187
- this.element
8188
- .show()
8189
- .removeAttr( "title" )
8190
- .addClass( "ui-dialog-content ui-widget-content" )
8191
- .appendTo( this.uiDialog );
8192
-
8193
- this._createTitlebar();
8194
- this._createButtonPane();
8195
-
8196
- if ( this.options.draggable && $.fn.draggable ) {
8197
- this._makeDraggable();
8198
- }
8199
- if ( this.options.resizable && $.fn.resizable ) {
8200
- this._makeResizable();
8201
- }
8202
-
8203
- this._isOpen = false;
8204
-
8205
- this._trackFocus();
8206
- },
8207
-
8208
- _init: function() {
8209
- if ( this.options.autoOpen ) {
8210
- this.open();
8211
- }
8212
- },
8213
-
8214
- _appendTo: function() {
8215
- var element = this.options.appendTo;
8216
- if ( element && (element.jquery || element.nodeType) ) {
8217
- return $( element );
8218
- }
8219
- return this.document.find( element || "body" ).eq( 0 );
8220
- },
8221
-
8222
- _destroy: function() {
8223
- var next,
8224
- originalPosition = this.originalPosition;
8225
-
8226
- this._untrackInstance();
8227
- this._destroyOverlay();
8228
-
8229
- this.element
8230
- .removeUniqueId()
8231
- .removeClass( "ui-dialog-content ui-widget-content" )
8232
- .css( this.originalCss )
8233
- // Without detaching first, the following becomes really slow
8234
- .detach();
8235
-
8236
- this.uiDialog.stop( true, true ).remove();
8237
-
8238
- if ( this.originalTitle ) {
8239
- this.element.attr( "title", this.originalTitle );
8240
- }
8241
-
8242
- next = originalPosition.parent.children().eq( originalPosition.index );
8243
- // Don't try to place the dialog next to itself (#8613)
8244
- if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
8245
- next.before( this.element );
8246
- } else {
8247
- originalPosition.parent.append( this.element );
8248
- }
8249
- },
8250
-
8251
- widget: function() {
8252
- return this.uiDialog;
8253
- },
8254
-
8255
- disable: $.noop,
8256
- enable: $.noop,
8257
-
8258
- close: function( event ) {
8259
- var activeElement,
8260
- that = this;
8261
-
8262
- if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
8263
- return;
8264
- }
8265
-
8266
- this._isOpen = false;
8267
- this._focusedElement = null;
8268
- this._destroyOverlay();
8269
- this._untrackInstance();
8270
-
8271
- if ( !this.opener.filter( ":focusable" ).focus().length ) {
8272
-
8273
- // support: IE9
8274
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
8275
- try {
8276
- activeElement = this.document[ 0 ].activeElement;
8277
-
8278
- // Support: IE9, IE10
8279
- // If the <body> is blurred, IE will switch windows, see #4520
8280
- if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
8281
-
8282
- // Hiding a focused element doesn't trigger blur in WebKit
8283
- // so in case we have nothing to focus on, explicitly blur the active element
8284
- // https://bugs.webkit.org/show_bug.cgi?id=47182
8285
- $( activeElement ).blur();
8286
- }
8287
- } catch ( error ) {}
8288
- }
8289
-
8290
- this._hide( this.uiDialog, this.options.hide, function() {
8291
- that._trigger( "close", event );
8292
- });
8293
- },
8294
-
8295
- isOpen: function() {
8296
- return this._isOpen;
8297
- },
8298
-
8299
- moveToTop: function() {
8300
- this._moveToTop();
8301
- },
8302
-
8303
- _moveToTop: function( event, silent ) {
8304
- var moved = false,
8305
- zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
8306
- return +$( this ).css( "z-index" );
8307
- }).get(),
8308
- zIndexMax = Math.max.apply( null, zIndices );
8309
-
8310
- if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
8311
- this.uiDialog.css( "z-index", zIndexMax + 1 );
8312
- moved = true;
8313
- }
8314
-
8315
- if ( moved && !silent ) {
8316
- this._trigger( "focus", event );
8317
- }
8318
- return moved;
8319
- },
8320
-
8321
- open: function() {
8322
- var that = this;
8323
- if ( this._isOpen ) {
8324
- if ( this._moveToTop() ) {
8325
- this._focusTabbable();
8326
- }
8327
- return;
8328
- }
8329
-
8330
- this._isOpen = true;
8331
- this.opener = $( this.document[ 0 ].activeElement );
8332
-
8333
- this._size();
8334
- this._position();
8335
- this._createOverlay();
8336
- this._moveToTop( null, true );
8337
-
8338
- // Ensure the overlay is moved to the top with the dialog, but only when
8339
- // opening. The overlay shouldn't move after the dialog is open so that
8340
- // modeless dialogs opened after the modal dialog stack properly.
8341
- if ( this.overlay ) {
8342
- this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
8343
- }
8344
-
8345
- this._show( this.uiDialog, this.options.show, function() {
8346
- that._focusTabbable();
8347
- that._trigger( "focus" );
8348
- });
8349
-
8350
- // Track the dialog immediately upon openening in case a focus event
8351
- // somehow occurs outside of the dialog before an element inside the
8352
- // dialog is focused (#10152)
8353
- this._makeFocusTarget();
8354
-
8355
- this._trigger( "open" );
8356
- },
8357
-
8358
- _focusTabbable: function() {
8359
- // Set focus to the first match:
8360
- // 1. An element that was focused previously
8361
- // 2. First element inside the dialog matching [autofocus]
8362
- // 3. Tabbable element inside the content element
8363
- // 4. Tabbable element inside the buttonpane
8364
- // 5. The close button
8365
- // 6. The dialog itself
8366
- var hasFocus = this._focusedElement;
8367
- if ( !hasFocus ) {
8368
- hasFocus = this.element.find( "[autofocus]" );
8369
- }
8370
- if ( !hasFocus.length ) {
8371
- hasFocus = this.element.find( ":tabbable" );
8372
- }
8373
- if ( !hasFocus.length ) {
8374
- hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
8375
- }
8376
- if ( !hasFocus.length ) {
8377
- hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
8378
- }
8379
- if ( !hasFocus.length ) {
8380
- hasFocus = this.uiDialog;
8381
- }
8382
- hasFocus.eq( 0 ).focus();
8383
- },
8384
-
8385
- _keepFocus: function( event ) {
8386
- function checkFocus() {
8387
- var activeElement = this.document[0].activeElement,
8388
- isActive = this.uiDialog[0] === activeElement ||
8389
- $.contains( this.uiDialog[0], activeElement );
8390
- if ( !isActive ) {
8391
- this._focusTabbable();
8392
- }
8393
- }
8394
- event.preventDefault();
8395
- checkFocus.call( this );
8396
- // support: IE
8397
- // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
8398
- // so we check again later
8399
- this._delay( checkFocus );
8400
- },
8401
-
8402
- _createWrapper: function() {
8403
- this.uiDialog = $("<div>")
8404
- .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
8405
- this.options.dialogClass )
8406
- .hide()
8407
- .attr({
8408
- // Setting tabIndex makes the div focusable
8409
- tabIndex: -1,
8410
- role: "dialog"
8411
- })
8412
- .appendTo( this._appendTo() );
8413
-
8414
- this._on( this.uiDialog, {
8415
- keydown: function( event ) {
8416
- if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
8417
- event.keyCode === $.ui.keyCode.ESCAPE ) {
8418
- event.preventDefault();
8419
- this.close( event );
8420
- return;
8421
- }
8422
-
8423
- // prevent tabbing out of dialogs
8424
- if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
8425
- return;
8426
- }
8427
- var tabbables = this.uiDialog.find( ":tabbable" ),
8428
- first = tabbables.filter( ":first" ),
8429
- last = tabbables.filter( ":last" );
8430
-
8431
- if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
8432
- this._delay(function() {
8433
- first.focus();
8434
- });
8435
- event.preventDefault();
8436
- } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
8437
- this._delay(function() {
8438
- last.focus();
8439
- });
8440
- event.preventDefault();
8441
- }
8442
- },
8443
- mousedown: function( event ) {
8444
- if ( this._moveToTop( event ) ) {
8445
- this._focusTabbable();
8446
- }
8447
- }
8448
- });
8449
-
8450
- // We assume that any existing aria-describedby attribute means
8451
- // that the dialog content is marked up properly
8452
- // otherwise we brute force the content as the description
8453
- if ( !this.element.find( "[aria-describedby]" ).length ) {
8454
- this.uiDialog.attr({
8455
- "aria-describedby": this.element.uniqueId().attr( "id" )
8456
- });
8457
- }
8458
- },
8459
-
8460
- _createTitlebar: function() {
8461
- var uiDialogTitle;
8462
-
8463
- this.uiDialogTitlebar = $( "<div>" )
8464
- .addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
8465
- .prependTo( this.uiDialog );
8466
- this._on( this.uiDialogTitlebar, {
8467
- mousedown: function( event ) {
8468
- // Don't prevent click on close button (#8838)
8469
- // Focusing a dialog that is partially scrolled out of view
8470
- // causes the browser to scroll it into view, preventing the click event
8471
- if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
8472
- // Dialog isn't getting focus when dragging (#8063)
8473
- this.uiDialog.focus();
8474
- }
8475
- }
8476
- });
8477
-
8478
- // support: IE
8479
- // Use type="button" to prevent enter keypresses in textboxes from closing the
8480
- // dialog in IE (#9312)
8481
- this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
8482
- .button({
8483
- label: this.options.closeText,
8484
- icons: {
8485
- primary: "ui-icon-closethick"
8486
- },
8487
- text: false
8488
- })
8489
- .addClass( "ui-dialog-titlebar-close" )
8490
- .appendTo( this.uiDialogTitlebar );
8491
- this._on( this.uiDialogTitlebarClose, {
8492
- click: function( event ) {
8493
- event.preventDefault();
8494
- this.close( event );
8495
- }
8496
- });
8497
-
8498
- uiDialogTitle = $( "<span>" )
8499
- .uniqueId()
8500
- .addClass( "ui-dialog-title" )
8501
- .prependTo( this.uiDialogTitlebar );
8502
- this._title( uiDialogTitle );
8503
-
8504
- this.uiDialog.attr({
8505
- "aria-labelledby": uiDialogTitle.attr( "id" )
8506
- });
8507
- },
8508
-
8509
- _title: function( title ) {
8510
- if ( !this.options.title ) {
8511
- title.html( "&#160;" );
8512
- }
8513
- title.text( this.options.title );
8514
- },
8515
-
8516
- _createButtonPane: function() {
8517
- this.uiDialogButtonPane = $( "<div>" )
8518
- .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
8519
-
8520
- this.uiButtonSet = $( "<div>" )
8521
- .addClass( "ui-dialog-buttonset" )
8522
- .appendTo( this.uiDialogButtonPane );
8523
-
8524
- this._createButtons();
8525
- },
8526
-
8527
- _createButtons: function() {
8528
- var that = this,
8529
- buttons = this.options.buttons;
8530
-
8531
- // if we already have a button pane, remove it
8532
- this.uiDialogButtonPane.remove();
8533
- this.uiButtonSet.empty();
8534
-
8535
- if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
8536
- this.uiDialog.removeClass( "ui-dialog-buttons" );
8537
- return;
8538
- }
8539
-
8540
- $.each( buttons, function( name, props ) {
8541
- var click, buttonOptions;
8542
- props = $.isFunction( props ) ?
8543
- { click: props, text: name } :
8544
- props;
8545
- // Default to a non-submitting button
8546
- props = $.extend( { type: "button" }, props );
8547
- // Change the context for the click callback to be the main element
8548
- click = props.click;
8549
- props.click = function() {
8550
- click.apply( that.element[ 0 ], arguments );
8551
- };
8552
- buttonOptions = {
8553
- icons: props.icons,
8554
- text: props.showText
8555
- };
8556
- delete props.icons;
8557
- delete props.showText;
8558
- $( "<button></button>", props )
8559
- .button( buttonOptions )
8560
- .appendTo( that.uiButtonSet );
8561
- });
8562
- this.uiDialog.addClass( "ui-dialog-buttons" );
8563
- this.uiDialogButtonPane.appendTo( this.uiDialog );
8564
- },
8565
-
8566
- _makeDraggable: function() {
8567
- var that = this,
8568
- options = this.options;
8569
-
8570
- function filteredUi( ui ) {
8571
- return {
8572
- position: ui.position,
8573
- offset: ui.offset
8574
- };
8575
- }
8576
-
8577
- this.uiDialog.draggable({
8578
- cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
8579
- handle: ".ui-dialog-titlebar",
8580
- containment: "document",
8581
- start: function( event, ui ) {
8582
- $( this ).addClass( "ui-dialog-dragging" );
8583
- that._blockFrames();
8584
- that._trigger( "dragStart", event, filteredUi( ui ) );
8585
- },
8586
- drag: function( event, ui ) {
8587
- that._trigger( "drag", event, filteredUi( ui ) );
8588
- },
8589
- stop: function( event, ui ) {
8590
- var left = ui.offset.left - that.document.scrollLeft(),
8591
- top = ui.offset.top - that.document.scrollTop();
8592
-
8593
- options.position = {
8594
- my: "left top",
8595
- at: "left" + (left >= 0 ? "+" : "") + left + " " +
8596
- "top" + (top >= 0 ? "+" : "") + top,
8597
- of: that.window
8598
- };
8599
- $( this ).removeClass( "ui-dialog-dragging" );
8600
- that._unblockFrames();
8601
- that._trigger( "dragStop", event, filteredUi( ui ) );
8602
- }
8603
- });
8604
- },
8605
-
8606
- _makeResizable: function() {
8607
- var that = this,
8608
- options = this.options,
8609
- handles = options.resizable,
8610
- // .ui-resizable has position: relative defined in the stylesheet
8611
- // but dialogs have to use absolute or fixed positioning
8612
- position = this.uiDialog.css("position"),
8613
- resizeHandles = typeof handles === "string" ?
8614
- handles :
8615
- "n,e,s,w,se,sw,ne,nw";
8616
-
8617
- function filteredUi( ui ) {
8618
- return {
8619
- originalPosition: ui.originalPosition,
8620
- originalSize: ui.originalSize,
8621
- position: ui.position,
8622
- size: ui.size
8623
- };
8624
- }
8625
-
8626
- this.uiDialog.resizable({
8627
- cancel: ".ui-dialog-content",
8628
- containment: "document",
8629
- alsoResize: this.element,
8630
- maxWidth: options.maxWidth,
8631
- maxHeight: options.maxHeight,
8632
- minWidth: options.minWidth,
8633
- minHeight: this._minHeight(),
8634
- handles: resizeHandles,
8635
- start: function( event, ui ) {
8636
- $( this ).addClass( "ui-dialog-resizing" );
8637
- that._blockFrames();
8638
- that._trigger( "resizeStart", event, filteredUi( ui ) );
8639
- },
8640
- resize: function( event, ui ) {
8641
- that._trigger( "resize", event, filteredUi( ui ) );
8642
- },
8643
- stop: function( event, ui ) {
8644
- var offset = that.uiDialog.offset(),
8645
- left = offset.left - that.document.scrollLeft(),
8646
- top = offset.top - that.document.scrollTop();
8647
-
8648
- options.height = that.uiDialog.height();
8649
- options.width = that.uiDialog.width();
8650
- options.position = {
8651
- my: "left top",
8652
- at: "left" + (left >= 0 ? "+" : "") + left + " " +
8653
- "top" + (top >= 0 ? "+" : "") + top,
8654
- of: that.window
8655
- };
8656
- $( this ).removeClass( "ui-dialog-resizing" );
8657
- that._unblockFrames();
8658
- that._trigger( "resizeStop", event, filteredUi( ui ) );
8659
- }
8660
- })
8661
- .css( "position", position );
8662
- },
8663
-
8664
- _trackFocus: function() {
8665
- this._on( this.widget(), {
8666
- focusin: function( event ) {
8667
- this._makeFocusTarget();
8668
- this._focusedElement = $( event.target );
8669
- }
8670
- });
8671
- },
8672
-
8673
- _makeFocusTarget: function() {
8674
- this._untrackInstance();
8675
- this._trackingInstances().unshift( this );
8676
- },
8677
-
8678
- _untrackInstance: function() {
8679
- var instances = this._trackingInstances(),
8680
- exists = $.inArray( this, instances );
8681
- if ( exists !== -1 ) {
8682
- instances.splice( exists, 1 );
8683
- }
8684
- },
8685
-
8686
- _trackingInstances: function() {
8687
- var instances = this.document.data( "ui-dialog-instances" );
8688
- if ( !instances ) {
8689
- instances = [];
8690
- this.document.data( "ui-dialog-instances", instances );
8691
- }
8692
- return instances;
8693
- },
8694
-
8695
- _minHeight: function() {
8696
- var options = this.options;
8697
-
8698
- return options.height === "auto" ?
8699
- options.minHeight :
8700
- Math.min( options.minHeight, options.height );
8701
- },
8702
-
8703
- _position: function() {
8704
- // Need to show the dialog to get the actual offset in the position plugin
8705
- var isVisible = this.uiDialog.is( ":visible" );
8706
- if ( !isVisible ) {
8707
- this.uiDialog.show();
8708
- }
8709
- this.uiDialog.position( this.options.position );
8710
- if ( !isVisible ) {
8711
- this.uiDialog.hide();
8712
- }
8713
- },
8714
-
8715
- _setOptions: function( options ) {
8716
- var that = this,
8717
- resize = false,
8718
- resizableOptions = {};
8719
-
8720
- $.each( options, function( key, value ) {
8721
- that._setOption( key, value );
8722
-
8723
- if ( key in that.sizeRelatedOptions ) {
8724
- resize = true;
8725
- }
8726
- if ( key in that.resizableRelatedOptions ) {
8727
- resizableOptions[ key ] = value;
8728
- }
8729
- });
8730
-
8731
- if ( resize ) {
8732
- this._size();
8733
- this._position();
8734
- }
8735
- if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
8736
- this.uiDialog.resizable( "option", resizableOptions );
8737
- }
8738
- },
8739
-
8740
- _setOption: function( key, value ) {
8741
- var isDraggable, isResizable,
8742
- uiDialog = this.uiDialog;
8743
-
8744
- if ( key === "dialogClass" ) {
8745
- uiDialog
8746
- .removeClass( this.options.dialogClass )
8747
- .addClass( value );
8748
- }
8749
-
8750
- if ( key === "disabled" ) {
8751
- return;
8752
- }
8753
-
8754
- this._super( key, value );
8755
-
8756
- if ( key === "appendTo" ) {
8757
- this.uiDialog.appendTo( this._appendTo() );
8758
- }
8759
-
8760
- if ( key === "buttons" ) {
8761
- this._createButtons();
8762
- }
8763
-
8764
- if ( key === "closeText" ) {
8765
- this.uiDialogTitlebarClose.button({
8766
- // Ensure that we always pass a string
8767
- label: "" + value
8768
- });
8769
- }
8770
-
8771
- if ( key === "draggable" ) {
8772
- isDraggable = uiDialog.is( ":data(ui-draggable)" );
8773
- if ( isDraggable && !value ) {
8774
- uiDialog.draggable( "destroy" );
8775
- }
8776
-
8777
- if ( !isDraggable && value ) {
8778
- this._makeDraggable();
8779
- }
8780
- }
8781
-
8782
- if ( key === "position" ) {
8783
- this._position();
8784
- }
8785
-
8786
- if ( key === "resizable" ) {
8787
- // currently resizable, becoming non-resizable
8788
- isResizable = uiDialog.is( ":data(ui-resizable)" );
8789
- if ( isResizable && !value ) {
8790
- uiDialog.resizable( "destroy" );
8791
- }
8792
-
8793
- // currently resizable, changing handles
8794
- if ( isResizable && typeof value === "string" ) {
8795
- uiDialog.resizable( "option", "handles", value );
8796
- }
8797
-
8798
- // currently non-resizable, becoming resizable
8799
- if ( !isResizable && value !== false ) {
8800
- this._makeResizable();
8801
- }
8802
- }
8803
-
8804
- if ( key === "title" ) {
8805
- this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
8806
- }
8807
- },
8808
-
8809
- _size: function() {
8810
- // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
8811
- // divs will both have width and height set, so we need to reset them
8812
- var nonContentHeight, minContentHeight, maxContentHeight,
8813
- options = this.options;
8814
-
8815
- // Reset content sizing
8816
- this.element.show().css({
8817
- width: "auto",
8818
- minHeight: 0,
8819
- maxHeight: "none",
8820
- height: 0
8821
- });
8822
-
8823
- if ( options.minWidth > options.width ) {
8824
- options.width = options.minWidth;
8825
- }
8826
-
8827
- // reset wrapper sizing
8828
- // determine the height of all the non-content elements
8829
- nonContentHeight = this.uiDialog.css({
8830
- height: "auto",
8831
- width: options.width
8832
- })
8833
- .outerHeight();
8834
- minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
8835
- maxContentHeight = typeof options.maxHeight === "number" ?
8836
- Math.max( 0, options.maxHeight - nonContentHeight ) :
8837
- "none";
8838
-
8839
- if ( options.height === "auto" ) {
8840
- this.element.css({
8841
- minHeight: minContentHeight,
8842
- maxHeight: maxContentHeight,
8843
- height: "auto"
8844
- });
8845
- } else {
8846
- this.element.height( Math.max( 0, options.height - nonContentHeight ) );
8847
- }
8848
-
8849
- if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
8850
- this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
8851
- }
8852
- },
8853
-
8854
- _blockFrames: function() {
8855
- this.iframeBlocks = this.document.find( "iframe" ).map(function() {
8856
- var iframe = $( this );
8857
-
8858
- return $( "<div>" )
8859
- .css({
8860
- position: "absolute",
8861
- width: iframe.outerWidth(),
8862
- height: iframe.outerHeight()
8863
- })
8864
- .appendTo( iframe.parent() )
8865
- .offset( iframe.offset() )[0];
8866
- });
8867
- },
8868
-
8869
- _unblockFrames: function() {
8870
- if ( this.iframeBlocks ) {
8871
- this.iframeBlocks.remove();
8872
- delete this.iframeBlocks;
8873
- }
8874
- },
8875
-
8876
- _allowInteraction: function( event ) {
8877
- if ( $( event.target ).closest( ".ui-dialog" ).length ) {
8878
- return true;
8879
- }
8880
-
8881
- // TODO: Remove hack when datepicker implements
8882
- // the .ui-front logic (#8989)
8883
- return !!$( event.target ).closest( ".ui-datepicker" ).length;
8884
- },
8885
-
8886
- _createOverlay: function() {
8887
- if ( !this.options.modal ) {
8888
- return;
8889
- }
8890
-
8891
- // We use a delay in case the overlay is created from an
8892
- // event that we're going to be cancelling (#2804)
8893
- var isOpening = true;
8894
- this._delay(function() {
8895
- isOpening = false;
8896
- });
8897
-
8898
- if ( !this.document.data( "ui-dialog-overlays" ) ) {
8899
-
8900
- // Prevent use of anchors and inputs
8901
- // Using _on() for an event handler shared across many instances is
8902
- // safe because the dialogs stack and must be closed in reverse order
8903
- this._on( this.document, {
8904
- focusin: function( event ) {
8905
- if ( isOpening ) {
8906
- return;
8907
- }
8908
-
8909
- if ( !this._allowInteraction( event ) ) {
8910
- event.preventDefault();
8911
- this._trackingInstances()[ 0 ]._focusTabbable();
8912
- }
8913
- }
8914
- });
8915
- }
8916
-
8917
- this.overlay = $( "<div>" )
8918
- .addClass( "ui-widget-overlay ui-front" )
8919
- .appendTo( this._appendTo() );
8920
- this._on( this.overlay, {
8921
- mousedown: "_keepFocus"
8922
- });
8923
- this.document.data( "ui-dialog-overlays",
8924
- (this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
8925
- },
8926
-
8927
- _destroyOverlay: function() {
8928
- if ( !this.options.modal ) {
8929
- return;
8930
- }
8931
-
8932
- if ( this.overlay ) {
8933
- var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
8934
-
8935
- if ( !overlays ) {
8936
- this.document
8937
- .unbind( "focusin" )
8938
- .removeData( "ui-dialog-overlays" );
8939
- } else {
8940
- this.document.data( "ui-dialog-overlays", overlays );
8941
- }
8942
-
8943
- this.overlay.remove();
8944
- this.overlay = null;
8945
- }
8946
- }
8947
- });
8948
-
8949
-
8950
- /*!
8951
- * jQuery UI Droppable 1.11.4
8952
- * http://jqueryui.com
8953
- *
8954
- * Copyright jQuery Foundation and other contributors
8955
- * Released under the MIT license.
8956
- * http://jquery.org/license
8957
- *
8958
- * http://api.jqueryui.com/droppable/
8959
- */
8960
-
8961
-
8962
- $.widget( "ui.droppable", {
8963
- version: "1.11.4",
8964
- widgetEventPrefix: "drop",
8965
- options: {
8966
- accept: "*",
8967
- activeClass: false,
8968
- addClasses: true,
8969
- greedy: false,
8970
- hoverClass: false,
8971
- scope: "default",
8972
- tolerance: "intersect",
8973
-
8974
- // callbacks
8975
- activate: null,
8976
- deactivate: null,
8977
- drop: null,
8978
- out: null,
8979
- over: null
8980
- },
8981
- _create: function() {
8982
-
8983
- var proportions,
8984
- o = this.options,
8985
- accept = o.accept;
8986
-
8987
- this.isover = false;
8988
- this.isout = true;
8989
-
8990
- this.accept = $.isFunction( accept ) ? accept : function( d ) {
8991
- return d.is( accept );
8992
- };
8993
-
8994
- this.proportions = function( /* valueToWrite */ ) {
8995
- if ( arguments.length ) {
8996
- // Store the droppable's proportions
8997
- proportions = arguments[ 0 ];
8998
- } else {
8999
- // Retrieve or derive the droppable's proportions
9000
- return proportions ?
9001
- proportions :
9002
- proportions = {
9003
- width: this.element[ 0 ].offsetWidth,
9004
- height: this.element[ 0 ].offsetHeight
9005
- };
9006
- }
9007
- };
9008
-
9009
- this._addToManager( o.scope );
9010
-
9011
- o.addClasses && this.element.addClass( "ui-droppable" );
9012
-
9013
- },
9014
-
9015
- _addToManager: function( scope ) {
9016
- // Add the reference and positions to the manager
9017
- $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
9018
- $.ui.ddmanager.droppables[ scope ].push( this );
9019
- },
9020
-
9021
- _splice: function( drop ) {
9022
- var i = 0;
9023
- for ( ; i < drop.length; i++ ) {
9024
- if ( drop[ i ] === this ) {
9025
- drop.splice( i, 1 );
9026
- }
9027
- }
9028
- },
9029
-
9030
- _destroy: function() {
9031
- var drop = $.ui.ddmanager.droppables[ this.options.scope ];
9032
-
9033
- this._splice( drop );
9034
-
9035
- this.element.removeClass( "ui-droppable ui-droppable-disabled" );
9036
- },
9037
-
9038
- _setOption: function( key, value ) {
9039
-
9040
- if ( key === "accept" ) {
9041
- this.accept = $.isFunction( value ) ? value : function( d ) {
9042
- return d.is( value );
9043
- };
9044
- } else if ( key === "scope" ) {
9045
- var drop = $.ui.ddmanager.droppables[ this.options.scope ];
9046
-
9047
- this._splice( drop );
9048
- this._addToManager( value );
9049
- }
9050
-
9051
- this._super( key, value );
9052
- },
9053
-
9054
- _activate: function( event ) {
9055
- var draggable = $.ui.ddmanager.current;
9056
- if ( this.options.activeClass ) {
9057
- this.element.addClass( this.options.activeClass );
9058
- }
9059
- if ( draggable ){
9060
- this._trigger( "activate", event, this.ui( draggable ) );
9061
- }
9062
- },
9063
-
9064
- _deactivate: function( event ) {
9065
- var draggable = $.ui.ddmanager.current;
9066
- if ( this.options.activeClass ) {
9067
- this.element.removeClass( this.options.activeClass );
9068
- }
9069
- if ( draggable ){
9070
- this._trigger( "deactivate", event, this.ui( draggable ) );
9071
- }
9072
- },
9073
-
9074
- _over: function( event ) {
9075
-
9076
- var draggable = $.ui.ddmanager.current;
9077
-
9078
- // Bail if draggable and droppable are same element
9079
- if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9080
- return;
9081
- }
9082
-
9083
- if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9084
- if ( this.options.hoverClass ) {
9085
- this.element.addClass( this.options.hoverClass );
9086
- }
9087
- this._trigger( "over", event, this.ui( draggable ) );
9088
- }
9089
-
9090
- },
9091
-
9092
- _out: function( event ) {
9093
-
9094
- var draggable = $.ui.ddmanager.current;
9095
-
9096
- // Bail if draggable and droppable are same element
9097
- if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9098
- return;
9099
- }
9100
-
9101
- if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9102
- if ( this.options.hoverClass ) {
9103
- this.element.removeClass( this.options.hoverClass );
9104
- }
9105
- this._trigger( "out", event, this.ui( draggable ) );
9106
- }
9107
-
9108
- },
9109
-
9110
- _drop: function( event, custom ) {
9111
-
9112
- var draggable = custom || $.ui.ddmanager.current,
9113
- childrenIntersection = false;
9114
-
9115
- // Bail if draggable and droppable are same element
9116
- if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9117
- return false;
9118
- }
9119
-
9120
- this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
9121
- var inst = $( this ).droppable( "instance" );
9122
- if (
9123
- inst.options.greedy &&
9124
- !inst.options.disabled &&
9125
- inst.options.scope === draggable.options.scope &&
9126
- inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
9127
- $.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
9128
- ) { childrenIntersection = true; return false; }
9129
- });
9130
- if ( childrenIntersection ) {
9131
- return false;
9132
- }
9133
-
9134
- if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9135
- if ( this.options.activeClass ) {
9136
- this.element.removeClass( this.options.activeClass );
9137
- }
9138
- if ( this.options.hoverClass ) {
9139
- this.element.removeClass( this.options.hoverClass );
9140
- }
9141
- this._trigger( "drop", event, this.ui( draggable ) );
9142
- return this.element;
9143
- }
9144
-
9145
- return false;
9146
-
9147
- },
9148
-
9149
- ui: function( c ) {
9150
- return {
9151
- draggable: ( c.currentItem || c.element ),
9152
- helper: c.helper,
9153
- position: c.position,
9154
- offset: c.positionAbs
9155
- };
9156
- }
9157
-
9158
- });
9159
-
9160
- $.ui.intersect = (function() {
9161
- function isOverAxis( x, reference, size ) {
9162
- return ( x >= reference ) && ( x < ( reference + size ) );
9163
- }
9164
-
9165
- return function( draggable, droppable, toleranceMode, event ) {
9166
-
9167
- if ( !droppable.offset ) {
9168
- return false;
9169
- }
9170
-
9171
- var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
9172
- y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
9173
- x2 = x1 + draggable.helperProportions.width,
9174
- y2 = y1 + draggable.helperProportions.height,
9175
- l = droppable.offset.left,
9176
- t = droppable.offset.top,
9177
- r = l + droppable.proportions().width,
9178
- b = t + droppable.proportions().height;
9179
-
9180
- switch ( toleranceMode ) {
9181
- case "fit":
9182
- return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
9183
- case "intersect":
9184
- return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
9185
- x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
9186
- t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
9187
- y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
9188
- case "pointer":
9189
- return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
9190
- case "touch":
9191
- return (
9192
- ( y1 >= t && y1 <= b ) || // Top edge touching
9193
- ( y2 >= t && y2 <= b ) || // Bottom edge touching
9194
- ( y1 < t && y2 > b ) // Surrounded vertically
9195
- ) && (
9196
- ( x1 >= l && x1 <= r ) || // Left edge touching
9197
- ( x2 >= l && x2 <= r ) || // Right edge touching
9198
- ( x1 < l && x2 > r ) // Surrounded horizontally
9199
- );
9200
- default:
9201
- return false;
9202
- }
9203
- };
9204
- })();
9205
-
9206
- /*
9207
- This manager tracks offsets of draggables and droppables
9208
- */
9209
- $.ui.ddmanager = {
9210
- current: null,
9211
- droppables: { "default": [] },
9212
- prepareOffsets: function( t, event ) {
9213
-
9214
- var i, j,
9215
- m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
9216
- type = event ? event.type : null, // workaround for #2317
9217
- list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
9218
-
9219
- droppablesLoop: for ( i = 0; i < m.length; i++ ) {
9220
-
9221
- // No disabled and non-accepted
9222
- if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
9223
- continue;
9224
- }
9225
-
9226
- // Filter out elements in the current dragged item
9227
- for ( j = 0; j < list.length; j++ ) {
9228
- if ( list[ j ] === m[ i ].element[ 0 ] ) {
9229
- m[ i ].proportions().height = 0;
9230
- continue droppablesLoop;
9231
- }
9232
- }
9233
-
9234
- m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
9235
- if ( !m[ i ].visible ) {
9236
- continue;
9237
- }
9238
-
9239
- // Activate the droppable if used directly from draggables
9240
- if ( type === "mousedown" ) {
9241
- m[ i ]._activate.call( m[ i ], event );
9242
- }
9243
-
9244
- m[ i ].offset = m[ i ].element.offset();
9245
- m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
9246
-
9247
- }
9248
-
9249
- },
9250
- drop: function( draggable, event ) {
9251
-
9252
- var dropped = false;
9253
- // Create a copy of the droppables in case the list changes during the drop (#9116)
9254
- $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
9255
-
9256
- if ( !this.options ) {
9257
- return;
9258
- }
9259
- if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
9260
- dropped = this._drop.call( this, event ) || dropped;
9261
- }
9262
-
9263
- if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9264
- this.isout = true;
9265
- this.isover = false;
9266
- this._deactivate.call( this, event );
9267
- }
9268
-
9269
- });
9270
- return dropped;
9271
-
9272
- },
9273
- dragStart: function( draggable, event ) {
9274
- // Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
9275
- draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
9276
- if ( !draggable.options.refreshPositions ) {
9277
- $.ui.ddmanager.prepareOffsets( draggable, event );
9278
- }
9279
- });
9280
- },
9281
- drag: function( draggable, event ) {
9282
-
9283
- // If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
9284
- if ( draggable.options.refreshPositions ) {
9285
- $.ui.ddmanager.prepareOffsets( draggable, event );
9286
- }
9287
-
9288
- // Run through all droppables and check their positions based on specific tolerance options
9289
- $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
9290
-
9291
- if ( this.options.disabled || this.greedyChild || !this.visible ) {
9292
- return;
9293
- }
9294
-
9295
- var parentInstance, scope, parent,
9296
- intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
9297
- c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
9298
- if ( !c ) {
9299
- return;
9300
- }
9301
-
9302
- if ( this.options.greedy ) {
9303
- // find droppable parents with same scope
9304
- scope = this.options.scope;
9305
- parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
9306
- return $( this ).droppable( "instance" ).options.scope === scope;
9307
- });
9308
-
9309
- if ( parent.length ) {
9310
- parentInstance = $( parent[ 0 ] ).droppable( "instance" );
9311
- parentInstance.greedyChild = ( c === "isover" );
9312
- }
9313
- }
9314
-
9315
- // we just moved into a greedy child
9316
- if ( parentInstance && c === "isover" ) {
9317
- parentInstance.isover = false;
9318
- parentInstance.isout = true;
9319
- parentInstance._out.call( parentInstance, event );
9320
- }
9321
-
9322
- this[ c ] = true;
9323
- this[c === "isout" ? "isover" : "isout"] = false;
9324
- this[c === "isover" ? "_over" : "_out"].call( this, event );
9325
-
9326
- // we just moved out of a greedy child
9327
- if ( parentInstance && c === "isout" ) {
9328
- parentInstance.isout = false;
9329
- parentInstance.isover = true;
9330
- parentInstance._over.call( parentInstance, event );
9331
- }
9332
- });
9333
-
9334
- },
9335
- dragStop: function( draggable, event ) {
9336
- draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
9337
- // Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
9338
- if ( !draggable.options.refreshPositions ) {
9339
- $.ui.ddmanager.prepareOffsets( draggable, event );
9340
- }
9341
- }
9342
- };
9343
-
9344
- var droppable = $.ui.droppable;
9345
-
9346
-
9347
- /*!
9348
- * jQuery UI Effects 1.11.4
9349
- * http://jqueryui.com
9350
- *
9351
- * Copyright jQuery Foundation and other contributors
9352
- * Released under the MIT license.
9353
- * http://jquery.org/license
9354
- *
9355
- * http://api.jqueryui.com/category/effects-core/
9356
- */
9357
-
9358
-
9359
- var dataSpace = "ui-effects-",
9360
-
9361
- // Create a local jQuery because jQuery Color relies on it and the
9362
- // global may not exist with AMD and a custom build (#10199)
9363
- jQuery = $;
9364
-
9365
- $.effects = {
9366
- effect: {}
9367
- };
9368
-
9369
- /*!
9370
- * jQuery Color Animations v2.1.2
9371
- * https://github.com/jquery/jquery-color
9372
- *
9373
- * Copyright 2014 jQuery Foundation and other contributors
9374
- * Released under the MIT license.
9375
- * http://jquery.org/license
9376
- *
9377
- * Date: Wed Jan 16 08:47:09 2013 -0600
9378
- */
9379
- (function( jQuery, undefined ) {
9380
-
9381
- var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
9382
-
9383
- // plusequals test for += 100 -= 100
9384
- rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
9385
- // a set of RE's that can match strings and generate color tuples.
9386
- stringParsers = [ {
9387
- re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9388
- parse: function( execResult ) {
9389
- return [
9390
- execResult[ 1 ],
9391
- execResult[ 2 ],
9392
- execResult[ 3 ],
9393
- execResult[ 4 ]
9394
- ];
9395
- }
9396
- }, {
9397
- re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9398
- parse: function( execResult ) {
9399
- return [
9400
- execResult[ 1 ] * 2.55,
9401
- execResult[ 2 ] * 2.55,
9402
- execResult[ 3 ] * 2.55,
9403
- execResult[ 4 ]
9404
- ];
9405
- }
9406
- }, {
9407
- // this regex ignores A-F because it's compared against an already lowercased string
9408
- re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
9409
- parse: function( execResult ) {
9410
- return [
9411
- parseInt( execResult[ 1 ], 16 ),
9412
- parseInt( execResult[ 2 ], 16 ),
9413
- parseInt( execResult[ 3 ], 16 )
9414
- ];
9415
- }
9416
- }, {
9417
- // this regex ignores A-F because it's compared against an already lowercased string
9418
- re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
9419
- parse: function( execResult ) {
9420
- return [
9421
- parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
9422
- parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
9423
- parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
9424
- ];
9425
- }
9426
- }, {
9427
- re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9428
- space: "hsla",
9429
- parse: function( execResult ) {
9430
- return [
9431
- execResult[ 1 ],
9432
- execResult[ 2 ] / 100,
9433
- execResult[ 3 ] / 100,
9434
- execResult[ 4 ]
9435
- ];
9436
- }
9437
- } ],
9438
-
9439
- // jQuery.Color( )
9440
- color = jQuery.Color = function( color, green, blue, alpha ) {
9441
- return new jQuery.Color.fn.parse( color, green, blue, alpha );
9442
- },
9443
- spaces = {
9444
- rgba: {
9445
- props: {
9446
- red: {
9447
- idx: 0,
9448
- type: "byte"
9449
- },
9450
- green: {
9451
- idx: 1,
9452
- type: "byte"
9453
- },
9454
- blue: {
9455
- idx: 2,
9456
- type: "byte"
9457
- }
9458
- }
9459
- },
9460
-
9461
- hsla: {
9462
- props: {
9463
- hue: {
9464
- idx: 0,
9465
- type: "degrees"
9466
- },
9467
- saturation: {
9468
- idx: 1,
9469
- type: "percent"
9470
- },
9471
- lightness: {
9472
- idx: 2,
9473
- type: "percent"
9474
- }
9475
- }
9476
- }
9477
- },
9478
- propTypes = {
9479
- "byte": {
9480
- floor: true,
9481
- max: 255
9482
- },
9483
- "percent": {
9484
- max: 1
9485
- },
9486
- "degrees": {
9487
- mod: 360,
9488
- floor: true
9489
- }
9490
- },
9491
- support = color.support = {},
9492
-
9493
- // element for support tests
9494
- supportElem = jQuery( "<p>" )[ 0 ],
9495
-
9496
- // colors = jQuery.Color.names
9497
- colors,
9498
-
9499
- // local aliases of functions called often
9500
- each = jQuery.each;
9501
-
9502
- // determine rgba support immediately
9503
- supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
9504
- support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
9505
-
9506
- // define cache name and alpha properties
9507
- // for rgba and hsla spaces
9508
- each( spaces, function( spaceName, space ) {
9509
- space.cache = "_" + spaceName;
9510
- space.props.alpha = {
9511
- idx: 3,
9512
- type: "percent",
9513
- def: 1
9514
- };
9515
- });
9516
-
9517
- function clamp( value, prop, allowEmpty ) {
9518
- var type = propTypes[ prop.type ] || {};
9519
-
9520
- if ( value == null ) {
9521
- return (allowEmpty || !prop.def) ? null : prop.def;
9522
- }
9523
-
9524
- // ~~ is an short way of doing floor for positive numbers
9525
- value = type.floor ? ~~value : parseFloat( value );
9526
-
9527
- // IE will pass in empty strings as value for alpha,
9528
- // which will hit this case
9529
- if ( isNaN( value ) ) {
9530
- return prop.def;
9531
- }
9532
-
9533
- if ( type.mod ) {
9534
- // we add mod before modding to make sure that negatives values
9535
- // get converted properly: -10 -> 350
9536
- return (value + type.mod) % type.mod;
9537
- }
9538
-
9539
- // for now all property types without mod have min and max
9540
- return 0 > value ? 0 : type.max < value ? type.max : value;
9541
- }
9542
-
9543
- function stringParse( string ) {
9544
- var inst = color(),
9545
- rgba = inst._rgba = [];
9546
-
9547
- string = string.toLowerCase();
9548
-
9549
- each( stringParsers, function( i, parser ) {
9550
- var parsed,
9551
- match = parser.re.exec( string ),
9552
- values = match && parser.parse( match ),
9553
- spaceName = parser.space || "rgba";
9554
-
9555
- if ( values ) {
9556
- parsed = inst[ spaceName ]( values );
9557
-
9558
- // if this was an rgba parse the assignment might happen twice
9559
- // oh well....
9560
- inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
9561
- rgba = inst._rgba = parsed._rgba;
9562
-
9563
- // exit each( stringParsers ) here because we matched
9564
- return false;
9565
- }
9566
- });
9567
-
9568
- // Found a stringParser that handled it
9569
- if ( rgba.length ) {
9570
-
9571
- // if this came from a parsed string, force "transparent" when alpha is 0
9572
- // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
9573
- if ( rgba.join() === "0,0,0,0" ) {
9574
- jQuery.extend( rgba, colors.transparent );
9575
- }
9576
- return inst;
9577
- }
9578
-
9579
- // named colors
9580
- return colors[ string ];
9581
- }
9582
-
9583
- color.fn = jQuery.extend( color.prototype, {
9584
- parse: function( red, green, blue, alpha ) {
9585
- if ( red === undefined ) {
9586
- this._rgba = [ null, null, null, null ];
9587
- return this;
9588
- }
9589
- if ( red.jquery || red.nodeType ) {
9590
- red = jQuery( red ).css( green );
9591
- green = undefined;
9592
- }
9593
-
9594
- var inst = this,
9595
- type = jQuery.type( red ),
9596
- rgba = this._rgba = [];
9597
-
9598
- // more than 1 argument specified - assume ( red, green, blue, alpha )
9599
- if ( green !== undefined ) {
9600
- red = [ red, green, blue, alpha ];
9601
- type = "array";
9602
- }
9603
-
9604
- if ( type === "string" ) {
9605
- return this.parse( stringParse( red ) || colors._default );
9606
- }
9607
-
9608
- if ( type === "array" ) {
9609
- each( spaces.rgba.props, function( key, prop ) {
9610
- rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
9611
- });
9612
- return this;
9613
- }
9614
-
9615
- if ( type === "object" ) {
9616
- if ( red instanceof color ) {
9617
- each( spaces, function( spaceName, space ) {
9618
- if ( red[ space.cache ] ) {
9619
- inst[ space.cache ] = red[ space.cache ].slice();
9620
- }
9621
- });
9622
- } else {
9623
- each( spaces, function( spaceName, space ) {
9624
- var cache = space.cache;
9625
- each( space.props, function( key, prop ) {
9626
-
9627
- // if the cache doesn't exist, and we know how to convert
9628
- if ( !inst[ cache ] && space.to ) {
9629
-
9630
- // if the value was null, we don't need to copy it
9631
- // if the key was alpha, we don't need to copy it either
9632
- if ( key === "alpha" || red[ key ] == null ) {
9633
- return;
9634
- }
9635
- inst[ cache ] = space.to( inst._rgba );
9636
- }
9637
-
9638
- // this is the only case where we allow nulls for ALL properties.
9639
- // call clamp with alwaysAllowEmpty
9640
- inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
9641
- });
9642
-
9643
- // everything defined but alpha?
9644
- if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
9645
- // use the default of 1
9646
- inst[ cache ][ 3 ] = 1;
9647
- if ( space.from ) {
9648
- inst._rgba = space.from( inst[ cache ] );
9649
- }
9650
- }
9651
- });
9652
- }
9653
- return this;
9654
- }
9655
- },
9656
- is: function( compare ) {
9657
- var is = color( compare ),
9658
- same = true,
9659
- inst = this;
9660
-
9661
- each( spaces, function( _, space ) {
9662
- var localCache,
9663
- isCache = is[ space.cache ];
9664
- if (isCache) {
9665
- localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
9666
- each( space.props, function( _, prop ) {
9667
- if ( isCache[ prop.idx ] != null ) {
9668
- same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
9669
- return same;
9670
- }
9671
- });
9672
- }
9673
- return same;
9674
- });
9675
- return same;
9676
- },
9677
- _space: function() {
9678
- var used = [],
9679
- inst = this;
9680
- each( spaces, function( spaceName, space ) {
9681
- if ( inst[ space.cache ] ) {
9682
- used.push( spaceName );
9683
- }
9684
- });
9685
- return used.pop();
9686
- },
9687
- transition: function( other, distance ) {
9688
- var end = color( other ),
9689
- spaceName = end._space(),
9690
- space = spaces[ spaceName ],
9691
- startColor = this.alpha() === 0 ? color( "transparent" ) : this,
9692
- start = startColor[ space.cache ] || space.to( startColor._rgba ),
9693
- result = start.slice();
9694
-
9695
- end = end[ space.cache ];
9696
- each( space.props, function( key, prop ) {
9697
- var index = prop.idx,
9698
- startValue = start[ index ],
9699
- endValue = end[ index ],
9700
- type = propTypes[ prop.type ] || {};
9701
-
9702
- // if null, don't override start value
9703
- if ( endValue === null ) {
9704
- return;
9705
- }
9706
- // if null - use end
9707
- if ( startValue === null ) {
9708
- result[ index ] = endValue;
9709
- } else {
9710
- if ( type.mod ) {
9711
- if ( endValue - startValue > type.mod / 2 ) {
9712
- startValue += type.mod;
9713
- } else if ( startValue - endValue > type.mod / 2 ) {
9714
- startValue -= type.mod;
9715
- }
9716
- }
9717
- result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
9718
- }
9719
- });
9720
- return this[ spaceName ]( result );
9721
- },
9722
- blend: function( opaque ) {
9723
- // if we are already opaque - return ourself
9724
- if ( this._rgba[ 3 ] === 1 ) {
9725
- return this;
9726
- }
9727
-
9728
- var rgb = this._rgba.slice(),
9729
- a = rgb.pop(),
9730
- blend = color( opaque )._rgba;
9731
-
9732
- return color( jQuery.map( rgb, function( v, i ) {
9733
- return ( 1 - a ) * blend[ i ] + a * v;
9734
- }));
9735
- },
9736
- toRgbaString: function() {
9737
- var prefix = "rgba(",
9738
- rgba = jQuery.map( this._rgba, function( v, i ) {
9739
- return v == null ? ( i > 2 ? 1 : 0 ) : v;
9740
- });
9741
-
9742
- if ( rgba[ 3 ] === 1 ) {
9743
- rgba.pop();
9744
- prefix = "rgb(";
9745
- }
9746
-
9747
- return prefix + rgba.join() + ")";
9748
- },
9749
- toHslaString: function() {
9750
- var prefix = "hsla(",
9751
- hsla = jQuery.map( this.hsla(), function( v, i ) {
9752
- if ( v == null ) {
9753
- v = i > 2 ? 1 : 0;
9754
- }
9755
-
9756
- // catch 1 and 2
9757
- if ( i && i < 3 ) {
9758
- v = Math.round( v * 100 ) + "%";
9759
- }
9760
- return v;
9761
- });
9762
-
9763
- if ( hsla[ 3 ] === 1 ) {
9764
- hsla.pop();
9765
- prefix = "hsl(";
9766
- }
9767
- return prefix + hsla.join() + ")";
9768
- },
9769
- toHexString: function( includeAlpha ) {
9770
- var rgba = this._rgba.slice(),
9771
- alpha = rgba.pop();
9772
-
9773
- if ( includeAlpha ) {
9774
- rgba.push( ~~( alpha * 255 ) );
9775
- }
9776
-
9777
- return "#" + jQuery.map( rgba, function( v ) {
9778
-
9779
- // default to 0 when nulls exist
9780
- v = ( v || 0 ).toString( 16 );
9781
- return v.length === 1 ? "0" + v : v;
9782
- }).join("");
9783
- },
9784
- toString: function() {
9785
- return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
9786
- }
9787
- });
9788
- color.fn.parse.prototype = color.fn;
9789
-
9790
- // hsla conversions adapted from:
9791
- // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
9792
-
9793
- function hue2rgb( p, q, h ) {
9794
- h = ( h + 1 ) % 1;
9795
- if ( h * 6 < 1 ) {
9796
- return p + ( q - p ) * h * 6;
9797
- }
9798
- if ( h * 2 < 1) {
9799
- return q;
9800
- }
9801
- if ( h * 3 < 2 ) {
9802
- return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
9803
- }
9804
- return p;
9805
- }
9806
-
9807
- spaces.hsla.to = function( rgba ) {
9808
- if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
9809
- return [ null, null, null, rgba[ 3 ] ];
9810
- }
9811
- var r = rgba[ 0 ] / 255,
9812
- g = rgba[ 1 ] / 255,
9813
- b = rgba[ 2 ] / 255,
9814
- a = rgba[ 3 ],
9815
- max = Math.max( r, g, b ),
9816
- min = Math.min( r, g, b ),
9817
- diff = max - min,
9818
- add = max + min,
9819
- l = add * 0.5,
9820
- h, s;
9821
-
9822
- if ( min === max ) {
9823
- h = 0;
9824
- } else if ( r === max ) {
9825
- h = ( 60 * ( g - b ) / diff ) + 360;
9826
- } else if ( g === max ) {
9827
- h = ( 60 * ( b - r ) / diff ) + 120;
9828
- } else {
9829
- h = ( 60 * ( r - g ) / diff ) + 240;
9830
- }
9831
-
9832
- // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
9833
- // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
9834
- if ( diff === 0 ) {
9835
- s = 0;
9836
- } else if ( l <= 0.5 ) {
9837
- s = diff / add;
9838
- } else {
9839
- s = diff / ( 2 - add );
9840
- }
9841
- return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
9842
- };
9843
-
9844
- spaces.hsla.from = function( hsla ) {
9845
- if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
9846
- return [ null, null, null, hsla[ 3 ] ];
9847
- }
9848
- var h = hsla[ 0 ] / 360,
9849
- s = hsla[ 1 ],
9850
- l = hsla[ 2 ],
9851
- a = hsla[ 3 ],
9852
- q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
9853
- p = 2 * l - q;
9854
-
9855
- return [
9856
- Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
9857
- Math.round( hue2rgb( p, q, h ) * 255 ),
9858
- Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
9859
- a
9860
- ];
9861
- };
9862
-
9863
- each( spaces, function( spaceName, space ) {
9864
- var props = space.props,
9865
- cache = space.cache,
9866
- to = space.to,
9867
- from = space.from;
9868
-
9869
- // makes rgba() and hsla()
9870
- color.fn[ spaceName ] = function( value ) {
9871
-
9872
- // generate a cache for this space if it doesn't exist
9873
- if ( to && !this[ cache ] ) {
9874
- this[ cache ] = to( this._rgba );
9875
- }
9876
- if ( value === undefined ) {
9877
- return this[ cache ].slice();
9878
- }
9879
-
9880
- var ret,
9881
- type = jQuery.type( value ),
9882
- arr = ( type === "array" || type === "object" ) ? value : arguments,
9883
- local = this[ cache ].slice();
9884
-
9885
- each( props, function( key, prop ) {
9886
- var val = arr[ type === "object" ? key : prop.idx ];
9887
- if ( val == null ) {
9888
- val = local[ prop.idx ];
9889
- }
9890
- local[ prop.idx ] = clamp( val, prop );
9891
- });
9892
-
9893
- if ( from ) {
9894
- ret = color( from( local ) );
9895
- ret[ cache ] = local;
9896
- return ret;
9897
- } else {
9898
- return color( local );
9899
- }
9900
- };
9901
-
9902
- // makes red() green() blue() alpha() hue() saturation() lightness()
9903
- each( props, function( key, prop ) {
9904
- // alpha is included in more than one space
9905
- if ( color.fn[ key ] ) {
9906
- return;
9907
- }
9908
- color.fn[ key ] = function( value ) {
9909
- var vtype = jQuery.type( value ),
9910
- fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
9911
- local = this[ fn ](),
9912
- cur = local[ prop.idx ],
9913
- match;
9914
-
9915
- if ( vtype === "undefined" ) {
9916
- return cur;
9917
- }
9918
-
9919
- if ( vtype === "function" ) {
9920
- value = value.call( this, cur );
9921
- vtype = jQuery.type( value );
9922
- }
9923
- if ( value == null && prop.empty ) {
9924
- return this;
9925
- }
9926
- if ( vtype === "string" ) {
9927
- match = rplusequals.exec( value );
9928
- if ( match ) {
9929
- value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
9930
- }
9931
- }
9932
- local[ prop.idx ] = value;
9933
- return this[ fn ]( local );
9934
- };
9935
- });
9936
- });
9937
-
9938
- // add cssHook and .fx.step function for each named hook.
9939
- // accept a space separated string of properties
9940
- color.hook = function( hook ) {
9941
- var hooks = hook.split( " " );
9942
- each( hooks, function( i, hook ) {
9943
- jQuery.cssHooks[ hook ] = {
9944
- set: function( elem, value ) {
9945
- var parsed, curElem,
9946
- backgroundColor = "";
9947
-
9948
- if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
9949
- value = color( parsed || value );
9950
- if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
9951
- curElem = hook === "backgroundColor" ? elem.parentNode : elem;
9952
- while (
9953
- (backgroundColor === "" || backgroundColor === "transparent") &&
9954
- curElem && curElem.style
9955
- ) {
9956
- try {
9957
- backgroundColor = jQuery.css( curElem, "backgroundColor" );
9958
- curElem = curElem.parentNode;
9959
- } catch ( e ) {
9960
- }
9961
- }
9962
-
9963
- value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
9964
- backgroundColor :
9965
- "_default" );
9966
- }
9967
-
9968
- value = value.toRgbaString();
9969
- }
9970
- try {
9971
- elem.style[ hook ] = value;
9972
- } catch ( e ) {
9973
- // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
9974
- }
9975
- }
9976
- };
9977
- jQuery.fx.step[ hook ] = function( fx ) {
9978
- if ( !fx.colorInit ) {
9979
- fx.start = color( fx.elem, hook );
9980
- fx.end = color( fx.end );
9981
- fx.colorInit = true;
9982
- }
9983
- jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
9984
- };
9985
- });
9986
-
9987
- };
9988
-
9989
- color.hook( stepHooks );
9990
-
9991
- jQuery.cssHooks.borderColor = {
9992
- expand: function( value ) {
9993
- var expanded = {};
9994
-
9995
- each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
9996
- expanded[ "border" + part + "Color" ] = value;
9997
- });
9998
- return expanded;
9999
- }
10000
- };
10001
-
10002
- // Basic color names only.
10003
- // Usage of any of the other color names requires adding yourself or including
10004
- // jquery.color.svg-names.js.
10005
- colors = jQuery.Color.names = {
10006
- // 4.1. Basic color keywords
10007
- aqua: "#00ffff",
10008
- black: "#000000",
10009
- blue: "#0000ff",
10010
- fuchsia: "#ff00ff",
10011
- gray: "#808080",
10012
- green: "#008000",
10013
- lime: "#00ff00",
10014
- maroon: "#800000",
10015
- navy: "#000080",
10016
- olive: "#808000",
10017
- purple: "#800080",
10018
- red: "#ff0000",
10019
- silver: "#c0c0c0",
10020
- teal: "#008080",
10021
- white: "#ffffff",
10022
- yellow: "#ffff00",
10023
-
10024
- // 4.2.3. "transparent" color keyword
10025
- transparent: [ null, null, null, 0 ],
10026
-
10027
- _default: "#ffffff"
10028
- };
10029
-
10030
- })( jQuery );
10031
-
10032
- /******************************************************************************/
10033
- /****************************** CLASS ANIMATIONS ******************************/
10034
- /******************************************************************************/
10035
- (function() {
10036
-
10037
- var classAnimationActions = [ "add", "remove", "toggle" ],
10038
- shorthandStyles = {
10039
- border: 1,
10040
- borderBottom: 1,
10041
- borderColor: 1,
10042
- borderLeft: 1,
10043
- borderRight: 1,
10044
- borderTop: 1,
10045
- borderWidth: 1,
10046
- margin: 1,
10047
- padding: 1
10048
- };
10049
-
10050
- $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
10051
- $.fx.step[ prop ] = function( fx ) {
10052
- if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
10053
- jQuery.style( fx.elem, prop, fx.end );
10054
- fx.setAttr = true;
10055
- }
10056
- };
10057
- });
10058
-
10059
- function getElementStyles( elem ) {
10060
- var key, len,
10061
- style = elem.ownerDocument.defaultView ?
10062
- elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
10063
- elem.currentStyle,
10064
- styles = {};
10065
-
10066
- if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
10067
- len = style.length;
10068
- while ( len-- ) {
10069
- key = style[ len ];
10070
- if ( typeof style[ key ] === "string" ) {
10071
- styles[ $.camelCase( key ) ] = style[ key ];
10072
- }
10073
- }
10074
- // support: Opera, IE <9
10075
- } else {
10076
- for ( key in style ) {
10077
- if ( typeof style[ key ] === "string" ) {
10078
- styles[ key ] = style[ key ];
10079
- }
10080
- }
10081
- }
10082
-
10083
- return styles;
10084
- }
10085
-
10086
- function styleDifference( oldStyle, newStyle ) {
10087
- var diff = {},
10088
- name, value;
10089
-
10090
- for ( name in newStyle ) {
10091
- value = newStyle[ name ];
10092
- if ( oldStyle[ name ] !== value ) {
10093
- if ( !shorthandStyles[ name ] ) {
10094
- if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
10095
- diff[ name ] = value;
10096
- }
10097
- }
10098
- }
10099
- }
10100
-
10101
- return diff;
10102
- }
10103
-
10104
- // support: jQuery <1.8
10105
- if ( !$.fn.addBack ) {
10106
- $.fn.addBack = function( selector ) {
10107
- return this.add( selector == null ?
10108
- this.prevObject : this.prevObject.filter( selector )
10109
- );
10110
- };
10111
- }
10112
-
10113
- $.effects.animateClass = function( value, duration, easing, callback ) {
10114
- var o = $.speed( duration, easing, callback );
10115
-
10116
- return this.queue( function() {
10117
- var animated = $( this ),
10118
- baseClass = animated.attr( "class" ) || "",
10119
- applyClassChange,
10120
- allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
10121
-
10122
- // map the animated objects to store the original styles.
10123
- allAnimations = allAnimations.map(function() {
10124
- var el = $( this );
10125
- return {
10126
- el: el,
10127
- start: getElementStyles( this )
10128
- };
10129
- });
10130
-
10131
- // apply class change
10132
- applyClassChange = function() {
10133
- $.each( classAnimationActions, function(i, action) {
10134
- if ( value[ action ] ) {
10135
- animated[ action + "Class" ]( value[ action ] );
10136
- }
10137
- });
10138
- };
10139
- applyClassChange();
10140
-
10141
- // map all animated objects again - calculate new styles and diff
10142
- allAnimations = allAnimations.map(function() {
10143
- this.end = getElementStyles( this.el[ 0 ] );
10144
- this.diff = styleDifference( this.start, this.end );
10145
- return this;
10146
- });
10147
-
10148
- // apply original class
10149
- animated.attr( "class", baseClass );
10150
-
10151
- // map all animated objects again - this time collecting a promise
10152
- allAnimations = allAnimations.map(function() {
10153
- var styleInfo = this,
10154
- dfd = $.Deferred(),
10155
- opts = $.extend({}, o, {
10156
- queue: false,
10157
- complete: function() {
10158
- dfd.resolve( styleInfo );
10159
- }
10160
- });
10161
-
10162
- this.el.animate( this.diff, opts );
10163
- return dfd.promise();
10164
- });
10165
-
10166
- // once all animations have completed:
10167
- $.when.apply( $, allAnimations.get() ).done(function() {
10168
-
10169
- // set the final class
10170
- applyClassChange();
10171
-
10172
- // for each animated element,
10173
- // clear all css properties that were animated
10174
- $.each( arguments, function() {
10175
- var el = this.el;
10176
- $.each( this.diff, function(key) {
10177
- el.css( key, "" );
10178
- });
10179
- });
10180
-
10181
- // this is guarnteed to be there if you use jQuery.speed()
10182
- // it also handles dequeuing the next anim...
10183
- o.complete.call( animated[ 0 ] );
10184
- });
10185
- });
10186
- };
10187
-
10188
- $.fn.extend({
10189
- addClass: (function( orig ) {
10190
- return function( classNames, speed, easing, callback ) {
10191
- return speed ?
10192
- $.effects.animateClass.call( this,
10193
- { add: classNames }, speed, easing, callback ) :
10194
- orig.apply( this, arguments );
10195
- };
10196
- })( $.fn.addClass ),
10197
-
10198
- removeClass: (function( orig ) {
10199
- return function( classNames, speed, easing, callback ) {
10200
- return arguments.length > 1 ?
10201
- $.effects.animateClass.call( this,
10202
- { remove: classNames }, speed, easing, callback ) :
10203
- orig.apply( this, arguments );
10204
- };
10205
- })( $.fn.removeClass ),
10206
-
10207
- toggleClass: (function( orig ) {
10208
- return function( classNames, force, speed, easing, callback ) {
10209
- if ( typeof force === "boolean" || force === undefined ) {
10210
- if ( !speed ) {
10211
- // without speed parameter
10212
- return orig.apply( this, arguments );
10213
- } else {
10214
- return $.effects.animateClass.call( this,
10215
- (force ? { add: classNames } : { remove: classNames }),
10216
- speed, easing, callback );
10217
- }
10218
- } else {
10219
- // without force parameter
10220
- return $.effects.animateClass.call( this,
10221
- { toggle: classNames }, force, speed, easing );
10222
- }
10223
- };
10224
- })( $.fn.toggleClass ),
10225
-
10226
- switchClass: function( remove, add, speed, easing, callback) {
10227
- return $.effects.animateClass.call( this, {
10228
- add: add,
10229
- remove: remove
10230
- }, speed, easing, callback );
10231
- }
10232
- });
10233
-
10234
- })();
10235
-
10236
- /******************************************************************************/
10237
- /*********************************** EFFECTS **********************************/
10238
- /******************************************************************************/
10239
-
10240
- (function() {
10241
-
10242
- $.extend( $.effects, {
10243
- version: "1.11.4",
10244
-
10245
- // Saves a set of properties in a data storage
10246
- save: function( element, set ) {
10247
- for ( var i = 0; i < set.length; i++ ) {
10248
- if ( set[ i ] !== null ) {
10249
- element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
10250
- }
10251
- }
10252
- },
10253
-
10254
- // Restores a set of previously saved properties from a data storage
10255
- restore: function( element, set ) {
10256
- var val, i;
10257
- for ( i = 0; i < set.length; i++ ) {
10258
- if ( set[ i ] !== null ) {
10259
- val = element.data( dataSpace + set[ i ] );
10260
- // support: jQuery 1.6.2
10261
- // http://bugs.jquery.com/ticket/9917
10262
- // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
10263
- // We can't differentiate between "" and 0 here, so we just assume
10264
- // empty string since it's likely to be a more common value...
10265
- if ( val === undefined ) {
10266
- val = "";
10267
- }
10268
- element.css( set[ i ], val );
10269
- }
10270
- }
10271
- },
10272
-
10273
- setMode: function( el, mode ) {
10274
- if (mode === "toggle") {
10275
- mode = el.is( ":hidden" ) ? "show" : "hide";
10276
- }
10277
- return mode;
10278
- },
10279
-
10280
- // Translates a [top,left] array into a baseline value
10281
- // this should be a little more flexible in the future to handle a string & hash
10282
- getBaseline: function( origin, original ) {
10283
- var y, x;
10284
- switch ( origin[ 0 ] ) {
10285
- case "top": y = 0; break;
10286
- case "middle": y = 0.5; break;
10287
- case "bottom": y = 1; break;
10288
- default: y = origin[ 0 ] / original.height;
10289
- }
10290
- switch ( origin[ 1 ] ) {
10291
- case "left": x = 0; break;
10292
- case "center": x = 0.5; break;
10293
- case "right": x = 1; break;
10294
- default: x = origin[ 1 ] / original.width;
10295
- }
10296
- return {
10297
- x: x,
10298
- y: y
10299
- };
10300
- },
10301
-
10302
- // Wraps the element around a wrapper that copies position properties
10303
- createWrapper: function( element ) {
10304
-
10305
- // if the element is already wrapped, return it
10306
- if ( element.parent().is( ".ui-effects-wrapper" )) {
10307
- return element.parent();
10308
- }
10309
-
10310
- // wrap the element
10311
- var props = {
10312
- width: element.outerWidth(true),
10313
- height: element.outerHeight(true),
10314
- "float": element.css( "float" )
10315
- },
10316
- wrapper = $( "<div></div>" )
10317
- .addClass( "ui-effects-wrapper" )
10318
- .css({
10319
- fontSize: "100%",
10320
- background: "transparent",
10321
- border: "none",
10322
- margin: 0,
10323
- padding: 0
10324
- }),
10325
- // Store the size in case width/height are defined in % - Fixes #5245
10326
- size = {
10327
- width: element.width(),
10328
- height: element.height()
10329
- },
10330
- active = document.activeElement;
10331
-
10332
- // support: Firefox
10333
- // Firefox incorrectly exposes anonymous content
10334
- // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
10335
- try {
10336
- active.id;
10337
- } catch ( e ) {
10338
- active = document.body;
10339
- }
10340
-
10341
- element.wrap( wrapper );
10342
-
10343
- // Fixes #7595 - Elements lose focus when wrapped.
10344
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
10345
- $( active ).focus();
10346
- }
10347
-
10348
- wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
10349
-
10350
- // transfer positioning properties to the wrapper
10351
- if ( element.css( "position" ) === "static" ) {
10352
- wrapper.css({ position: "relative" });
10353
- element.css({ position: "relative" });
10354
- } else {
10355
- $.extend( props, {
10356
- position: element.css( "position" ),
10357
- zIndex: element.css( "z-index" )
10358
- });
10359
- $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
10360
- props[ pos ] = element.css( pos );
10361
- if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
10362
- props[ pos ] = "auto";
10363
- }
10364
- });
10365
- element.css({
10366
- position: "relative",
10367
- top: 0,
10368
- left: 0,
10369
- right: "auto",
10370
- bottom: "auto"
10371
- });
10372
- }
10373
- element.css(size);
10374
-
10375
- return wrapper.css( props ).show();
10376
- },
10377
-
10378
- removeWrapper: function( element ) {
10379
- var active = document.activeElement;
10380
-
10381
- if ( element.parent().is( ".ui-effects-wrapper" ) ) {
10382
- element.parent().replaceWith( element );
10383
-
10384
- // Fixes #7595 - Elements lose focus when wrapped.
10385
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
10386
- $( active ).focus();
10387
- }
10388
- }
10389
-
10390
- return element;
10391
- },
10392
-
10393
- setTransition: function( element, list, factor, value ) {
10394
- value = value || {};
10395
- $.each( list, function( i, x ) {
10396
- var unit = element.cssUnit( x );
10397
- if ( unit[ 0 ] > 0 ) {
10398
- value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
10399
- }
10400
- });
10401
- return value;
10402
- }
10403
- });
10404
-
10405
- // return an effect options object for the given parameters:
10406
- function _normalizeArguments( effect, options, speed, callback ) {
10407
-
10408
- // allow passing all options as the first parameter
10409
- if ( $.isPlainObject( effect ) ) {
10410
- options = effect;
10411
- effect = effect.effect;
10412
- }
10413
-
10414
- // convert to an object
10415
- effect = { effect: effect };
10416
-
10417
- // catch (effect, null, ...)
10418
- if ( options == null ) {
10419
- options = {};
10420
- }
10421
-
10422
- // catch (effect, callback)
10423
- if ( $.isFunction( options ) ) {
10424
- callback = options;
10425
- speed = null;
10426
- options = {};
10427
- }
10428
-
10429
- // catch (effect, speed, ?)
10430
- if ( typeof options === "number" || $.fx.speeds[ options ] ) {
10431
- callback = speed;
10432
- speed = options;
10433
- options = {};
10434
- }
10435
-
10436
- // catch (effect, options, callback)
10437
- if ( $.isFunction( speed ) ) {
10438
- callback = speed;
10439
- speed = null;
10440
- }
10441
-
10442
- // add options to effect
10443
- if ( options ) {
10444
- $.extend( effect, options );
10445
- }
10446
-
10447
- speed = speed || options.duration;
10448
- effect.duration = $.fx.off ? 0 :
10449
- typeof speed === "number" ? speed :
10450
- speed in $.fx.speeds ? $.fx.speeds[ speed ] :
10451
- $.fx.speeds._default;
10452
-
10453
- effect.complete = callback || options.complete;
10454
-
10455
- return effect;
10456
- }
10457
-
10458
- function standardAnimationOption( option ) {
10459
- // Valid standard speeds (nothing, number, named speed)
10460
- if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
10461
- return true;
10462
- }
10463
-
10464
- // Invalid strings - treat as "normal" speed
10465
- if ( typeof option === "string" && !$.effects.effect[ option ] ) {
10466
- return true;
10467
- }
10468
-
10469
- // Complete callback
10470
- if ( $.isFunction( option ) ) {
10471
- return true;
10472
- }
10473
-
10474
- // Options hash (but not naming an effect)
10475
- if ( typeof option === "object" && !option.effect ) {
10476
- return true;
10477
- }
10478
-
10479
- // Didn't match any standard API
10480
- return false;
10481
- }
10482
-
10483
- $.fn.extend({
10484
- effect: function( /* effect, options, speed, callback */ ) {
10485
- var args = _normalizeArguments.apply( this, arguments ),
10486
- mode = args.mode,
10487
- queue = args.queue,
10488
- effectMethod = $.effects.effect[ args.effect ];
10489
-
10490
- if ( $.fx.off || !effectMethod ) {
10491
- // delegate to the original method (e.g., .show()) if possible
10492
- if ( mode ) {
10493
- return this[ mode ]( args.duration, args.complete );
10494
- } else {
10495
- return this.each( function() {
10496
- if ( args.complete ) {
10497
- args.complete.call( this );
10498
- }
10499
- });
10500
- }
10501
- }
10502
-
10503
- function run( next ) {
10504
- var elem = $( this ),
10505
- complete = args.complete,
10506
- mode = args.mode;
10507
-
10508
- function done() {
10509
- if ( $.isFunction( complete ) ) {
10510
- complete.call( elem[0] );
10511
- }
10512
- if ( $.isFunction( next ) ) {
10513
- next();
10514
- }
10515
- }
10516
-
10517
- // If the element already has the correct final state, delegate to
10518
- // the core methods so the internal tracking of "olddisplay" works.
10519
- if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
10520
- elem[ mode ]();
10521
- done();
10522
- } else {
10523
- effectMethod.call( elem[0], args, done );
10524
- }
10525
- }
10526
-
10527
- return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
10528
- },
10529
-
10530
- show: (function( orig ) {
10531
- return function( option ) {
10532
- if ( standardAnimationOption( option ) ) {
10533
- return orig.apply( this, arguments );
10534
- } else {
10535
- var args = _normalizeArguments.apply( this, arguments );
10536
- args.mode = "show";
10537
- return this.effect.call( this, args );
10538
- }
10539
- };
10540
- })( $.fn.show ),
10541
-
10542
- hide: (function( orig ) {
10543
- return function( option ) {
10544
- if ( standardAnimationOption( option ) ) {
10545
- return orig.apply( this, arguments );
10546
- } else {
10547
- var args = _normalizeArguments.apply( this, arguments );
10548
- args.mode = "hide";
10549
- return this.effect.call( this, args );
10550
- }
10551
- };
10552
- })( $.fn.hide ),
10553
-
10554
- toggle: (function( orig ) {
10555
- return function( option ) {
10556
- if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
10557
- return orig.apply( this, arguments );
10558
- } else {
10559
- var args = _normalizeArguments.apply( this, arguments );
10560
- args.mode = "toggle";
10561
- return this.effect.call( this, args );
10562
- }
10563
- };
10564
- })( $.fn.toggle ),
10565
-
10566
- // helper functions
10567
- cssUnit: function(key) {
10568
- var style = this.css( key ),
10569
- val = [];
10570
-
10571
- $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
10572
- if ( style.indexOf( unit ) > 0 ) {
10573
- val = [ parseFloat( style ), unit ];
10574
- }
10575
- });
10576
- return val;
10577
- }
10578
- });
10579
-
10580
- })();
10581
-
10582
- /******************************************************************************/
10583
- /*********************************** EASING ***********************************/
10584
- /******************************************************************************/
10585
-
10586
- (function() {
10587
-
10588
- // based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
10589
-
10590
- var baseEasings = {};
10591
-
10592
- $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
10593
- baseEasings[ name ] = function( p ) {
10594
- return Math.pow( p, i + 2 );
10595
- };
10596
- });
10597
-
10598
- $.extend( baseEasings, {
10599
- Sine: function( p ) {
10600
- return 1 - Math.cos( p * Math.PI / 2 );
10601
- },
10602
- Circ: function( p ) {
10603
- return 1 - Math.sqrt( 1 - p * p );
10604
- },
10605
- Elastic: function( p ) {
10606
- return p === 0 || p === 1 ? p :
10607
- -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
10608
- },
10609
- Back: function( p ) {
10610
- return p * p * ( 3 * p - 2 );
10611
- },
10612
- Bounce: function( p ) {
10613
- var pow2,
10614
- bounce = 4;
10615
-
10616
- while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
10617
- return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
10618
- }
10619
- });
10620
-
10621
- $.each( baseEasings, function( name, easeIn ) {
10622
- $.easing[ "easeIn" + name ] = easeIn;
10623
- $.easing[ "easeOut" + name ] = function( p ) {
10624
- return 1 - easeIn( 1 - p );
10625
- };
10626
- $.easing[ "easeInOut" + name ] = function( p ) {
10627
- return p < 0.5 ?
10628
- easeIn( p * 2 ) / 2 :
10629
- 1 - easeIn( p * -2 + 2 ) / 2;
10630
- };
10631
- });
10632
-
10633
- })();
10634
-
10635
- var effect = $.effects;
10636
-
10637
-
10638
- /*!
10639
- * jQuery UI Effects Blind 1.11.4
10640
- * http://jqueryui.com
10641
- *
10642
- * Copyright jQuery Foundation and other contributors
10643
- * Released under the MIT license.
10644
- * http://jquery.org/license
10645
- *
10646
- * http://api.jqueryui.com/blind-effect/
10647
- */
10648
-
10649
-
10650
- var effectBlind = $.effects.effect.blind = function( o, done ) {
10651
- // Create element
10652
- var el = $( this ),
10653
- rvertical = /up|down|vertical/,
10654
- rpositivemotion = /up|left|vertical|horizontal/,
10655
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10656
- mode = $.effects.setMode( el, o.mode || "hide" ),
10657
- direction = o.direction || "up",
10658
- vertical = rvertical.test( direction ),
10659
- ref = vertical ? "height" : "width",
10660
- ref2 = vertical ? "top" : "left",
10661
- motion = rpositivemotion.test( direction ),
10662
- animation = {},
10663
- show = mode === "show",
10664
- wrapper, distance, margin;
10665
-
10666
- // if already wrapped, the wrapper's properties are my property. #6245
10667
- if ( el.parent().is( ".ui-effects-wrapper" ) ) {
10668
- $.effects.save( el.parent(), props );
10669
- } else {
10670
- $.effects.save( el, props );
10671
- }
10672
- el.show();
10673
- wrapper = $.effects.createWrapper( el ).css({
10674
- overflow: "hidden"
10675
- });
10676
-
10677
- distance = wrapper[ ref ]();
10678
- margin = parseFloat( wrapper.css( ref2 ) ) || 0;
10679
-
10680
- animation[ ref ] = show ? distance : 0;
10681
- if ( !motion ) {
10682
- el
10683
- .css( vertical ? "bottom" : "right", 0 )
10684
- .css( vertical ? "top" : "left", "auto" )
10685
- .css({ position: "absolute" });
10686
-
10687
- animation[ ref2 ] = show ? margin : distance + margin;
10688
- }
10689
-
10690
- // start at 0 if we are showing
10691
- if ( show ) {
10692
- wrapper.css( ref, 0 );
10693
- if ( !motion ) {
10694
- wrapper.css( ref2, margin + distance );
10695
- }
10696
- }
10697
-
10698
- // Animate
10699
- wrapper.animate( animation, {
10700
- duration: o.duration,
10701
- easing: o.easing,
10702
- queue: false,
10703
- complete: function() {
10704
- if ( mode === "hide" ) {
10705
- el.hide();
10706
- }
10707
- $.effects.restore( el, props );
10708
- $.effects.removeWrapper( el );
10709
- done();
10710
- }
10711
- });
10712
- };
10713
-
10714
-
10715
- /*!
10716
- * jQuery UI Effects Bounce 1.11.4
10717
- * http://jqueryui.com
10718
- *
10719
- * Copyright jQuery Foundation and other contributors
10720
- * Released under the MIT license.
10721
- * http://jquery.org/license
10722
- *
10723
- * http://api.jqueryui.com/bounce-effect/
10724
- */
10725
-
10726
-
10727
- var effectBounce = $.effects.effect.bounce = function( o, done ) {
10728
- var el = $( this ),
10729
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10730
-
10731
- // defaults:
10732
- mode = $.effects.setMode( el, o.mode || "effect" ),
10733
- hide = mode === "hide",
10734
- show = mode === "show",
10735
- direction = o.direction || "up",
10736
- distance = o.distance,
10737
- times = o.times || 5,
10738
-
10739
- // number of internal animations
10740
- anims = times * 2 + ( show || hide ? 1 : 0 ),
10741
- speed = o.duration / anims,
10742
- easing = o.easing,
10743
-
10744
- // utility:
10745
- ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10746
- motion = ( direction === "up" || direction === "left" ),
10747
- i,
10748
- upAnim,
10749
- downAnim,
10750
-
10751
- // we will need to re-assemble the queue to stack our animations in place
10752
- queue = el.queue(),
10753
- queuelen = queue.length;
10754
-
10755
- // Avoid touching opacity to prevent clearType and PNG issues in IE
10756
- if ( show || hide ) {
10757
- props.push( "opacity" );
10758
- }
10759
-
10760
- $.effects.save( el, props );
10761
- el.show();
10762
- $.effects.createWrapper( el ); // Create Wrapper
10763
-
10764
- // default distance for the BIGGEST bounce is the outer Distance / 3
10765
- if ( !distance ) {
10766
- distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
10767
- }
10768
-
10769
- if ( show ) {
10770
- downAnim = { opacity: 1 };
10771
- downAnim[ ref ] = 0;
10772
-
10773
- // if we are showing, force opacity 0 and set the initial position
10774
- // then do the "first" animation
10775
- el.css( "opacity", 0 )
10776
- .css( ref, motion ? -distance * 2 : distance * 2 )
10777
- .animate( downAnim, speed, easing );
10778
- }
10779
-
10780
- // start at the smallest distance if we are hiding
10781
- if ( hide ) {
10782
- distance = distance / Math.pow( 2, times - 1 );
10783
- }
10784
-
10785
- downAnim = {};
10786
- downAnim[ ref ] = 0;
10787
- // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
10788
- for ( i = 0; i < times; i++ ) {
10789
- upAnim = {};
10790
- upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
10791
-
10792
- el.animate( upAnim, speed, easing )
10793
- .animate( downAnim, speed, easing );
10794
-
10795
- distance = hide ? distance * 2 : distance / 2;
10796
- }
10797
-
10798
- // Last Bounce when Hiding
10799
- if ( hide ) {
10800
- upAnim = { opacity: 0 };
10801
- upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
10802
-
10803
- el.animate( upAnim, speed, easing );
10804
- }
10805
-
10806
- el.queue(function() {
10807
- if ( hide ) {
10808
- el.hide();
10809
- }
10810
- $.effects.restore( el, props );
10811
- $.effects.removeWrapper( el );
10812
- done();
10813
- });
10814
-
10815
- // inject all the animations we just queued to be first in line (after "inprogress")
10816
- if ( queuelen > 1) {
10817
- queue.splice.apply( queue,
10818
- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
10819
- }
10820
- el.dequeue();
10821
-
10822
- };
10823
-
10824
-
10825
- /*!
10826
- * jQuery UI Effects Clip 1.11.4
10827
- * http://jqueryui.com
10828
- *
10829
- * Copyright jQuery Foundation and other contributors
10830
- * Released under the MIT license.
10831
- * http://jquery.org/license
10832
- *
10833
- * http://api.jqueryui.com/clip-effect/
10834
- */
10835
-
10836
-
10837
- var effectClip = $.effects.effect.clip = function( o, done ) {
10838
- // Create element
10839
- var el = $( this ),
10840
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10841
- mode = $.effects.setMode( el, o.mode || "hide" ),
10842
- show = mode === "show",
10843
- direction = o.direction || "vertical",
10844
- vert = direction === "vertical",
10845
- size = vert ? "height" : "width",
10846
- position = vert ? "top" : "left",
10847
- animation = {},
10848
- wrapper, animate, distance;
10849
-
10850
- // Save & Show
10851
- $.effects.save( el, props );
10852
- el.show();
10853
-
10854
- // Create Wrapper
10855
- wrapper = $.effects.createWrapper( el ).css({
10856
- overflow: "hidden"
10857
- });
10858
- animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
10859
- distance = animate[ size ]();
10860
-
10861
- // Shift
10862
- if ( show ) {
10863
- animate.css( size, 0 );
10864
- animate.css( position, distance / 2 );
10865
- }
10866
-
10867
- // Create Animation Object:
10868
- animation[ size ] = show ? distance : 0;
10869
- animation[ position ] = show ? 0 : distance / 2;
10870
-
10871
- // Animate
10872
- animate.animate( animation, {
10873
- queue: false,
10874
- duration: o.duration,
10875
- easing: o.easing,
10876
- complete: function() {
10877
- if ( !show ) {
10878
- el.hide();
10879
- }
10880
- $.effects.restore( el, props );
10881
- $.effects.removeWrapper( el );
10882
- done();
10883
- }
10884
- });
10885
-
10886
- };
10887
-
10888
-
10889
- /*!
10890
- * jQuery UI Effects Drop 1.11.4
10891
- * http://jqueryui.com
10892
- *
10893
- * Copyright jQuery Foundation and other contributors
10894
- * Released under the MIT license.
10895
- * http://jquery.org/license
10896
- *
10897
- * http://api.jqueryui.com/drop-effect/
10898
- */
10899
-
10900
-
10901
- var effectDrop = $.effects.effect.drop = function( o, done ) {
10902
-
10903
- var el = $( this ),
10904
- props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
10905
- mode = $.effects.setMode( el, o.mode || "hide" ),
10906
- show = mode === "show",
10907
- direction = o.direction || "left",
10908
- ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10909
- motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
10910
- animation = {
10911
- opacity: show ? 1 : 0
10912
- },
10913
- distance;
10914
-
10915
- // Adjust
10916
- $.effects.save( el, props );
10917
- el.show();
10918
- $.effects.createWrapper( el );
10919
-
10920
- distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
10921
-
10922
- if ( show ) {
10923
- el
10924
- .css( "opacity", 0 )
10925
- .css( ref, motion === "pos" ? -distance : distance );
10926
- }
10927
-
10928
- // Animation
10929
- animation[ ref ] = ( show ?
10930
- ( motion === "pos" ? "+=" : "-=" ) :
10931
- ( motion === "pos" ? "-=" : "+=" ) ) +
10932
- distance;
10933
-
10934
- // Animate
10935
- el.animate( animation, {
10936
- queue: false,
10937
- duration: o.duration,
10938
- easing: o.easing,
10939
- complete: function() {
10940
- if ( mode === "hide" ) {
10941
- el.hide();
10942
- }
10943
- $.effects.restore( el, props );
10944
- $.effects.removeWrapper( el );
10945
- done();
10946
- }
10947
- });
10948
- };
10949
-
10950
-
10951
- /*!
10952
- * jQuery UI Effects Explode 1.11.4
10953
- * http://jqueryui.com
10954
- *
10955
- * Copyright jQuery Foundation and other contributors
10956
- * Released under the MIT license.
10957
- * http://jquery.org/license
10958
- *
10959
- * http://api.jqueryui.com/explode-effect/
10960
- */
10961
-
10962
-
10963
- var effectExplode = $.effects.effect.explode = function( o, done ) {
10964
-
10965
- var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
10966
- cells = rows,
10967
- el = $( this ),
10968
- mode = $.effects.setMode( el, o.mode || "hide" ),
10969
- show = mode === "show",
10970
-
10971
- // show and then visibility:hidden the element before calculating offset
10972
- offset = el.show().css( "visibility", "hidden" ).offset(),
10973
-
10974
- // width and height of a piece
10975
- width = Math.ceil( el.outerWidth() / cells ),
10976
- height = Math.ceil( el.outerHeight() / rows ),
10977
- pieces = [],
10978
-
10979
- // loop
10980
- i, j, left, top, mx, my;
10981
-
10982
- // children animate complete:
10983
- function childComplete() {
10984
- pieces.push( this );
10985
- if ( pieces.length === rows * cells ) {
10986
- animComplete();
10987
- }
10988
- }
10989
-
10990
- // clone the element for each row and cell.
10991
- for ( i = 0; i < rows ; i++ ) { // ===>
10992
- top = offset.top + i * height;
10993
- my = i - ( rows - 1 ) / 2 ;
10994
-
10995
- for ( j = 0; j < cells ; j++ ) { // |||
10996
- left = offset.left + j * width;
10997
- mx = j - ( cells - 1 ) / 2 ;
10998
-
10999
- // Create a clone of the now hidden main element that will be absolute positioned
11000
- // within a wrapper div off the -left and -top equal to size of our pieces
11001
- el
11002
- .clone()
11003
- .appendTo( "body" )
11004
- .wrap( "<div></div>" )
11005
- .css({
11006
- position: "absolute",
11007
- visibility: "visible",
11008
- left: -j * width,
11009
- top: -i * height
11010
- })
11011
-
11012
- // select the wrapper - make it overflow: hidden and absolute positioned based on
11013
- // where the original was located +left and +top equal to the size of pieces
11014
- .parent()
11015
- .addClass( "ui-effects-explode" )
11016
- .css({
11017
- position: "absolute",
11018
- overflow: "hidden",
11019
- width: width,
11020
- height: height,
11021
- left: left + ( show ? mx * width : 0 ),
11022
- top: top + ( show ? my * height : 0 ),
11023
- opacity: show ? 0 : 1
11024
- }).animate({
11025
- left: left + ( show ? 0 : mx * width ),
11026
- top: top + ( show ? 0 : my * height ),
11027
- opacity: show ? 1 : 0
11028
- }, o.duration || 500, o.easing, childComplete );
11029
- }
11030
- }
11031
-
11032
- function animComplete() {
11033
- el.css({
11034
- visibility: "visible"
11035
- });
11036
- $( pieces ).remove();
11037
- if ( !show ) {
11038
- el.hide();
11039
- }
11040
- done();
11041
- }
11042
- };
11043
-
11044
-
11045
- /*!
11046
- * jQuery UI Effects Fade 1.11.4
11047
- * http://jqueryui.com
11048
- *
11049
- * Copyright jQuery Foundation and other contributors
11050
- * Released under the MIT license.
11051
- * http://jquery.org/license
11052
- *
11053
- * http://api.jqueryui.com/fade-effect/
11054
- */
11055
-
11056
-
11057
- var effectFade = $.effects.effect.fade = function( o, done ) {
11058
- var el = $( this ),
11059
- mode = $.effects.setMode( el, o.mode || "toggle" );
11060
-
11061
- el.animate({
11062
- opacity: mode
11063
- }, {
11064
- queue: false,
11065
- duration: o.duration,
11066
- easing: o.easing,
11067
- complete: done
11068
- });
11069
- };
11070
-
11071
-
11072
- /*!
11073
- * jQuery UI Effects Fold 1.11.4
11074
- * http://jqueryui.com
11075
- *
11076
- * Copyright jQuery Foundation and other contributors
11077
- * Released under the MIT license.
11078
- * http://jquery.org/license
11079
- *
11080
- * http://api.jqueryui.com/fold-effect/
11081
- */
11082
-
11083
-
11084
- var effectFold = $.effects.effect.fold = function( o, done ) {
11085
-
11086
- // Create element
11087
- var el = $( this ),
11088
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11089
- mode = $.effects.setMode( el, o.mode || "hide" ),
11090
- show = mode === "show",
11091
- hide = mode === "hide",
11092
- size = o.size || 15,
11093
- percent = /([0-9]+)%/.exec( size ),
11094
- horizFirst = !!o.horizFirst,
11095
- widthFirst = show !== horizFirst,
11096
- ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
11097
- duration = o.duration / 2,
11098
- wrapper, distance,
11099
- animation1 = {},
11100
- animation2 = {};
11101
-
11102
- $.effects.save( el, props );
11103
- el.show();
11104
-
11105
- // Create Wrapper
11106
- wrapper = $.effects.createWrapper( el ).css({
11107
- overflow: "hidden"
11108
- });
11109
- distance = widthFirst ?
11110
- [ wrapper.width(), wrapper.height() ] :
11111
- [ wrapper.height(), wrapper.width() ];
11112
-
11113
- if ( percent ) {
11114
- size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
11115
- }
11116
- if ( show ) {
11117
- wrapper.css( horizFirst ? {
11118
- height: 0,
11119
- width: size
11120
- } : {
11121
- height: size,
11122
- width: 0
11123
- });
11124
- }
11125
-
11126
- // Animation
11127
- animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
11128
- animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
11129
-
11130
- // Animate
11131
- wrapper
11132
- .animate( animation1, duration, o.easing )
11133
- .animate( animation2, duration, o.easing, function() {
11134
- if ( hide ) {
11135
- el.hide();
11136
- }
11137
- $.effects.restore( el, props );
11138
- $.effects.removeWrapper( el );
11139
- done();
11140
- });
11141
-
11142
- };
11143
-
11144
-
11145
- /*!
11146
- * jQuery UI Effects Highlight 1.11.4
11147
- * http://jqueryui.com
11148
- *
11149
- * Copyright jQuery Foundation and other contributors
11150
- * Released under the MIT license.
11151
- * http://jquery.org/license
11152
- *
11153
- * http://api.jqueryui.com/highlight-effect/
11154
- */
11155
-
11156
-
11157
- var effectHighlight = $.effects.effect.highlight = function( o, done ) {
11158
- var elem = $( this ),
11159
- props = [ "backgroundImage", "backgroundColor", "opacity" ],
11160
- mode = $.effects.setMode( elem, o.mode || "show" ),
11161
- animation = {
11162
- backgroundColor: elem.css( "backgroundColor" )
11163
- };
11164
-
11165
- if (mode === "hide") {
11166
- animation.opacity = 0;
11167
- }
11168
-
11169
- $.effects.save( elem, props );
11170
-
11171
- elem
11172
- .show()
11173
- .css({
11174
- backgroundImage: "none",
11175
- backgroundColor: o.color || "#ffff99"
11176
- })
11177
- .animate( animation, {
11178
- queue: false,
11179
- duration: o.duration,
11180
- easing: o.easing,
11181
- complete: function() {
11182
- if ( mode === "hide" ) {
11183
- elem.hide();
11184
- }
11185
- $.effects.restore( elem, props );
11186
- done();
11187
- }
11188
- });
11189
- };
11190
-
11191
-
11192
- /*!
11193
- * jQuery UI Effects Size 1.11.4
11194
- * http://jqueryui.com
11195
- *
11196
- * Copyright jQuery Foundation and other contributors
11197
- * Released under the MIT license.
11198
- * http://jquery.org/license
11199
- *
11200
- * http://api.jqueryui.com/size-effect/
11201
- */
11202
-
11203
-
11204
- var effectSize = $.effects.effect.size = function( o, done ) {
11205
-
11206
- // Create element
11207
- var original, baseline, factor,
11208
- el = $( this ),
11209
- props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
11210
-
11211
- // Always restore
11212
- props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
11213
-
11214
- // Copy for children
11215
- props2 = [ "width", "height", "overflow" ],
11216
- cProps = [ "fontSize" ],
11217
- vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
11218
- hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
11219
-
11220
- // Set options
11221
- mode = $.effects.setMode( el, o.mode || "effect" ),
11222
- restore = o.restore || mode !== "effect",
11223
- scale = o.scale || "both",
11224
- origin = o.origin || [ "middle", "center" ],
11225
- position = el.css( "position" ),
11226
- props = restore ? props0 : props1,
11227
- zero = {
11228
- height: 0,
11229
- width: 0,
11230
- outerHeight: 0,
11231
- outerWidth: 0
11232
- };
11233
-
11234
- if ( mode === "show" ) {
11235
- el.show();
11236
- }
11237
- original = {
11238
- height: el.height(),
11239
- width: el.width(),
11240
- outerHeight: el.outerHeight(),
11241
- outerWidth: el.outerWidth()
11242
- };
11243
-
11244
- if ( o.mode === "toggle" && mode === "show" ) {
11245
- el.from = o.to || zero;
11246
- el.to = o.from || original;
11247
- } else {
11248
- el.from = o.from || ( mode === "show" ? zero : original );
11249
- el.to = o.to || ( mode === "hide" ? zero : original );
11250
- }
11251
-
11252
- // Set scaling factor
11253
- factor = {
11254
- from: {
11255
- y: el.from.height / original.height,
11256
- x: el.from.width / original.width
11257
- },
11258
- to: {
11259
- y: el.to.height / original.height,
11260
- x: el.to.width / original.width
11261
- }
11262
- };
11263
-
11264
- // Scale the css box
11265
- if ( scale === "box" || scale === "both" ) {
11266
-
11267
- // Vertical props scaling
11268
- if ( factor.from.y !== factor.to.y ) {
11269
- props = props.concat( vProps );
11270
- el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
11271
- el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
11272
- }
11273
-
11274
- // Horizontal props scaling
11275
- if ( factor.from.x !== factor.to.x ) {
11276
- props = props.concat( hProps );
11277
- el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
11278
- el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
11279
- }
11280
- }
11281
-
11282
- // Scale the content
11283
- if ( scale === "content" || scale === "both" ) {
11284
-
11285
- // Vertical props scaling
11286
- if ( factor.from.y !== factor.to.y ) {
11287
- props = props.concat( cProps ).concat( props2 );
11288
- el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
11289
- el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
11290
- }
11291
- }
11292
-
11293
- $.effects.save( el, props );
11294
- el.show();
11295
- $.effects.createWrapper( el );
11296
- el.css( "overflow", "hidden" ).css( el.from );
11297
-
11298
- // Adjust
11299
- if (origin) { // Calculate baseline shifts
11300
- baseline = $.effects.getBaseline( origin, original );
11301
- el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
11302
- el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
11303
- el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
11304
- el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
11305
- }
11306
- el.css( el.from ); // set top & left
11307
-
11308
- // Animate
11309
- if ( scale === "content" || scale === "both" ) { // Scale the children
11310
-
11311
- // Add margins/font-size
11312
- vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
11313
- hProps = hProps.concat([ "marginLeft", "marginRight" ]);
11314
- props2 = props0.concat(vProps).concat(hProps);
11315
-
11316
- el.find( "*[width]" ).each( function() {
11317
- var child = $( this ),
11318
- c_original = {
11319
- height: child.height(),
11320
- width: child.width(),
11321
- outerHeight: child.outerHeight(),
11322
- outerWidth: child.outerWidth()
11323
- };
11324
- if (restore) {
11325
- $.effects.save(child, props2);
11326
- }
11327
-
11328
- child.from = {
11329
- height: c_original.height * factor.from.y,
11330
- width: c_original.width * factor.from.x,
11331
- outerHeight: c_original.outerHeight * factor.from.y,
11332
- outerWidth: c_original.outerWidth * factor.from.x
11333
- };
11334
- child.to = {
11335
- height: c_original.height * factor.to.y,
11336
- width: c_original.width * factor.to.x,
11337
- outerHeight: c_original.height * factor.to.y,
11338
- outerWidth: c_original.width * factor.to.x
11339
- };
11340
-
11341
- // Vertical props scaling
11342
- if ( factor.from.y !== factor.to.y ) {
11343
- child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
11344
- child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
11345
- }
11346
-
11347
- // Horizontal props scaling
11348
- if ( factor.from.x !== factor.to.x ) {
11349
- child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
11350
- child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
11351
- }
11352
-
11353
- // Animate children
11354
- child.css( child.from );
11355
- child.animate( child.to, o.duration, o.easing, function() {
11356
-
11357
- // Restore children
11358
- if ( restore ) {
11359
- $.effects.restore( child, props2 );
11360
- }
11361
- });
11362
- });
11363
- }
11364
-
11365
- // Animate
11366
- el.animate( el.to, {
11367
- queue: false,
11368
- duration: o.duration,
11369
- easing: o.easing,
11370
- complete: function() {
11371
- if ( el.to.opacity === 0 ) {
11372
- el.css( "opacity", el.from.opacity );
11373
- }
11374
- if ( mode === "hide" ) {
11375
- el.hide();
11376
- }
11377
- $.effects.restore( el, props );
11378
- if ( !restore ) {
11379
-
11380
- // we need to calculate our new positioning based on the scaling
11381
- if ( position === "static" ) {
11382
- el.css({
11383
- position: "relative",
11384
- top: el.to.top,
11385
- left: el.to.left
11386
- });
11387
- } else {
11388
- $.each([ "top", "left" ], function( idx, pos ) {
11389
- el.css( pos, function( _, str ) {
11390
- var val = parseInt( str, 10 ),
11391
- toRef = idx ? el.to.left : el.to.top;
11392
-
11393
- // if original was "auto", recalculate the new value from wrapper
11394
- if ( str === "auto" ) {
11395
- return toRef + "px";
11396
- }
11397
-
11398
- return val + toRef + "px";
11399
- });
11400
- });
11401
- }
11402
- }
11403
-
11404
- $.effects.removeWrapper( el );
11405
- done();
11406
- }
11407
- });
11408
-
11409
- };
11410
-
11411
-
11412
- /*!
11413
- * jQuery UI Effects Scale 1.11.4
11414
- * http://jqueryui.com
11415
- *
11416
- * Copyright jQuery Foundation and other contributors
11417
- * Released under the MIT license.
11418
- * http://jquery.org/license
11419
- *
11420
- * http://api.jqueryui.com/scale-effect/
11421
- */
11422
-
11423
-
11424
- var effectScale = $.effects.effect.scale = function( o, done ) {
11425
-
11426
- // Create element
11427
- var el = $( this ),
11428
- options = $.extend( true, {}, o ),
11429
- mode = $.effects.setMode( el, o.mode || "effect" ),
11430
- percent = parseInt( o.percent, 10 ) ||
11431
- ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
11432
- direction = o.direction || "both",
11433
- origin = o.origin,
11434
- original = {
11435
- height: el.height(),
11436
- width: el.width(),
11437
- outerHeight: el.outerHeight(),
11438
- outerWidth: el.outerWidth()
11439
- },
11440
- factor = {
11441
- y: direction !== "horizontal" ? (percent / 100) : 1,
11442
- x: direction !== "vertical" ? (percent / 100) : 1
11443
- };
11444
-
11445
- // We are going to pass this effect to the size effect:
11446
- options.effect = "size";
11447
- options.queue = false;
11448
- options.complete = done;
11449
-
11450
- // Set default origin and restore for show/hide
11451
- if ( mode !== "effect" ) {
11452
- options.origin = origin || [ "middle", "center" ];
11453
- options.restore = true;
11454
- }
11455
-
11456
- options.from = o.from || ( mode === "show" ? {
11457
- height: 0,
11458
- width: 0,
11459
- outerHeight: 0,
11460
- outerWidth: 0
11461
- } : original );
11462
- options.to = {
11463
- height: original.height * factor.y,
11464
- width: original.width * factor.x,
11465
- outerHeight: original.outerHeight * factor.y,
11466
- outerWidth: original.outerWidth * factor.x
11467
- };
11468
-
11469
- // Fade option to support puff
11470
- if ( options.fade ) {
11471
- if ( mode === "show" ) {
11472
- options.from.opacity = 0;
11473
- options.to.opacity = 1;
11474
- }
11475
- if ( mode === "hide" ) {
11476
- options.from.opacity = 1;
11477
- options.to.opacity = 0;
11478
- }
11479
- }
11480
-
11481
- // Animate
11482
- el.effect( options );
11483
-
11484
- };
11485
-
11486
-
11487
- /*!
11488
- * jQuery UI Effects Puff 1.11.4
11489
- * http://jqueryui.com
11490
- *
11491
- * Copyright jQuery Foundation and other contributors
11492
- * Released under the MIT license.
11493
- * http://jquery.org/license
11494
- *
11495
- * http://api.jqueryui.com/puff-effect/
11496
- */
11497
-
11498
-
11499
- var effectPuff = $.effects.effect.puff = function( o, done ) {
11500
- var elem = $( this ),
11501
- mode = $.effects.setMode( elem, o.mode || "hide" ),
11502
- hide = mode === "hide",
11503
- percent = parseInt( o.percent, 10 ) || 150,
11504
- factor = percent / 100,
11505
- original = {
11506
- height: elem.height(),
11507
- width: elem.width(),
11508
- outerHeight: elem.outerHeight(),
11509
- outerWidth: elem.outerWidth()
11510
- };
11511
-
11512
- $.extend( o, {
11513
- effect: "scale",
11514
- queue: false,
11515
- fade: true,
11516
- mode: mode,
11517
- complete: done,
11518
- percent: hide ? percent : 100,
11519
- from: hide ?
11520
- original :
11521
- {
11522
- height: original.height * factor,
11523
- width: original.width * factor,
11524
- outerHeight: original.outerHeight * factor,
11525
- outerWidth: original.outerWidth * factor
11526
- }
11527
- });
11528
-
11529
- elem.effect( o );
11530
- };
11531
-
11532
-
11533
- /*!
11534
- * jQuery UI Effects Pulsate 1.11.4
11535
- * http://jqueryui.com
11536
- *
11537
- * Copyright jQuery Foundation and other contributors
11538
- * Released under the MIT license.
11539
- * http://jquery.org/license
11540
- *
11541
- * http://api.jqueryui.com/pulsate-effect/
11542
- */
11543
-
11544
-
11545
- var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
11546
- var elem = $( this ),
11547
- mode = $.effects.setMode( elem, o.mode || "show" ),
11548
- show = mode === "show",
11549
- hide = mode === "hide",
11550
- showhide = ( show || mode === "hide" ),
11551
-
11552
- // showing or hiding leaves of the "last" animation
11553
- anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
11554
- duration = o.duration / anims,
11555
- animateTo = 0,
11556
- queue = elem.queue(),
11557
- queuelen = queue.length,
11558
- i;
11559
-
11560
- if ( show || !elem.is(":visible")) {
11561
- elem.css( "opacity", 0 ).show();
11562
- animateTo = 1;
11563
- }
11564
-
11565
- // anims - 1 opacity "toggles"
11566
- for ( i = 1; i < anims; i++ ) {
11567
- elem.animate({
11568
- opacity: animateTo
11569
- }, duration, o.easing );
11570
- animateTo = 1 - animateTo;
11571
- }
11572
-
11573
- elem.animate({
11574
- opacity: animateTo
11575
- }, duration, o.easing);
11576
-
11577
- elem.queue(function() {
11578
- if ( hide ) {
11579
- elem.hide();
11580
- }
11581
- done();
11582
- });
11583
-
11584
- // We just queued up "anims" animations, we need to put them next in the queue
11585
- if ( queuelen > 1 ) {
11586
- queue.splice.apply( queue,
11587
- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
11588
- }
11589
- elem.dequeue();
11590
- };
11591
-
11592
-
11593
- /*!
11594
- * jQuery UI Effects Shake 1.11.4
11595
- * http://jqueryui.com
11596
- *
11597
- * Copyright jQuery Foundation and other contributors
11598
- * Released under the MIT license.
11599
- * http://jquery.org/license
11600
- *
11601
- * http://api.jqueryui.com/shake-effect/
11602
- */
11603
-
11604
-
11605
- var effectShake = $.effects.effect.shake = function( o, done ) {
11606
-
11607
- var el = $( this ),
11608
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11609
- mode = $.effects.setMode( el, o.mode || "effect" ),
11610
- direction = o.direction || "left",
11611
- distance = o.distance || 20,
11612
- times = o.times || 3,
11613
- anims = times * 2 + 1,
11614
- speed = Math.round( o.duration / anims ),
11615
- ref = (direction === "up" || direction === "down") ? "top" : "left",
11616
- positiveMotion = (direction === "up" || direction === "left"),
11617
- animation = {},
11618
- animation1 = {},
11619
- animation2 = {},
11620
- i,
11621
-
11622
- // we will need to re-assemble the queue to stack our animations in place
11623
- queue = el.queue(),
11624
- queuelen = queue.length;
11625
-
11626
- $.effects.save( el, props );
11627
- el.show();
11628
- $.effects.createWrapper( el );
11629
-
11630
- // Animation
11631
- animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
11632
- animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
11633
- animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
11634
-
11635
- // Animate
11636
- el.animate( animation, speed, o.easing );
11637
-
11638
- // Shakes
11639
- for ( i = 1; i < times; i++ ) {
11640
- el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
11641
- }
11642
- el
11643
- .animate( animation1, speed, o.easing )
11644
- .animate( animation, speed / 2, o.easing )
11645
- .queue(function() {
11646
- if ( mode === "hide" ) {
11647
- el.hide();
11648
- }
11649
- $.effects.restore( el, props );
11650
- $.effects.removeWrapper( el );
11651
- done();
11652
- });
11653
-
11654
- // inject all the animations we just queued to be first in line (after "inprogress")
11655
- if ( queuelen > 1) {
11656
- queue.splice.apply( queue,
11657
- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
11658
- }
11659
- el.dequeue();
11660
-
11661
- };
11662
-
11663
-
11664
- /*!
11665
- * jQuery UI Effects Slide 1.11.4
11666
- * http://jqueryui.com
11667
- *
11668
- * Copyright jQuery Foundation and other contributors
11669
- * Released under the MIT license.
11670
- * http://jquery.org/license
11671
- *
11672
- * http://api.jqueryui.com/slide-effect/
11673
- */
11674
-
11675
-
11676
- var effectSlide = $.effects.effect.slide = function( o, done ) {
11677
-
11678
- // Create element
11679
- var el = $( this ),
11680
- props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
11681
- mode = $.effects.setMode( el, o.mode || "show" ),
11682
- show = mode === "show",
11683
- direction = o.direction || "left",
11684
- ref = (direction === "up" || direction === "down") ? "top" : "left",
11685
- positiveMotion = (direction === "up" || direction === "left"),
11686
- distance,
11687
- animation = {};
11688
-
11689
- // Adjust
11690
- $.effects.save( el, props );
11691
- el.show();
11692
- distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
11693
-
11694
- $.effects.createWrapper( el ).css({
11695
- overflow: "hidden"
11696
- });
11697
-
11698
- if ( show ) {
11699
- el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
11700
- }
11701
-
11702
- // Animation
11703
- animation[ ref ] = ( show ?
11704
- ( positiveMotion ? "+=" : "-=") :
11705
- ( positiveMotion ? "-=" : "+=")) +
11706
- distance;
11707
-
11708
- // Animate
11709
- el.animate( animation, {
11710
- queue: false,
11711
- duration: o.duration,
11712
- easing: o.easing,
11713
- complete: function() {
11714
- if ( mode === "hide" ) {
11715
- el.hide();
11716
- }
11717
- $.effects.restore( el, props );
11718
- $.effects.removeWrapper( el );
11719
- done();
11720
- }
11721
- });
11722
- };
11723
-
11724
-
11725
- /*!
11726
- * jQuery UI Effects Transfer 1.11.4
11727
- * http://jqueryui.com
11728
- *
11729
- * Copyright jQuery Foundation and other contributors
11730
- * Released under the MIT license.
11731
- * http://jquery.org/license
11732
- *
11733
- * http://api.jqueryui.com/transfer-effect/
11734
- */
11735
-
11736
-
11737
- var effectTransfer = $.effects.effect.transfer = function( o, done ) {
11738
- var elem = $( this ),
11739
- target = $( o.to ),
11740
- targetFixed = target.css( "position" ) === "fixed",
11741
- body = $("body"),
11742
- fixTop = targetFixed ? body.scrollTop() : 0,
11743
- fixLeft = targetFixed ? body.scrollLeft() : 0,
11744
- endPosition = target.offset(),
11745
- animation = {
11746
- top: endPosition.top - fixTop,
11747
- left: endPosition.left - fixLeft,
11748
- height: target.innerHeight(),
11749
- width: target.innerWidth()
11750
- },
11751
- startPosition = elem.offset(),
11752
- transfer = $( "<div class='ui-effects-transfer'></div>" )
11753
- .appendTo( document.body )
11754
- .addClass( o.className )
11755
- .css({
11756
- top: startPosition.top - fixTop,
11757
- left: startPosition.left - fixLeft,
11758
- height: elem.innerHeight(),
11759
- width: elem.innerWidth(),
11760
- position: targetFixed ? "fixed" : "absolute"
11761
- })
11762
- .animate( animation, o.duration, o.easing, function() {
11763
- transfer.remove();
11764
- done();
11765
- });
11766
- };
11767
-
11768
-
11769
- /*!
11770
- * jQuery UI Progressbar 1.11.4
11771
- * http://jqueryui.com
11772
- *
11773
- * Copyright jQuery Foundation and other contributors
11774
- * Released under the MIT license.
11775
- * http://jquery.org/license
11776
- *
11777
- * http://api.jqueryui.com/progressbar/
11778
- */
11779
-
11780
-
11781
- var progressbar = $.widget( "ui.progressbar", {
11782
- version: "1.11.4",
11783
- options: {
11784
- max: 100,
11785
- value: 0,
11786
-
11787
- change: null,
11788
- complete: null
11789
- },
11790
-
11791
- min: 0,
11792
-
11793
- _create: function() {
11794
- // Constrain initial value
11795
- this.oldValue = this.options.value = this._constrainedValue();
11796
-
11797
- this.element
11798
- .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
11799
- .attr({
11800
- // Only set static values, aria-valuenow and aria-valuemax are
11801
- // set inside _refreshValue()
11802
- role: "progressbar",
11803
- "aria-valuemin": this.min
11804
- });
11805
-
11806
- this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
11807
- .appendTo( this.element );
11808
-
11809
- this._refreshValue();
11810
- },
11811
-
11812
- _destroy: function() {
11813
- this.element
11814
- .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
11815
- .removeAttr( "role" )
11816
- .removeAttr( "aria-valuemin" )
11817
- .removeAttr( "aria-valuemax" )
11818
- .removeAttr( "aria-valuenow" );
11819
-
11820
- this.valueDiv.remove();
11821
- },
11822
-
11823
- value: function( newValue ) {
11824
- if ( newValue === undefined ) {
11825
- return this.options.value;
11826
- }
11827
-
11828
- this.options.value = this._constrainedValue( newValue );
11829
- this._refreshValue();
11830
- },
11831
-
11832
- _constrainedValue: function( newValue ) {
11833
- if ( newValue === undefined ) {
11834
- newValue = this.options.value;
11835
- }
11836
-
11837
- this.indeterminate = newValue === false;
11838
-
11839
- // sanitize value
11840
- if ( typeof newValue !== "number" ) {
11841
- newValue = 0;
11842
- }
11843
-
11844
- return this.indeterminate ? false :
11845
- Math.min( this.options.max, Math.max( this.min, newValue ) );
11846
- },
11847
-
11848
- _setOptions: function( options ) {
11849
- // Ensure "value" option is set after other values (like max)
11850
- var value = options.value;
11851
- delete options.value;
11852
-
11853
- this._super( options );
11854
-
11855
- this.options.value = this._constrainedValue( value );
11856
- this._refreshValue();
11857
- },
11858
-
11859
- _setOption: function( key, value ) {
11860
- if ( key === "max" ) {
11861
- // Don't allow a max less than min
11862
- value = Math.max( this.min, value );
11863
- }
11864
- if ( key === "disabled" ) {
11865
- this.element
11866
- .toggleClass( "ui-state-disabled", !!value )
11867
- .attr( "aria-disabled", value );
11868
- }
11869
- this._super( key, value );
11870
- },
11871
-
11872
- _percentage: function() {
11873
- return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
11874
- },
11875
-
11876
- _refreshValue: function() {
11877
- var value = this.options.value,
11878
- percentage = this._percentage();
11879
-
11880
- this.valueDiv
11881
- .toggle( this.indeterminate || value > this.min )
11882
- .toggleClass( "ui-corner-right", value === this.options.max )
11883
- .width( percentage.toFixed(0) + "%" );
11884
-
11885
- this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
11886
-
11887
- if ( this.indeterminate ) {
11888
- this.element.removeAttr( "aria-valuenow" );
11889
- if ( !this.overlayDiv ) {
11890
- this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
11891
- }
11892
- } else {
11893
- this.element.attr({
11894
- "aria-valuemax": this.options.max,
11895
- "aria-valuenow": value
11896
- });
11897
- if ( this.overlayDiv ) {
11898
- this.overlayDiv.remove();
11899
- this.overlayDiv = null;
11900
- }
11901
- }
11902
-
11903
- if ( this.oldValue !== value ) {
11904
- this.oldValue = value;
11905
- this._trigger( "change" );
11906
- }
11907
- if ( value === this.options.max ) {
11908
- this._trigger( "complete" );
11909
- }
11910
- }
11911
- });
11912
-
11913
-
11914
- /*!
11915
- * jQuery UI Selectable 1.11.4
11916
- * http://jqueryui.com
11917
- *
11918
- * Copyright jQuery Foundation and other contributors
11919
- * Released under the MIT license.
11920
- * http://jquery.org/license
11921
- *
11922
- * http://api.jqueryui.com/selectable/
11923
- */
11924
-
11925
-
11926
- var selectable = $.widget("ui.selectable", $.ui.mouse, {
11927
- version: "1.11.4",
11928
- options: {
11929
- appendTo: "body",
11930
- autoRefresh: true,
11931
- distance: 0,
11932
- filter: "*",
11933
- tolerance: "touch",
11934
-
11935
- // callbacks
11936
- selected: null,
11937
- selecting: null,
11938
- start: null,
11939
- stop: null,
11940
- unselected: null,
11941
- unselecting: null
11942
- },
11943
- _create: function() {
11944
- var selectees,
11945
- that = this;
11946
-
11947
- this.element.addClass("ui-selectable");
11948
-
11949
- this.dragged = false;
11950
-
11951
- // cache selectee children based on filter
11952
- this.refresh = function() {
11953
- selectees = $(that.options.filter, that.element[0]);
11954
- selectees.addClass("ui-selectee");
11955
- selectees.each(function() {
11956
- var $this = $(this),
11957
- pos = $this.offset();
11958
- $.data(this, "selectable-item", {
11959
- element: this,
11960
- $element: $this,
11961
- left: pos.left,
11962
- top: pos.top,
11963
- right: pos.left + $this.outerWidth(),
11964
- bottom: pos.top + $this.outerHeight(),
11965
- startselected: false,
11966
- selected: $this.hasClass("ui-selected"),
11967
- selecting: $this.hasClass("ui-selecting"),
11968
- unselecting: $this.hasClass("ui-unselecting")
11969
- });
11970
- });
11971
- };
11972
- this.refresh();
11973
-
11974
- this.selectees = selectees.addClass("ui-selectee");
11975
-
11976
- this._mouseInit();
11977
-
11978
- this.helper = $("<div class='ui-selectable-helper'></div>");
11979
- },
11980
-
11981
- _destroy: function() {
11982
- this.selectees
11983
- .removeClass("ui-selectee")
11984
- .removeData("selectable-item");
11985
- this.element
11986
- .removeClass("ui-selectable ui-selectable-disabled");
11987
- this._mouseDestroy();
11988
- },
11989
-
11990
- _mouseStart: function(event) {
11991
- var that = this,
11992
- options = this.options;
11993
-
11994
- this.opos = [ event.pageX, event.pageY ];
11995
-
11996
- if (this.options.disabled) {
11997
- return;
11998
- }
11999
-
12000
- this.selectees = $(options.filter, this.element[0]);
12001
-
12002
- this._trigger("start", event);
12003
-
12004
- $(options.appendTo).append(this.helper);
12005
- // position helper (lasso)
12006
- this.helper.css({
12007
- "left": event.pageX,
12008
- "top": event.pageY,
12009
- "width": 0,
12010
- "height": 0
12011
- });
12012
-
12013
- if (options.autoRefresh) {
12014
- this.refresh();
12015
- }
12016
-
12017
- this.selectees.filter(".ui-selected").each(function() {
12018
- var selectee = $.data(this, "selectable-item");
12019
- selectee.startselected = true;
12020
- if (!event.metaKey && !event.ctrlKey) {
12021
- selectee.$element.removeClass("ui-selected");
12022
- selectee.selected = false;
12023
- selectee.$element.addClass("ui-unselecting");
12024
- selectee.unselecting = true;
12025
- // selectable UNSELECTING callback
12026
- that._trigger("unselecting", event, {
12027
- unselecting: selectee.element
12028
- });
12029
- }
12030
- });
12031
-
12032
- $(event.target).parents().addBack().each(function() {
12033
- var doSelect,
12034
- selectee = $.data(this, "selectable-item");
12035
- if (selectee) {
12036
- doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
12037
- selectee.$element
12038
- .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
12039
- .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
12040
- selectee.unselecting = !doSelect;
12041
- selectee.selecting = doSelect;
12042
- selectee.selected = doSelect;
12043
- // selectable (UN)SELECTING callback
12044
- if (doSelect) {
12045
- that._trigger("selecting", event, {
12046
- selecting: selectee.element
12047
- });
12048
- } else {
12049
- that._trigger("unselecting", event, {
12050
- unselecting: selectee.element
12051
- });
12052
- }
12053
- return false;
12054
- }
12055
- });
12056
-
12057
- },
12058
-
12059
- _mouseDrag: function(event) {
12060
-
12061
- this.dragged = true;
12062
-
12063
- if (this.options.disabled) {
12064
- return;
12065
- }
12066
-
12067
- var tmp,
12068
- that = this,
12069
- options = this.options,
12070
- x1 = this.opos[0],
12071
- y1 = this.opos[1],
12072
- x2 = event.pageX,
12073
- y2 = event.pageY;
12074
-
12075
- if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
12076
- if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
12077
- this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
12078
-
12079
- this.selectees.each(function() {
12080
- var selectee = $.data(this, "selectable-item"),
12081
- hit = false;
12082
-
12083
- //prevent helper from being selected if appendTo: selectable
12084
- if (!selectee || selectee.element === that.element[0]) {
12085
- return;
12086
- }
12087
-
12088
- if (options.tolerance === "touch") {
12089
- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
12090
- } else if (options.tolerance === "fit") {
12091
- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
12092
- }
12093
-
12094
- if (hit) {
12095
- // SELECT
12096
- if (selectee.selected) {
12097
- selectee.$element.removeClass("ui-selected");
12098
- selectee.selected = false;
12099
- }
12100
- if (selectee.unselecting) {
12101
- selectee.$element.removeClass("ui-unselecting");
12102
- selectee.unselecting = false;
12103
- }
12104
- if (!selectee.selecting) {
12105
- selectee.$element.addClass("ui-selecting");
12106
- selectee.selecting = true;
12107
- // selectable SELECTING callback
12108
- that._trigger("selecting", event, {
12109
- selecting: selectee.element
12110
- });
12111
- }
12112
- } else {
12113
- // UNSELECT
12114
- if (selectee.selecting) {
12115
- if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
12116
- selectee.$element.removeClass("ui-selecting");
12117
- selectee.selecting = false;
12118
- selectee.$element.addClass("ui-selected");
12119
- selectee.selected = true;
12120
- } else {
12121
- selectee.$element.removeClass("ui-selecting");
12122
- selectee.selecting = false;
12123
- if (selectee.startselected) {
12124
- selectee.$element.addClass("ui-unselecting");
12125
- selectee.unselecting = true;
12126
- }
12127
- // selectable UNSELECTING callback
12128
- that._trigger("unselecting", event, {
12129
- unselecting: selectee.element
12130
- });
12131
- }
12132
- }
12133
- if (selectee.selected) {
12134
- if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
12135
- selectee.$element.removeClass("ui-selected");
12136
- selectee.selected = false;
12137
-
12138
- selectee.$element.addClass("ui-unselecting");
12139
- selectee.unselecting = true;
12140
- // selectable UNSELECTING callback
12141
- that._trigger("unselecting", event, {
12142
- unselecting: selectee.element
12143
- });
12144
- }
12145
- }
12146
- }
12147
- });
12148
-
12149
- return false;
12150
- },
12151
-
12152
- _mouseStop: function(event) {
12153
- var that = this;
12154
-
12155
- this.dragged = false;
12156
-
12157
- $(".ui-unselecting", this.element[0]).each(function() {
12158
- var selectee = $.data(this, "selectable-item");
12159
- selectee.$element.removeClass("ui-unselecting");
12160
- selectee.unselecting = false;
12161
- selectee.startselected = false;
12162
- that._trigger("unselected", event, {
12163
- unselected: selectee.element
12164
- });
12165
- });
12166
- $(".ui-selecting", this.element[0]).each(function() {
12167
- var selectee = $.data(this, "selectable-item");
12168
- selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
12169
- selectee.selecting = false;
12170
- selectee.selected = true;
12171
- selectee.startselected = true;
12172
- that._trigger("selected", event, {
12173
- selected: selectee.element
12174
- });
12175
- });
12176
- this._trigger("stop", event);
12177
-
12178
- this.helper.remove();
12179
-
12180
- return false;
12181
- }
12182
-
12183
- });
12184
-
12185
-
12186
- /*!
12187
- * jQuery UI Selectmenu 1.11.4
12188
- * http://jqueryui.com
12189
- *
12190
- * Copyright jQuery Foundation and other contributors
12191
- * Released under the MIT license.
12192
- * http://jquery.org/license
12193
- *
12194
- * http://api.jqueryui.com/selectmenu
12195
- */
12196
-
12197
-
12198
- var selectmenu = $.widget( "ui.selectmenu", {
12199
- version: "1.11.4",
12200
- defaultElement: "<select>",
12201
- options: {
12202
- appendTo: null,
12203
- disabled: null,
12204
- icons: {
12205
- button: "ui-icon-triangle-1-s"
12206
- },
12207
- position: {
12208
- my: "left top",
12209
- at: "left bottom",
12210
- collision: "none"
12211
- },
12212
- width: null,
12213
-
12214
- // callbacks
12215
- change: null,
12216
- close: null,
12217
- focus: null,
12218
- open: null,
12219
- select: null
12220
- },
12221
-
12222
- _create: function() {
12223
- var selectmenuId = this.element.uniqueId().attr( "id" );
12224
- this.ids = {
12225
- element: selectmenuId,
12226
- button: selectmenuId + "-button",
12227
- menu: selectmenuId + "-menu"
12228
- };
12229
-
12230
- this._drawButton();
12231
- this._drawMenu();
12232
-
12233
- if ( this.options.disabled ) {
12234
- this.disable();
12235
- }
12236
- },
12237
-
12238
- _drawButton: function() {
12239
- var that = this;
12240
-
12241
- // Associate existing label with the new button
12242
- this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
12243
- this._on( this.label, {
12244
- click: function( event ) {
12245
- this.button.focus();
12246
- event.preventDefault();
12247
- }
12248
- });
12249
-
12250
- // Hide original select element
12251
- this.element.hide();
12252
-
12253
- // Create button
12254
- this.button = $( "<span>", {
12255
- "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
12256
- tabindex: this.options.disabled ? -1 : 0,
12257
- id: this.ids.button,
12258
- role: "combobox",
12259
- "aria-expanded": "false",
12260
- "aria-autocomplete": "list",
12261
- "aria-owns": this.ids.menu,
12262
- "aria-haspopup": "true"
12263
- })
12264
- .insertAfter( this.element );
12265
-
12266
- $( "<span>", {
12267
- "class": "ui-icon " + this.options.icons.button
12268
- })
12269
- .prependTo( this.button );
12270
-
12271
- this.buttonText = $( "<span>", {
12272
- "class": "ui-selectmenu-text"
12273
- })
12274
- .appendTo( this.button );
12275
-
12276
- this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
12277
- this._resizeButton();
12278
-
12279
- this._on( this.button, this._buttonEvents );
12280
- this.button.one( "focusin", function() {
12281
-
12282
- // Delay rendering the menu items until the button receives focus.
12283
- // The menu may have already been rendered via a programmatic open.
12284
- if ( !that.menuItems ) {
12285
- that._refreshMenu();
12286
- }
12287
- });
12288
- this._hoverable( this.button );
12289
- this._focusable( this.button );
12290
- },
12291
-
12292
- _drawMenu: function() {
12293
- var that = this;
12294
-
12295
- // Create menu
12296
- this.menu = $( "<ul>", {
12297
- "aria-hidden": "true",
12298
- "aria-labelledby": this.ids.button,
12299
- id: this.ids.menu
12300
- });
12301
-
12302
- // Wrap menu
12303
- this.menuWrap = $( "<div>", {
12304
- "class": "ui-selectmenu-menu ui-front"
12305
- })
12306
- .append( this.menu )
12307
- .appendTo( this._appendTo() );
12308
-
12309
- // Initialize menu widget
12310
- this.menuInstance = this.menu
12311
- .menu({
12312
- role: "listbox",
12313
- select: function( event, ui ) {
12314
- event.preventDefault();
12315
-
12316
- // support: IE8
12317
- // If the item was selected via a click, the text selection
12318
- // will be destroyed in IE
12319
- that._setSelection();
12320
-
12321
- that._select( ui.item.data( "ui-selectmenu-item" ), event );
12322
- },
12323
- focus: function( event, ui ) {
12324
- var item = ui.item.data( "ui-selectmenu-item" );
12325
-
12326
- // Prevent inital focus from firing and check if its a newly focused item
12327
- if ( that.focusIndex != null && item.index !== that.focusIndex ) {
12328
- that._trigger( "focus", event, { item: item } );
12329
- if ( !that.isOpen ) {
12330
- that._select( item, event );
12331
- }
12332
- }
12333
- that.focusIndex = item.index;
12334
-
12335
- that.button.attr( "aria-activedescendant",
12336
- that.menuItems.eq( item.index ).attr( "id" ) );
12337
- }
12338
- })
12339
- .menu( "instance" );
12340
-
12341
- // Adjust menu styles to dropdown
12342
- this.menu
12343
- .addClass( "ui-corner-bottom" )
12344
- .removeClass( "ui-corner-all" );
12345
-
12346
- // Don't close the menu on mouseleave
12347
- this.menuInstance._off( this.menu, "mouseleave" );
12348
-
12349
- // Cancel the menu's collapseAll on document click
12350
- this.menuInstance._closeOnDocumentClick = function() {
12351
- return false;
12352
- };
12353
-
12354
- // Selects often contain empty items, but never contain dividers
12355
- this.menuInstance._isDivider = function() {
12356
- return false;
12357
- };
12358
- },
12359
-
12360
- refresh: function() {
12361
- this._refreshMenu();
12362
- this._setText( this.buttonText, this._getSelectedItem().text() );
12363
- if ( !this.options.width ) {
12364
- this._resizeButton();
12365
- }
12366
- },
12367
-
12368
- _refreshMenu: function() {
12369
- this.menu.empty();
12370
-
12371
- var item,
12372
- options = this.element.find( "option" );
12373
-
12374
- if ( !options.length ) {
12375
- return;
12376
- }
12377
-
12378
- this._parseOptions( options );
12379
- this._renderMenu( this.menu, this.items );
12380
-
12381
- this.menuInstance.refresh();
12382
- this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
12383
-
12384
- item = this._getSelectedItem();
12385
-
12386
- // Update the menu to have the correct item focused
12387
- this.menuInstance.focus( null, item );
12388
- this._setAria( item.data( "ui-selectmenu-item" ) );
12389
-
12390
- // Set disabled state
12391
- this._setOption( "disabled", this.element.prop( "disabled" ) );
12392
- },
12393
-
12394
- open: function( event ) {
12395
- if ( this.options.disabled ) {
12396
- return;
12397
- }
12398
-
12399
- // If this is the first time the menu is being opened, render the items
12400
- if ( !this.menuItems ) {
12401
- this._refreshMenu();
12402
- } else {
12403
-
12404
- // Menu clears focus on close, reset focus to selected item
12405
- this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
12406
- this.menuInstance.focus( null, this._getSelectedItem() );
12407
- }
12408
-
12409
- this.isOpen = true;
12410
- this._toggleAttr();
12411
- this._resizeMenu();
12412
- this._position();
12413
-
12414
- this._on( this.document, this._documentClick );
12415
-
12416
- this._trigger( "open", event );
12417
- },
12418
-
12419
- _position: function() {
12420
- this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
12421
- },
12422
-
12423
- close: function( event ) {
12424
- if ( !this.isOpen ) {
12425
- return;
12426
- }
12427
-
12428
- this.isOpen = false;
12429
- this._toggleAttr();
12430
-
12431
- this.range = null;
12432
- this._off( this.document );
12433
-
12434
- this._trigger( "close", event );
12435
- },
12436
-
12437
- widget: function() {
12438
- return this.button;
12439
- },
12440
-
12441
- menuWidget: function() {
12442
- return this.menu;
12443
- },
12444
-
12445
- _renderMenu: function( ul, items ) {
12446
- var that = this,
12447
- currentOptgroup = "";
12448
-
12449
- $.each( items, function( index, item ) {
12450
- if ( item.optgroup !== currentOptgroup ) {
12451
- $( "<li>", {
12452
- "class": "ui-selectmenu-optgroup ui-menu-divider" +
12453
- ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
12454
- " ui-state-disabled" :
12455
- "" ),
12456
- text: item.optgroup
12457
- })
12458
- .appendTo( ul );
12459
-
12460
- currentOptgroup = item.optgroup;
12461
- }
12462
-
12463
- that._renderItemData( ul, item );
12464
- });
12465
- },
12466
-
12467
- _renderItemData: function( ul, item ) {
12468
- return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
12469
- },
12470
-
12471
- _renderItem: function( ul, item ) {
12472
- var li = $( "<li>" );
12473
-
12474
- if ( item.disabled ) {
12475
- li.addClass( "ui-state-disabled" );
12476
- }
12477
- this._setText( li, item.label );
12478
-
12479
- return li.appendTo( ul );
12480
- },
12481
-
12482
- _setText: function( element, value ) {
12483
- if ( value ) {
12484
- element.text( value );
12485
- } else {
12486
- element.html( "&#160;" );
12487
- }
12488
- },
12489
-
12490
- _move: function( direction, event ) {
12491
- var item, next,
12492
- filter = ".ui-menu-item";
12493
-
12494
- if ( this.isOpen ) {
12495
- item = this.menuItems.eq( this.focusIndex );
12496
- } else {
12497
- item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
12498
- filter += ":not(.ui-state-disabled)";
12499
- }
12500
-
12501
- if ( direction === "first" || direction === "last" ) {
12502
- next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
12503
- } else {
12504
- next = item[ direction + "All" ]( filter ).eq( 0 );
12505
- }
12506
-
12507
- if ( next.length ) {
12508
- this.menuInstance.focus( event, next );
12509
- }
12510
- },
12511
-
12512
- _getSelectedItem: function() {
12513
- return this.menuItems.eq( this.element[ 0 ].selectedIndex );
12514
- },
12515
-
12516
- _toggle: function( event ) {
12517
- this[ this.isOpen ? "close" : "open" ]( event );
12518
- },
12519
-
12520
- _setSelection: function() {
12521
- var selection;
12522
-
12523
- if ( !this.range ) {
12524
- return;
12525
- }
12526
-
12527
- if ( window.getSelection ) {
12528
- selection = window.getSelection();
12529
- selection.removeAllRanges();
12530
- selection.addRange( this.range );
12531
-
12532
- // support: IE8
12533
- } else {
12534
- this.range.select();
12535
- }
12536
-
12537
- // support: IE
12538
- // Setting the text selection kills the button focus in IE, but
12539
- // restoring the focus doesn't kill the selection.
12540
- this.button.focus();
12541
- },
12542
-
12543
- _documentClick: {
12544
- mousedown: function( event ) {
12545
- if ( !this.isOpen ) {
12546
- return;
12547
- }
12548
-
12549
- if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
12550
- this.close( event );
12551
- }
12552
- }
12553
- },
12554
-
12555
- _buttonEvents: {
12556
-
12557
- // Prevent text selection from being reset when interacting with the selectmenu (#10144)
12558
- mousedown: function() {
12559
- var selection;
12560
-
12561
- if ( window.getSelection ) {
12562
- selection = window.getSelection();
12563
- if ( selection.rangeCount ) {
12564
- this.range = selection.getRangeAt( 0 );
12565
- }
12566
-
12567
- // support: IE8
12568
- } else {
12569
- this.range = document.selection.createRange();
12570
- }
12571
- },
12572
-
12573
- click: function( event ) {
12574
- this._setSelection();
12575
- this._toggle( event );
12576
- },
12577
-
12578
- keydown: function( event ) {
12579
- var preventDefault = true;
12580
- switch ( event.keyCode ) {
12581
- case $.ui.keyCode.TAB:
12582
- case $.ui.keyCode.ESCAPE:
12583
- this.close( event );
12584
- preventDefault = false;
12585
- break;
12586
- case $.ui.keyCode.ENTER:
12587
- if ( this.isOpen ) {
12588
- this._selectFocusedItem( event );
12589
- }
12590
- break;
12591
- case $.ui.keyCode.UP:
12592
- if ( event.altKey ) {
12593
- this._toggle( event );
12594
- } else {
12595
- this._move( "prev", event );
12596
- }
12597
- break;
12598
- case $.ui.keyCode.DOWN:
12599
- if ( event.altKey ) {
12600
- this._toggle( event );
12601
- } else {
12602
- this._move( "next", event );
12603
- }
12604
- break;
12605
- case $.ui.keyCode.SPACE:
12606
- if ( this.isOpen ) {
12607
- this._selectFocusedItem( event );
12608
- } else {
12609
- this._toggle( event );
12610
- }
12611
- break;
12612
- case $.ui.keyCode.LEFT:
12613
- this._move( "prev", event );
12614
- break;
12615
- case $.ui.keyCode.RIGHT:
12616
- this._move( "next", event );
12617
- break;
12618
- case $.ui.keyCode.HOME:
12619
- case $.ui.keyCode.PAGE_UP:
12620
- this._move( "first", event );
12621
- break;
12622
- case $.ui.keyCode.END:
12623
- case $.ui.keyCode.PAGE_DOWN:
12624
- this._move( "last", event );
12625
- break;
12626
- default:
12627
- this.menu.trigger( event );
12628
- preventDefault = false;
12629
- }
12630
-
12631
- if ( preventDefault ) {
12632
- event.preventDefault();
12633
- }
12634
- }
12635
- },
12636
-
12637
- _selectFocusedItem: function( event ) {
12638
- var item = this.menuItems.eq( this.focusIndex );
12639
- if ( !item.hasClass( "ui-state-disabled" ) ) {
12640
- this._select( item.data( "ui-selectmenu-item" ), event );
12641
- }
12642
- },
12643
-
12644
- _select: function( item, event ) {
12645
- var oldIndex = this.element[ 0 ].selectedIndex;
12646
-
12647
- // Change native select element
12648
- this.element[ 0 ].selectedIndex = item.index;
12649
- this._setText( this.buttonText, item.label );
12650
- this._setAria( item );
12651
- this._trigger( "select", event, { item: item } );
12652
-
12653
- if ( item.index !== oldIndex ) {
12654
- this._trigger( "change", event, { item: item } );
12655
- }
12656
-
12657
- this.close( event );
12658
- },
12659
-
12660
- _setAria: function( item ) {
12661
- var id = this.menuItems.eq( item.index ).attr( "id" );
12662
-
12663
- this.button.attr({
12664
- "aria-labelledby": id,
12665
- "aria-activedescendant": id
12666
- });
12667
- this.menu.attr( "aria-activedescendant", id );
12668
- },
12669
-
12670
- _setOption: function( key, value ) {
12671
- if ( key === "icons" ) {
12672
- this.button.find( "span.ui-icon" )
12673
- .removeClass( this.options.icons.button )
12674
- .addClass( value.button );
12675
- }
12676
-
12677
- this._super( key, value );
12678
-
12679
- if ( key === "appendTo" ) {
12680
- this.menuWrap.appendTo( this._appendTo() );
12681
- }
12682
-
12683
- if ( key === "disabled" ) {
12684
- this.menuInstance.option( "disabled", value );
12685
- this.button
12686
- .toggleClass( "ui-state-disabled", value )
12687
- .attr( "aria-disabled", value );
12688
-
12689
- this.element.prop( "disabled", value );
12690
- if ( value ) {
12691
- this.button.attr( "tabindex", -1 );
12692
- this.close();
12693
- } else {
12694
- this.button.attr( "tabindex", 0 );
12695
- }
12696
- }
12697
-
12698
- if ( key === "width" ) {
12699
- this._resizeButton();
12700
- }
12701
- },
12702
-
12703
- _appendTo: function() {
12704
- var element = this.options.appendTo;
12705
-
12706
- if ( element ) {
12707
- element = element.jquery || element.nodeType ?
12708
- $( element ) :
12709
- this.document.find( element ).eq( 0 );
12710
- }
12711
-
12712
- if ( !element || !element[ 0 ] ) {
12713
- element = this.element.closest( ".ui-front" );
12714
- }
12715
-
12716
- if ( !element.length ) {
12717
- element = this.document[ 0 ].body;
12718
- }
12719
-
12720
- return element;
12721
- },
12722
-
12723
- _toggleAttr: function() {
12724
- this.button
12725
- .toggleClass( "ui-corner-top", this.isOpen )
12726
- .toggleClass( "ui-corner-all", !this.isOpen )
12727
- .attr( "aria-expanded", this.isOpen );
12728
- this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
12729
- this.menu.attr( "aria-hidden", !this.isOpen );
12730
- },
12731
-
12732
- _resizeButton: function() {
12733
- var width = this.options.width;
12734
-
12735
- if ( !width ) {
12736
- width = this.element.show().outerWidth();
12737
- this.element.hide();
12738
- }
12739
-
12740
- this.button.outerWidth( width );
12741
- },
12742
-
12743
- _resizeMenu: function() {
12744
- this.menu.outerWidth( Math.max(
12745
- this.button.outerWidth(),
12746
-
12747
- // support: IE10
12748
- // IE10 wraps long text (possibly a rounding bug)
12749
- // so we add 1px to avoid the wrapping
12750
- this.menu.width( "" ).outerWidth() + 1
12751
- ) );
12752
- },
12753
-
12754
- _getCreateOptions: function() {
12755
- return { disabled: this.element.prop( "disabled" ) };
12756
- },
12757
-
12758
- _parseOptions: function( options ) {
12759
- var data = [];
12760
- options.each(function( index, item ) {
12761
- var option = $( item ),
12762
- optgroup = option.parent( "optgroup" );
12763
- data.push({
12764
- element: option,
12765
- index: index,
12766
- value: option.val(),
12767
- label: option.text(),
12768
- optgroup: optgroup.attr( "label" ) || "",
12769
- disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
12770
- });
12771
- });
12772
- this.items = data;
12773
- },
12774
-
12775
- _destroy: function() {
12776
- this.menuWrap.remove();
12777
- this.button.remove();
12778
- this.element.show();
12779
- this.element.removeUniqueId();
12780
- this.label.attr( "for", this.ids.element );
12781
- }
12782
- });
12783
-
12784
-
12785
- /*!
12786
- * jQuery UI Slider 1.11.4
12787
- * http://jqueryui.com
12788
- *
12789
- * Copyright jQuery Foundation and other contributors
12790
- * Released under the MIT license.
12791
- * http://jquery.org/license
12792
- *
12793
- * http://api.jqueryui.com/slider/
12794
- */
12795
-
12796
-
12797
- var slider = $.widget( "ui.slider", $.ui.mouse, {
12798
- version: "1.11.4",
12799
- widgetEventPrefix: "slide",
12800
-
12801
- options: {
12802
- animate: false,
12803
- distance: 0,
12804
- max: 100,
12805
- min: 0,
12806
- orientation: "horizontal",
12807
- range: false,
12808
- step: 1,
12809
- value: 0,
12810
- values: null,
12811
-
12812
- // callbacks
12813
- change: null,
12814
- slide: null,
12815
- start: null,
12816
- stop: null
12817
- },
12818
-
12819
- // number of pages in a slider
12820
- // (how many times can you page up/down to go through the whole range)
12821
- numPages: 5,
12822
-
12823
- _create: function() {
12824
- this._keySliding = false;
12825
- this._mouseSliding = false;
12826
- this._animateOff = true;
12827
- this._handleIndex = null;
12828
- this._detectOrientation();
12829
- this._mouseInit();
12830
- this._calculateNewMax();
12831
-
12832
- this.element
12833
- .addClass( "ui-slider" +
12834
- " ui-slider-" + this.orientation +
12835
- " ui-widget" +
12836
- " ui-widget-content" +
12837
- " ui-corner-all");
12838
-
12839
- this._refresh();
12840
- this._setOption( "disabled", this.options.disabled );
12841
-
12842
- this._animateOff = false;
12843
- },
12844
-
12845
- _refresh: function() {
12846
- this._createRange();
12847
- this._createHandles();
12848
- this._setupEvents();
12849
- this._refreshValue();
12850
- },
12851
-
12852
- _createHandles: function() {
12853
- var i, handleCount,
12854
- options = this.options,
12855
- existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
12856
- handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
12857
- handles = [];
12858
-
12859
- handleCount = ( options.values && options.values.length ) || 1;
12860
-
12861
- if ( existingHandles.length > handleCount ) {
12862
- existingHandles.slice( handleCount ).remove();
12863
- existingHandles = existingHandles.slice( 0, handleCount );
12864
- }
12865
-
12866
- for ( i = existingHandles.length; i < handleCount; i++ ) {
12867
- handles.push( handle );
12868
- }
12869
-
12870
- this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
12871
-
12872
- this.handle = this.handles.eq( 0 );
12873
-
12874
- this.handles.each(function( i ) {
12875
- $( this ).data( "ui-slider-handle-index", i );
12876
- });
12877
- },
12878
-
12879
- _createRange: function() {
12880
- var options = this.options,
12881
- classes = "";
12882
-
12883
- if ( options.range ) {
12884
- if ( options.range === true ) {
12885
- if ( !options.values ) {
12886
- options.values = [ this._valueMin(), this._valueMin() ];
12887
- } else if ( options.values.length && options.values.length !== 2 ) {
12888
- options.values = [ options.values[0], options.values[0] ];
12889
- } else if ( $.isArray( options.values ) ) {
12890
- options.values = options.values.slice(0);
12891
- }
12892
- }
12893
-
12894
- if ( !this.range || !this.range.length ) {
12895
- this.range = $( "<div></div>" )
12896
- .appendTo( this.element );
12897
-
12898
- classes = "ui-slider-range" +
12899
- // note: this isn't the most fittingly semantic framework class for this element,
12900
- // but worked best visually with a variety of themes
12901
- " ui-widget-header ui-corner-all";
12902
- } else {
12903
- this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
12904
- // Handle range switching from true to min/max
12905
- .css({
12906
- "left": "",
12907
- "bottom": ""
12908
- });
12909
- }
12910
-
12911
- this.range.addClass( classes +
12912
- ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
12913
- } else {
12914
- if ( this.range ) {
12915
- this.range.remove();
12916
- }
12917
- this.range = null;
12918
- }
12919
- },
12920
-
12921
- _setupEvents: function() {
12922
- this._off( this.handles );
12923
- this._on( this.handles, this._handleEvents );
12924
- this._hoverable( this.handles );
12925
- this._focusable( this.handles );
12926
- },
12927
-
12928
- _destroy: function() {
12929
- this.handles.remove();
12930
- if ( this.range ) {
12931
- this.range.remove();
12932
- }
12933
-
12934
- this.element
12935
- .removeClass( "ui-slider" +
12936
- " ui-slider-horizontal" +
12937
- " ui-slider-vertical" +
12938
- " ui-widget" +
12939
- " ui-widget-content" +
12940
- " ui-corner-all" );
12941
-
12942
- this._mouseDestroy();
12943
- },
12944
-
12945
- _mouseCapture: function( event ) {
12946
- var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
12947
- that = this,
12948
- o = this.options;
12949
-
12950
- if ( o.disabled ) {
12951
- return false;
12952
- }
12953
-
12954
- this.elementSize = {
12955
- width: this.element.outerWidth(),
12956
- height: this.element.outerHeight()
12957
- };
12958
- this.elementOffset = this.element.offset();
12959
-
12960
- position = { x: event.pageX, y: event.pageY };
12961
- normValue = this._normValueFromMouse( position );
12962
- distance = this._valueMax() - this._valueMin() + 1;
12963
- this.handles.each(function( i ) {
12964
- var thisDistance = Math.abs( normValue - that.values(i) );
12965
- if (( distance > thisDistance ) ||
12966
- ( distance === thisDistance &&
12967
- (i === that._lastChangedValue || that.values(i) === o.min ))) {
12968
- distance = thisDistance;
12969
- closestHandle = $( this );
12970
- index = i;
12971
- }
12972
- });
12973
-
12974
- allowed = this._start( event, index );
12975
- if ( allowed === false ) {
12976
- return false;
12977
- }
12978
- this._mouseSliding = true;
12979
-
12980
- this._handleIndex = index;
12981
-
12982
- closestHandle
12983
- .addClass( "ui-state-active" )
12984
- .focus();
12985
-
12986
- offset = closestHandle.offset();
12987
- mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
12988
- this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
12989
- left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
12990
- top: event.pageY - offset.top -
12991
- ( closestHandle.height() / 2 ) -
12992
- ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
12993
- ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
12994
- ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
12995
- };
12996
-
12997
- if ( !this.handles.hasClass( "ui-state-hover" ) ) {
12998
- this._slide( event, index, normValue );
12999
- }
13000
- this._animateOff = true;
13001
- return true;
13002
- },
13003
-
13004
- _mouseStart: function() {
13005
- return true;
13006
- },
13007
-
13008
- _mouseDrag: function( event ) {
13009
- var position = { x: event.pageX, y: event.pageY },
13010
- normValue = this._normValueFromMouse( position );
13011
-
13012
- this._slide( event, this._handleIndex, normValue );
13013
-
13014
- return false;
13015
- },
13016
-
13017
- _mouseStop: function( event ) {
13018
- this.handles.removeClass( "ui-state-active" );
13019
- this._mouseSliding = false;
13020
-
13021
- this._stop( event, this._handleIndex );
13022
- this._change( event, this._handleIndex );
13023
-
13024
- this._handleIndex = null;
13025
- this._clickOffset = null;
13026
- this._animateOff = false;
13027
-
13028
- return false;
13029
- },
13030
-
13031
- _detectOrientation: function() {
13032
- this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
13033
- },
13034
-
13035
- _normValueFromMouse: function( position ) {
13036
- var pixelTotal,
13037
- pixelMouse,
13038
- percentMouse,
13039
- valueTotal,
13040
- valueMouse;
13041
-
13042
- if ( this.orientation === "horizontal" ) {
13043
- pixelTotal = this.elementSize.width;
13044
- pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
13045
- } else {
13046
- pixelTotal = this.elementSize.height;
13047
- pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
13048
- }
13049
-
13050
- percentMouse = ( pixelMouse / pixelTotal );
13051
- if ( percentMouse > 1 ) {
13052
- percentMouse = 1;
13053
- }
13054
- if ( percentMouse < 0 ) {
13055
- percentMouse = 0;
13056
- }
13057
- if ( this.orientation === "vertical" ) {
13058
- percentMouse = 1 - percentMouse;
13059
- }
13060
-
13061
- valueTotal = this._valueMax() - this._valueMin();
13062
- valueMouse = this._valueMin() + percentMouse * valueTotal;
13063
-
13064
- return this._trimAlignValue( valueMouse );
13065
- },
13066
-
13067
- _start: function( event, index ) {
13068
- var uiHash = {
13069
- handle: this.handles[ index ],
13070
- value: this.value()
13071
- };
13072
- if ( this.options.values && this.options.values.length ) {
13073
- uiHash.value = this.values( index );
13074
- uiHash.values = this.values();
13075
- }
13076
- return this._trigger( "start", event, uiHash );
13077
- },
13078
-
13079
- _slide: function( event, index, newVal ) {
13080
- var otherVal,
13081
- newValues,
13082
- allowed;
13083
-
13084
- if ( this.options.values && this.options.values.length ) {
13085
- otherVal = this.values( index ? 0 : 1 );
13086
-
13087
- if ( ( this.options.values.length === 2 && this.options.range === true ) &&
13088
- ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
13089
- ) {
13090
- newVal = otherVal;
13091
- }
13092
-
13093
- if ( newVal !== this.values( index ) ) {
13094
- newValues = this.values();
13095
- newValues[ index ] = newVal;
13096
- // A slide can be canceled by returning false from the slide callback
13097
- allowed = this._trigger( "slide", event, {
13098
- handle: this.handles[ index ],
13099
- value: newVal,
13100
- values: newValues
13101
- } );
13102
- otherVal = this.values( index ? 0 : 1 );
13103
- if ( allowed !== false ) {
13104
- this.values( index, newVal );
13105
- }
13106
- }
13107
- } else {
13108
- if ( newVal !== this.value() ) {
13109
- // A slide can be canceled by returning false from the slide callback
13110
- allowed = this._trigger( "slide", event, {
13111
- handle: this.handles[ index ],
13112
- value: newVal
13113
- } );
13114
- if ( allowed !== false ) {
13115
- this.value( newVal );
13116
- }
13117
- }
13118
- }
13119
- },
13120
-
13121
- _stop: function( event, index ) {
13122
- var uiHash = {
13123
- handle: this.handles[ index ],
13124
- value: this.value()
13125
- };
13126
- if ( this.options.values && this.options.values.length ) {
13127
- uiHash.value = this.values( index );
13128
- uiHash.values = this.values();
13129
- }
13130
-
13131
- this._trigger( "stop", event, uiHash );
13132
- },
13133
-
13134
- _change: function( event, index ) {
13135
- if ( !this._keySliding && !this._mouseSliding ) {
13136
- var uiHash = {
13137
- handle: this.handles[ index ],
13138
- value: this.value()
13139
- };
13140
- if ( this.options.values && this.options.values.length ) {
13141
- uiHash.value = this.values( index );
13142
- uiHash.values = this.values();
13143
- }
13144
-
13145
- //store the last changed value index for reference when handles overlap
13146
- this._lastChangedValue = index;
13147
-
13148
- this._trigger( "change", event, uiHash );
13149
- }
13150
- },
13151
-
13152
- value: function( newValue ) {
13153
- if ( arguments.length ) {
13154
- this.options.value = this._trimAlignValue( newValue );
13155
- this._refreshValue();
13156
- this._change( null, 0 );
13157
- return;
13158
- }
13159
-
13160
- return this._value();
13161
- },
13162
-
13163
- values: function( index, newValue ) {
13164
- var vals,
13165
- newValues,
13166
- i;
13167
-
13168
- if ( arguments.length > 1 ) {
13169
- this.options.values[ index ] = this._trimAlignValue( newValue );
13170
- this._refreshValue();
13171
- this._change( null, index );
13172
- return;
13173
- }
13174
-
13175
- if ( arguments.length ) {
13176
- if ( $.isArray( arguments[ 0 ] ) ) {
13177
- vals = this.options.values;
13178
- newValues = arguments[ 0 ];
13179
- for ( i = 0; i < vals.length; i += 1 ) {
13180
- vals[ i ] = this._trimAlignValue( newValues[ i ] );
13181
- this._change( null, i );
13182
- }
13183
- this._refreshValue();
13184
- } else {
13185
- if ( this.options.values && this.options.values.length ) {
13186
- return this._values( index );
13187
- } else {
13188
- return this.value();
13189
- }
13190
- }
13191
- } else {
13192
- return this._values();
13193
- }
13194
- },
13195
-
13196
- _setOption: function( key, value ) {
13197
- var i,
13198
- valsLength = 0;
13199
-
13200
- if ( key === "range" && this.options.range === true ) {
13201
- if ( value === "min" ) {
13202
- this.options.value = this._values( 0 );
13203
- this.options.values = null;
13204
- } else if ( value === "max" ) {
13205
- this.options.value = this._values( this.options.values.length - 1 );
13206
- this.options.values = null;
13207
- }
13208
- }
13209
-
13210
- if ( $.isArray( this.options.values ) ) {
13211
- valsLength = this.options.values.length;
13212
- }
13213
-
13214
- if ( key === "disabled" ) {
13215
- this.element.toggleClass( "ui-state-disabled", !!value );
13216
- }
13217
-
13218
- this._super( key, value );
13219
-
13220
- switch ( key ) {
13221
- case "orientation":
13222
- this._detectOrientation();
13223
- this.element
13224
- .removeClass( "ui-slider-horizontal ui-slider-vertical" )
13225
- .addClass( "ui-slider-" + this.orientation );
13226
- this._refreshValue();
13227
-
13228
- // Reset positioning from previous orientation
13229
- this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
13230
- break;
13231
- case "value":
13232
- this._animateOff = true;
13233
- this._refreshValue();
13234
- this._change( null, 0 );
13235
- this._animateOff = false;
13236
- break;
13237
- case "values":
13238
- this._animateOff = true;
13239
- this._refreshValue();
13240
- for ( i = 0; i < valsLength; i += 1 ) {
13241
- this._change( null, i );
13242
- }
13243
- this._animateOff = false;
13244
- break;
13245
- case "step":
13246
- case "min":
13247
- case "max":
13248
- this._animateOff = true;
13249
- this._calculateNewMax();
13250
- this._refreshValue();
13251
- this._animateOff = false;
13252
- break;
13253
- case "range":
13254
- this._animateOff = true;
13255
- this._refresh();
13256
- this._animateOff = false;
13257
- break;
13258
- }
13259
- },
13260
-
13261
- //internal value getter
13262
- // _value() returns value trimmed by min and max, aligned by step
13263
- _value: function() {
13264
- var val = this.options.value;
13265
- val = this._trimAlignValue( val );
13266
-
13267
- return val;
13268
- },
13269
-
13270
- //internal values getter
13271
- // _values() returns array of values trimmed by min and max, aligned by step
13272
- // _values( index ) returns single value trimmed by min and max, aligned by step
13273
- _values: function( index ) {
13274
- var val,
13275
- vals,
13276
- i;
13277
-
13278
- if ( arguments.length ) {
13279
- val = this.options.values[ index ];
13280
- val = this._trimAlignValue( val );
13281
-
13282
- return val;
13283
- } else if ( this.options.values && this.options.values.length ) {
13284
- // .slice() creates a copy of the array
13285
- // this copy gets trimmed by min and max and then returned
13286
- vals = this.options.values.slice();
13287
- for ( i = 0; i < vals.length; i += 1) {
13288
- vals[ i ] = this._trimAlignValue( vals[ i ] );
13289
- }
13290
-
13291
- return vals;
13292
- } else {
13293
- return [];
13294
- }
13295
- },
13296
-
13297
- // returns the step-aligned value that val is closest to, between (inclusive) min and max
13298
- _trimAlignValue: function( val ) {
13299
- if ( val <= this._valueMin() ) {
13300
- return this._valueMin();
13301
- }
13302
- if ( val >= this._valueMax() ) {
13303
- return this._valueMax();
13304
- }
13305
- var step = ( this.options.step > 0 ) ? this.options.step : 1,
13306
- valModStep = (val - this._valueMin()) % step,
13307
- alignValue = val - valModStep;
13308
-
13309
- if ( Math.abs(valModStep) * 2 >= step ) {
13310
- alignValue += ( valModStep > 0 ) ? step : ( -step );
13311
- }
13312
-
13313
- // Since JavaScript has problems with large floats, round
13314
- // the final value to 5 digits after the decimal point (see #4124)
13315
- return parseFloat( alignValue.toFixed(5) );
13316
- },
13317
-
13318
- _calculateNewMax: function() {
13319
- var max = this.options.max,
13320
- min = this._valueMin(),
13321
- step = this.options.step,
13322
- aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
13323
- max = aboveMin + min;
13324
- this.max = parseFloat( max.toFixed( this._precision() ) );
13325
- },
13326
-
13327
- _precision: function() {
13328
- var precision = this._precisionOf( this.options.step );
13329
- if ( this.options.min !== null ) {
13330
- precision = Math.max( precision, this._precisionOf( this.options.min ) );
13331
- }
13332
- return precision;
13333
- },
13334
-
13335
- _precisionOf: function( num ) {
13336
- var str = num.toString(),
13337
- decimal = str.indexOf( "." );
13338
- return decimal === -1 ? 0 : str.length - decimal - 1;
13339
- },
13340
-
13341
- _valueMin: function() {
13342
- return this.options.min;
13343
- },
13344
-
13345
- _valueMax: function() {
13346
- return this.max;
13347
- },
13348
-
13349
- _refreshValue: function() {
13350
- var lastValPercent, valPercent, value, valueMin, valueMax,
13351
- oRange = this.options.range,
13352
- o = this.options,
13353
- that = this,
13354
- animate = ( !this._animateOff ) ? o.animate : false,
13355
- _set = {};
13356
-
13357
- if ( this.options.values && this.options.values.length ) {
13358
- this.handles.each(function( i ) {
13359
- valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
13360
- _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
13361
- $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
13362
- if ( that.options.range === true ) {
13363
- if ( that.orientation === "horizontal" ) {
13364
- if ( i === 0 ) {
13365
- that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
13366
- }
13367
- if ( i === 1 ) {
13368
- that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
13369
- }
13370
- } else {
13371
- if ( i === 0 ) {
13372
- that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
13373
- }
13374
- if ( i === 1 ) {
13375
- that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
13376
- }
13377
- }
13378
- }
13379
- lastValPercent = valPercent;
13380
- });
13381
- } else {
13382
- value = this.value();
13383
- valueMin = this._valueMin();
13384
- valueMax = this._valueMax();
13385
- valPercent = ( valueMax !== valueMin ) ?
13386
- ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
13387
- 0;
13388
- _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
13389
- this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
13390
-
13391
- if ( oRange === "min" && this.orientation === "horizontal" ) {
13392
- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
13393
- }
13394
- if ( oRange === "max" && this.orientation === "horizontal" ) {
13395
- this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
13396
- }
13397
- if ( oRange === "min" && this.orientation === "vertical" ) {
13398
- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
13399
- }
13400
- if ( oRange === "max" && this.orientation === "vertical" ) {
13401
- this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
13402
- }
13403
- }
13404
- },
13405
-
13406
- _handleEvents: {
13407
- keydown: function( event ) {
13408
- var allowed, curVal, newVal, step,
13409
- index = $( event.target ).data( "ui-slider-handle-index" );
13410
-
13411
- switch ( event.keyCode ) {
13412
- case $.ui.keyCode.HOME:
13413
- case $.ui.keyCode.END:
13414
- case $.ui.keyCode.PAGE_UP:
13415
- case $.ui.keyCode.PAGE_DOWN:
13416
- case $.ui.keyCode.UP:
13417
- case $.ui.keyCode.RIGHT:
13418
- case $.ui.keyCode.DOWN:
13419
- case $.ui.keyCode.LEFT:
13420
- event.preventDefault();
13421
- if ( !this._keySliding ) {
13422
- this._keySliding = true;
13423
- $( event.target ).addClass( "ui-state-active" );
13424
- allowed = this._start( event, index );
13425
- if ( allowed === false ) {
13426
- return;
13427
- }
13428
- }
13429
- break;
13430
- }
13431
-
13432
- step = this.options.step;
13433
- if ( this.options.values && this.options.values.length ) {
13434
- curVal = newVal = this.values( index );
13435
- } else {
13436
- curVal = newVal = this.value();
13437
- }
13438
-
13439
- switch ( event.keyCode ) {
13440
- case $.ui.keyCode.HOME:
13441
- newVal = this._valueMin();
13442
- break;
13443
- case $.ui.keyCode.END:
13444
- newVal = this._valueMax();
13445
- break;
13446
- case $.ui.keyCode.PAGE_UP:
13447
- newVal = this._trimAlignValue(
13448
- curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
13449
- );
13450
- break;
13451
- case $.ui.keyCode.PAGE_DOWN:
13452
- newVal = this._trimAlignValue(
13453
- curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
13454
- break;
13455
- case $.ui.keyCode.UP:
13456
- case $.ui.keyCode.RIGHT:
13457
- if ( curVal === this._valueMax() ) {
13458
- return;
13459
- }
13460
- newVal = this._trimAlignValue( curVal + step );
13461
- break;
13462
- case $.ui.keyCode.DOWN:
13463
- case $.ui.keyCode.LEFT:
13464
- if ( curVal === this._valueMin() ) {
13465
- return;
13466
- }
13467
- newVal = this._trimAlignValue( curVal - step );
13468
- break;
13469
- }
13470
-
13471
- this._slide( event, index, newVal );
13472
- },
13473
- keyup: function( event ) {
13474
- var index = $( event.target ).data( "ui-slider-handle-index" );
13475
-
13476
- if ( this._keySliding ) {
13477
- this._keySliding = false;
13478
- this._stop( event, index );
13479
- this._change( event, index );
13480
- $( event.target ).removeClass( "ui-state-active" );
13481
- }
13482
- }
13483
- }
13484
- });
13485
-
13486
-
13487
- /*!
13488
- * jQuery UI Sortable 1.11.4
13489
- * http://jqueryui.com
13490
- *
13491
- * Copyright jQuery Foundation and other contributors
13492
- * Released under the MIT license.
13493
- * http://jquery.org/license
13494
- *
13495
- * http://api.jqueryui.com/sortable/
13496
- */
13497
-
13498
-
13499
- var sortable = $.widget("ui.sortable", $.ui.mouse, {
13500
- version: "1.11.4",
13501
- widgetEventPrefix: "sort",
13502
- ready: false,
13503
- options: {
13504
- appendTo: "parent",
13505
- axis: false,
13506
- connectWith: false,
13507
- containment: false,
13508
- cursor: "auto",
13509
- cursorAt: false,
13510
- dropOnEmpty: true,
13511
- forcePlaceholderSize: false,
13512
- forceHelperSize: false,
13513
- grid: false,
13514
- handle: false,
13515
- helper: "original",
13516
- items: "> *",
13517
- opacity: false,
13518
- placeholder: false,
13519
- revert: false,
13520
- scroll: true,
13521
- scrollSensitivity: 20,
13522
- scrollSpeed: 20,
13523
- scope: "default",
13524
- tolerance: "intersect",
13525
- zIndex: 1000,
13526
-
13527
- // callbacks
13528
- activate: null,
13529
- beforeStop: null,
13530
- change: null,
13531
- deactivate: null,
13532
- out: null,
13533
- over: null,
13534
- receive: null,
13535
- remove: null,
13536
- sort: null,
13537
- start: null,
13538
- stop: null,
13539
- update: null
13540
- },
13541
-
13542
- _isOverAxis: function( x, reference, size ) {
13543
- return ( x >= reference ) && ( x < ( reference + size ) );
13544
- },
13545
-
13546
- _isFloating: function( item ) {
13547
- return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
13548
- },
13549
-
13550
- _create: function() {
13551
- this.containerCache = {};
13552
- this.element.addClass("ui-sortable");
13553
-
13554
- //Get the items
13555
- this.refresh();
13556
-
13557
- //Let's determine the parent's offset
13558
- this.offset = this.element.offset();
13559
-
13560
- //Initialize mouse events for interaction
13561
- this._mouseInit();
13562
-
13563
- this._setHandleClassName();
13564
-
13565
- //We're ready to go
13566
- this.ready = true;
13567
-
13568
- },
13569
-
13570
- _setOption: function( key, value ) {
13571
- this._super( key, value );
13572
-
13573
- if ( key === "handle" ) {
13574
- this._setHandleClassName();
13575
- }
13576
- },
13577
-
13578
- _setHandleClassName: function() {
13579
- this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
13580
- $.each( this.items, function() {
13581
- ( this.instance.options.handle ?
13582
- this.item.find( this.instance.options.handle ) : this.item )
13583
- .addClass( "ui-sortable-handle" );
13584
- });
13585
- },
13586
-
13587
- _destroy: function() {
13588
- this.element
13589
- .removeClass( "ui-sortable ui-sortable-disabled" )
13590
- .find( ".ui-sortable-handle" )
13591
- .removeClass( "ui-sortable-handle" );
13592
- this._mouseDestroy();
13593
-
13594
- for ( var i = this.items.length - 1; i >= 0; i-- ) {
13595
- this.items[i].item.removeData(this.widgetName + "-item");
13596
- }
13597
-
13598
- return this;
13599
- },
13600
-
13601
- _mouseCapture: function(event, overrideHandle) {
13602
- var currentItem = null,
13603
- validHandle = false,
13604
- that = this;
13605
-
13606
- if (this.reverting) {
13607
- return false;
13608
- }
13609
-
13610
- if(this.options.disabled || this.options.type === "static") {
13611
- return false;
13612
- }
13613
-
13614
- //We have to refresh the items data once first
13615
- this._refreshItems(event);
13616
-
13617
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
13618
- $(event.target).parents().each(function() {
13619
- if($.data(this, that.widgetName + "-item") === that) {
13620
- currentItem = $(this);
13621
- return false;
13622
- }
13623
- });
13624
- if($.data(event.target, that.widgetName + "-item") === that) {
13625
- currentItem = $(event.target);
13626
- }
13627
-
13628
- if(!currentItem) {
13629
- return false;
13630
- }
13631
- if(this.options.handle && !overrideHandle) {
13632
- $(this.options.handle, currentItem).find("*").addBack().each(function() {
13633
- if(this === event.target) {
13634
- validHandle = true;
13635
- }
13636
- });
13637
- if(!validHandle) {
13638
- return false;
13639
- }
13640
- }
13641
-
13642
- this.currentItem = currentItem;
13643
- this._removeCurrentsFromItems();
13644
- return true;
13645
-
13646
- },
13647
-
13648
- _mouseStart: function(event, overrideHandle, noActivation) {
13649
-
13650
- var i, body,
13651
- o = this.options;
13652
-
13653
- this.currentContainer = this;
13654
-
13655
- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
13656
- this.refreshPositions();
13657
-
13658
- //Create and append the visible helper
13659
- this.helper = this._createHelper(event);
13660
-
13661
- //Cache the helper size
13662
- this._cacheHelperProportions();
13663
-
13664
- /*
13665
- * - Position generation -
13666
- * This block generates everything position related - it's the core of draggables.
13667
- */
13668
-
13669
- //Cache the margins of the original element
13670
- this._cacheMargins();
13671
-
13672
- //Get the next scrolling parent
13673
- this.scrollParent = this.helper.scrollParent();
13674
-
13675
- //The element's absolute position on the page minus margins
13676
- this.offset = this.currentItem.offset();
13677
- this.offset = {
13678
- top: this.offset.top - this.margins.top,
13679
- left: this.offset.left - this.margins.left
13680
- };
13681
-
13682
- $.extend(this.offset, {
13683
- click: { //Where the click happened, relative to the element
13684
- left: event.pageX - this.offset.left,
13685
- top: event.pageY - this.offset.top
13686
- },
13687
- parent: this._getParentOffset(),
13688
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
13689
- });
13690
-
13691
- // Only after we got the offset, we can change the helper's position to absolute
13692
- // TODO: Still need to figure out a way to make relative sorting possible
13693
- this.helper.css("position", "absolute");
13694
- this.cssPosition = this.helper.css("position");
13695
-
13696
- //Generate the original position
13697
- this.originalPosition = this._generatePosition(event);
13698
- this.originalPageX = event.pageX;
13699
- this.originalPageY = event.pageY;
13700
-
13701
- //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
13702
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
13703
-
13704
- //Cache the former DOM position
13705
- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
13706
-
13707
- //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
13708
- if(this.helper[0] !== this.currentItem[0]) {
13709
- this.currentItem.hide();
13710
- }
13711
-
13712
- //Create the placeholder
13713
- this._createPlaceholder();
13714
-
13715
- //Set a containment if given in the options
13716
- if(o.containment) {
13717
- this._setContainment();
13718
- }
13719
-
13720
- if( o.cursor && o.cursor !== "auto" ) { // cursor option
13721
- body = this.document.find( "body" );
13722
-
13723
- // support: IE
13724
- this.storedCursor = body.css( "cursor" );
13725
- body.css( "cursor", o.cursor );
13726
-
13727
- this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
13728
- }
13729
-
13730
- if(o.opacity) { // opacity option
13731
- if (this.helper.css("opacity")) {
13732
- this._storedOpacity = this.helper.css("opacity");
13733
- }
13734
- this.helper.css("opacity", o.opacity);
13735
- }
13736
-
13737
- if(o.zIndex) { // zIndex option
13738
- if (this.helper.css("zIndex")) {
13739
- this._storedZIndex = this.helper.css("zIndex");
13740
- }
13741
- this.helper.css("zIndex", o.zIndex);
13742
- }
13743
-
13744
- //Prepare scrolling
13745
- if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
13746
- this.overflowOffset = this.scrollParent.offset();
13747
- }
13748
-
13749
- //Call callbacks
13750
- this._trigger("start", event, this._uiHash());
13751
-
13752
- //Recache the helper size
13753
- if(!this._preserveHelperProportions) {
13754
- this._cacheHelperProportions();
13755
- }
13756
-
13757
-
13758
- //Post "activate" events to possible containers
13759
- if( !noActivation ) {
13760
- for ( i = this.containers.length - 1; i >= 0; i-- ) {
13761
- this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
13762
- }
13763
- }
13764
-
13765
- //Prepare possible droppables
13766
- if($.ui.ddmanager) {
13767
- $.ui.ddmanager.current = this;
13768
- }
13769
-
13770
- if ($.ui.ddmanager && !o.dropBehaviour) {
13771
- $.ui.ddmanager.prepareOffsets(this, event);
13772
- }
13773
-
13774
- this.dragging = true;
13775
-
13776
- this.helper.addClass("ui-sortable-helper");
13777
- this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
13778
- return true;
13779
-
13780
- },
13781
-
13782
- _mouseDrag: function(event) {
13783
- var i, item, itemElement, intersection,
13784
- o = this.options,
13785
- scrolled = false;
13786
-
13787
- //Compute the helpers position
13788
- this.position = this._generatePosition(event);
13789
- this.positionAbs = this._convertPositionTo("absolute");
13790
-
13791
- if (!this.lastPositionAbs) {
13792
- this.lastPositionAbs = this.positionAbs;
13793
- }
13794
-
13795
- //Do scrolling
13796
- if(this.options.scroll) {
13797
- if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
13798
-
13799
- if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
13800
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
13801
- } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
13802
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
13803
- }
13804
-
13805
- if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
13806
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
13807
- } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
13808
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
13809
- }
13810
-
13811
- } else {
13812
-
13813
- if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
13814
- scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
13815
- } else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
13816
- scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
13817
- }
13818
-
13819
- if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
13820
- scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
13821
- } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
13822
- scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
13823
- }
13824
-
13825
- }
13826
-
13827
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
13828
- $.ui.ddmanager.prepareOffsets(this, event);
13829
- }
13830
- }
13831
-
13832
- //Regenerate the absolute position used for position checks
13833
- this.positionAbs = this._convertPositionTo("absolute");
13834
-
13835
- //Set the helper position
13836
- if(!this.options.axis || this.options.axis !== "y") {
13837
- this.helper[0].style.left = this.position.left+"px";
13838
- }
13839
- if(!this.options.axis || this.options.axis !== "x") {
13840
- this.helper[0].style.top = this.position.top+"px";
13841
- }
13842
-
13843
- //Rearrange
13844
- for (i = this.items.length - 1; i >= 0; i--) {
13845
-
13846
- //Cache variables and intersection, continue if no intersection
13847
- item = this.items[i];
13848
- itemElement = item.item[0];
13849
- intersection = this._intersectsWithPointer(item);
13850
- if (!intersection) {
13851
- continue;
13852
- }
13853
-
13854
- // Only put the placeholder inside the current Container, skip all
13855
- // items from other containers. This works because when moving
13856
- // an item from one container to another the
13857
- // currentContainer is switched before the placeholder is moved.
13858
- //
13859
- // Without this, moving items in "sub-sortables" can cause
13860
- // the placeholder to jitter between the outer and inner container.
13861
- if (item.instance !== this.currentContainer) {
13862
- continue;
13863
- }
13864
-
13865
- // cannot intersect with itself
13866
- // no useless actions that have been done before
13867
- // no action if the item moved is the parent of the item checked
13868
- if (itemElement !== this.currentItem[0] &&
13869
- this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
13870
- !$.contains(this.placeholder[0], itemElement) &&
13871
- (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
13872
- ) {
13873
-
13874
- this.direction = intersection === 1 ? "down" : "up";
13875
-
13876
- if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
13877
- this._rearrange(event, item);
13878
- } else {
13879
- break;
13880
- }
13881
-
13882
- this._trigger("change", event, this._uiHash());
13883
- break;
13884
- }
13885
- }
13886
-
13887
- //Post events to containers
13888
- this._contactContainers(event);
13889
-
13890
- //Interconnect with droppables
13891
- if($.ui.ddmanager) {
13892
- $.ui.ddmanager.drag(this, event);
13893
- }
13894
-
13895
- //Call callbacks
13896
- this._trigger("sort", event, this._uiHash());
13897
-
13898
- this.lastPositionAbs = this.positionAbs;
13899
- return false;
13900
-
13901
- },
13902
-
13903
- _mouseStop: function(event, noPropagation) {
13904
-
13905
- if(!event) {
13906
- return;
13907
- }
13908
-
13909
- //If we are using droppables, inform the manager about the drop
13910
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
13911
- $.ui.ddmanager.drop(this, event);
13912
- }
13913
-
13914
- if(this.options.revert) {
13915
- var that = this,
13916
- cur = this.placeholder.offset(),
13917
- axis = this.options.axis,
13918
- animation = {};
13919
-
13920
- if ( !axis || axis === "x" ) {
13921
- animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
13922
- }
13923
- if ( !axis || axis === "y" ) {
13924
- animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
13925
- }
13926
- this.reverting = true;
13927
- $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
13928
- that._clear(event);
13929
- });
13930
- } else {
13931
- this._clear(event, noPropagation);
13932
- }
13933
-
13934
- return false;
13935
-
13936
- },
13937
-
13938
- cancel: function() {
13939
-
13940
- if(this.dragging) {
13941
-
13942
- this._mouseUp({ target: null });
13943
-
13944
- if(this.options.helper === "original") {
13945
- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
13946
- } else {
13947
- this.currentItem.show();
13948
- }
13949
-
13950
- //Post deactivating events to containers
13951
- for (var i = this.containers.length - 1; i >= 0; i--){
13952
- this.containers[i]._trigger("deactivate", null, this._uiHash(this));
13953
- if(this.containers[i].containerCache.over) {
13954
- this.containers[i]._trigger("out", null, this._uiHash(this));
13955
- this.containers[i].containerCache.over = 0;
13956
- }
13957
- }
13958
-
13959
- }
13960
-
13961
- if (this.placeholder) {
13962
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
13963
- if(this.placeholder[0].parentNode) {
13964
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
13965
- }
13966
- if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
13967
- this.helper.remove();
13968
- }
13969
-
13970
- $.extend(this, {
13971
- helper: null,
13972
- dragging: false,
13973
- reverting: false,
13974
- _noFinalSort: null
13975
- });
13976
-
13977
- if(this.domPosition.prev) {
13978
- $(this.domPosition.prev).after(this.currentItem);
13979
- } else {
13980
- $(this.domPosition.parent).prepend(this.currentItem);
13981
- }
13982
- }
13983
-
13984
- return this;
13985
-
13986
- },
13987
-
13988
- serialize: function(o) {
13989
-
13990
- var items = this._getItemsAsjQuery(o && o.connected),
13991
- str = [];
13992
- o = o || {};
13993
-
13994
- $(items).each(function() {
13995
- var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
13996
- if (res) {
13997
- str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
13998
- }
13999
- });
14000
-
14001
- if(!str.length && o.key) {
14002
- str.push(o.key + "=");
14003
- }
14004
-
14005
- return str.join("&");
14006
-
14007
- },
14008
-
14009
- toArray: function(o) {
14010
-
14011
- var items = this._getItemsAsjQuery(o && o.connected),
14012
- ret = [];
14013
-
14014
- o = o || {};
14015
-
14016
- items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
14017
- return ret;
14018
-
14019
- },
14020
-
14021
- /* Be careful with the following core functions */
14022
- _intersectsWith: function(item) {
14023
-
14024
- var x1 = this.positionAbs.left,
14025
- x2 = x1 + this.helperProportions.width,
14026
- y1 = this.positionAbs.top,
14027
- y2 = y1 + this.helperProportions.height,
14028
- l = item.left,
14029
- r = l + item.width,
14030
- t = item.top,
14031
- b = t + item.height,
14032
- dyClick = this.offset.click.top,
14033
- dxClick = this.offset.click.left,
14034
- isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
14035
- isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
14036
- isOverElement = isOverElementHeight && isOverElementWidth;
14037
-
14038
- if ( this.options.tolerance === "pointer" ||
14039
- this.options.forcePointerForContainers ||
14040
- (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
14041
- ) {
14042
- return isOverElement;
14043
- } else {
14044
-
14045
- return (l < x1 + (this.helperProportions.width / 2) && // Right Half
14046
- x2 - (this.helperProportions.width / 2) < r && // Left Half
14047
- t < y1 + (this.helperProportions.height / 2) && // Bottom Half
14048
- y2 - (this.helperProportions.height / 2) < b ); // Top Half
14049
-
14050
- }
14051
- },
14052
-
14053
- _intersectsWithPointer: function(item) {
14054
-
14055
- var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
14056
- isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
14057
- isOverElement = isOverElementHeight && isOverElementWidth,
14058
- verticalDirection = this._getDragVerticalDirection(),
14059
- horizontalDirection = this._getDragHorizontalDirection();
14060
-
14061
- if (!isOverElement) {
14062
- return false;
14063
- }
14064
-
14065
- return this.floating ?
14066
- ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
14067
- : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
14068
-
14069
- },
14070
-
14071
- _intersectsWithSides: function(item) {
14072
-
14073
- var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
14074
- isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
14075
- verticalDirection = this._getDragVerticalDirection(),
14076
- horizontalDirection = this._getDragHorizontalDirection();
14077
-
14078
- if (this.floating && horizontalDirection) {
14079
- return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
14080
- } else {
14081
- return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
14082
- }
14083
-
14084
- },
14085
-
14086
- _getDragVerticalDirection: function() {
14087
- var delta = this.positionAbs.top - this.lastPositionAbs.top;
14088
- return delta !== 0 && (delta > 0 ? "down" : "up");
14089
- },
14090
-
14091
- _getDragHorizontalDirection: function() {
14092
- var delta = this.positionAbs.left - this.lastPositionAbs.left;
14093
- return delta !== 0 && (delta > 0 ? "right" : "left");
14094
- },
14095
-
14096
- refresh: function(event) {
14097
- this._refreshItems(event);
14098
- this._setHandleClassName();
14099
- this.refreshPositions();
14100
- return this;
14101
- },
14102
-
14103
- _connectWith: function() {
14104
- var options = this.options;
14105
- return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
14106
- },
14107
-
14108
- _getItemsAsjQuery: function(connected) {
14109
-
14110
- var i, j, cur, inst,
14111
- items = [],
14112
- queries = [],
14113
- connectWith = this._connectWith();
14114
-
14115
- if(connectWith && connected) {
14116
- for (i = connectWith.length - 1; i >= 0; i--){
14117
- cur = $(connectWith[i], this.document[0]);
14118
- for ( j = cur.length - 1; j >= 0; j--){
14119
- inst = $.data(cur[j], this.widgetFullName);
14120
- if(inst && inst !== this && !inst.options.disabled) {
14121
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
14122
- }
14123
- }
14124
- }
14125
- }
14126
-
14127
- queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
14128
-
14129
- function addItems() {
14130
- items.push( this );
14131
- }
14132
- for (i = queries.length - 1; i >= 0; i--){
14133
- queries[i][0].each( addItems );
14134
- }
14135
-
14136
- return $(items);
14137
-
14138
- },
14139
-
14140
- _removeCurrentsFromItems: function() {
14141
-
14142
- var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
14143
-
14144
- this.items = $.grep(this.items, function (item) {
14145
- for (var j=0; j < list.length; j++) {
14146
- if(list[j] === item.item[0]) {
14147
- return false;
14148
- }
14149
- }
14150
- return true;
14151
- });
14152
-
14153
- },
14154
-
14155
- _refreshItems: function(event) {
14156
-
14157
- this.items = [];
14158
- this.containers = [this];
14159
-
14160
- var i, j, cur, inst, targetData, _queries, item, queriesLength,
14161
- items = this.items,
14162
- queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
14163
- connectWith = this._connectWith();
14164
-
14165
- if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
14166
- for (i = connectWith.length - 1; i >= 0; i--){
14167
- cur = $(connectWith[i], this.document[0]);
14168
- for (j = cur.length - 1; j >= 0; j--){
14169
- inst = $.data(cur[j], this.widgetFullName);
14170
- if(inst && inst !== this && !inst.options.disabled) {
14171
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
14172
- this.containers.push(inst);
14173
- }
14174
- }
14175
- }
14176
- }
14177
-
14178
- for (i = queries.length - 1; i >= 0; i--) {
14179
- targetData = queries[i][1];
14180
- _queries = queries[i][0];
14181
-
14182
- for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
14183
- item = $(_queries[j]);
14184
-
14185
- item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
14186
-
14187
- items.push({
14188
- item: item,
14189
- instance: targetData,
14190
- width: 0, height: 0,
14191
- left: 0, top: 0
14192
- });
14193
- }
14194
- }
14195
-
14196
- },
14197
-
14198
- refreshPositions: function(fast) {
14199
-
14200
- // Determine whether items are being displayed horizontally
14201
- this.floating = this.items.length ?
14202
- this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
14203
- false;
14204
-
14205
- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
14206
- if(this.offsetParent && this.helper) {
14207
- this.offset.parent = this._getParentOffset();
14208
- }
14209
-
14210
- var i, item, t, p;
14211
-
14212
- for (i = this.items.length - 1; i >= 0; i--){
14213
- item = this.items[i];
14214
-
14215
- //We ignore calculating positions of all connected containers when we're not over them
14216
- if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
14217
- continue;
14218
- }
14219
-
14220
- t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
14221
-
14222
- if (!fast) {
14223
- item.width = t.outerWidth();
14224
- item.height = t.outerHeight();
14225
- }
14226
-
14227
- p = t.offset();
14228
- item.left = p.left;
14229
- item.top = p.top;
14230
- }
14231
-
14232
- if(this.options.custom && this.options.custom.refreshContainers) {
14233
- this.options.custom.refreshContainers.call(this);
14234
- } else {
14235
- for (i = this.containers.length - 1; i >= 0; i--){
14236
- p = this.containers[i].element.offset();
14237
- this.containers[i].containerCache.left = p.left;
14238
- this.containers[i].containerCache.top = p.top;
14239
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
14240
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
14241
- }
14242
- }
14243
-
14244
- return this;
14245
- },
14246
-
14247
- _createPlaceholder: function(that) {
14248
- that = that || this;
14249
- var className,
14250
- o = that.options;
14251
-
14252
- if(!o.placeholder || o.placeholder.constructor === String) {
14253
- className = o.placeholder;
14254
- o.placeholder = {
14255
- element: function() {
14256
-
14257
- var nodeName = that.currentItem[0].nodeName.toLowerCase(),
14258
- element = $( "<" + nodeName + ">", that.document[0] )
14259
- .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
14260
- .removeClass("ui-sortable-helper");
14261
-
14262
- if ( nodeName === "tbody" ) {
14263
- that._createTrPlaceholder(
14264
- that.currentItem.find( "tr" ).eq( 0 ),
14265
- $( "<tr>", that.document[ 0 ] ).appendTo( element )
14266
- );
14267
- } else if ( nodeName === "tr" ) {
14268
- that._createTrPlaceholder( that.currentItem, element );
14269
- } else if ( nodeName === "img" ) {
14270
- element.attr( "src", that.currentItem.attr( "src" ) );
14271
- }
14272
-
14273
- if ( !className ) {
14274
- element.css( "visibility", "hidden" );
14275
- }
14276
-
14277
- return element;
14278
- },
14279
- update: function(container, p) {
14280
-
14281
- // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
14282
- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
14283
- if(className && !o.forcePlaceholderSize) {
14284
- return;
14285
- }
14286
-
14287
- //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
14288
- if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
14289
- if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
14290
- }
14291
- };
14292
- }
14293
-
14294
- //Create the placeholder
14295
- that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
14296
-
14297
- //Append it after the actual current item
14298
- that.currentItem.after(that.placeholder);
14299
-
14300
- //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
14301
- o.placeholder.update(that, that.placeholder);
14302
-
14303
- },
14304
-
14305
- _createTrPlaceholder: function( sourceTr, targetTr ) {
14306
- var that = this;
14307
-
14308
- sourceTr.children().each(function() {
14309
- $( "<td>&#160;</td>", that.document[ 0 ] )
14310
- .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
14311
- .appendTo( targetTr );
14312
- });
14313
- },
14314
-
14315
- _contactContainers: function(event) {
14316
- var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
14317
- innermostContainer = null,
14318
- innermostIndex = null;
14319
-
14320
- // get innermost container that intersects with item
14321
- for (i = this.containers.length - 1; i >= 0; i--) {
14322
-
14323
- // never consider a container that's located within the item itself
14324
- if($.contains(this.currentItem[0], this.containers[i].element[0])) {
14325
- continue;
14326
- }
14327
-
14328
- if(this._intersectsWith(this.containers[i].containerCache)) {
14329
-
14330
- // if we've already found a container and it's more "inner" than this, then continue
14331
- if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
14332
- continue;
14333
- }
14334
-
14335
- innermostContainer = this.containers[i];
14336
- innermostIndex = i;
14337
-
14338
- } else {
14339
- // container doesn't intersect. trigger "out" event if necessary
14340
- if(this.containers[i].containerCache.over) {
14341
- this.containers[i]._trigger("out", event, this._uiHash(this));
14342
- this.containers[i].containerCache.over = 0;
14343
- }
14344
- }
14345
-
14346
- }
14347
-
14348
- // if no intersecting containers found, return
14349
- if(!innermostContainer) {
14350
- return;
14351
- }
14352
-
14353
- // move the item into the container if it's not there already
14354
- if(this.containers.length === 1) {
14355
- if (!this.containers[innermostIndex].containerCache.over) {
14356
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
14357
- this.containers[innermostIndex].containerCache.over = 1;
14358
- }
14359
- } else {
14360
-
14361
- //When entering a new container, we will find the item with the least distance and append our item near it
14362
- dist = 10000;
14363
- itemWithLeastDistance = null;
14364
- floating = innermostContainer.floating || this._isFloating(this.currentItem);
14365
- posProperty = floating ? "left" : "top";
14366
- sizeProperty = floating ? "width" : "height";
14367
- axis = floating ? "clientX" : "clientY";
14368
-
14369
- for (j = this.items.length - 1; j >= 0; j--) {
14370
- if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
14371
- continue;
14372
- }
14373
- if(this.items[j].item[0] === this.currentItem[0]) {
14374
- continue;
14375
- }
14376
-
14377
- cur = this.items[j].item.offset()[posProperty];
14378
- nearBottom = false;
14379
- if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
14380
- nearBottom = true;
14381
- }
14382
-
14383
- if ( Math.abs( event[ axis ] - cur ) < dist ) {
14384
- dist = Math.abs( event[ axis ] - cur );
14385
- itemWithLeastDistance = this.items[ j ];
14386
- this.direction = nearBottom ? "up": "down";
14387
- }
14388
- }
14389
-
14390
- //Check if dropOnEmpty is enabled
14391
- if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
14392
- return;
14393
- }
14394
-
14395
- if(this.currentContainer === this.containers[innermostIndex]) {
14396
- if ( !this.currentContainer.containerCache.over ) {
14397
- this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
14398
- this.currentContainer.containerCache.over = 1;
14399
- }
14400
- return;
14401
- }
14402
-
14403
- itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
14404
- this._trigger("change", event, this._uiHash());
14405
- this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
14406
- this.currentContainer = this.containers[innermostIndex];
14407
-
14408
- //Update the placeholder
14409
- this.options.placeholder.update(this.currentContainer, this.placeholder);
14410
-
14411
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
14412
- this.containers[innermostIndex].containerCache.over = 1;
14413
- }
14414
-
14415
-
14416
- },
14417
-
14418
- _createHelper: function(event) {
14419
-
14420
- var o = this.options,
14421
- helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
14422
-
14423
- //Add the helper to the DOM if that didn't happen already
14424
- if(!helper.parents("body").length) {
14425
- $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
14426
- }
14427
-
14428
- if(helper[0] === this.currentItem[0]) {
14429
- this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
14430
- }
14431
-
14432
- if(!helper[0].style.width || o.forceHelperSize) {
14433
- helper.width(this.currentItem.width());
14434
- }
14435
- if(!helper[0].style.height || o.forceHelperSize) {
14436
- helper.height(this.currentItem.height());
14437
- }
14438
-
14439
- return helper;
14440
-
14441
- },
14442
-
14443
- _adjustOffsetFromHelper: function(obj) {
14444
- if (typeof obj === "string") {
14445
- obj = obj.split(" ");
14446
- }
14447
- if ($.isArray(obj)) {
14448
- obj = {left: +obj[0], top: +obj[1] || 0};
14449
- }
14450
- if ("left" in obj) {
14451
- this.offset.click.left = obj.left + this.margins.left;
14452
- }
14453
- if ("right" in obj) {
14454
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
14455
- }
14456
- if ("top" in obj) {
14457
- this.offset.click.top = obj.top + this.margins.top;
14458
- }
14459
- if ("bottom" in obj) {
14460
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
14461
- }
14462
- },
14463
-
14464
- _getParentOffset: function() {
14465
-
14466
-
14467
- //Get the offsetParent and cache its position
14468
- this.offsetParent = this.helper.offsetParent();
14469
- var po = this.offsetParent.offset();
14470
-
14471
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
14472
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
14473
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
14474
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
14475
- if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
14476
- po.left += this.scrollParent.scrollLeft();
14477
- po.top += this.scrollParent.scrollTop();
14478
- }
14479
-
14480
- // This needs to be actually done for all browsers, since pageX/pageY includes this information
14481
- // with an ugly IE fix
14482
- if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
14483
- po = { top: 0, left: 0 };
14484
- }
14485
-
14486
- return {
14487
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
14488
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
14489
- };
14490
-
14491
- },
14492
-
14493
- _getRelativeOffset: function() {
14494
-
14495
- if(this.cssPosition === "relative") {
14496
- var p = this.currentItem.position();
14497
- return {
14498
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
14499
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
14500
- };
14501
- } else {
14502
- return { top: 0, left: 0 };
14503
- }
14504
-
14505
- },
14506
-
14507
- _cacheMargins: function() {
14508
- this.margins = {
14509
- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
14510
- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
14511
- };
14512
- },
14513
-
14514
- _cacheHelperProportions: function() {
14515
- this.helperProportions = {
14516
- width: this.helper.outerWidth(),
14517
- height: this.helper.outerHeight()
14518
- };
14519
- },
14520
-
14521
- _setContainment: function() {
14522
-
14523
- var ce, co, over,
14524
- o = this.options;
14525
- if(o.containment === "parent") {
14526
- o.containment = this.helper[0].parentNode;
14527
- }
14528
- if(o.containment === "document" || o.containment === "window") {
14529
- this.containment = [
14530
- 0 - this.offset.relative.left - this.offset.parent.left,
14531
- 0 - this.offset.relative.top - this.offset.parent.top,
14532
- o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
14533
- (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
14534
- ];
14535
- }
14536
-
14537
- if(!(/^(document|window|parent)$/).test(o.containment)) {
14538
- ce = $(o.containment)[0];
14539
- co = $(o.containment).offset();
14540
- over = ($(ce).css("overflow") !== "hidden");
14541
-
14542
- this.containment = [
14543
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
14544
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
14545
- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
14546
- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
14547
- ];
14548
- }
14549
-
14550
- },
14551
-
14552
- _convertPositionTo: function(d, pos) {
14553
-
14554
- if(!pos) {
14555
- pos = this.position;
14556
- }
14557
- var mod = d === "absolute" ? 1 : -1,
14558
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
14559
- scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
14560
-
14561
- return {
14562
- top: (
14563
- pos.top + // The absolute mouse position
14564
- this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
14565
- this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
14566
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
14567
- ),
14568
- left: (
14569
- pos.left + // The absolute mouse position
14570
- this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
14571
- this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
14572
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
14573
- )
14574
- };
14575
-
14576
- },
14577
-
14578
- _generatePosition: function(event) {
14579
-
14580
- var top, left,
14581
- o = this.options,
14582
- pageX = event.pageX,
14583
- pageY = event.pageY,
14584
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
14585
-
14586
- // This is another very weird special case that only happens for relative elements:
14587
- // 1. If the css position is relative
14588
- // 2. and the scroll parent is the document or similar to the offset parent
14589
- // we have to refresh the relative offset during the scroll so there are no jumps
14590
- if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
14591
- this.offset.relative = this._getRelativeOffset();
14592
- }
14593
-
14594
- /*
14595
- * - Position constraining -
14596
- * Constrain the position to a mix of grid, containment.
14597
- */
14598
-
14599
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
14600
-
14601
- if(this.containment) {
14602
- if(event.pageX - this.offset.click.left < this.containment[0]) {
14603
- pageX = this.containment[0] + this.offset.click.left;
14604
- }
14605
- if(event.pageY - this.offset.click.top < this.containment[1]) {
14606
- pageY = this.containment[1] + this.offset.click.top;
14607
- }
14608
- if(event.pageX - this.offset.click.left > this.containment[2]) {
14609
- pageX = this.containment[2] + this.offset.click.left;
14610
- }
14611
- if(event.pageY - this.offset.click.top > this.containment[3]) {
14612
- pageY = this.containment[3] + this.offset.click.top;
14613
- }
14614
- }
14615
-
14616
- if(o.grid) {
14617
- top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
14618
- pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
14619
-
14620
- left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
14621
- pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
14622
- }
14623
-
14624
- }
14625
-
14626
- return {
14627
- top: (
14628
- pageY - // The absolute mouse position
14629
- this.offset.click.top - // Click offset (relative to the element)
14630
- this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
14631
- this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
14632
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
14633
- ),
14634
- left: (
14635
- pageX - // The absolute mouse position
14636
- this.offset.click.left - // Click offset (relative to the element)
14637
- this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
14638
- this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
14639
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
14640
- )
14641
- };
14642
-
14643
- },
14644
-
14645
- _rearrange: function(event, i, a, hardRefresh) {
14646
-
14647
- a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
14648
-
14649
- //Various things done here to improve the performance:
14650
- // 1. we create a setTimeout, that calls refreshPositions
14651
- // 2. on the instance, we have a counter variable, that get's higher after every append
14652
- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
14653
- // 4. this lets only the last addition to the timeout stack through
14654
- this.counter = this.counter ? ++this.counter : 1;
14655
- var counter = this.counter;
14656
-
14657
- this._delay(function() {
14658
- if(counter === this.counter) {
14659
- this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
14660
- }
14661
- });
14662
-
14663
- },
14664
-
14665
- _clear: function(event, noPropagation) {
14666
-
14667
- this.reverting = false;
14668
- // We delay all events that have to be triggered to after the point where the placeholder has been removed and
14669
- // everything else normalized again
14670
- var i,
14671
- delayedTriggers = [];
14672
-
14673
- // We first have to update the dom position of the actual currentItem
14674
- // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
14675
- if(!this._noFinalSort && this.currentItem.parent().length) {
14676
- this.placeholder.before(this.currentItem);
14677
- }
14678
- this._noFinalSort = null;
14679
-
14680
- if(this.helper[0] === this.currentItem[0]) {
14681
- for(i in this._storedCSS) {
14682
- if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
14683
- this._storedCSS[i] = "";
14684
- }
14685
- }
14686
- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
14687
- } else {
14688
- this.currentItem.show();
14689
- }
14690
-
14691
- if(this.fromOutside && !noPropagation) {
14692
- delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
14693
- }
14694
- if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
14695
- delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
14696
- }
14697
-
14698
- // Check if the items Container has Changed and trigger appropriate
14699
- // events.
14700
- if (this !== this.currentContainer) {
14701
- if(!noPropagation) {
14702
- delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
14703
- delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
14704
- delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
14705
- }
14706
- }
14707
-
14708
-
14709
- //Post events to containers
14710
- function delayEvent( type, instance, container ) {
14711
- return function( event ) {
14712
- container._trigger( type, event, instance._uiHash( instance ) );
14713
- };
14714
- }
14715
- for (i = this.containers.length - 1; i >= 0; i--){
14716
- if (!noPropagation) {
14717
- delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
14718
- }
14719
- if(this.containers[i].containerCache.over) {
14720
- delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
14721
- this.containers[i].containerCache.over = 0;
14722
- }
14723
- }
14724
-
14725
- //Do what was originally in plugins
14726
- if ( this.storedCursor ) {
14727
- this.document.find( "body" ).css( "cursor", this.storedCursor );
14728
- this.storedStylesheet.remove();
14729
- }
14730
- if(this._storedOpacity) {
14731
- this.helper.css("opacity", this._storedOpacity);
14732
- }
14733
- if(this._storedZIndex) {
14734
- this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
14735
- }
14736
-
14737
- this.dragging = false;
14738
-
14739
- if(!noPropagation) {
14740
- this._trigger("beforeStop", event, this._uiHash());
14741
- }
14742
-
14743
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
14744
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
14745
-
14746
- if ( !this.cancelHelperRemoval ) {
14747
- if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
14748
- this.helper.remove();
14749
- }
14750
- this.helper = null;
14751
- }
14752
-
14753
- if(!noPropagation) {
14754
- for (i=0; i < delayedTriggers.length; i++) {
14755
- delayedTriggers[i].call(this, event);
14756
- } //Trigger all delayed events
14757
- this._trigger("stop", event, this._uiHash());
14758
- }
14759
-
14760
- this.fromOutside = false;
14761
- return !this.cancelHelperRemoval;
14762
-
14763
- },
14764
-
14765
- _trigger: function() {
14766
- if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
14767
- this.cancel();
14768
- }
14769
- },
14770
-
14771
- _uiHash: function(_inst) {
14772
- var inst = _inst || this;
14773
- return {
14774
- helper: inst.helper,
14775
- placeholder: inst.placeholder || $([]),
14776
- position: inst.position,
14777
- originalPosition: inst.originalPosition,
14778
- offset: inst.positionAbs,
14779
- item: inst.currentItem,
14780
- sender: _inst ? _inst.element : null
14781
- };
14782
- }
14783
-
14784
- });
14785
-
14786
-
14787
- /*!
14788
- * jQuery UI Spinner 1.11.4
14789
- * http://jqueryui.com
14790
- *
14791
- * Copyright jQuery Foundation and other contributors
14792
- * Released under the MIT license.
14793
- * http://jquery.org/license
14794
- *
14795
- * http://api.jqueryui.com/spinner/
14796
- */
14797
-
14798
-
14799
- function spinner_modifier( fn ) {
14800
- return function() {
14801
- var previous = this.element.val();
14802
- fn.apply( this, arguments );
14803
- this._refresh();
14804
- if ( previous !== this.element.val() ) {
14805
- this._trigger( "change" );
14806
- }
14807
- };
14808
- }
14809
-
14810
- var spinner = $.widget( "ui.spinner", {
14811
- version: "1.11.4",
14812
- defaultElement: "<input>",
14813
- widgetEventPrefix: "spin",
14814
- options: {
14815
- culture: null,
14816
- icons: {
14817
- down: "ui-icon-triangle-1-s",
14818
- up: "ui-icon-triangle-1-n"
14819
- },
14820
- incremental: true,
14821
- max: null,
14822
- min: null,
14823
- numberFormat: null,
14824
- page: 10,
14825
- step: 1,
14826
-
14827
- change: null,
14828
- spin: null,
14829
- start: null,
14830
- stop: null
14831
- },
14832
-
14833
- _create: function() {
14834
- // handle string values that need to be parsed
14835
- this._setOption( "max", this.options.max );
14836
- this._setOption( "min", this.options.min );
14837
- this._setOption( "step", this.options.step );
14838
-
14839
- // Only format if there is a value, prevents the field from being marked
14840
- // as invalid in Firefox, see #9573.
14841
- if ( this.value() !== "" ) {
14842
- // Format the value, but don't constrain.
14843
- this._value( this.element.val(), true );
14844
- }
14845
-
14846
- this._draw();
14847
- this._on( this._events );
14848
- this._refresh();
14849
-
14850
- // turning off autocomplete prevents the browser from remembering the
14851
- // value when navigating through history, so we re-enable autocomplete
14852
- // if the page is unloaded before the widget is destroyed. #7790
14853
- this._on( this.window, {
14854
- beforeunload: function() {
14855
- this.element.removeAttr( "autocomplete" );
14856
- }
14857
- });
14858
- },
14859
-
14860
- _getCreateOptions: function() {
14861
- var options = {},
14862
- element = this.element;
14863
-
14864
- $.each( [ "min", "max", "step" ], function( i, option ) {
14865
- var value = element.attr( option );
14866
- if ( value !== undefined && value.length ) {
14867
- options[ option ] = value;
14868
- }
14869
- });
14870
-
14871
- return options;
14872
- },
14873
-
14874
- _events: {
14875
- keydown: function( event ) {
14876
- if ( this._start( event ) && this._keydown( event ) ) {
14877
- event.preventDefault();
14878
- }
14879
- },
14880
- keyup: "_stop",
14881
- focus: function() {
14882
- this.previous = this.element.val();
14883
- },
14884
- blur: function( event ) {
14885
- if ( this.cancelBlur ) {
14886
- delete this.cancelBlur;
14887
- return;
14888
- }
14889
-
14890
- this._stop();
14891
- this._refresh();
14892
- if ( this.previous !== this.element.val() ) {
14893
- this._trigger( "change", event );
14894
- }
14895
- },
14896
- mousewheel: function( event, delta ) {
14897
- if ( !delta ) {
14898
- return;
14899
- }
14900
- if ( !this.spinning && !this._start( event ) ) {
14901
- return false;
14902
- }
14903
-
14904
- this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
14905
- clearTimeout( this.mousewheelTimer );
14906
- this.mousewheelTimer = this._delay(function() {
14907
- if ( this.spinning ) {
14908
- this._stop( event );
14909
- }
14910
- }, 100 );
14911
- event.preventDefault();
14912
- },
14913
- "mousedown .ui-spinner-button": function( event ) {
14914
- var previous;
14915
-
14916
- // We never want the buttons to have focus; whenever the user is
14917
- // interacting with the spinner, the focus should be on the input.
14918
- // If the input is focused then this.previous is properly set from
14919
- // when the input first received focus. If the input is not focused
14920
- // then we need to set this.previous based on the value before spinning.
14921
- previous = this.element[0] === this.document[0].activeElement ?
14922
- this.previous : this.element.val();
14923
- function checkFocus() {
14924
- var isActive = this.element[0] === this.document[0].activeElement;
14925
- if ( !isActive ) {
14926
- this.element.focus();
14927
- this.previous = previous;
14928
- // support: IE
14929
- // IE sets focus asynchronously, so we need to check if focus
14930
- // moved off of the input because the user clicked on the button.
14931
- this._delay(function() {
14932
- this.previous = previous;
14933
- });
14934
- }
14935
- }
14936
-
14937
- // ensure focus is on (or stays on) the text field
14938
- event.preventDefault();
14939
- checkFocus.call( this );
14940
-
14941
- // support: IE
14942
- // IE doesn't prevent moving focus even with event.preventDefault()
14943
- // so we set a flag to know when we should ignore the blur event
14944
- // and check (again) if focus moved off of the input.
14945
- this.cancelBlur = true;
14946
- this._delay(function() {
14947
- delete this.cancelBlur;
14948
- checkFocus.call( this );
14949
- });
14950
-
14951
- if ( this._start( event ) === false ) {
14952
- return;
14953
- }
14954
-
14955
- this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14956
- },
14957
- "mouseup .ui-spinner-button": "_stop",
14958
- "mouseenter .ui-spinner-button": function( event ) {
14959
- // button will add ui-state-active if mouse was down while mouseleave and kept down
14960
- if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
14961
- return;
14962
- }
14963
-
14964
- if ( this._start( event ) === false ) {
14965
- return false;
14966
- }
14967
- this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14968
- },
14969
- // TODO: do we really want to consider this a stop?
14970
- // shouldn't we just stop the repeater and wait until mouseup before
14971
- // we trigger the stop event?
14972
- "mouseleave .ui-spinner-button": "_stop"
14973
- },
14974
-
14975
- _draw: function() {
14976
- var uiSpinner = this.uiSpinner = this.element
14977
- .addClass( "ui-spinner-input" )
14978
- .attr( "autocomplete", "off" )
14979
- .wrap( this._uiSpinnerHtml() )
14980
- .parent()
14981
- // add buttons
14982
- .append( this._buttonHtml() );
14983
-
14984
- this.element.attr( "role", "spinbutton" );
14985
-
14986
- // button bindings
14987
- this.buttons = uiSpinner.find( ".ui-spinner-button" )
14988
- .attr( "tabIndex", -1 )
14989
- .button()
14990
- .removeClass( "ui-corner-all" );
14991
-
14992
- // IE 6 doesn't understand height: 50% for the buttons
14993
- // unless the wrapper has an explicit height
14994
- if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
14995
- uiSpinner.height() > 0 ) {
14996
- uiSpinner.height( uiSpinner.height() );
14997
- }
14998
-
14999
- // disable spinner if element was already disabled
15000
- if ( this.options.disabled ) {
15001
- this.disable();
15002
- }
15003
- },
15004
-
15005
- _keydown: function( event ) {
15006
- var options = this.options,
15007
- keyCode = $.ui.keyCode;
15008
-
15009
- switch ( event.keyCode ) {
15010
- case keyCode.UP:
15011
- this._repeat( null, 1, event );
15012
- return true;
15013
- case keyCode.DOWN:
15014
- this._repeat( null, -1, event );
15015
- return true;
15016
- case keyCode.PAGE_UP:
15017
- this._repeat( null, options.page, event );
15018
- return true;
15019
- case keyCode.PAGE_DOWN:
15020
- this._repeat( null, -options.page, event );
15021
- return true;
15022
- }
15023
-
15024
- return false;
15025
- },
15026
-
15027
- _uiSpinnerHtml: function() {
15028
- return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
15029
- },
15030
-
15031
- _buttonHtml: function() {
15032
- return "" +
15033
- "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
15034
- "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
15035
- "</a>" +
15036
- "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
15037
- "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
15038
- "</a>";
15039
- },
15040
-
15041
- _start: function( event ) {
15042
- if ( !this.spinning && this._trigger( "start", event ) === false ) {
15043
- return false;
15044
- }
15045
-
15046
- if ( !this.counter ) {
15047
- this.counter = 1;
15048
- }
15049
- this.spinning = true;
15050
- return true;
15051
- },
15052
-
15053
- _repeat: function( i, steps, event ) {
15054
- i = i || 500;
15055
-
15056
- clearTimeout( this.timer );
15057
- this.timer = this._delay(function() {
15058
- this._repeat( 40, steps, event );
15059
- }, i );
15060
-
15061
- this._spin( steps * this.options.step, event );
15062
- },
15063
-
15064
- _spin: function( step, event ) {
15065
- var value = this.value() || 0;
15066
-
15067
- if ( !this.counter ) {
15068
- this.counter = 1;
15069
- }
15070
-
15071
- value = this._adjustValue( value + step * this._increment( this.counter ) );
15072
-
15073
- if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
15074
- this._value( value );
15075
- this.counter++;
15076
- }
15077
- },
15078
-
15079
- _increment: function( i ) {
15080
- var incremental = this.options.incremental;
15081
-
15082
- if ( incremental ) {
15083
- return $.isFunction( incremental ) ?
15084
- incremental( i ) :
15085
- Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
15086
- }
15087
-
15088
- return 1;
15089
- },
15090
-
15091
- _precision: function() {
15092
- var precision = this._precisionOf( this.options.step );
15093
- if ( this.options.min !== null ) {
15094
- precision = Math.max( precision, this._precisionOf( this.options.min ) );
15095
- }
15096
- return precision;
15097
- },
15098
-
15099
- _precisionOf: function( num ) {
15100
- var str = num.toString(),
15101
- decimal = str.indexOf( "." );
15102
- return decimal === -1 ? 0 : str.length - decimal - 1;
15103
- },
15104
-
15105
- _adjustValue: function( value ) {
15106
- var base, aboveMin,
15107
- options = this.options;
15108
-
15109
- // make sure we're at a valid step
15110
- // - find out where we are relative to the base (min or 0)
15111
- base = options.min !== null ? options.min : 0;
15112
- aboveMin = value - base;
15113
- // - round to the nearest step
15114
- aboveMin = Math.round(aboveMin / options.step) * options.step;
15115
- // - rounding is based on 0, so adjust back to our base
15116
- value = base + aboveMin;
15117
-
15118
- // fix precision from bad JS floating point math
15119
- value = parseFloat( value.toFixed( this._precision() ) );
15120
-
15121
- // clamp the value
15122
- if ( options.max !== null && value > options.max) {
15123
- return options.max;
15124
- }
15125
- if ( options.min !== null && value < options.min ) {
15126
- return options.min;
15127
- }
15128
-
15129
- return value;
15130
- },
15131
-
15132
- _stop: function( event ) {
15133
- if ( !this.spinning ) {
15134
- return;
15135
- }
15136
-
15137
- clearTimeout( this.timer );
15138
- clearTimeout( this.mousewheelTimer );
15139
- this.counter = 0;
15140
- this.spinning = false;
15141
- this._trigger( "stop", event );
15142
- },
15143
-
15144
- _setOption: function( key, value ) {
15145
- if ( key === "culture" || key === "numberFormat" ) {
15146
- var prevValue = this._parse( this.element.val() );
15147
- this.options[ key ] = value;
15148
- this.element.val( this._format( prevValue ) );
15149
- return;
15150
- }
15151
-
15152
- if ( key === "max" || key === "min" || key === "step" ) {
15153
- if ( typeof value === "string" ) {
15154
- value = this._parse( value );
15155
- }
15156
- }
15157
- if ( key === "icons" ) {
15158
- this.buttons.first().find( ".ui-icon" )
15159
- .removeClass( this.options.icons.up )
15160
- .addClass( value.up );
15161
- this.buttons.last().find( ".ui-icon" )
15162
- .removeClass( this.options.icons.down )
15163
- .addClass( value.down );
15164
- }
15165
-
15166
- this._super( key, value );
15167
-
15168
- if ( key === "disabled" ) {
15169
- this.widget().toggleClass( "ui-state-disabled", !!value );
15170
- this.element.prop( "disabled", !!value );
15171
- this.buttons.button( value ? "disable" : "enable" );
15172
- }
15173
- },
15174
-
15175
- _setOptions: spinner_modifier(function( options ) {
15176
- this._super( options );
15177
- }),
15178
-
15179
- _parse: function( val ) {
15180
- if ( typeof val === "string" && val !== "" ) {
15181
- val = window.Globalize && this.options.numberFormat ?
15182
- Globalize.parseFloat( val, 10, this.options.culture ) : +val;
15183
- }
15184
- return val === "" || isNaN( val ) ? null : val;
15185
- },
15186
-
15187
- _format: function( value ) {
15188
- if ( value === "" ) {
15189
- return "";
15190
- }
15191
- return window.Globalize && this.options.numberFormat ?
15192
- Globalize.format( value, this.options.numberFormat, this.options.culture ) :
15193
- value;
15194
- },
15195
-
15196
- _refresh: function() {
15197
- this.element.attr({
15198
- "aria-valuemin": this.options.min,
15199
- "aria-valuemax": this.options.max,
15200
- // TODO: what should we do with values that can't be parsed?
15201
- "aria-valuenow": this._parse( this.element.val() )
15202
- });
15203
- },
15204
-
15205
- isValid: function() {
15206
- var value = this.value();
15207
-
15208
- // null is invalid
15209
- if ( value === null ) {
15210
- return false;
15211
- }
15212
-
15213
- // if value gets adjusted, it's invalid
15214
- return value === this._adjustValue( value );
15215
- },
15216
-
15217
- // update the value without triggering change
15218
- _value: function( value, allowAny ) {
15219
- var parsed;
15220
- if ( value !== "" ) {
15221
- parsed = this._parse( value );
15222
- if ( parsed !== null ) {
15223
- if ( !allowAny ) {
15224
- parsed = this._adjustValue( parsed );
15225
- }
15226
- value = this._format( parsed );
15227
- }
15228
- }
15229
- this.element.val( value );
15230
- this._refresh();
15231
- },
15232
-
15233
- _destroy: function() {
15234
- this.element
15235
- .removeClass( "ui-spinner-input" )
15236
- .prop( "disabled", false )
15237
- .removeAttr( "autocomplete" )
15238
- .removeAttr( "role" )
15239
- .removeAttr( "aria-valuemin" )
15240
- .removeAttr( "aria-valuemax" )
15241
- .removeAttr( "aria-valuenow" );
15242
- this.uiSpinner.replaceWith( this.element );
15243
- },
15244
-
15245
- stepUp: spinner_modifier(function( steps ) {
15246
- this._stepUp( steps );
15247
- }),
15248
- _stepUp: function( steps ) {
15249
- if ( this._start() ) {
15250
- this._spin( (steps || 1) * this.options.step );
15251
- this._stop();
15252
- }
15253
- },
15254
-
15255
- stepDown: spinner_modifier(function( steps ) {
15256
- this._stepDown( steps );
15257
- }),
15258
- _stepDown: function( steps ) {
15259
- if ( this._start() ) {
15260
- this._spin( (steps || 1) * -this.options.step );
15261
- this._stop();
15262
- }
15263
- },
15264
-
15265
- pageUp: spinner_modifier(function( pages ) {
15266
- this._stepUp( (pages || 1) * this.options.page );
15267
- }),
15268
-
15269
- pageDown: spinner_modifier(function( pages ) {
15270
- this._stepDown( (pages || 1) * this.options.page );
15271
- }),
15272
-
15273
- value: function( newVal ) {
15274
- if ( !arguments.length ) {
15275
- return this._parse( this.element.val() );
15276
- }
15277
- spinner_modifier( this._value ).call( this, newVal );
15278
- },
15279
-
15280
- widget: function() {
15281
- return this.uiSpinner;
15282
- }
15283
- });
15284
-
15285
-
15286
- /*!
15287
- * jQuery UI Tabs 1.11.4
15288
- * http://jqueryui.com
15289
- *
15290
- * Copyright jQuery Foundation and other contributors
15291
- * Released under the MIT license.
15292
- * http://jquery.org/license
15293
- *
15294
- * http://api.jqueryui.com/tabs/
15295
- */
15296
-
15297
-
15298
- var tabs = $.widget( "ui.tabs", {
15299
- version: "1.11.4",
15300
- delay: 300,
15301
- options: {
15302
- active: null,
15303
- collapsible: false,
15304
- event: "click",
15305
- heightStyle: "content",
15306
- hide: null,
15307
- show: null,
15308
-
15309
- // callbacks
15310
- activate: null,
15311
- beforeActivate: null,
15312
- beforeLoad: null,
15313
- load: null
15314
- },
15315
-
15316
- _isLocal: (function() {
15317
- var rhash = /#.*$/;
15318
-
15319
- return function( anchor ) {
15320
- var anchorUrl, locationUrl;
15321
-
15322
- // support: IE7
15323
- // IE7 doesn't normalize the href property when set via script (#9317)
15324
- anchor = anchor.cloneNode( false );
15325
-
15326
- anchorUrl = anchor.href.replace( rhash, "" );
15327
- locationUrl = location.href.replace( rhash, "" );
15328
-
15329
- // decoding may throw an error if the URL isn't UTF-8 (#9518)
15330
- try {
15331
- anchorUrl = decodeURIComponent( anchorUrl );
15332
- } catch ( error ) {}
15333
- try {
15334
- locationUrl = decodeURIComponent( locationUrl );
15335
- } catch ( error ) {}
15336
-
15337
- return anchor.hash.length > 1 && anchorUrl === locationUrl;
15338
- };
15339
- })(),
15340
-
15341
- _create: function() {
15342
- var that = this,
15343
- options = this.options;
15344
-
15345
- this.running = false;
15346
-
15347
- this.element
15348
- .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
15349
- .toggleClass( "ui-tabs-collapsible", options.collapsible );
15350
-
15351
- this._processTabs();
15352
- options.active = this._initialActive();
15353
-
15354
- // Take disabling tabs via class attribute from HTML
15355
- // into account and update option properly.
15356
- if ( $.isArray( options.disabled ) ) {
15357
- options.disabled = $.unique( options.disabled.concat(
15358
- $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
15359
- return that.tabs.index( li );
15360
- })
15361
- ) ).sort();
15362
- }
15363
-
15364
- // check for length avoids error when initializing empty list
15365
- if ( this.options.active !== false && this.anchors.length ) {
15366
- this.active = this._findActive( options.active );
15367
- } else {
15368
- this.active = $();
15369
- }
15370
-
15371
- this._refresh();
15372
-
15373
- if ( this.active.length ) {
15374
- this.load( options.active );
15375
- }
15376
- },
15377
-
15378
- _initialActive: function() {
15379
- var active = this.options.active,
15380
- collapsible = this.options.collapsible,
15381
- locationHash = location.hash.substring( 1 );
15382
-
15383
- if ( active === null ) {
15384
- // check the fragment identifier in the URL
15385
- if ( locationHash ) {
15386
- this.tabs.each(function( i, tab ) {
15387
- if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
15388
- active = i;
15389
- return false;
15390
- }
15391
- });
15392
- }
15393
-
15394
- // check for a tab marked active via a class
15395
- if ( active === null ) {
15396
- active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
15397
- }
15398
-
15399
- // no active tab, set to false
15400
- if ( active === null || active === -1 ) {
15401
- active = this.tabs.length ? 0 : false;
15402
- }
15403
- }
15404
-
15405
- // handle numbers: negative, out of range
15406
- if ( active !== false ) {
15407
- active = this.tabs.index( this.tabs.eq( active ) );
15408
- if ( active === -1 ) {
15409
- active = collapsible ? false : 0;
15410
- }
15411
- }
15412
-
15413
- // don't allow collapsible: false and active: false
15414
- if ( !collapsible && active === false && this.anchors.length ) {
15415
- active = 0;
15416
- }
15417
-
15418
- return active;
15419
- },
15420
-
15421
- _getCreateEventData: function() {
15422
- return {
15423
- tab: this.active,
15424
- panel: !this.active.length ? $() : this._getPanelForTab( this.active )
15425
- };
15426
- },
15427
-
15428
- _tabKeydown: function( event ) {
15429
- var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
15430
- selectedIndex = this.tabs.index( focusedTab ),
15431
- goingForward = true;
15432
-
15433
- if ( this._handlePageNav( event ) ) {
15434
- return;
15435
- }
15436
-
15437
- switch ( event.keyCode ) {
15438
- case $.ui.keyCode.RIGHT:
15439
- case $.ui.keyCode.DOWN:
15440
- selectedIndex++;
15441
- break;
15442
- case $.ui.keyCode.UP:
15443
- case $.ui.keyCode.LEFT:
15444
- goingForward = false;
15445
- selectedIndex--;
15446
- break;
15447
- case $.ui.keyCode.END:
15448
- selectedIndex = this.anchors.length - 1;
15449
- break;
15450
- case $.ui.keyCode.HOME:
15451
- selectedIndex = 0;
15452
- break;
15453
- case $.ui.keyCode.SPACE:
15454
- // Activate only, no collapsing
15455
- event.preventDefault();
15456
- clearTimeout( this.activating );
15457
- this._activate( selectedIndex );
15458
- return;
15459
- case $.ui.keyCode.ENTER:
15460
- // Toggle (cancel delayed activation, allow collapsing)
15461
- event.preventDefault();
15462
- clearTimeout( this.activating );
15463
- // Determine if we should collapse or activate
15464
- this._activate( selectedIndex === this.options.active ? false : selectedIndex );
15465
- return;
15466
- default:
15467
- return;
15468
- }
15469
-
15470
- // Focus the appropriate tab, based on which key was pressed
15471
- event.preventDefault();
15472
- clearTimeout( this.activating );
15473
- selectedIndex = this._focusNextTab( selectedIndex, goingForward );
15474
-
15475
- // Navigating with control/command key will prevent automatic activation
15476
- if ( !event.ctrlKey && !event.metaKey ) {
15477
-
15478
- // Update aria-selected immediately so that AT think the tab is already selected.
15479
- // Otherwise AT may confuse the user by stating that they need to activate the tab,
15480
- // but the tab will already be activated by the time the announcement finishes.
15481
- focusedTab.attr( "aria-selected", "false" );
15482
- this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
15483
-
15484
- this.activating = this._delay(function() {
15485
- this.option( "active", selectedIndex );
15486
- }, this.delay );
15487
- }
15488
- },
15489
-
15490
- _panelKeydown: function( event ) {
15491
- if ( this._handlePageNav( event ) ) {
15492
- return;
15493
- }
15494
-
15495
- // Ctrl+up moves focus to the current tab
15496
- if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
15497
- event.preventDefault();
15498
- this.active.focus();
15499
- }
15500
- },
15501
-
15502
- // Alt+page up/down moves focus to the previous/next tab (and activates)
15503
- _handlePageNav: function( event ) {
15504
- if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
15505
- this._activate( this._focusNextTab( this.options.active - 1, false ) );
15506
- return true;
15507
- }
15508
- if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
15509
- this._activate( this._focusNextTab( this.options.active + 1, true ) );
15510
- return true;
15511
- }
15512
- },
15513
-
15514
- _findNextTab: function( index, goingForward ) {
15515
- var lastTabIndex = this.tabs.length - 1;
15516
-
15517
- function constrain() {
15518
- if ( index > lastTabIndex ) {
15519
- index = 0;
15520
- }
15521
- if ( index < 0 ) {
15522
- index = lastTabIndex;
15523
- }
15524
- return index;
15525
- }
15526
-
15527
- while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
15528
- index = goingForward ? index + 1 : index - 1;
15529
- }
15530
-
15531
- return index;
15532
- },
15533
-
15534
- _focusNextTab: function( index, goingForward ) {
15535
- index = this._findNextTab( index, goingForward );
15536
- this.tabs.eq( index ).focus();
15537
- return index;
15538
- },
15539
-
15540
- _setOption: function( key, value ) {
15541
- if ( key === "active" ) {
15542
- // _activate() will handle invalid values and update this.options
15543
- this._activate( value );
15544
- return;
15545
- }
15546
-
15547
- if ( key === "disabled" ) {
15548
- // don't use the widget factory's disabled handling
15549
- this._setupDisabled( value );
15550
- return;
15551
- }
15552
-
15553
- this._super( key, value);
15554
-
15555
- if ( key === "collapsible" ) {
15556
- this.element.toggleClass( "ui-tabs-collapsible", value );
15557
- // Setting collapsible: false while collapsed; open first panel
15558
- if ( !value && this.options.active === false ) {
15559
- this._activate( 0 );
15560
- }
15561
- }
15562
-
15563
- if ( key === "event" ) {
15564
- this._setupEvents( value );
15565
- }
15566
-
15567
- if ( key === "heightStyle" ) {
15568
- this._setupHeightStyle( value );
15569
- }
15570
- },
15571
-
15572
- _sanitizeSelector: function( hash ) {
15573
- return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
15574
- },
15575
-
15576
- refresh: function() {
15577
- var options = this.options,
15578
- lis = this.tablist.children( ":has(a[href])" );
15579
-
15580
- // get disabled tabs from class attribute from HTML
15581
- // this will get converted to a boolean if needed in _refresh()
15582
- options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
15583
- return lis.index( tab );
15584
- });
15585
-
15586
- this._processTabs();
15587
-
15588
- // was collapsed or no tabs
15589
- if ( options.active === false || !this.anchors.length ) {
15590
- options.active = false;
15591
- this.active = $();
15592
- // was active, but active tab is gone
15593
- } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
15594
- // all remaining tabs are disabled
15595
- if ( this.tabs.length === options.disabled.length ) {
15596
- options.active = false;
15597
- this.active = $();
15598
- // activate previous tab
15599
- } else {
15600
- this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
15601
- }
15602
- // was active, active tab still exists
15603
- } else {
15604
- // make sure active index is correct
15605
- options.active = this.tabs.index( this.active );
15606
- }
15607
-
15608
- this._refresh();
15609
- },
15610
-
15611
- _refresh: function() {
15612
- this._setupDisabled( this.options.disabled );
15613
- this._setupEvents( this.options.event );
15614
- this._setupHeightStyle( this.options.heightStyle );
15615
-
15616
- this.tabs.not( this.active ).attr({
15617
- "aria-selected": "false",
15618
- "aria-expanded": "false",
15619
- tabIndex: -1
15620
- });
15621
- this.panels.not( this._getPanelForTab( this.active ) )
15622
- .hide()
15623
- .attr({
15624
- "aria-hidden": "true"
15625
- });
15626
-
15627
- // Make sure one tab is in the tab order
15628
- if ( !this.active.length ) {
15629
- this.tabs.eq( 0 ).attr( "tabIndex", 0 );
15630
- } else {
15631
- this.active
15632
- .addClass( "ui-tabs-active ui-state-active" )
15633
- .attr({
15634
- "aria-selected": "true",
15635
- "aria-expanded": "true",
15636
- tabIndex: 0
15637
- });
15638
- this._getPanelForTab( this.active )
15639
- .show()
15640
- .attr({
15641
- "aria-hidden": "false"
15642
- });
15643
- }
15644
- },
15645
-
15646
- _processTabs: function() {
15647
- var that = this,
15648
- prevTabs = this.tabs,
15649
- prevAnchors = this.anchors,
15650
- prevPanels = this.panels;
15651
-
15652
- this.tablist = this._getList()
15653
- .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
15654
- .attr( "role", "tablist" )
15655
-
15656
- // Prevent users from focusing disabled tabs via click
15657
- .delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
15658
- if ( $( this ).is( ".ui-state-disabled" ) ) {
15659
- event.preventDefault();
15660
- }
15661
- })
15662
-
15663
- // support: IE <9
15664
- // Preventing the default action in mousedown doesn't prevent IE
15665
- // from focusing the element, so if the anchor gets focused, blur.
15666
- // We don't have to worry about focusing the previously focused
15667
- // element since clicking on a non-focusable element should focus
15668
- // the body anyway.
15669
- .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
15670
- if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
15671
- this.blur();
15672
- }
15673
- });
15674
-
15675
- this.tabs = this.tablist.find( "> li:has(a[href])" )
15676
- .addClass( "ui-state-default ui-corner-top" )
15677
- .attr({
15678
- role: "tab",
15679
- tabIndex: -1
15680
- });
15681
-
15682
- this.anchors = this.tabs.map(function() {
15683
- return $( "a", this )[ 0 ];
15684
- })
15685
- .addClass( "ui-tabs-anchor" )
15686
- .attr({
15687
- role: "presentation",
15688
- tabIndex: -1
15689
- });
15690
-
15691
- this.panels = $();
15692
-
15693
- this.anchors.each(function( i, anchor ) {
15694
- var selector, panel, panelId,
15695
- anchorId = $( anchor ).uniqueId().attr( "id" ),
15696
- tab = $( anchor ).closest( "li" ),
15697
- originalAriaControls = tab.attr( "aria-controls" );
15698
-
15699
- // inline tab
15700
- if ( that._isLocal( anchor ) ) {
15701
- selector = anchor.hash;
15702
- panelId = selector.substring( 1 );
15703
- panel = that.element.find( that._sanitizeSelector( selector ) );
15704
- // remote tab
15705
- } else {
15706
- // If the tab doesn't already have aria-controls,
15707
- // generate an id by using a throw-away element
15708
- panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
15709
- selector = "#" + panelId;
15710
- panel = that.element.find( selector );
15711
- if ( !panel.length ) {
15712
- panel = that._createPanel( panelId );
15713
- panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
15714
- }
15715
- panel.attr( "aria-live", "polite" );
15716
- }
15717
-
15718
- if ( panel.length) {
15719
- that.panels = that.panels.add( panel );
15720
- }
15721
- if ( originalAriaControls ) {
15722
- tab.data( "ui-tabs-aria-controls", originalAriaControls );
15723
- }
15724
- tab.attr({
15725
- "aria-controls": panelId,
15726
- "aria-labelledby": anchorId
15727
- });
15728
- panel.attr( "aria-labelledby", anchorId );
15729
- });
15730
-
15731
- this.panels
15732
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
15733
- .attr( "role", "tabpanel" );
15734
-
15735
- // Avoid memory leaks (#10056)
15736
- if ( prevTabs ) {
15737
- this._off( prevTabs.not( this.tabs ) );
15738
- this._off( prevAnchors.not( this.anchors ) );
15739
- this._off( prevPanels.not( this.panels ) );
15740
- }
15741
- },
15742
-
15743
- // allow overriding how to find the list for rare usage scenarios (#7715)
15744
- _getList: function() {
15745
- return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
15746
- },
15747
-
15748
- _createPanel: function( id ) {
15749
- return $( "<div>" )
15750
- .attr( "id", id )
15751
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
15752
- .data( "ui-tabs-destroy", true );
15753
- },
15754
-
15755
- _setupDisabled: function( disabled ) {
15756
- if ( $.isArray( disabled ) ) {
15757
- if ( !disabled.length ) {
15758
- disabled = false;
15759
- } else if ( disabled.length === this.anchors.length ) {
15760
- disabled = true;
15761
- }
15762
- }
15763
-
15764
- // disable tabs
15765
- for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
15766
- if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
15767
- $( li )
15768
- .addClass( "ui-state-disabled" )
15769
- .attr( "aria-disabled", "true" );
15770
- } else {
15771
- $( li )
15772
- .removeClass( "ui-state-disabled" )
15773
- .removeAttr( "aria-disabled" );
15774
- }
15775
- }
15776
-
15777
- this.options.disabled = disabled;
15778
- },
15779
-
15780
- _setupEvents: function( event ) {
15781
- var events = {};
15782
- if ( event ) {
15783
- $.each( event.split(" "), function( index, eventName ) {
15784
- events[ eventName ] = "_eventHandler";
15785
- });
15786
- }
15787
-
15788
- this._off( this.anchors.add( this.tabs ).add( this.panels ) );
15789
- // Always prevent the default action, even when disabled
15790
- this._on( true, this.anchors, {
15791
- click: function( event ) {
15792
- event.preventDefault();
15793
- }
15794
- });
15795
- this._on( this.anchors, events );
15796
- this._on( this.tabs, { keydown: "_tabKeydown" } );
15797
- this._on( this.panels, { keydown: "_panelKeydown" } );
15798
-
15799
- this._focusable( this.tabs );
15800
- this._hoverable( this.tabs );
15801
- },
15802
-
15803
- _setupHeightStyle: function( heightStyle ) {
15804
- var maxHeight,
15805
- parent = this.element.parent();
15806
-
15807
- if ( heightStyle === "fill" ) {
15808
- maxHeight = parent.height();
15809
- maxHeight -= this.element.outerHeight() - this.element.height();
15810
-
15811
- this.element.siblings( ":visible" ).each(function() {
15812
- var elem = $( this ),
15813
- position = elem.css( "position" );
15814
-
15815
- if ( position === "absolute" || position === "fixed" ) {
15816
- return;
15817
- }
15818
- maxHeight -= elem.outerHeight( true );
15819
- });
15820
-
15821
- this.element.children().not( this.panels ).each(function() {
15822
- maxHeight -= $( this ).outerHeight( true );
15823
- });
15824
-
15825
- this.panels.each(function() {
15826
- $( this ).height( Math.max( 0, maxHeight -
15827
- $( this ).innerHeight() + $( this ).height() ) );
15828
- })
15829
- .css( "overflow", "auto" );
15830
- } else if ( heightStyle === "auto" ) {
15831
- maxHeight = 0;
15832
- this.panels.each(function() {
15833
- maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
15834
- }).height( maxHeight );
15835
- }
15836
- },
15837
-
15838
- _eventHandler: function( event ) {
15839
- var options = this.options,
15840
- active = this.active,
15841
- anchor = $( event.currentTarget ),
15842
- tab = anchor.closest( "li" ),
15843
- clickedIsActive = tab[ 0 ] === active[ 0 ],
15844
- collapsing = clickedIsActive && options.collapsible,
15845
- toShow = collapsing ? $() : this._getPanelForTab( tab ),
15846
- toHide = !active.length ? $() : this._getPanelForTab( active ),
15847
- eventData = {
15848
- oldTab: active,
15849
- oldPanel: toHide,
15850
- newTab: collapsing ? $() : tab,
15851
- newPanel: toShow
15852
- };
15853
-
15854
- event.preventDefault();
15855
-
15856
- if ( tab.hasClass( "ui-state-disabled" ) ||
15857
- // tab is already loading
15858
- tab.hasClass( "ui-tabs-loading" ) ||
15859
- // can't switch durning an animation
15860
- this.running ||
15861
- // click on active header, but not collapsible
15862
- ( clickedIsActive && !options.collapsible ) ||
15863
- // allow canceling activation
15864
- ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
15865
- return;
15866
- }
15867
-
15868
- options.active = collapsing ? false : this.tabs.index( tab );
15869
-
15870
- this.active = clickedIsActive ? $() : tab;
15871
- if ( this.xhr ) {
15872
- this.xhr.abort();
15873
- }
15874
-
15875
- if ( !toHide.length && !toShow.length ) {
15876
- $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
15877
- }
15878
-
15879
- if ( toShow.length ) {
15880
- this.load( this.tabs.index( tab ), event );
15881
- }
15882
- this._toggle( event, eventData );
15883
- },
15884
-
15885
- // handles show/hide for selecting tabs
15886
- _toggle: function( event, eventData ) {
15887
- var that = this,
15888
- toShow = eventData.newPanel,
15889
- toHide = eventData.oldPanel;
15890
-
15891
- this.running = true;
15892
-
15893
- function complete() {
15894
- that.running = false;
15895
- that._trigger( "activate", event, eventData );
15896
- }
15897
-
15898
- function show() {
15899
- eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
15900
-
15901
- if ( toShow.length && that.options.show ) {
15902
- that._show( toShow, that.options.show, complete );
15903
- } else {
15904
- toShow.show();
15905
- complete();
15906
- }
15907
- }
15908
-
15909
- // start out by hiding, then showing, then completing
15910
- if ( toHide.length && this.options.hide ) {
15911
- this._hide( toHide, this.options.hide, function() {
15912
- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
15913
- show();
15914
- });
15915
- } else {
15916
- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
15917
- toHide.hide();
15918
- show();
15919
- }
15920
-
15921
- toHide.attr( "aria-hidden", "true" );
15922
- eventData.oldTab.attr({
15923
- "aria-selected": "false",
15924
- "aria-expanded": "false"
15925
- });
15926
- // If we're switching tabs, remove the old tab from the tab order.
15927
- // If we're opening from collapsed state, remove the previous tab from the tab order.
15928
- // If we're collapsing, then keep the collapsing tab in the tab order.
15929
- if ( toShow.length && toHide.length ) {
15930
- eventData.oldTab.attr( "tabIndex", -1 );
15931
- } else if ( toShow.length ) {
15932
- this.tabs.filter(function() {
15933
- return $( this ).attr( "tabIndex" ) === 0;
15934
- })
15935
- .attr( "tabIndex", -1 );
15936
- }
15937
-
15938
- toShow.attr( "aria-hidden", "false" );
15939
- eventData.newTab.attr({
15940
- "aria-selected": "true",
15941
- "aria-expanded": "true",
15942
- tabIndex: 0
15943
- });
15944
- },
15945
-
15946
- _activate: function( index ) {
15947
- var anchor,
15948
- active = this._findActive( index );
15949
-
15950
- // trying to activate the already active panel
15951
- if ( active[ 0 ] === this.active[ 0 ] ) {
15952
- return;
15953
- }
15954
-
15955
- // trying to collapse, simulate a click on the current active header
15956
- if ( !active.length ) {
15957
- active = this.active;
15958
- }
15959
-
15960
- anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
15961
- this._eventHandler({
15962
- target: anchor,
15963
- currentTarget: anchor,
15964
- preventDefault: $.noop
15965
- });
15966
- },
15967
-
15968
- _findActive: function( index ) {
15969
- return index === false ? $() : this.tabs.eq( index );
15970
- },
15971
-
15972
- _getIndex: function( index ) {
15973
- // meta-function to give users option to provide a href string instead of a numerical index.
15974
- if ( typeof index === "string" ) {
15975
- index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
15976
- }
15977
-
15978
- return index;
15979
- },
15980
-
15981
- _destroy: function() {
15982
- if ( this.xhr ) {
15983
- this.xhr.abort();
15984
- }
15985
-
15986
- this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
15987
-
15988
- this.tablist
15989
- .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
15990
- .removeAttr( "role" );
15991
-
15992
- this.anchors
15993
- .removeClass( "ui-tabs-anchor" )
15994
- .removeAttr( "role" )
15995
- .removeAttr( "tabIndex" )
15996
- .removeUniqueId();
15997
-
15998
- this.tablist.unbind( this.eventNamespace );
15999
-
16000
- this.tabs.add( this.panels ).each(function() {
16001
- if ( $.data( this, "ui-tabs-destroy" ) ) {
16002
- $( this ).remove();
16003
- } else {
16004
- $( this )
16005
- .removeClass( "ui-state-default ui-state-active ui-state-disabled " +
16006
- "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
16007
- .removeAttr( "tabIndex" )
16008
- .removeAttr( "aria-live" )
16009
- .removeAttr( "aria-busy" )
16010
- .removeAttr( "aria-selected" )
16011
- .removeAttr( "aria-labelledby" )
16012
- .removeAttr( "aria-hidden" )
16013
- .removeAttr( "aria-expanded" )
16014
- .removeAttr( "role" );
16015
- }
16016
- });
16017
-
16018
- this.tabs.each(function() {
16019
- var li = $( this ),
16020
- prev = li.data( "ui-tabs-aria-controls" );
16021
- if ( prev ) {
16022
- li
16023
- .attr( "aria-controls", prev )
16024
- .removeData( "ui-tabs-aria-controls" );
16025
- } else {
16026
- li.removeAttr( "aria-controls" );
16027
- }
16028
- });
16029
-
16030
- this.panels.show();
16031
-
16032
- if ( this.options.heightStyle !== "content" ) {
16033
- this.panels.css( "height", "" );
16034
- }
16035
- },
16036
-
16037
- enable: function( index ) {
16038
- var disabled = this.options.disabled;
16039
- if ( disabled === false ) {
16040
- return;
16041
- }
16042
-
16043
- if ( index === undefined ) {
16044
- disabled = false;
16045
- } else {
16046
- index = this._getIndex( index );
16047
- if ( $.isArray( disabled ) ) {
16048
- disabled = $.map( disabled, function( num ) {
16049
- return num !== index ? num : null;
16050
- });
16051
- } else {
16052
- disabled = $.map( this.tabs, function( li, num ) {
16053
- return num !== index ? num : null;
16054
- });
16055
- }
16056
- }
16057
- this._setupDisabled( disabled );
16058
- },
16059
-
16060
- disable: function( index ) {
16061
- var disabled = this.options.disabled;
16062
- if ( disabled === true ) {
16063
- return;
16064
- }
16065
-
16066
- if ( index === undefined ) {
16067
- disabled = true;
16068
- } else {
16069
- index = this._getIndex( index );
16070
- if ( $.inArray( index, disabled ) !== -1 ) {
16071
- return;
16072
- }
16073
- if ( $.isArray( disabled ) ) {
16074
- disabled = $.merge( [ index ], disabled ).sort();
16075
- } else {
16076
- disabled = [ index ];
16077
- }
16078
- }
16079
- this._setupDisabled( disabled );
16080
- },
16081
-
16082
- load: function( index, event ) {
16083
- index = this._getIndex( index );
16084
- var that = this,
16085
- tab = this.tabs.eq( index ),
16086
- anchor = tab.find( ".ui-tabs-anchor" ),
16087
- panel = this._getPanelForTab( tab ),
16088
- eventData = {
16089
- tab: tab,
16090
- panel: panel
16091
- },
16092
- complete = function( jqXHR, status ) {
16093
- if ( status === "abort" ) {
16094
- that.panels.stop( false, true );
16095
- }
16096
-
16097
- tab.removeClass( "ui-tabs-loading" );
16098
- panel.removeAttr( "aria-busy" );
16099
-
16100
- if ( jqXHR === that.xhr ) {
16101
- delete that.xhr;
16102
- }
16103
- };
16104
-
16105
- // not remote
16106
- if ( this._isLocal( anchor[ 0 ] ) ) {
16107
- return;
16108
- }
16109
-
16110
- this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
16111
-
16112
- // support: jQuery <1.8
16113
- // jQuery <1.8 returns false if the request is canceled in beforeSend,
16114
- // but as of 1.8, $.ajax() always returns a jqXHR object.
16115
- if ( this.xhr && this.xhr.statusText !== "canceled" ) {
16116
- tab.addClass( "ui-tabs-loading" );
16117
- panel.attr( "aria-busy", "true" );
16118
-
16119
- this.xhr
16120
- .done(function( response, status, jqXHR ) {
16121
- // support: jQuery <1.8
16122
- // http://bugs.jquery.com/ticket/11778
16123
- setTimeout(function() {
16124
- panel.html( response );
16125
- that._trigger( "load", event, eventData );
16126
-
16127
- complete( jqXHR, status );
16128
- }, 1 );
16129
- })
16130
- .fail(function( jqXHR, status ) {
16131
- // support: jQuery <1.8
16132
- // http://bugs.jquery.com/ticket/11778
16133
- setTimeout(function() {
16134
- complete( jqXHR, status );
16135
- }, 1 );
16136
- });
16137
- }
16138
- },
16139
-
16140
- _ajaxSettings: function( anchor, event, eventData ) {
16141
- var that = this;
16142
- return {
16143
- url: anchor.attr( "href" ),
16144
- beforeSend: function( jqXHR, settings ) {
16145
- return that._trigger( "beforeLoad", event,
16146
- $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
16147
- }
16148
- };
16149
- },
16150
-
16151
- _getPanelForTab: function( tab ) {
16152
- var id = $( tab ).attr( "aria-controls" );
16153
- return this.element.find( this._sanitizeSelector( "#" + id ) );
16154
- }
16155
- });
16156
-
16157
-
16158
- /*!
16159
- * jQuery UI Tooltip 1.11.4
16160
- * http://jqueryui.com
16161
- *
16162
- * Copyright jQuery Foundation and other contributors
16163
- * Released under the MIT license.
16164
- * http://jquery.org/license
16165
- *
16166
- * http://api.jqueryui.com/tooltip/
16167
- */
16168
-
16169
-
16170
- var tooltip = $.widget( "ui.tooltip", {
16171
- version: "1.11.4",
16172
- options: {
16173
- content: function() {
16174
- // support: IE<9, Opera in jQuery <1.7
16175
- // .text() can't accept undefined, so coerce to a string
16176
- var title = $( this ).attr( "title" ) || "";
16177
- // Escape title, since we're going from an attribute to raw HTML
16178
- return $( "<a>" ).text( title ).html();
16179
- },
16180
- hide: true,
16181
- // Disabled elements have inconsistent behavior across browsers (#8661)
16182
- items: "[title]:not([disabled])",
16183
- position: {
16184
- my: "left top+15",
16185
- at: "left bottom",
16186
- collision: "flipfit flip"
16187
- },
16188
- show: true,
16189
- tooltipClass: null,
16190
- track: false,
16191
-
16192
- // callbacks
16193
- close: null,
16194
- open: null
16195
- },
16196
-
16197
- _addDescribedBy: function( elem, id ) {
16198
- var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
16199
- describedby.push( id );
16200
- elem
16201
- .data( "ui-tooltip-id", id )
16202
- .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
16203
- },
16204
-
16205
- _removeDescribedBy: function( elem ) {
16206
- var id = elem.data( "ui-tooltip-id" ),
16207
- describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
16208
- index = $.inArray( id, describedby );
16209
-
16210
- if ( index !== -1 ) {
16211
- describedby.splice( index, 1 );
16212
- }
16213
-
16214
- elem.removeData( "ui-tooltip-id" );
16215
- describedby = $.trim( describedby.join( " " ) );
16216
- if ( describedby ) {
16217
- elem.attr( "aria-describedby", describedby );
16218
- } else {
16219
- elem.removeAttr( "aria-describedby" );
16220
- }
16221
- },
16222
-
16223
- _create: function() {
16224
- this._on({
16225
- mouseover: "open",
16226
- focusin: "open"
16227
- });
16228
-
16229
- // IDs of generated tooltips, needed for destroy
16230
- this.tooltips = {};
16231
-
16232
- // IDs of parent tooltips where we removed the title attribute
16233
- this.parents = {};
16234
-
16235
- if ( this.options.disabled ) {
16236
- this._disable();
16237
- }
16238
-
16239
- // Append the aria-live region so tooltips announce correctly
16240
- this.liveRegion = $( "<div>" )
16241
- .attr({
16242
- role: "log",
16243
- "aria-live": "assertive",
16244
- "aria-relevant": "additions"
16245
- })
16246
- .addClass( "ui-helper-hidden-accessible" )
16247
- .appendTo( this.document[ 0 ].body );
16248
- },
16249
-
16250
- _setOption: function( key, value ) {
16251
- var that = this;
16252
-
16253
- if ( key === "disabled" ) {
16254
- this[ value ? "_disable" : "_enable" ]();
16255
- this.options[ key ] = value;
16256
- // disable element style changes
16257
- return;
16258
- }
16259
-
16260
- this._super( key, value );
16261
-
16262
- if ( key === "content" ) {
16263
- $.each( this.tooltips, function( id, tooltipData ) {
16264
- that._updateContent( tooltipData.element );
16265
- });
16266
- }
16267
- },
16268
-
16269
- _disable: function() {
16270
- var that = this;
16271
-
16272
- // close open tooltips
16273
- $.each( this.tooltips, function( id, tooltipData ) {
16274
- var event = $.Event( "blur" );
16275
- event.target = event.currentTarget = tooltipData.element[ 0 ];
16276
- that.close( event, true );
16277
- });
16278
-
16279
- // remove title attributes to prevent native tooltips
16280
- this.element.find( this.options.items ).addBack().each(function() {
16281
- var element = $( this );
16282
- if ( element.is( "[title]" ) ) {
16283
- element
16284
- .data( "ui-tooltip-title", element.attr( "title" ) )
16285
- .removeAttr( "title" );
16286
- }
16287
- });
16288
- },
16289
-
16290
- _enable: function() {
16291
- // restore title attributes
16292
- this.element.find( this.options.items ).addBack().each(function() {
16293
- var element = $( this );
16294
- if ( element.data( "ui-tooltip-title" ) ) {
16295
- element.attr( "title", element.data( "ui-tooltip-title" ) );
16296
- }
16297
- });
16298
- },
16299
-
16300
- open: function( event ) {
16301
- var that = this,
16302
- target = $( event ? event.target : this.element )
16303
- // we need closest here due to mouseover bubbling,
16304
- // but always pointing at the same event target
16305
- .closest( this.options.items );
16306
-
16307
- // No element to show a tooltip for or the tooltip is already open
16308
- if ( !target.length || target.data( "ui-tooltip-id" ) ) {
16309
- return;
16310
- }
16311
-
16312
- if ( target.attr( "title" ) ) {
16313
- target.data( "ui-tooltip-title", target.attr( "title" ) );
16314
- }
16315
-
16316
- target.data( "ui-tooltip-open", true );
16317
-
16318
- // kill parent tooltips, custom or native, for hover
16319
- if ( event && event.type === "mouseover" ) {
16320
- target.parents().each(function() {
16321
- var parent = $( this ),
16322
- blurEvent;
16323
- if ( parent.data( "ui-tooltip-open" ) ) {
16324
- blurEvent = $.Event( "blur" );
16325
- blurEvent.target = blurEvent.currentTarget = this;
16326
- that.close( blurEvent, true );
16327
- }
16328
- if ( parent.attr( "title" ) ) {
16329
- parent.uniqueId();
16330
- that.parents[ this.id ] = {
16331
- element: this,
16332
- title: parent.attr( "title" )
16333
- };
16334
- parent.attr( "title", "" );
16335
- }
16336
- });
16337
- }
16338
-
16339
- this._registerCloseHandlers( event, target );
16340
- this._updateContent( target, event );
16341
- },
16342
-
16343
- _updateContent: function( target, event ) {
16344
- var content,
16345
- contentOption = this.options.content,
16346
- that = this,
16347
- eventType = event ? event.type : null;
16348
-
16349
- if ( typeof contentOption === "string" ) {
16350
- return this._open( event, target, contentOption );
16351
- }
16352
-
16353
- content = contentOption.call( target[0], function( response ) {
16354
-
16355
- // IE may instantly serve a cached response for ajax requests
16356
- // delay this call to _open so the other call to _open runs first
16357
- that._delay(function() {
16358
-
16359
- // Ignore async response if tooltip was closed already
16360
- if ( !target.data( "ui-tooltip-open" ) ) {
16361
- return;
16362
- }
16363
-
16364
- // jQuery creates a special event for focusin when it doesn't
16365
- // exist natively. To improve performance, the native event
16366
- // object is reused and the type is changed. Therefore, we can't
16367
- // rely on the type being correct after the event finished
16368
- // bubbling, so we set it back to the previous value. (#8740)
16369
- if ( event ) {
16370
- event.type = eventType;
16371
- }
16372
- this._open( event, target, response );
16373
- });
16374
- });
16375
- if ( content ) {
16376
- this._open( event, target, content );
16377
- }
16378
- },
16379
-
16380
- _open: function( event, target, content ) {
16381
- var tooltipData, tooltip, delayedShow, a11yContent,
16382
- positionOption = $.extend( {}, this.options.position );
16383
-
16384
- if ( !content ) {
16385
- return;
16386
- }
16387
-
16388
- // Content can be updated multiple times. If the tooltip already
16389
- // exists, then just update the content and bail.
16390
- tooltipData = this._find( target );
16391
- if ( tooltipData ) {
16392
- tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
16393
- return;
16394
- }
16395
-
16396
- // if we have a title, clear it to prevent the native tooltip
16397
- // we have to check first to avoid defining a title if none exists
16398
- // (we don't want to cause an element to start matching [title])
16399
- //
16400
- // We use removeAttr only for key events, to allow IE to export the correct
16401
- // accessible attributes. For mouse events, set to empty string to avoid
16402
- // native tooltip showing up (happens only when removing inside mouseover).
16403
- if ( target.is( "[title]" ) ) {
16404
- if ( event && event.type === "mouseover" ) {
16405
- target.attr( "title", "" );
16406
- } else {
16407
- target.removeAttr( "title" );
16408
- }
16409
- }
16410
-
16411
- tooltipData = this._tooltip( target );
16412
- tooltip = tooltipData.tooltip;
16413
- this._addDescribedBy( target, tooltip.attr( "id" ) );
16414
- tooltip.find( ".ui-tooltip-content" ).html( content );
16415
-
16416
- // Support: Voiceover on OS X, JAWS on IE <= 9
16417
- // JAWS announces deletions even when aria-relevant="additions"
16418
- // Voiceover will sometimes re-read the entire log region's contents from the beginning
16419
- this.liveRegion.children().hide();
16420
- if ( content.clone ) {
16421
- a11yContent = content.clone();
16422
- a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
16423
- } else {
16424
- a11yContent = content;
16425
- }
16426
- $( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
16427
-
16428
- function position( event ) {
16429
- positionOption.of = event;
16430
- if ( tooltip.is( ":hidden" ) ) {
16431
- return;
16432
- }
16433
- tooltip.position( positionOption );
16434
- }
16435
- if ( this.options.track && event && /^mouse/.test( event.type ) ) {
16436
- this._on( this.document, {
16437
- mousemove: position
16438
- });
16439
- // trigger once to override element-relative positioning
16440
- position( event );
16441
- } else {
16442
- tooltip.position( $.extend({
16443
- of: target
16444
- }, this.options.position ) );
16445
- }
16446
-
16447
- tooltip.hide();
16448
-
16449
- this._show( tooltip, this.options.show );
16450
- // Handle tracking tooltips that are shown with a delay (#8644). As soon
16451
- // as the tooltip is visible, position the tooltip using the most recent
16452
- // event.
16453
- if ( this.options.show && this.options.show.delay ) {
16454
- delayedShow = this.delayedShow = setInterval(function() {
16455
- if ( tooltip.is( ":visible" ) ) {
16456
- position( positionOption.of );
16457
- clearInterval( delayedShow );
16458
- }
16459
- }, $.fx.interval );
16460
- }
16461
-
16462
- this._trigger( "open", event, { tooltip: tooltip } );
16463
- },
16464
-
16465
- _registerCloseHandlers: function( event, target ) {
16466
- var events = {
16467
- keyup: function( event ) {
16468
- if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
16469
- var fakeEvent = $.Event(event);
16470
- fakeEvent.currentTarget = target[0];
16471
- this.close( fakeEvent, true );
16472
- }
16473
- }
16474
- };
16475
-
16476
- // Only bind remove handler for delegated targets. Non-delegated
16477
- // tooltips will handle this in destroy.
16478
- if ( target[ 0 ] !== this.element[ 0 ] ) {
16479
- events.remove = function() {
16480
- this._removeTooltip( this._find( target ).tooltip );
16481
- };
16482
- }
16483
-
16484
- if ( !event || event.type === "mouseover" ) {
16485
- events.mouseleave = "close";
16486
- }
16487
- if ( !event || event.type === "focusin" ) {
16488
- events.focusout = "close";
16489
- }
16490
- this._on( true, target, events );
16491
- },
16492
-
16493
- close: function( event ) {
16494
- var tooltip,
16495
- that = this,
16496
- target = $( event ? event.currentTarget : this.element ),
16497
- tooltipData = this._find( target );
16498
-
16499
- // The tooltip may already be closed
16500
- if ( !tooltipData ) {
16501
-
16502
- // We set ui-tooltip-open immediately upon open (in open()), but only set the
16503
- // additional data once there's actually content to show (in _open()). So even if the
16504
- // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
16505
- // the period between open() and _open().
16506
- target.removeData( "ui-tooltip-open" );
16507
- return;
16508
- }
16509
-
16510
- tooltip = tooltipData.tooltip;
16511
-
16512
- // disabling closes the tooltip, so we need to track when we're closing
16513
- // to avoid an infinite loop in case the tooltip becomes disabled on close
16514
- if ( tooltipData.closing ) {
16515
- return;
16516
- }
16517
-
16518
- // Clear the interval for delayed tracking tooltips
16519
- clearInterval( this.delayedShow );
16520
-
16521
- // only set title if we had one before (see comment in _open())
16522
- // If the title attribute has changed since open(), don't restore
16523
- if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
16524
- target.attr( "title", target.data( "ui-tooltip-title" ) );
16525
- }
16526
-
16527
- this._removeDescribedBy( target );
16528
-
16529
- tooltipData.hiding = true;
16530
- tooltip.stop( true );
16531
- this._hide( tooltip, this.options.hide, function() {
16532
- that._removeTooltip( $( this ) );
16533
- });
16534
-
16535
- target.removeData( "ui-tooltip-open" );
16536
- this._off( target, "mouseleave focusout keyup" );
16537
-
16538
- // Remove 'remove' binding only on delegated targets
16539
- if ( target[ 0 ] !== this.element[ 0 ] ) {
16540
- this._off( target, "remove" );
16541
- }
16542
- this._off( this.document, "mousemove" );
16543
-
16544
- if ( event && event.type === "mouseleave" ) {
16545
- $.each( this.parents, function( id, parent ) {
16546
- $( parent.element ).attr( "title", parent.title );
16547
- delete that.parents[ id ];
16548
- });
16549
- }
16550
-
16551
- tooltipData.closing = true;
16552
- this._trigger( "close", event, { tooltip: tooltip } );
16553
- if ( !tooltipData.hiding ) {
16554
- tooltipData.closing = false;
16555
- }
16556
- },
16557
-
16558
- _tooltip: function( element ) {
16559
- var tooltip = $( "<div>" )
16560
- .attr( "role", "tooltip" )
16561
- .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
16562
- ( this.options.tooltipClass || "" ) ),
16563
- id = tooltip.uniqueId().attr( "id" );
16564
-
16565
- $( "<div>" )
16566
- .addClass( "ui-tooltip-content" )
16567
- .appendTo( tooltip );
16568
-
16569
- tooltip.appendTo( this.document[0].body );
16570
-
16571
- return this.tooltips[ id ] = {
16572
- element: element,
16573
- tooltip: tooltip
16574
- };
16575
- },
16576
-
16577
- _find: function( target ) {
16578
- var id = target.data( "ui-tooltip-id" );
16579
- return id ? this.tooltips[ id ] : null;
16580
- },
16581
-
16582
- _removeTooltip: function( tooltip ) {
16583
- tooltip.remove();
16584
- delete this.tooltips[ tooltip.attr( "id" ) ];
16585
- },
16586
-
16587
- _destroy: function() {
16588
- var that = this;
16589
-
16590
- // close open tooltips
16591
- $.each( this.tooltips, function( id, tooltipData ) {
16592
- // Delegate to close method to handle common cleanup
16593
- var event = $.Event( "blur" ),
16594
- element = tooltipData.element;
16595
- event.target = event.currentTarget = element[ 0 ];
16596
- that.close( event, true );
16597
-
16598
- // Remove immediately; destroying an open tooltip doesn't use the
16599
- // hide animation
16600
- $( "#" + id ).remove();
16601
-
16602
- // Restore the title
16603
- if ( element.data( "ui-tooltip-title" ) ) {
16604
- // If the title attribute has changed since open(), don't restore
16605
- if ( !element.attr( "title" ) ) {
16606
- element.attr( "title", element.data( "ui-tooltip-title" ) );
16607
- }
16608
- element.removeData( "ui-tooltip-title" );
16609
- }
16610
- });
16611
- this.liveRegion.remove();
16612
- }
16613
- });
16614
-
16615
-
16616
-
16617
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
jquery-ui-1.11.4/jquery-ui.min.css CHANGED
File without changes
jquery-ui-1.11.4/jquery-ui.min.js DELETED
@@ -1,13 +0,0 @@
1
- /*! jQuery UI - v1.11.4 - 2015-03-11
2
- * http://jqueryui.com
3
- * Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
4
- * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
5
-
6
- (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",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}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);
7
- i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);
8
- return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(j&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)
9
- },_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;
10
- if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
11
- f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
12
- return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;
13
- this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position