Comments – wpDiscuz - Version 2.2.1

Version Description

  • Fixed Bug : Front-end Phrases don't suport Special Characters
Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.1.10 to 2.2.1

Files changed (64) hide show
  1. comment-form/form.php +30 -11
  2. comment-form/tpl-comment.php +43 -10
  3. files/css/fv.css +0 -69
  4. files/css/fv.min.css +1 -0
  5. files/css/options-css.css +0 -11
  6. files/css/options-css.min.css +1 -0
  7. files/css/wpdiscuz-rtl.css +0 -37
  8. files/css/wpdiscuz-rtl.min.css +1 -0
  9. files/css/wpdiscuz.css +0 -591
  10. files/css/wpdiscuz.min.css +2 -0
  11. files/img/facebook.png +0 -0
  12. files/img/gplus.png +0 -0
  13. files/img/social-icons/fb-18x18-orig.png +0 -0
  14. files/img/social-icons/google-18x18-orig.png +0 -0
  15. files/img/social-icons/ok-18x18-orig.png +0 -0
  16. files/img/social-icons/ok-18x18.png +0 -0
  17. files/img/social-icons/ok-24x24.png +0 -0
  18. files/img/social-icons/twitter-18x18-orig.png +0 -0
  19. files/img/social-icons/vk-18x18-orig.png +0 -0
  20. files/img/social-icons/vk-18x18.png +0 -0
  21. files/img/social-icons/vk-24x24.png +0 -0
  22. files/img/twitter.png +0 -0
  23. files/js/jquery.cookie.js +0 -117
  24. files/js/jquery.cookie.min.js +8 -0
  25. files/js/options-js.js +0 -89
  26. files/js/options-js.min.js +1 -0
  27. files/js/validator.js +0 -392
  28. files/js/validator.min.js +1 -0
  29. files/js/wc-ajax.js +0 -747
  30. files/js/wc-ajax.min.js +1 -0
  31. files/js/wc-frontend.js +0 -5
  32. files/js/wc-frontend.min.js +1 -0
  33. files/js/wc-scripts.js +0 -62
  34. files/js/wc-scripts.min.js +1 -0
  35. files/third-party/colorpicker/css/colorpicker.css +0 -161
  36. files/third-party/colorpicker/css/colorpicker.min.css +1 -0
  37. files/third-party/colorpicker/js/colorpicker.js +0 -529
  38. files/third-party/colorpicker/js/colorpicker.min.js +1 -0
  39. files/third-party/easy-responsive-tabs/css/easy-responsive-tabs.css +0 -70
  40. files/third-party/easy-responsive-tabs/css/easy-responsive-tabs.min.css +1 -0
  41. files/third-party/easy-responsive-tabs/js/easy-responsive-tabs.js +0 -224
  42. files/third-party/easy-responsive-tabs/js/easy-responsive-tabs.min.js +1 -0
  43. files/third-party/jquery-ui/jquery-ui.js +0 -16582
  44. files/third-party/jquery-ui/jquery-ui.min.js +423 -0
  45. files/third-party/modal-box/modal-box-ie.css +0 -8
  46. files/third-party/modal-box/modal-box-ie.min.css +1 -0
  47. files/third-party/modal-box/modal-box.css +0 -75
  48. files/third-party/modal-box/modal-box.min.css +1 -0
  49. files/third-party/tooltipster/css/tooltipster.css +0 -274
  50. files/third-party/tooltipster/css/tooltipster.min.css +1 -0
  51. files/third-party/tooltipster/js/html5.js +0 -8
  52. files/third-party/tooltipster/js/html5.min.js +1 -0
  53. includes/wc-db-helper.php +2 -2
  54. languages/wpdiscuz-ru_RU.po +2 -2
  55. options/options-layouts/settings-general.php +22 -0
  56. options/options-layouts/settings-show-hide.php +14 -12
  57. options/options-layouts/settings-social.php +82 -0
  58. options/phrases-layout/phrases-comment.php +30 -0
  59. options/phrases-layout/phrases-form.php +11 -1
  60. options/phrases-layout/phrases-notification.php +10 -0
  61. options/wc-options-serialize.php +49 -11
  62. options/wc-options.php +10 -1
  63. readme.txt +30 -13
  64. wc.php +9 -10
comment-form/form.php CHANGED
@@ -2,6 +2,8 @@
2
  global $post, $wc_core, $current_user;
3
  get_currentuserinfo();
4
 
 
 
5
  if ($wc_core->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
6
  $wc_core->wc_options_serialized->wc_phrases = $wc_core->wc_db_helper->get_phrases();
7
  }
@@ -13,6 +15,7 @@ $wc_comment_list_update_type = $wc_core->wc_options_serialized->wc_comment_list_
13
  wpdiscuzValidator.message['invalid'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_invalid_field']; ?>';
14
  wpdiscuzValidator.message['empty'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_error_empty_text']; ?>';
15
  wpdiscuzValidator.message['email'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_error_email_text']; ?>';
 
16
 
17
  jQuery(document).ready(function ($) {
18
  $(document).delegate('.wc-toggle', 'click', function () {
@@ -50,6 +53,13 @@ $header_text = '<span class="wc_header_text_count">' . $post->comment_count . '<
50
  $header_text .= ($post->comment_count > 1) ? $wc_core->wc_options_serialized->wc_phrases['wc_header_text_plural'] : $wc_core->wc_options_serialized->wc_phrases['wc_header_text'];
51
  $header_text .= ' ' . $wc_core->wc_options_serialized->wc_phrases['wc_header_on_text'];
52
  $header_text .= ' "' . get_the_title($post) . '"';
 
 
 
 
 
 
 
53
  ?>
54
  <div style="clear:both"></div>
55
 
@@ -81,7 +91,6 @@ $header_text .= ' "' . get_the_title($post) . '"';
81
  <h3 id="wc-comment-header"><?php echo $wc_core->wc_options_serialized->wc_phrases['wc_leave_a_reply_text']; ?></h3>
82
  <?php } ?>
83
  <?php do_action('comment_form_before'); ?>
84
-
85
  <?php
86
  if ($wc_core->wc_options_serialized->wc_show_hide_loggedin_username) {
87
  if (is_user_logged_in()) {
@@ -98,11 +107,16 @@ $header_text .= ' "' . get_the_title($post) . '"';
98
  }
99
  }
100
  ?>
101
- <div id="wpcomm">
102
- <p class="wc-comment-title">
103
- <?php echo ($post->comment_count) ? $header_text : $wc_core->wc_options_serialized->wc_phrases['wc_be_the_first_text']; ?>
104
- </p>
105
- <?php do_action('comment_form_top'); ?>
 
 
 
 
 
106
  <div class="wc-form-wrapper">
107
  <?php
108
  if ($wc_core->is_guest_can_comment()) {
@@ -119,8 +133,8 @@ $header_text .= ' "' . get_the_title($post) . '"';
119
  <div id="wc-form-footer-<?php echo $unique_id; ?>" class="wc-form-footer">
120
  <?php if (!is_user_logged_in()) { ?>
121
  <div class="wc-author-data">
122
- <div class="wc-field-name wpdiscuz-item"><input id="wc_name-<?php echo $unique_id; ?>" class="wc_name wc_field_input" name="wc_name" required="required" value="" type="text" placeholder="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_name_text'] ?>"/></div>
123
- <div class="wc-field-email wpdiscuz-item"><input id="wc_email-<?php echo $unique_id; ?>" class="wc_email wc_field_input email" name="wc_email" required="required" value="" type="email" placeholder="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_email_text']; ?>"/></div>
124
  <div style="clear:both"></div>
125
  </div>
126
  <?php } ?>
@@ -137,13 +151,18 @@ $header_text .= ' "' . get_the_title($post) . '"';
137
  </div>
138
  <?php } ?>
139
  <?php } ?>
140
- <div class="wc-field-submit"><input type="button" name="submit" value="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_submit_text']; ?>" id="wc_comm-<?php echo $unique_id; ?>" class="wc_comm_submit button alt"/></div>
 
 
 
 
 
141
  <div style="clear:both"></div>
142
  </div>
143
  <?php if ($wc_core->wc_options_serialized->wc_show_hide_comment_checkbox || $wc_core->wc_options_serialized->wc_show_hide_reply_checkbox || $wc_core->wc_options_serialized->wc_show_hide_all_reply_checkbox) { ?>
144
- <span class="wc_manage_subscribtions" <?php if(class_exists('Prompt_Comment_Form_Handling') && $wc_core->wc_options_serialized->wc_use_postmatic_for_comment_notification) echo 'style="display:none"' ?>><?php echo $wc_core->wc_options_serialized->wc_phrases['wc_manage_subscribtions']; ?> &or;</span>
145
  <?php } ?>
146
- <div class="wc_notification_checkboxes" <?php if(class_exists('Prompt_Comment_Form_Handling') && $wc_core->wc_options_serialized->wc_use_postmatic_for_comment_notification) echo 'style="display:block"' ?>>
147
  <?php
148
  $wc_is_user_subscription_confirmed = $wc_core->wc_db_helper->wc_is_user_subscription_confirmed($post->ID, $current_user->user_email);
149
  $wc_subscription_phrase = ($wc_is_user_subscription_confirmed == 1) ? $wc_core->wc_options_serialized->wc_phrases['wc_unsubscribe'] : $wc_core->wc_options_serialized->wc_phrases['wc_ignore_subscription'];
2
  global $post, $wc_core, $current_user;
3
  get_currentuserinfo();
4
 
5
+ error_reporting(0);
6
+
7
  if ($wc_core->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
8
  $wc_core->wc_options_serialized->wc_phrases = $wc_core->wc_db_helper->get_phrases();
9
  }
15
  wpdiscuzValidator.message['invalid'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_invalid_field']; ?>';
16
  wpdiscuzValidator.message['empty'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_error_empty_text']; ?>';
17
  wpdiscuzValidator.message['email'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_error_email_text']; ?>';
18
+ wpdiscuzValidator.message['url'] = '<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_error_url_text']; ?>';
19
 
20
  jQuery(document).ready(function ($) {
21
  $(document).delegate('.wc-toggle', 'click', function () {
53
  $header_text .= ($post->comment_count > 1) ? $wc_core->wc_options_serialized->wc_phrases['wc_header_text_plural'] : $wc_core->wc_options_serialized->wc_phrases['wc_header_text'];
54
  $header_text .= ' ' . $wc_core->wc_options_serialized->wc_phrases['wc_header_on_text'];
55
  $header_text .= ' "' . get_the_title($post) . '"';
56
+
57
+ $wc_is_name_field_required = ($wc_core->wc_options_serialized->wc_is_name_field_required) ? 'required="required"' : '';
58
+ $wc_is_email_field_required = ($wc_core->wc_options_serialized->wc_is_email_field_required) ? 'required="required"' : '';
59
+
60
+
61
+ ob_start(); do_action('comment_form_top'); $wc_comment_form_top_content = ob_get_contents(); ob_clean();
62
+ if( strpos('champ_login') !== FALSE ){ if( preg_match_all('|<li[^><]*>.+?</li>|is', $wc_comment_form_top_content, $wc_social_buttons, PREG_SET_ORDER ) ){ foreach( $wc_social_buttons as $wc_social_button ){ $wc_social_buttons_array[] = $wc_social_button[0]; } $wc_comment_form_top_content = '<div class="wp-social-login-widget"><div class="wp-social-login-connect-with_by_the_champ">'.__('Connect with').':</div><div class="wp-social-login-provider-list"><ul class="wc_social_login_by_the_champ">'.implode('', $wc_social_buttons_array).'</ul><div style="clear:both"></div></div></div>'; } }
63
  ?>
64
  <div style="clear:both"></div>
65
 
91
  <h3 id="wc-comment-header"><?php echo $wc_core->wc_options_serialized->wc_phrases['wc_leave_a_reply_text']; ?></h3>
92
  <?php } ?>
93
  <?php do_action('comment_form_before'); ?>
 
94
  <?php
95
  if ($wc_core->wc_options_serialized->wc_show_hide_loggedin_username) {
96
  if (is_user_logged_in()) {
107
  }
108
  }
109
  ?>
110
+ <div id="wpcomm">
111
+ <div class="wc-comment-bar">
112
+ <p class="wc-comment-title">
113
+ <?php echo ($post->comment_count) ? $header_text : $wc_core->wc_options_serialized->wc_phrases['wc_be_the_first_text']; ?>
114
+ </p>
115
+ <div style="clear:both"></div>
116
+ </div>
117
+ <div class="wc_social_plugin_wrapper">
118
+ <?php echo $wc_comment_form_top_content; ?>
119
+ </div>
120
  <div class="wc-form-wrapper">
121
  <?php
122
  if ($wc_core->is_guest_can_comment()) {
133
  <div id="wc-form-footer-<?php echo $unique_id; ?>" class="wc-form-footer">
134
  <?php if (!is_user_logged_in()) { ?>
135
  <div class="wc-author-data">
136
+ <div class="wc-field-name wpdiscuz-item"><input id="wc_name-<?php echo $unique_id; ?>" class="wc_name wc_field_input" name="wc_name" <?php echo $wc_is_name_field_required; ?> value="" type="text" placeholder="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_name_text'] ?>"/></div>
137
+ <div class="wc-field-email wpdiscuz-item"><input id="wc_email-<?php echo $unique_id; ?>" class="wc_email wc_field_input email" name="wc_email" <?php echo $wc_is_email_field_required; ?> value="" type="email" placeholder="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_email_text']; ?>"/></div>
138
  <div style="clear:both"></div>
139
  </div>
140
  <?php } ?>
151
  </div>
152
  <?php } ?>
153
  <?php } ?>
154
+ <div class="wc-field-submit">
155
+ <?php if (!is_user_logged_in() && !$wc_core->wc_options_serialized->wc_weburl_show_hide) { ?>
156
+ <div class="wc-field-website wpdiscuz-item"><input id="wc_website-<?php echo $unique_id; ?>" class="wc_website wc_field_input" name="wc_website" value="" type="url" placeholder="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_website_text'] ?>"/></div>
157
+ <?php } ?>
158
+ <input type="button" name="submit" value="<?php echo $wc_core->wc_options_serialized->wc_phrases['wc_submit_text']; ?>" id="wc_comm-<?php echo $unique_id; ?>" class="wc_comm_submit button alt"/>
159
+ </div>
160
  <div style="clear:both"></div>
161
  </div>
162
  <?php if ($wc_core->wc_options_serialized->wc_show_hide_comment_checkbox || $wc_core->wc_options_serialized->wc_show_hide_reply_checkbox || $wc_core->wc_options_serialized->wc_show_hide_all_reply_checkbox) { ?>
163
+ <span class="wc_manage_subscribtions" <?php if (class_exists('Prompt_Comment_Form_Handling') && $wc_core->wc_options_serialized->wc_use_postmatic_for_comment_notification) echo 'style="display:none"' ?>><?php echo $wc_core->wc_options_serialized->wc_phrases['wc_manage_subscribtions']; ?> &or;</span>
164
  <?php } ?>
165
+ <div class="wc_notification_checkboxes" <?php if (class_exists('Prompt_Comment_Form_Handling') && $wc_core->wc_options_serialized->wc_use_postmatic_for_comment_notification) echo 'style="display:block"' ?>>
166
  <?php
167
  $wc_is_user_subscription_confirmed = $wc_core->wc_db_helper->wc_is_user_subscription_confirmed($post->ID, $current_user->user_email);
168
  $wc_subscription_phrase = ($wc_is_user_subscription_confirmed == 1) ? $wc_core->wc_options_serialized->wc_phrases['wc_unsubscribe'] : $wc_core->wc_options_serialized->wc_phrases['wc_ignore_subscription'];
comment-form/tpl-comment.php CHANGED
@@ -27,7 +27,7 @@ class WC_Comment_Template_Builder {
27
 
28
  $comment_content = wp_kses($comment->comment_content, array(
29
  'br' => array(),
30
- 'a' => array('href' => array(), 'title' => array()),
31
  'i' => array(),
32
  'b' => array(),
33
  'u' => array(),
@@ -43,7 +43,11 @@ class WC_Comment_Template_Builder {
43
  $vote_title_text = '';
44
  $user = get_user_by('id', $comment->user_id);
45
  $wc_author_title_class = '';
 
 
 
46
  if ($user) {
 
47
  $post = get_post($comment->comment_post_ID);
48
  if ($user->ID == $post->post_author) {
49
  $wc_author_title_class = 'wc-post-author';
@@ -81,15 +85,23 @@ class WC_Comment_Template_Builder {
81
  $unique_id = $this->get_unique_id($comment);
82
 
83
  $wc_author_name = $comment->comment_author ? $comment->comment_author : __('Anonymous', WC_Core::$TEXT_DOMAIN);
84
-
85
  $wc_comm_author_avatar = $this->wc_helper->get_comment_author_avatar($comment);
86
  $wc_profile_url = $this->get_profile_url($user);
87
 
88
  if ($wc_profile_url) {
89
  $wc_comm_author_avatar = "<a href='$wc_profile_url'>" . $this->wc_helper->get_comment_author_avatar($comment) . "</a>";
90
- $wc_author_name = "<a href='$wc_profile_url'>" . $wc_author_name . "</a>";
 
91
  }
92
 
 
 
 
 
 
 
 
 
93
  $child_comments = get_comments(array(
94
  'parent' => $comment->comment_ID,
95
  'status' => 'approve'
@@ -155,9 +167,11 @@ class WC_Comment_Template_Builder {
155
  $twitt_content = strip_tags($comment_content) . ' ' . get_comment_link($comment);
156
 
157
  $output .= '<span id="share_buttons_box-' . $unique_id . '" class="share_buttons_box">';
158
- $output .= '<a target="_blank" href="http://www.facebook.com/sharer.php" title="' . $this->wc_options_serialized->wc_phrases['wc_share_facebook'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/fb-18x18.png') . '"/></a>&nbsp;&nbsp;';
159
- $output .= '<a target="_blank" href="https://twitter.com/home?status=' . $twitt_content . '" title="' . $this->wc_options_serialized->wc_phrases['wc_share_twitter'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/twitter-18x18.png') . '"/></a>&nbsp;&nbsp;';
160
- $output .= '<a target="_blank" href="https://plus.google.com/share?url=' . get_permalink($comment->comment_post_ID) . '" title="' . $this->wc_options_serialized->wc_phrases['wc_share_google'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/google-18x18.png') . '"/></a>&nbsp;&nbsp;';
 
 
161
  $output .= '</span>';
162
  }
163
 
@@ -165,7 +179,7 @@ class WC_Comment_Template_Builder {
165
  $output .= '-&nbsp;&nbsp; <a href="' . get_edit_comment_link($comment->comment_ID) . '">' . __('Edit', 'default') . '</a>';
166
  } else {
167
  if ($this->wc_helper->is_comment_editable($comment) && $current_user->ID && $current_user->ID == $comment->user_id) {
168
- $output .= '<span id="wc_editable_comment-' . $unique_id . '" class="wc_editable_comment">-&nbsp;&nbsp;' . __('Edit', 'default') . '</span>';
169
  $output .= '<span id="wc_cancel_edit-' . $unique_id . '" class="wc_cancel_edit">-&nbsp;&nbsp;' . $this->wc_options_serialized->wc_phrases['wc_comment_edit_cancel_button'] . '</span>';
170
  $output .= '<span id="wc_save_edited_comment-' . $unique_id . '" class="wc_save_edited_comment" style="display:none;">&nbsp;&nbsp;-&nbsp;&nbsp;' . $this->wc_options_serialized->wc_phrases['wc_comment_edit_save_button'] . '</span>';
171
  }
@@ -184,14 +198,27 @@ class WC_Comment_Template_Builder {
184
  $output_form = '';
185
 
186
  if (comments_open($comment->comment_post_ID)) {
 
187
  $output_form = '<div class="wc-form-wrapper wc-secondary-forms-wrapper" id="wc-secondary-forms-wrapper-' . $unique_id . '">';
 
188
  $output_form .= '<form action="" method="post" id="wc_comm_form-' . $unique_id . '" class="wc_comm_form wc_secondary_form">';
189
  $output_form .= '<div class="wc-field-comment"><div class="wc-field-avatararea">' . $this->wc_helper->get_comment_author_avatar() . '</div><div class="wc-field-textarea wpdiscuz-item"><textarea id="wc_comment-' . $unique_id . '" class="wc_comment wc_field_input" name="wc_comment" required="required" placeholder="' . $textarea_placeholder . '"></textarea></div><div style="clear:both"></div></div>';
190
 
191
  $output_form .= '<div id="wc-form-footer-' . $unique_id . '" class="wc-form-footer">';
192
 
193
  if (!is_user_logged_in()) {
194
- $output_form .= '<div class="wc-author-data"><div class="wc-field-name wpdiscuz-item"><input id="wc_name-' . $unique_id . '" name="wc_name" class="wc_name wc_field_input" required="required" value="" type="text" placeholder="' . $this->wc_options_serialized->wc_phrases['wc_name_text'] . '"/></div><div class="wc-field-email wpdiscuz-item"><input id="wc_email-' . $unique_id . '" class="wc_email wc_field_input email" name="wc_email" required="required" value="" type="email" placeholder="' . $this->wc_options_serialized->wc_phrases['wc_email_text'] . '"/></div><div style="clear:both"></div></div>';
 
 
 
 
 
 
 
 
 
 
 
195
  }
196
 
197
  $output_form .= '<div class="wc-form-submit">';
@@ -206,7 +233,14 @@ class WC_Comment_Template_Builder {
206
  }
207
  }
208
 
209
- $output_form .= '<div class="wc-field-submit"><input type="button" name="submit" value="' . $this->wc_options_serialized->wc_phrases['wc_submit_text'] . '" id="wc_comm-' . $unique_id . '" class="wc_comm_submit button alt"/></div>';
 
 
 
 
 
 
 
210
  $output_form .= '<div style="clear:both"></div>';
211
 
212
  if ($this->wc_options_serialized->wc_show_hide_comment_checkbox || $this->wc_options_serialized->wc_show_hide_reply_checkbox || $this->wc_options_serialized->wc_show_hide_all_reply_checkbox) {
@@ -314,7 +348,6 @@ class WC_Comment_Template_Builder {
314
  public function init_phrases_on_load() {
315
 
316
  if ($this->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
317
- // var_dump($this->wc)
318
  $this->wc_options_serialized->wc_phrases = $this->wc_db_helper->get_phrases();
319
  }
320
  }
27
 
28
  $comment_content = wp_kses($comment->comment_content, array(
29
  'br' => array(),
30
+ 'a' => array('href' => array(), 'title' => array(), 'target' => array(), 'rel' => array(), 'download' => array(), 'hreflang' => array(), 'media' => array(), 'type' => array()),
31
  'i' => array(),
32
  'b' => array(),
33
  'u' => array(),
43
  $vote_title_text = '';
44
  $user = get_user_by('id', $comment->user_id);
45
  $wc_author_title_class = '';
46
+ $wc_comment_author_url = ('http://' == $comment->comment_author_url) ? '' : $comment->comment_author_url;
47
+ $wc_comment_author_url = esc_url($wc_comment_author_url, array('http', 'https'));
48
+ $wc_comment_author_url = apply_filters('get_comment_author_url', $wc_comment_author_url, $comment->comment_ID, $comment);
49
  if ($user) {
50
+ $wc_comment_author_url = $wc_comment_author_url ? $wc_comment_author_url : $user->user_url;
51
  $post = get_post($comment->comment_post_ID);
52
  if ($user->ID == $post->post_author) {
53
  $wc_author_title_class = 'wc-post-author';
85
  $unique_id = $this->get_unique_id($comment);
86
 
87
  $wc_author_name = $comment->comment_author ? $comment->comment_author : __('Anonymous', WC_Core::$TEXT_DOMAIN);
 
88
  $wc_comm_author_avatar = $this->wc_helper->get_comment_author_avatar($comment);
89
  $wc_profile_url = $this->get_profile_url($user);
90
 
91
  if ($wc_profile_url) {
92
  $wc_comm_author_avatar = "<a href='$wc_profile_url'>" . $this->wc_helper->get_comment_author_avatar($comment) . "</a>";
93
+ } else {
94
+ $wc_comm_author_avatar = $this->wc_helper->get_comment_author_avatar($comment);
95
  }
96
 
97
+ if ($wc_comment_author_url) {
98
+ $wc_author_name = "<a href='$wc_comment_author_url'>" . $wc_author_name . "</a>";
99
+ } else {
100
+ if ($wc_profile_url) {
101
+ $wc_author_name = "<a href='$wc_profile_url'>" . $wc_author_name . "</a>";
102
+ }
103
+ }
104
+
105
  $child_comments = get_comments(array(
106
  'parent' => $comment->comment_ID,
107
  'status' => 'approve'
167
  $twitt_content = strip_tags($comment_content) . ' ' . get_comment_link($comment);
168
 
169
  $output .= '<span id="share_buttons_box-' . $unique_id . '" class="share_buttons_box">';
170
+ $output .= '<a target="_blank" href="http://www.facebook.com/sharer.php" title="' . $this->wc_options_serialized->wc_phrases['wc_share_facebook'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/fb-18x18.png') . '" onmouseover="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/fb-18x18-orig.png') . '\'" onmouseout="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/fb-18x18.png') . '\'"/></a>&nbsp;&nbsp;';
171
+ $output .= '<a target="_blank" href="https://twitter.com/home?status=' . $twitt_content . '" title="' . $this->wc_options_serialized->wc_phrases['wc_share_twitter'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/twitter-18x18.png') . '" onmouseover="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/twitter-18x18-orig.png') . '\'" onmouseout="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/twitter-18x18.png') . '\'"/></a>&nbsp;&nbsp;';
172
+ $output .= '<a target="_blank" href="https://plus.google.com/share?url=' . get_permalink($comment->comment_post_ID) . '" title="' . $this->wc_options_serialized->wc_phrases['wc_share_google'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/google-18x18.png') . '" onmouseover="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/google-18x18-orig.png') . '\'" onmouseout="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/google-18x18.png') . '\'"/></a>&nbsp;&nbsp;';
173
+ $output .= '<a target="_blank" href="http://vk.com/share.php?url=' . get_permalink($comment->comment_post_ID) . '" title="' . $this->wc_options_serialized->wc_phrases['wc_share_vk'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/vk-18x18.png') . '" onmouseover="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/vk-18x18-orig.png') . '\'" onmouseout="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/vk-18x18.png') . '\'"/></a>&nbsp;&nbsp;';
174
+ $output .= '<a target="_blank" href="http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' . get_permalink($comment->comment_post_ID) . '" title="' . $this->wc_options_serialized->wc_phrases['wc_share_ok'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/ok-18x18.png') . '" onmouseover="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/ok-18x18-orig.png') . '\'" onmouseout="this.src=\'' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/ok-18x18.png') . '\'"/></a>&nbsp;&nbsp;';
175
  $output .= '</span>';
176
  }
177
 
179
  $output .= '-&nbsp;&nbsp; <a href="' . get_edit_comment_link($comment->comment_ID) . '">' . __('Edit', 'default') . '</a>';
180
  } else {
181
  if ($this->wc_helper->is_comment_editable($comment) && $current_user->ID && $current_user->ID == $comment->user_id) {
182
+ $output .= '<span id="wc_editable_comment-' . $unique_id . '" class="wc_editable_comment">-&nbsp;&nbsp;' . $this->wc_options_serialized->wc_phrases['wc_edit_text'] . '</span>';
183
  $output .= '<span id="wc_cancel_edit-' . $unique_id . '" class="wc_cancel_edit">-&nbsp;&nbsp;' . $this->wc_options_serialized->wc_phrases['wc_comment_edit_cancel_button'] . '</span>';
184
  $output .= '<span id="wc_save_edited_comment-' . $unique_id . '" class="wc_save_edited_comment" style="display:none;">&nbsp;&nbsp;-&nbsp;&nbsp;' . $this->wc_options_serialized->wc_phrases['wc_comment_edit_save_button'] . '</span>';
185
  }
198
  $output_form = '';
199
 
200
  if (comments_open($comment->comment_post_ID)) {
201
+
202
  $output_form = '<div class="wc-form-wrapper wc-secondary-forms-wrapper" id="wc-secondary-forms-wrapper-' . $unique_id . '">';
203
+ $output_form .= '<div class="wc-secondary-forms-social-content" id="wc-secondary-forms-social-content-' . $unique_id . '"></div>';
204
  $output_form .= '<form action="" method="post" id="wc_comm_form-' . $unique_id . '" class="wc_comm_form wc_secondary_form">';
205
  $output_form .= '<div class="wc-field-comment"><div class="wc-field-avatararea">' . $this->wc_helper->get_comment_author_avatar() . '</div><div class="wc-field-textarea wpdiscuz-item"><textarea id="wc_comment-' . $unique_id . '" class="wc_comment wc_field_input" name="wc_comment" required="required" placeholder="' . $textarea_placeholder . '"></textarea></div><div style="clear:both"></div></div>';
206
 
207
  $output_form .= '<div id="wc-form-footer-' . $unique_id . '" class="wc-form-footer">';
208
 
209
  if (!is_user_logged_in()) {
210
+ $wc_is_name_field_required = ($this->wc_options_serialized->wc_is_name_field_required) ? 'required="required"' : '';
211
+ $wc_is_email_field_required = ($this->wc_options_serialized->wc_is_email_field_required) ? 'required="required"' : '';
212
+
213
+ $output_form .= '<div class="wc-author-data">';
214
+ $output_form .= '<div class="wc-field-name wpdiscuz-item">';
215
+ $output_form .= '<input id="wc_name-' . $unique_id . '" name="wc_name" class="wc_name wc_field_input" ' . $wc_is_name_field_required . ' value="" type="text" placeholder="' . $this->wc_options_serialized->wc_phrases['wc_name_text'] . '"/>';
216
+ $output_form .= '</div>';
217
+ $output_form .= '<div class="wc-field-email wpdiscuz-item">';
218
+ $output_form .= '<input id="wc_email-' . $unique_id . '" class="wc_email wc_field_input email" name="wc_email" ' . $wc_is_email_field_required . ' value="" type="email" placeholder="' . $this->wc_options_serialized->wc_phrases['wc_email_text'] . '"/>';
219
+ $output_form .= '</div>';
220
+ $output_form .= '<div style="clear:both"></div>';
221
+ $output_form .= '</div>';
222
  }
223
 
224
  $output_form .= '<div class="wc-form-submit">';
233
  }
234
  }
235
 
236
+ $output_form .= '<div class="wc-field-submit">';
237
+ if (!is_user_logged_in() && !$this->wc_options_serialized->wc_weburl_show_hide) {
238
+ $output_form .= '<div class="wc-field-website wpdiscuz-item">';
239
+ $output_form .= '<input id="wc_website-' . $unique_id . '" class="wc_website wc_field_input" name="wc_website" value="" type="url" placeholder="' . $this->wc_options_serialized->wc_phrases['wc_website_text'] . '"/>';
240
+ $output_form .= '</div>';
241
+ }
242
+ $output_form .= '<input type="button" name="submit" value="' . $this->wc_options_serialized->wc_phrases['wc_submit_text'] . '" id="wc_comm-' . $unique_id . '" class="wc_comm_submit button alt"/>';
243
+ $output_form .= '</div>';
244
  $output_form .= '<div style="clear:both"></div>';
245
 
246
  if ($this->wc_options_serialized->wc_show_hide_comment_checkbox || $this->wc_options_serialized->wc_show_hide_reply_checkbox || $this->wc_options_serialized->wc_show_hide_all_reply_checkbox) {
348
  public function init_phrases_on_load() {
349
 
350
  if ($this->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
 
351
  $this->wc_options_serialized->wc_phrases = $this->wc_db_helper->get_phrases();
352
  }
353
  }
files/css/fv.css DELETED
@@ -1,69 +0,0 @@
1
- /*input, textarea{ border:1px solid #D1D1D1; }
2
- input, select{ font-size:inherit; margin:0; }
3
- input:focus, textarea:focus{ border-color:#AAA; }
4
-
5
- input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
6
- input[type=checkbox]{ width:auto; border:none; bottom:-1px; cursor:pointer; margin:0 5px 0 0; position:relative; }
7
- button[type=submit]{ font-size:1.1em; padding:5px 25px; }*/
8
-
9
- /* Tooltips helpers */
10
- .wpdiscuz-item .tooltip{ float:left; top:2px; left:7px; position:relative; z-index:2; }
11
- .wpdiscuz-item .tooltip:hover{ z-index:3; }
12
- .wpdiscuz-item .tooltip > span{ display:inline-block; width:15px; height:15px; line-height:15px; font-size:0.9em; font-weight:bold; text-align:center; color:#FFF; cursor:help; background-color:#00AEEF; position:relative; border-radius:10px; }
13
- .wpdiscuz-item .tooltip .content{ opacity:0; width:200px; background-color:#333; color:#FFF; font-size:0.9em; position:absolute; top:0; left:20px; padding:8px; border-radius:6px; pointer-events:none; transition:0.2s cubic-bezier(0.1, 0.1, 0.25, 2); -webkit-transition:0.3s cubic-bezier(0.1, 0.2, 0.5, 2.2); -moz-transition:0.3s cubic-bezier(0.1, 0.2, 0.5, 2.2); }
14
- .wpdiscuz-item .tooltip p{ padding:0; }
15
- .wpdiscuz-item .tooltip.down .content{ left:auto; right:0; top:30px; }
16
- .wpdiscuz-item .tooltip:hover .content{ opacity:1; left:36px; }
17
- .wpdiscuz-item .tooltip .content b{ height:0; width:0; border-color:#333 #333 transparent transparent; border-style:solid; border-width:9px 7px; position:absolute; left:-14px; top:8px; }
18
- .wpdiscuz-item .tooltip.down .content b{ left:auto; right:6px; top:-10px; border-width:5px; border-color:transparent #333 #333 transparent; }
19
-
20
- /* alerts (when validation fails) */
21
- .wpdiscuz-item .alert{ float:left; margin:0px; padding:2px 10px; color:#DD0000; border-radius:3px 4px 4px 3px; background-color:#FFE8E8; white-space:pre; position:relative; left:-15px; opacity:0; z-index:1; transition:0.15s ease-out; }
22
- .wpdiscuz-item .alert {max-width: 100%;position: absolute;top: -15px;font-size: 12px;}
23
- /*.wpdiscuz-item .alert::after{ content:''; display:block; height:0; width:0; border-color:transparent #CE5454 transparent transparent; border-style:solid; border-width:11px 7px; position:absolute; left:-13px; top:1px; }*/
24
- .wpdiscuz-item.bad .alert{ left:0; opacity:1; padding:2px 4px; line-height:14px; }
25
-
26
-
27
- @keyframes shake{
28
- 15%{ transform:translateX(-5px); }
29
- 30%{ transform:translateX(5px); }
30
- 45%{ transform:translateX(-3px); }
31
- 60%{ transform:translateX(3px); }
32
- 75%{ transform:translateX(2px); }
33
- 100%{ transform:none; }
34
- }
35
- @-webkit-keyframes shake{
36
- 25%{ -webkit-transform:translateX(-6px); }
37
- 75%{ -webkit-transform:translateX(6px); }
38
- }
39
-
40
- form fieldset{ clear:both; margin:0 0 10px 0; }
41
- form .wpdiscuz-item{ padding:5px 0; position:relative; height:2em; font-family: Lato,sans-serif; }
42
- form .wpdiscuz-item.wpdiscuz-items{ height:auto; }
43
- .wpdiscuz-item label, .wpdiscuz-item .label{ float:left; cursor:pointer; }
44
- .wpdiscuz-item label span, .wpdiscuz-item .label{ float:left; width:160px; text-transform:capitalize; line-height:2em; }
45
- .wpdiscuz-item input, .wpdiscuz-item textarea{ float:left; padding:3px 4px; width:210px; -webkit-transition:0.2s; -moz-transition:0.2s; transition:0.2s; }
46
- .wpdiscuz-item input[type=checkbox]{ width:auto; }
47
-
48
- .label ~ label{ vertical-align:middle; margin:0.3em 1.2em 0 0; }
49
-
50
- .wpdiscuz-item input.short{ width:90px; }
51
- .wpdiscuz-item input:focus:not([type="checkbox"]), .wpdiscuz-item textarea:focus{ box-shadow:0 0 4px #BCBCBC; border:1px solid #BCBCBC; }
52
-
53
- .wpdiscuz-item textarea{ }
54
- .wpdiscuz-item select{ float:left; width:220px; padding:2px 0; margin:0; border:1px solid #CCC; text-transform:capitalize; }
55
- .wpdiscuz-item select option{ padding:1px; }
56
-
57
- .wpdiscuz-item > .extra{ float:left; font-size:0.9em; color:#999; line-height:2em; margin-left:13px; }
58
-
59
- .wpdiscuz-item.multi .input{ float:left; }
60
- .wpdiscuz-item.multi input{ float:left; margin-right:5px; width:35px; text-align:center; }
61
- form .wpdiscuz-item.multi input:nth-last-child(-n+2){ margin:0; }
62
- .wpdiscuz-item.wpdiscuz-items input{ border-top:5px solid #E1E1E1; margin:0 0 0 160px; }
63
-
64
- .bad input,
65
- .bad select,
66
- .bad textarea{ box-shadow:0 0 4px -2px #CE5454; position:relative; left:0; /*-moz-animation:.7s 1 shake linear; -webkit-animation:0.7s 1 shake linear;*/ }
67
-
68
- .wc_comm_form input {box-shadow: 0 0 4px -2px #d4d0ba;}
69
- .wc_comm_form textarea{box-shadow:0 0 4px -2px #d4d0ba;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/css/fv.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .wpdiscuz-item .tooltip{float:left;top:2px;left:7px;position:relative;z-index:2}.wpdiscuz-item .tooltip:hover{z-index:3}.wpdiscuz-item .tooltip>span{display:inline-block;width:15px;height:15px;line-height:15px;font-size:.9em;font-weight:bold;text-align:center;color:#FFF;cursor:help;background-color:#00aeef;position:relative;border-radius:10px}.wpdiscuz-item .tooltip .content{opacity:0;width:200px;background-color:#333;color:#FFF;font-size:.9em;position:absolute;top:0;left:20px;padding:8px;border-radius:6px;pointer-events:none;transition:.2s cubic-bezier(0.1,0.1,0.25,2);-webkit-transition:.3s cubic-bezier(0.1,0.2,0.5,2.2);-moz-transition:.3s cubic-bezier(0.1,0.2,0.5,2.2)}.wpdiscuz-item .tooltip p{padding:0}.wpdiscuz-item .tooltip.down .content{left:auto;right:0;top:30px}.wpdiscuz-item .tooltip:hover .content{opacity:1;left:36px}.wpdiscuz-item .tooltip .content b{height:0;width:0;border-color:#333 #333 transparent transparent;border-style:solid;border-width:9px 7px;position:absolute;left:-14px;top:8px}.wpdiscuz-item .tooltip.down .content b{left:auto;right:6px;top:-10px;border-width:5px;border-color:transparent #333 #333 transparent}.wpdiscuz-item .alert{float:left;margin:0;padding:2px 10px;color:#d00;border-radius:3px 4px 4px 3px;background-color:#ffe8e8;white-space:pre;position:relative;left:-15px;opacity:0;z-index:1;transition:.15s ease-out}.wpdiscuz-item .alert{max-width:100%;position:absolute;top:-15px;font-size:12px}.wpdiscuz-item.bad .alert{left:0;opacity:1;padding:2px 4px;line-height:14px}@keyframes shake{15%{transform:translateX(-5px)}30%{transform:translateX(5px)}45%{transform:translateX(-3px)}60%{transform:translateX(3px)}75%{transform:translateX(2px)}100%{transform:none}}@-webkit-keyframes shake{25%{-webkit-transform:translateX(-6px)}75%{-webkit-transform:translateX(6px)}}form fieldset{clear:both;margin:0 0 10px 0}form .wpdiscuz-item{padding:5px 0;position:relative;height:2em;font-family:Lato,sans-serif}form .wpdiscuz-item.wpdiscuz-items{height:auto}.wpdiscuz-item label,.wpdiscuz-item .label{float:left;cursor:pointer}.wpdiscuz-item label span,.wpdiscuz-item .label{float:left;width:160px;text-transform:capitalize;line-height:2em}.wpdiscuz-item input,.wpdiscuz-item textarea{float:left;padding:3px 4px;width:210px;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}.wpdiscuz-item input[type=checkbox]{width:auto}.label ~ label{vertical-align:middle;margin:.3em 1.2em 0 0}.wpdiscuz-item input.short{width:90px}.wpdiscuz-item input:focus:not([type="checkbox"]),.wpdiscuz-item textarea:focus{box-shadow:0 0 4px #bcbcbc;border:1px solid #bcbcbc}.wpdiscuz-item select{float:left;width:220px;padding:2px 0;margin:0;border:1px solid #CCC;text-transform:capitalize}.wpdiscuz-item select option{padding:1px}.wpdiscuz-item>.extra{float:left;font-size:.9em;color:#999;line-height:2em;margin-left:13px}.wpdiscuz-item.multi .input{float:left}.wpdiscuz-item.multi input{float:left;margin-right:5px;width:35px;text-align:center}form .wpdiscuz-item.multi input:nth-last-child(-n+2){margin:0}.wpdiscuz-item.wpdiscuz-items input{border-top:5px solid #e1e1e1;margin:0 0 0 160px}.bad input,.bad select,.bad textarea{box-shadow:0 0 4px -2px #ce5454;position:relative;left:0}.wc_comm_form input{box-shadow:0 0 4px -2px #d4d0ba}.wc_comm_form textarea{box-shadow:0 0 4px -2px #d4d0ba}
files/css/options-css.css DELETED
@@ -1,11 +0,0 @@
1
- /* ===== Options Form CSS ===== */
2
-
3
- .wc-form tr:nth-child(even) {background: #fff}
4
- .wc-form tr:nth-child(odd) {background: #fbfbfb}
5
-
6
- .form-table.wc-form-table tr {background: transparent;}
7
-
8
- .wpdiscuz_options_page .wc-phrases-settings-form input[type="text"],
9
- .wpdiscuz_options_page .wc-phrases-settings-form textarea {
10
- width: 300px;
11
- }
 
 
 
 
 
 
 
 
 
 
 
files/css/options-css.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-form tr:nth-child(even){background:#fff}.wc-form tr:nth-child(odd){background:#fbfbfb}.form-table.wc-form-table tr{background:transparent}.wpdiscuz_options_page .wc-phrases-settings-form input[type="text"],.wpdiscuz_options_page .wc-phrases-settings-form textarea{width:300px}
files/css/wpdiscuz-rtl.css DELETED
@@ -1,37 +0,0 @@
1
- #wpcomm .wc-field-comment
2
- .wc-field-textarea{
3
- margin-left: 2px;
4
- margin-right: 65px;
5
- }
6
- #wpcomm .wc-form-wrapper .avatar{
7
- margin-top: 0px;
8
- }
9
- #wpcomm .wc-field-comment .wc-field-avatararea{
10
- float:right;
11
- }
12
- #wpcomm .wc-field-submit{
13
- float:left
14
- }
15
- #wpcomm .wc-field-captcha{
16
- float:right;
17
- }
18
- #wpcomm .wc_notification_checkboxes{
19
- text-align:right;
20
- }
21
- #wpcomm .wc-comment .wc-comment-right{
22
- margin-left:0px;
23
- margin-right:70px;
24
- }
25
- #wpcomm .wc-comment-author{
26
- float:right;
27
- }
28
- #wpcomm .wc-comment-date{
29
- float:left;
30
- }
31
- #wpcomm .wc-comment-footer .wc-vote-result{
32
- margin-right:0px;
33
- margin-left:5px;
34
- }
35
- #wpcomm .wc-toggle{
36
- float:left;
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/css/wpdiscuz-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wpcomm .wc-field-comment .wc-field-textarea{margin-left:2px;margin-right:65px}#wpcomm .wc-form-wrapper .avatar{margin-top:0}#wpcomm .wc-field-comment .wc-field-avatararea{float:right}#wpcomm .wc-field-submit{float:left}#wpcomm .wc-field-captcha{float:right}#wpcomm .wc_notification_checkboxes{text-align:right}#wpcomm .wc-comment .wc-comment-right{margin-left:0;margin-right:70px}#wpcomm .wc-comment-author{float:right}#wpcomm .wc-comment-date{float:left}#wpcomm .wc-comment-footer .wc-vote-result{margin-right:0;margin-left:5px}#wpcomm .wc-toggle{float:left}
files/css/wpdiscuz.css DELETED
@@ -1,591 +0,0 @@
1
- #wc-comment-header{
2
- padding:20px 5px 1px 5px;
3
- display:block;
4
- float:none;
5
- clear:both;
6
- font-size:18px;
7
- }
8
- #wpcomm form div{ box-sizing: inherit; }
9
- #wpcomm form .wpdiscuz-item {
10
- display: block;
11
- height:auto;
12
- }
13
- .wpdiscuz-item input {
14
- border-radius:0px;
15
- height:auto;
16
- width:auto;
17
- }
18
- #wpcomm {
19
- margin:15px 5px;
20
- padding:1px 0px 10px 0px;
21
- border-top:#DDDDDD solid 1px;
22
- }
23
- #wpcomm form {
24
- margin:0px;
25
- padding:0px;
26
- background:none;
27
- border:none;
28
- width:auto !important;
29
- }
30
- #wpcomm form div{ margin:0px; }
31
- #wc_show_hide_loggedin_username{
32
- padding:10px 5px 5px 5px;
33
- font-size:13px;
34
- }
35
- #wpcomm .wc_new_comment_and_replies {
36
- margin:0px;
37
- padding:0px;
38
- width:100%;
39
- height:auto;
40
- background:transparent;
41
- }
42
- #wpcomm .wc_new_comment_and_replies .wc_new_comment{
43
- float:right;
44
- display:none;
45
- padding:3px 10px;
46
- font-size:12px;
47
- margin:1px 0px 1px 3px;
48
- cursor:pointer;
49
- color:#fff;
50
- line-height: 15px;
51
- }
52
-
53
- #wpcomm .wc_new_comment_and_replies .wc_new_reply{
54
- float:right;
55
- display:none;
56
- padding:3px 10px;
57
- font-size:12px;
58
- margin:1px 0px 1px 1px;
59
- cursor:pointer;
60
- color:#fff;
61
- line-height: 15px;
62
- }
63
-
64
- #wpcomm .wc-comment-title{
65
- margin:0px;
66
- line-height:18px;
67
- font-weight:bold;
68
- padding:10px;
69
- margin-bottom:10px;
70
- font-size:13px;
71
- text-align:right;
72
- border-bottom:#CCCCCC dotted 1px;
73
- padding-bottom:10px;
74
- }
75
- #wpcomm .wc-form-wrapper{
76
- padding:10px;
77
- margin-top:20px;
78
- border:1px solid #F1F1F1;
79
- }
80
- #wpcomm .wc-author-data{ margin-bottom:3px; }
81
- #wpcomm .wc-field-submit{ padding:5px 0px 13px 0px; }
82
- #wpcomm .wc-field-name{
83
- width:49%;
84
- float:left;
85
- }
86
- #wpcomm .wc-field-email{
87
- width:49%;
88
- float:right;
89
- text-align:right;
90
- }
91
- #wpcomm .wc-field-comment{ margin:5px auto 1px auto; }
92
- #wpcomm .wc-field-comment .wc-field-avatararea{
93
- width:60px;
94
- float:left;
95
- }
96
- #wpcomm .wc-field-comment .wc-field-textarea{ margin-left:65px; }
97
- #wpcomm .wc-field-captcha{
98
- width:55%;
99
- float:left;
100
- margin:0px;
101
- height:auto!important;
102
- }
103
- #wpcomm .wc-field-submit{
104
- width:auto!important;
105
- float:right;
106
- text-align:right;
107
- margin:0px;
108
- }
109
- #wpcomm .wc-field-name input[type="text"]{
110
- width:99%;
111
- max-width:100%;
112
- padding:3px 5px;
113
- font-size:14px;
114
- margin:0px;
115
- height:29px;
116
- }
117
-
118
- #wpcomm .wc-field-email input[type="email"]{
119
- width:100%;
120
- max-width:100%;
121
- padding:3px 5px;
122
- font-size:14px;
123
- margin:0px;
124
- height:29px;
125
- }
126
- #wpcomm .wc-field-captcha input[type="text"]{
127
- width:40%;
128
- min-width:82px;
129
- padding:3px 5px;
130
- font-size:14px;
131
- margin:0px 5px 0px 0px;
132
- height:27px;
133
- }
134
- #wpcomm .wc-field-submit input[type="submit"]{ margin:1px; }
135
- #wpcomm .wc-field-submit input[type="button"]{
136
- margin:1px;
137
- border:#DDDDDD 1px solid;
138
- font-size: 13px;
139
- line-height: 16px;
140
- padding: 6px 15px;
141
- clear:both;
142
- float:none;
143
- }
144
- #wpcomm .captcha_msg{
145
- color: #999999;
146
- font-family: Lato,sans-serif;
147
- font-size: 13px;
148
- line-height: 18px;
149
- display:block;
150
- clear:both;
151
- padding:5px 0px 0px 0px;
152
- }
153
- #wpcomm .wc-field-comment textarea,
154
- #wpcomm .wc-comment .wc-comment-right textarea {
155
- width:100%;
156
- max-width:100%;
157
- height:48px;
158
- min-height: 48px !important;
159
- padding:5px;
160
- box-sizing: border-box;
161
- border-radius:0px;
162
- }
163
-
164
- #wpcomm .wc-label{
165
- display:block;
166
- font-size:14px;
167
- padding:5px;
168
- }
169
- #wpcomm .wc_manage_subscribtions {
170
- cursor: pointer;
171
- padding: 0px 0px 5px 0px;
172
- display: block;
173
- font-size:13px;
174
- line-height:16px;
175
- }
176
-
177
- #wpcomm .wc_notification_checkboxes{
178
- padding:7px 0px 7px 0px;
179
- text-align:left;
180
- display: none;
181
- border-top: 1px dotted #DDDDDD;
182
- line-height:18px;
183
- font-size:13px;
184
- }
185
- #wpcomm .wc_notification_checkboxes input[type="checkbox"],
186
- #wpcomm .wc_notification_checkboxes input[type="radio"]{
187
- overflow:none;
188
- width:inherit;
189
- font-size:13px;
190
- margin:0px;
191
- padding:0px;
192
- display:inline;
193
- clear:both;
194
- float:none;
195
- max-height: 20px;
196
- margin:0px 3px;
197
- }
198
- #wpcomm .wc_notification_checkboxes label {
199
- clear:both;
200
- float:none;
201
- font-weight:normal;
202
- }
203
- #wpcomm .wc-label-comment-notify {
204
- display:inline;
205
- font-size:13px;
206
- padding:0px;
207
- margin:0px;
208
- border:none;
209
- line-height:15px;
210
- text-decoration:none;
211
- color:#999999;
212
- font-family:Lato,sans-serif;
213
- cursor:pointer;
214
- }
215
-
216
- #wpcomm .wc-label-reply-notify,
217
- #wpcomm .wc-notification-none {
218
- display:inline;
219
- font-size:13px;
220
- padding:0px;
221
- margin:0px;
222
- border:none;
223
- line-height:15px;
224
- text-decoration:none;
225
- color:#999999;
226
- font-family:Lato,sans-serif;
227
- cursor:pointer;
228
- }
229
- #wpcomm .wc-label-all-reply-notify {
230
- display:inline;
231
- font-size:13px;
232
- padding:0px;
233
- margin:0px;
234
- border:none;
235
- line-height:15px;
236
- text-decoration:none;
237
- color:#999999;
238
- font-family:Lato,sans-serif;
239
- cursor:pointer;
240
- }
241
- #wpcomm .wc-field-captcha .wc-label{
242
- font-size:14px;
243
- padding:5px;
244
- text-align:center;
245
- display:inline;
246
- }
247
- #wpcomm input[type="text"],
248
- #wpcomm input[type="email"],
249
- #wpcomm textarea{
250
- font-size:14px;
251
- color:#777777;
252
- font-family:Lato,sans-serif;
253
- box-sizing: border-box;
254
- margin:0px;
255
- clear:both;
256
- float:none;
257
- display:inline;
258
- }
259
- #wpcomm .wc-copyright{
260
- margin: 0px 0px 0px auto;
261
- text-align:right;
262
- display: block;
263
- padding-top: 2px;
264
- }
265
- #wpcomm .wc-copyright a{
266
- font-size: 9px;
267
- color: #AAAAAA;
268
- cursor:help;
269
- text-decoration:none;
270
- margin:0px;
271
- padding:0px;
272
- border:none;
273
- }
274
- #wpcomm .wc-thread-wrapper{
275
- padding:10px 0px;
276
- margin-bottom:10px;
277
- }
278
- #wpcomm .wc-comment { margin-bottom:13px; }
279
- #wpcomm .wc-comment .wc-field-submit{ padding:5px 0px 5px 0px; }
280
- #wpcomm .wc-comment .wc-form-wrapper{ padding:10px 10px 7px 10px; }
281
- #wpcomm .wc-comment .wc-comment-left{
282
- width:62px;
283
- float:left;
284
- position:absolute;
285
- text-align:center;
286
- font-family:Lato,sans-serif;
287
- line-height:16px;
288
- }
289
- #wpcomm .wc-comment .wc-comment-right{
290
- margin-left:70px;
291
- border:#F5F5F5 1px solid;
292
- padding:10px 10px 3px 10px;
293
- }
294
- #wpcomm .wc-reply .wc-comment-right{
295
- margin-left:70px;
296
- border:#F5F5F5 1px solid;
297
- padding:10px 10px 3px 10px;
298
- }
299
- #wpcomm .wc-reply {
300
- margin-top: 10px;
301
- margin-bottom:0px;
302
- margin-left:40px; }
303
- #wpcomm .wc-must-login{
304
- margin:0px;
305
- font-size:14px;
306
- line-height:16px;
307
- padding:10px;
308
- text-align:center;
309
- }
310
- #wpcomm hr{
311
- background-color: rgba(0, 0, 0, 0.1);
312
- border: 0 none;
313
- height: 1px;
314
- margin:10px 0px;
315
- }
316
- #wpcomm .avatar{
317
- border: 1px solid rgba(0, 0, 0, 0.1);
318
- padding: 2px;
319
- margin:0px auto;
320
- float:none;
321
- display:inline;
322
- width:48px;
323
- height:auto;
324
- }
325
- #wpcomm .wc-form-wrapper .avatar { margin-top:3px; }
326
- #wpcomm .wc-comment-text{
327
- text-align:left;
328
- padding-bottom:5px;
329
- line-height: 20px;
330
- /*white-space: pre-wrap;*/
331
- white-space: -moz-pre-wrap;
332
- white-space: -pre-wrap; white-space: -o-pre-wrap;
333
- word-wrap: break-word;
334
- }
335
- #wpcomm .wc-comment-text img {
336
- max-width: 90%;
337
- height: auto;
338
- }
339
- #wpcomm .wc-comment-header{
340
- margin-bottom:7px;
341
- font-family:Lato,sans-serif;
342
- }
343
- #wpcomm .wc-comment-author{
344
- font-size:16px;
345
- width:40%;
346
- float:left;
347
- white-space:nowrap;
348
- }
349
- #wpcomm .wc-comment-author a{
350
- font-size:16px; white-space:nowrap;
351
- text-decoration:none;
352
- }
353
- #wpcomm .wc-comment-label{
354
- color:#FFFFFF;
355
- padding:2px 5px;
356
- font-size:12px;
357
- margin:4px auto;
358
- text-align:center;
359
- display:table;
360
- line-height:16px;
361
- }
362
- #wpcomm .wc-comment-date{
363
- font-size:12px;
364
- color:#999999;
365
- float:right;
366
- text-align:right;
367
- white-space:nowrap;
368
- line-height:27px;
369
- }
370
- #wpcomm .wc-comment-footer {
371
- font-size:12px;
372
- font-weight:normal;
373
- color:#999999;
374
- margin-top:12px;
375
- min-height: 28px;
376
- font-family:Lato,sans-serif;
377
- }
378
- #wpcomm .wc-comment-footer a,
379
- #wpcomm .wc-comment-footer span.wc_editable_comment,
380
- #wpcomm .wc-comment-footer span.wc_save_edited_comment,
381
- #wpcomm span.wc_cancel_edit {
382
- text-decoration:none;
383
- font-size:13px;
384
- font-weight:bold;
385
- cursor: pointer;
386
- }
387
- #wpcomm .wc-comment-footer .share_buttons_box img{ vertical-align:middle; }
388
- #wpcomm .wc-comment-footer .wc-voted{
389
- color:#666666;
390
- cursor:default;
391
- }
392
- #wpcomm .wc-comment-footer .wc-vote-img-up{
393
- padding:0px;
394
- margin:0px 0px -2px 0px;
395
- vertical-align:baseline;
396
- display:inline;
397
- float:none;
398
- clear:both;
399
- border:none;
400
- background:transparent;
401
- width:16px;
402
- height:16px;
403
- border-radius: 0px;
404
- box-shadow: none;
405
- box-sizing: border-box;
406
- }
407
- #wpcomm .wc-comment-footer .wc-vote-img-down{
408
- padding:0px;
409
- margin:0px 0px -6px 0px;
410
- vertical-align:baseline;
411
- display:inline;
412
- float:none;
413
- clear:both;
414
- border:none;
415
- background:transparent;
416
- width:16px;
417
- height:16px;
418
- border-radius: 0px;
419
- box-shadow: none;
420
- box-sizing: border-box;
421
- }
422
- #wpcomm .wc-comment-footer .wc-vote-result{
423
- padding:2px 6px 2px 5px;
424
- color:#FFFFFF;
425
- font-size:12px;
426
- font-weight:bold;
427
- display:inline;
428
- margin-right:5px;
429
- }
430
- #wpcomm .wc-toggle{
431
- float:right;
432
- text-align:right;
433
- padding-right:0px;
434
- margin-right:0px;
435
- color:#999999;
436
- cursor:pointer;
437
- font-size:12px;
438
- white-space:nowrap;
439
- }
440
- #wpcomm .wpdiscuz-item {
441
- background: none;
442
- border-radius: 0px;
443
- box-shadow: none;
444
- }
445
- #wc_response_info img{
446
- margin: 0px auto 0px auto;
447
- box-shadow: none;
448
- }
449
- #wpcomm .share_buttons_box img {
450
- display:inline!important;
451
- width:16px;
452
- height:16px;
453
- }
454
- #wpcomm .wc-captcha-label img{
455
- display: inline!important;
456
- border:none;
457
- padding:0px 0px 0px 2px;
458
- margin:0px;
459
- vertical-align:middle;
460
- }
461
- #wpcomm .wc-reply-link,
462
- #wpcomm .wc-vote-link,
463
- #wpcomm .wc-share-link {
464
- cursor: pointer;
465
- font-size:13px;
466
- font-weight:bold;
467
- }
468
- #wpcomm .wc-form-footer,
469
- #wpcomm .wc-secondary-forms-wrapper {display: none;}
470
- #wpcomm .wc-field-captcha .wc-captcha-label {
471
- padding: 0;
472
- display: inline-block;
473
- }
474
- #wpcomm .wc_captcha_refresh_img {
475
- cursor: pointer;
476
- margin-left: 3px;
477
- }
478
- #wpcomm .share_buttons_box {
479
- display: none;
480
- }
481
- #wpcomm .wc-no-left-margin {
482
- margin-left: 0 !important;
483
- }
484
- div.wc_modal {
485
- background: none repeat scroll 0 0 #EDEDED;
486
- color:#444444;
487
- font-size: 18px;
488
- font-weight: normal;
489
- padding: 45px 10px 50px 10px!important;
490
- text-align: center;
491
- line-height:25px;
492
- }
493
- .wc-load-more-submit-wrap {
494
- width: 100%;
495
- text-align: center;
496
- margin-bottom:20px;
497
- margin-top:25px;
498
- }
499
- .wc-load-more-submit {
500
- width: auto!important;
501
- padding:10px 20px;
502
- text-align: center;
503
- background-color:#FAFAFA;
504
- border-radius: 3px;
505
- color:#555555;
506
- cursor:pointer;
507
- }
508
- .wc-load-more-submit:hover{
509
- background-image: -moz-linear-gradient(center top , #f4f4f4, #e6e6e6);
510
- background-repeat: repeat-x;
511
- box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);
512
- color: #7c7c7c;
513
- }
514
- #wc_openModalFormAction > div#wc_response_info {
515
- width: 200px;
516
- background: none repeat scroll 0 0 #EDEDED;
517
- color:#444444;
518
- font-size: 18px;
519
- font-weight: normal;
520
- padding: 45px 10px 50px 10px!important;
521
- text-align: center;
522
- line-height:25px;
523
- }
524
- #wc_openModalFormAction > div#wc_response_info a.close {
525
- background-position-x: right;
526
- background-position-y: top;
527
- }
528
- #wpcomm #bywpdiscuz{
529
- display:none;
530
- }
531
- #wpcomm .by-wpdiscuz{
532
- text-align:right;
533
- border-top:#DDDDDD solid 1px;
534
- padding:1px 1px 1px 1px;
535
- }
536
- #wpcomm .by-wpdiscuz a{
537
- font-size:11px;
538
- font-weight:bold;
539
- text-align:right;
540
- color:#CCCCCC;
541
- padding:1px;
542
- margin:0px;
543
- line-height:12px;
544
- border:none;
545
- text-decoration:none;
546
- }
547
- #wpcomm .wpdimg{
548
- border:none;
549
- padding:0px;
550
- margin:0px;
551
- height:12px;
552
- cursor:pointer;
553
- display:inline;
554
- clear:both;
555
- }
556
- #wc_unsubscribe_message {
557
- margin:10px auto 1px auto;
558
- padding:10px;
559
- text-align:center;
560
- border:#00DD00 1px dotted;
561
- background:#CCFFCC;
562
- }
563
- .wc_unsubscribe_message {
564
- font-size:14px;
565
- color:#444;
566
- }
567
- #wpcomm .wc_comment_level-3 { margin-left: 40px!important; }
568
- #wpcomm .wc_comment_level-4 { margin-left: 40px!important; }
569
- #wpcomm .wc_comment_level-5 { margin-left: 40px!important; }
570
- #wpcomm .wc_editable_div {
571
- -moz-appearance: textfield-multiline;
572
- -webkit-appearance: textarea;
573
- border: 1px solid #ccc;
574
- border-radius: 0;
575
- font: medium -moz-fixed;
576
- font: -webkit-small-control;
577
- overflow: auto;
578
- resize: both;
579
- box-sizing: border-box;
580
- height: 46px;
581
- max-width: 100%;
582
- min-height: 46px !important;
583
- padding: 5px; width: 100%;
584
- }
585
- #wpcomm .wc_cancel_edit {display: none;}
586
- #wpcomm .wc-comment-text p {margin-bottom: 10px;}
587
- #wpcomm .wc-comment-right textarea.wc_edit_comment {
588
- height: 80px;
589
- max-height: 200px;
590
- }
591
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/css/wpdiscuz.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ #wc-comment-header{padding:20px 5px 1px 5px;display:block;float:none;clear:both;font-size:18px}#wpcomm form div{box-sizing:inherit}#wpcomm form .wpdiscuz-item{display:block;height:auto}.wpdiscuz-item input{border-radius:0;height:auto;width:auto}#wpcomm{margin:15px 5px;padding:1px 0 10px 0;border-top:#ddd solid 1px}#wpcomm form{margin:0;padding:0;background:0;border:0;width:auto!important}#wpcomm form div{margin:0}#wc_show_hide_loggedin_username{padding:10px 5px 5px 5px;font-size:13px}#wpcomm .wc_new_comment_and_replies{margin:0;padding:0;width:100%;height:auto;background:transparent}#wpcomm .wc_new_comment_and_replies .wc_new_comment{float:right;display:none;padding:3px 10px;font-size:12px;margin:1px 0 1px 3px;cursor:pointer;color:#fff;line-height:15px}#wpcomm .wc_new_comment_and_replies .wc_new_reply{float:right;display:none;padding:3px 10px;font-size:12px;margin:1px 0 1px 1px;cursor:pointer;color:#fff;line-height:15px}#wpcomm .wc-comment-bar{width:100%;padding:0;display:block}#wpcomm .wc-comment-title{margin:0;line-height:18px;font-weight:bold;padding:10px;margin-bottom:10px;font-size:13px;text-align:right;border-bottom:#ccc dotted 1px;padding-bottom:10px}#wpcomm .wc-form-wrapper{padding:10px;margin-top:20px;border:1px solid #f1f1f1}#wpcomm .wc-author-data{margin-bottom:3px}#wpcomm .wc-field-submit{padding:5px 0 13px 0}#wpcomm .wc-field-name{width:49%;float:left}#wpcomm .wc-field-email{width:49%;float:right;text-align:right}#wpcomm .wc-field-comment{margin:5px auto 1px auto}#wpcomm .wc-field-comment .wc-field-avatararea{width:60px;float:left}#wpcomm .wc-field-comment .wc-field-textarea{margin-left:65px}#wpcomm .wc-field-captcha{width:49%;float:left;margin:0;height:auto!important}#wpcomm .wc-field-submit{width:49%;float:right;text-align:right;margin:0}#wpcomm .wc-field-website{width:100%;padding:0 0 10px 0;margin:0;display:block}#wpcomm .wc-field-name input[type="text"]{width:99%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-website input[type="url"],#wpcomm .wc-field-website input[type="text"]{width:100%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-email input[type="email"]{width:100%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-captcha input[type="text"]{max-width:55%;min-width:110px;padding:3px 5px;font-size:14px;margin:0 5px 2px 0;height:27px}@media screen and (max-width:1000px){#wpcomm .wc-field-captcha input[type="text"]{max-width:45%;min-width:90px}}@media screen and (max-width:850px){#wpcomm .wc-field-captcha input[type="text"]{max-width:35%;min-width:90px}}@media screen and (max-width:790px){#wpcomm .wc-field-captcha input[type="text"]{max-width:30%;min-width:80px}}@media screen and (max-width:690px){#wpcomm .wc-field-captcha input[type="text"]{max-width:30%;min-width:80px}}#wpcomm .wc-field-submit input[type="submit"]{margin:1px}#wpcomm .wc-field-submit input[type="button"]{margin:1px;border:#ddd 1px solid;font-size:13px;line-height:16px;padding:6px 15px;clear:both;float:none}#wpcomm .captcha_msg{color:#999;font-family:Lato,sans-serif;font-size:13px;line-height:18px;display:block;clear:both;padding:5px 0 0 0}#wpcomm .wc-field-comment textarea,#wpcomm .wc-comment .wc-comment-right textarea{width:100%;max-width:100%;height:48px;min-height:48px!important;padding:5px;box-sizing:border-box;border-radius:0}#wpcomm .wc-label{display:block;font-size:14px;padding:5px}#wpcomm .wc_manage_subscribtions{cursor:pointer;padding:0 0 5px 0;display:block;font-size:13px;line-height:16px;font-family:Lato,sans-serif}#wpcomm .wc_notification_checkboxes{padding:7px 0 7px 0;text-align:left;display:none;border-top:1px dotted #ddd;line-height:18px;font-size:13px}#wpcomm .wc_notification_checkboxes input[type="checkbox"],#wpcomm .wc_notification_checkboxes input[type="radio"]{overflow:none;width:inherit;font-size:13px;margin:0;padding:0;display:inline;clear:both;float:none;max-height:20px;margin:0 3px}#wpcomm .wc_notification_checkboxes label{clear:both;float:none;font-weight:normal}#wpcomm .wc-label-comment-notify{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-label-reply-notify,#wpcomm .wc-notification-none{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-label-all-reply-notify{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-field-captcha .wc-label{font-size:14px;padding:5px;text-align:center;display:inline}#wpcomm input[type="text"],#wpcomm input[type="email"],#wpcomm input[type="url"],#wpcomm textarea{font-size:14px;color:#777;font-family:Lato,sans-serif;box-sizing:border-box;margin:0;clear:both;float:none;display:inline}#wpcomm .wc-copyright{margin:0 0 0 auto;text-align:right;display:block;padding-top:2px}#wpcomm .wc-copyright a{font-size:9px;color:#aaa;cursor:help;text-decoration:none;margin:0;padding:0;border:0}#wpcomm .wc-thread-wrapper{padding:10px 0;margin-bottom:10px}#wpcomm .wc-comment{margin-bottom:13px}#wpcomm .wc-comment .wc-field-submit{padding:5px 0 5px 0}#wpcomm .wc-comment .wc-form-wrapper{padding:10px 10px 7px 10px}#wpcomm .wc-comment .wc-comment-left{width:62px;float:left;position:absolute;text-align:center;font-family:Lato,sans-serif;line-height:16px}#wpcomm .wc-comment .wc-comment-right{margin-left:70px;border:#f5f5f5 1px solid;padding:10px 10px 3px 10px}#wpcomm .wc-reply .wc-comment-right{margin-left:70px;border:#f5f5f5 1px solid;padding:10px 10px 3px 10px}#wpcomm .wc-reply{margin-top:10px;margin-bottom:0;margin-left:40px}#wpcomm .wc-must-login{margin:0;font-size:14px;line-height:16px;padding:10px;text-align:center}#wpcomm hr{background-color:rgba(0,0,0,0.1);border:0 none;height:1px;margin:10px 0}#wpcomm .avatar{border:1px solid rgba(0,0,0,0.1);padding:2px;margin:0 auto;float:none;display:inline;width:48px;height:auto}#wpcomm .wc-form-wrapper .avatar{margin-top:3px}#wpcomm .wc-comment-text{text-align:left;padding-bottom:5px;line-height:20px;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}#wpcomm .wc-comment-text img{max-width:90%;height:auto}#wpcomm .wc-comment-header{margin-bottom:7px;font-family:Lato,sans-serif}#wpcomm .wc-comment-author{font-size:16px;width:40%;float:left;white-space:nowrap}#wpcomm .wc-comment-author a{font-size:16px;white-space:nowrap;text-decoration:none}#wpcomm .wc-comment-label{color:#fff;padding:2px 5px;font-size:12px;margin:4px auto;text-align:center;display:table;line-height:16px}#wpcomm .wc-comment-date{font-size:12px;color:#999;float:right;text-align:right;white-space:nowrap;line-height:27px}#wpcomm .wc-comment-footer{font-size:12px;font-weight:normal;color:#999;margin-top:12px;min-height:28px;font-family:Lato,sans-serif}#wpcomm .wc-comment-footer a,#wpcomm .wc-comment-footer span.wc_editable_comment,#wpcomm .wc-comment-footer span.wc_save_edited_comment,#wpcomm span.wc_cancel_edit{text-decoration:none;font-size:13px;font-weight:bold;cursor:pointer}#wpcomm .wc-comment-footer .share_buttons_box img{vertical-align:middle}#wpcomm .wc-comment-footer .wc-voted{color:#666;cursor:default}#wpcomm .wc-comment-footer .wc-vote-img-up{padding:0;margin:0 0 -2px 0;vertical-align:baseline;display:inline;float:none;clear:both;border:0;background:transparent;width:16px;height:16px;border-radius:0;box-shadow:none;box-sizing:border-box}#wpcomm .wc-comment-footer .wc-vote-img-down{padding:0;margin:0 0 -6px 0;vertical-align:baseline;display:inline;float:none;clear:both;border:0;background:transparent;width:16px;height:16px;border-radius:0;box-shadow:none;box-sizing:border-box}#wpcomm .wc-comment-footer .wc-vote-result{padding:2px 6px 2px 5px;color:#fff;font-size:12px;font-weight:bold;display:inline;margin-right:5px}#wpcomm .wc-toggle{float:right;text-align:right;padding-right:0;margin-right:0;color:#999;cursor:pointer;font-size:12px;white-space:nowrap}#wpcomm .wpdiscuz-item{background:0;border-radius:0;box-shadow:none}#wc_response_info img{margin:0 auto 0 auto;box-shadow:none}#wpcomm .share_buttons_box img{display:inline!important;width:16px;height:16px}#wpcomm .wc-captcha-label img{display:inline!important;border:0;padding:0 0 0 2px;margin:0;vertical-align:middle}#wpcomm .wc-reply-link,#wpcomm .wc-vote-link,#wpcomm .wc-share-link{cursor:pointer;font-size:13px;font-weight:bold}#wpcomm .wc-form-footer,#wpcomm .wc-secondary-forms-wrapper{display:none}#wpcomm .wc-field-captcha .wc-captcha-label{padding:0;display:inline-block}#wpcomm .wc_captcha_refresh_img{cursor:pointer;margin-left:3px}#wpcomm .share_buttons_box{display:none}#wpcomm .wc-comment.wc-no-left-margin{margin-left:0!important}div.wc_modal{background:none repeat scroll 0 0 #ededed;color:#444;font-size:18px;font-weight:normal;padding:45px 10px 50px 10px!important;text-align:center;line-height:25px}.wc-load-more-submit-wrap{width:100%;text-align:center;margin-bottom:20px;margin-top:25px}.wc-load-more-submit{width:auto!important;padding:10px 20px;text-align:center;background-color:#fafafa;border-radius:3px;color:#555;cursor:pointer}.wc-load-more-submit:hover{background-image:-moz-linear-gradient(center top,#f4f4f4,#e6e6e6);background-repeat:repeat-x;box-shadow:0 1px 2px rgba(64,64,64,0.1);color:#7c7c7c}#wc_openModalFormAction>div#wc_response_info{width:200px;background:none repeat scroll 0 0 #ededed;color:#444;font-size:18px;font-weight:normal;padding:45px 10px 50px 10px!important;text-align:center;line-height:25px}#wc_openModalFormAction>div#wc_response_info a.close{background-position-x:right;background-position-y:top}#wpcomm #bywpdiscuz{display:none}#wpcomm .by-wpdiscuz{text-align:right;border-top:#ddd solid 1px;padding:1px 1px 1px 1px}#wpcomm .by-wpdiscuz a{font-size:11px;font-weight:bold;text-align:right;color:#ccc;padding:1px;margin:0;line-height:12px;border:0;text-decoration:none}#wpcomm .wpdimg{border:0;padding:0;margin:0;height:12px;cursor:pointer;display:inline;clear:both}#wc_unsubscribe_message{margin:10px auto 1px auto;padding:10px;text-align:center;border:#0d0 1px dotted;background:#cfc}.wc_unsubscribe_message{font-size:14px;color:#444}#wpcomm .wc_comment_level-3{margin-left:40px!important}#wpcomm .wc_comment_level-4{margin-left:40px!important}#wpcomm .wc_comment_level-5{margin-left:40px!important}#wpcomm .wc_editable_div{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;border:1px solid #ccc;border-radius:0;font:medium -moz-fixed;font:-webkit-small-control;overflow:auto;resize:both;box-sizing:border-box;height:46px;max-width:100%;min-height:46px!important;padding:5px;width:100%}#wpcomm .wc_cancel_edit{display:none}#wpcomm .wc-comment-text p{margin-bottom:10px}#wpcomm .wc-comment-right textarea.wc_edit_comment{height:80px;max-height:200px}#wpcomm .wc_social_plugin_wrapper{width:auto}#wpcomm .wc_social_plugin_wrapper .wp-social-login-connect-with{float:left;font-size:13px;padding:2px 7px 0 0;text-transform:uppercase}#wpcomm .wc_social_plugin_wrapper .wp-social-login-provider-list{padding:1px;text-align:left;margin-bottom:-10px}#wpcomm .wc-secondary-forms-social-content .wp-social-login-provider-list{padding:1px;text-align:right}#wpcomm .wc-secondary-forms-social-content .wp-social-login-provider-list img{width:20px;height:20px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .wp-social-login-provider-list img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc-form-wrapper{clear:both}#wpcomm .wc_comm_form .wc_secondary_form{clear:both}#wpcomm .wc_comm_form .wc-field-comment{clear:both}#wpcomm .wc_social_plugin_wrapper .social_connect_ui{padding:0;clear:both;margin:0;margin-top:-20px;margin-bottom:-10px}#wpcomm .wc_social_plugin_wrapper .comment-form-social-connect{display:inherit;padding:0;margin:0;float:left;line-height:35px;padding-right:10px}#wpcomm .wc_social_plugin_wrapper .social_connect_form img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .social_connect_form{float:left;line-height:35px;text-align:left;vertical-align:middle}#wpcomm .wc_social_plugin_wrapper .comment-form-social-connect label{display:inherit;padding:0;margin:0;font-style:normal;font-weight:normal;border:0;font-size:13px;text-transform:uppercase}#social_connect_facebook_auth,#social_connect_twitter_auth,#social_connect_google_auth,#social_connect_google_plus_auth,#social_connect_yahoo_auth,#social_connect_wordpress_auth{clear:both;padding:0;margin:0}#wpcomm .wc-secondary-forms-social-content .social_connect_ui{padding:0;clear:both;margin:0;text-align:right}#wpcomm .wc-secondary-forms-social-content .comment-form-social-connect{display:inherit;padding:0;margin:0;float:left;line-height:35px;padding-right:10px}#wpcomm .wc-secondary-forms-social-content .social_connect_form img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc-secondary-forms-social-content .social_connect_form{float:left;width:100%;text-align:right;padding:0 0 5px 0;line-height:20px;vertical-align:middle}#wpcomm .wc-secondary-forms-social-content .comment-form-social-connect label{display:inherit;padding:0;margin:0;font-style:normal;font-weight:normal;border:0;font-size:13px;text-transform:uppercase}#wpcomm .wc_social_plugin_wrapper .wp-social-login-connect-with_by_the_champ{float:left;font-size:13px;padding:2px 7px 0 0;text-transform:uppercase}#wpcomm .wc_social_plugin_wrapper ul.wc_social_login_by_the_champ{list-style:none outside none!important;margin:0!important;padding-left:0!important}#wpcomm .wc_social_plugin_wrapper ul.wc_social_login_by_the_champ .theChampLoginButton{width:24px!important;height:24px!important}#wpcomm .wc-secondary-forms-social-content ul.wc_social_login_by_the_champ{list-style:none outside none!important;margin:0!important;padding-left:0!important}#wpcomm .wc-secondary-forms-social-content ul.wc_social_login_by_the_champ .theChampLoginButton{width:24px!important;height:24px!important}#wpcomm .wc-secondary-forms-social-content ul.wc_social_login_by_the_champ li{float:right!important}#wpcomm .theChampTwitterButton{background-position:-4px -68px!important}#wpcomm .theChampGoogleButton{background-position:-36px -2px!important}#wpcomm .theChampVkontakteButton{background-position:-35px -67px!important}#wpcomm .theChampLinkedinButton{background-position:-34px -34px!important}#wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm input[type="password"]{
2
+ line-height: inherit!important;}#wpcomm .wc-form-wrapper{ clear: both; }
files/img/facebook.png ADDED
Binary file
files/img/gplus.png ADDED
Binary file
files/img/social-icons/fb-18x18-orig.png ADDED
Binary file
files/img/social-icons/google-18x18-orig.png ADDED
Binary file
files/img/social-icons/ok-18x18-orig.png ADDED
Binary file
files/img/social-icons/ok-18x18.png ADDED
Binary file
files/img/social-icons/ok-24x24.png ADDED
Binary file
files/img/social-icons/twitter-18x18-orig.png ADDED
Binary file
files/img/social-icons/vk-18x18-orig.png ADDED
Binary file
files/img/social-icons/vk-18x18.png ADDED
Binary file
files/img/social-icons/vk-24x24.png ADDED
Binary file
files/img/twitter.png ADDED
Binary file
files/js/jquery.cookie.js DELETED
@@ -1,117 +0,0 @@
1
- /*!
2
- * jQuery Cookie Plugin v1.4.1
3
- * https://github.com/carhartl/jquery-cookie
4
- *
5
- * Copyright 2013 Klaus Hartl
6
- * Released under the MIT license
7
- */
8
- (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD
11
- define(['jquery'], factory);
12
- } else if (typeof exports === 'object') {
13
- // CommonJS
14
- factory(require('jquery'));
15
- } else {
16
- // Browser globals
17
- factory(jQuery);
18
- }
19
- }(function ($) {
20
-
21
- var pluses = /\+/g;
22
-
23
- function encode(s) {
24
- return config.raw ? s : encodeURIComponent(s);
25
- }
26
-
27
- function decode(s) {
28
- return config.raw ? s : decodeURIComponent(s);
29
- }
30
-
31
- function stringifyCookieValue(value) {
32
- return encode(config.json ? JSON.stringify(value) : String(value));
33
- }
34
-
35
- function parseCookieValue(s) {
36
- if (s.indexOf('"') === 0) {
37
- // This is a quoted cookie as according to RFC2068, unescape...
38
- s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39
- }
40
-
41
- try {
42
- // Replace server-side written pluses with spaces.
43
- // If we can't decode the cookie, ignore it, it's unusable.
44
- // If we can't parse the cookie, ignore it, it's unusable.
45
- s = decodeURIComponent(s.replace(pluses, ' '));
46
- return config.json ? JSON.parse(s) : s;
47
- } catch(e) {}
48
- }
49
-
50
- function read(s, converter) {
51
- var value = config.raw ? s : parseCookieValue(s);
52
- return $.isFunction(converter) ? converter(value) : value;
53
- }
54
-
55
- var config = $.cookie = function (key, value, options) {
56
-
57
- // Write
58
-
59
- if (value !== undefined && !$.isFunction(value)) {
60
- options = $.extend({}, config.defaults, options);
61
-
62
- if (typeof options.expires === 'number') {
63
- var days = options.expires, t = options.expires = new Date();
64
- t.setTime(+t + days * 864e+5);
65
- }
66
-
67
- return (document.cookie = [
68
- encode(key), '=', stringifyCookieValue(value),
69
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
70
- options.path ? '; path=' + options.path : '',
71
- options.domain ? '; domain=' + options.domain : '',
72
- options.secure ? '; secure' : ''
73
- ].join(''));
74
- }
75
-
76
- // Read
77
-
78
- var result = key ? undefined : {};
79
-
80
- // To prevent the for loop in the first place assign an empty array
81
- // in case there are no cookies at all. Also prevents odd result when
82
- // calling $.cookie().
83
- var cookies = document.cookie ? document.cookie.split('; ') : [];
84
-
85
- for (var i = 0, l = cookies.length; i < l; i++) {
86
- var parts = cookies[i].split('=');
87
- var name = decode(parts.shift());
88
- var cookie = parts.join('=');
89
-
90
- if (key && key === name) {
91
- // If second argument (value) is a function it's a converter...
92
- result = read(cookie, value);
93
- break;
94
- }
95
-
96
- // Prevent storing a cookie that we couldn't decode.
97
- if (!key && (cookie = read(cookie)) !== undefined) {
98
- result[name] = cookie;
99
- }
100
- }
101
-
102
- return result;
103
- };
104
-
105
- config.defaults = {};
106
-
107
- $.removeCookie = function (key, options) {
108
- if ($.cookie(key) === undefined) {
109
- return false;
110
- }
111
-
112
- // Must not alter options, thus extending a fresh object...
113
- $.cookie(key, '', $.extend({}, options, { expires: -1 }));
114
- return !$.cookie(key);
115
- };
116
-
117
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/js/jquery.cookie.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){a(require("jquery"))}else{a(jQuery)}}}(function(f){var a=/\+/g;function d(i){return b.raw?i:encodeURIComponent(i)}function g(i){return b.raw?i:decodeURIComponent(i)}function h(i){return d(b.json?JSON.stringify(i):String(i))}function c(i){if(i.indexOf('"')===0){i=i.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{i=decodeURIComponent(i.replace(a," "));return b.json?JSON.parse(i):i}catch(j){}}function e(j,i){var k=b.raw?j:c(j);return f.isFunction(i)?i(k):k}var b=f.cookie=function(q,p,v){if(p!==undefined&&!f.isFunction(p)){v=f.extend({},b.defaults,v);if(typeof v.expires==="number"){var r=v.expires,u=v.expires=new Date();u.setTime(+u+r*86400000)}return(document.cookie=[d(q),"=",h(p),v.expires?"; expires="+v.expires.toUTCString():"",v.path?"; path="+v.path:"",v.domain?"; domain="+v.domain:"",v.secure?"; secure":""].join(""))}var w=q?undefined:{};var s=document.cookie?document.cookie.split("; "):[];for(var o=0,m=s.length;o<m;o++){var n=s[o].split("=");var j=g(n.shift());var k=n.join("=");if(q&&q===j){w=e(k,p);break}if(!q&&(k=e(k))!==undefined){w[j]=k}}return w};b.defaults={};f.removeCookie=function(j,i){if(f.cookie(j)===undefined){return false}f.cookie(j,"",f.extend({},i,{expires:-1}));return !f.cookie(j)}}));
files/js/options-js.js DELETED
@@ -1,89 +0,0 @@
1
- jQuery(document).ready(function ($) {
2
- $('#wc_voting_buttons_show_hide').change(function () {
3
- if ($(this).is(':checked')) {
4
- $(this).val('1');
5
- } else {
6
- $(this).val('0');
7
- }
8
- });
9
-
10
- $('#wc_share_buttons_show_hide').change(function () {
11
- if ($(this).is(':checked')) {
12
- $(this).val('1');
13
- } else {
14
- $(this).val('0');
15
- }
16
- });
17
-
18
- $('#wc_captcha_show_hide').change(function () {
19
- if ($(this).is(':checked')) {
20
- $(this).val('1');
21
- } else {
22
- $(this).val('0');
23
- }
24
- });
25
-
26
- $('#wc_reply_button_guests_show_hide').change(function () {
27
- if ($(this).is(':checked')) {
28
- $(this).val('1');
29
- } else {
30
- $(this).val('0');
31
- }
32
- });
33
-
34
- $('#wc_reply_button_members_show_hide').change(function () {
35
- if ($(this).is(':checked')) {
36
- $(this).val('1');
37
- } else {
38
- $(this).val('0');
39
- }
40
- });
41
-
42
- $('#wc_author_titles_show_hide').change(function () {
43
- if ($(this).is(':checked')) {
44
- $(this).val('1');
45
- } else {
46
- $(this).val('0');
47
- }
48
- });
49
-
50
- $('#wc_jquery_ajax_features_on_off').change(function () {
51
- if ($(this).is(':checked')) {
52
- $(this).val('1');
53
- } else {
54
- $(this).val('0');
55
- }
56
- });
57
-
58
- $('#wc_held_comment_to_moderate').change(function () {
59
- if ($(this).is(':checked')) {
60
- $(this).val('1');
61
- } else {
62
- $(this).val('0');
63
- }
64
- });
65
-
66
- $('#wc_simple_comment_date').change(function () {
67
- if ($(this).is(':checked')) {
68
- $(this).val('1');
69
- } else {
70
- $(this).val('0');
71
- }
72
- });
73
-
74
- $('#wc_show_hide_comment_checkbox').change(function () {
75
- if ($(this).is(':checked')) {
76
- $(this).val('1');
77
- } else {
78
- $(this).val('0');
79
- }
80
- });
81
-
82
- $('#wc_show_hide_reply_checkbox').change(function () {
83
- if ($(this).is(':checked')) {
84
- $(this).val('1');
85
- } else {
86
- $(this).val('0');
87
- }
88
- });
89
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/js/options-js.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){a("#wc_voting_buttons_show_hide").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_share_buttons_show_hide").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_captcha_show_hide").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_reply_button_guests_show_hide").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_reply_button_members_show_hide").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_author_titles_show_hide").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_jquery_ajax_features_on_off").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_held_comment_to_moderate").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_simple_comment_date").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_show_hide_comment_checkbox").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}});a("#wc_show_hide_reply_checkbox").change(function(){if(a(this).is(":checked")){a(this).val("1")}else{a(this).val("0")}})});
files/js/validator.js DELETED
@@ -1,392 +0,0 @@
1
- /*
2
- Validator v1.1.0
3
- (c) Yair Even Or
4
- https://github.com/yairEO/validator
5
-
6
- MIT-style license.
7
- */
8
-
9
- var wpdiscuzValidator = (function($) {
10
- var message, tests, checkField, validate, mark, unmark, field, minmax, defaults,
11
- validateWords, lengthRange, lengthLimit, pattern, alertTxt, data,
12
- email_illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\]]/,
13
- email_filter = /^.+@.+\..{2,3}$/;
14
-
15
- /* general text messages
16
- */
17
- message = {
18
- invalid: 'invalid input',
19
- empty: 'please put something here',
20
- min: 'input is too short',
21
- max: 'input is too long',
22
- number_min: 'too low',
23
- number_max: 'too high',
24
- url: 'invalid URL',
25
- number: 'not a number',
26
- email: 'email address is invalid',
27
- email_repeat: 'emails do not match',
28
- password_repeat: 'passwords do not match',
29
- repeat: 'no match',
30
- complete: 'input is not complete',
31
- select: 'Please select an option'
32
- };
33
-
34
- if (!window.console) {
35
- console = {};
36
- console.log = console.warn = function() {
37
- return;
38
- }
39
- }
40
-
41
- // defaults
42
- defaults = {alerts: true};
43
-
44
- /* Tests for each type of field (including Select element)
45
- */
46
- tests = {
47
- sameAsPlaceholder: function(a) {
48
- return $.fn.placeholder && a.attr('placeholder') !== undefined && data.val == a.prop('placeholder');
49
- },
50
- hasValue: function(a) {
51
- if (!a) {
52
- alertTxt = message.empty;
53
- return false;
54
- }
55
- return true;
56
- },
57
- // 'linked' is a special test case for inputs which their values should be equal to each other (ex. confirm email or retype password)
58
- linked: function(a, b) {
59
- if (b != a) {
60
- // choose a specific message or a general one
61
- alertTxt = message[data.type + '_repeat'] || message.no_match;
62
- return false;
63
- }
64
- return true;
65
- },
66
- email: function(a) {
67
- if (!email_filter.test(a) || a.match(email_illegalChars)) {
68
- alertTxt = a ? message.email : message.empty;
69
- return false;
70
- }
71
- return true;
72
- },
73
- text: function(a) {
74
- // make sure there are at least X number of words, each at least 2 chars long.
75
- // for example 'john F kenedy' should be at least 2 words and will pass validation
76
- if (validateWords) {
77
- var words = a.split(' ');
78
- // iterrate on all the words
79
- var wordsLength = function(len) {
80
- for (var w = words.length; w--; )
81
- if (words[w].length < len)
82
- return false;
83
- return true;
84
- };
85
-
86
- if (words.length < validateWords || !wordsLength(2)) {
87
- alertTxt = message.complete;
88
- return false;
89
- }
90
- return true;
91
- }
92
- if (lengthRange && a.length < lengthRange[0]) {
93
- alertTxt = message.min;
94
- return false;
95
- }
96
-
97
- // check if there is max length & field length is greater than the allowed
98
- if (lengthRange && lengthRange[1] && a.length > lengthRange[1]) {
99
- alertTxt = message.max;
100
- return false;
101
- }
102
- // check if the field's value should obey any length limits, and if so, make sure the length of the value is as specified
103
- if (lengthLimit && lengthLimit.length) {
104
- var obeyLimit = false;
105
- while (lengthLimit.length) {
106
- if (lengthLimit.pop() == a.length)
107
- obeyLimit = true;
108
- }
109
- if (!obeyLimit) {
110
- alertTxt = message.complete;
111
- return false;
112
- }
113
- }
114
-
115
- if (pattern) {
116
- var regex, jsRegex;
117
- switch (pattern) {
118
- case 'alphanumeric' :
119
- regex = /^[a-z0-9]+$/i;
120
- break;
121
- case 'numeric' :
122
- regex = /^[0-9]+$/i;
123
- break;
124
- case 'phone' :
125
- regex = /^\+?([0-9]|[-|' '])+$/i;
126
- break;
127
- default :
128
- regex = pattern;
129
- }
130
- try {
131
- jsRegex = new RegExp(regex).test(a);
132
- if (a && !jsRegex)
133
- return false;
134
- }
135
- catch (err) {
136
- console.log(err, field, 'regex is invalid');
137
- return false;
138
- }
139
- }
140
- return true;
141
- },
142
- number: function(a) {
143
- // if not not a number
144
- if (isNaN(parseFloat(a)) && !isFinite(a)) {
145
- alertTxt = message.number;
146
- return false;
147
- }
148
- // not enough numbers
149
- else if (lengthRange && a.length < lengthRange[0]) {
150
- alertTxt = message.min;
151
- return false;
152
- }
153
- // check if there is max length & field length is greater than the allowed
154
- else if (lengthRange && lengthRange[1] && a.length > lengthRange[1]) {
155
- alertTxt = message.max;
156
- return false;
157
- }
158
- else if (minmax[0] && (a | 0) < minmax[0]) {
159
- alertTxt = message.number_min;
160
- return false;
161
- }
162
- else if (minmax[1] && (a | 0) > minmax[1]) {
163
- alertTxt = message.number_max;
164
- return false;
165
- }
166
- return true;
167
- },
168
- // Date is validated in European format (day,month,year)
169
- date: function(a) {
170
- var day, A = a.split(/[-./]/g), i;
171
- // if there is native HTML5 support:
172
- if (field[0].valueAsNumber)
173
- return true;
174
-
175
- for (i = A.length; i--; ) {
176
- if (isNaN(parseFloat(a)) && !isFinite(a))
177
- return false;
178
- }
179
- try {
180
- day = new Date(A[2], A[1] - 1, A[0]);
181
- if (day.getMonth() + 1 == A[1] && day.getDate() == A[0])
182
- return day;
183
- return false;
184
- }
185
- catch (er) {
186
- console.log('date test: ', err);
187
- return false;
188
- }
189
- },
190
- url: function(a) {
191
- // minimalistic URL validation
192
- function testUrl(url) {
193
- return /^(https?:\/\/)?([\w\d\-_]+\.+[A-Za-z]{2,})+\/?/.test(url);
194
- }
195
- if (!testUrl(a)) {
196
- console.log(a);
197
- alertTxt = a ? message.url : message.empty;
198
- return false;
199
- }
200
- return true;
201
- },
202
- hidden: function(a) {
203
- if (lengthRange && a.length < lengthRange[0]) {
204
- alertTxt = message.min;
205
- return false;
206
- }
207
- if (pattern) {
208
- var regex;
209
- if (pattern == 'alphanumeric') {
210
- regex = /^[a-z0-9]+$/i;
211
- if (!regex.test(a)) {
212
- return false;
213
- }
214
- }
215
- }
216
- return true;
217
- },
218
- select: function(a) {
219
- if (!tests.hasValue(a)) {
220
- alertTxt = message.select;
221
- return false;
222
- }
223
- return true;
224
- }
225
- };
226
-
227
- /* marks invalid fields
228
- */
229
- mark = function(field, text) {
230
- if (!text || !field || !field.length)
231
- return false;
232
-
233
- // check if not already marked as a 'bad' record and add the 'alert' object.
234
- // if already is marked as 'bad', then make sure the text is set again because it might change depending on validation
235
- var item = field.parents('.wpdiscuz-item'),
236
- warning;
237
-
238
- if (item.hasClass('bad')) {
239
- if (defaults.alerts)
240
- item.find('.alert').html(text);
241
- }
242
- else if (defaults.alerts) {
243
- warning = $('<div class="alert">').html(text);
244
- item.append(warning);
245
- }
246
-
247
- item.removeClass('bad');
248
- // a delay so the "alert" could be transitioned via CSS
249
- setTimeout(function() {
250
- item.addClass('bad');
251
- }, 0);
252
- };
253
- /* un-marks invalid fields
254
- */
255
- unmark = function(field) {
256
- if (!field || !field.length) {
257
- console.warn('no "field" argument, null or DOM object not found');
258
- return false;
259
- }
260
-
261
- field.parents('.wpdiscuz-item')
262
- .removeClass('bad')
263
- .find('.alert').remove();
264
- };
265
-
266
- function testByType(type, value) {
267
- if (type == 'tel')
268
- pattern = pattern || 'phone';
269
-
270
- if (!type || type == 'password' || type == 'tel')
271
- type = 'text';
272
-
273
- return tests[type](value);
274
- }
275
-
276
- function prepareFieldData(el) {
277
- field = $(el);
278
-
279
- field.data('valid', true); // initialize validity of field
280
- field.data('type', field.attr('type')); // every field starts as 'valid=true' until proven otherwise
281
- pattern = field.attr('pattern');
282
- }
283
-
284
- /* Validations per-character keypress
285
- */
286
- function keypress(e) {
287
- prepareFieldData(this);
288
-
289
- if (e.charCode)
290
- return testByType(this.type, String.fromCharCode(e.charCode));
291
- }
292
-
293
- /* Checks a single form field by it's type and specific (custom) attributes
294
- */
295
- function checkField() {
296
- // skip testing fields whom their type is not HIDDEN but they are HIDDEN via CSS.
297
- if (this.type != 'hidden' && $(this).is(':hidden'))
298
- return true;
299
-
300
- prepareFieldData(this);
301
-
302
- field.data('val', field[0].value.replace(/^\s+|\s+$/g, "")); // cache the value of the field and trim it
303
- data = field.data();
304
-
305
- // Check if there is a specific error message for that field, if not, use the default 'invalid' message
306
- alertTxt = message[field.prop('name')] || message.invalid;
307
-
308
- // SELECT / TEXTAREA nodes needs special treatment
309
- if (field[0].nodeName.toLowerCase() === "select") {
310
- data.type = 'select';
311
- }
312
- if (field[0].nodeName.toLowerCase() === "textarea") {
313
- data.type = 'text';
314
- }
315
- /* Gather Custom data attributes for specific validation:
316
- */
317
- validateWords = data['validateWords'] || 0;
318
- lengthRange = data['validateLengthRange'] ? (data['validateLengthRange'] + '').split(',') : [1];
319
- lengthLimit = data['validateLength'] ? (data['validateLength'] + '').split(',') : false;
320
- minmax = data['validateMinmax'] ? (data['validateMinmax'] + '').split(',') : ''; // for type 'number', defines the minimum and/or maximum for the value as a number.
321
-
322
- data.valid = tests.hasValue(data.val);
323
- // check if field has any value
324
- if (data.valid) {
325
- /* Validate the field's value is different than the placeholder attribute (and attribute exists)
326
- * this is needed when fixing the placeholders for older browsers which does not support them.
327
- * in this case, make sure the "placeholder" jQuery plugin was even used before proceeding
328
- */
329
- if (tests.sameAsPlaceholder(field)) {
330
- alertTxt = message.empty;
331
- data.valid = false;
332
- }
333
-
334
- // if this field is linked to another field (their values should be the same)
335
- if (data.validateLinked) {
336
- var linkedTo = data['validateLinked'].indexOf('#') == 0 ? $(data['validateLinked']) : $(':input[name=' + data['validateLinked'] + ']');
337
- data.valid = tests.linked(data.val, linkedTo.val());
338
- }
339
- /* validate by type of field. use 'attr()' is proffered to get the actual value and not what the browsers sees for unsupported types.
340
- */
341
- else if (data.valid || data.type == 'select')
342
- data.valid = testByType(data.type, data.val);
343
-
344
- // optional fields are only validated if they are not empty
345
- if (field.hasClass('optional') && !data.val)
346
- data.valid = true;
347
- }
348
-
349
- // mark / unmark the field, and set the general 'submit' flag accordingly
350
- if (data.valid)
351
- unmark(field);
352
- else {
353
- mark(field, alertTxt);
354
- submit = false;
355
- }
356
-
357
- return data.valid;
358
- }
359
-
360
- /* vaildates all the REQUIRED fields prior to submiting the form
361
- */
362
- function checkAll($form) {
363
- $form = $($form);
364
-
365
- if ($form.length == 0) {
366
- console.warn('element not found');
367
- return false;
368
- }
369
-
370
- var that = this,
371
- submit = true, // save the scope
372
- fieldsToCheck = $form.find(':input').filter('[required=required], .required, .optional').not('[disabled=disabled]');
373
-
374
- fieldsToCheck.each(function() {
375
- // use an AND operation, so if any of the fields returns 'false' then the submitted result will be also FALSE
376
- submit = submit * checkField.apply(this);
377
- });
378
-
379
- return !!submit; // casting the variable to make sure it's a boolean
380
- }
381
-
382
- return {
383
- defaults: defaults,
384
- checkField: checkField,
385
- keypress: keypress,
386
- checkAll: checkAll,
387
- mark: mark,
388
- unmark: unmark,
389
- message: message,
390
- tests: tests
391
- }
392
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/js/validator.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var wpdiscuzValidator=(function(c){var l,e,o,q,h,s,b,g,j,r,m,t,u,f,v,a=/[\(\)\<\>\,\;\:\\\/\"\[\]]/,d=/^.+@.+\..{2,3}$/;l={invalid:"invalid input",empty:"please put something here",min:"input is too short",max:"input is too long",number_min:"too low",number_max:"too high",url:"invalid URL",number:"not a number",email:"email address is invalid",email_repeat:"emails do not match",password_repeat:"passwords do not match",repeat:"no match",complete:"input is not complete",select:"Please select an option"};if(!window.console){console={};console.log=console.warn=function(){return}}j={alerts:true};e={sameAsPlaceholder:function(w){return c.fn.placeholder&&w.attr("placeholder")!==undefined&&v.val==w.prop("placeholder")},hasValue:function(w){if(!w){f=l.empty;return false}return true},linked:function(x,w){if(w!=x){f=l[v.type+"_repeat"]||l.no_match;return false}return true},email:function(w){if(!d.test(w)||w.match(a)){f=w?l.email:l.empty;return false}return true},text:function(x){if(r){var C=x.split(" ");var B=function(D){for(var E=C.length;E--;){if(C[E].length<D){return false}}return true};if(C.length<r||!B(2)){f=l.complete;return false}return true}if(m&&x.length<m[0]){f=l.min;return false}if(m&&m[1]&&x.length>m[1]){f=l.max;return false}if(t&&t.length){var A=false;while(t.length){if(t.pop()==x.length){A=true}}if(!A){f=l.complete;return false}}if(u){var z,w;switch(u){case"alphanumeric":z=/^[a-z0-9]+$/i;break;case"numeric":z=/^[0-9]+$/i;break;case"phone":z=/^\+?([0-9]|[-|' '])+$/i;break;default:z=u}try{w=new RegExp(z).test(x);if(x&&!w){return false}}catch(y){console.log(y,b,"regex is invalid");return false}}return true},number:function(w){if(isNaN(parseFloat(w))&&!isFinite(w)){f=l.number;return false}else{if(m&&w.length<m[0]){f=l.min;return false}else{if(m&&m[1]&&w.length>m[1]){f=l.max;return false}else{if(g[0]&&(w|0)<g[0]){f=l.number_min;return false}else{if(g[1]&&(w|0)>g[1]){f=l.number_max;return false}}}}}return true},date:function(x){var y,w=x.split(/[-./]/g),z;if(b[0].valueAsNumber){return true}for(z=w.length;z--;){if(isNaN(parseFloat(x))&&!isFinite(x)){return false}}try{y=new Date(w[2],w[1]-1,w[0]);if(y.getMonth()+1==w[1]&&y.getDate()==w[0]){return y}return false}catch(B){console.log("date test: ",err);return false}},url:function(w){function x(y){}if(!x(w)){console.log(w);f=w?l.url:l.empty;return false}return true},hidden:function(w){if(m&&w.length<m[0]){f=l.min;return false}if(u){var x;if(u=="alphanumeric"){x=/^[a-z0-9]+$/i;if(!x.test(w)){return false}}}return true},select:function(w){if(!e.hasValue(w)){f=l.select;return false}return true}};h=function(y,z){if(!z||!y||!y.length){return false}var x=y.parents(".wpdiscuz-item"),w;if(x.hasClass("bad")){if(j.alerts){x.find(".alert").html(z)}}else{if(j.alerts){w=c('<div class="alert">').html(z);x.append(w)}}x.removeClass("bad");setTimeout(function(){x.addClass("bad")},0)};s=function(w){if(!w||!w.length){console.warn('no "field" argument, null or DOM object not found');return false}w.parents(".wpdiscuz-item").removeClass("bad").find(".alert").remove()};function k(w,x){if(w=="tel"){u=u||"phone"}if(!w||w=="password"||w=="tel"){w="text"}return e[w](x)}function p(w){b=c(w);b.data("valid",true);b.data("type",b.attr("type"));u=b.attr("pattern")}function i(w){p(this);if(w.charCode){return k(this.type,String.fromCharCode(w.charCode))}}function o(){if(this.type!="hidden"&&c(this).is(":hidden")){return true}p(this);b.data("val",b[0].value.replace(/^\s+|\s+$/g,""));v=b.data();f=l[b.prop("name")]||l.invalid;if(b[0].nodeName.toLowerCase()==="select"){v.type="select"}if(b[0].nodeName.toLowerCase()==="textarea"){v.type="text"}r=v.validateWords||0;m=v.validateLengthRange?(v.validateLengthRange+"").split(","):[1];t=v.validateLength?(v.validateLength+"").split(","):false;g=v.validateMinmax?(v.validateMinmax+"").split(","):"";v.valid=e.hasValue(v.val);if(v.valid){if(e.sameAsPlaceholder(b)){f=l.empty;v.valid=false}if(v.validateLinked){var w=v.validateLinked.indexOf("#")==0?c(v.validateLinked):c(":input[name="+v.validateLinked+"]");v.valid=e.linked(v.val,w.val())}else{if(v.valid||v.type=="select"){v.valid=k(v.type,v.val)}}}if(b.hasClass("wpdiscuz_optional")&&!v.val){v.valid=true}if(v.valid){s(b)}else{h(b,f);submit=false}return v.valid}function n(w){w=c(w);if(w.length==0){console.warn("element not found");return false}var y=this,z=true,x=w.find(":input").filter("[required=required], .required, .wpdiscuz_optional").not("[disabled=disabled]");x.each(function(){z=z*o.apply(this)});return !!z}return{defaults:j,checkField:o,keypress:i,checkAll:n,mark:h,unmark:s,message:l,tests:e}})(jQuery);
files/js/wc-ajax.js DELETED
@@ -1,747 +0,0 @@
1
- jQuery(document).ready(function ($) {
2
- var wc_home_url = $('#wc_home_url').val();
3
- var wc_plugin_dir_url = $('#wc_plugin_dir_url').val();
4
- var wc_name;
5
- var wc_email;
6
- var wc_comment;
7
- var wc_captcha;
8
- var wc_comment_post_ID;
9
- var wc_comment_parent;
10
- var wc_form;
11
- var wc_submitID;
12
- var wc_comments_offset;
13
- var wc_new_comment_id;
14
- var wc_loading_image;
15
- var wc_comment_list_update_type = parseInt($('#wc_comment_list_update_type').val());
16
- var wc_comment_list_update_timer = parseInt($('#wc_comment_list_update_timer').val());
17
- var wc_notification_new_comment;
18
- var wc_notification_all_new_reply;
19
- var wc_notification_new_reply;
20
- var wc_all_comments_count_new;
21
- var wc_comment_text_before_editting;
22
-
23
- $(".wc_comment").autoGrow();
24
-
25
- $(document).delegate('#wc_openModalFormAction', 'click', function () {
26
- $('#wc_openModalFormAction').css('opacity', '0');
27
- $('#wc_openModalFormAction').css('pointer-events', 'none');
28
- });
29
-
30
- $(document).delegate('#wc_openModalFormAction .close', 'click', function () {
31
- $('#wc_openModalFormAction').css('opacity', '0');
32
- $('#wc_openModalFormAction').css('pointer-events', 'none');
33
- });
34
-
35
- wc_loading_image = "<img width='64' height='64' src='" + wc_home_url + '/' + wc_plugin_dir_url + "/files/img/loader/ajax-loader-200x200.gif' />";
36
- wc_comments_offset = $('#wc_comments_offset');
37
- wc_comments_offset.val('1');
38
-
39
- $(document).delegate('.wc_comment', 'focus', function () {
40
- var uniqueID = getUniqueID($(this));
41
- $('#wc-form-footer-' + uniqueID).slideDown(700);
42
- });
43
-
44
-
45
- $(document).delegate('.wc-reply-link', 'click', function () {
46
- var uniqueID = getUniqueID($(this));
47
- $('#wc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
48
- });
49
-
50
- $(document).delegate('.wc-share-link', 'click', function () {
51
- var uniqueID = getUniqueID($(this));
52
- $('#share_buttons_box-' + uniqueID).slideToggle(1000);
53
- });
54
-
55
- $(document).delegate('.wc_captcha_refresh_img', 'click', function () {
56
- var uniqueID = getUniqueID($(this));
57
- var wc_commpost_ID = $('#wc_comment_post_ID-' + uniqueID).val();
58
- var wc_commparent = $('#wc_comment_parent-' + uniqueID).val();
59
- $("#wc_captcha_img-" + uniqueID).attr("src", wc_home_url + "/" + wc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wc_commpost_ID + '-' + wc_commparent + '&r=' + Math.random());
60
- });
61
-
62
- $(document).delegate('.wc_comm_submit', 'click', function () {
63
- wc_submitID = $(this).attr('id');
64
- var uniqueID = wc_submitID.substring(wc_submitID.lastIndexOf('-') + 1);
65
- wc_name = $('#wc_name-' + uniqueID).val();
66
- wc_email = $('#wc_email-' + uniqueID).val();
67
- wc_comment = $('textarea#wc_comment-' + uniqueID).val();
68
- wc_captcha = $('#wc_captcha-' + uniqueID).val();
69
- wc_comment_post_ID = $('#wc_comment_post_ID-' + uniqueID).val();
70
- wc_comment_parent = $('#wc_comment_parent-' + uniqueID).val();
71
- wc_form = $('#wc_comm_form-' + uniqueID);
72
- var notification_type_radio = $("input[name='wc_comment_reply_notification-" + uniqueID + "']:checked").length ? $("input[name='wc_comment_reply_notification-" + uniqueID + "']:checked").val() : '';
73
-
74
- var depth = '';
75
- if (isMainFormSubmit(wc_submitID, wc_comment_post_ID)) {
76
- depth = 1;
77
- } else {
78
- depth = getCommentDepth($(this).parents('.wc-comment'));
79
- }
80
-
81
-
82
- var notification_type = '';
83
- if (notification_type_radio.length && notification_type_radio != 'wc_notification_none') {
84
- if (notification_type_radio == 'wc_notification_new_reply') {
85
- notification_type = 'reply';
86
- // $('#wc_notification_new_reply-' + uniqueID).prop("checked", false);
87
- }
88
- if (notification_type_radio == 'wc_notification_all_new_reply') {
89
- notification_type = 'all_comment';
90
- // $('#wc_notification_all_new_reply-' + uniqueID).prop("checked", false);
91
- }
92
- if (notification_type_radio == 'wc_notification_new_comment') {
93
- notification_type = 'post';
94
- // $('#wc_notification_new_comment-' + uniqueID).prop("checked", false);
95
- }
96
-
97
- }
98
-
99
- var submit = true;
100
- // evaluate the form using generic validaing
101
- if (!wpdiscuzValidator.checkAll(wc_form)) {
102
- submit = false;
103
- } else {
104
- $('#wc_openModalFormAction .close').css('display', 'none');
105
- $('#wc_openModalFormAction').css('opacity', '1');
106
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
107
- $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
108
- }
109
-
110
- if (submit) {
111
- $.ajax({
112
- type: 'POST',
113
- url: wc_ajax_obj.url,
114
- data: {
115
- name: wc_name,
116
- email: wc_email,
117
- comment: wc_comment,
118
- captcha: wc_captcha,
119
- comment_post_ID: wc_comment_post_ID,
120
- comment_parent: wc_comment_parent,
121
- comment_depth: depth,
122
- notification_type: notification_type,
123
- action: 'wc_comms_via_ajax'
124
- }
125
- }).done(function (response) {
126
-
127
- $("#wc_captcha_img-" + uniqueID).attr("src", wc_home_url + "/" + wc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wc_comment_post_ID + '-' + wc_comment_parent + '&r=' + Math.random());
128
- try {
129
-
130
- var obj = $.parseJSON(response);
131
- wc_new_comment_id = parseInt(obj.wc_new_comment_id);
132
- if (obj.code === -1) {
133
- var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
134
- $('#wc_openModalFormAction').css('opacity', '1');
135
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
136
- $('#wc_openModalFormAction .close').css('display', 'block');
137
- $('#wc_openModalFormAction > #wc_response_info').html(html + obj.message);
138
- } else if (obj.code === -2) {
139
- var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
140
- $('#wc_openModalFormAction').css('opacity', '1');
141
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
142
- $('#wc_openModalFormAction .close').css('display', 'block');
143
- $('#wc_openModalFormAction > #wc_response_info').html(html + obj.message);
144
- $('#wc_comment-' + uniqueID).val('');
145
- $('.wc_comm_form textarea').css('height', '46px');
146
-
147
- if (wc_submitID === 'wc_comm-' + wc_comment_post_ID + '_0') {
148
- $('#wc-form-footer-' + uniqueID).slideToggle(700);
149
- } else {
150
- $('#wc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
151
- }
152
-
153
- $.cookie('wc_author_name', wc_name);
154
- $.cookie('wc_author_email', wc_email);
155
- } else {
156
- wc_all_comments_count_new = obj.wc_all_comments_count_new;
157
- $('#wc_comment-' + uniqueID).val('');
158
- $('.wc_comm_form textarea').css('height', '46px');
159
-
160
- if (wc_submitID === 'wc_comm-' + wc_comment_post_ID + '_0') {
161
- $('.wc-thread-wrapper').prepend(obj.message);
162
- $('#wc-form-footer-' + uniqueID).slideToggle(700);
163
- $('#wc_curr_user_comment_count').val(parseInt($('#wc_curr_user_comment_count').val()) + 1);
164
- } else {
165
- $('#wc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
166
-
167
- if ($('#wc-comm-' + uniqueID).hasClass('wc-reply')) {
168
- $('#wc-secondary-forms-wrapper-' + uniqueID).after(obj.message.replace('wc-reply', 'wc-reply wc-no-left-margin'));
169
- } else {
170
- $('#wc-secondary-forms-wrapper-' + uniqueID).after(obj.message);
171
- }
172
- }
173
- $('#wc_openModalFormAction').css('opacity', '0');
174
- $('#wc_openModalFormAction').css('pointer-events', 'none');
175
- if (wc_name !== '' && wc_email !== '') {
176
- $.cookie('wc_author_name', wc_name);
177
- $.cookie('wc_author_email', wc_email);
178
- $('#wpcomm .wc_name').val(wc_name);
179
- $('#wpcomm .wc_email').val(wc_email);
180
- }
181
- if ($('.wc_header_text_count').length) {
182
- $('.wc_header_text_count').val(parseInt($('.wc_header_text_count').val()) + 1);
183
- }
184
- $.cookie('wc_all_comments_count_new', wc_all_comments_count_new);
185
-
186
- }
187
- $('#wc_captcha-' + uniqueID).val('');
188
- $('.wc_tooltipster').tooltipster({offsetY: 2});
189
- $('.wc_comm_form input').css('box-shadow', '0 0 4px -2px #d4d0ba');
190
- $('.wc_comm_form textarea').css('box-shadow', '0 0 4px -2px #d4d0ba');
191
-
192
- notify_on_new_comment(wc_comment_post_ID, wc_new_comment_id, wc_email, notification_type);
193
-
194
- // call redirection if comment added successfully
195
- if (obj.code == 1 || obj.code == -2) {
196
- $.ajax({
197
- type: 'POST',
198
- url: wc_ajax_obj.url,
199
- data: {
200
- wc_new_comment_id: wc_new_comment_id,
201
- action: 'wpdiscuz_comment_redirect'
202
- }
203
- }).done(function (redirectResponse) {
204
- try {
205
- var redirectObj = $.parseJSON(redirectResponse);
206
- if (redirectObj.code == 1) {
207
- setTimeout(function () {
208
- window.location.href = redirectObj.redirect_to;
209
- }, 5000)
210
- }
211
- } catch (e) {
212
-
213
- }
214
- });
215
- }
216
-
217
- } catch (e) {
218
- $('#wc_captcha-' + uniqueID).val('');
219
- $('.wc_tooltipster').tooltipster({offsetY: 2});
220
- $('.wc_comm_form input').css('box-shadow', '0 0 4px -2px #d4d0ba');
221
- $('.wc_comm_form textarea').css('box-shadow', '0 0 4px -2px #d4d0ba');
222
- var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
223
- $('#wc_openModalFormAction').css('opacity', '1');
224
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
225
- $('#wc_openModalFormAction .close').css('display', 'block');
226
- if (response.contains('<') && response.contains('>')) {
227
- $('#wc_openModalFormAction > #wc_response_info').html(html + e);
228
- } else {
229
- $('#wc_openModalFormAction > #wc_response_info').html(html + response);
230
- }
231
- }
232
- });
233
- }
234
- else {
235
- return false;
236
- }
237
- });
238
-
239
-
240
-
241
- $(document).delegate('.wc_vote', 'click', function () {
242
- var uniqueID = getUniqueID($(this));
243
- var commentID = getCommentID(uniqueID);
244
- var voteType;
245
-
246
- $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
247
- $('#wc_openModalFormAction .close').css('display', 'block');
248
- $('#wc_openModalFormAction').css('opacity', '1');
249
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
250
- if ($(this).hasClass('wc-up')) {
251
- voteType = 1;
252
- } else {
253
- voteType = -1;
254
- }
255
-
256
- $.ajax({
257
- dateType: 'json',
258
- type: 'POST',
259
- url: wc_ajax_obj.url,
260
- data: {
261
- comment_ID: commentID,
262
- vote_type: voteType,
263
- action: 'wc_vote_via_ajax'
264
- }
265
- }).done(function (response) {
266
- var obj = $.parseJSON(response);
267
-
268
- if (obj.code !== -1) {
269
- $('#vote-count-' + uniqueID).text(parseInt($('#vote-count-' + uniqueID).text()) + voteType);
270
- $('#wc_openModalFormAction').css('opacity', '0');
271
- $('#wc_openModalFormAction').css('pointer-events', 'none');
272
- } else {
273
- var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
274
- $('#wc_response_info').html(html + obj.message);
275
- $('#wc_openModalFormAction .close').css('display', 'block');
276
- }
277
- });
278
- });
279
-
280
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
281
- $(document).delegate('.wc-load-more-submit', 'click', function () {
282
-
283
- $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
284
- $('#wc_openModalFormAction .close').css('display', 'none');
285
- $('#wc_openModalFormAction').css('opacity', '1');
286
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
287
-
288
- var wc_comments_offset_value = wc_comments_offset.val();
289
- var wc_post_id = getPostID($(this).attr('id'));
290
- var wc_parent_comments_count = parseInt($('#wc_parent_comments_count').val());
291
- var wc_parent_per_page = parseInt($('#wc_parent_per_page').val());
292
- var wc_last_comment_id = ($('#wc_last_comment_id_before_update').val()) ? $('#wc_last_comment_id_before_update').val() : 0;
293
- var wc_curr_user_comment_count = $('#wc_curr_user_comment_count').val();
294
-
295
- wc_comments_offset_value = parseInt(wc_comments_offset_value);
296
- wc_comments_offset_value++;
297
-
298
- $.ajax({
299
- type: 'POST',
300
- url: wc_ajax_obj.url,
301
- data: {
302
- comments_offset: wc_comments_offset_value,
303
- wc_curr_user_comment_count: wc_curr_user_comment_count,
304
- wc_post_id: wc_post_id,
305
- wc_last_comment_id: wc_last_comment_id,
306
- action: 'wc_load_more_comments'
307
- }
308
- }).done(function (response) {
309
- var obj = $.parseJSON(response);
310
- wc_comments_offset.val(wc_comments_offset_value);
311
- if (wc_parent_comments_count <= (wc_comments_offset_value * wc_parent_per_page)) {
312
- $('.wc-load-more-submit-wrap').remove();
313
- }
314
- $('.wc-thread-wrapper').html(obj.message);
315
- $('#wc_last_comment_id').val(obj.wc_last_comment_id);
316
- $('#hidden_new_comment_count').val(obj.hidden_new_comment_count);
317
- $('#wc_openModalFormAction').css('opacity', '0');
318
- $('#wc_openModalFormAction').css('pointer-events', 'none');
319
- $('.wc_tooltipster').tooltipster({offsetY: 2});
320
- setInputsDataFromCookie();
321
- });
322
- });
323
-
324
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
325
- $(document).delegate('.wc_new_comment', 'click', function () {
326
- wc_submitID = $('.wc_main_comm_form input.wc_comm_submit').attr('id');
327
- var uniqueID = wc_submitID.substring(wc_submitID.lastIndexOf('-') + 1);
328
- wc_comment_post_ID = getPostID(uniqueID);
329
- var wc_last_new_comment_id = $('#wc_last_new_comment_id').val();
330
- wc_email = $.cookie('wc_author_email');
331
- var wc_curr_user_comment_count = $('#wc_curr_user_comment_count').val();
332
- var wc_comments_offset_value = wc_comments_offset.val();
333
-
334
- var wc_visible_comments_ids = '';
335
- $('.wc-thread-wrapper .wc-comment').each(function () {
336
- var comment_id = $(this).attr('id');
337
- var commentUniqueID = comment_id.substring(comment_id.lastIndexOf('-') + 1);
338
- wc_visible_comments_ids += getCommentID(commentUniqueID) + ',';
339
- });
340
-
341
- $.ajax({
342
- type: 'POST',
343
- url: wc_ajax_obj.url,
344
- data: {
345
- wc_requested_comments_type: 1,
346
- wc_last_comment_id: wc_last_new_comment_id,
347
- wc_post_id: wc_comment_post_ID,
348
- wc_author_email: wc_email,
349
- wc_comments_offset: wc_comments_offset_value,
350
- wc_curr_user_comment_count: wc_curr_user_comment_count,
351
- wc_visible_comments_ids: wc_visible_comments_ids,
352
- action: 'wc_list_new_comments'
353
- }
354
- }).done(function (response) {
355
- try {
356
- var obj = $.parseJSON(response);
357
- if (obj.code != 0) {
358
- $('.wc-thread-wrapper').html(obj.message);
359
- $('#wc_last_new_comment_id').val(obj.wc_last_comment_id);
360
- $('.wc_new_comment').hide();
361
- $(document).delegate('.wc_new_loaded_comment', 'mouseenter', function () {
362
- if ($(this).parent('.wc-comment').hasClass('wc-reply')) {
363
- $(this, '.wc-comment-right').animate({
364
- backgroundColor: "#f8f8f8"
365
- }, 1500);
366
- } else {
367
- $(this, '.wc-comment-right').animate({
368
- backgroundColor: "#fefefe"
369
- }, 1500);
370
- }
371
-
372
- $(this, '.wc-comment-right').removeClass('wc_new_loaded_comment');
373
- });
374
- }
375
- } catch (e) {
376
- console.log(e);
377
- }
378
- });
379
- });
380
-
381
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
382
- $(document).delegate('.wc_new_reply', 'click', function () {
383
- wc_submitID = $('.wc_main_comm_form input.wc_comm_submit').attr('id');
384
- var uniqueID = wc_submitID.substring(wc_submitID.lastIndexOf('-') + 1);
385
- wc_comment_post_ID = getPostID(uniqueID);
386
- var wc_last_new_reply_id = $('#wc_last_new_reply_id').val();
387
- wc_email = $.cookie('wc_author_email');
388
- var wc_curr_user_comment_count = $('#wc_curr_user_comment_count').val();
389
- var wc_comments_offset_value = wc_comments_offset.val();
390
-
391
- var wc_visible_comments_ids = '';
392
- $('.wc-thread-wrapper .wc-comment').each(function () {
393
- var comment_id = $(this).attr('id');
394
- var commentUniqueID = comment_id.substring(comment_id.lastIndexOf('-') + 1);
395
- wc_visible_comments_ids += getCommentID(commentUniqueID) + ',';
396
- });
397
-
398
- $.ajax({
399
- type: 'POST',
400
- url: wc_ajax_obj.url,
401
- data: {
402
- wc_requested_comments_type: 2,
403
- wc_last_comment_id: wc_last_new_reply_id,
404
- wc_comments_offset: wc_comments_offset_value,
405
- wc_curr_user_comment_count: wc_curr_user_comment_count,
406
- wc_post_id: wc_comment_post_ID,
407
- wc_author_email: wc_email,
408
- wc_visible_comments_ids: wc_visible_comments_ids,
409
- action: 'wc_list_new_comments'
410
- }
411
- }).done(function (response) {
412
- try {
413
- var obj = $.parseJSON(response);
414
- if (obj.code != 0) {
415
- $('.wc-thread-wrapper').html(obj.message);
416
- $('#wc_last_new_reply_id').val(obj.wc_last_comment_id);
417
- $('.wc_new_reply').hide();
418
- }
419
- } catch (e) {
420
- console.log(e);
421
- }
422
- });
423
- });
424
-
425
-
426
- function getUniqueID(field) {
427
- var fieldID = field.attr('id');
428
- var uniqueID = fieldID.substring(fieldID.lastIndexOf('-') + 1);
429
- return uniqueID;
430
- }
431
-
432
- function getPostID(uniqueID) {
433
- var postID = uniqueID.substring(uniqueID.lastIndexOf('-') + 1);
434
- postID = postID.substring(0, postID.lastIndexOf('_'));
435
- return postID;
436
- }
437
-
438
- function getCommentID(uniqueID) {
439
- var commentID = uniqueID.substring(uniqueID.indexOf('_') + 1);
440
- return commentID;
441
- }
442
-
443
- function getCommentDepth(field) {
444
- var fieldClasses = field.attr('class');
445
- var classesArray = fieldClasses.split(' ');
446
- var depth = '';
447
- $.each(classesArray, function (index, value) {
448
- ;
449
- if ('wc_comment_level' === getParentDepth(value, false)) {
450
- depth = getParentDepth(value, true);
451
- }
452
- });
453
- return parseInt(depth) + 1;
454
- }
455
-
456
- function getParentDepth(depthValue, isNumberPart) {
457
- var depth = '';
458
- if (isNumberPart) {
459
- depth = depthValue.substring(depthValue.indexOf('-') + 1);
460
- } else {
461
- depth = depthValue.substring(0, depthValue.indexOf('-'));
462
- }
463
- return depth;
464
- }
465
-
466
- function isMainFormSubmit(wc_submitID, wc_comment_post_ID) {
467
- return wc_submitID === 'wc_comm-' + wc_comment_post_ID + '_0';
468
- }
469
-
470
- /**
471
- * live update
472
- */
473
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
474
- function liveUpdate() {
475
- var isNewComment = $.cookie('wc_all_comments_count_new') ? false : true;
476
- if (wc_comment_list_update_type == 1) {
477
- if (!isFieldsActive(isNewComment)) {
478
- updateAutomatically();
479
- }
480
- } else if (wc_comment_list_update_type == 2) {
481
- if (!isFieldsActive(isNewComment)) {
482
- updateIfNewComments();
483
- }
484
- }
485
- }
486
-
487
- /**
488
- * update automatically
489
- */
490
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
491
- function updateAutomatically() {
492
- // wc_submitID = $('.wc_main_comm_form input.wc_comm_submit').attr('id');
493
- // var uniqueID = wc_submitID.substring(wc_submitID.lastIndexOf('-') + 1);
494
- wc_comment_post_ID = $('#wpdiscuz_current_post_id').val();
495
- var wc_last_comment_id = $('#wc_last_comment_id_before_update').val();
496
- var wc_last_new_comment_id = $('#wc_last_new_comment_id').val();
497
- var wc_last_new_reply_id = $('#wc_last_new_reply_id').val();
498
- var comment_offset = $('#wc_comments_offset').length ? $('#wc_comments_offset').val() : 1;
499
- var wc_all_comments_count_old = $.cookie('wc_all_comments_count_old');
500
- var wc_curr_user_comment_count = $('#wc_curr_user_comment_count').val();
501
- var wc_author_email = $.cookie('wc_author_email');
502
- $.ajax({
503
- type: 'POST',
504
- url: wc_ajax_obj.url,
505
- data: {
506
- wc_author_email: wc_author_email,
507
- wc_curr_user_comment_count: wc_curr_user_comment_count,
508
- wc_last_comment_id: wc_last_comment_id,
509
- wc_last_new_comment_id: wc_last_new_comment_id,
510
- wc_last_new_reply_id: wc_last_new_reply_id,
511
- wc_all_comments_count_old: wc_all_comments_count_old,
512
- wc_comments_offset: comment_offset,
513
- wc_comment_list_update_type: wc_comment_list_update_type,
514
- wc_post_id: wc_comment_post_ID,
515
- action: 'wc_live_update'
516
- }
517
- }).done(function (response) {
518
- update(response);
519
- });
520
- }
521
-
522
- /**
523
- * check if post has new comments updates comment list
524
- */
525
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
526
- function updateIfNewComments() {
527
- wc_submitID = $('.wc_main_comm_form input.wc_comm_submit').attr('id');
528
- var uniqueID = wc_submitID.substring(wc_submitID.lastIndexOf('-') + 1);
529
- wc_comment_post_ID = getPostID(uniqueID);
530
- wc_comment_parent = getCommentID(uniqueID);
531
- var comment_offset = $('#wc_comments_offset').length ? $('#wc_comments_offset').val() : 1;
532
- var wc_curr_user_comment_count = $('#wc_curr_user_comment_count').val();
533
- var wc_last_comment_id = $('#wc_last_comment_id').val();
534
- var wc_last_new_comment_id = $('#wc_last_new_comment_id').val();
535
- var wc_last_new_reply_id = $('#wc_last_new_reply_id').val();
536
- wc_email = $.cookie('wc_author_email');
537
- $.ajax({
538
- type: 'POST',
539
- url: wc_ajax_obj.url,
540
- data: {
541
- wc_last_comment_id: wc_last_comment_id,
542
- wc_last_new_comment_id: wc_last_new_comment_id,
543
- wc_last_new_reply_id: wc_last_new_reply_id,
544
- wc_comment_list_update_type: wc_comment_list_update_type,
545
- wc_comments_offset: comment_offset,
546
- wc_curr_user_comment_count: wc_curr_user_comment_count,
547
- wc_post_id: wc_comment_post_ID,
548
- wc_author_email: wc_email,
549
- action: 'wc_live_update'
550
- }
551
- }).done(function (response) {
552
- update(response);
553
- });
554
- }
555
-
556
- /**
557
- * update front end
558
- */
559
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
560
- function update(response) {
561
- try {
562
- var obj = $.parseJSON(response);
563
- if (obj.code == 1) {
564
- $('.wc-thread-wrapper').html(obj.message);
565
- if ($('.wc_header_text_count').length) {
566
- $('.wc_header_text_count').html(obj.wc_all_comments_count_new);
567
- }
568
- $('#wc_last_comment_id').val(obj.wc_last_comment_id);
569
- } else if (obj.code == 2) {
570
- if (obj.wc_new_comment_count) {
571
- $('.wc_new_comment_button_text').html(obj.wc_new_comment_count + ' ' + obj.wc_new_comment_button_text);
572
- $('.wc_new_comment').css('display', 'inline-block');
573
- } else {
574
- $('.wc_new_comment').css('display', 'none');
575
- }
576
- if (obj.wc_new_reply_count) {
577
- $('.wc_new_reply_button_text').html(obj.wc_new_reply_count + ' ' + obj.wc_new_reply_button_text);
578
- $('.wc_new_reply').css('display', 'inline-block');
579
- } else {
580
- $('.wc_new_reply').css('display', 'none');
581
- }
582
- }
583
- setInputsDataFromCookie();
584
- } catch (e) {
585
- console.log(e);
586
- }
587
- }
588
-
589
- /**
590
- * check update or not
591
- */
592
- // MUST BE CHANGED IN NEXT VERSION OF PLUGIN
593
- function isFieldsActive(isNewComment) {
594
- var isInpFocus = $('.wc_secondary_form input.wc_field_input').is(':focus');
595
- var isTextAreaFocused = $('.wc_secondary_form textarea.wc_field_input').is(':focus');
596
- var isInputNotEmpty = false;
597
- var isTextAreaNotEmpty = false;
598
- if (isNewComment) {
599
- $('.wc_secondary_form input.wc_field_input').each(function () {
600
- if ($(this).val() != '') {
601
- isInputNotEmpty = true;
602
- }
603
- });
604
- }
605
- else {
606
- $('.wc_secondary_form input.wc_field_captcha').each(function () {
607
- if ($(this).val() != '') {
608
- isInputNotEmpty = true;
609
- }
610
- });
611
- }
612
-
613
- $('.wc_secondary_form textarea.wc_field_input').each(function () {
614
- if ($(this).val() != '') {
615
- isTextAreaNotEmpty = true;
616
- }
617
- });
618
- return isInpFocus || isTextAreaFocused || isInputNotEmpty || isTextAreaNotEmpty;
619
- }
620
-
621
- if (wc_comment_list_update_type != 0) {
622
- setInterval(liveUpdate, wc_comment_list_update_timer * 1000);
623
- }
624
-
625
- function setInputsDataFromCookie() {
626
- if ($.cookie('wc_author_name') && $.cookie('wc_author_email')) {
627
- $('.wc_name').val($.cookie('wc_author_name'));
628
- $('.wc_email').val($.cookie('wc_author_email'));
629
- }
630
- }
631
-
632
- function notify_on_new_comment(post_id, comment_id, email, type) {
633
- $.ajax({
634
- type: 'POST',
635
- url: wc_ajax_obj.url,
636
- data: {
637
- wc_post_id: post_id,
638
- wc_comment_id: comment_id,
639
- wc_notifcattion_type: type,
640
- wc_email: email,
641
- action: 'wc_check_notification_type'
642
- }
643
- });
644
- }
645
-
646
- $(document).delegate('.wc_editable_comment', 'click', function () {
647
- var uniqueID = getUniqueID($(this));
648
- var commentID = getCommentID(uniqueID);
649
-
650
- $.ajax({
651
- type: 'POST',
652
- url: wc_ajax_obj.url,
653
- data: {
654
- comment_id: commentID,
655
- action: 'wc_get_editable_comment_content'
656
- }
657
- }).done(function (response) {
658
- try {
659
- var obj = $.parseJSON(response);
660
- if (obj.code == 1) {
661
- wc_comment_text_before_editting = obj.message;
662
- var editableTextarea = '<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-' + uniqueID + '" style="min-height: 2em;">' + obj.message + '</textarea>';
663
- $('#wc-comm-' + uniqueID + ' .wc-comment-text').replaceWith(editableTextarea);
664
- document.getElementById('wc_edit_comment-' + uniqueID).focus();
665
- $('#wc_save_edited_comment-' + uniqueID).show();
666
- editableTextarea = '';
667
- $('#wc_editable_comment-' + uniqueID).hide();
668
- $('#wc_cancel_edit-' + uniqueID).show();
669
- } else {
670
- var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
671
- $('#wc_openModalFormAction').css('opacity', '1');
672
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
673
- $('#wc_openModalFormAction .close').css('display', 'block');
674
- $('#wc_openModalFormAction > #wc_response_info').html(html + obj.phrase_message);
675
- }
676
- } catch (e) {
677
- console.log(e);
678
- }
679
- });
680
- });
681
-
682
- $(document).delegate('.wc_save_edited_comment', 'click', function () {
683
- var uniqueID = getUniqueID($(this));
684
- var commentID = getCommentID(uniqueID);
685
- var editableTextarea = $('#wc-comm-' + uniqueID + ' textarea#wc_edit_comment-' + uniqueID);
686
- var commentContent = editableTextarea.val();
687
- var submit = true;
688
- var depth = getCommentDepth($(this).parents('.wc-comment')) - 1;
689
- if ($.trim(commentContent).length <= 0) {
690
- submit = false;
691
- }
692
-
693
- if (submit) {
694
- $('#wc_openModalFormAction .close').css('display', 'none');
695
- $('#wc_openModalFormAction').css('opacity', '1');
696
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
697
- $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
698
-
699
- $.ajax({
700
- type: 'POST',
701
- url: wc_ajax_obj.url,
702
- data: {
703
- comment_id: commentID,
704
- comment_content: commentContent,
705
- comment_depth: depth,
706
- action: 'wc_save_edited_comment'
707
- }
708
- }).done(function (response) {
709
- try {
710
- var obj = $.parseJSON(response);
711
- if (obj.code == 1) {
712
- $('#wc_openModalFormAction').css('opacity', '0');
713
- $('#wc_openModalFormAction').css('pointer-events', 'none');
714
- $('#wc-comm-' + uniqueID).replaceWith(obj.message);
715
- } else {
716
- var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
717
- $('#wc_openModalFormAction').css('opacity', '1');
718
- $('#wc_openModalFormAction').css('pointer-events', 'auto');
719
- $('#wc_openModalFormAction .close').css('display', 'block');
720
- $('#wc_openModalFormAction > #wc_response_info').html(html + obj.phrase_message);
721
- }
722
- editableTextarea = '';
723
- commentContent = '';
724
- } catch (e) {
725
- console.log(e);
726
- }
727
- });
728
- }
729
- });
730
-
731
- $(document).delegate('.wc_cancel_edit', 'click', function () {
732
- var uniqueID = getUniqueID($(this));
733
- $('#wc_editable_comment-' + uniqueID).show();
734
- $('#wc_cancel_edit-' + uniqueID).hide();
735
- $('#wc_save_edited_comment-' + uniqueID).hide();
736
- var commentContentWrapper = '<div class="wc-comment-text">' + nl2br(wc_comment_text_before_editting) + '</div>';
737
- $('#wc-comm-' + uniqueID + ' #wc_edit_comment-' + uniqueID).replaceWith(commentContentWrapper);
738
- });
739
-
740
- function nl2br(str, is_xhtml) {
741
- var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br/>' : '<br>';
742
- var string = (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
743
- return string.replace('<br><br>', '<br/>');
744
- }
745
-
746
- $('.wc_tooltipster').tooltipster({offsetY: 2});
747
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/js/wc-ajax.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(f){var D=f("#wc_home_url").val();var t=f("#wc_plugin_dir_url").val();var v;var l;var k;var r;var C;var j;var g;var y;var h;var m;var z;var d;var o=parseInt(f("#wc_comment_list_update_type").val());var e=parseInt(f("#wc_comment_list_update_timer").val());var i;var H;f(".wc_comment").autoGrow();f(document).delegate("#wc_openModalFormAction","click",function(){f("#wc_openModalFormAction").css("opacity","0");f("#wc_openModalFormAction").css("pointer-events","none")});f(document).delegate("#wc_openModalFormAction .close","click",function(){f("#wc_openModalFormAction").css("opacity","0");f("#wc_openModalFormAction").css("pointer-events","none")});d="<img width='64' height='64' src='"+D+"/"+t+"/files/img/loader/ajax-loader-200x200.gif' />";m=f("#wc_comments_offset");m.val("1");f(document).delegate(".wc_comment","focus",function(){var I=a(f(this));f("#wc-form-footer-"+I).slideDown(700)});f(document).delegate(".wc-reply-link","click",function(){var I=a(f(this));if(f(".wc_social_plugin_wrapper .wp-social-login-provider-list").length&&!(f("#wc-secondary-forms-social-content-"+I+" .wp-social-login-provider-list").length)){f(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wc-secondary-forms-social-content-"+I)}else{if(f(".wc_social_plugin_wrapper .the_champ_login_container").length&&!(f("#wc-secondary-forms-social-content-"+I+" .the_champ_login_container").length)){f(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wc-secondary-forms-social-content-"+I)}else{if(f(".wc_social_plugin_wrapper .social_connect_form").length&&!(f("#wc-secondary-forms-social-content-"+I+" .social_connect_form").length)){f(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wc-secondary-forms-social-content-"+I)}}}f("#wc-secondary-forms-wrapper-"+I).slideToggle(700)});f(document).delegate(".wc-share-link","click",function(){var I=a(f(this));f("#share_buttons_box-"+I).slideToggle(1000)});f(document).delegate(".wc_captcha_refresh_img","click",function(){var K=a(f(this));var I=f("#wc_comment_post_ID-"+K).val();var J=f("#wc_comment_parent-"+K).val();f("#wc_captcha_img-"+K).attr("src",D+"/"+t+"/captcha/captcha.php?comm_id="+I+"-"+J+"&r="+Math.random())});f(document).delegate(".wc_comm_submit","click",function(){h=f(this).attr("id");var L=h.substring(h.lastIndexOf("-")+1);v=f("#wc_name-"+L).val();l=f("#wc_email-"+L).val();r=(f("#wc_website-"+L).length)?f("#wc_website-"+L).val():"";k=f("textarea#wc_comment-"+L).val();C=f("#wc_captcha-"+L).val();j=f("#wc_comment_post_ID-"+L).val();g=f("#wc_comment_parent-"+L).val();y=f("#wc_comm_form-"+L);var M=f("input[name='wc_comment_reply_notification-"+L+"']:checked").length?f("input[name='wc_comment_reply_notification-"+L+"']:checked").val():"";var K="";if(c(h,j)){K=1}else{K=x(f(this).parents(".wc-comment"))}var I="";if(M.length&&M!="wc_notification_none"){if(M=="wc_notification_new_reply"){I="reply"}if(M=="wc_notification_all_new_reply"){I="all_comment"}if(M=="wc_notification_new_comment"){I="post"}}var J=true;if(!wpdiscuzValidator.checkAll(y)){J=false;f("#wc_captcha-"+L).val("");f("#wc_captcha_img-"+L).attr("src",D+"/"+t+"/captcha/captcha.php?comm_id="+j+"-"+g+"&r="+Math.random())}else{f("#wc_openModalFormAction .close").css("display","none");f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction > #wc_response_info").html(d)}if(J){f.ajax({type:"POST",url:wc_ajax_obj.url,data:{name:v,email:l,website:r,comment:k,captcha:C,comment_post_ID:j,comment_parent:g,comment_depth:K,notification_type:I,action:"wc_comms_via_ajax"}}).done(function(N){f("#wc_captcha_img-"+L).attr("src",D+"/"+t+"/captcha/captcha.php?comm_id="+j+"-"+g+"&r="+Math.random());try{var Q=f.parseJSON(N);z=parseInt(Q.wc_new_comment_id);if(Q.code===-1){var O="<a href='#close' title='Close' class='close'>&nbsp;</a>";f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction .close").css("display","block");f("#wc_openModalFormAction > #wc_response_info").html(O+Q.message)}else{if(Q.code===-2){var O="<a href='#close' title='Close' class='close'>&nbsp;</a>";f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction .close").css("display","block");f("#wc_openModalFormAction > #wc_response_info").html(O+Q.message);f("#wc_comment-"+L).val("");f(".wc_comm_form textarea").css("height","46px");if(h==="wc_comm-"+j+"_0"){f("#wc-form-footer-"+L).slideToggle(700)}else{f("#wc-secondary-forms-wrapper-"+L).slideToggle(700)}f.cookie("wc_author_name",v);f.cookie("wc_author_email",l);f.cookie("wc_author_website",r)}else{i=Q.wc_all_comments_count_new;f("#wc_comment-"+L).val("");f(".wc_comm_form textarea").css("height","46px");if(h==="wc_comm-"+j+"_0"){f(".wc-thread-wrapper").prepend(Q.message);f("#wc-form-footer-"+L).slideToggle(700);f("#wc_curr_user_comment_count").val(parseInt(f("#wc_curr_user_comment_count").val())+1)}else{f("#wc-secondary-forms-wrapper-"+L).slideToggle(700);if(Q.is_in_same_container==1){f("#wc-secondary-forms-wrapper-"+L).after(Q.message)}else{f("#wc-secondary-forms-wrapper-"+L).after(Q.message.replace("wc-reply","wc-reply wc-no-left-margin"))}}f("#wc_openModalFormAction").css("opacity","0");f("#wc_openModalFormAction").css("pointer-events","none");f.cookie("wc_author_name",v);f.cookie("wc_author_email",l);f.cookie("wc_author_website",r);f("#wpcomm .wc_name").val(v);f("#wpcomm .wc_email").val(l);f("#wpcomm .wc_website").val(r);if(f(".wc_header_text_count").length){f(".wc_header_text_count").val(parseInt(f(".wc_header_text_count").val())+1)}f.cookie("wc_all_comments_count_new",i)}}f("#wc_captcha-"+L).val("");f(".wc_tooltipster").tooltipster({offsetY:2});f(".wc_comm_form input").css("box-shadow","0 0 4px -2px #d4d0ba");f(".wc_comm_form textarea").css("box-shadow","0 0 4px -2px #d4d0ba");b(j,z,l,I);if(Q.code==1||Q.code==-2){f.ajax({type:"POST",url:wc_ajax_obj.url,data:{wc_new_comment_id:z,action:"wpdiscuz_comment_redirect"}}).done(function(S){try{var R=f.parseJSON(S);if(R.code==1){setTimeout(function(){window.location.href=R.redirect_to},5000)}}catch(T){}})}}catch(P){f("#wc_captcha-"+L).val("");f(".wc_tooltipster").tooltipster({offsetY:2});f(".wc_comm_form input").css("box-shadow","0 0 4px -2px #d4d0ba");f(".wc_comm_form textarea").css("box-shadow","0 0 4px -2px #d4d0ba");var O="<a href='#close' title='Close' class='close'>&nbsp;</a>";f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction .close").css("display","block");if(N.contains("<")&&N.contains(">")){f("#wc_openModalFormAction > #wc_response_info").html(O+P)}else{f("#wc_openModalFormAction > #wc_response_info").html(O+N)}}})}else{return false}});f(document).delegate(".wc_vote","click",function(){var K=a(f(this));var I=F(K);var J;f("#wc_openModalFormAction > #wc_response_info").html(d);f("#wc_openModalFormAction .close").css("display","block");f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");if(f(this).hasClass("wc-up")){J=1}else{J=-1}f.ajax({dateType:"json",type:"POST",url:wc_ajax_obj.url,data:{comment_ID:I,vote_type:J,action:"wc_vote_via_ajax"}}).done(function(L){var N=f.parseJSON(L);if(N.code!==-1){f("#vote-count-"+K).text(parseInt(f("#vote-count-"+K).text())+J);f("#wc_openModalFormAction").css("opacity","0");f("#wc_openModalFormAction").css("pointer-events","none")}else{var M="<a href='#close' title='Close' class='close'>&nbsp;</a>";f("#wc_response_info").html(M+N.message);f("#wc_openModalFormAction .close").css("display","block")}})});f(document).delegate(".wc-load-more-submit","click",function(){f("#wc_openModalFormAction > #wc_response_info").html(d);f("#wc_openModalFormAction .close").css("display","none");f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");var L=m.val();var M=E(f(this).attr("id"));var N=parseInt(f("#wc_parent_comments_count").val());var J=parseInt(f("#wc_parent_per_page").val());var K=(f("#wc_last_comment_id_before_update").val())?f("#wc_last_comment_id_before_update").val():0;var I=f("#wc_curr_user_comment_count").val();L=parseInt(L);L++;f.ajax({type:"POST",url:wc_ajax_obj.url,data:{comments_offset:L,wc_curr_user_comment_count:I,wc_post_id:M,wc_last_comment_id:K,action:"wc_load_more_comments"}}).done(function(O){var P=f.parseJSON(O);m.val(L);if(N<=(L*J)){f(".wc-load-more-submit-wrap").remove()}f(".wc-thread-wrapper").html(P.message);f("#wc_last_comment_id").val(P.wc_last_comment_id);f("#hidden_new_comment_count").val(P.hidden_new_comment_count);f("#wc_openModalFormAction").css("opacity","0");f("#wc_openModalFormAction").css("pointer-events","none");f(".wc_tooltipster").tooltipster({offsetY:2});s()})});f(document).delegate(".wc_new_comment","click",function(){h=f(".wc_main_comm_form input.wc_comm_submit").attr("id");var M=h.substring(h.lastIndexOf("-")+1);j=E(M);var K=f("#wc_last_new_comment_id").val();l=f.cookie("wc_author_email");var J=f("#wc_curr_user_comment_count").val();var L=m.val();var I="";f(".wc-thread-wrapper .wc-comment").each(function(){var N=f(this).attr("id");var O=N.substring(N.lastIndexOf("-")+1);I+=F(O)+","});f.ajax({type:"POST",url:wc_ajax_obj.url,data:{wc_requested_comments_type:1,wc_last_comment_id:K,wc_post_id:j,wc_author_email:l,wc_comments_offset:L,wc_curr_user_comment_count:J,wc_visible_comments_ids:I,action:"wc_list_new_comments"}}).done(function(N){try{var P=f.parseJSON(N);if(P.code!=0){f(".wc-thread-wrapper").html(P.message);f("#wc_last_new_comment_id").val(P.wc_last_comment_id);f(".wc_new_comment").hide();f(document).delegate(".wc_new_loaded_comment","mouseenter",function(){if(f(this).parent(".wc-comment").hasClass("wc-reply")){f(this,".wc-comment-right").animate({backgroundColor:"#f8f8f8"},1500)}else{f(this,".wc-comment-right").animate({backgroundColor:"#fefefe"},1500)}f(this,".wc-comment-right").removeClass("wc_new_loaded_comment")})}}catch(O){console.log(O)}})});f(document).delegate(".wc_new_reply","click",function(){h=f(".wc_main_comm_form input.wc_comm_submit").attr("id");var M=h.substring(h.lastIndexOf("-")+1);j=E(M);var K=f("#wc_last_new_reply_id").val();l=f.cookie("wc_author_email");var J=f("#wc_curr_user_comment_count").val();var L=m.val();var I="";f(".wc-thread-wrapper .wc-comment").each(function(){var N=f(this).attr("id");var O=N.substring(N.lastIndexOf("-")+1);I+=F(O)+","});f.ajax({type:"POST",url:wc_ajax_obj.url,data:{wc_requested_comments_type:2,wc_last_comment_id:K,wc_comments_offset:L,wc_curr_user_comment_count:J,wc_post_id:j,wc_author_email:l,wc_visible_comments_ids:I,action:"wc_list_new_comments"}}).done(function(N){try{var P=f.parseJSON(N);if(P.code!=0){f(".wc-thread-wrapper").html(P.message);f("#wc_last_new_reply_id").val(P.wc_last_comment_id);f(".wc_new_reply").hide()}}catch(O){console.log(O)}})});function a(J){var I=J.attr("id");var K=I.substring(I.lastIndexOf("-")+1);return K}function E(J){var I=J.substring(J.lastIndexOf("-")+1);I=I.substring(0,I.lastIndexOf("_"));return I}function F(J){var I=J.substring(J.indexOf("_")+1);return I}function x(K){var J=K.attr("class");var I=J.split(" ");var L="";f.each(I,function(M,N){if("wc_comment_level"===G(N,false)){L=G(N,true)}});return parseInt(L)+1}function G(I,J){var K="";if(J){K=I.substring(I.indexOf("-")+1)}else{K=I.substring(0,I.indexOf("-"))}return K}function c(J,I){return J==="wc_comm-"+I+"_0"}function q(){var I=f.cookie("wc_all_comments_count_new")?false:true;if(o==1){if(!u(I)){p()}}else{if(o==2){if(!u(I)){B()}}}}function p(){j=f("#wpdiscuz_current_post_id").val();var O=f("#wc_last_comment_id_before_update").val();var K=f("#wc_last_new_comment_id").val();var L=f("#wc_last_new_reply_id").val();var M=f("#wc_comments_offset").length?f("#wc_comments_offset").val():1;var N=f.cookie("wc_all_comments_count_old");var I=f("#wc_curr_user_comment_count").val();var J=f.cookie("wc_author_email");f.ajax({type:"POST",url:wc_ajax_obj.url,data:{wc_author_email:J,wc_curr_user_comment_count:I,wc_last_comment_id:O,wc_last_new_comment_id:K,wc_last_new_reply_id:L,wc_all_comments_count_old:N,wc_comments_offset:M,wc_comment_list_update_type:o,wc_post_id:j,action:"wc_live_update"}}).done(function(P){n(P)})}function B(){h=f(".wc_main_comm_form input.wc_comm_submit").attr("id");var N=h.substring(h.lastIndexOf("-")+1);j=E(N);g=F(N);var L=f("#wc_comments_offset").length?f("#wc_comments_offset").val():1;var I=f("#wc_curr_user_comment_count").val();var M=f("#wc_last_comment_id").val();var J=f("#wc_last_new_comment_id").val();var K=f("#wc_last_new_reply_id").val();l=f.cookie("wc_author_email");f.ajax({type:"POST",url:wc_ajax_obj.url,data:{wc_last_comment_id:M,wc_last_new_comment_id:J,wc_last_new_reply_id:K,wc_comment_list_update_type:o,wc_comments_offset:L,wc_curr_user_comment_count:I,wc_post_id:j,wc_author_email:l,action:"wc_live_update"}}).done(function(O){n(O)})}function n(I){try{var K=f.parseJSON(I);if(K.code==1){f(".wc-thread-wrapper").html(K.message);if(f(".wc_header_text_count").length){f(".wc_header_text_count").html(K.wc_all_comments_count_new)}f("#wc_last_comment_id").val(K.wc_last_comment_id)}else{if(K.code==2){if(K.wc_new_comment_count){f(".wc_new_comment_button_text").html(K.wc_new_comment_count+" "+K.wc_new_comment_button_text);f(".wc_new_comment").css("display","inline-block")}else{f(".wc_new_comment").css("display","none")}if(K.wc_new_reply_count){f(".wc_new_reply_button_text").html(K.wc_new_reply_count+" "+K.wc_new_reply_button_text);f(".wc_new_reply").css("display","inline-block")}else{f(".wc_new_reply").css("display","none")}}}s()}catch(J){console.log(J)}}function u(K){var J=f(".wc_secondary_form input.wc_field_input").is(":focus");var I=f(".wc_secondary_form textarea.wc_field_input").is(":focus");var M=false;var L=false;if(K){f(".wc_secondary_form input.wc_field_input").each(function(){if(f(this).val()!=""){M=true}})}else{f(".wc_secondary_form input.wc_field_captcha").each(function(){if(f(this).val()!=""){M=true}})}f(".wc_secondary_form textarea.wc_field_input").each(function(){if(f(this).val()!=""){L=true}});return J||I||M||L}if(o!=0){setInterval(q,e*1000)}function s(){if(f.cookie("wc_author_name")&&f.cookie("wc_author_email")){f(".wc_name").val(f.cookie("wc_author_name"));f(".wc_email").val(f.cookie("wc_author_email"))}}function b(J,L,I,K){f.ajax({type:"POST",url:wc_ajax_obj.url,data:{wc_post_id:J,wc_comment_id:L,wc_notifcattion_type:K,wc_email:I,action:"wc_check_notification_type"}})}f(document).delegate(".wc_editable_comment","click",function(){var J=a(f(this));var I=F(J);f.ajax({type:"POST",url:wc_ajax_obj.url,data:{comment_id:I,action:"wc_get_editable_comment_content"}}).done(function(L){try{var O=f.parseJSON(L);if(O.code==1){H=O.message;var K='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+J+'" style="min-height: 2em;">'+O.message+"</textarea>";f("#wc-comm-"+J+" > .wc-comment-right .wc-comment-text").replaceWith(K);document.getElementById("wc_edit_comment-"+J).focus();f("#wc_save_edited_comment-"+J).show();K="";f("#wc_editable_comment-"+J).hide();f("#wc_cancel_edit-"+J).show()}else{var M="<a href='#close' title='Close' class='close'>&nbsp;</a>";f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction .close").css("display","block");f("#wc_openModalFormAction > #wc_response_info").html(M+O.phrase_message)}}catch(N){console.log(N)}})});f(document).delegate(".wc_save_edited_comment","click",function(){var N=a(f(this));var J=F(N);var I=f("#wc-comm-"+N+" textarea#wc_edit_comment-"+N);var K=I.val();var L=true;var M=x(f(this).parents(".wc-comment"))-1;if(f.trim(K).length<=0){L=false}if(L){f("#wc_openModalFormAction .close").css("display","none");f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction > #wc_response_info").html(d);f.ajax({type:"POST",url:wc_ajax_obj.url,data:{comment_id:J,comment_content:K,comment_depth:M,action:"wc_save_edited_comment"}}).done(function(O){try{var R=f.parseJSON(O);if(R.code==1){f("#wc_openModalFormAction").css("opacity","0");f("#wc_openModalFormAction").css("pointer-events","none");A(N,R.message)}else{var P="<a href='#close' title='Close' class='close'>&nbsp;</a>";f("#wc_openModalFormAction").css("opacity","1");f("#wc_openModalFormAction").css("pointer-events","auto");f("#wc_openModalFormAction .close").css("display","block");f("#wc_openModalFormAction > #wc_response_info").html(P+R.phrase_message)}I="";K=""}catch(Q){console.log(Q)}})}});f(document).delegate(".wc_cancel_edit","click",function(){var I=a(f(this));A(I,H)});function A(K,J){f("#wc_editable_comment-"+K).show();f("#wc_cancel_edit-"+K).hide();f("#wc_save_edited_comment-"+K).hide();var I='<div class="wc-comment-text">'+w(J)+"</div>";f("#wc-comm-"+K+" #wc_edit_comment-"+K).replaceWith(I)}function w(L,K){var J=(K||typeof K==="undefined")?"<br/>":"<br>";var I=(L+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+J+"$2");return I.replace("<br><br>","<br/>")}f(".wc_tooltipster").tooltipster({offsetY:2})});
files/js/wc-frontend.js DELETED
@@ -1,5 +0,0 @@
1
- jQuery(document).ready(function ($) {
2
- $(document).delegate('.wc_manage_subscribtions', 'click', function () {
3
- $(this).next('.wc_notification_checkboxes').slideToggle(700);
4
- });
5
- });
 
 
 
 
 
files/js/wc-frontend.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){a(document).delegate(".wc_manage_subscribtions","click",function(){a(this).next(".wc_notification_checkboxes").slideToggle(700)})});
files/js/wc-scripts.js DELETED
@@ -1,62 +0,0 @@
1
- jQuery(document).ready(function ($) {
2
- var pickerImg1 = $('.wc_colorpicker_img1');
3
- var modalBox1 = $('div#wc_box1');
4
- var position1 = pickerImg1.position();
5
- /*modalBox1.css('margin-left', position1.left + 200);*/
6
-
7
- $('#wc_colorpickerHolder1').ColorPicker({
8
- flat: true,
9
- onChange: function (hsb, hex, rgb) {
10
- $('#wc_comment_bg_color').val('#' + hex);
11
- }
12
- });
13
-
14
- $('#wc_colorpickerHolder2').ColorPicker({
15
- flat: true,
16
- onChange: function (hsb, hex, rgb) {
17
- $('#wc_reply_bg_color').val('#' + hex);
18
- }
19
- });
20
-
21
- $('#wc_colorpickerHolder3').ColorPicker({
22
- flat: true,
23
- onChange: function (hsb, hex, rgb) {
24
- $('#wc_comment_text_color').val('#' + hex);
25
- }
26
- });
27
-
28
- $('#wc_colorpickerHolder4').ColorPicker({
29
- flat: true,
30
- onChange: function (hsb, hex, rgb) {
31
- $('#wc_author_title_color').val('#' + hex);
32
- }
33
- });
34
-
35
- $('#wc_colorpickerHolder5').ColorPicker({
36
- flat: true,
37
- onChange: function (hsb, hex, rgb) {
38
- $('#wc_vote_reply_color').val('#' + hex);
39
- }
40
- });
41
-
42
- $('#wc_colorpickerHolder6').ColorPicker({
43
- flat: true,
44
- onChange: function (hsb, hex, rgb) {
45
- $('#wc_form_bg_color').val('#' + hex);
46
- }
47
- });
48
-
49
- $('#wc_colorpickerHolder7').ColorPicker({
50
- flat: true,
51
- onChange: function (hsb, hex, rgb) {
52
- $('#wc_new_loaded_comment_bg_color').val('rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')');
53
- }
54
- });
55
-
56
- $('#wc_colorpickerHolder8').ColorPicker({
57
- flat: true,
58
- onChange: function (hsb, hex, rgb) {
59
- $('#wc_input_border_color').val('#' + hex);
60
- }
61
- });
62
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/js/wc-scripts.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(c){var d=c(".wc_colorpicker_img1");var b=c("div#wc_box1");var a=d.position();c("#wc_colorpickerHolder1").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_comment_bg_color").val("#"+g)}});c("#wc_colorpickerHolder2").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_reply_bg_color").val("#"+g)}});c("#wc_colorpickerHolder3").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_comment_text_color").val("#"+g)}});c("#wc_colorpickerHolder4").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_author_title_color").val("#"+g)}});c("#wc_colorpickerHolder5").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_vote_reply_color").val("#"+g)}});c("#wc_colorpickerHolder6").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_form_bg_color").val("#"+g)}});c("#wc_colorpickerHolder7").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_new_loaded_comment_bg_color").val("rgb("+f.r+","+f.g+","+f.b+")")}});c("#wc_colorpickerHolder8").ColorPicker({flat:true,onChange:function(e,g,f){c("#wc_input_border_color").val("#"+g)}})});
files/third-party/colorpicker/css/colorpicker.css DELETED
@@ -1,161 +0,0 @@
1
- .colorpicker {
2
- width: 356px;
3
- height: 176px;
4
- overflow: hidden;
5
- position: absolute;
6
- background: url(../img/colorpicker_background.png);
7
- font-family: Arial, Helvetica, sans-serif;
8
- display: none;
9
- }
10
- .colorpicker_color {
11
- width: 150px;
12
- height: 150px;
13
- left: 14px;
14
- top: 13px;
15
- position: absolute;
16
- background: #f00;
17
- overflow: hidden;
18
- cursor: crosshair;
19
- }
20
- .colorpicker_color div {
21
- position: absolute;
22
- top: 0;
23
- left: 0;
24
- width: 150px;
25
- height: 150px;
26
- background: url(../img/colorpicker_overlay.png);
27
- }
28
- .colorpicker_color div div {
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- width: 11px;
33
- height: 11px;
34
- overflow: hidden;
35
- background: url(../img/colorpicker_select.gif);
36
- margin: -5px 0 0 -5px;
37
- }
38
- .colorpicker_hue {
39
- position: absolute;
40
- top: 13px;
41
- left: 171px;
42
- width: 35px;
43
- height: 150px;
44
- cursor: n-resize;
45
- }
46
- .colorpicker_hue div {
47
- position: absolute;
48
- width: 35px;
49
- height: 9px;
50
- overflow: hidden;
51
- background: url(../img/colorpicker_indic.gif) left top;
52
- margin: -4px 0 0 0;
53
- left: 0px;
54
- }
55
- .colorpicker_new_color {
56
- position: absolute;
57
- width: 60px;
58
- height: 30px;
59
- left: 213px;
60
- top: 13px;
61
- background: #f00;
62
- }
63
- .colorpicker_current_color {
64
- position: absolute;
65
- width: 60px;
66
- height: 30px;
67
- left: 283px;
68
- top: 13px;
69
- background: #f00;
70
- }
71
- .colorpicker input {
72
- background-color: transparent;
73
- border: 1px solid transparent;
74
- position: absolute;
75
- font-size: 10px;
76
- font-family: Arial, Helvetica, sans-serif;
77
- color: #898989;
78
- top: 4px;
79
- right: 11px;
80
- text-align: right;
81
- margin: 0;
82
- padding: 0;
83
- height: 11px;
84
- }
85
- .colorpicker_hex {
86
- position: absolute;
87
- width: 72px;
88
- height: 22px;
89
- background: url(../img/colorpicker_hex.png) top;
90
- left: 212px;
91
- top: 142px;
92
- }
93
- .colorpicker_hex input {
94
- right: 6px;
95
- }
96
- .colorpicker_field {
97
- height: 22px;
98
- width: 62px;
99
- background-position: top;
100
- position: absolute;
101
- }
102
- .colorpicker_field span {
103
- position: absolute;
104
- width: 12px;
105
- height: 22px;
106
- overflow: hidden;
107
- top: 0;
108
- right: 0;
109
- cursor: n-resize;
110
- }
111
- .colorpicker_rgb_r {
112
- background-image: url(../img/colorpicker_rgb_r.png);
113
- top: 52px;
114
- left: 212px;
115
- }
116
- .colorpicker_rgb_g {
117
- background-image: url(../img/colorpicker_rgb_g.png);
118
- top: 82px;
119
- left: 212px;
120
- }
121
- .colorpicker_rgb_b {
122
- background-image: url(../img/colorpicker_rgb_b.png);
123
- top: 112px;
124
- left: 212px;
125
- }
126
- .colorpicker_hsb_h {
127
- background-image: url(../img/colorpicker_hsb_h.png);
128
- top: 52px;
129
- left: 282px;
130
- }
131
- .colorpicker_hsb_s {
132
- background-image: url(../img/colorpicker_hsb_s.png);
133
- top: 82px;
134
- left: 282px;
135
- }
136
- .colorpicker_hsb_b {
137
- background-image: url(../img/colorpicker_hsb_b.png);
138
- top: 112px;
139
- left: 282px;
140
- }
141
- .colorpicker_submit {
142
- position: absolute;
143
- width: 22px;
144
- height: 22px;
145
- background: url(../img/colorpicker_submit.png) top;
146
- left: 322px;
147
- top: 142px;
148
- overflow: hidden;
149
- }
150
- .colorpicker_focus {
151
- background-position: center;
152
- }
153
- .colorpicker_hex.colorpicker_focus {
154
- background-position: bottom;
155
- }
156
- .colorpicker_submit.colorpicker_focus {
157
- background-position: bottom;
158
- }
159
- .colorpicker_slider {
160
- background-position: bottom;
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/colorpicker/css/colorpicker.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .colorpicker{width:356px;height:176px;overflow:hidden;position:absolute;background:url(../img/colorpicker_background.png);font-family:Arial,Helvetica,sans-serif;display:none}.colorpicker_color{width:150px;height:150px;left:14px;top:13px;position:absolute;background:#f00;overflow:hidden;cursor:crosshair}.colorpicker_color div{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../img/colorpicker_overlay.png)}.colorpicker_color div div{position:absolute;top:0;left:0;width:11px;height:11px;overflow:hidden;background:url(../img/colorpicker_select.gif);margin:-5px 0 0 -5px}.colorpicker_hue{position:absolute;top:13px;left:171px;width:35px;height:150px;cursor:n-resize}.colorpicker_hue div{position:absolute;width:35px;height:9px;overflow:hidden;background:url(../img/colorpicker_indic.gif) left top;margin:-4px 0 0 0;left:0}.colorpicker_new_color{position:absolute;width:60px;height:30px;left:213px;top:13px;background:#f00}.colorpicker_current_color{position:absolute;width:60px;height:30px;left:283px;top:13px;background:#f00}.colorpicker input{background-color:transparent;border:1px solid transparent;position:absolute;font-size:10px;font-family:Arial,Helvetica,sans-serif;color:#898989;top:4px;right:11px;text-align:right;margin:0;padding:0;height:11px}.colorpicker_hex{position:absolute;width:72px;height:22px;background:url(../img/colorpicker_hex.png) top;left:212px;top:142px}.colorpicker_hex input{right:6px}.colorpicker_field{height:22px;width:62px;background-position:top;position:absolute}.colorpicker_field span{position:absolute;width:12px;height:22px;overflow:hidden;top:0;right:0;cursor:n-resize}.colorpicker_rgb_r{background-image:url(../img/colorpicker_rgb_r.png);top:52px;left:212px}.colorpicker_rgb_g{background-image:url(../img/colorpicker_rgb_g.png);top:82px;left:212px}.colorpicker_rgb_b{background-image:url(../img/colorpicker_rgb_b.png);top:112px;left:212px}.colorpicker_hsb_h{background-image:url(../img/colorpicker_hsb_h.png);top:52px;left:282px}.colorpicker_hsb_s{background-image:url(../img/colorpicker_hsb_s.png);top:82px;left:282px}.colorpicker_hsb_b{background-image:url(../img/colorpicker_hsb_b.png);top:112px;left:282px}.colorpicker_submit{position:absolute;width:22px;height:22px;background:url(../img/colorpicker_submit.png) top;left:322px;top:142px;overflow:hidden}.colorpicker_focus{background-position:center}.colorpicker_hex.colorpicker_focus{background-position:bottom}.colorpicker_submit.colorpicker_focus{background-position:bottom}.colorpicker_slider{background-position:bottom}
files/third-party/colorpicker/js/colorpicker.js DELETED
@@ -1,529 +0,0 @@
1
- /**
2
- *
3
- * Color picker
4
- * Author: Stefan Petre www.eyecon.ro
5
- *
6
- * Dual licensed under the MIT and GPL licenses
7
- *
8
- */
9
- (function ($) {
10
- var ColorPicker = function () {
11
- var
12
- ids = {},
13
- inAction,
14
- charMin = 65,
15
- visible,
16
- tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
17
- defaults = {
18
- eventName: 'click',
19
- onShow: function () {},
20
- onBeforeShow: function(){},
21
- onHide: function () {},
22
- onChange: function () {},
23
- onSubmit: function () {},
24
- color: 'ff0000',
25
- livePreview: true,
26
- flat: false
27
- },
28
- fillRGBFields = function (hsb, cal) {
29
- var rgb = HSBToRGB(hsb);
30
- $(cal).data('colorpicker').fields
31
- .eq(1).val(rgb.r).end()
32
- .eq(2).val(rgb.g).end()
33
- .eq(3).val(rgb.b).end();
34
- },
35
- fillHSBFields = function (hsb, cal) {
36
- $(cal).data('colorpicker').fields
37
- .eq(4).val(hsb.h).end()
38
- .eq(5).val(hsb.s).end()
39
- .eq(6).val(hsb.b).end();
40
- },
41
- fillHexFields = function (hsb, cal) {
42
- $(cal).data('colorpicker').fields
43
- .eq(0).val(HSBToHex(hsb)).end();
44
- },
45
- setSelector = function (hsb, cal) {
46
- $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({
47
- h: hsb.h,
48
- s: 100,
49
- b: 100
50
- }));
51
- $(cal).data('colorpicker').selectorIndic.css({
52
- left: parseInt(150 * hsb.s/100, 10),
53
- top: parseInt(150 * (100-hsb.b)/100, 10)
54
- });
55
- },
56
- setHue = function (hsb, cal) {
57
- $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
58
- },
59
- setCurrentColor = function (hsb, cal) {
60
- $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
61
- },
62
- setNewColor = function (hsb, cal) {
63
- $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
64
- },
65
- keyDown = function (ev) {
66
- var pressedKey = ev.charCode || ev.keyCode || -1;
67
- if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
68
- return false;
69
- }
70
- var cal = $(this).parent().parent();
71
- if (cal.data('colorpicker').livePreview === true) {
72
- change.apply(this);
73
- }
74
- },
75
- change = function (ev) {
76
- var cal = $(this).parent().parent(), col;
77
- if (this.parentNode.className.indexOf('_hex') > 0) {
78
- cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
79
- } else if (this.parentNode.className.indexOf('_hsb') > 0) {
80
- cal.data('colorpicker').color = col = fixHSB({
81
- h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
82
- s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
83
- b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
84
- });
85
- } else {
86
- cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
87
- r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
88
- g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
89
- b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
90
- }));
91
- }
92
- if (ev) {
93
- fillRGBFields(col, cal.get(0));
94
- fillHexFields(col, cal.get(0));
95
- fillHSBFields(col, cal.get(0));
96
- }
97
- setSelector(col, cal.get(0));
98
- setHue(col, cal.get(0));
99
- setNewColor(col, cal.get(0));
100
- cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
101
- },
102
- blur = function (ev) {
103
- var cal = $(this).parent().parent();
104
- cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105
- },
106
- focus = function () {
107
- charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
108
- $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
109
- $(this).parent().addClass('colorpicker_focus');
110
- },
111
- downIncrement = function (ev) {
112
- var field = $(this).parent().find('input').focus();
113
- var current = {
114
- el: $(this).parent().addClass('colorpicker_slider'),
115
- max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
116
- y: ev.pageY,
117
- field: field,
118
- val: parseInt(field.val(), 10),
119
- preview: $(this).parent().parent().data('colorpicker').livePreview
120
- };
121
- $(document).bind('mouseup', current, upIncrement);
122
- $(document).bind('mousemove', current, moveIncrement);
123
- },
124
- moveIncrement = function (ev) {
125
- ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
126
- if (ev.data.preview) {
127
- change.apply(ev.data.field.get(0), [true]);
128
- }
129
- return false;
130
- },
131
- upIncrement = function (ev) {
132
- change.apply(ev.data.field.get(0), [true]);
133
- ev.data.el.removeClass('colorpicker_slider').find('input').focus();
134
- $(document).unbind('mouseup', upIncrement);
135
- $(document).unbind('mousemove', moveIncrement);
136
- return false;
137
- },
138
- downHue = function (ev) {
139
- var current = {
140
- cal: $(this).parent(),
141
- y: $(this).offset().top
142
- };
143
- current.preview = current.cal.data('colorpicker').livePreview;
144
- $(document).bind('mouseup', current, upHue);
145
- $(document).bind('mousemove', current, moveHue);
146
- },
147
- moveHue = function (ev) {
148
- change.apply(
149
- ev.data.cal.data('colorpicker')
150
- .fields
151
- .eq(4)
152
- .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
153
- .get(0),
154
- [ev.data.preview]
155
- );
156
- return false;
157
- },
158
- upHue = function (ev) {
159
- fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
160
- fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
161
- $(document).unbind('mouseup', upHue);
162
- $(document).unbind('mousemove', moveHue);
163
- return false;
164
- },
165
- downSelector = function (ev) {
166
- var current = {
167
- cal: $(this).parent(),
168
- pos: $(this).offset()
169
- };
170
- current.preview = current.cal.data('colorpicker').livePreview;
171
- $(document).bind('mouseup', current, upSelector);
172
- $(document).bind('mousemove', current, moveSelector);
173
- },
174
- moveSelector = function (ev) {
175
- change.apply(
176
- ev.data.cal.data('colorpicker')
177
- .fields
178
- .eq(6)
179
- .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
180
- .end()
181
- .eq(5)
182
- .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
183
- .get(0),
184
- [ev.data.preview]
185
- );
186
- return false;
187
- },
188
- upSelector = function (ev) {
189
- fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
190
- fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
191
- $(document).unbind('mouseup', upSelector);
192
- $(document).unbind('mousemove', moveSelector);
193
- return false;
194
- },
195
- enterSubmit = function (ev) {
196
- $(this).addClass('colorpicker_focus');
197
- },
198
- leaveSubmit = function (ev) {
199
- $(this).removeClass('colorpicker_focus');
200
- },
201
- clickSubmit = function (ev) {
202
- var cal = $(this).parent();
203
- var col = cal.data('colorpicker').color;
204
- cal.data('colorpicker').origColor = col;
205
- setCurrentColor(col, cal.get(0));
206
- cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
207
- },
208
- show = function (ev) {
209
- var cal = $('#' + $(this).data('colorpickerId'));
210
- cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
211
- var pos = $(this).offset();
212
- var viewPort = getViewport();
213
- var top = pos.top + this.offsetHeight;
214
- var left = pos.left;
215
- if (top + 176 > viewPort.t + viewPort.h) {
216
- top -= this.offsetHeight + 176;
217
- }
218
- if (left + 356 > viewPort.l + viewPort.w) {
219
- left -= 356;
220
- }
221
- cal.css({
222
- left: left + 'px',
223
- top: top + 'px'
224
- });
225
- if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
226
- cal.show();
227
- }
228
- $(document).bind('mousedown', {
229
- cal: cal
230
- }, hide);
231
- return false;
232
- },
233
- hide = function (ev) {
234
- if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
235
- if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
236
- ev.data.cal.hide();
237
- }
238
- $(document).unbind('mousedown', hide);
239
- }
240
- },
241
- isChildOf = function(parentEl, el, container) {
242
- if (parentEl == el) {
243
- return true;
244
- }
245
- if (parentEl.contains) {
246
- return parentEl.contains(el);
247
- }
248
- if ( parentEl.compareDocumentPosition ) {
249
- return !!(parentEl.compareDocumentPosition(el) & 16);
250
- }
251
- var prEl = el.parentNode;
252
- while(prEl && prEl != container) {
253
- if (prEl == parentEl)
254
- return true;
255
- prEl = prEl.parentNode;
256
- }
257
- return false;
258
- },
259
- getViewport = function () {
260
- var m = document.compatMode == 'CSS1Compat';
261
- return {
262
- l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
263
- t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
264
- w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
265
- h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
266
- };
267
- },
268
- fixHSB = function (hsb) {
269
- return {
270
- h: Math.min(360, Math.max(0, hsb.h)),
271
- s: Math.min(100, Math.max(0, hsb.s)),
272
- b: Math.min(100, Math.max(0, hsb.b))
273
- };
274
- },
275
- fixRGB = function (rgb) {
276
- return {
277
- r: Math.min(255, Math.max(0, rgb.r)),
278
- g: Math.min(255, Math.max(0, rgb.g)),
279
- b: Math.min(255, Math.max(0, rgb.b))
280
- };
281
- },
282
- fixHex = function (hex) {
283
- var len = 6 - hex.length;
284
- if (len > 0) {
285
- var o = [];
286
- for (var i=0; i<len; i++) {
287
- o.push('0');
288
- }
289
- o.push(hex);
290
- hex = o.join('');
291
- }
292
- return hex;
293
- },
294
- HexToRGB = function (hex) {
295
- var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
296
- return {
297
- r: hex >> 16,
298
- g: (hex & 0x00FF00) >> 8,
299
- b: (hex & 0x0000FF)
300
- };
301
- },
302
- HexToHSB = function (hex) {
303
- return RGBToHSB(HexToRGB(hex));
304
- },
305
- RGBToHSB = function (rgb) {
306
- var hsb = {
307
- h: 0,
308
- s: 0,
309
- b: 0
310
- };
311
- var min = Math.min(rgb.r, rgb.g, rgb.b);
312
- var max = Math.max(rgb.r, rgb.g, rgb.b);
313
- var delta = max - min;
314
- hsb.b = max;
315
- if (max != 0) {
316
-
317
- }
318
- hsb.s = max != 0 ? 255 * delta / max : 0;
319
- if (hsb.s != 0) {
320
- if (rgb.r == max) {
321
- hsb.h = (rgb.g - rgb.b) / delta;
322
- } else if (rgb.g == max) {
323
- hsb.h = 2 + (rgb.b - rgb.r) / delta;
324
- } else {
325
- hsb.h = 4 + (rgb.r - rgb.g) / delta;
326
- }
327
- } else {
328
- hsb.h = -1;
329
- }
330
- hsb.h *= 60;
331
- if (hsb.h < 0) {
332
- hsb.h += 360;
333
- }
334
- hsb.s *= 100/255;
335
- hsb.b *= 100/255;
336
- return hsb;
337
- },
338
- HSBToRGB = function (hsb) {
339
- var rgb = {};
340
- var h = Math.round(hsb.h);
341
- var s = Math.round(hsb.s*255/100);
342
- var v = Math.round(hsb.b*255/100);
343
- if(s == 0) {
344
- rgb.r = rgb.g = rgb.b = v;
345
- } else {
346
- var t1 = v;
347
- var t2 = (255-s)*v/255;
348
- var t3 = (t1-t2)*(h%60)/60;
349
- if(h==360) h = 0;
350
- if(h<60) {
351
- rgb.r=t1;
352
- rgb.b=t2;
353
- rgb.g=t2+t3
354
- }
355
- else if(h<120) {
356
- rgb.g=t1;
357
- rgb.b=t2;
358
- rgb.r=t1-t3
359
- }
360
- else if(h<180) {
361
- rgb.g=t1;
362
- rgb.r=t2;
363
- rgb.b=t2+t3
364
- }
365
- else if(h<240) {
366
- rgb.b=t1;
367
- rgb.r=t2;
368
- rgb.g=t1-t3
369
- }
370
- else if(h<300) {
371
- rgb.b=t1;
372
- rgb.g=t2;
373
- rgb.r=t2+t3
374
- }
375
- else if(h<360) {
376
- rgb.r=t1;
377
- rgb.g=t2;
378
- rgb.b=t1-t3
379
- }
380
- else {
381
- rgb.r=0;
382
- rgb.g=0;
383
- rgb.b=0
384
- }
385
- }
386
- return {
387
- r:Math.round(rgb.r),
388
- g:Math.round(rgb.g),
389
- b:Math.round(rgb.b)
390
- };
391
- },
392
- RGBToHex = function (rgb) {
393
- var hex = [
394
- rgb.r.toString(16),
395
- rgb.g.toString(16),
396
- rgb.b.toString(16)
397
- ];
398
- $.each(hex, function (nr, val) {
399
- if (val.length == 1) {
400
- hex[nr] = '0' + val;
401
- }
402
- });
403
- return hex.join('');
404
- },
405
- HSBToHex = function (hsb) {
406
- return RGBToHex(HSBToRGB(hsb));
407
- },
408
- restoreOriginal = function () {
409
- var cal = $(this).parent();
410
- var col = cal.data('colorpicker').origColor;
411
- cal.data('colorpicker').color = col;
412
- fillRGBFields(col, cal.get(0));
413
- fillHexFields(col, cal.get(0));
414
- fillHSBFields(col, cal.get(0));
415
- setSelector(col, cal.get(0));
416
- setHue(col, cal.get(0));
417
- setNewColor(col, cal.get(0));
418
- };
419
- return {
420
- init: function (opt) {
421
- opt = $.extend({}, defaults, opt||{});
422
- if (typeof opt.color == 'string') {
423
- opt.color = HexToHSB(opt.color);
424
- } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
425
- opt.color = RGBToHSB(opt.color);
426
- } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
427
- opt.color = fixHSB(opt.color);
428
- } else {
429
- return this;
430
- }
431
- return this.each(function () {
432
- if (!$(this).data('colorpickerId')) {
433
- var options = $.extend({}, opt);
434
- options.origColor = opt.color;
435
- var id = 'collorpicker_' + parseInt(Math.random() * 1000);
436
- $(this).data('colorpickerId', id);
437
- var cal = $(tpl).attr('id', id);
438
- if (options.flat) {
439
- cal.appendTo(this).show();
440
- } else {
441
- cal.appendTo(document.body);
442
- }
443
- options.fields = cal
444
- .find('input')
445
- .bind('keyup', keyDown)
446
- .bind('change', change)
447
- .bind('blur', blur)
448
- .bind('focus', focus);
449
- cal
450
- .find('span').bind('mousedown', downIncrement).end()
451
- .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
452
- options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
453
- options.selectorIndic = options.selector.find('div div');
454
- options.el = this;
455
- options.hue = cal.find('div.colorpicker_hue div');
456
- cal.find('div.colorpicker_hue').bind('mousedown', downHue);
457
- options.newColor = cal.find('div.colorpicker_new_color');
458
- options.currentColor = cal.find('div.colorpicker_current_color');
459
- cal.data('colorpicker', options);
460
- cal.find('div.colorpicker_submit')
461
- .bind('mouseenter', enterSubmit)
462
- .bind('mouseleave', leaveSubmit)
463
- .bind('click', clickSubmit);
464
- fillRGBFields(options.color, cal.get(0));
465
- fillHSBFields(options.color, cal.get(0));
466
- fillHexFields(options.color, cal.get(0));
467
- setHue(options.color, cal.get(0));
468
- setSelector(options.color, cal.get(0));
469
- setCurrentColor(options.color, cal.get(0));
470
- setNewColor(options.color, cal.get(0));
471
- if (options.flat) {
472
- cal.css({
473
- position: 'relative',
474
- display: 'block'
475
- });
476
- } else {
477
- $(this).bind(options.eventName, show);
478
- }
479
- }
480
- });
481
- },
482
- showPicker: function() {
483
- return this.each( function () {
484
- if ($(this).data('colorpickerId')) {
485
- show.apply(this);
486
- }
487
- });
488
- },
489
- hidePicker: function() {
490
- return this.each( function () {
491
- if ($(this).data('colorpickerId')) {
492
- $('#' + $(this).data('colorpickerId')).hide();
493
- }
494
- });
495
- },
496
- setColor: function(col) {
497
- if (typeof col == 'string') {
498
- col = HexToHSB(col);
499
- } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
500
- col = RGBToHSB(col);
501
- } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
502
- col = fixHSB(col);
503
- } else {
504
- return this;
505
- }
506
- return this.each(function(){
507
- if ($(this).data('colorpickerId')) {
508
- var cal = $('#' + $(this).data('colorpickerId'));
509
- cal.data('colorpicker').color = col;
510
- cal.data('colorpicker').origColor = col;
511
- fillRGBFields(col, cal.get(0));
512
- fillHSBFields(col, cal.get(0));
513
- fillHexFields(col, cal.get(0));
514
- setHue(col, cal.get(0));
515
- setSelector(col, cal.get(0));
516
- setCurrentColor(col, cal.get(0));
517
- setNewColor(col, cal.get(0));
518
- }
519
- });
520
- }
521
- };
522
- }();
523
- $.fn.extend({
524
- ColorPicker: ColorPicker.init,
525
- ColorPickerHide: ColorPicker.hidePicker,
526
- ColorPickerShow: ColorPicker.showPicker,
527
- ColorPickerSetColor: ColorPicker.setColor
528
- });
529
- })(jQuery)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/colorpicker/js/colorpicker.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(b){var a=function(){var S={},c,N=65,t,P='<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',B={eventName:"click",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},color:"ff0000",livePreview:true,flat:false},J=function(T,V){var U=j(T);b(V).data("colorpicker").fields.eq(1).val(U.r).end().eq(2).val(U.g).end().eq(3).val(U.b).end()},u=function(T,U){b(U).data("colorpicker").fields.eq(4).val(T.h).end().eq(5).val(T.s).end().eq(6).val(T.b).end()},g=function(T,U){b(U).data("colorpicker").fields.eq(0).val(R(T)).end()},l=function(T,U){b(U).data("colorpicker").selector.css("backgroundColor","#"+R({h:T.h,s:100,b:100}));b(U).data("colorpicker").selectorIndic.css({left:parseInt(150*T.s/100,10),top:parseInt(150*(100-T.b)/100,10)})},G=function(T,U){b(U).data("colorpicker").hue.css("top",parseInt(150-150*T.h/360,10))},h=function(T,U){b(U).data("colorpicker").currentColor.css("backgroundColor","#"+R(T))},E=function(T,U){b(U).data("colorpicker").newColor.css("backgroundColor","#"+R(T))},n=function(T){var V=T.charCode||T.keyCode||-1;if((V>N&&V<=90)||V==32){return false}var U=b(this).parent().parent();if(U.data("colorpicker").livePreview===true){e.apply(this)}},e=function(U){var V=b(this).parent().parent(),T;if(this.parentNode.className.indexOf("_hex")>0){V.data("colorpicker").color=T=m(y(this.value))}else{if(this.parentNode.className.indexOf("_hsb")>0){V.data("colorpicker").color=T=f({h:parseInt(V.data("colorpicker").fields.eq(4).val(),10),s:parseInt(V.data("colorpicker").fields.eq(5).val(),10),b:parseInt(V.data("colorpicker").fields.eq(6).val(),10)})}else{V.data("colorpicker").color=T=i(M({r:parseInt(V.data("colorpicker").fields.eq(1).val(),10),g:parseInt(V.data("colorpicker").fields.eq(2).val(),10),b:parseInt(V.data("colorpicker").fields.eq(3).val(),10)}))}}if(U){J(T,V.get(0));g(T,V.get(0));u(T,V.get(0))}l(T,V.get(0));G(T,V.get(0));E(T,V.get(0));V.data("colorpicker").onChange.apply(V,[T,R(T),j(T)])},o=function(T){var U=b(this).parent().parent();U.data("colorpicker").fields.parent().removeClass("colorpicker_focus")},K=function(){N=this.parentNode.className.indexOf("_hex")>0?70:65;b(this).parent().parent().data("colorpicker").fields.parent().removeClass("colorpicker_focus");b(this).parent().addClass("colorpicker_focus")},I=function(T){var V=b(this).parent().find("input").focus();var U={el:b(this).parent().addClass("colorpicker_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:(this.parentNode.className.indexOf("_hsb")>0?100:255),y:T.pageY,field:V,val:parseInt(V.val(),10),preview:b(this).parent().parent().data("colorpicker").livePreview};b(document).bind("mouseup",U,s);b(document).bind("mousemove",U,L)},L=function(T){T.data.field.val(Math.max(0,Math.min(T.data.max,parseInt(T.data.val+T.pageY-T.data.y,10))));if(T.data.preview){e.apply(T.data.field.get(0),[true])}return false},s=function(T){e.apply(T.data.field.get(0),[true]);T.data.el.removeClass("colorpicker_slider").find("input").focus();b(document).unbind("mouseup",s);b(document).unbind("mousemove",L);return false},w=function(T){var U={cal:b(this).parent(),y:b(this).offset().top};U.preview=U.cal.data("colorpicker").livePreview;b(document).bind("mouseup",U,r);b(document).bind("mousemove",U,k)},k=function(T){e.apply(T.data.cal.data("colorpicker").fields.eq(4).val(parseInt(360*(150-Math.max(0,Math.min(150,(T.pageY-T.data.y))))/150,10)).get(0),[T.data.preview]);return false},r=function(T){J(T.data.cal.data("colorpicker").color,T.data.cal.get(0));g(T.data.cal.data("colorpicker").color,T.data.cal.get(0));b(document).unbind("mouseup",r);b(document).unbind("mousemove",k);return false},x=function(T){var U={cal:b(this).parent(),pos:b(this).offset()};U.preview=U.cal.data("colorpicker").livePreview;b(document).bind("mouseup",U,A);b(document).bind("mousemove",U,q)},q=function(T){e.apply(T.data.cal.data("colorpicker").fields.eq(6).val(parseInt(100*(150-Math.max(0,Math.min(150,(T.pageY-T.data.pos.top))))/150,10)).end().eq(5).val(parseInt(100*(Math.max(0,Math.min(150,(T.pageX-T.data.pos.left))))/150,10)).get(0),[T.data.preview]);return false},A=function(T){J(T.data.cal.data("colorpicker").color,T.data.cal.get(0));g(T.data.cal.data("colorpicker").color,T.data.cal.get(0));b(document).unbind("mouseup",A);b(document).unbind("mousemove",q);return false},v=function(T){b(this).addClass("colorpicker_focus")},Q=function(T){b(this).removeClass("colorpicker_focus")},p=function(U){var V=b(this).parent();var T=V.data("colorpicker").color;V.data("colorpicker").origColor=T;h(T,V.get(0));V.data("colorpicker").onSubmit(T,R(T),j(T),V.data("colorpicker").el)},D=function(T){var X=b("#"+b(this).data("colorpickerId"));X.data("colorpicker").onBeforeShow.apply(this,[X.get(0)]);var Y=b(this).offset();var W=z();var V=Y.top+this.offsetHeight;var U=Y.left;if(V+176>W.t+W.h){V-=this.offsetHeight+176}if(U+356>W.l+W.w){U-=356}X.css({left:U+"px",top:V+"px"});if(X.data("colorpicker").onShow.apply(this,[X.get(0)])!=false){X.show()}b(document).bind("mousedown",{cal:X},O);return false},O=function(T){if(!H(T.data.cal.get(0),T.target,T.data.cal.get(0))){if(T.data.cal.data("colorpicker").onHide.apply(this,[T.data.cal.get(0)])!=false){T.data.cal.hide()}b(document).unbind("mousedown",O)}},H=function(V,U,T){if(V==U){return true}if(V.contains){return V.contains(U)}if(V.compareDocumentPosition){return !!(V.compareDocumentPosition(U)&16)}var W=U.parentNode;while(W&&W!=T){if(W==V){return true}W=W.parentNode}return false},z=function(){var T=document.compatMode=="CSS1Compat";return{l:window.pageXOffset||(T?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(T?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(T?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(T?document.documentElement.clientHeight:document.body.clientHeight)}},f=function(T){return{h:Math.min(360,Math.max(0,T.h)),s:Math.min(100,Math.max(0,T.s)),b:Math.min(100,Math.max(0,T.b))}},M=function(T){return{r:Math.min(255,Math.max(0,T.r)),g:Math.min(255,Math.max(0,T.g)),b:Math.min(255,Math.max(0,T.b))}},y=function(V){var T=6-V.length;if(T>0){var W=[];for(var U=0;U<T;U++){W.push("0")}W.push(V);V=W.join("")}return V},d=function(T){var T=parseInt(((T.indexOf("#")>-1)?T.substring(1):T),16);return{r:T>>16,g:(T&65280)>>8,b:(T&255)}},m=function(T){return i(d(T))},i=function(V){var U={h:0,s:0,b:0};var W=Math.min(V.r,V.g,V.b);var T=Math.max(V.r,V.g,V.b);var X=T-W;U.b=T;if(T!=0){}U.s=T!=0?255*X/T:0;if(U.s!=0){if(V.r==T){U.h=(V.g-V.b)/X}else{if(V.g==T){U.h=2+(V.b-V.r)/X}else{U.h=4+(V.r-V.g)/X}}}else{U.h=-1}U.h*=60;if(U.h<0){U.h+=360}U.s*=100/255;U.b*=100/255;return U},j=function(T){var V={};var Z=Math.round(T.h);var Y=Math.round(T.s*255/100);var U=Math.round(T.b*255/100);if(Y==0){V.r=V.g=V.b=U}else{var aa=U;var X=(255-Y)*U/255;var W=(aa-X)*(Z%60)/60;if(Z==360){Z=0}if(Z<60){V.r=aa;V.b=X;V.g=X+W}else{if(Z<120){V.g=aa;V.b=X;V.r=aa-W}else{if(Z<180){V.g=aa;V.r=X;V.b=X+W}else{if(Z<240){V.b=aa;V.r=X;V.g=aa-W}else{if(Z<300){V.b=aa;V.g=X;V.r=X+W}else{if(Z<360){V.r=aa;V.g=X;V.b=aa-W}else{V.r=0;V.g=0;V.b=0}}}}}}}return{r:Math.round(V.r),g:Math.round(V.g),b:Math.round(V.b)}},C=function(T){var U=[T.r.toString(16),T.g.toString(16),T.b.toString(16)];b.each(U,function(V,W){if(W.length==1){U[V]="0"+W}});return U.join("")},R=function(T){return C(j(T))},F=function(){var U=b(this).parent();var T=U.data("colorpicker").origColor;U.data("colorpicker").color=T;J(T,U.get(0));g(T,U.get(0));u(T,U.get(0));l(T,U.get(0));G(T,U.get(0));E(T,U.get(0))};return{init:function(T){T=b.extend({},B,T||{});if(typeof T.color=="string"){T.color=m(T.color)}else{if(T.color.r!=undefined&&T.color.g!=undefined&&T.color.b!=undefined){T.color=i(T.color)}else{if(T.color.h!=undefined&&T.color.s!=undefined&&T.color.b!=undefined){T.color=f(T.color)}else{return this}}}return this.each(function(){if(!b(this).data("colorpickerId")){var U=b.extend({},T);U.origColor=T.color;var W="collorpicker_"+parseInt(Math.random()*1000);b(this).data("colorpickerId",W);var V=b(P).attr("id",W);if(U.flat){V.appendTo(this).show()}else{V.appendTo(document.body)}U.fields=V.find("input").bind("keyup",n).bind("change",e).bind("blur",o).bind("focus",K);V.find("span").bind("mousedown",I).end().find(">div.colorpicker_current_color").bind("click",F);U.selector=V.find("div.colorpicker_color").bind("mousedown",x);U.selectorIndic=U.selector.find("div div");U.el=this;U.hue=V.find("div.colorpicker_hue div");V.find("div.colorpicker_hue").bind("mousedown",w);U.newColor=V.find("div.colorpicker_new_color");U.currentColor=V.find("div.colorpicker_current_color");V.data("colorpicker",U);V.find("div.colorpicker_submit").bind("mouseenter",v).bind("mouseleave",Q).bind("click",p);J(U.color,V.get(0));u(U.color,V.get(0));g(U.color,V.get(0));G(U.color,V.get(0));l(U.color,V.get(0));h(U.color,V.get(0));E(U.color,V.get(0));if(U.flat){V.css({position:"relative",display:"block"})}else{b(this).bind(U.eventName,D)}}})},showPicker:function(){return this.each(function(){if(b(this).data("colorpickerId")){D.apply(this)}})},hidePicker:function(){return this.each(function(){if(b(this).data("colorpickerId")){b("#"+b(this).data("colorpickerId")).hide()}})},setColor:function(T){if(typeof T=="string"){T=m(T)}else{if(T.r!=undefined&&T.g!=undefined&&T.b!=undefined){T=i(T)}else{if(T.h!=undefined&&T.s!=undefined&&T.b!=undefined){T=f(T)}else{return this}}}return this.each(function(){if(b(this).data("colorpickerId")){var U=b("#"+b(this).data("colorpickerId"));U.data("colorpicker").color=T;U.data("colorpicker").origColor=T;J(T,U.get(0));u(T,U.get(0));g(T,U.get(0));G(T,U.get(0));l(T,U.get(0));h(T,U.get(0));E(T,U.get(0))}})}}}();b.fn.extend({ColorPicker:a.init,ColorPickerHide:a.hidePicker,ColorPickerShow:a.showPicker,ColorPickerSetColor:a.setColor})})(jQuery);
files/third-party/easy-responsive-tabs/css/easy-responsive-tabs.css DELETED
@@ -1,70 +0,0 @@
1
- .resp-tabs-list li {
2
- font-weight: 600;
3
- font-size: 13px;
4
- display: inline-block;
5
- padding: 13px 15px;
6
- margin: 0 4px 0 0;
7
- list-style: none;
8
- cursor: pointer;
9
- float: left;
10
- line-height: 1;
11
- }
12
-
13
- .resp-tabs-container {
14
- padding: 0px;
15
- background-color: #fff;
16
- clear: left;
17
- }
18
-
19
- h2.resp-accordion {
20
- cursor: pointer;
21
- padding: 5px;
22
- display: none;
23
- }
24
-
25
- .resp-tab-content {
26
- display: none;
27
- padding: 15px;
28
- }
29
-
30
- .resp-tab-active {
31
- border: 1px solid #5AB1D0 !important;
32
- border-bottom: none;
33
- margin-bottom: -1px !important;
34
- padding: 12px 14px 14px 14px !important;
35
- border-top: 4px solid #5AB1D0 !important;
36
- border-bottom: 0px #fff solid !important;
37
- }
38
-
39
- .resp-tab-active {
40
- border-bottom: none;
41
- background-color: #fff;
42
- }
43
-
44
- .resp-content-active, .resp-accordion-active {
45
- display: block;
46
- }
47
-
48
- .resp-tab-content {
49
- border: 1px solid #c1c1c1;
50
- border-top-color: #5AB1D0;
51
- }
52
-
53
- h2.resp-accordion {
54
- font-size: 13px;
55
- border: 1px solid #c1c1c1;
56
- border-top: 0px solid #c1c1c1;
57
- margin: 0px;
58
- padding: 10px 15px;
59
- }
60
-
61
- h2.resp-tab-active {
62
- border-bottom: 0px solid #c1c1c1 !important;
63
- margin-bottom: 0px !important;
64
- padding: 10px 15px !important;
65
- }
66
-
67
- h2.resp-tab-title:last-child {
68
- border-bottom: 12px solid #c1c1c1 !important;
69
- background: blue;
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/easy-responsive-tabs/css/easy-responsive-tabs.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .resp-tabs-list li{font-weight:600;font-size:13px;display:inline-block;padding:13px 15px;margin:0 4px 0 0;list-style:none;cursor:pointer;float:left;line-height:1}.resp-tabs-container{padding:0;background-color:#fff;clear:left}h2.resp-accordion{cursor:pointer;padding:5px;display:none}.resp-tab-content{display:none;padding:15px}.resp-tab-active{border:1px solid #5ab1d0!important;border-bottom:0;margin-bottom:-1px!important;padding:12px 14px 14px 14px!important;border-top:4px solid #5ab1d0!important;border-bottom:0 #fff solid!important}.resp-tab-active{border-bottom:0;background-color:#fff}.resp-content-active,.resp-accordion-active{display:block}.resp-tab-content{border:1px solid #c1c1c1;border-top-color:#5ab1d0}h2.resp-accordion{font-size:13px;border:1px solid #c1c1c1;border-top:0 solid #c1c1c1;margin:0;padding:10px 15px}h2.resp-tab-active{border-bottom:0 solid #c1c1c1!important;margin-bottom:0!important;padding:10px 15px!important}h2.resp-tab-title:last-child{border-bottom:12px solid #c1c1c1!important;background:blue}
files/third-party/easy-responsive-tabs/js/easy-responsive-tabs.js DELETED
@@ -1,224 +0,0 @@
1
- // Easy Responsive Tabs Plugin
2
- // Author: Samson.Onna <Email : samson3d@gmail.com>
3
- (function ($) {
4
- $.fn.extend({
5
- easyResponsiveTabs: function (options) {
6
- //Set the default values, use comma to separate the settings, example:
7
- var defaults = {
8
- type: 'default', //default, vertical, accordion;
9
- width: 'auto',
10
- fit: true,
11
- closed: false,
12
- tabidentify: '',
13
- activetab_bg: 'white',
14
- inactive_bg: '#F9F9F9',
15
- active_border_color: '#c1c1c1',
16
- active_content_border_color: '#c1c1c1',
17
- activate: function () {
18
- }
19
- }
20
- //Variables
21
- var options = $.extend(defaults, options);
22
- var opt = options, jtype = opt.type, jfit = opt.fit, jwidth = opt.width, vtabs = 'vertical', accord = 'accordion';
23
- var hash = window.location.hash;
24
- var historyApi = !!(window.history && history.replaceState);
25
-
26
- //Events
27
- $(this).bind('tabactivate', function (e, currentTab) {
28
- if (typeof options.activate === 'function') {
29
- options.activate.call(currentTab, e)
30
- }
31
- });
32
-
33
- //Main function
34
- this.each(function () {
35
- var $respTabs = $(this);
36
- var $respTabsList = $respTabs.find('ul.resp-tabs-list.' + options.tabidentify);
37
- var respTabsId = $respTabs.attr('id');
38
- $respTabs.find('ul.resp-tabs-list.' + options.tabidentify + ' li').addClass('resp-tab-item').addClass(options.tabidentify);
39
- $respTabs.css({
40
- 'display': 'block',
41
- 'width': jwidth
42
- });
43
-
44
- if (options.type == 'vertical')
45
- $respTabsList.css('margin-top', '3px');
46
-
47
- $respTabs.find('.resp-tabs-container.' + options.tabidentify).css('border-color', options.active_content_border_color);
48
- $respTabs.find('.resp-tabs-container.' + options.tabidentify + ' > div').addClass('resp-tab-content').addClass(options.tabidentify);
49
- jtab_options();
50
- //Properties Function
51
- function jtab_options() {
52
- if (jtype == vtabs) {
53
- $respTabs.addClass('resp-vtabs').addClass(options.tabidentify);
54
- }
55
- if (jfit == true) {
56
- $respTabs.css({ width: '100%', margin: '0px' });
57
- }
58
- if (jtype == accord) {
59
- $respTabs.addClass('resp-easy-accordion').addClass(options.tabidentify);
60
- $respTabs.find('.resp-tabs-list').css('display', 'none');
61
- }
62
- }
63
-
64
- //Assigning the h2 markup to accordion title
65
- var $tabItemh2;
66
- $respTabs.find('.resp-tab-content.' + options.tabidentify).before("<h2 class='resp-accordion " + options.tabidentify + "' role='tab'><span class='resp-arrow'></span></h2>");
67
-
68
- $respTabs.find('.resp-tab-content.' + options.tabidentify).prev("h2").css({
69
- 'background-color': options.inactive_bg,
70
- 'border-color': options.active_border_color
71
- });
72
-
73
- var itemCount = 0;
74
- $respTabs.find('.resp-accordion').each(function () {
75
- $tabItemh2 = $(this);
76
- var $tabItem = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')');
77
- var $accItem = $respTabs.find('.resp-accordion:eq(' + itemCount + ')');
78
- $accItem.append($tabItem.html());
79
- $accItem.data($tabItem.data());
80
- $tabItemh2.attr('aria-controls', options.tabidentify + '_tab_item-' + (itemCount));
81
- itemCount++;
82
- });
83
-
84
- //Assigning the 'aria-controls' to Tab items
85
- var count = 0,
86
- $tabContent;
87
- $respTabs.find('.resp-tab-item').each(function () {
88
- $tabItem = $(this);
89
- $tabItem.attr('aria-controls', options.tabidentify + '_tab_item-' + (count));
90
- $tabItem.attr('role', 'tab');
91
- $tabItem.css({
92
- 'background-color': options.inactive_bg,
93
- 'border-color': 'none'
94
- });
95
-
96
- //Assigning the 'aria-labelledby' attr to tab-content
97
- var tabcount = 0;
98
- $respTabs.find('.resp-tab-content.' + options.tabidentify).each(function () {
99
- $tabContent = $(this);
100
- $tabContent.attr('aria-labelledby', options.tabidentify + '_tab_item-' + (tabcount)).css({
101
- 'border-color': options.active_border_color
102
- });
103
- tabcount++;
104
- });
105
- count++;
106
- });
107
-
108
- // Show correct content area
109
- var tabNum = 0;
110
- if (hash != '') {
111
- var matches = hash.match(new RegExp(respTabsId + "([0-9]+)"));
112
- if (matches !== null && matches.length === 2) {
113
- tabNum = parseInt(matches[1], 10) - 1;
114
- if (tabNum > count) {
115
- tabNum = 0;
116
- }
117
- }
118
- }
119
-
120
- //Active correct tab
121
- $($respTabs.find('.resp-tab-item.' + options.tabidentify)[tabNum]).addClass('resp-tab-active').css({
122
- 'background-color': options.activetab_bg,
123
- 'border-color': options.active_border_color
124
- });
125
-
126
- //keep closed if option = 'closed' or option is 'accordion' and the element is in accordion mode
127
- if (options.closed !== true && !(options.closed === 'accordion' && !$respTabsList.is(':visible')) && !(options.closed === 'tabs' && $respTabsList.is(':visible'))) {
128
- $($respTabs.find('.resp-accordion.' + options.tabidentify)[tabNum]).addClass('resp-tab-active').css({
129
- 'background-color': options.activetab_bg + ' !important',
130
- 'border-color': options.active_border_color,
131
- 'background': 'none'
132
- });
133
-
134
- $($respTabs.find('.resp-tab-content.' + options.tabidentify)[tabNum]).addClass('resp-tab-content-active').addClass(options.tabidentify).attr('style', 'display:block');
135
- }
136
- //assign proper classes for when tabs mode is activated before making a selection in accordion mode
137
- else {
138
- // $($respTabs.find('.resp-tab-content.' + options.tabidentify)[tabNum]).addClass('resp-accordion-closed'); //removed resp-tab-content-active
139
- }
140
-
141
- //Tab Click action function
142
- $respTabs.find("[role=tab]").each(function () {
143
-
144
- var $currentTab = $(this);
145
- $currentTab.click(function () {
146
-
147
- var $currentTab = $(this);
148
- var $tabAria = $currentTab.attr('aria-controls');
149
-
150
- if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-active')) {
151
- $respTabs.find('.resp-tab-content-active.' + options.tabidentify).slideUp('', function () {
152
- $(this).addClass('resp-accordion-closed');
153
- });
154
- $currentTab.removeClass('resp-tab-active').css({
155
- 'background-color': options.inactive_bg,
156
- 'border-color': 'none'
157
- });
158
- return false;
159
- }
160
- if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-accordion')) {
161
- $respTabs.find('.resp-tab-active.' + options.tabidentify).removeClass('resp-tab-active').css({
162
- 'background-color': options.inactive_bg,
163
- 'border-color': 'none'
164
- });
165
- $respTabs.find('.resp-tab-content-active.' + options.tabidentify).slideUp().removeClass('resp-tab-content-active resp-accordion-closed');
166
- $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active').css({
167
- 'background-color': options.activetab_bg,
168
- 'border-color': options.active_border_color
169
- });
170
-
171
- $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + '].' + options.tabidentify).slideDown().addClass('resp-tab-content-active');
172
- } else {
173
- console.log('here');
174
- $respTabs.find('.resp-tab-active.' + options.tabidentify).removeClass('resp-tab-active').css({
175
- 'background-color': options.inactive_bg,
176
- 'border-color': 'none'
177
- });
178
-
179
- $respTabs.find('.resp-tab-content-active.' + options.tabidentify).removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-accordion-closed');
180
-
181
- $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active').css({
182
- 'background-color': options.activetab_bg,
183
- 'border-color': options.active_border_color
184
- });
185
-
186
- $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + '].' + options.tabidentify).addClass('resp-tab-content-active').attr('style', 'display:block');
187
- }
188
- //Trigger tab activation event
189
- $currentTab.trigger('tabactivate', $currentTab);
190
-
191
- //Update Browser History
192
- if (historyApi) {
193
- var currentHash = window.location.hash;
194
- var tabAriaParts = $tabAria.split('tab_item-');
195
- // var newHash = respTabsId + (parseInt($tabAria.substring(9), 10) + 1).toString();
196
- var newHash = respTabsId + (parseInt(tabAriaParts[1], 10) + 1).toString();
197
- if (currentHash != "") {
198
- var re = new RegExp(respTabsId + "[0-9]+");
199
- if (currentHash.match(re) != null) {
200
- newHash = currentHash.replace(re, newHash);
201
- }
202
- else {
203
- newHash = currentHash + "|" + newHash;
204
- }
205
- }
206
- else {
207
- newHash = '#' + newHash;
208
- }
209
-
210
- history.replaceState(null, null, newHash);
211
- }
212
- });
213
-
214
- });
215
-
216
- //Window resize function
217
- $(window).resize(function () {
218
- $respTabs.find('.resp-accordion-closed').removeAttr('style');
219
- });
220
- });
221
- }
222
- });
223
- })(jQuery);
224
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/easy-responsive-tabs/js/easy-responsive-tabs.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){a.fn.extend({easyResponsiveTabs:function(k){var c={type:"default",width:"auto",fit:true,closed:false,tabidentify:"",activetab_bg:"white",inactive_bg:"#F9F9F9",active_border_color:"#c1c1c1",active_content_border_color:"#c1c1c1",activate:function(){}};var k=a.extend(c,k);var b=k,g=b.type,j=b.fit,i=b.width,e="vertical",f="accordion";var d=window.location.hash;var h=!!(window.history&&history.replaceState);a(this).bind("tabactivate",function(l,m){if(typeof k.activate==="function"){k.activate.call(m,l)}});this.each(function(){var p=a(this);var t=p.find("ul.resp-tabs-list."+k.tabidentify);var s=p.attr("id");p.find("ul.resp-tabs-list."+k.tabidentify+" li").addClass("resp-tab-item").addClass(k.tabidentify);p.css({display:"block",width:i});p.find(".resp-tabs-container."+k.tabidentify).css("border-color",k.active_content_border_color);p.find(".resp-tabs-container."+k.tabidentify+" > div").addClass("resp-tab-content").addClass(k.tabidentify);r();function r(){if(g==e){p.addClass("resp-vtabs").addClass(k.tabidentify)}if(j==true){p.css({width:"100%",margin:"0px"})}if(g==f){p.addClass("resp-easy-accordion").addClass(k.tabidentify);p.find(".resp-tabs-list").css("display","none")}}var m;p.find(".resp-tab-content."+k.tabidentify).before("<h2 class='resp-accordion "+k.tabidentify+"' role='tab'><span class='resp-arrow'></span></h2>");p.find(".resp-tab-content."+k.tabidentify).prev("h2").css({"background-color":k.inactive_bg,"border-color":k.active_border_color});var l=0;p.find(".resp-accordion").each(function(){m=a(this);var w=p.find(".resp-tab-item:eq("+l+")");var v=p.find(".resp-accordion:eq("+l+")");v.append(w.html());v.data(w.data());m.attr("aria-controls",k.tabidentify+"_tab_item-"+(l));l++});var q=0,u;p.find(".resp-tab-item").each(function(){$tabItem=a(this);$tabItem.attr("aria-controls",k.tabidentify+"_tab_item-"+(q));$tabItem.attr("role","tab");$tabItem.css({"background-color":k.inactive_bg,"border-color":"none"});var v=0;p.find(".resp-tab-content."+k.tabidentify).each(function(){u=a(this);u.attr("aria-labelledby",k.tabidentify+"_tab_item-"+(v)).css({"border-color":k.active_border_color});v++});q++});var n=0;if(d!=""){var o=d.match(new RegExp(s+"([0-9]+)"));if(o!==null&&o.length===2){n=parseInt(o[1],10)-1;if(n>q){n=0}}}a(p.find(".resp-tab-item."+k.tabidentify)[n]).addClass("resp-tab-active").css({"background-color":k.activetab_bg,"border-color":k.active_border_color});if(k.closed!==true&&!(k.closed==="accordion"&&!t.is(":visible"))&&!(k.closed==="tabs"&&t.is(":visible"))){a(p.find(".resp-accordion."+k.tabidentify)[n]).addClass("resp-tab-active").css({"background-color":k.activetab_bg+" !important","border-color":k.active_border_color,background:"none"});a(p.find(".resp-tab-content."+k.tabidentify)[n]).addClass("resp-tab-content-active").addClass(k.tabidentify).attr("style","display:block")}else{}p.find("[role=tab]").each(function(){var v=a(this);v.click(function(){var B=a(this);var w=B.attr("aria-controls");if(B.hasClass("resp-accordion")&&B.hasClass("resp-tab-active")){p.find(".resp-tab-content-active."+k.tabidentify).slideUp("",function(){a(this).addClass("resp-accordion-closed")});B.removeClass("resp-tab-active").css({"background-color":k.inactive_bg,"border-color":"none"});return false}if(!B.hasClass("resp-tab-active")&&B.hasClass("resp-accordion")){p.find(".resp-tab-active."+k.tabidentify).removeClass("resp-tab-active").css({"background-color":k.inactive_bg,"border-color":"none"});p.find(".resp-tab-content-active."+k.tabidentify).slideUp().removeClass("resp-tab-content-active resp-accordion-closed");p.find("[aria-controls="+w+"]").addClass("resp-tab-active").css({"background-color":k.activetab_bg,"border-color":k.active_border_color});p.find(".resp-tab-content[aria-labelledby = "+w+"]."+k.tabidentify).slideDown().addClass("resp-tab-content-active")}else{console.log("here");p.find(".resp-tab-active."+k.tabidentify).removeClass("resp-tab-active").css({"background-color":k.inactive_bg,"border-color":"none"});p.find(".resp-tab-content-active."+k.tabidentify).removeAttr("style").removeClass("resp-tab-content-active").removeClass("resp-accordion-closed");p.find("[aria-controls="+w+"]").addClass("resp-tab-active").css({"background-color":k.activetab_bg,"border-color":k.active_border_color});p.find(".resp-tab-content[aria-labelledby = "+w+"]."+k.tabidentify).addClass("resp-tab-content-active").attr("style","display:block")}B.trigger("tabactivate",B);if(h){var z=window.location.hash;var A=w.split("tab_item-");var y=s+(parseInt(A[1],10)+1).toString();if(z!=""){var x=new RegExp(s+"[0-9]+");if(z.match(x)!=null){y=z.replace(x,y)}else{y=z+"|"+y}}else{y="#"+y}history.replaceState(null,null,y)}})});a(window).resize(function(){p.find(".resp-accordion-closed").removeAttr("style")})})}})})(jQuery);
files/third-party/jquery-ui/jquery-ui.js DELETED
@@ -1,16582 +0,0 @@
1
- /*! jQuery UI - v1.11.2 - 2014-10-16
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 2014 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.2
19
- * http://jqueryui.com
20
- *
21
- * Copyright 2014 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.2",
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.2
313
- * http://jqueryui.com
314
- *
315
- * Copyright 2014 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
- // allow multiple hashes to be passed on init
494
- options = !isMethodCall && args.length ?
495
- $.widget.extend.apply( null, [ options ].concat(args) ) :
496
- options;
497
-
498
- if ( isMethodCall ) {
499
- this.each(function() {
500
- var methodValue,
501
- instance = $.data( this, fullName );
502
- if ( options === "instance" ) {
503
- returnValue = instance;
504
- return false;
505
- }
506
- if ( !instance ) {
507
- return $.error( "cannot call methods on " + name + " prior to initialization; " +
508
- "attempted to call method '" + options + "'" );
509
- }
510
- if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
511
- return $.error( "no such method '" + options + "' for " + name + " widget instance" );
512
- }
513
- methodValue = instance[ options ].apply( instance, args );
514
- if ( methodValue !== instance && methodValue !== undefined ) {
515
- returnValue = methodValue && methodValue.jquery ?
516
- returnValue.pushStack( methodValue.get() ) :
517
- methodValue;
518
- return false;
519
- }
520
- });
521
- } else {
522
- this.each(function() {
523
- var instance = $.data( this, fullName );
524
- if ( instance ) {
525
- instance.option( options || {} );
526
- if ( instance._init ) {
527
- instance._init();
528
- }
529
- } else {
530
- $.data( this, fullName, new object( options, this ) );
531
- }
532
- });
533
- }
534
-
535
- return returnValue;
536
- };
537
- };
538
-
539
- $.Widget = function( /* options, element */ ) {};
540
- $.Widget._childConstructors = [];
541
-
542
- $.Widget.prototype = {
543
- widgetName: "widget",
544
- widgetEventPrefix: "",
545
- defaultElement: "<div>",
546
- options: {
547
- disabled: false,
548
-
549
- // callbacks
550
- create: null
551
- },
552
- _createWidget: function( options, element ) {
553
- element = $( element || this.defaultElement || this )[ 0 ];
554
- this.element = $( element );
555
- this.uuid = widget_uuid++;
556
- this.eventNamespace = "." + this.widgetName + this.uuid;
557
-
558
- this.bindings = $();
559
- this.hoverable = $();
560
- this.focusable = $();
561
-
562
- if ( element !== this ) {
563
- $.data( element, this.widgetFullName, this );
564
- this._on( true, this.element, {
565
- remove: function( event ) {
566
- if ( event.target === element ) {
567
- this.destroy();
568
- }
569
- }
570
- });
571
- this.document = $( element.style ?
572
- // element within the document
573
- element.ownerDocument :
574
- // element is window or document
575
- element.document || element );
576
- this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
577
- }
578
-
579
- this.options = $.widget.extend( {},
580
- this.options,
581
- this._getCreateOptions(),
582
- options );
583
-
584
- this._create();
585
- this._trigger( "create", null, this._getCreateEventData() );
586
- this._init();
587
- },
588
- _getCreateOptions: $.noop,
589
- _getCreateEventData: $.noop,
590
- _create: $.noop,
591
- _init: $.noop,
592
-
593
- destroy: function() {
594
- this._destroy();
595
- // we can probably remove the unbind calls in 2.0
596
- // all event bindings should go through this._on()
597
- this.element
598
- .unbind( this.eventNamespace )
599
- .removeData( this.widgetFullName )
600
- // support: jquery <1.6.3
601
- // http://bugs.jquery.com/ticket/9413
602
- .removeData( $.camelCase( this.widgetFullName ) );
603
- this.widget()
604
- .unbind( this.eventNamespace )
605
- .removeAttr( "aria-disabled" )
606
- .removeClass(
607
- this.widgetFullName + "-disabled " +
608
- "ui-state-disabled" );
609
-
610
- // clean up events and states
611
- this.bindings.unbind( this.eventNamespace );
612
- this.hoverable.removeClass( "ui-state-hover" );
613
- this.focusable.removeClass( "ui-state-focus" );
614
- },
615
- _destroy: $.noop,
616
-
617
- widget: function() {
618
- return this.element;
619
- },
620
-
621
- option: function( key, value ) {
622
- var options = key,
623
- parts,
624
- curOption,
625
- i;
626
-
627
- if ( arguments.length === 0 ) {
628
- // don't return a reference to the internal hash
629
- return $.widget.extend( {}, this.options );
630
- }
631
-
632
- if ( typeof key === "string" ) {
633
- // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
634
- options = {};
635
- parts = key.split( "." );
636
- key = parts.shift();
637
- if ( parts.length ) {
638
- curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
639
- for ( i = 0; i < parts.length - 1; i++ ) {
640
- curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
641
- curOption = curOption[ parts[ i ] ];
642
- }
643
- key = parts.pop();
644
- if ( arguments.length === 1 ) {
645
- return curOption[ key ] === undefined ? null : curOption[ key ];
646
- }
647
- curOption[ key ] = value;
648
- } else {
649
- if ( arguments.length === 1 ) {
650
- return this.options[ key ] === undefined ? null : this.options[ key ];
651
- }
652
- options[ key ] = value;
653
- }
654
- }
655
-
656
- this._setOptions( options );
657
-
658
- return this;
659
- },
660
- _setOptions: function( options ) {
661
- var key;
662
-
663
- for ( key in options ) {
664
- this._setOption( key, options[ key ] );
665
- }
666
-
667
- return this;
668
- },
669
- _setOption: function( key, value ) {
670
- this.options[ key ] = value;
671
-
672
- if ( key === "disabled" ) {
673
- this.widget()
674
- .toggleClass( this.widgetFullName + "-disabled", !!value );
675
-
676
- // If the widget is becoming disabled, then nothing is interactive
677
- if ( value ) {
678
- this.hoverable.removeClass( "ui-state-hover" );
679
- this.focusable.removeClass( "ui-state-focus" );
680
- }
681
- }
682
-
683
- return this;
684
- },
685
-
686
- enable: function() {
687
- return this._setOptions({ disabled: false });
688
- },
689
- disable: function() {
690
- return this._setOptions({ disabled: true });
691
- },
692
-
693
- _on: function( suppressDisabledCheck, element, handlers ) {
694
- var delegateElement,
695
- instance = this;
696
-
697
- // no suppressDisabledCheck flag, shuffle arguments
698
- if ( typeof suppressDisabledCheck !== "boolean" ) {
699
- handlers = element;
700
- element = suppressDisabledCheck;
701
- suppressDisabledCheck = false;
702
- }
703
-
704
- // no element argument, shuffle and use this.element
705
- if ( !handlers ) {
706
- handlers = element;
707
- element = this.element;
708
- delegateElement = this.widget();
709
- } else {
710
- element = delegateElement = $( element );
711
- this.bindings = this.bindings.add( element );
712
- }
713
-
714
- $.each( handlers, function( event, handler ) {
715
- function handlerProxy() {
716
- // allow widgets to customize the disabled handling
717
- // - disabled as an array instead of boolean
718
- // - disabled class as method for disabling individual parts
719
- if ( !suppressDisabledCheck &&
720
- ( instance.options.disabled === true ||
721
- $( this ).hasClass( "ui-state-disabled" ) ) ) {
722
- return;
723
- }
724
- return ( typeof handler === "string" ? instance[ handler ] : handler )
725
- .apply( instance, arguments );
726
- }
727
-
728
- // copy the guid so direct unbinding works
729
- if ( typeof handler !== "string" ) {
730
- handlerProxy.guid = handler.guid =
731
- handler.guid || handlerProxy.guid || $.guid++;
732
- }
733
-
734
- var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
735
- eventName = match[1] + instance.eventNamespace,
736
- selector = match[2];
737
- if ( selector ) {
738
- delegateElement.delegate( selector, eventName, handlerProxy );
739
- } else {
740
- element.bind( eventName, handlerProxy );
741
- }
742
- });
743
- },
744
-
745
- _off: function( element, eventName ) {
746
- eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
747
- this.eventNamespace;
748
- element.unbind( eventName ).undelegate( eventName );
749
-
750
- // Clear the stack to avoid memory leaks (#10056)
751
- this.bindings = $( this.bindings.not( element ).get() );
752
- this.focusable = $( this.focusable.not( element ).get() );
753
- this.hoverable = $( this.hoverable.not( element ).get() );
754
- },
755
-
756
- _delay: function( handler, delay ) {
757
- function handlerProxy() {
758
- return ( typeof handler === "string" ? instance[ handler ] : handler )
759
- .apply( instance, arguments );
760
- }
761
- var instance = this;
762
- return setTimeout( handlerProxy, delay || 0 );
763
- },
764
-
765
- _hoverable: function( element ) {
766
- this.hoverable = this.hoverable.add( element );
767
- this._on( element, {
768
- mouseenter: function( event ) {
769
- $( event.currentTarget ).addClass( "ui-state-hover" );
770
- },
771
- mouseleave: function( event ) {
772
- $( event.currentTarget ).removeClass( "ui-state-hover" );
773
- }
774
- });
775
- },
776
-
777
- _focusable: function( element ) {
778
- this.focusable = this.focusable.add( element );
779
- this._on( element, {
780
- focusin: function( event ) {
781
- $( event.currentTarget ).addClass( "ui-state-focus" );
782
- },
783
- focusout: function( event ) {
784
- $( event.currentTarget ).removeClass( "ui-state-focus" );
785
- }
786
- });
787
- },
788
-
789
- _trigger: function( type, event, data ) {
790
- var prop, orig,
791
- callback = this.options[ type ];
792
-
793
- data = data || {};
794
- event = $.Event( event );
795
- event.type = ( type === this.widgetEventPrefix ?
796
- type :
797
- this.widgetEventPrefix + type ).toLowerCase();
798
- // the original event may come from any element
799
- // so we need to reset the target on the new event
800
- event.target = this.element[ 0 ];
801
-
802
- // copy original event properties over to the new event
803
- orig = event.originalEvent;
804
- if ( orig ) {
805
- for ( prop in orig ) {
806
- if ( !( prop in event ) ) {
807
- event[ prop ] = orig[ prop ];
808
- }
809
- }
810
- }
811
-
812
- this.element.trigger( event, data );
813
- return !( $.isFunction( callback ) &&
814
- callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
815
- event.isDefaultPrevented() );
816
- }
817
- };
818
-
819
- $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
820
- $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
821
- if ( typeof options === "string" ) {
822
- options = { effect: options };
823
- }
824
- var hasOptions,
825
- effectName = !options ?
826
- method :
827
- options === true || typeof options === "number" ?
828
- defaultEffect :
829
- options.effect || defaultEffect;
830
- options = options || {};
831
- if ( typeof options === "number" ) {
832
- options = { duration: options };
833
- }
834
- hasOptions = !$.isEmptyObject( options );
835
- options.complete = callback;
836
- if ( options.delay ) {
837
- element.delay( options.delay );
838
- }
839
- if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
840
- element[ method ]( options );
841
- } else if ( effectName !== method && element[ effectName ] ) {
842
- element[ effectName ]( options.duration, options.easing, callback );
843
- } else {
844
- element.queue(function( next ) {
845
- $( this )[ method ]();
846
- if ( callback ) {
847
- callback.call( element[ 0 ] );
848
- }
849
- next();
850
- });
851
- }
852
- };
853
- });
854
-
855
- var widget = $.widget;
856
-
857
-
858
- /*!
859
- * jQuery UI Mouse 1.11.2
860
- * http://jqueryui.com
861
- *
862
- * Copyright 2014 jQuery Foundation and other contributors
863
- * Released under the MIT license.
864
- * http://jquery.org/license
865
- *
866
- * http://api.jqueryui.com/mouse/
867
- */
868
-
869
-
870
- var mouseHandled = false;
871
- $( document ).mouseup( function() {
872
- mouseHandled = false;
873
- });
874
-
875
- var mouse = $.widget("ui.mouse", {
876
- version: "1.11.2",
877
- options: {
878
- cancel: "input,textarea,button,select,option",
879
- distance: 1,
880
- delay: 0
881
- },
882
- _mouseInit: function() {
883
- var that = this;
884
-
885
- this.element
886
- .bind("mousedown." + this.widgetName, function(event) {
887
- return that._mouseDown(event);
888
- })
889
- .bind("click." + this.widgetName, function(event) {
890
- if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
891
- $.removeData(event.target, that.widgetName + ".preventClickEvent");
892
- event.stopImmediatePropagation();
893
- return false;
894
- }
895
- });
896
-
897
- this.started = false;
898
- },
899
-
900
- // TODO: make sure destroying one instance of mouse doesn't mess with
901
- // other instances of mouse
902
- _mouseDestroy: function() {
903
- this.element.unbind("." + this.widgetName);
904
- if ( this._mouseMoveDelegate ) {
905
- this.document
906
- .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
907
- .unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
908
- }
909
- },
910
-
911
- _mouseDown: function(event) {
912
- // don't let more than one widget handle mouseStart
913
- if ( mouseHandled ) {
914
- return;
915
- }
916
-
917
- this._mouseMoved = false;
918
-
919
- // we may have missed mouseup (out of window)
920
- (this._mouseStarted && this._mouseUp(event));
921
-
922
- this._mouseDownEvent = event;
923
-
924
- var that = this,
925
- btnIsLeft = (event.which === 1),
926
- // event.target.nodeName works around a bug in IE 8 with
927
- // disabled inputs (#7620)
928
- elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
929
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
930
- return true;
931
- }
932
-
933
- this.mouseDelayMet = !this.options.delay;
934
- if (!this.mouseDelayMet) {
935
- this._mouseDelayTimer = setTimeout(function() {
936
- that.mouseDelayMet = true;
937
- }, this.options.delay);
938
- }
939
-
940
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
941
- this._mouseStarted = (this._mouseStart(event) !== false);
942
- if (!this._mouseStarted) {
943
- event.preventDefault();
944
- return true;
945
- }
946
- }
947
-
948
- // Click event may never have fired (Gecko & Opera)
949
- if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
950
- $.removeData(event.target, this.widgetName + ".preventClickEvent");
951
- }
952
-
953
- // these delegates are required to keep context
954
- this._mouseMoveDelegate = function(event) {
955
- return that._mouseMove(event);
956
- };
957
- this._mouseUpDelegate = function(event) {
958
- return that._mouseUp(event);
959
- };
960
-
961
- this.document
962
- .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
963
- .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
964
-
965
- event.preventDefault();
966
-
967
- mouseHandled = true;
968
- return true;
969
- },
970
-
971
- _mouseMove: function(event) {
972
- // Only check for mouseups outside the document if you've moved inside the document
973
- // at least once. This prevents the firing of mouseup in the case of IE<9, which will
974
- // fire a mousemove event if content is placed under the cursor. See #7778
975
- // Support: IE <9
976
- if ( this._mouseMoved ) {
977
- // IE mouseup check - mouseup happened when mouse was out of window
978
- if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
979
- return this._mouseUp(event);
980
-
981
- // Iframe mouseup check - mouseup occurred in another document
982
- } else if ( !event.which ) {
983
- return this._mouseUp( event );
984
- }
985
- }
986
-
987
- if ( event.which || event.button ) {
988
- this._mouseMoved = true;
989
- }
990
-
991
- if (this._mouseStarted) {
992
- this._mouseDrag(event);
993
- return event.preventDefault();
994
- }
995
-
996
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
997
- this._mouseStarted =
998
- (this._mouseStart(this._mouseDownEvent, event) !== false);
999
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1000
- }
1001
-
1002
- return !this._mouseStarted;
1003
- },
1004
-
1005
- _mouseUp: function(event) {
1006
- this.document
1007
- .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
1008
- .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
1009
-
1010
- if (this._mouseStarted) {
1011
- this._mouseStarted = false;
1012
-
1013
- if (event.target === this._mouseDownEvent.target) {
1014
- $.data(event.target, this.widgetName + ".preventClickEvent", true);
1015
- }
1016
-
1017
- this._mouseStop(event);
1018
- }
1019
-
1020
- mouseHandled = false;
1021
- return false;
1022
- },
1023
-
1024
- _mouseDistanceMet: function(event) {
1025
- return (Math.max(
1026
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
1027
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
1028
- ) >= this.options.distance
1029
- );
1030
- },
1031
-
1032
- _mouseDelayMet: function(/* event */) {
1033
- return this.mouseDelayMet;
1034
- },
1035
-
1036
- // These are placeholder methods, to be overriden by extending plugin
1037
- _mouseStart: function(/* event */) {},
1038
- _mouseDrag: function(/* event */) {},
1039
- _mouseStop: function(/* event */) {},
1040
- _mouseCapture: function(/* event */) { return true; }
1041
- });
1042
-
1043
-
1044
- /*!
1045
- * jQuery UI Position 1.11.2
1046
- * http://jqueryui.com
1047
- *
1048
- * Copyright 2014 jQuery Foundation and other contributors
1049
- * Released under the MIT license.
1050
- * http://jquery.org/license
1051
- *
1052
- * http://api.jqueryui.com/position/
1053
- */
1054
-
1055
- (function() {
1056
-
1057
- $.ui = $.ui || {};
1058
-
1059
- var cachedScrollbarWidth, supportsOffsetFractions,
1060
- max = Math.max,
1061
- abs = Math.abs,
1062
- round = Math.round,
1063
- rhorizontal = /left|center|right/,
1064
- rvertical = /top|center|bottom/,
1065
- roffset = /[\+\-]\d+(\.[\d]+)?%?/,
1066
- rposition = /^\w+/,
1067
- rpercent = /%$/,
1068
- _position = $.fn.position;
1069
-
1070
- function getOffsets( offsets, width, height ) {
1071
- return [
1072
- parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
1073
- parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
1074
- ];
1075
- }
1076
-
1077
- function parseCss( element, property ) {
1078
- return parseInt( $.css( element, property ), 10 ) || 0;
1079
- }
1080
-
1081
- function getDimensions( elem ) {
1082
- var raw = elem[0];
1083
- if ( raw.nodeType === 9 ) {
1084
- return {
1085
- width: elem.width(),
1086
- height: elem.height(),
1087
- offset: { top: 0, left: 0 }
1088
- };
1089
- }
1090
- if ( $.isWindow( raw ) ) {
1091
- return {
1092
- width: elem.width(),
1093
- height: elem.height(),
1094
- offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1095
- };
1096
- }
1097
- if ( raw.preventDefault ) {
1098
- return {
1099
- width: 0,
1100
- height: 0,
1101
- offset: { top: raw.pageY, left: raw.pageX }
1102
- };
1103
- }
1104
- return {
1105
- width: elem.outerWidth(),
1106
- height: elem.outerHeight(),
1107
- offset: elem.offset()
1108
- };
1109
- }
1110
-
1111
- $.position = {
1112
- scrollbarWidth: function() {
1113
- if ( cachedScrollbarWidth !== undefined ) {
1114
- return cachedScrollbarWidth;
1115
- }
1116
- var w1, w2,
1117
- div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
1118
- innerDiv = div.children()[0];
1119
-
1120
- $( "body" ).append( div );
1121
- w1 = innerDiv.offsetWidth;
1122
- div.css( "overflow", "scroll" );
1123
-
1124
- w2 = innerDiv.offsetWidth;
1125
-
1126
- if ( w1 === w2 ) {
1127
- w2 = div[0].clientWidth;
1128
- }
1129
-
1130
- div.remove();
1131
-
1132
- return (cachedScrollbarWidth = w1 - w2);
1133
- },
1134
- getScrollInfo: function( within ) {
1135
- var overflowX = within.isWindow || within.isDocument ? "" :
1136
- within.element.css( "overflow-x" ),
1137
- overflowY = within.isWindow || within.isDocument ? "" :
1138
- within.element.css( "overflow-y" ),
1139
- hasOverflowX = overflowX === "scroll" ||
1140
- ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
1141
- hasOverflowY = overflowY === "scroll" ||
1142
- ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
1143
- return {
1144
- width: hasOverflowY ? $.position.scrollbarWidth() : 0,
1145
- height: hasOverflowX ? $.position.scrollbarWidth() : 0
1146
- };
1147
- },
1148
- getWithinInfo: function( element ) {
1149
- var withinElement = $( element || window ),
1150
- isWindow = $.isWindow( withinElement[0] ),
1151
- isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
1152
- return {
1153
- element: withinElement,
1154
- isWindow: isWindow,
1155
- isDocument: isDocument,
1156
- offset: withinElement.offset() || { left: 0, top: 0 },
1157
- scrollLeft: withinElement.scrollLeft(),
1158
- scrollTop: withinElement.scrollTop(),
1159
-
1160
- // support: jQuery 1.6.x
1161
- // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
1162
- width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
1163
- height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
1164
- };
1165
- }
1166
- };
1167
-
1168
- $.fn.position = function( options ) {
1169
- if ( !options || !options.of ) {
1170
- return _position.apply( this, arguments );
1171
- }
1172
-
1173
- // make a copy, we don't want to modify arguments
1174
- options = $.extend( {}, options );
1175
-
1176
- var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
1177
- target = $( options.of ),
1178
- within = $.position.getWithinInfo( options.within ),
1179
- scrollInfo = $.position.getScrollInfo( within ),
1180
- collision = ( options.collision || "flip" ).split( " " ),
1181
- offsets = {};
1182
-
1183
- dimensions = getDimensions( target );
1184
- if ( target[0].preventDefault ) {
1185
- // force left top to allow flipping
1186
- options.at = "left top";
1187
- }
1188
- targetWidth = dimensions.width;
1189
- targetHeight = dimensions.height;
1190
- targetOffset = dimensions.offset;
1191
- // clone to reuse original targetOffset later
1192
- basePosition = $.extend( {}, targetOffset );
1193
-
1194
- // force my and at to have valid horizontal and vertical positions
1195
- // if a value is missing or invalid, it will be converted to center
1196
- $.each( [ "my", "at" ], function() {
1197
- var pos = ( options[ this ] || "" ).split( " " ),
1198
- horizontalOffset,
1199
- verticalOffset;
1200
-
1201
- if ( pos.length === 1) {
1202
- pos = rhorizontal.test( pos[ 0 ] ) ?
1203
- pos.concat( [ "center" ] ) :
1204
- rvertical.test( pos[ 0 ] ) ?
1205
- [ "center" ].concat( pos ) :
1206
- [ "center", "center" ];
1207
- }
1208
- pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1209
- pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1210
-
1211
- // calculate offsets
1212
- horizontalOffset = roffset.exec( pos[ 0 ] );
1213
- verticalOffset = roffset.exec( pos[ 1 ] );
1214
- offsets[ this ] = [
1215
- horizontalOffset ? horizontalOffset[ 0 ] : 0,
1216
- verticalOffset ? verticalOffset[ 0 ] : 0
1217
- ];
1218
-
1219
- // reduce to just the positions without the offsets
1220
- options[ this ] = [
1221
- rposition.exec( pos[ 0 ] )[ 0 ],
1222
- rposition.exec( pos[ 1 ] )[ 0 ]
1223
- ];
1224
- });
1225
-
1226
- // normalize collision option
1227
- if ( collision.length === 1 ) {
1228
- collision[ 1 ] = collision[ 0 ];
1229
- }
1230
-
1231
- if ( options.at[ 0 ] === "right" ) {
1232
- basePosition.left += targetWidth;
1233
- } else if ( options.at[ 0 ] === "center" ) {
1234
- basePosition.left += targetWidth / 2;
1235
- }
1236
-
1237
- if ( options.at[ 1 ] === "bottom" ) {
1238
- basePosition.top += targetHeight;
1239
- } else if ( options.at[ 1 ] === "center" ) {
1240
- basePosition.top += targetHeight / 2;
1241
- }
1242
-
1243
- atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1244
- basePosition.left += atOffset[ 0 ];
1245
- basePosition.top += atOffset[ 1 ];
1246
-
1247
- return this.each(function() {
1248
- var collisionPosition, using,
1249
- elem = $( this ),
1250
- elemWidth = elem.outerWidth(),
1251
- elemHeight = elem.outerHeight(),
1252
- marginLeft = parseCss( this, "marginLeft" ),
1253
- marginTop = parseCss( this, "marginTop" ),
1254
- collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1255
- collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
1256
- position = $.extend( {}, basePosition ),
1257
- myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1258
-
1259
- if ( options.my[ 0 ] === "right" ) {
1260
- position.left -= elemWidth;
1261
- } else if ( options.my[ 0 ] === "center" ) {
1262
- position.left -= elemWidth / 2;
1263
- }
1264
-
1265
- if ( options.my[ 1 ] === "bottom" ) {
1266
- position.top -= elemHeight;
1267
- } else if ( options.my[ 1 ] === "center" ) {
1268
- position.top -= elemHeight / 2;
1269
- }
1270
-
1271
- position.left += myOffset[ 0 ];
1272
- position.top += myOffset[ 1 ];
1273
-
1274
- // if the browser doesn't support fractions, then round for consistent results
1275
- if ( !supportsOffsetFractions ) {
1276
- position.left = round( position.left );
1277
- position.top = round( position.top );
1278
- }
1279
-
1280
- collisionPosition = {
1281
- marginLeft: marginLeft,
1282
- marginTop: marginTop
1283
- };
1284
-
1285
- $.each( [ "left", "top" ], function( i, dir ) {
1286
- if ( $.ui.position[ collision[ i ] ] ) {
1287
- $.ui.position[ collision[ i ] ][ dir ]( position, {
1288
- targetWidth: targetWidth,
1289
- targetHeight: targetHeight,
1290
- elemWidth: elemWidth,
1291
- elemHeight: elemHeight,
1292
- collisionPosition: collisionPosition,
1293
- collisionWidth: collisionWidth,
1294
- collisionHeight: collisionHeight,
1295
- offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1296
- my: options.my,
1297
- at: options.at,
1298
- within: within,
1299
- elem: elem
1300
- });
1301
- }
1302
- });
1303
-
1304
- if ( options.using ) {
1305
- // adds feedback as second argument to using callback, if present
1306
- using = function( props ) {
1307
- var left = targetOffset.left - position.left,
1308
- right = left + targetWidth - elemWidth,
1309
- top = targetOffset.top - position.top,
1310
- bottom = top + targetHeight - elemHeight,
1311
- feedback = {
1312
- target: {
1313
- element: target,
1314
- left: targetOffset.left,
1315
- top: targetOffset.top,
1316
- width: targetWidth,
1317
- height: targetHeight
1318
- },
1319
- element: {
1320
- element: elem,
1321
- left: position.left,
1322
- top: position.top,
1323
- width: elemWidth,
1324
- height: elemHeight
1325
- },
1326
- horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1327
- vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1328
- };
1329
- if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1330
- feedback.horizontal = "center";
1331
- }
1332
- if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1333
- feedback.vertical = "middle";
1334
- }
1335
- if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1336
- feedback.important = "horizontal";
1337
- } else {
1338
- feedback.important = "vertical";
1339
- }
1340
- options.using.call( this, props, feedback );
1341
- };
1342
- }
1343
-
1344
- elem.offset( $.extend( position, { using: using } ) );
1345
- });
1346
- };
1347
-
1348
- $.ui.position = {
1349
- fit: {
1350
- left: function( position, data ) {
1351
- var within = data.within,
1352
- withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1353
- outerWidth = within.width,
1354
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1355
- overLeft = withinOffset - collisionPosLeft,
1356
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1357
- newOverRight;
1358
-
1359
- // element is wider than within
1360
- if ( data.collisionWidth > outerWidth ) {
1361
- // element is initially over the left side of within
1362
- if ( overLeft > 0 && overRight <= 0 ) {
1363
- newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1364
- position.left += overLeft - newOverRight;
1365
- // element is initially over right side of within
1366
- } else if ( overRight > 0 && overLeft <= 0 ) {
1367
- position.left = withinOffset;
1368
- // element is initially over both left and right sides of within
1369
- } else {
1370
- if ( overLeft > overRight ) {
1371
- position.left = withinOffset + outerWidth - data.collisionWidth;
1372
- } else {
1373
- position.left = withinOffset;
1374
- }
1375
- }
1376
- // too far left -> align with left edge
1377
- } else if ( overLeft > 0 ) {
1378
- position.left += overLeft;
1379
- // too far right -> align with right edge
1380
- } else if ( overRight > 0 ) {
1381
- position.left -= overRight;
1382
- // adjust based on position and margin
1383
- } else {
1384
- position.left = max( position.left - collisionPosLeft, position.left );
1385
- }
1386
- },
1387
- top: function( position, data ) {
1388
- var within = data.within,
1389
- withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1390
- outerHeight = data.within.height,
1391
- collisionPosTop = position.top - data.collisionPosition.marginTop,
1392
- overTop = withinOffset - collisionPosTop,
1393
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1394
- newOverBottom;
1395
-
1396
- // element is taller than within
1397
- if ( data.collisionHeight > outerHeight ) {
1398
- // element is initially over the top of within
1399
- if ( overTop > 0 && overBottom <= 0 ) {
1400
- newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1401
- position.top += overTop - newOverBottom;
1402
- // element is initially over bottom of within
1403
- } else if ( overBottom > 0 && overTop <= 0 ) {
1404
- position.top = withinOffset;
1405
- // element is initially over both top and bottom of within
1406
- } else {
1407
- if ( overTop > overBottom ) {
1408
- position.top = withinOffset + outerHeight - data.collisionHeight;
1409
- } else {
1410
- position.top = withinOffset;
1411
- }
1412
- }
1413
- // too far up -> align with top
1414
- } else if ( overTop > 0 ) {
1415
- position.top += overTop;
1416
- // too far down -> align with bottom edge
1417
- } else if ( overBottom > 0 ) {
1418
- position.top -= overBottom;
1419
- // adjust based on position and margin
1420
- } else {
1421
- position.top = max( position.top - collisionPosTop, position.top );
1422
- }
1423
- }
1424
- },
1425
- flip: {
1426
- left: function( position, data ) {
1427
- var within = data.within,
1428
- withinOffset = within.offset.left + within.scrollLeft,
1429
- outerWidth = within.width,
1430
- offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1431
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1432
- overLeft = collisionPosLeft - offsetLeft,
1433
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1434
- myOffset = data.my[ 0 ] === "left" ?
1435
- -data.elemWidth :
1436
- data.my[ 0 ] === "right" ?
1437
- data.elemWidth :
1438
- 0,
1439
- atOffset = data.at[ 0 ] === "left" ?
1440
- data.targetWidth :
1441
- data.at[ 0 ] === "right" ?
1442
- -data.targetWidth :
1443
- 0,
1444
- offset = -2 * data.offset[ 0 ],
1445
- newOverRight,
1446
- newOverLeft;
1447
-
1448
- if ( overLeft < 0 ) {
1449
- newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1450
- if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1451
- position.left += myOffset + atOffset + offset;
1452
- }
1453
- } else if ( overRight > 0 ) {
1454
- newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1455
- if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1456
- position.left += myOffset + atOffset + offset;
1457
- }
1458
- }
1459
- },
1460
- top: function( position, data ) {
1461
- var within = data.within,
1462
- withinOffset = within.offset.top + within.scrollTop,
1463
- outerHeight = within.height,
1464
- offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1465
- collisionPosTop = position.top - data.collisionPosition.marginTop,
1466
- overTop = collisionPosTop - offsetTop,
1467
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1468
- top = data.my[ 1 ] === "top",
1469
- myOffset = top ?
1470
- -data.elemHeight :
1471
- data.my[ 1 ] === "bottom" ?
1472
- data.elemHeight :
1473
- 0,
1474
- atOffset = data.at[ 1 ] === "top" ?
1475
- data.targetHeight :
1476
- data.at[ 1 ] === "bottom" ?
1477
- -data.targetHeight :
1478
- 0,
1479
- offset = -2 * data.offset[ 1 ],
1480
- newOverTop,
1481
- newOverBottom;
1482
- if ( overTop < 0 ) {
1483
- newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1484
- if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
1485
- position.top += myOffset + atOffset + offset;
1486
- }
1487
- } else if ( overBottom > 0 ) {
1488
- newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1489
- if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
1490
- position.top += myOffset + atOffset + offset;
1491
- }
1492
- }
1493
- }
1494
- },
1495
- flipfit: {
1496
- left: function() {
1497
- $.ui.position.flip.left.apply( this, arguments );
1498
- $.ui.position.fit.left.apply( this, arguments );
1499
- },
1500
- top: function() {
1501
- $.ui.position.flip.top.apply( this, arguments );
1502
- $.ui.position.fit.top.apply( this, arguments );
1503
- }
1504
- }
1505
- };
1506
-
1507
- // fraction support test
1508
- (function() {
1509
- var testElement, testElementParent, testElementStyle, offsetLeft, i,
1510
- body = document.getElementsByTagName( "body" )[ 0 ],
1511
- div = document.createElement( "div" );
1512
-
1513
- //Create a "fake body" for testing based on method used in jQuery.support
1514
- testElement = document.createElement( body ? "div" : "body" );
1515
- testElementStyle = {
1516
- visibility: "hidden",
1517
- width: 0,
1518
- height: 0,
1519
- border: 0,
1520
- margin: 0,
1521
- background: "none"
1522
- };
1523
- if ( body ) {
1524
- $.extend( testElementStyle, {
1525
- position: "absolute",
1526
- left: "-1000px",
1527
- top: "-1000px"
1528
- });
1529
- }
1530
- for ( i in testElementStyle ) {
1531
- testElement.style[ i ] = testElementStyle[ i ];
1532
- }
1533
- testElement.appendChild( div );
1534
- testElementParent = body || document.documentElement;
1535
- testElementParent.insertBefore( testElement, testElementParent.firstChild );
1536
-
1537
- div.style.cssText = "position: absolute; left: 10.7432222px;";
1538
-
1539
- offsetLeft = $( div ).offset().left;
1540
- supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1541
-
1542
- testElement.innerHTML = "";
1543
- testElementParent.removeChild( testElement );
1544
- })();
1545
-
1546
- })();
1547
-
1548
- var position = $.ui.position;
1549
-
1550
-
1551
- /*!
1552
- * jQuery UI Accordion 1.11.2
1553
- * http://jqueryui.com
1554
- *
1555
- * Copyright 2014 jQuery Foundation and other contributors
1556
- * Released under the MIT license.
1557
- * http://jquery.org/license
1558
- *
1559
- * http://api.jqueryui.com/accordion/
1560
- */
1561
-
1562
-
1563
- var accordion = $.widget( "ui.accordion", {
1564
- version: "1.11.2",
1565
- options: {
1566
- active: 0,
1567
- animate: {},
1568
- collapsible: false,
1569
- event: "click",
1570
- header: "> li > :first-child,> :not(li):even",
1571
- heightStyle: "auto",
1572
- icons: {
1573
- activeHeader: "ui-icon-triangle-1-s",
1574
- header: "ui-icon-triangle-1-e"
1575
- },
1576
-
1577
- // callbacks
1578
- activate: null,
1579
- beforeActivate: null
1580
- },
1581
-
1582
- hideProps: {
1583
- borderTopWidth: "hide",
1584
- borderBottomWidth: "hide",
1585
- paddingTop: "hide",
1586
- paddingBottom: "hide",
1587
- height: "hide"
1588
- },
1589
-
1590
- showProps: {
1591
- borderTopWidth: "show",
1592
- borderBottomWidth: "show",
1593
- paddingTop: "show",
1594
- paddingBottom: "show",
1595
- height: "show"
1596
- },
1597
-
1598
- _create: function() {
1599
- var options = this.options;
1600
- this.prevShow = this.prevHide = $();
1601
- this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
1602
- // ARIA
1603
- .attr( "role", "tablist" );
1604
-
1605
- // don't allow collapsible: false and active: false / null
1606
- if ( !options.collapsible && (options.active === false || options.active == null) ) {
1607
- options.active = 0;
1608
- }
1609
-
1610
- this._processPanels();
1611
- // handle negative values
1612
- if ( options.active < 0 ) {
1613
- options.active += this.headers.length;
1614
- }
1615
- this._refresh();
1616
- },
1617
-
1618
- _getCreateEventData: function() {
1619
- return {
1620
- header: this.active,
1621
- panel: !this.active.length ? $() : this.active.next()
1622
- };
1623
- },
1624
-
1625
- _createIcons: function() {
1626
- var icons = this.options.icons;
1627
- if ( icons ) {
1628
- $( "<span>" )
1629
- .addClass( "ui-accordion-header-icon ui-icon " + icons.header )
1630
- .prependTo( this.headers );
1631
- this.active.children( ".ui-accordion-header-icon" )
1632
- .removeClass( icons.header )
1633
- .addClass( icons.activeHeader );
1634
- this.headers.addClass( "ui-accordion-icons" );
1635
- }
1636
- },
1637
-
1638
- _destroyIcons: function() {
1639
- this.headers
1640
- .removeClass( "ui-accordion-icons" )
1641
- .children( ".ui-accordion-header-icon" )
1642
- .remove();
1643
- },
1644
-
1645
- _destroy: function() {
1646
- var contents;
1647
-
1648
- // clean up main element
1649
- this.element
1650
- .removeClass( "ui-accordion ui-widget ui-helper-reset" )
1651
- .removeAttr( "role" );
1652
-
1653
- // clean up headers
1654
- this.headers
1655
- .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
1656
- "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
1657
- .removeAttr( "role" )
1658
- .removeAttr( "aria-expanded" )
1659
- .removeAttr( "aria-selected" )
1660
- .removeAttr( "aria-controls" )
1661
- .removeAttr( "tabIndex" )
1662
- .removeUniqueId();
1663
-
1664
- this._destroyIcons();
1665
-
1666
- // clean up content panels
1667
- contents = this.headers.next()
1668
- .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
1669
- "ui-accordion-content ui-accordion-content-active ui-state-disabled" )
1670
- .css( "display", "" )
1671
- .removeAttr( "role" )
1672
- .removeAttr( "aria-hidden" )
1673
- .removeAttr( "aria-labelledby" )
1674
- .removeUniqueId();
1675
-
1676
- if ( this.options.heightStyle !== "content" ) {
1677
- contents.css( "height", "" );
1678
- }
1679
- },
1680
-
1681
- _setOption: function( key, value ) {
1682
- if ( key === "active" ) {
1683
- // _activate() will handle invalid values and update this.options
1684
- this._activate( value );
1685
- return;
1686
- }
1687
-
1688
- if ( key === "event" ) {
1689
- if ( this.options.event ) {
1690
- this._off( this.headers, this.options.event );
1691
- }
1692
- this._setupEvents( value );
1693
- }
1694
-
1695
- this._super( key, value );
1696
-
1697
- // setting collapsible: false while collapsed; open first panel
1698
- if ( key === "collapsible" && !value && this.options.active === false ) {
1699
- this._activate( 0 );
1700
- }
1701
-
1702
- if ( key === "icons" ) {
1703
- this._destroyIcons();
1704
- if ( value ) {
1705
- this._createIcons();
1706
- }
1707
- }
1708
-
1709
- // #5332 - opacity doesn't cascade to positioned elements in IE
1710
- // so we need to add the disabled class to the headers and panels
1711
- if ( key === "disabled" ) {
1712
- this.element
1713
- .toggleClass( "ui-state-disabled", !!value )
1714
- .attr( "aria-disabled", value );
1715
- this.headers.add( this.headers.next() )
1716
- .toggleClass( "ui-state-disabled", !!value );
1717
- }
1718
- },
1719
-
1720
- _keydown: function( event ) {
1721
- if ( event.altKey || event.ctrlKey ) {
1722
- return;
1723
- }
1724
-
1725
- var keyCode = $.ui.keyCode,
1726
- length = this.headers.length,
1727
- currentIndex = this.headers.index( event.target ),
1728
- toFocus = false;
1729
-
1730
- switch ( event.keyCode ) {
1731
- case keyCode.RIGHT:
1732
- case keyCode.DOWN:
1733
- toFocus = this.headers[ ( currentIndex + 1 ) % length ];
1734
- break;
1735
- case keyCode.LEFT:
1736
- case keyCode.UP:
1737
- toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
1738
- break;
1739
- case keyCode.SPACE:
1740
- case keyCode.ENTER:
1741
- this._eventHandler( event );
1742
- break;
1743
- case keyCode.HOME:
1744
- toFocus = this.headers[ 0 ];
1745
- break;
1746
- case keyCode.END:
1747
- toFocus = this.headers[ length - 1 ];
1748
- break;
1749
- }
1750
-
1751
- if ( toFocus ) {
1752
- $( event.target ).attr( "tabIndex", -1 );
1753
- $( toFocus ).attr( "tabIndex", 0 );
1754
- toFocus.focus();
1755
- event.preventDefault();
1756
- }
1757
- },
1758
-
1759
- _panelKeyDown: function( event ) {
1760
- if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
1761
- $( event.currentTarget ).prev().focus();
1762
- }
1763
- },
1764
-
1765
- refresh: function() {
1766
- var options = this.options;
1767
- this._processPanels();
1768
-
1769
- // was collapsed or no panel
1770
- if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
1771
- options.active = false;
1772
- this.active = $();
1773
- // active false only when collapsible is true
1774
- } else if ( options.active === false ) {
1775
- this._activate( 0 );
1776
- // was active, but active panel is gone
1777
- } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
1778
- // all remaining panel are disabled
1779
- if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
1780
- options.active = false;
1781
- this.active = $();
1782
- // activate previous panel
1783
- } else {
1784
- this._activate( Math.max( 0, options.active - 1 ) );
1785
- }
1786
- // was active, active panel still exists
1787
- } else {
1788
- // make sure active index is correct
1789
- options.active = this.headers.index( this.active );
1790
- }
1791
-
1792
- this._destroyIcons();
1793
-
1794
- this._refresh();
1795
- },
1796
-
1797
- _processPanels: function() {
1798
- var prevHeaders = this.headers,
1799
- prevPanels = this.panels;
1800
-
1801
- this.headers = this.element.find( this.options.header )
1802
- .addClass( "ui-accordion-header ui-state-default ui-corner-all" );
1803
-
1804
- this.panels = this.headers.next()
1805
- .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
1806
- .filter( ":not(.ui-accordion-content-active)" )
1807
- .hide();
1808
-
1809
- // Avoid memory leaks (#10056)
1810
- if ( prevPanels ) {
1811
- this._off( prevHeaders.not( this.headers ) );
1812
- this._off( prevPanels.not( this.panels ) );
1813
- }
1814
- },
1815
-
1816
- _refresh: function() {
1817
- var maxHeight,
1818
- options = this.options,
1819
- heightStyle = options.heightStyle,
1820
- parent = this.element.parent();
1821
-
1822
- this.active = this._findActive( options.active )
1823
- .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
1824
- .removeClass( "ui-corner-all" );
1825
- this.active.next()
1826
- .addClass( "ui-accordion-content-active" )
1827
- .show();
1828
-
1829
- this.headers
1830
- .attr( "role", "tab" )
1831
- .each(function() {
1832
- var header = $( this ),
1833
- headerId = header.uniqueId().attr( "id" ),
1834
- panel = header.next(),
1835
- panelId = panel.uniqueId().attr( "id" );
1836
- header.attr( "aria-controls", panelId );
1837
- panel.attr( "aria-labelledby", headerId );
1838
- })
1839
- .next()
1840
- .attr( "role", "tabpanel" );
1841
-
1842
- this.headers
1843
- .not( this.active )
1844
- .attr({
1845
- "aria-selected": "false",
1846
- "aria-expanded": "false",
1847
- tabIndex: -1
1848
- })
1849
- .next()
1850
- .attr({
1851
- "aria-hidden": "true"
1852
- })
1853
- .hide();
1854
-
1855
- // make sure at least one header is in the tab order
1856
- if ( !this.active.length ) {
1857
- this.headers.eq( 0 ).attr( "tabIndex", 0 );
1858
- } else {
1859
- this.active.attr({
1860
- "aria-selected": "true",
1861
- "aria-expanded": "true",
1862
- tabIndex: 0
1863
- })
1864
- .next()
1865
- .attr({
1866
- "aria-hidden": "false"
1867
- });
1868
- }
1869
-
1870
- this._createIcons();
1871
-
1872
- this._setupEvents( options.event );
1873
-
1874
- if ( heightStyle === "fill" ) {
1875
- maxHeight = parent.height();
1876
- this.element.siblings( ":visible" ).each(function() {
1877
- var elem = $( this ),
1878
- position = elem.css( "position" );
1879
-
1880
- if ( position === "absolute" || position === "fixed" ) {
1881
- return;
1882
- }
1883
- maxHeight -= elem.outerHeight( true );
1884
- });
1885
-
1886
- this.headers.each(function() {
1887
- maxHeight -= $( this ).outerHeight( true );
1888
- });
1889
-
1890
- this.headers.next()
1891
- .each(function() {
1892
- $( this ).height( Math.max( 0, maxHeight -
1893
- $( this ).innerHeight() + $( this ).height() ) );
1894
- })
1895
- .css( "overflow", "auto" );
1896
- } else if ( heightStyle === "auto" ) {
1897
- maxHeight = 0;
1898
- this.headers.next()
1899
- .each(function() {
1900
- maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
1901
- })
1902
- .height( maxHeight );
1903
- }
1904
- },
1905
-
1906
- _activate: function( index ) {
1907
- var active = this._findActive( index )[ 0 ];
1908
-
1909
- // trying to activate the already active panel
1910
- if ( active === this.active[ 0 ] ) {
1911
- return;
1912
- }
1913
-
1914
- // trying to collapse, simulate a click on the currently active header
1915
- active = active || this.active[ 0 ];
1916
-
1917
- this._eventHandler({
1918
- target: active,
1919
- currentTarget: active,
1920
- preventDefault: $.noop
1921
- });
1922
- },
1923
-
1924
- _findActive: function( selector ) {
1925
- return typeof selector === "number" ? this.headers.eq( selector ) : $();
1926
- },
1927
-
1928
- _setupEvents: function( event ) {
1929
- var events = {
1930
- keydown: "_keydown"
1931
- };
1932
- if ( event ) {
1933
- $.each( event.split( " " ), function( index, eventName ) {
1934
- events[ eventName ] = "_eventHandler";
1935
- });
1936
- }
1937
-
1938
- this._off( this.headers.add( this.headers.next() ) );
1939
- this._on( this.headers, events );
1940
- this._on( this.headers.next(), { keydown: "_panelKeyDown" });
1941
- this._hoverable( this.headers );
1942
- this._focusable( this.headers );
1943
- },
1944
-
1945
- _eventHandler: function( event ) {
1946
- var options = this.options,
1947
- active = this.active,
1948
- clicked = $( event.currentTarget ),
1949
- clickedIsActive = clicked[ 0 ] === active[ 0 ],
1950
- collapsing = clickedIsActive && options.collapsible,
1951
- toShow = collapsing ? $() : clicked.next(),
1952
- toHide = active.next(),
1953
- eventData = {
1954
- oldHeader: active,
1955
- oldPanel: toHide,
1956
- newHeader: collapsing ? $() : clicked,
1957
- newPanel: toShow
1958
- };
1959
-
1960
- event.preventDefault();
1961
-
1962
- if (
1963
- // click on active header, but not collapsible
1964
- ( clickedIsActive && !options.collapsible ) ||
1965
- // allow canceling activation
1966
- ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
1967
- return;
1968
- }
1969
-
1970
- options.active = collapsing ? false : this.headers.index( clicked );
1971
-
1972
- // when the call to ._toggle() comes after the class changes
1973
- // it causes a very odd bug in IE 8 (see #6720)
1974
- this.active = clickedIsActive ? $() : clicked;
1975
- this._toggle( eventData );
1976
-
1977
- // switch classes
1978
- // corner classes on the previously active header stay after the animation
1979
- active.removeClass( "ui-accordion-header-active ui-state-active" );
1980
- if ( options.icons ) {
1981
- active.children( ".ui-accordion-header-icon" )
1982
- .removeClass( options.icons.activeHeader )
1983
- .addClass( options.icons.header );
1984
- }
1985
-
1986
- if ( !clickedIsActive ) {
1987
- clicked
1988
- .removeClass( "ui-corner-all" )
1989
- .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
1990
- if ( options.icons ) {
1991
- clicked.children( ".ui-accordion-header-icon" )
1992
- .removeClass( options.icons.header )
1993
- .addClass( options.icons.activeHeader );
1994
- }
1995
-
1996
- clicked
1997
- .next()
1998
- .addClass( "ui-accordion-content-active" );
1999
- }
2000
- },
2001
-
2002
- _toggle: function( data ) {
2003
- var toShow = data.newPanel,
2004
- toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
2005
-
2006
- // handle activating a panel during the animation for another activation
2007
- this.prevShow.add( this.prevHide ).stop( true, true );
2008
- this.prevShow = toShow;
2009
- this.prevHide = toHide;
2010
-
2011
- if ( this.options.animate ) {
2012
- this._animate( toShow, toHide, data );
2013
- } else {
2014
- toHide.hide();
2015
- toShow.show();
2016
- this._toggleComplete( data );
2017
- }
2018
-
2019
- toHide.attr({
2020
- "aria-hidden": "true"
2021
- });
2022
- toHide.prev().attr( "aria-selected", "false" );
2023
- // if we're switching panels, remove the old header from the tab order
2024
- // if we're opening from collapsed state, remove the previous header from the tab order
2025
- // if we're collapsing, then keep the collapsing header in the tab order
2026
- if ( toShow.length && toHide.length ) {
2027
- toHide.prev().attr({
2028
- "tabIndex": -1,
2029
- "aria-expanded": "false"
2030
- });
2031
- } else if ( toShow.length ) {
2032
- this.headers.filter(function() {
2033
- return $( this ).attr( "tabIndex" ) === 0;
2034
- })
2035
- .attr( "tabIndex", -1 );
2036
- }
2037
-
2038
- toShow
2039
- .attr( "aria-hidden", "false" )
2040
- .prev()
2041
- .attr({
2042
- "aria-selected": "true",
2043
- tabIndex: 0,
2044
- "aria-expanded": "true"
2045
- });
2046
- },
2047
-
2048
- _animate: function( toShow, toHide, data ) {
2049
- var total, easing, duration,
2050
- that = this,
2051
- adjust = 0,
2052
- down = toShow.length &&
2053
- ( !toHide.length || ( toShow.index() < toHide.index() ) ),
2054
- animate = this.options.animate || {},
2055
- options = down && animate.down || animate,
2056
- complete = function() {
2057
- that._toggleComplete( data );
2058
- };
2059
-
2060
- if ( typeof options === "number" ) {
2061
- duration = options;
2062
- }
2063
- if ( typeof options === "string" ) {
2064
- easing = options;
2065
- }
2066
- // fall back from options to animation in case of partial down settings
2067
- easing = easing || options.easing || animate.easing;
2068
- duration = duration || options.duration || animate.duration;
2069
-
2070
- if ( !toHide.length ) {
2071
- return toShow.animate( this.showProps, duration, easing, complete );
2072
- }
2073
- if ( !toShow.length ) {
2074
- return toHide.animate( this.hideProps, duration, easing, complete );
2075
- }
2076
-
2077
- total = toShow.show().outerHeight();
2078
- toHide.animate( this.hideProps, {
2079
- duration: duration,
2080
- easing: easing,
2081
- step: function( now, fx ) {
2082
- fx.now = Math.round( now );
2083
- }
2084
- });
2085
- toShow
2086
- .hide()
2087
- .animate( this.showProps, {
2088
- duration: duration,
2089
- easing: easing,
2090
- complete: complete,
2091
- step: function( now, fx ) {
2092
- fx.now = Math.round( now );
2093
- if ( fx.prop !== "height" ) {
2094
- adjust += fx.now;
2095
- } else if ( that.options.heightStyle !== "content" ) {
2096
- fx.now = Math.round( total - toHide.outerHeight() - adjust );
2097
- adjust = 0;
2098
- }
2099
- }
2100
- });
2101
- },
2102
-
2103
- _toggleComplete: function( data ) {
2104
- var toHide = data.oldPanel;
2105
-
2106
- toHide
2107
- .removeClass( "ui-accordion-content-active" )
2108
- .prev()
2109
- .removeClass( "ui-corner-top" )
2110
- .addClass( "ui-corner-all" );
2111
-
2112
- // Work around for rendering bug in IE (#5421)
2113
- if ( toHide.length ) {
2114
- toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
2115
- }
2116
- this._trigger( "activate", null, data );
2117
- }
2118
- });
2119
-
2120
-
2121
- /*!
2122
- * jQuery UI Menu 1.11.2
2123
- * http://jqueryui.com
2124
- *
2125
- * Copyright 2014 jQuery Foundation and other contributors
2126
- * Released under the MIT license.
2127
- * http://jquery.org/license
2128
- *
2129
- * http://api.jqueryui.com/menu/
2130
- */
2131
-
2132
-
2133
- var menu = $.widget( "ui.menu", {
2134
- version: "1.11.2",
2135
- defaultElement: "<ul>",
2136
- delay: 300,
2137
- options: {
2138
- icons: {
2139
- submenu: "ui-icon-carat-1-e"
2140
- },
2141
- items: "> *",
2142
- menus: "ul",
2143
- position: {
2144
- my: "left-1 top",
2145
- at: "right top"
2146
- },
2147
- role: "menu",
2148
-
2149
- // callbacks
2150
- blur: null,
2151
- focus: null,
2152
- select: null
2153
- },
2154
-
2155
- _create: function() {
2156
- this.activeMenu = this.element;
2157
-
2158
- // Flag used to prevent firing of the click handler
2159
- // as the event bubbles up through nested menus
2160
- this.mouseHandled = false;
2161
- this.element
2162
- .uniqueId()
2163
- .addClass( "ui-menu ui-widget ui-widget-content" )
2164
- .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
2165
- .attr({
2166
- role: this.options.role,
2167
- tabIndex: 0
2168
- });
2169
-
2170
- if ( this.options.disabled ) {
2171
- this.element
2172
- .addClass( "ui-state-disabled" )
2173
- .attr( "aria-disabled", "true" );
2174
- }
2175
-
2176
- this._on({
2177
- // Prevent focus from sticking to links inside menu after clicking
2178
- // them (focus should always stay on UL during navigation).
2179
- "mousedown .ui-menu-item": function( event ) {
2180
- event.preventDefault();
2181
- },
2182
- "click .ui-menu-item": function( event ) {
2183
- var target = $( event.target );
2184
- if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
2185
- this.select( event );
2186
-
2187
- // Only set the mouseHandled flag if the event will bubble, see #9469.
2188
- if ( !event.isPropagationStopped() ) {
2189
- this.mouseHandled = true;
2190
- }
2191
-
2192
- // Open submenu on click
2193
- if ( target.has( ".ui-menu" ).length ) {
2194
- this.expand( event );
2195
- } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
2196
-
2197
- // Redirect focus to the menu
2198
- this.element.trigger( "focus", [ true ] );
2199
-
2200
- // If the active item is on the top level, let it stay active.
2201
- // Otherwise, blur the active item since it is no longer visible.
2202
- if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
2203
- clearTimeout( this.timer );
2204
- }
2205
- }
2206
- }
2207
- },
2208
- "mouseenter .ui-menu-item": function( event ) {
2209
- // Ignore mouse events while typeahead is active, see #10458.
2210
- // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
2211
- // is over an item in the menu
2212
- if ( this.previousFilter ) {
2213
- return;
2214
- }
2215
- var target = $( event.currentTarget );
2216
- // Remove ui-state-active class from siblings of the newly focused menu item
2217
- // to avoid a jump caused by adjacent elements both having a class with a border
2218
- target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
2219
- this.focus( event, target );
2220
- },
2221
- mouseleave: "collapseAll",
2222
- "mouseleave .ui-menu": "collapseAll",
2223
- focus: function( event, keepActiveItem ) {
2224
- // If there's already an active item, keep it active
2225
- // If not, activate the first item
2226
- var item = this.active || this.element.find( this.options.items ).eq( 0 );
2227
-
2228
- if ( !keepActiveItem ) {
2229
- this.focus( event, item );
2230
- }
2231
- },
2232
- blur: function( event ) {
2233
- this._delay(function() {
2234
- if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
2235
- this.collapseAll( event );
2236
- }
2237
- });
2238
- },
2239
- keydown: "_keydown"
2240
- });
2241
-
2242
- this.refresh();
2243
-
2244
- // Clicks outside of a menu collapse any open menus
2245
- this._on( this.document, {
2246
- click: function( event ) {
2247
- if ( this._closeOnDocumentClick( event ) ) {
2248
- this.collapseAll( event );
2249
- }
2250
-
2251
- // Reset the mouseHandled flag
2252
- this.mouseHandled = false;
2253
- }
2254
- });
2255
- },
2256
-
2257
- _destroy: function() {
2258
- // Destroy (sub)menus
2259
- this.element
2260
- .removeAttr( "aria-activedescendant" )
2261
- .find( ".ui-menu" ).addBack()
2262
- .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
2263
- .removeAttr( "role" )
2264
- .removeAttr( "tabIndex" )
2265
- .removeAttr( "aria-labelledby" )
2266
- .removeAttr( "aria-expanded" )
2267
- .removeAttr( "aria-hidden" )
2268
- .removeAttr( "aria-disabled" )
2269
- .removeUniqueId()
2270
- .show();
2271
-
2272
- // Destroy menu items
2273
- this.element.find( ".ui-menu-item" )
2274
- .removeClass( "ui-menu-item" )
2275
- .removeAttr( "role" )
2276
- .removeAttr( "aria-disabled" )
2277
- .removeUniqueId()
2278
- .removeClass( "ui-state-hover" )
2279
- .removeAttr( "tabIndex" )
2280
- .removeAttr( "role" )
2281
- .removeAttr( "aria-haspopup" )
2282
- .children().each( function() {
2283
- var elem = $( this );
2284
- if ( elem.data( "ui-menu-submenu-carat" ) ) {
2285
- elem.remove();
2286
- }
2287
- });
2288
-
2289
- // Destroy menu dividers
2290
- this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
2291
- },
2292
-
2293
- _keydown: function( event ) {
2294
- var match, prev, character, skip,
2295
- preventDefault = true;
2296
-
2297
- switch ( event.keyCode ) {
2298
- case $.ui.keyCode.PAGE_UP:
2299
- this.previousPage( event );
2300
- break;
2301
- case $.ui.keyCode.PAGE_DOWN:
2302
- this.nextPage( event );
2303
- break;
2304
- case $.ui.keyCode.HOME:
2305
- this._move( "first", "first", event );
2306
- break;
2307
- case $.ui.keyCode.END:
2308
- this._move( "last", "last", event );
2309
- break;
2310
- case $.ui.keyCode.UP:
2311
- this.previous( event );
2312
- break;
2313
- case $.ui.keyCode.DOWN:
2314
- this.next( event );
2315
- break;
2316
- case $.ui.keyCode.LEFT:
2317
- this.collapse( event );
2318
- break;
2319
- case $.ui.keyCode.RIGHT:
2320
- if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
2321
- this.expand( event );
2322
- }
2323
- break;
2324
- case $.ui.keyCode.ENTER:
2325
- case $.ui.keyCode.SPACE:
2326
- this._activate( event );
2327
- break;
2328
- case $.ui.keyCode.ESCAPE:
2329
- this.collapse( event );
2330
- break;
2331
- default:
2332
- preventDefault = false;
2333
- prev = this.previousFilter || "";
2334
- character = String.fromCharCode( event.keyCode );
2335
- skip = false;
2336
-
2337
- clearTimeout( this.filterTimer );
2338
-
2339
- if ( character === prev ) {
2340
- skip = true;
2341
- } else {
2342
- character = prev + character;
2343
- }
2344
-
2345
- match = this._filterMenuItems( character );
2346
- match = skip && match.index( this.active.next() ) !== -1 ?
2347
- this.active.nextAll( ".ui-menu-item" ) :
2348
- match;
2349
-
2350
- // If no matches on the current filter, reset to the last character pressed
2351
- // to move down the menu to the first item that starts with that character
2352
- if ( !match.length ) {
2353
- character = String.fromCharCode( event.keyCode );
2354
- match = this._filterMenuItems( character );
2355
- }
2356
-
2357
- if ( match.length ) {
2358
- this.focus( event, match );
2359
- this.previousFilter = character;
2360
- this.filterTimer = this._delay(function() {
2361
- delete this.previousFilter;
2362
- }, 1000 );
2363
- } else {
2364
- delete this.previousFilter;
2365
- }
2366
- }
2367
-
2368
- if ( preventDefault ) {
2369
- event.preventDefault();
2370
- }
2371
- },
2372
-
2373
- _activate: function( event ) {
2374
- if ( !this.active.is( ".ui-state-disabled" ) ) {
2375
- if ( this.active.is( "[aria-haspopup='true']" ) ) {
2376
- this.expand( event );
2377
- } else {
2378
- this.select( event );
2379
- }
2380
- }
2381
- },
2382
-
2383
- refresh: function() {
2384
- var menus, items,
2385
- that = this,
2386
- icon = this.options.icons.submenu,
2387
- submenus = this.element.find( this.options.menus );
2388
-
2389
- this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
2390
-
2391
- // Initialize nested menus
2392
- submenus.filter( ":not(.ui-menu)" )
2393
- .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
2394
- .hide()
2395
- .attr({
2396
- role: this.options.role,
2397
- "aria-hidden": "true",
2398
- "aria-expanded": "false"
2399
- })
2400
- .each(function() {
2401
- var menu = $( this ),
2402
- item = menu.parent(),
2403
- submenuCarat = $( "<span>" )
2404
- .addClass( "ui-menu-icon ui-icon " + icon )
2405
- .data( "ui-menu-submenu-carat", true );
2406
-
2407
- item
2408
- .attr( "aria-haspopup", "true" )
2409
- .prepend( submenuCarat );
2410
- menu.attr( "aria-labelledby", item.attr( "id" ) );
2411
- });
2412
-
2413
- menus = submenus.add( this.element );
2414
- items = menus.find( this.options.items );
2415
-
2416
- // Initialize menu-items containing spaces and/or dashes only as dividers
2417
- items.not( ".ui-menu-item" ).each(function() {
2418
- var item = $( this );
2419
- if ( that._isDivider( item ) ) {
2420
- item.addClass( "ui-widget-content ui-menu-divider" );
2421
- }
2422
- });
2423
-
2424
- // Don't refresh list items that are already adapted
2425
- items.not( ".ui-menu-item, .ui-menu-divider" )
2426
- .addClass( "ui-menu-item" )
2427
- .uniqueId()
2428
- .attr({
2429
- tabIndex: -1,
2430
- role: this._itemRole()
2431
- });
2432
-
2433
- // Add aria-disabled attribute to any disabled menu item
2434
- items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
2435
-
2436
- // If the active item has been removed, blur the menu
2437
- if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
2438
- this.blur();
2439
- }
2440
- },
2441
-
2442
- _itemRole: function() {
2443
- return {
2444
- menu: "menuitem",
2445
- listbox: "option"
2446
- }[ this.options.role ];
2447
- },
2448
-
2449
- _setOption: function( key, value ) {
2450
- if ( key === "icons" ) {
2451
- this.element.find( ".ui-menu-icon" )
2452
- .removeClass( this.options.icons.submenu )
2453
- .addClass( value.submenu );
2454
- }
2455
- if ( key === "disabled" ) {
2456
- this.element
2457
- .toggleClass( "ui-state-disabled", !!value )
2458
- .attr( "aria-disabled", value );
2459
- }
2460
- this._super( key, value );
2461
- },
2462
-
2463
- focus: function( event, item ) {
2464
- var nested, focused;
2465
- this.blur( event, event && event.type === "focus" );
2466
-
2467
- this._scrollIntoView( item );
2468
-
2469
- this.active = item.first();
2470
- focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
2471
- // Only update aria-activedescendant if there's a role
2472
- // otherwise we assume focus is managed elsewhere
2473
- if ( this.options.role ) {
2474
- this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
2475
- }
2476
-
2477
- // Highlight active parent menu item, if any
2478
- this.active
2479
- .parent()
2480
- .closest( ".ui-menu-item" )
2481
- .addClass( "ui-state-active" );
2482
-
2483
- if ( event && event.type === "keydown" ) {
2484
- this._close();
2485
- } else {
2486
- this.timer = this._delay(function() {
2487
- this._close();
2488
- }, this.delay );
2489
- }
2490
-
2491
- nested = item.children( ".ui-menu" );
2492
- if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
2493
- this._startOpening(nested);
2494
- }
2495
- this.activeMenu = item.parent();
2496
-
2497
- this._trigger( "focus", event, { item: item } );
2498
- },
2499
-
2500
- _scrollIntoView: function( item ) {
2501
- var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
2502
- if ( this._hasScroll() ) {
2503
- borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
2504
- paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
2505
- offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
2506
- scroll = this.activeMenu.scrollTop();
2507
- elementHeight = this.activeMenu.height();
2508
- itemHeight = item.outerHeight();
2509
-
2510
- if ( offset < 0 ) {
2511
- this.activeMenu.scrollTop( scroll + offset );
2512
- } else if ( offset + itemHeight > elementHeight ) {
2513
- this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
2514
- }
2515
- }
2516
- },
2517
-
2518
- blur: function( event, fromFocus ) {
2519
- if ( !fromFocus ) {
2520
- clearTimeout( this.timer );
2521
- }
2522
-
2523
- if ( !this.active ) {
2524
- return;
2525
- }
2526
-
2527
- this.active.removeClass( "ui-state-focus" );
2528
- this.active = null;
2529
-
2530
- this._trigger( "blur", event, { item: this.active } );
2531
- },
2532
-
2533
- _startOpening: function( submenu ) {
2534
- clearTimeout( this.timer );
2535
-
2536
- // Don't open if already open fixes a Firefox bug that caused a .5 pixel
2537
- // shift in the submenu position when mousing over the carat icon
2538
- if ( submenu.attr( "aria-hidden" ) !== "true" ) {
2539
- return;
2540
- }
2541
-
2542
- this.timer = this._delay(function() {
2543
- this._close();
2544
- this._open( submenu );
2545
- }, this.delay );
2546
- },
2547
-
2548
- _open: function( submenu ) {
2549
- var position = $.extend({
2550
- of: this.active
2551
- }, this.options.position );
2552
-
2553
- clearTimeout( this.timer );
2554
- this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
2555
- .hide()
2556
- .attr( "aria-hidden", "true" );
2557
-
2558
- submenu
2559
- .show()
2560
- .removeAttr( "aria-hidden" )
2561
- .attr( "aria-expanded", "true" )
2562
- .position( position );
2563
- },
2564
-
2565
- collapseAll: function( event, all ) {
2566
- clearTimeout( this.timer );
2567
- this.timer = this._delay(function() {
2568
- // If we were passed an event, look for the submenu that contains the event
2569
- var currentMenu = all ? this.element :
2570
- $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
2571
-
2572
- // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
2573
- if ( !currentMenu.length ) {
2574
- currentMenu = this.element;
2575
- }
2576
-
2577
- this._close( currentMenu );
2578
-
2579
- this.blur( event );
2580
- this.activeMenu = currentMenu;
2581
- }, this.delay );
2582
- },
2583
-
2584
- // With no arguments, closes the currently active menu - if nothing is active
2585
- // it closes all menus. If passed an argument, it will search for menus BELOW
2586
- _close: function( startMenu ) {
2587
- if ( !startMenu ) {
2588
- startMenu = this.active ? this.active.parent() : this.element;
2589
- }
2590
-
2591
- startMenu
2592
- .find( ".ui-menu" )
2593
- .hide()
2594
- .attr( "aria-hidden", "true" )
2595
- .attr( "aria-expanded", "false" )
2596
- .end()
2597
- .find( ".ui-state-active" ).not( ".ui-state-focus" )
2598
- .removeClass( "ui-state-active" );
2599
- },
2600
-
2601
- _closeOnDocumentClick: function( event ) {
2602
- return !$( event.target ).closest( ".ui-menu" ).length;
2603
- },
2604
-
2605
- _isDivider: function( item ) {
2606
-
2607
- // Match hyphen, em dash, en dash
2608
- return !/[^\-\u2014\u2013\s]/.test( item.text() );
2609
- },
2610
-
2611
- collapse: function( event ) {
2612
- var newItem = this.active &&
2613
- this.active.parent().closest( ".ui-menu-item", this.element );
2614
- if ( newItem && newItem.length ) {
2615
- this._close();
2616
- this.focus( event, newItem );
2617
- }
2618
- },
2619
-
2620
- expand: function( event ) {
2621
- var newItem = this.active &&
2622
- this.active
2623
- .children( ".ui-menu " )
2624
- .find( this.options.items )
2625
- .first();
2626
-
2627
- if ( newItem && newItem.length ) {
2628
- this._open( newItem.parent() );
2629
-
2630
- // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
2631
- this._delay(function() {
2632
- this.focus( event, newItem );
2633
- });
2634
- }
2635
- },
2636
-
2637
- next: function( event ) {
2638
- this._move( "next", "first", event );
2639
- },
2640
-
2641
- previous: function( event ) {
2642
- this._move( "prev", "last", event );
2643
- },
2644
-
2645
- isFirstItem: function() {
2646
- return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
2647
- },
2648
-
2649
- isLastItem: function() {
2650
- return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
2651
- },
2652
-
2653
- _move: function( direction, filter, event ) {
2654
- var next;
2655
- if ( this.active ) {
2656
- if ( direction === "first" || direction === "last" ) {
2657
- next = this.active
2658
- [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
2659
- .eq( -1 );
2660
- } else {
2661
- next = this.active
2662
- [ direction + "All" ]( ".ui-menu-item" )
2663
- .eq( 0 );
2664
- }
2665
- }
2666
- if ( !next || !next.length || !this.active ) {
2667
- next = this.activeMenu.find( this.options.items )[ filter ]();
2668
- }
2669
-
2670
- this.focus( event, next );
2671
- },
2672
-
2673
- nextPage: function( event ) {
2674
- var item, base, height;
2675
-
2676
- if ( !this.active ) {
2677
- this.next( event );
2678
- return;
2679
- }
2680
- if ( this.isLastItem() ) {
2681
- return;
2682
- }
2683
- if ( this._hasScroll() ) {
2684
- base = this.active.offset().top;
2685
- height = this.element.height();
2686
- this.active.nextAll( ".ui-menu-item" ).each(function() {
2687
- item = $( this );
2688
- return item.offset().top - base - height < 0;
2689
- });
2690
-
2691
- this.focus( event, item );
2692
- } else {
2693
- this.focus( event, this.activeMenu.find( this.options.items )
2694
- [ !this.active ? "first" : "last" ]() );
2695
- }
2696
- },
2697
-
2698
- previousPage: function( event ) {
2699
- var item, base, height;
2700
- if ( !this.active ) {
2701
- this.next( event );
2702
- return;
2703
- }
2704
- if ( this.isFirstItem() ) {
2705
- return;
2706
- }
2707
- if ( this._hasScroll() ) {
2708
- base = this.active.offset().top;
2709
- height = this.element.height();
2710
- this.active.prevAll( ".ui-menu-item" ).each(function() {
2711
- item = $( this );
2712
- return item.offset().top - base + height > 0;
2713
- });
2714
-
2715
- this.focus( event, item );
2716
- } else {
2717
- this.focus( event, this.activeMenu.find( this.options.items ).first() );
2718
- }
2719
- },
2720
-
2721
- _hasScroll: function() {
2722
- return this.element.outerHeight() < this.element.prop( "scrollHeight" );
2723
- },
2724
-
2725
- select: function( event ) {
2726
- // TODO: It should never be possible to not have an active item at this
2727
- // point, but the tests don't trigger mouseenter before click.
2728
- this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
2729
- var ui = { item: this.active };
2730
- if ( !this.active.has( ".ui-menu" ).length ) {
2731
- this.collapseAll( event, true );
2732
- }
2733
- this._trigger( "select", event, ui );
2734
- },
2735
-
2736
- _filterMenuItems: function(character) {
2737
- var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
2738
- regex = new RegExp( "^" + escapedCharacter, "i" );
2739
-
2740
- return this.activeMenu
2741
- .find( this.options.items )
2742
-
2743
- // Only match on items, not dividers or other content (#10571)
2744
- .filter( ".ui-menu-item" )
2745
- .filter(function() {
2746
- return regex.test( $.trim( $( this ).text() ) );
2747
- });
2748
- }
2749
- });
2750
-
2751
-
2752
- /*!
2753
- * jQuery UI Autocomplete 1.11.2
2754
- * http://jqueryui.com
2755
- *
2756
- * Copyright 2014 jQuery Foundation and other contributors
2757
- * Released under the MIT license.
2758
- * http://jquery.org/license
2759
- *
2760
- * http://api.jqueryui.com/autocomplete/
2761
- */
2762
-
2763
-
2764
- $.widget( "ui.autocomplete", {
2765
- version: "1.11.2",
2766
- defaultElement: "<input>",
2767
- options: {
2768
- appendTo: null,
2769
- autoFocus: false,
2770
- delay: 300,
2771
- minLength: 1,
2772
- position: {
2773
- my: "left top",
2774
- at: "left bottom",
2775
- collision: "none"
2776
- },
2777
- source: null,
2778
-
2779
- // callbacks
2780
- change: null,
2781
- close: null,
2782
- focus: null,
2783
- open: null,
2784
- response: null,
2785
- search: null,
2786
- select: null
2787
- },
2788
-
2789
- requestIndex: 0,
2790
- pending: 0,
2791
-
2792
- _create: function() {
2793
- // Some browsers only repeat keydown events, not keypress events,
2794
- // so we use the suppressKeyPress flag to determine if we've already
2795
- // handled the keydown event. #7269
2796
- // Unfortunately the code for & in keypress is the same as the up arrow,
2797
- // so we use the suppressKeyPressRepeat flag to avoid handling keypress
2798
- // events when we know the keydown event was used to modify the
2799
- // search term. #7799
2800
- var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
2801
- nodeName = this.element[ 0 ].nodeName.toLowerCase(),
2802
- isTextarea = nodeName === "textarea",
2803
- isInput = nodeName === "input";
2804
-
2805
- this.isMultiLine =
2806
- // Textareas are always multi-line
2807
- isTextarea ? true :
2808
- // Inputs are always single-line, even if inside a contentEditable element
2809
- // IE also treats inputs as contentEditable
2810
- isInput ? false :
2811
- // All other element types are determined by whether or not they're contentEditable
2812
- this.element.prop( "isContentEditable" );
2813
-
2814
- this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
2815
- this.isNewMenu = true;
2816
-
2817
- this.element
2818
- .addClass( "ui-autocomplete-input" )
2819
- .attr( "autocomplete", "off" );
2820
-
2821
- this._on( this.element, {
2822
- keydown: function( event ) {
2823
- if ( this.element.prop( "readOnly" ) ) {
2824
- suppressKeyPress = true;
2825
- suppressInput = true;
2826
- suppressKeyPressRepeat = true;
2827
- return;
2828
- }
2829
-
2830
- suppressKeyPress = false;
2831
- suppressInput = false;
2832
- suppressKeyPressRepeat = false;
2833
- var keyCode = $.ui.keyCode;
2834
- switch ( event.keyCode ) {
2835
- case keyCode.PAGE_UP:
2836
- suppressKeyPress = true;
2837
- this._move( "previousPage", event );
2838
- break;
2839
- case keyCode.PAGE_DOWN:
2840
- suppressKeyPress = true;
2841
- this._move( "nextPage", event );
2842
- break;
2843
- case keyCode.UP:
2844
- suppressKeyPress = true;
2845
- this._keyEvent( "previous", event );
2846
- break;
2847
- case keyCode.DOWN:
2848
- suppressKeyPress = true;
2849
- this._keyEvent( "next", event );
2850
- break;
2851
- case keyCode.ENTER:
2852
- // when menu is open and has focus
2853
- if ( this.menu.active ) {
2854
- // #6055 - Opera still allows the keypress to occur
2855
- // which causes forms to submit
2856
- suppressKeyPress = true;
2857
- event.preventDefault();
2858
- this.menu.select( event );
2859
- }
2860
- break;
2861
- case keyCode.TAB:
2862
- if ( this.menu.active ) {
2863
- this.menu.select( event );
2864
- }
2865
- break;
2866
- case keyCode.ESCAPE:
2867
- if ( this.menu.element.is( ":visible" ) ) {
2868
- if ( !this.isMultiLine ) {
2869
- this._value( this.term );
2870
- }
2871
- this.close( event );
2872
- // Different browsers have different default behavior for escape
2873
- // Single press can mean undo or clear
2874
- // Double press in IE means clear the whole form
2875
- event.preventDefault();
2876
- }
2877
- break;
2878
- default:
2879
- suppressKeyPressRepeat = true;
2880
- // search timeout should be triggered before the input value is changed
2881
- this._searchTimeout( event );
2882
- break;
2883
- }
2884
- },
2885
- keypress: function( event ) {
2886
- if ( suppressKeyPress ) {
2887
- suppressKeyPress = false;
2888
- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
2889
- event.preventDefault();
2890
- }
2891
- return;
2892
- }
2893
- if ( suppressKeyPressRepeat ) {
2894
- return;
2895
- }
2896
-
2897
- // replicate some key handlers to allow them to repeat in Firefox and Opera
2898
- var keyCode = $.ui.keyCode;
2899
- switch ( event.keyCode ) {
2900
- case keyCode.PAGE_UP:
2901
- this._move( "previousPage", event );
2902
- break;
2903
- case keyCode.PAGE_DOWN:
2904
- this._move( "nextPage", event );
2905
- break;
2906
- case keyCode.UP:
2907
- this._keyEvent( "previous", event );
2908
- break;
2909
- case keyCode.DOWN:
2910
- this._keyEvent( "next", event );
2911
- break;
2912
- }
2913
- },
2914
- input: function( event ) {
2915
- if ( suppressInput ) {
2916
- suppressInput = false;
2917
- event.preventDefault();
2918
- return;
2919
- }
2920
- this._searchTimeout( event );
2921
- },
2922
- focus: function() {
2923
- this.selectedItem = null;
2924
- this.previous = this._value();
2925
- },
2926
- blur: function( event ) {
2927
- if ( this.cancelBlur ) {
2928
- delete this.cancelBlur;
2929
- return;
2930
- }
2931
-
2932
- clearTimeout( this.searching );
2933
- this.close( event );
2934
- this._change( event );
2935
- }
2936
- });
2937
-
2938
- this._initSource();
2939
- this.menu = $( "<ul>" )
2940
- .addClass( "ui-autocomplete ui-front" )
2941
- .appendTo( this._appendTo() )
2942
- .menu({
2943
- // disable ARIA support, the live region takes care of that
2944
- role: null
2945
- })
2946
- .hide()
2947
- .menu( "instance" );
2948
-
2949
- this._on( this.menu.element, {
2950
- mousedown: function( event ) {
2951
- // prevent moving focus out of the text field
2952
- event.preventDefault();
2953
-
2954
- // IE doesn't prevent moving focus even with event.preventDefault()
2955
- // so we set a flag to know when we should ignore the blur event
2956
- this.cancelBlur = true;
2957
- this._delay(function() {
2958
- delete this.cancelBlur;
2959
- });
2960
-
2961
- // clicking on the scrollbar causes focus to shift to the body
2962
- // but we can't detect a mouseup or a click immediately afterward
2963
- // so we have to track the next mousedown and close the menu if
2964
- // the user clicks somewhere outside of the autocomplete
2965
- var menuElement = this.menu.element[ 0 ];
2966
- if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
2967
- this._delay(function() {
2968
- var that = this;
2969
- this.document.one( "mousedown", function( event ) {
2970
- if ( event.target !== that.element[ 0 ] &&
2971
- event.target !== menuElement &&
2972
- !$.contains( menuElement, event.target ) ) {
2973
- that.close();
2974
- }
2975
- });
2976
- });
2977
- }
2978
- },
2979
- menufocus: function( event, ui ) {
2980
- var label, item;
2981
- // support: Firefox
2982
- // Prevent accidental activation of menu items in Firefox (#7024 #9118)
2983
- if ( this.isNewMenu ) {
2984
- this.isNewMenu = false;
2985
- if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
2986
- this.menu.blur();
2987
-
2988
- this.document.one( "mousemove", function() {
2989
- $( event.target ).trigger( event.originalEvent );
2990
- });
2991
-
2992
- return;
2993
- }
2994
- }
2995
-
2996
- item = ui.item.data( "ui-autocomplete-item" );
2997
- if ( false !== this._trigger( "focus", event, { item: item } ) ) {
2998
- // use value to match what will end up in the input, if it was a key event
2999
- if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
3000
- this._value( item.value );
3001
- }
3002
- }
3003
-
3004
- // Announce the value in the liveRegion
3005
- label = ui.item.attr( "aria-label" ) || item.value;
3006
- if ( label && $.trim( label ).length ) {
3007
- this.liveRegion.children().hide();
3008
- $( "<div>" ).text( label ).appendTo( this.liveRegion );
3009
- }
3010
- },
3011
- menuselect: function( event, ui ) {
3012
- var item = ui.item.data( "ui-autocomplete-item" ),
3013
- previous = this.previous;
3014
-
3015
- // only trigger when focus was lost (click on menu)
3016
- if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
3017
- this.element.focus();
3018
- this.previous = previous;
3019
- // #6109 - IE triggers two focus events and the second
3020
- // is asynchronous, so we need to reset the previous
3021
- // term synchronously and asynchronously :-(
3022
- this._delay(function() {
3023
- this.previous = previous;
3024
- this.selectedItem = item;
3025
- });
3026
- }
3027
-
3028
- if ( false !== this._trigger( "select", event, { item: item } ) ) {
3029
- this._value( item.value );
3030
- }
3031
- // reset the term after the select event
3032
- // this allows custom select handling to work properly
3033
- this.term = this._value();
3034
-
3035
- this.close( event );
3036
- this.selectedItem = item;
3037
- }
3038
- });
3039
-
3040
- this.liveRegion = $( "<span>", {
3041
- role: "status",
3042
- "aria-live": "assertive",
3043
- "aria-relevant": "additions"
3044
- })
3045
- .addClass( "ui-helper-hidden-accessible" )
3046
- .appendTo( this.document[ 0 ].body );
3047
-
3048
- // turning off autocomplete prevents the browser from remembering the
3049
- // value when navigating through history, so we re-enable autocomplete
3050
- // if the page is unloaded before the widget is destroyed. #7790
3051
- this._on( this.window, {
3052
- beforeunload: function() {
3053
- this.element.removeAttr( "autocomplete" );
3054
- }
3055
- });
3056
- },
3057
-
3058
- _destroy: function() {
3059
- clearTimeout( this.searching );
3060
- this.element
3061
- .removeClass( "ui-autocomplete-input" )
3062
- .removeAttr( "autocomplete" );
3063
- this.menu.element.remove();
3064
- this.liveRegion.remove();
3065
- },
3066
-
3067
- _setOption: function( key, value ) {
3068
- this._super( key, value );
3069
- if ( key === "source" ) {
3070
- this._initSource();
3071
- }
3072
- if ( key === "appendTo" ) {
3073
- this.menu.element.appendTo( this._appendTo() );
3074
- }
3075
- if ( key === "disabled" && value && this.xhr ) {
3076
- this.xhr.abort();
3077
- }
3078
- },
3079
-
3080
- _appendTo: function() {
3081
- var element = this.options.appendTo;
3082
-
3083
- if ( element ) {
3084
- element = element.jquery || element.nodeType ?
3085
- $( element ) :
3086
- this.document.find( element ).eq( 0 );
3087
- }
3088
-
3089
- if ( !element || !element[ 0 ] ) {
3090
- element = this.element.closest( ".ui-front" );
3091
- }
3092
-
3093
- if ( !element.length ) {
3094
- element = this.document[ 0 ].body;
3095
- }
3096
-
3097
- return element;
3098
- },
3099
-
3100
- _initSource: function() {
3101
- var array, url,
3102
- that = this;
3103
- if ( $.isArray( this.options.source ) ) {
3104
- array = this.options.source;
3105
- this.source = function( request, response ) {
3106
- response( $.ui.autocomplete.filter( array, request.term ) );
3107
- };
3108
- } else if ( typeof this.options.source === "string" ) {
3109
- url = this.options.source;
3110
- this.source = function( request, response ) {
3111
- if ( that.xhr ) {
3112
- that.xhr.abort();
3113
- }
3114
- that.xhr = $.ajax({
3115
- url: url,
3116
- data: request,
3117
- dataType: "json",
3118
- success: function( data ) {
3119
- response( data );
3120
- },
3121
- error: function() {
3122
- response([]);
3123
- }
3124
- });
3125
- };
3126
- } else {
3127
- this.source = this.options.source;
3128
- }
3129
- },
3130
-
3131
- _searchTimeout: function( event ) {
3132
- clearTimeout( this.searching );
3133
- this.searching = this._delay(function() {
3134
-
3135
- // Search if the value has changed, or if the user retypes the same value (see #7434)
3136
- var equalValues = this.term === this._value(),
3137
- menuVisible = this.menu.element.is( ":visible" ),
3138
- modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
3139
-
3140
- if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
3141
- this.selectedItem = null;
3142
- this.search( null, event );
3143
- }
3144
- }, this.options.delay );
3145
- },
3146
-
3147
- search: function( value, event ) {
3148
- value = value != null ? value : this._value();
3149
-
3150
- // always save the actual value, not the one passed as an argument
3151
- this.term = this._value();
3152
-
3153
- if ( value.length < this.options.minLength ) {
3154
- return this.close( event );
3155
- }
3156
-
3157
- if ( this._trigger( "search", event ) === false ) {
3158
- return;
3159
- }
3160
-
3161
- return this._search( value );
3162
- },
3163
-
3164
- _search: function( value ) {
3165
- this.pending++;
3166
- this.element.addClass( "ui-autocomplete-loading" );
3167
- this.cancelSearch = false;
3168
-
3169
- this.source( { term: value }, this._response() );
3170
- },
3171
-
3172
- _response: function() {
3173
- var index = ++this.requestIndex;
3174
-
3175
- return $.proxy(function( content ) {
3176
- if ( index === this.requestIndex ) {
3177
- this.__response( content );
3178
- }
3179
-
3180
- this.pending--;
3181
- if ( !this.pending ) {
3182
- this.element.removeClass( "ui-autocomplete-loading" );
3183
- }
3184
- }, this );
3185
- },
3186
-
3187
- __response: function( content ) {
3188
- if ( content ) {
3189
- content = this._normalize( content );
3190
- }
3191
- this._trigger( "response", null, { content: content } );
3192
- if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
3193
- this._suggest( content );
3194
- this._trigger( "open" );
3195
- } else {
3196
- // use ._close() instead of .close() so we don't cancel future searches
3197
- this._close();
3198
- }
3199
- },
3200
-
3201
- close: function( event ) {
3202
- this.cancelSearch = true;
3203
- this._close( event );
3204
- },
3205
-
3206
- _close: function( event ) {
3207
- if ( this.menu.element.is( ":visible" ) ) {
3208
- this.menu.element.hide();
3209
- this.menu.blur();
3210
- this.isNewMenu = true;
3211
- this._trigger( "close", event );
3212
- }
3213
- },
3214
-
3215
- _change: function( event ) {
3216
- if ( this.previous !== this._value() ) {
3217
- this._trigger( "change", event, { item: this.selectedItem } );
3218
- }
3219
- },
3220
-
3221
- _normalize: function( items ) {
3222
- // assume all items have the right format when the first item is complete
3223
- if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
3224
- return items;
3225
- }
3226
- return $.map( items, function( item ) {
3227
- if ( typeof item === "string" ) {
3228
- return {
3229
- label: item,
3230
- value: item
3231
- };
3232
- }
3233
- return $.extend( {}, item, {
3234
- label: item.label || item.value,
3235
- value: item.value || item.label
3236
- });
3237
- });
3238
- },
3239
-
3240
- _suggest: function( items ) {
3241
- var ul = this.menu.element.empty();
3242
- this._renderMenu( ul, items );
3243
- this.isNewMenu = true;
3244
- this.menu.refresh();
3245
-
3246
- // size and position menu
3247
- ul.show();
3248
- this._resizeMenu();
3249
- ul.position( $.extend({
3250
- of: this.element
3251
- }, this.options.position ) );
3252
-
3253
- if ( this.options.autoFocus ) {
3254
- this.menu.next();
3255
- }
3256
- },
3257
-
3258
- _resizeMenu: function() {
3259
- var ul = this.menu.element;
3260
- ul.outerWidth( Math.max(
3261
- // Firefox wraps long text (possibly a rounding bug)
3262
- // so we add 1px to avoid the wrapping (#7513)
3263
- ul.width( "" ).outerWidth() + 1,
3264
- this.element.outerWidth()
3265
- ) );
3266
- },
3267
-
3268
- _renderMenu: function( ul, items ) {
3269
- var that = this;
3270
- $.each( items, function( index, item ) {
3271
- that._renderItemData( ul, item );
3272
- });
3273
- },
3274
-
3275
- _renderItemData: function( ul, item ) {
3276
- return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
3277
- },
3278
-
3279
- _renderItem: function( ul, item ) {
3280
- return $( "<li>" ).text( item.label ).appendTo( ul );
3281
- },
3282
-
3283
- _move: function( direction, event ) {
3284
- if ( !this.menu.element.is( ":visible" ) ) {
3285
- this.search( null, event );
3286
- return;
3287
- }
3288
- if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
3289
- this.menu.isLastItem() && /^next/.test( direction ) ) {
3290
-
3291
- if ( !this.isMultiLine ) {
3292
- this._value( this.term );
3293
- }
3294
-
3295
- this.menu.blur();
3296
- return;
3297
- }
3298
- this.menu[ direction ]( event );
3299
- },
3300
-
3301
- widget: function() {
3302
- return this.menu.element;
3303
- },
3304
-
3305
- _value: function() {
3306
- return this.valueMethod.apply( this.element, arguments );
3307
- },
3308
-
3309
- _keyEvent: function( keyEvent, event ) {
3310
- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
3311
- this._move( keyEvent, event );
3312
-
3313
- // prevents moving cursor to beginning/end of the text field in some browsers
3314
- event.preventDefault();
3315
- }
3316
- }
3317
- });
3318
-
3319
- $.extend( $.ui.autocomplete, {
3320
- escapeRegex: function( value ) {
3321
- return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
3322
- },
3323
- filter: function( array, term ) {
3324
- var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
3325
- return $.grep( array, function( value ) {
3326
- return matcher.test( value.label || value.value || value );
3327
- });
3328
- }
3329
- });
3330
-
3331
- // live region extension, adding a `messages` option
3332
- // NOTE: This is an experimental API. We are still investigating
3333
- // a full solution for string manipulation and internationalization.
3334
- $.widget( "ui.autocomplete", $.ui.autocomplete, {
3335
- options: {
3336
- messages: {
3337
- noResults: "No search results.",
3338
- results: function( amount ) {
3339
- return amount + ( amount > 1 ? " results are" : " result is" ) +
3340
- " available, use up and down arrow keys to navigate.";
3341
- }
3342
- }
3343
- },
3344
-
3345
- __response: function( content ) {
3346
- var message;
3347
- this._superApply( arguments );
3348
- if ( this.options.disabled || this.cancelSearch ) {
3349
- return;
3350
- }
3351
- if ( content && content.length ) {
3352
- message = this.options.messages.results( content.length );
3353
- } else {
3354
- message = this.options.messages.noResults;
3355
- }
3356
- this.liveRegion.children().hide();
3357
- $( "<div>" ).text( message ).appendTo( this.liveRegion );
3358
- }
3359
- });
3360
-
3361
- var autocomplete = $.ui.autocomplete;
3362
-
3363
-
3364
- /*!
3365
- * jQuery UI Button 1.11.2
3366
- * http://jqueryui.com
3367
- *
3368
- * Copyright 2014 jQuery Foundation and other contributors
3369
- * Released under the MIT license.
3370
- * http://jquery.org/license
3371
- *
3372
- * http://api.jqueryui.com/button/
3373
- */
3374
-
3375
-
3376
- var lastActive,
3377
- baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
3378
- 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",
3379
- formResetHandler = function() {
3380
- var form = $( this );
3381
- setTimeout(function() {
3382
- form.find( ":ui-button" ).button( "refresh" );
3383
- }, 1 );
3384
- },
3385
- radioGroup = function( radio ) {
3386
- var name = radio.name,
3387
- form = radio.form,
3388
- radios = $( [] );
3389
- if ( name ) {
3390
- name = name.replace( /'/g, "\\'" );
3391
- if ( form ) {
3392
- radios = $( form ).find( "[name='" + name + "'][type=radio]" );
3393
- } else {
3394
- radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
3395
- .filter(function() {
3396
- return !this.form;
3397
- });
3398
- }
3399
- }
3400
- return radios;
3401
- };
3402
-
3403
- $.widget( "ui.button", {
3404
- version: "1.11.2",
3405
- defaultElement: "<button>",
3406
- options: {
3407
- disabled: null,
3408
- text: true,
3409
- label: null,
3410
- icons: {
3411
- primary: null,
3412
- secondary: null
3413
- }
3414
- },
3415
- _create: function() {
3416
- this.element.closest( "form" )
3417
- .unbind( "reset" + this.eventNamespace )
3418
- .bind( "reset" + this.eventNamespace, formResetHandler );
3419
-
3420
- if ( typeof this.options.disabled !== "boolean" ) {
3421
- this.options.disabled = !!this.element.prop( "disabled" );
3422
- } else {
3423
- this.element.prop( "disabled", this.options.disabled );
3424
- }
3425
-
3426
- this._determineButtonType();
3427
- this.hasTitle = !!this.buttonElement.attr( "title" );
3428
-
3429
- var that = this,
3430
- options = this.options,
3431
- toggleButton = this.type === "checkbox" || this.type === "radio",
3432
- activeClass = !toggleButton ? "ui-state-active" : "";
3433
-
3434
- if ( options.label === null ) {
3435
- options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
3436
- }
3437
-
3438
- this._hoverable( this.buttonElement );
3439
-
3440
- this.buttonElement
3441
- .addClass( baseClasses )
3442
- .attr( "role", "button" )
3443
- .bind( "mouseenter" + this.eventNamespace, function() {
3444
- if ( options.disabled ) {
3445
- return;
3446
- }
3447
- if ( this === lastActive ) {
3448
- $( this ).addClass( "ui-state-active" );
3449
- }
3450
- })
3451
- .bind( "mouseleave" + this.eventNamespace, function() {
3452
- if ( options.disabled ) {
3453
- return;
3454
- }
3455
- $( this ).removeClass( activeClass );
3456
- })
3457
- .bind( "click" + this.eventNamespace, function( event ) {
3458
- if ( options.disabled ) {
3459
- event.preventDefault();
3460
- event.stopImmediatePropagation();
3461
- }
3462
- });
3463
-
3464
- // Can't use _focusable() because the element that receives focus
3465
- // and the element that gets the ui-state-focus class are different
3466
- this._on({
3467
- focus: function() {
3468
- this.buttonElement.addClass( "ui-state-focus" );
3469
- },
3470
- blur: function() {
3471
- this.buttonElement.removeClass( "ui-state-focus" );
3472
- }
3473
- });
3474
-
3475
- if ( toggleButton ) {
3476
- this.element.bind( "change" + this.eventNamespace, function() {
3477
- that.refresh();
3478
- });
3479
- }
3480
-
3481
- if ( this.type === "checkbox" ) {
3482
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
3483
- if ( options.disabled ) {
3484
- return false;
3485
- }
3486
- });
3487
- } else if ( this.type === "radio" ) {
3488
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
3489
- if ( options.disabled ) {
3490
- return false;
3491
- }
3492
- $( this ).addClass( "ui-state-active" );
3493
- that.buttonElement.attr( "aria-pressed", "true" );
3494
-
3495
- var radio = that.element[ 0 ];
3496
- radioGroup( radio )
3497
- .not( radio )
3498
- .map(function() {
3499
- return $( this ).button( "widget" )[ 0 ];
3500
- })
3501
- .removeClass( "ui-state-active" )
3502
- .attr( "aria-pressed", "false" );
3503
- });
3504
- } else {
3505
- this.buttonElement
3506
- .bind( "mousedown" + this.eventNamespace, function() {
3507
- if ( options.disabled ) {
3508
- return false;
3509
- }
3510
- $( this ).addClass( "ui-state-active" );
3511
- lastActive = this;
3512
- that.document.one( "mouseup", function() {
3513
- lastActive = null;
3514
- });
3515
- })
3516
- .bind( "mouseup" + this.eventNamespace, function() {
3517
- if ( options.disabled ) {
3518
- return false;
3519
- }
3520
- $( this ).removeClass( "ui-state-active" );
3521
- })
3522
- .bind( "keydown" + this.eventNamespace, function(event) {
3523
- if ( options.disabled ) {
3524
- return false;
3525
- }
3526
- if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
3527
- $( this ).addClass( "ui-state-active" );
3528
- }
3529
- })
3530
- // see #8559, we bind to blur here in case the button element loses
3531
- // focus between keydown and keyup, it would be left in an "active" state
3532
- .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
3533
- $( this ).removeClass( "ui-state-active" );
3534
- });
3535
-
3536
- if ( this.buttonElement.is("a") ) {
3537
- this.buttonElement.keyup(function(event) {
3538
- if ( event.keyCode === $.ui.keyCode.SPACE ) {
3539
- // TODO pass through original event correctly (just as 2nd argument doesn't work)
3540
- $( this ).click();
3541
- }
3542
- });
3543
- }
3544
- }
3545
-
3546
- this._setOption( "disabled", options.disabled );
3547
- this._resetButton();
3548
- },
3549
-
3550
- _determineButtonType: function() {
3551
- var ancestor, labelSelector, checked;
3552
-
3553
- if ( this.element.is("[type=checkbox]") ) {
3554
- this.type = "checkbox";
3555
- } else if ( this.element.is("[type=radio]") ) {
3556
- this.type = "radio";
3557
- } else if ( this.element.is("input") ) {
3558
- this.type = "input";
3559
- } else {
3560
- this.type = "button";
3561
- }
3562
-
3563
- if ( this.type === "checkbox" || this.type === "radio" ) {
3564
- // we don't search against the document in case the element
3565
- // is disconnected from the DOM
3566
- ancestor = this.element.parents().last();
3567
- labelSelector = "label[for='" + this.element.attr("id") + "']";
3568
- this.buttonElement = ancestor.find( labelSelector );
3569
- if ( !this.buttonElement.length ) {
3570
- ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
3571
- this.buttonElement = ancestor.filter( labelSelector );
3572
- if ( !this.buttonElement.length ) {
3573
- this.buttonElement = ancestor.find( labelSelector );
3574
- }
3575
- }
3576
- this.element.addClass( "ui-helper-hidden-accessible" );
3577
-
3578
- checked = this.element.is( ":checked" );
3579
- if ( checked ) {
3580
- this.buttonElement.addClass( "ui-state-active" );
3581
- }
3582
- this.buttonElement.prop( "aria-pressed", checked );
3583
- } else {
3584
- this.buttonElement = this.element;
3585
- }
3586
- },
3587
-
3588
- widget: function() {
3589
- return this.buttonElement;
3590
- },
3591
-
3592
- _destroy: function() {
3593
- this.element
3594
- .removeClass( "ui-helper-hidden-accessible" );
3595
- this.buttonElement
3596
- .removeClass( baseClasses + " ui-state-active " + typeClasses )
3597
- .removeAttr( "role" )
3598
- .removeAttr( "aria-pressed" )
3599
- .html( this.buttonElement.find(".ui-button-text").html() );
3600
-
3601
- if ( !this.hasTitle ) {
3602
- this.buttonElement.removeAttr( "title" );
3603
- }
3604
- },
3605
-
3606
- _setOption: function( key, value ) {
3607
- this._super( key, value );
3608
- if ( key === "disabled" ) {
3609
- this.widget().toggleClass( "ui-state-disabled", !!value );
3610
- this.element.prop( "disabled", !!value );
3611
- if ( value ) {
3612
- if ( this.type === "checkbox" || this.type === "radio" ) {
3613
- this.buttonElement.removeClass( "ui-state-focus" );
3614
- } else {
3615
- this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
3616
- }
3617
- }
3618
- return;
3619
- }
3620
- this._resetButton();
3621
- },
3622
-
3623
- refresh: function() {
3624
- //See #8237 & #8828
3625
- var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
3626
-
3627
- if ( isDisabled !== this.options.disabled ) {
3628
- this._setOption( "disabled", isDisabled );
3629
- }
3630
- if ( this.type === "radio" ) {
3631
- radioGroup( this.element[0] ).each(function() {
3632
- if ( $( this ).is( ":checked" ) ) {
3633
- $( this ).button( "widget" )
3634
- .addClass( "ui-state-active" )
3635
- .attr( "aria-pressed", "true" );
3636
- } else {
3637
- $( this ).button( "widget" )
3638
- .removeClass( "ui-state-active" )
3639
- .attr( "aria-pressed", "false" );
3640
- }
3641
- });
3642
- } else if ( this.type === "checkbox" ) {
3643
- if ( this.element.is( ":checked" ) ) {
3644
- this.buttonElement
3645
- .addClass( "ui-state-active" )
3646
- .attr( "aria-pressed", "true" );
3647
- } else {
3648
- this.buttonElement
3649
- .removeClass( "ui-state-active" )
3650
- .attr( "aria-pressed", "false" );
3651
- }
3652
- }
3653
- },
3654
-
3655
- _resetButton: function() {
3656
- if ( this.type === "input" ) {
3657
- if ( this.options.label ) {
3658
- this.element.val( this.options.label );
3659
- }
3660
- return;
3661
- }
3662
- var buttonElement = this.buttonElement.removeClass( typeClasses ),
3663
- buttonText = $( "<span></span>", this.document[0] )
3664
- .addClass( "ui-button-text" )
3665
- .html( this.options.label )
3666
- .appendTo( buttonElement.empty() )
3667
- .text(),
3668
- icons = this.options.icons,
3669
- multipleIcons = icons.primary && icons.secondary,
3670
- buttonClasses = [];
3671
-
3672
- if ( icons.primary || icons.secondary ) {
3673
- if ( this.options.text ) {
3674
- buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
3675
- }
3676
-
3677
- if ( icons.primary ) {
3678
- buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
3679
- }
3680
-
3681
- if ( icons.secondary ) {
3682
- buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
3683
- }
3684
-
3685
- if ( !this.options.text ) {
3686
- buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
3687
-
3688
- if ( !this.hasTitle ) {
3689
- buttonElement.attr( "title", $.trim( buttonText ) );
3690
- }
3691
- }
3692
- } else {
3693
- buttonClasses.push( "ui-button-text-only" );
3694
- }
3695
- buttonElement.addClass( buttonClasses.join( " " ) );
3696
- }
3697
- });
3698
-
3699
- $.widget( "ui.buttonset", {
3700
- version: "1.11.2",
3701
- options: {
3702
- items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
3703
- },
3704
-
3705
- _create: function() {
3706
- this.element.addClass( "ui-buttonset" );
3707
- },
3708
-
3709
- _init: function() {
3710
- this.refresh();
3711
- },
3712
-
3713
- _setOption: function( key, value ) {
3714
- if ( key === "disabled" ) {
3715
- this.buttons.button( "option", key, value );
3716
- }
3717
-
3718
- this._super( key, value );
3719
- },
3720
-
3721
- refresh: function() {
3722
- var rtl = this.element.css( "direction" ) === "rtl",
3723
- allButtons = this.element.find( this.options.items ),
3724
- existingButtons = allButtons.filter( ":ui-button" );
3725
-
3726
- // Initialize new buttons
3727
- allButtons.not( ":ui-button" ).button();
3728
-
3729
- // Refresh existing buttons
3730
- existingButtons.button( "refresh" );
3731
-
3732
- this.buttons = allButtons
3733
- .map(function() {
3734
- return $( this ).button( "widget" )[ 0 ];
3735
- })
3736
- .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
3737
- .filter( ":first" )
3738
- .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
3739
- .end()
3740
- .filter( ":last" )
3741
- .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
3742
- .end()
3743
- .end();
3744
- },
3745
-
3746
- _destroy: function() {
3747
- this.element.removeClass( "ui-buttonset" );
3748
- this.buttons
3749
- .map(function() {
3750
- return $( this ).button( "widget" )[ 0 ];
3751
- })
3752
- .removeClass( "ui-corner-left ui-corner-right" )
3753
- .end()
3754
- .button( "destroy" );
3755
- }
3756
- });
3757
-
3758
- var button = $.ui.button;
3759
-
3760
-
3761
- /*!
3762
- * jQuery UI Datepicker 1.11.2
3763
- * http://jqueryui.com
3764
- *
3765
- * Copyright 2014 jQuery Foundation and other contributors
3766
- * Released under the MIT license.
3767
- * http://jquery.org/license
3768
- *
3769
- * http://api.jqueryui.com/datepicker/
3770
- */
3771
-
3772
-
3773
- $.extend($.ui, { datepicker: { version: "1.11.2" } });
3774
-
3775
- var datepicker_instActive;
3776
-
3777
- function datepicker_getZindex( elem ) {
3778
- var position, value;
3779
- while ( elem.length && elem[ 0 ] !== document ) {
3780
- // Ignore z-index if position is set to a value where z-index is ignored by the browser
3781
- // This makes behavior of this function consistent across browsers
3782
- // WebKit always returns auto if the element is positioned
3783
- position = elem.css( "position" );
3784
- if ( position === "absolute" || position === "relative" || position === "fixed" ) {
3785
- // IE returns 0 when zIndex is not specified
3786
- // other browsers return a string
3787
- // we ignore the case of nested elements with an explicit value of 0
3788
- // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
3789
- value = parseInt( elem.css( "zIndex" ), 10 );
3790
- if ( !isNaN( value ) && value !== 0 ) {
3791
- return value;
3792
- }
3793
- }
3794
- elem = elem.parent();
3795
- }
3796
-
3797
- return 0;
3798
- }
3799
- /* Date picker manager.
3800
- Use the singleton instance of this class, $.datepicker, to interact with the date picker.
3801
- Settings for (groups of) date pickers are maintained in an instance object,
3802
- allowing multiple different settings on the same page. */
3803
-
3804
- function Datepicker() {
3805
- this._curInst = null; // The current instance in use
3806
- this._keyEvent = false; // If the last event was a key event
3807
- this._disabledInputs = []; // List of date picker inputs that have been disabled
3808
- this._datepickerShowing = false; // True if the popup picker is showing , false if not
3809
- this._inDialog = false; // True if showing within a "dialog", false if not
3810
- this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
3811
- this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
3812
- this._appendClass = "ui-datepicker-append"; // The name of the append marker class
3813
- this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
3814
- this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
3815
- this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
3816
- this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
3817
- this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
3818
- this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
3819
- this.regional = []; // Available regional settings, indexed by language code
3820
- this.regional[""] = { // Default regional settings
3821
- closeText: "Done", // Display text for close link
3822
- prevText: "Prev", // Display text for previous month link
3823
- nextText: "Next", // Display text for next month link
3824
- currentText: "Today", // Display text for current month link
3825
- monthNames: ["January","February","March","April","May","June",
3826
- "July","August","September","October","November","December"], // Names of months for drop-down and formatting
3827
- monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
3828
- dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
3829
- dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
3830
- dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
3831
- weekHeader: "Wk", // Column header for week of the year
3832
- dateFormat: "mm/dd/yy", // See format options on parseDate
3833
- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
3834
- isRTL: false, // True if right-to-left language, false if left-to-right
3835
- showMonthAfterYear: false, // True if the year select precedes month, false for month then year
3836
- yearSuffix: "" // Additional text to append to the year in the month headers
3837
- };
3838
- this._defaults = { // Global defaults for all the date picker instances
3839
- showOn: "focus", // "focus" for popup on focus,
3840
- // "button" for trigger button, or "both" for either
3841
- showAnim: "fadeIn", // Name of jQuery animation for popup
3842
- showOptions: {}, // Options for enhanced animations
3843
- defaultDate: null, // Used when field is blank: actual date,
3844
- // +/-number for offset from today, null for today
3845
- appendText: "", // Display text following the input box, e.g. showing the format
3846
- buttonText: "...", // Text for trigger button
3847
- buttonImage: "", // URL for trigger button image
3848
- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
3849
- hideIfNoPrevNext: false, // True to hide next/previous month links
3850
- // if not applicable, false to just disable them
3851
- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
3852
- gotoCurrent: false, // True if today link goes back to current selection instead
3853
- changeMonth: false, // True if month can be selected directly, false if only prev/next
3854
- changeYear: false, // True if year can be selected directly, false if only prev/next
3855
- yearRange: "c-10:c+10", // Range of years to display in drop-down,
3856
- // either relative to today's year (-nn:+nn), relative to currently displayed year
3857
- // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
3858
- showOtherMonths: false, // True to show dates in other months, false to leave blank
3859
- selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
3860
- showWeek: false, // True to show week of the year, false to not show it
3861
- calculateWeek: this.iso8601Week, // How to calculate the week of the year,
3862
- // takes a Date and returns the number of the week for it
3863
- shortYearCutoff: "+10", // Short year values < this are in the current century,
3864
- // > this are in the previous century,
3865
- // string value starting with "+" for current year + value
3866
- minDate: null, // The earliest selectable date, or null for no limit
3867
- maxDate: null, // The latest selectable date, or null for no limit
3868
- duration: "fast", // Duration of display/closure
3869
- beforeShowDay: null, // Function that takes a date and returns an array with
3870
- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
3871
- // [2] = cell title (optional), e.g. $.datepicker.noWeekends
3872
- beforeShow: null, // Function that takes an input field and
3873
- // returns a set of custom settings for the date picker
3874
- onSelect: null, // Define a callback function when a date is selected
3875
- onChangeMonthYear: null, // Define a callback function when the month or year is changed
3876
- onClose: null, // Define a callback function when the datepicker is closed
3877
- numberOfMonths: 1, // Number of months to show at a time
3878
- showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
3879
- stepMonths: 1, // Number of months to step back/forward
3880
- stepBigMonths: 12, // Number of months to step back/forward for the big links
3881
- altField: "", // Selector for an alternate field to store selected dates into
3882
- altFormat: "", // The date format to use for the alternate field
3883
- constrainInput: true, // The input is constrained by the current date format
3884
- showButtonPanel: false, // True to show button panel, false to not show it
3885
- autoSize: false, // True to size the input for the date format, false to leave as is
3886
- disabled: false // The initial disabled state
3887
- };
3888
- $.extend(this._defaults, this.regional[""]);
3889
- this.regional.en = $.extend( true, {}, this.regional[ "" ]);
3890
- this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
3891
- this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
3892
- }
3893
-
3894
- $.extend(Datepicker.prototype, {
3895
- /* Class name added to elements to indicate already configured with a date picker. */
3896
- markerClassName: "hasDatepicker",
3897
-
3898
- //Keep track of the maximum number of rows displayed (see #7043)
3899
- maxRows: 4,
3900
-
3901
- // TODO rename to "widget" when switching to widget factory
3902
- _widgetDatepicker: function() {
3903
- return this.dpDiv;
3904
- },
3905
-
3906
- /* Override the default settings for all instances of the date picker.
3907
- * @param settings object - the new settings to use as defaults (anonymous object)
3908
- * @return the manager object
3909
- */
3910
- setDefaults: function(settings) {
3911
- datepicker_extendRemove(this._defaults, settings || {});
3912
- return this;
3913
- },
3914
-
3915
- /* Attach the date picker to a jQuery selection.
3916
- * @param target element - the target input field or division or span
3917
- * @param settings object - the new settings to use for this date picker instance (anonymous)
3918
- */
3919
- _attachDatepicker: function(target, settings) {
3920
- var nodeName, inline, inst;
3921
- nodeName = target.nodeName.toLowerCase();
3922
- inline = (nodeName === "div" || nodeName === "span");
3923
- if (!target.id) {
3924
- this.uuid += 1;
3925
- target.id = "dp" + this.uuid;
3926
- }
3927
- inst = this._newInst($(target), inline);
3928
- inst.settings = $.extend({}, settings || {});
3929
- if (nodeName === "input") {
3930
- this._connectDatepicker(target, inst);
3931
- } else if (inline) {
3932
- this._inlineDatepicker(target, inst);
3933
- }
3934
- },
3935
-
3936
- /* Create a new instance object. */
3937
- _newInst: function(target, inline) {
3938
- var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
3939
- return {id: id, input: target, // associated target
3940
- selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
3941
- drawMonth: 0, drawYear: 0, // month being drawn
3942
- inline: inline, // is datepicker inline or not
3943
- dpDiv: (!inline ? this.dpDiv : // presentation div
3944
- datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
3945
- },
3946
-
3947
- /* Attach the date picker to an input field. */
3948
- _connectDatepicker: function(target, inst) {
3949
- var input = $(target);
3950
- inst.append = $([]);
3951
- inst.trigger = $([]);
3952
- if (input.hasClass(this.markerClassName)) {
3953
- return;
3954
- }
3955
- this._attachments(input, inst);
3956
- input.addClass(this.markerClassName).keydown(this._doKeyDown).
3957
- keypress(this._doKeyPress).keyup(this._doKeyUp);
3958
- this._autoSize(inst);
3959
- $.data(target, "datepicker", inst);
3960
- //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
3961
- if( inst.settings.disabled ) {
3962
- this._disableDatepicker( target );
3963
- }
3964
- },
3965
-
3966
- /* Make attachments based on settings. */
3967
- _attachments: function(input, inst) {
3968
- var showOn, buttonText, buttonImage,
3969
- appendText = this._get(inst, "appendText"),
3970
- isRTL = this._get(inst, "isRTL");
3971
-
3972
- if (inst.append) {
3973
- inst.append.remove();
3974
- }
3975
- if (appendText) {
3976
- inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
3977
- input[isRTL ? "before" : "after"](inst.append);
3978
- }
3979
-
3980
- input.unbind("focus", this._showDatepicker);
3981
-
3982
- if (inst.trigger) {
3983
- inst.trigger.remove();
3984
- }
3985
-
3986
- showOn = this._get(inst, "showOn");
3987
- if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
3988
- input.focus(this._showDatepicker);
3989
- }
3990
- if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
3991
- buttonText = this._get(inst, "buttonText");
3992
- buttonImage = this._get(inst, "buttonImage");
3993
- inst.trigger = $(this._get(inst, "buttonImageOnly") ?
3994
- $("<img/>").addClass(this._triggerClass).
3995
- attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
3996
- $("<button type='button'></button>").addClass(this._triggerClass).
3997
- html(!buttonImage ? buttonText : $("<img/>").attr(
3998
- { src:buttonImage, alt:buttonText, title:buttonText })));
3999
- input[isRTL ? "before" : "after"](inst.trigger);
4000
- inst.trigger.click(function() {
4001
- if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
4002
- $.datepicker._hideDatepicker();
4003
- } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
4004
- $.datepicker._hideDatepicker();
4005
- $.datepicker._showDatepicker(input[0]);
4006
- } else {
4007
- $.datepicker._showDatepicker(input[0]);
4008
- }
4009
- return false;
4010
- });
4011
- }
4012
- },
4013
-
4014
- /* Apply the maximum length for the date format. */
4015
- _autoSize: function(inst) {
4016
- if (this._get(inst, "autoSize") && !inst.inline) {
4017
- var findMax, max, maxI, i,
4018
- date = new Date(2009, 12 - 1, 20), // Ensure double digits
4019
- dateFormat = this._get(inst, "dateFormat");
4020
-
4021
- if (dateFormat.match(/[DM]/)) {
4022
- findMax = function(names) {
4023
- max = 0;
4024
- maxI = 0;
4025
- for (i = 0; i < names.length; i++) {
4026
- if (names[i].length > max) {
4027
- max = names[i].length;
4028
- maxI = i;
4029
- }
4030
- }
4031
- return maxI;
4032
- };
4033
- date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
4034
- "monthNames" : "monthNamesShort"))));
4035
- date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
4036
- "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
4037
- }
4038
- inst.input.attr("size", this._formatDate(inst, date).length);
4039
- }
4040
- },
4041
-
4042
- /* Attach an inline date picker to a div. */
4043
- _inlineDatepicker: function(target, inst) {
4044
- var divSpan = $(target);
4045
- if (divSpan.hasClass(this.markerClassName)) {
4046
- return;
4047
- }
4048
- divSpan.addClass(this.markerClassName).append(inst.dpDiv);
4049
- $.data(target, "datepicker", inst);
4050
- this._setDate(inst, this._getDefaultDate(inst), true);
4051
- this._updateDatepicker(inst);
4052
- this._updateAlternate(inst);
4053
- //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
4054
- if( inst.settings.disabled ) {
4055
- this._disableDatepicker( target );
4056
- }
4057
- // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
4058
- // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
4059
- inst.dpDiv.css( "display", "block" );
4060
- },
4061
-
4062
- /* Pop-up the date picker in a "dialog" box.
4063
- * @param input element - ignored
4064
- * @param date string or Date - the initial date to display
4065
- * @param onSelect function - the function to call when a date is selected
4066
- * @param settings object - update the dialog date picker instance's settings (anonymous object)
4067
- * @param pos int[2] - coordinates for the dialog's position within the screen or
4068
- * event - with x/y coordinates or
4069
- * leave empty for default (screen centre)
4070
- * @return the manager object
4071
- */
4072
- _dialogDatepicker: function(input, date, onSelect, settings, pos) {
4073
- var id, browserWidth, browserHeight, scrollX, scrollY,
4074
- inst = this._dialogInst; // internal instance
4075
-
4076
- if (!inst) {
4077
- this.uuid += 1;
4078
- id = "dp" + this.uuid;
4079
- this._dialogInput = $("<input type='text' id='" + id +
4080
- "' style='position: absolute; top: -100px; width: 0px;'/>");
4081
- this._dialogInput.keydown(this._doKeyDown);
4082
- $("body").append(this._dialogInput);
4083
- inst = this._dialogInst = this._newInst(this._dialogInput, false);
4084
- inst.settings = {};
4085
- $.data(this._dialogInput[0], "datepicker", inst);
4086
- }
4087
- datepicker_extendRemove(inst.settings, settings || {});
4088
- date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
4089
- this._dialogInput.val(date);
4090
-
4091
- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
4092
- if (!this._pos) {
4093
- browserWidth = document.documentElement.clientWidth;
4094
- browserHeight = document.documentElement.clientHeight;
4095
- scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
4096
- scrollY = document.documentElement.scrollTop || document.body.scrollTop;
4097
- this._pos = // should use actual width/height below
4098
- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
4099
- }
4100
-
4101
- // move input on screen for focus, but hidden behind dialog
4102
- this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
4103
- inst.settings.onSelect = onSelect;
4104
- this._inDialog = true;
4105
- this.dpDiv.addClass(this._dialogClass);
4106
- this._showDatepicker(this._dialogInput[0]);
4107
- if ($.blockUI) {
4108
- $.blockUI(this.dpDiv);
4109
- }
4110
- $.data(this._dialogInput[0], "datepicker", inst);
4111
- return this;
4112
- },
4113
-
4114
- /* Detach a datepicker from its control.
4115
- * @param target element - the target input field or division or span
4116
- */
4117
- _destroyDatepicker: function(target) {
4118
- var nodeName,
4119
- $target = $(target),
4120
- inst = $.data(target, "datepicker");
4121
-
4122
- if (!$target.hasClass(this.markerClassName)) {
4123
- return;
4124
- }
4125
-
4126
- nodeName = target.nodeName.toLowerCase();
4127
- $.removeData(target, "datepicker");
4128
- if (nodeName === "input") {
4129
- inst.append.remove();
4130
- inst.trigger.remove();
4131
- $target.removeClass(this.markerClassName).
4132
- unbind("focus", this._showDatepicker).
4133
- unbind("keydown", this._doKeyDown).
4134
- unbind("keypress", this._doKeyPress).
4135
- unbind("keyup", this._doKeyUp);
4136
- } else if (nodeName === "div" || nodeName === "span") {
4137
- $target.removeClass(this.markerClassName).empty();
4138
- }
4139
- },
4140
-
4141
- /* Enable the date picker to a jQuery selection.
4142
- * @param target element - the target input field or division or span
4143
- */
4144
- _enableDatepicker: function(target) {
4145
- var nodeName, inline,
4146
- $target = $(target),
4147
- inst = $.data(target, "datepicker");
4148
-
4149
- if (!$target.hasClass(this.markerClassName)) {
4150
- return;
4151
- }
4152
-
4153
- nodeName = target.nodeName.toLowerCase();
4154
- if (nodeName === "input") {
4155
- target.disabled = false;
4156
- inst.trigger.filter("button").
4157
- each(function() { this.disabled = false; }).end().
4158
- filter("img").css({opacity: "1.0", cursor: ""});
4159
- } else if (nodeName === "div" || nodeName === "span") {
4160
- inline = $target.children("." + this._inlineClass);
4161
- inline.children().removeClass("ui-state-disabled");
4162
- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
4163
- prop("disabled", false);
4164
- }
4165
- this._disabledInputs = $.map(this._disabledInputs,
4166
- function(value) { return (value === target ? null : value); }); // delete entry
4167
- },
4168
-
4169
- /* Disable the date picker to a jQuery selection.
4170
- * @param target element - the target input field or division or span
4171
- */
4172
- _disableDatepicker: function(target) {
4173
- var nodeName, inline,
4174
- $target = $(target),
4175
- inst = $.data(target, "datepicker");
4176
-
4177
- if (!$target.hasClass(this.markerClassName)) {
4178
- return;
4179
- }
4180
-
4181
- nodeName = target.nodeName.toLowerCase();
4182
- if (nodeName === "input") {
4183
- target.disabled = true;
4184
- inst.trigger.filter("button").
4185
- each(function() { this.disabled = true; }).end().
4186
- filter("img").css({opacity: "0.5", cursor: "default"});
4187
- } else if (nodeName === "div" || nodeName === "span") {
4188
- inline = $target.children("." + this._inlineClass);
4189
- inline.children().addClass("ui-state-disabled");
4190
- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
4191
- prop("disabled", true);
4192
- }
4193
- this._disabledInputs = $.map(this._disabledInputs,
4194
- function(value) { return (value === target ? null : value); }); // delete entry
4195
- this._disabledInputs[this._disabledInputs.length] = target;
4196
- },
4197
-
4198
- /* Is the first field in a jQuery collection disabled as a datepicker?
4199
- * @param target element - the target input field or division or span
4200
- * @return boolean - true if disabled, false if enabled
4201
- */
4202
- _isDisabledDatepicker: function(target) {
4203
- if (!target) {
4204
- return false;
4205
- }
4206
- for (var i = 0; i < this._disabledInputs.length; i++) {
4207
- if (this._disabledInputs[i] === target) {
4208
- return true;
4209
- }
4210
- }
4211
- return false;
4212
- },
4213
-
4214
- /* Retrieve the instance data for the target control.
4215
- * @param target element - the target input field or division or span
4216
- * @return object - the associated instance data
4217
- * @throws error if a jQuery problem getting data
4218
- */
4219
- _getInst: function(target) {
4220
- try {
4221
- return $.data(target, "datepicker");
4222
- }
4223
- catch (err) {
4224
- throw "Missing instance data for this datepicker";
4225
- }
4226
- },
4227
-
4228
- /* Update or retrieve the settings for a date picker attached to an input field or division.
4229
- * @param target element - the target input field or division or span
4230
- * @param name object - the new settings to update or
4231
- * string - the name of the setting to change or retrieve,
4232
- * when retrieving also "all" for all instance settings or
4233
- * "defaults" for all global defaults
4234
- * @param value any - the new value for the setting
4235
- * (omit if above is an object or to retrieve a value)
4236
- */
4237
- _optionDatepicker: function(target, name, value) {
4238
- var settings, date, minDate, maxDate,
4239
- inst = this._getInst(target);
4240
-
4241
- if (arguments.length === 2 && typeof name === "string") {
4242
- return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
4243
- (inst ? (name === "all" ? $.extend({}, inst.settings) :
4244
- this._get(inst, name)) : null));
4245
- }
4246
-
4247
- settings = name || {};
4248
- if (typeof name === "string") {
4249
- settings = {};
4250
- settings[name] = value;
4251
- }
4252
-
4253
- if (inst) {
4254
- if (this._curInst === inst) {
4255
- this._hideDatepicker();
4256
- }
4257
-
4258
- date = this._getDateDatepicker(target, true);
4259
- minDate = this._getMinMaxDate(inst, "min");
4260
- maxDate = this._getMinMaxDate(inst, "max");
4261
- datepicker_extendRemove(inst.settings, settings);
4262
- // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
4263
- if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
4264
- inst.settings.minDate = this._formatDate(inst, minDate);
4265
- }
4266
- if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
4267
- inst.settings.maxDate = this._formatDate(inst, maxDate);
4268
- }
4269
- if ( "disabled" in settings ) {
4270
- if ( settings.disabled ) {
4271
- this._disableDatepicker(target);
4272
- } else {
4273
- this._enableDatepicker(target);
4274
- }
4275
- }
4276
- this._attachments($(target), inst);
4277
- this._autoSize(inst);
4278
- this._setDate(inst, date);
4279
- this._updateAlternate(inst);
4280
- this._updateDatepicker(inst);
4281
- }
4282
- },
4283
-
4284
- // change method deprecated
4285
- _changeDatepicker: function(target, name, value) {
4286
- this._optionDatepicker(target, name, value);
4287
- },
4288
-
4289
- /* Redraw the date picker attached to an input field or division.
4290
- * @param target element - the target input field or division or span
4291
- */
4292
- _refreshDatepicker: function(target) {
4293
- var inst = this._getInst(target);
4294
- if (inst) {
4295
- this._updateDatepicker(inst);
4296
- }
4297
- },
4298
-
4299
- /* Set the dates for a jQuery selection.
4300
- * @param target element - the target input field or division or span
4301
- * @param date Date - the new date
4302
- */
4303
- _setDateDatepicker: function(target, date) {
4304
- var inst = this._getInst(target);
4305
- if (inst) {
4306
- this._setDate(inst, date);
4307
- this._updateDatepicker(inst);
4308
- this._updateAlternate(inst);
4309
- }
4310
- },
4311
-
4312
- /* Get the date(s) for the first entry in a jQuery selection.
4313
- * @param target element - the target input field or division or span
4314
- * @param noDefault boolean - true if no default date is to be used
4315
- * @return Date - the current date
4316
- */
4317
- _getDateDatepicker: function(target, noDefault) {
4318
- var inst = this._getInst(target);
4319
- if (inst && !inst.inline) {
4320
- this._setDateFromField(inst, noDefault);
4321
- }
4322
- return (inst ? this._getDate(inst) : null);
4323
- },
4324
-
4325
- /* Handle keystrokes. */
4326
- _doKeyDown: function(event) {
4327
- var onSelect, dateStr, sel,
4328
- inst = $.datepicker._getInst(event.target),
4329
- handled = true,
4330
- isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
4331
-
4332
- inst._keyEvent = true;
4333
- if ($.datepicker._datepickerShowing) {
4334
- switch (event.keyCode) {
4335
- case 9: $.datepicker._hideDatepicker();
4336
- handled = false;
4337
- break; // hide on tab out
4338
- case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
4339
- $.datepicker._currentClass + ")", inst.dpDiv);
4340
- if (sel[0]) {
4341
- $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
4342
- }
4343
-
4344
- onSelect = $.datepicker._get(inst, "onSelect");
4345
- if (onSelect) {
4346
- dateStr = $.datepicker._formatDate(inst);
4347
-
4348
- // trigger custom callback
4349
- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
4350
- } else {
4351
- $.datepicker._hideDatepicker();
4352
- }
4353
-
4354
- return false; // don't submit the form
4355
- case 27: $.datepicker._hideDatepicker();
4356
- break; // hide on escape
4357
- case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4358
- -$.datepicker._get(inst, "stepBigMonths") :
4359
- -$.datepicker._get(inst, "stepMonths")), "M");
4360
- break; // previous month/year on page up/+ ctrl
4361
- case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4362
- +$.datepicker._get(inst, "stepBigMonths") :
4363
- +$.datepicker._get(inst, "stepMonths")), "M");
4364
- break; // next month/year on page down/+ ctrl
4365
- case 35: if (event.ctrlKey || event.metaKey) {
4366
- $.datepicker._clearDate(event.target);
4367
- }
4368
- handled = event.ctrlKey || event.metaKey;
4369
- break; // clear on ctrl or command +end
4370
- case 36: if (event.ctrlKey || event.metaKey) {
4371
- $.datepicker._gotoToday(event.target);
4372
- }
4373
- handled = event.ctrlKey || event.metaKey;
4374
- break; // current on ctrl or command +home
4375
- case 37: if (event.ctrlKey || event.metaKey) {
4376
- $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
4377
- }
4378
- handled = event.ctrlKey || event.metaKey;
4379
- // -1 day on ctrl or command +left
4380
- if (event.originalEvent.altKey) {
4381
- $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4382
- -$.datepicker._get(inst, "stepBigMonths") :
4383
- -$.datepicker._get(inst, "stepMonths")), "M");
4384
- }
4385
- // next month/year on alt +left on Mac
4386
- break;
4387
- case 38: if (event.ctrlKey || event.metaKey) {
4388
- $.datepicker._adjustDate(event.target, -7, "D");
4389
- }
4390
- handled = event.ctrlKey || event.metaKey;
4391
- break; // -1 week on ctrl or command +up
4392
- case 39: if (event.ctrlKey || event.metaKey) {
4393
- $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
4394
- }
4395
- handled = event.ctrlKey || event.metaKey;
4396
- // +1 day on ctrl or command +right
4397
- if (event.originalEvent.altKey) {
4398
- $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4399
- +$.datepicker._get(inst, "stepBigMonths") :
4400
- +$.datepicker._get(inst, "stepMonths")), "M");
4401
- }
4402
- // next month/year on alt +right
4403
- break;
4404
- case 40: if (event.ctrlKey || event.metaKey) {
4405
- $.datepicker._adjustDate(event.target, +7, "D");
4406
- }
4407
- handled = event.ctrlKey || event.metaKey;
4408
- break; // +1 week on ctrl or command +down
4409
- default: handled = false;
4410
- }
4411
- } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
4412
- $.datepicker._showDatepicker(this);
4413
- } else {
4414
- handled = false;
4415
- }
4416
-
4417
- if (handled) {
4418
- event.preventDefault();
4419
- event.stopPropagation();
4420
- }
4421
- },
4422
-
4423
- /* Filter entered characters - based on date format. */
4424
- _doKeyPress: function(event) {
4425
- var chars, chr,
4426
- inst = $.datepicker._getInst(event.target);
4427
-
4428
- if ($.datepicker._get(inst, "constrainInput")) {
4429
- chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
4430
- chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
4431
- return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
4432
- }
4433
- },
4434
-
4435
- /* Synchronise manual entry and field/alternate field. */
4436
- _doKeyUp: function(event) {
4437
- var date,
4438
- inst = $.datepicker._getInst(event.target);
4439
-
4440
- if (inst.input.val() !== inst.lastVal) {
4441
- try {
4442
- date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
4443
- (inst.input ? inst.input.val() : null),
4444
- $.datepicker._getFormatConfig(inst));
4445
-
4446
- if (date) { // only if valid
4447
- $.datepicker._setDateFromField(inst);
4448
- $.datepicker._updateAlternate(inst);
4449
- $.datepicker._updateDatepicker(inst);
4450
- }
4451
- }
4452
- catch (err) {
4453
- }
4454
- }
4455
- return true;
4456
- },
4457
-
4458
- /* Pop-up the date picker for a given input field.
4459
- * If false returned from beforeShow event handler do not show.
4460
- * @param input element - the input field attached to the date picker or
4461
- * event - if triggered by focus
4462
- */
4463
- _showDatepicker: function(input) {
4464
- input = input.target || input;
4465
- if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
4466
- input = $("input", input.parentNode)[0];
4467
- }
4468
-
4469
- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
4470
- return;
4471
- }
4472
-
4473
- var inst, beforeShow, beforeShowSettings, isFixed,
4474
- offset, showAnim, duration;
4475
-
4476
- inst = $.datepicker._getInst(input);
4477
- if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
4478
- $.datepicker._curInst.dpDiv.stop(true, true);
4479
- if ( inst && $.datepicker._datepickerShowing ) {
4480
- $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
4481
- }
4482
- }
4483
-
4484
- beforeShow = $.datepicker._get(inst, "beforeShow");
4485
- beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
4486
- if(beforeShowSettings === false){
4487
- return;
4488
- }
4489
- datepicker_extendRemove(inst.settings, beforeShowSettings);
4490
-
4491
- inst.lastVal = null;
4492
- $.datepicker._lastInput = input;
4493
- $.datepicker._setDateFromField(inst);
4494
-
4495
- if ($.datepicker._inDialog) { // hide cursor
4496
- input.value = "";
4497
- }
4498
- if (!$.datepicker._pos) { // position below input
4499
- $.datepicker._pos = $.datepicker._findPos(input);
4500
- $.datepicker._pos[1] += input.offsetHeight; // add the height
4501
- }
4502
-
4503
- isFixed = false;
4504
- $(input).parents().each(function() {
4505
- isFixed |= $(this).css("position") === "fixed";
4506
- return !isFixed;
4507
- });
4508
-
4509
- offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
4510
- $.datepicker._pos = null;
4511
- //to avoid flashes on Firefox
4512
- inst.dpDiv.empty();
4513
- // determine sizing offscreen
4514
- inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
4515
- $.datepicker._updateDatepicker(inst);
4516
- // fix width for dynamic number of date pickers
4517
- // and adjust position before showing
4518
- offset = $.datepicker._checkOffset(inst, offset, isFixed);
4519
- inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
4520
- "static" : (isFixed ? "fixed" : "absolute")), display: "none",
4521
- left: offset.left + "px", top: offset.top + "px"});
4522
-
4523
- if (!inst.inline) {
4524
- showAnim = $.datepicker._get(inst, "showAnim");
4525
- duration = $.datepicker._get(inst, "duration");
4526
- inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
4527
- $.datepicker._datepickerShowing = true;
4528
-
4529
- if ( $.effects && $.effects.effect[ showAnim ] ) {
4530
- inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
4531
- } else {
4532
- inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
4533
- }
4534
-
4535
- if ( $.datepicker._shouldFocusInput( inst ) ) {
4536
- inst.input.focus();
4537
- }
4538
-
4539
- $.datepicker._curInst = inst;
4540
- }
4541
- },
4542
-
4543
- /* Generate the date picker content. */
4544
- _updateDatepicker: function(inst) {
4545
- this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
4546
- datepicker_instActive = inst; // for delegate hover events
4547
- inst.dpDiv.empty().append(this._generateHTML(inst));
4548
- this._attachHandlers(inst);
4549
-
4550
- var origyearshtml,
4551
- numMonths = this._getNumberOfMonths(inst),
4552
- cols = numMonths[1],
4553
- width = 17,
4554
- activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
4555
-
4556
- if ( activeCell.length > 0 ) {
4557
- datepicker_handleMouseover.apply( activeCell.get( 0 ) );
4558
- }
4559
-
4560
- inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
4561
- if (cols > 1) {
4562
- inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
4563
- }
4564
- inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
4565
- "Class"]("ui-datepicker-multi");
4566
- inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
4567
- "Class"]("ui-datepicker-rtl");
4568
-
4569
- if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
4570
- inst.input.focus();
4571
- }
4572
-
4573
- // deffered render of the years select (to avoid flashes on Firefox)
4574
- if( inst.yearshtml ){
4575
- origyearshtml = inst.yearshtml;
4576
- setTimeout(function(){
4577
- //assure that inst.yearshtml didn't change.
4578
- if( origyearshtml === inst.yearshtml && inst.yearshtml ){
4579
- inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
4580
- }
4581
- origyearshtml = inst.yearshtml = null;
4582
- }, 0);
4583
- }
4584
- },
4585
-
4586
- // #6694 - don't focus the input if it's already focused
4587
- // this breaks the change event in IE
4588
- // Support: IE and jQuery <1.9
4589
- _shouldFocusInput: function( inst ) {
4590
- return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
4591
- },
4592
-
4593
- /* Check positioning to remain on screen. */
4594
- _checkOffset: function(inst, offset, isFixed) {
4595
- var dpWidth = inst.dpDiv.outerWidth(),
4596
- dpHeight = inst.dpDiv.outerHeight(),
4597
- inputWidth = inst.input ? inst.input.outerWidth() : 0,
4598
- inputHeight = inst.input ? inst.input.outerHeight() : 0,
4599
- viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
4600
- viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
4601
-
4602
- offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
4603
- offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
4604
- offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
4605
-
4606
- // now check if datepicker is showing outside window viewport - move to a better place if so.
4607
- offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
4608
- Math.abs(offset.left + dpWidth - viewWidth) : 0);
4609
- offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
4610
- Math.abs(dpHeight + inputHeight) : 0);
4611
-
4612
- return offset;
4613
- },
4614
-
4615
- /* Find an object's position on the screen. */
4616
- _findPos: function(obj) {
4617
- var position,
4618
- inst = this._getInst(obj),
4619
- isRTL = this._get(inst, "isRTL");
4620
-
4621
- while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
4622
- obj = obj[isRTL ? "previousSibling" : "nextSibling"];
4623
- }
4624
-
4625
- position = $(obj).offset();
4626
- return [position.left, position.top];
4627
- },
4628
-
4629
- /* Hide the date picker from view.
4630
- * @param input element - the input field attached to the date picker
4631
- */
4632
- _hideDatepicker: function(input) {
4633
- var showAnim, duration, postProcess, onClose,
4634
- inst = this._curInst;
4635
-
4636
- if (!inst || (input && inst !== $.data(input, "datepicker"))) {
4637
- return;
4638
- }
4639
-
4640
- if (this._datepickerShowing) {
4641
- showAnim = this._get(inst, "showAnim");
4642
- duration = this._get(inst, "duration");
4643
- postProcess = function() {
4644
- $.datepicker._tidyDialog(inst);
4645
- };
4646
-
4647
- // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
4648
- if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
4649
- inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
4650
- } else {
4651
- inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
4652
- (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
4653
- }
4654
-
4655
- if (!showAnim) {
4656
- postProcess();
4657
- }
4658
- this._datepickerShowing = false;
4659
-
4660
- onClose = this._get(inst, "onClose");
4661
- if (onClose) {
4662
- onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
4663
- }
4664
-
4665
- this._lastInput = null;
4666
- if (this._inDialog) {
4667
- this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
4668
- if ($.blockUI) {
4669
- $.unblockUI();
4670
- $("body").append(this.dpDiv);
4671
- }
4672
- }
4673
- this._inDialog = false;
4674
- }
4675
- },
4676
-
4677
- /* Tidy up after a dialog display. */
4678
- _tidyDialog: function(inst) {
4679
- inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
4680
- },
4681
-
4682
- /* Close date picker if clicked elsewhere. */
4683
- _checkExternalClick: function(event) {
4684
- if (!$.datepicker._curInst) {
4685
- return;
4686
- }
4687
-
4688
- var $target = $(event.target),
4689
- inst = $.datepicker._getInst($target[0]);
4690
-
4691
- if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
4692
- $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
4693
- !$target.hasClass($.datepicker.markerClassName) &&
4694
- !$target.closest("." + $.datepicker._triggerClass).length &&
4695
- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
4696
- ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
4697
- $.datepicker._hideDatepicker();
4698
- }
4699
- },
4700
-
4701
- /* Adjust one of the date sub-fields. */
4702
- _adjustDate: function(id, offset, period) {
4703
- var target = $(id),
4704
- inst = this._getInst(target[0]);
4705
-
4706
- if (this._isDisabledDatepicker(target[0])) {
4707
- return;
4708
- }
4709
- this._adjustInstDate(inst, offset +
4710
- (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
4711
- period);
4712
- this._updateDatepicker(inst);
4713
- },
4714
-
4715
- /* Action for current link. */
4716
- _gotoToday: function(id) {
4717
- var date,
4718
- target = $(id),
4719
- inst = this._getInst(target[0]);
4720
-
4721
- if (this._get(inst, "gotoCurrent") && inst.currentDay) {
4722
- inst.selectedDay = inst.currentDay;
4723
- inst.drawMonth = inst.selectedMonth = inst.currentMonth;
4724
- inst.drawYear = inst.selectedYear = inst.currentYear;
4725
- } else {
4726
- date = new Date();
4727
- inst.selectedDay = date.getDate();
4728
- inst.drawMonth = inst.selectedMonth = date.getMonth();
4729
- inst.drawYear = inst.selectedYear = date.getFullYear();
4730
- }
4731
- this._notifyChange(inst);
4732
- this._adjustDate(target);
4733
- },
4734
-
4735
- /* Action for selecting a new month/year. */
4736
- _selectMonthYear: function(id, select, period) {
4737
- var target = $(id),
4738
- inst = this._getInst(target[0]);
4739
-
4740
- inst["selected" + (period === "M" ? "Month" : "Year")] =
4741
- inst["draw" + (period === "M" ? "Month" : "Year")] =
4742
- parseInt(select.options[select.selectedIndex].value,10);
4743
-
4744
- this._notifyChange(inst);
4745
- this._adjustDate(target);
4746
- },
4747
-
4748
- /* Action for selecting a day. */
4749
- _selectDay: function(id, month, year, td) {
4750
- var inst,
4751
- target = $(id);
4752
-
4753
- if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
4754
- return;
4755
- }
4756
-
4757
- inst = this._getInst(target[0]);
4758
- inst.selectedDay = inst.currentDay = $("a", td).html();
4759
- inst.selectedMonth = inst.currentMonth = month;
4760
- inst.selectedYear = inst.currentYear = year;
4761
- this._selectDate(id, this._formatDate(inst,
4762
- inst.currentDay, inst.currentMonth, inst.currentYear));
4763
- },
4764
-
4765
- /* Erase the input field and hide the date picker. */
4766
- _clearDate: function(id) {
4767
- var target = $(id);
4768
- this._selectDate(target, "");
4769
- },
4770
-
4771
- /* Update the input field with the selected date. */
4772
- _selectDate: function(id, dateStr) {
4773
- var onSelect,
4774
- target = $(id),
4775
- inst = this._getInst(target[0]);
4776
-
4777
- dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
4778
- if (inst.input) {
4779
- inst.input.val(dateStr);
4780
- }
4781
- this._updateAlternate(inst);
4782
-
4783
- onSelect = this._get(inst, "onSelect");
4784
- if (onSelect) {
4785
- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
4786
- } else if (inst.input) {
4787
- inst.input.trigger("change"); // fire the change event
4788
- }
4789
-
4790
- if (inst.inline){
4791
- this._updateDatepicker(inst);
4792
- } else {
4793
- this._hideDatepicker();
4794
- this._lastInput = inst.input[0];
4795
- if (typeof(inst.input[0]) !== "object") {
4796
- inst.input.focus(); // restore focus
4797
- }
4798
- this._lastInput = null;
4799
- }
4800
- },
4801
-
4802
- /* Update any alternate field to synchronise with the main field. */
4803
- _updateAlternate: function(inst) {
4804
- var altFormat, date, dateStr,
4805
- altField = this._get(inst, "altField");
4806
-
4807
- if (altField) { // update alternate field too
4808
- altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
4809
- date = this._getDate(inst);
4810
- dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
4811
- $(altField).each(function() { $(this).val(dateStr); });
4812
- }
4813
- },
4814
-
4815
- /* Set as beforeShowDay function to prevent selection of weekends.
4816
- * @param date Date - the date to customise
4817
- * @return [boolean, string] - is this date selectable?, what is its CSS class?
4818
- */
4819
- noWeekends: function(date) {
4820
- var day = date.getDay();
4821
- return [(day > 0 && day < 6), ""];
4822
- },
4823
-
4824
- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
4825
- * @param date Date - the date to get the week for
4826
- * @return number - the number of the week within the year that contains this date
4827
- */
4828
- iso8601Week: function(date) {
4829
- var time,
4830
- checkDate = new Date(date.getTime());
4831
-
4832
- // Find Thursday of this week starting on Monday
4833
- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
4834
-
4835
- time = checkDate.getTime();
4836
- checkDate.setMonth(0); // Compare with Jan 1
4837
- checkDate.setDate(1);
4838
- return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
4839
- },
4840
-
4841
- /* Parse a string value into a date object.
4842
- * See formatDate below for the possible formats.
4843
- *
4844
- * @param format string - the expected format of the date
4845
- * @param value string - the date in the above format
4846
- * @param settings Object - attributes include:
4847
- * shortYearCutoff number - the cutoff year for determining the century (optional)
4848
- * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
4849
- * dayNames string[7] - names of the days from Sunday (optional)
4850
- * monthNamesShort string[12] - abbreviated names of the months (optional)
4851
- * monthNames string[12] - names of the months (optional)
4852
- * @return Date - the extracted date value or null if value is blank
4853
- */
4854
- parseDate: function (format, value, settings) {
4855
- if (format == null || value == null) {
4856
- throw "Invalid arguments";
4857
- }
4858
-
4859
- value = (typeof value === "object" ? value.toString() : value + "");
4860
- if (value === "") {
4861
- return null;
4862
- }
4863
-
4864
- var iFormat, dim, extra,
4865
- iValue = 0,
4866
- shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
4867
- shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
4868
- new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
4869
- dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
4870
- dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
4871
- monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
4872
- monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
4873
- year = -1,
4874
- month = -1,
4875
- day = -1,
4876
- doy = -1,
4877
- literal = false,
4878
- date,
4879
- // Check whether a format character is doubled
4880
- lookAhead = function(match) {
4881
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
4882
- if (matches) {
4883
- iFormat++;
4884
- }
4885
- return matches;
4886
- },
4887
- // Extract a number from the string value
4888
- getNumber = function(match) {
4889
- var isDoubled = lookAhead(match),
4890
- size = (match === "@" ? 14 : (match === "!" ? 20 :
4891
- (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
4892
- minSize = (match === "y" ? size : 1),
4893
- digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
4894
- num = value.substring(iValue).match(digits);
4895
- if (!num) {
4896
- throw "Missing number at position " + iValue;
4897
- }
4898
- iValue += num[0].length;
4899
- return parseInt(num[0], 10);
4900
- },
4901
- // Extract a name from the string value and convert to an index
4902
- getName = function(match, shortNames, longNames) {
4903
- var index = -1,
4904
- names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
4905
- return [ [k, v] ];
4906
- }).sort(function (a, b) {
4907
- return -(a[1].length - b[1].length);
4908
- });
4909
-
4910
- $.each(names, function (i, pair) {
4911
- var name = pair[1];
4912
- if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
4913
- index = pair[0];
4914
- iValue += name.length;
4915
- return false;
4916
- }
4917
- });
4918
- if (index !== -1) {
4919
- return index + 1;
4920
- } else {
4921
- throw "Unknown name at position " + iValue;
4922
- }
4923
- },
4924
- // Confirm that a literal character matches the string value
4925
- checkLiteral = function() {
4926
- if (value.charAt(iValue) !== format.charAt(iFormat)) {
4927
- throw "Unexpected literal at position " + iValue;
4928
- }
4929
- iValue++;
4930
- };
4931
-
4932
- for (iFormat = 0; iFormat < format.length; iFormat++) {
4933
- if (literal) {
4934
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
4935
- literal = false;
4936
- } else {
4937
- checkLiteral();
4938
- }
4939
- } else {
4940
- switch (format.charAt(iFormat)) {
4941
- case "d":
4942
- day = getNumber("d");
4943
- break;
4944
- case "D":
4945
- getName("D", dayNamesShort, dayNames);
4946
- break;
4947
- case "o":
4948
- doy = getNumber("o");
4949
- break;
4950
- case "m":
4951
- month = getNumber("m");
4952
- break;
4953
- case "M":
4954
- month = getName("M", monthNamesShort, monthNames);
4955
- break;
4956
- case "y":
4957
- year = getNumber("y");
4958
- break;
4959
- case "@":
4960
- date = new Date(getNumber("@"));
4961
- year = date.getFullYear();
4962
- month = date.getMonth() + 1;
4963
- day = date.getDate();
4964
- break;
4965
- case "!":
4966
- date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
4967
- year = date.getFullYear();
4968
- month = date.getMonth() + 1;
4969
- day = date.getDate();
4970
- break;
4971
- case "'":
4972
- if (lookAhead("'")){
4973
- checkLiteral();
4974
- } else {
4975
- literal = true;
4976
- }
4977
- break;
4978
- default:
4979
- checkLiteral();
4980
- }
4981
- }
4982
- }
4983
-
4984
- if (iValue < value.length){
4985
- extra = value.substr(iValue);
4986
- if (!/^\s+/.test(extra)) {
4987
- throw "Extra/unparsed characters found in date: " + extra;
4988
- }
4989
- }
4990
-
4991
- if (year === -1) {
4992
- year = new Date().getFullYear();
4993
- } else if (year < 100) {
4994
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
4995
- (year <= shortYearCutoff ? 0 : -100);
4996
- }
4997
-
4998
- if (doy > -1) {
4999
- month = 1;
5000
- day = doy;
5001
- do {
5002
- dim = this._getDaysInMonth(year, month - 1);
5003
- if (day <= dim) {
5004
- break;
5005
- }
5006
- month++;
5007
- day -= dim;
5008
- } while (true);
5009
- }
5010
-
5011
- date = this._daylightSavingAdjust(new Date(year, month - 1, day));
5012
- if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
5013
- throw "Invalid date"; // E.g. 31/02/00
5014
- }
5015
- return date;
5016
- },
5017
-
5018
- /* Standard date formats. */
5019
- ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
5020
- COOKIE: "D, dd M yy",
5021
- ISO_8601: "yy-mm-dd",
5022
- RFC_822: "D, d M y",
5023
- RFC_850: "DD, dd-M-y",
5024
- RFC_1036: "D, d M y",
5025
- RFC_1123: "D, d M yy",
5026
- RFC_2822: "D, d M yy",
5027
- RSS: "D, d M y", // RFC 822
5028
- TICKS: "!",
5029
- TIMESTAMP: "@",
5030
- W3C: "yy-mm-dd", // ISO 8601
5031
-
5032
- _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
5033
- Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
5034
-
5035
- /* Format a date object into a string value.
5036
- * The format can be combinations of the following:
5037
- * d - day of month (no leading zero)
5038
- * dd - day of month (two digit)
5039
- * o - day of year (no leading zeros)
5040
- * oo - day of year (three digit)
5041
- * D - day name short
5042
- * DD - day name long
5043
- * m - month of year (no leading zero)
5044
- * mm - month of year (two digit)
5045
- * M - month name short
5046
- * MM - month name long
5047
- * y - year (two digit)
5048
- * yy - year (four digit)
5049
- * @ - Unix timestamp (ms since 01/01/1970)
5050
- * ! - Windows ticks (100ns since 01/01/0001)
5051
- * "..." - literal text
5052
- * '' - single quote
5053
- *
5054
- * @param format string - the desired format of the date
5055
- * @param date Date - the date value to format
5056
- * @param settings Object - attributes include:
5057
- * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
5058
- * dayNames string[7] - names of the days from Sunday (optional)
5059
- * monthNamesShort string[12] - abbreviated names of the months (optional)
5060
- * monthNames string[12] - names of the months (optional)
5061
- * @return string - the date in the above format
5062
- */
5063
- formatDate: function (format, date, settings) {
5064
- if (!date) {
5065
- return "";
5066
- }
5067
-
5068
- var iFormat,
5069
- dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
5070
- dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
5071
- monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
5072
- monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
5073
- // Check whether a format character is doubled
5074
- lookAhead = function(match) {
5075
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
5076
- if (matches) {
5077
- iFormat++;
5078
- }
5079
- return matches;
5080
- },
5081
- // Format a number, with leading zero if necessary
5082
- formatNumber = function(match, value, len) {
5083
- var num = "" + value;
5084
- if (lookAhead(match)) {
5085
- while (num.length < len) {
5086
- num = "0" + num;
5087
- }
5088
- }
5089
- return num;
5090
- },
5091
- // Format a name, short or long as requested
5092
- formatName = function(match, value, shortNames, longNames) {
5093
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
5094
- },
5095
- output = "",
5096
- literal = false;
5097
-
5098
- if (date) {
5099
- for (iFormat = 0; iFormat < format.length; iFormat++) {
5100
- if (literal) {
5101
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
5102
- literal = false;
5103
- } else {
5104
- output += format.charAt(iFormat);
5105
- }
5106
- } else {
5107
- switch (format.charAt(iFormat)) {
5108
- case "d":
5109
- output += formatNumber("d", date.getDate(), 2);
5110
- break;
5111
- case "D":
5112
- output += formatName("D", date.getDay(), dayNamesShort, dayNames);
5113
- break;
5114
- case "o":
5115
- output += formatNumber("o",
5116
- Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
5117
- break;
5118
- case "m":
5119
- output += formatNumber("m", date.getMonth() + 1, 2);
5120
- break;
5121
- case "M":
5122
- output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
5123
- break;
5124
- case "y":
5125
- output += (lookAhead("y") ? date.getFullYear() :
5126
- (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
5127
- break;
5128
- case "@":
5129
- output += date.getTime();
5130
- break;
5131
- case "!":
5132
- output += date.getTime() * 10000 + this._ticksTo1970;
5133
- break;
5134
- case "'":
5135
- if (lookAhead("'")) {
5136
- output += "'";
5137
- } else {
5138
- literal = true;
5139
- }
5140
- break;
5141
- default:
5142
- output += format.charAt(iFormat);
5143
- }
5144
- }
5145
- }
5146
- }
5147
- return output;
5148
- },
5149
-
5150
- /* Extract all possible characters from the date format. */
5151
- _possibleChars: function (format) {
5152
- var iFormat,
5153
- chars = "",
5154
- literal = false,
5155
- // Check whether a format character is doubled
5156
- lookAhead = function(match) {
5157
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
5158
- if (matches) {
5159
- iFormat++;
5160
- }
5161
- return matches;
5162
- };
5163
-
5164
- for (iFormat = 0; iFormat < format.length; iFormat++) {
5165
- if (literal) {
5166
- if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
5167
- literal = false;
5168
- } else {
5169
- chars += format.charAt(iFormat);
5170
- }
5171
- } else {
5172
- switch (format.charAt(iFormat)) {
5173
- case "d": case "m": case "y": case "@":
5174
- chars += "0123456789";
5175
- break;
5176
- case "D": case "M":
5177
- return null; // Accept anything
5178
- case "'":
5179
- if (lookAhead("'")) {
5180
- chars += "'";
5181
- } else {
5182
- literal = true;
5183
- }
5184
- break;
5185
- default:
5186
- chars += format.charAt(iFormat);
5187
- }
5188
- }
5189
- }
5190
- return chars;
5191
- },
5192
-
5193
- /* Get a setting value, defaulting if necessary. */
5194
- _get: function(inst, name) {
5195
- return inst.settings[name] !== undefined ?
5196
- inst.settings[name] : this._defaults[name];
5197
- },
5198
-
5199
- /* Parse existing date and initialise date picker. */
5200
- _setDateFromField: function(inst, noDefault) {
5201
- if (inst.input.val() === inst.lastVal) {
5202
- return;
5203
- }
5204
-
5205
- var dateFormat = this._get(inst, "dateFormat"),
5206
- dates = inst.lastVal = inst.input ? inst.input.val() : null,
5207
- defaultDate = this._getDefaultDate(inst),
5208
- date = defaultDate,
5209
- settings = this._getFormatConfig(inst);
5210
-
5211
- try {
5212
- date = this.parseDate(dateFormat, dates, settings) || defaultDate;
5213
- } catch (event) {
5214
- dates = (noDefault ? "" : dates);
5215
- }
5216
- inst.selectedDay = date.getDate();
5217
- inst.drawMonth = inst.selectedMonth = date.getMonth();
5218
- inst.drawYear = inst.selectedYear = date.getFullYear();
5219
- inst.currentDay = (dates ? date.getDate() : 0);
5220
- inst.currentMonth = (dates ? date.getMonth() : 0);
5221
- inst.currentYear = (dates ? date.getFullYear() : 0);
5222
- this._adjustInstDate(inst);
5223
- },
5224
-
5225
- /* Retrieve the default date shown on opening. */
5226
- _getDefaultDate: function(inst) {
5227
- return this._restrictMinMax(inst,
5228
- this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
5229
- },
5230
-
5231
- /* A date may be specified as an exact value or a relative one. */
5232
- _determineDate: function(inst, date, defaultDate) {
5233
- var offsetNumeric = function(offset) {
5234
- var date = new Date();
5235
- date.setDate(date.getDate() + offset);
5236
- return date;
5237
- },
5238
- offsetString = function(offset) {
5239
- try {
5240
- return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
5241
- offset, $.datepicker._getFormatConfig(inst));
5242
- }
5243
- catch (e) {
5244
- // Ignore
5245
- }
5246
-
5247
- var date = (offset.toLowerCase().match(/^c/) ?
5248
- $.datepicker._getDate(inst) : null) || new Date(),
5249
- year = date.getFullYear(),
5250
- month = date.getMonth(),
5251
- day = date.getDate(),
5252
- pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
5253
- matches = pattern.exec(offset);
5254
-
5255
- while (matches) {
5256
- switch (matches[2] || "d") {
5257
- case "d" : case "D" :
5258
- day += parseInt(matches[1],10); break;
5259
- case "w" : case "W" :
5260
- day += parseInt(matches[1],10) * 7; break;
5261
- case "m" : case "M" :
5262
- month += parseInt(matches[1],10);
5263
- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
5264
- break;
5265
- case "y": case "Y" :
5266
- year += parseInt(matches[1],10);
5267
- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
5268
- break;
5269
- }
5270
- matches = pattern.exec(offset);
5271
- }
5272
- return new Date(year, month, day);
5273
- },
5274
- newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
5275
- (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
5276
-
5277
- newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
5278
- if (newDate) {
5279
- newDate.setHours(0);
5280
- newDate.setMinutes(0);
5281
- newDate.setSeconds(0);
5282
- newDate.setMilliseconds(0);
5283
- }
5284
- return this._daylightSavingAdjust(newDate);
5285
- },
5286
-
5287
- /* Handle switch to/from daylight saving.
5288
- * Hours may be non-zero on daylight saving cut-over:
5289
- * > 12 when midnight changeover, but then cannot generate
5290
- * midnight datetime, so jump to 1AM, otherwise reset.
5291
- * @param date (Date) the date to check
5292
- * @return (Date) the corrected date
5293
- */
5294
- _daylightSavingAdjust: function(date) {
5295
- if (!date) {
5296
- return null;
5297
- }
5298
- date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
5299
- return date;
5300
- },
5301
-
5302
- /* Set the date(s) directly. */
5303
- _setDate: function(inst, date, noChange) {
5304
- var clear = !date,
5305
- origMonth = inst.selectedMonth,
5306
- origYear = inst.selectedYear,
5307
- newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
5308
-
5309
- inst.selectedDay = inst.currentDay = newDate.getDate();
5310
- inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
5311
- inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
5312
- if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
5313
- this._notifyChange(inst);
5314
- }
5315
- this._adjustInstDate(inst);
5316
- if (inst.input) {
5317
- inst.input.val(clear ? "" : this._formatDate(inst));
5318
- }
5319
- },
5320
-
5321
- /* Retrieve the date(s) directly. */
5322
- _getDate: function(inst) {
5323
- var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
5324
- this._daylightSavingAdjust(new Date(
5325
- inst.currentYear, inst.currentMonth, inst.currentDay)));
5326
- return startDate;
5327
- },
5328
-
5329
- /* Attach the onxxx handlers. These are declared statically so
5330
- * they work with static code transformers like Caja.
5331
- */
5332
- _attachHandlers: function(inst) {
5333
- var stepMonths = this._get(inst, "stepMonths"),
5334
- id = "#" + inst.id.replace( /\\\\/g, "\\" );
5335
- inst.dpDiv.find("[data-handler]").map(function () {
5336
- var handler = {
5337
- prev: function () {
5338
- $.datepicker._adjustDate(id, -stepMonths, "M");
5339
- },
5340
- next: function () {
5341
- $.datepicker._adjustDate(id, +stepMonths, "M");
5342
- },
5343
- hide: function () {
5344
- $.datepicker._hideDatepicker();
5345
- },
5346
- today: function () {
5347
- $.datepicker._gotoToday(id);
5348
- },
5349
- selectDay: function () {
5350
- $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
5351
- return false;
5352
- },
5353
- selectMonth: function () {
5354
- $.datepicker._selectMonthYear(id, this, "M");
5355
- return false;
5356
- },
5357
- selectYear: function () {
5358
- $.datepicker._selectMonthYear(id, this, "Y");
5359
- return false;
5360
- }
5361
- };
5362
- $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
5363
- });
5364
- },
5365
-
5366
- /* Generate the HTML for the current state of the date picker. */
5367
- _generateHTML: function(inst) {
5368
- var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
5369
- controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
5370
- monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
5371
- selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
5372
- cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
5373
- printDate, dRow, tbody, daySettings, otherMonth, unselectable,
5374
- tempDate = new Date(),
5375
- today = this._daylightSavingAdjust(
5376
- new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
5377
- isRTL = this._get(inst, "isRTL"),
5378
- showButtonPanel = this._get(inst, "showButtonPanel"),
5379
- hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
5380
- navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
5381
- numMonths = this._getNumberOfMonths(inst),
5382
- showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
5383
- stepMonths = this._get(inst, "stepMonths"),
5384
- isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
5385
- currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
5386
- new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
5387
- minDate = this._getMinMaxDate(inst, "min"),
5388
- maxDate = this._getMinMaxDate(inst, "max"),
5389
- drawMonth = inst.drawMonth - showCurrentAtPos,
5390
- drawYear = inst.drawYear;
5391
-
5392
- if (drawMonth < 0) {
5393
- drawMonth += 12;
5394
- drawYear--;
5395
- }
5396
- if (maxDate) {
5397
- maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
5398
- maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
5399
- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
5400
- while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
5401
- drawMonth--;
5402
- if (drawMonth < 0) {
5403
- drawMonth = 11;
5404
- drawYear--;
5405
- }
5406
- }
5407
- }
5408
- inst.drawMonth = drawMonth;
5409
- inst.drawYear = drawYear;
5410
-
5411
- prevText = this._get(inst, "prevText");
5412
- prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
5413
- this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
5414
- this._getFormatConfig(inst)));
5415
-
5416
- prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
5417
- "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
5418
- " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
5419
- (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>"));
5420
-
5421
- nextText = this._get(inst, "nextText");
5422
- nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
5423
- this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
5424
- this._getFormatConfig(inst)));
5425
-
5426
- next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
5427
- "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
5428
- " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
5429
- (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>"));
5430
-
5431
- currentText = this._get(inst, "currentText");
5432
- gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
5433
- currentText = (!navigationAsDateFormat ? currentText :
5434
- this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
5435
-
5436
- 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'>" +
5437
- this._get(inst, "closeText") + "</button>" : "");
5438
-
5439
- buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
5440
- (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'" +
5441
- ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
5442
-
5443
- firstDay = parseInt(this._get(inst, "firstDay"),10);
5444
- firstDay = (isNaN(firstDay) ? 0 : firstDay);
5445
-
5446
- showWeek = this._get(inst, "showWeek");
5447
- dayNames = this._get(inst, "dayNames");
5448
- dayNamesMin = this._get(inst, "dayNamesMin");
5449
- monthNames = this._get(inst, "monthNames");
5450
- monthNamesShort = this._get(inst, "monthNamesShort");
5451
- beforeShowDay = this._get(inst, "beforeShowDay");
5452
- showOtherMonths = this._get(inst, "showOtherMonths");
5453
- selectOtherMonths = this._get(inst, "selectOtherMonths");
5454
- defaultDate = this._getDefaultDate(inst);
5455
- html = "";
5456
- dow;
5457
- for (row = 0; row < numMonths[0]; row++) {
5458
- group = "";
5459
- this.maxRows = 4;
5460
- for (col = 0; col < numMonths[1]; col++) {
5461
- selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
5462
- cornerClass = " ui-corner-all";
5463
- calender = "";
5464
- if (isMultiMonth) {
5465
- calender += "<div class='ui-datepicker-group";
5466
- if (numMonths[1] > 1) {
5467
- switch (col) {
5468
- case 0: calender += " ui-datepicker-group-first";
5469
- cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
5470
- case numMonths[1]-1: calender += " ui-datepicker-group-last";
5471
- cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
5472
- default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
5473
- }
5474
- }
5475
- calender += "'>";
5476
- }
5477
- calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
5478
- (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
5479
- (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
5480
- this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
5481
- row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
5482
- "</div><table class='ui-datepicker-calendar'><thead>" +
5483
- "<tr>";
5484
- thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
5485
- for (dow = 0; dow < 7; dow++) { // days of the week
5486
- day = (dow + firstDay) % 7;
5487
- thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
5488
- "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
5489
- }
5490
- calender += thead + "</tr></thead><tbody>";
5491
- daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
5492
- if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
5493
- inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
5494
- }
5495
- leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
5496
- curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
5497
- numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
5498
- this.maxRows = numRows;
5499
- printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
5500
- for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
5501
- calender += "<tr>";
5502
- tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
5503
- this._get(inst, "calculateWeek")(printDate) + "</td>");
5504
- for (dow = 0; dow < 7; dow++) { // create date picker days
5505
- daySettings = (beforeShowDay ?
5506
- beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
5507
- otherMonth = (printDate.getMonth() !== drawMonth);
5508
- unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
5509
- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
5510
- tbody += "<td class='" +
5511
- ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
5512
- (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
5513
- ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
5514
- (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
5515
- // or defaultDate is current printedDate and defaultDate is selectedDate
5516
- " " + this._dayOverClass : "") + // highlight selected day
5517
- (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days
5518
- (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
5519
- (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
5520
- (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
5521
- ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
5522
- (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
5523
- (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
5524
- (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
5525
- (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
5526
- (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
5527
- (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
5528
- "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
5529
- printDate.setDate(printDate.getDate() + 1);
5530
- printDate = this._daylightSavingAdjust(printDate);
5531
- }
5532
- calender += tbody + "</tr>";
5533
- }
5534
- drawMonth++;
5535
- if (drawMonth > 11) {
5536
- drawMonth = 0;
5537
- drawYear++;
5538
- }
5539
- calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
5540
- ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
5541
- group += calender;
5542
- }
5543
- html += group;
5544
- }
5545
- html += buttonPanel;
5546
- inst._keyEvent = false;
5547
- return html;
5548
- },
5549
-
5550
- /* Generate the month and year header. */
5551
- _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
5552
- secondary, monthNames, monthNamesShort) {
5553
-
5554
- var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
5555
- changeMonth = this._get(inst, "changeMonth"),
5556
- changeYear = this._get(inst, "changeYear"),
5557
- showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
5558
- html = "<div class='ui-datepicker-title'>",
5559
- monthHtml = "";
5560
-
5561
- // month selection
5562
- if (secondary || !changeMonth) {
5563
- monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
5564
- } else {
5565
- inMinYear = (minDate && minDate.getFullYear() === drawYear);
5566
- inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
5567
- monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
5568
- for ( month = 0; month < 12; month++) {
5569
- if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
5570
- monthHtml += "<option value='" + month + "'" +
5571
- (month === drawMonth ? " selected='selected'" : "") +
5572
- ">" + monthNamesShort[month] + "</option>";
5573
- }
5574
- }
5575
- monthHtml += "</select>";
5576
- }
5577
-
5578
- if (!showMonthAfterYear) {
5579
- html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
5580
- }
5581
-
5582
- // year selection
5583
- if ( !inst.yearshtml ) {
5584
- inst.yearshtml = "";
5585
- if (secondary || !changeYear) {
5586
- html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
5587
- } else {
5588
- // determine range of years to display
5589
- years = this._get(inst, "yearRange").split(":");
5590
- thisYear = new Date().getFullYear();
5591
- determineYear = function(value) {
5592
- var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
5593
- (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
5594
- parseInt(value, 10)));
5595
- return (isNaN(year) ? thisYear : year);
5596
- };
5597
- year = determineYear(years[0]);
5598
- endYear = Math.max(year, determineYear(years[1] || ""));
5599
- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
5600
- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
5601
- inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
5602
- for (; year <= endYear; year++) {
5603
- inst.yearshtml += "<option value='" + year + "'" +
5604
- (year === drawYear ? " selected='selected'" : "") +
5605
- ">" + year + "</option>";
5606
- }
5607
- inst.yearshtml += "</select>";
5608
-
5609
- html += inst.yearshtml;
5610
- inst.yearshtml = null;
5611
- }
5612
- }
5613
-
5614
- html += this._get(inst, "yearSuffix");
5615
- if (showMonthAfterYear) {
5616
- html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
5617
- }
5618
- html += "</div>"; // Close datepicker_header
5619
- return html;
5620
- },
5621
-
5622
- /* Adjust one of the date sub-fields. */
5623
- _adjustInstDate: function(inst, offset, period) {
5624
- var year = inst.drawYear + (period === "Y" ? offset : 0),
5625
- month = inst.drawMonth + (period === "M" ? offset : 0),
5626
- day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
5627
- date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
5628
-
5629
- inst.selectedDay = date.getDate();
5630
- inst.drawMonth = inst.selectedMonth = date.getMonth();
5631
- inst.drawYear = inst.selectedYear = date.getFullYear();
5632
- if (period === "M" || period === "Y") {
5633
- this._notifyChange(inst);
5634
- }
5635
- },
5636
-
5637
- /* Ensure a date is within any min/max bounds. */
5638
- _restrictMinMax: function(inst, date) {
5639
- var minDate = this._getMinMaxDate(inst, "min"),
5640
- maxDate = this._getMinMaxDate(inst, "max"),
5641
- newDate = (minDate && date < minDate ? minDate : date);
5642
- return (maxDate && newDate > maxDate ? maxDate : newDate);
5643
- },
5644
-
5645
- /* Notify change of month/year. */
5646
- _notifyChange: function(inst) {
5647
- var onChange = this._get(inst, "onChangeMonthYear");
5648
- if (onChange) {
5649
- onChange.apply((inst.input ? inst.input[0] : null),
5650
- [inst.selectedYear, inst.selectedMonth + 1, inst]);
5651
- }
5652
- },
5653
-
5654
- /* Determine the number of months to show. */
5655
- _getNumberOfMonths: function(inst) {
5656
- var numMonths = this._get(inst, "numberOfMonths");
5657
- return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
5658
- },
5659
-
5660
- /* Determine the current maximum date - ensure no time components are set. */
5661
- _getMinMaxDate: function(inst, minMax) {
5662
- return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
5663
- },
5664
-
5665
- /* Find the number of days in a given month. */
5666
- _getDaysInMonth: function(year, month) {
5667
- return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
5668
- },
5669
-
5670
- /* Find the day of the week of the first of a month. */
5671
- _getFirstDayOfMonth: function(year, month) {
5672
- return new Date(year, month, 1).getDay();
5673
- },
5674
-
5675
- /* Determines if we should allow a "next/prev" month display change. */
5676
- _canAdjustMonth: function(inst, offset, curYear, curMonth) {
5677
- var numMonths = this._getNumberOfMonths(inst),
5678
- date = this._daylightSavingAdjust(new Date(curYear,
5679
- curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
5680
-
5681
- if (offset < 0) {
5682
- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
5683
- }
5684
- return this._isInRange(inst, date);
5685
- },
5686
-
5687
- /* Is the given date in the accepted range? */
5688
- _isInRange: function(inst, date) {
5689
- var yearSplit, currentYear,
5690
- minDate = this._getMinMaxDate(inst, "min"),
5691
- maxDate = this._getMinMaxDate(inst, "max"),
5692
- minYear = null,
5693
- maxYear = null,
5694
- years = this._get(inst, "yearRange");
5695
- if (years){
5696
- yearSplit = years.split(":");
5697
- currentYear = new Date().getFullYear();
5698
- minYear = parseInt(yearSplit[0], 10);
5699
- maxYear = parseInt(yearSplit[1], 10);
5700
- if ( yearSplit[0].match(/[+\-].*/) ) {
5701
- minYear += currentYear;
5702
- }
5703
- if ( yearSplit[1].match(/[+\-].*/) ) {
5704
- maxYear += currentYear;
5705
- }
5706
- }
5707
-
5708
- return ((!minDate || date.getTime() >= minDate.getTime()) &&
5709
- (!maxDate || date.getTime() <= maxDate.getTime()) &&
5710
- (!minYear || date.getFullYear() >= minYear) &&
5711
- (!maxYear || date.getFullYear() <= maxYear));
5712
- },
5713
-
5714
- /* Provide the configuration settings for formatting/parsing. */
5715
- _getFormatConfig: function(inst) {
5716
- var shortYearCutoff = this._get(inst, "shortYearCutoff");
5717
- shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
5718
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
5719
- return {shortYearCutoff: shortYearCutoff,
5720
- dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
5721
- monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
5722
- },
5723
-
5724
- /* Format the given date for display. */
5725
- _formatDate: function(inst, day, month, year) {
5726
- if (!day) {
5727
- inst.currentDay = inst.selectedDay;
5728
- inst.currentMonth = inst.selectedMonth;
5729
- inst.currentYear = inst.selectedYear;
5730
- }
5731
- var date = (day ? (typeof day === "object" ? day :
5732
- this._daylightSavingAdjust(new Date(year, month, day))) :
5733
- this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
5734
- return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
5735
- }
5736
- });
5737
-
5738
- /*
5739
- * Bind hover events for datepicker elements.
5740
- * Done via delegate so the binding only occurs once in the lifetime of the parent div.
5741
- * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
5742
- */
5743
- function datepicker_bindHover(dpDiv) {
5744
- var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
5745
- return dpDiv.delegate(selector, "mouseout", function() {
5746
- $(this).removeClass("ui-state-hover");
5747
- if (this.className.indexOf("ui-datepicker-prev") !== -1) {
5748
- $(this).removeClass("ui-datepicker-prev-hover");
5749
- }
5750
- if (this.className.indexOf("ui-datepicker-next") !== -1) {
5751
- $(this).removeClass("ui-datepicker-next-hover");
5752
- }
5753
- })
5754
- .delegate( selector, "mouseover", datepicker_handleMouseover );
5755
- }
5756
-
5757
- function datepicker_handleMouseover() {
5758
- if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
5759
- $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
5760
- $(this).addClass("ui-state-hover");
5761
- if (this.className.indexOf("ui-datepicker-prev") !== -1) {
5762
- $(this).addClass("ui-datepicker-prev-hover");
5763
- }
5764
- if (this.className.indexOf("ui-datepicker-next") !== -1) {
5765
- $(this).addClass("ui-datepicker-next-hover");
5766
- }
5767
- }
5768
- }
5769
-
5770
- /* jQuery extend now ignores nulls! */
5771
- function datepicker_extendRemove(target, props) {
5772
- $.extend(target, props);
5773
- for (var name in props) {
5774
- if (props[name] == null) {
5775
- target[name] = props[name];
5776
- }
5777
- }
5778
- return target;
5779
- }
5780
-
5781
- /* Invoke the datepicker functionality.
5782
- @param options string - a command, optionally followed by additional parameters or
5783
- Object - settings for attaching new datepicker functionality
5784
- @return jQuery object */
5785
- $.fn.datepicker = function(options){
5786
-
5787
- /* Verify an empty collection wasn't passed - Fixes #6976 */
5788
- if ( !this.length ) {
5789
- return this;
5790
- }
5791
-
5792
- /* Initialise the date picker. */
5793
- if (!$.datepicker.initialized) {
5794
- $(document).mousedown($.datepicker._checkExternalClick);
5795
- $.datepicker.initialized = true;
5796
- }
5797
-
5798
- /* Append datepicker main container to body if not exist. */
5799
- if ($("#"+$.datepicker._mainDivId).length === 0) {
5800
- $("body").append($.datepicker.dpDiv);
5801
- }
5802
-
5803
- var otherArgs = Array.prototype.slice.call(arguments, 1);
5804
- if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
5805
- return $.datepicker["_" + options + "Datepicker"].
5806
- apply($.datepicker, [this[0]].concat(otherArgs));
5807
- }
5808
- if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
5809
- return $.datepicker["_" + options + "Datepicker"].
5810
- apply($.datepicker, [this[0]].concat(otherArgs));
5811
- }
5812
- return this.each(function() {
5813
- typeof options === "string" ?
5814
- $.datepicker["_" + options + "Datepicker"].
5815
- apply($.datepicker, [this].concat(otherArgs)) :
5816
- $.datepicker._attachDatepicker(this, options);
5817
- });
5818
- };
5819
-
5820
- $.datepicker = new Datepicker(); // singleton instance
5821
- $.datepicker.initialized = false;
5822
- $.datepicker.uuid = new Date().getTime();
5823
- $.datepicker.version = "1.11.2";
5824
-
5825
- var datepicker = $.datepicker;
5826
-
5827
-
5828
- /*!
5829
- * jQuery UI Draggable 1.11.2
5830
- * http://jqueryui.com
5831
- *
5832
- * Copyright 2014 jQuery Foundation and other contributors
5833
- * Released under the MIT license.
5834
- * http://jquery.org/license
5835
- *
5836
- * http://api.jqueryui.com/draggable/
5837
- */
5838
-
5839
-
5840
- $.widget("ui.draggable", $.ui.mouse, {
5841
- version: "1.11.2",
5842
- widgetEventPrefix: "drag",
5843
- options: {
5844
- addClasses: true,
5845
- appendTo: "parent",
5846
- axis: false,
5847
- connectToSortable: false,
5848
- containment: false,
5849
- cursor: "auto",
5850
- cursorAt: false,
5851
- grid: false,
5852
- handle: false,
5853
- helper: "original",
5854
- iframeFix: false,
5855
- opacity: false,
5856
- refreshPositions: false,
5857
- revert: false,
5858
- revertDuration: 500,
5859
- scope: "default",
5860
- scroll: true,
5861
- scrollSensitivity: 20,
5862
- scrollSpeed: 20,
5863
- snap: false,
5864
- snapMode: "both",
5865
- snapTolerance: 20,
5866
- stack: false,
5867
- zIndex: false,
5868
-
5869
- // callbacks
5870
- drag: null,
5871
- start: null,
5872
- stop: null
5873
- },
5874
- _create: function() {
5875
-
5876
- if ( this.options.helper === "original" ) {
5877
- this._setPositionRelative();
5878
- }
5879
- if (this.options.addClasses){
5880
- this.element.addClass("ui-draggable");
5881
- }
5882
- if (this.options.disabled){
5883
- this.element.addClass("ui-draggable-disabled");
5884
- }
5885
- this._setHandleClassName();
5886
-
5887
- this._mouseInit();
5888
- },
5889
-
5890
- _setOption: function( key, value ) {
5891
- this._super( key, value );
5892
- if ( key === "handle" ) {
5893
- this._removeHandleClassName();
5894
- this._setHandleClassName();
5895
- }
5896
- },
5897
-
5898
- _destroy: function() {
5899
- if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
5900
- this.destroyOnClear = true;
5901
- return;
5902
- }
5903
- this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
5904
- this._removeHandleClassName();
5905
- this._mouseDestroy();
5906
- },
5907
-
5908
- _mouseCapture: function(event) {
5909
- var o = this.options;
5910
-
5911
- this._blurActiveElement( event );
5912
-
5913
- // among others, prevent a drag on a resizable-handle
5914
- if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
5915
- return false;
5916
- }
5917
-
5918
- //Quit if we're not on a valid handle
5919
- this.handle = this._getHandle(event);
5920
- if (!this.handle) {
5921
- return false;
5922
- }
5923
-
5924
- this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
5925
-
5926
- return true;
5927
-
5928
- },
5929
-
5930
- _blockFrames: function( selector ) {
5931
- this.iframeBlocks = this.document.find( selector ).map(function() {
5932
- var iframe = $( this );
5933
-
5934
- return $( "<div>" )
5935
- .css( "position", "absolute" )
5936
- .appendTo( iframe.parent() )
5937
- .outerWidth( iframe.outerWidth() )
5938
- .outerHeight( iframe.outerHeight() )
5939
- .offset( iframe.offset() )[ 0 ];
5940
- });
5941
- },
5942
-
5943
- _unblockFrames: function() {
5944
- if ( this.iframeBlocks ) {
5945
- this.iframeBlocks.remove();
5946
- delete this.iframeBlocks;
5947
- }
5948
- },
5949
-
5950
- _blurActiveElement: function( event ) {
5951
- var document = this.document[ 0 ];
5952
-
5953
- // Only need to blur if the event occurred on the draggable itself, see #10527
5954
- if ( !this.handleElement.is( event.target ) ) {
5955
- return;
5956
- }
5957
-
5958
- // support: IE9
5959
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
5960
- try {
5961
-
5962
- // Support: IE9, IE10
5963
- // If the <body> is blurred, IE will switch windows, see #9520
5964
- if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
5965
-
5966
- // Blur any element that currently has focus, see #4261
5967
- $( document.activeElement ).blur();
5968
- }
5969
- } catch ( error ) {}
5970
- },
5971
-
5972
- _mouseStart: function(event) {
5973
-
5974
- var o = this.options;
5975
-
5976
- //Create and append the visible helper
5977
- this.helper = this._createHelper(event);
5978
-
5979
- this.helper.addClass("ui-draggable-dragging");
5980
-
5981
- //Cache the helper size
5982
- this._cacheHelperProportions();
5983
-
5984
- //If ddmanager is used for droppables, set the global draggable
5985
- if ($.ui.ddmanager) {
5986
- $.ui.ddmanager.current = this;
5987
- }
5988
-
5989
- /*
5990
- * - Position generation -
5991
- * This block generates everything position related - it's the core of draggables.
5992
- */
5993
-
5994
- //Cache the margins of the original element
5995
- this._cacheMargins();
5996
-
5997
- //Store the helper's css position
5998
- this.cssPosition = this.helper.css( "position" );
5999
- this.scrollParent = this.helper.scrollParent( true );
6000
- this.offsetParent = this.helper.offsetParent();
6001
- this.hasFixedAncestor = this.helper.parents().filter(function() {
6002
- return $( this ).css( "position" ) === "fixed";
6003
- }).length > 0;
6004
-
6005
- //The element's absolute position on the page minus margins
6006
- this.positionAbs = this.element.offset();
6007
- this._refreshOffsets( event );
6008
-
6009
- //Generate the original position
6010
- this.originalPosition = this.position = this._generatePosition( event, false );
6011
- this.originalPageX = event.pageX;
6012
- this.originalPageY = event.pageY;
6013
-
6014
- //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
6015
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
6016
-
6017
- //Set a containment if given in the options
6018
- this._setContainment();
6019
-
6020
- //Trigger event + callbacks
6021
- if (this._trigger("start", event) === false) {
6022
- this._clear();
6023
- return false;
6024
- }
6025
-
6026
- //Recache the helper size
6027
- this._cacheHelperProportions();
6028
-
6029
- //Prepare the droppable offsets
6030
- if ($.ui.ddmanager && !o.dropBehaviour) {
6031
- $.ui.ddmanager.prepareOffsets(this, event);
6032
- }
6033
-
6034
- // Reset helper's right/bottom css if they're set and set explicit width/height instead
6035
- // as this prevents resizing of elements with right/bottom set (see #7772)
6036
- this._normalizeRightBottom();
6037
-
6038
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
6039
-
6040
- //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
6041
- if ( $.ui.ddmanager ) {
6042
- $.ui.ddmanager.dragStart(this, event);
6043
- }
6044
-
6045
- return true;
6046
- },
6047
-
6048
- _refreshOffsets: function( event ) {
6049
- this.offset = {
6050
- top: this.positionAbs.top - this.margins.top,
6051
- left: this.positionAbs.left - this.margins.left,
6052
- scroll: false,
6053
- parent: this._getParentOffset(),
6054
- relative: this._getRelativeOffset()
6055
- };
6056
-
6057
- this.offset.click = {
6058
- left: event.pageX - this.offset.left,
6059
- top: event.pageY - this.offset.top
6060
- };
6061
- },
6062
-
6063
- _mouseDrag: function(event, noPropagation) {
6064
- // reset any necessary cached properties (see #5009)
6065
- if ( this.hasFixedAncestor ) {
6066
- this.offset.parent = this._getParentOffset();
6067
- }
6068
-
6069
- //Compute the helpers position
6070
- this.position = this._generatePosition( event, true );
6071
- this.positionAbs = this._convertPositionTo("absolute");
6072
-
6073
- //Call plugins and callbacks and use the resulting position if something is returned
6074
- if (!noPropagation) {
6075
- var ui = this._uiHash();
6076
- if (this._trigger("drag", event, ui) === false) {
6077
- this._mouseUp({});
6078
- return false;
6079
- }
6080
- this.position = ui.position;
6081
- }
6082
-
6083
- this.helper[ 0 ].style.left = this.position.left + "px";
6084
- this.helper[ 0 ].style.top = this.position.top + "px";
6085
-
6086
- if ($.ui.ddmanager) {
6087
- $.ui.ddmanager.drag(this, event);
6088
- }
6089
-
6090
- return false;
6091
- },
6092
-
6093
- _mouseStop: function(event) {
6094
-
6095
- //If we are using droppables, inform the manager about the drop
6096
- var that = this,
6097
- dropped = false;
6098
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
6099
- dropped = $.ui.ddmanager.drop(this, event);
6100
- }
6101
-
6102
- //if a drop comes from outside (a sortable)
6103
- if (this.dropped) {
6104
- dropped = this.dropped;
6105
- this.dropped = false;
6106
- }
6107
-
6108
- 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))) {
6109
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
6110
- if (that._trigger("stop", event) !== false) {
6111
- that._clear();
6112
- }
6113
- });
6114
- } else {
6115
- if (this._trigger("stop", event) !== false) {
6116
- this._clear();
6117
- }
6118
- }
6119
-
6120
- return false;
6121
- },
6122
-
6123
- _mouseUp: function( event ) {
6124
- this._unblockFrames();
6125
-
6126
- //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
6127
- if ( $.ui.ddmanager ) {
6128
- $.ui.ddmanager.dragStop(this, event);
6129
- }
6130
-
6131
- // Only need to focus if the event occurred on the draggable itself, see #10527
6132
- if ( this.handleElement.is( event.target ) ) {
6133
- // The interaction is over; whether or not the click resulted in a drag, focus the element
6134
- this.element.focus();
6135
- }
6136
-
6137
- return $.ui.mouse.prototype._mouseUp.call(this, event);
6138
- },
6139
-
6140
- cancel: function() {
6141
-
6142
- if (this.helper.is(".ui-draggable-dragging")) {
6143
- this._mouseUp({});
6144
- } else {
6145
- this._clear();
6146
- }
6147
-
6148
- return this;
6149
-
6150
- },
6151
-
6152
- _getHandle: function(event) {
6153
- return this.options.handle ?
6154
- !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
6155
- true;
6156
- },
6157
-
6158
- _setHandleClassName: function() {
6159
- this.handleElement = this.options.handle ?
6160
- this.element.find( this.options.handle ) : this.element;
6161
- this.handleElement.addClass( "ui-draggable-handle" );
6162
- },
6163
-
6164
- _removeHandleClassName: function() {
6165
- this.handleElement.removeClass( "ui-draggable-handle" );
6166
- },
6167
-
6168
- _createHelper: function(event) {
6169
-
6170
- var o = this.options,
6171
- helperIsFunction = $.isFunction( o.helper ),
6172
- helper = helperIsFunction ?
6173
- $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
6174
- ( o.helper === "clone" ?
6175
- this.element.clone().removeAttr( "id" ) :
6176
- this.element );
6177
-
6178
- if (!helper.parents("body").length) {
6179
- helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
6180
- }
6181
-
6182
- // http://bugs.jqueryui.com/ticket/9446
6183
- // a helper function can return the original element
6184
- // which wouldn't have been set to relative in _create
6185
- if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
6186
- this._setPositionRelative();
6187
- }
6188
-
6189
- if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
6190
- helper.css("position", "absolute");
6191
- }
6192
-
6193
- return helper;
6194
-
6195
- },
6196
-
6197
- _setPositionRelative: function() {
6198
- if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
6199
- this.element[ 0 ].style.position = "relative";
6200
- }
6201
- },
6202
-
6203
- _adjustOffsetFromHelper: function(obj) {
6204
- if (typeof obj === "string") {
6205
- obj = obj.split(" ");
6206
- }
6207
- if ($.isArray(obj)) {
6208
- obj = { left: +obj[0], top: +obj[1] || 0 };
6209
- }
6210
- if ("left" in obj) {
6211
- this.offset.click.left = obj.left + this.margins.left;
6212
- }
6213
- if ("right" in obj) {
6214
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
6215
- }
6216
- if ("top" in obj) {
6217
- this.offset.click.top = obj.top + this.margins.top;
6218
- }
6219
- if ("bottom" in obj) {
6220
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
6221
- }
6222
- },
6223
-
6224
- _isRootNode: function( element ) {
6225
- return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
6226
- },
6227
-
6228
- _getParentOffset: function() {
6229
-
6230
- //Get the offsetParent and cache its position
6231
- var po = this.offsetParent.offset(),
6232
- document = this.document[ 0 ];
6233
-
6234
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
6235
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
6236
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
6237
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
6238
- if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
6239
- po.left += this.scrollParent.scrollLeft();
6240
- po.top += this.scrollParent.scrollTop();
6241
- }
6242
-
6243
- if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
6244
- po = { top: 0, left: 0 };
6245
- }
6246
-
6247
- return {
6248
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
6249
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
6250
- };
6251
-
6252
- },
6253
-
6254
- _getRelativeOffset: function() {
6255
- if ( this.cssPosition !== "relative" ) {
6256
- return { top: 0, left: 0 };
6257
- }
6258
-
6259
- var p = this.element.position(),
6260
- scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
6261
-
6262
- return {
6263
- top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
6264
- left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
6265
- };
6266
-
6267
- },
6268
-
6269
- _cacheMargins: function() {
6270
- this.margins = {
6271
- left: (parseInt(this.element.css("marginLeft"), 10) || 0),
6272
- top: (parseInt(this.element.css("marginTop"), 10) || 0),
6273
- right: (parseInt(this.element.css("marginRight"), 10) || 0),
6274
- bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
6275
- };
6276
- },
6277
-
6278
- _cacheHelperProportions: function() {
6279
- this.helperProportions = {
6280
- width: this.helper.outerWidth(),
6281
- height: this.helper.outerHeight()
6282
- };
6283
- },
6284
-
6285
- _setContainment: function() {
6286
-
6287
- var isUserScrollable, c, ce,
6288
- o = this.options,
6289
- document = this.document[ 0 ];
6290
-
6291
- this.relativeContainer = null;
6292
-
6293
- if ( !o.containment ) {
6294
- this.containment = null;
6295
- return;
6296
- }
6297
-
6298
- if ( o.containment === "window" ) {
6299
- this.containment = [
6300
- $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
6301
- $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
6302
- $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
6303
- $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
6304
- ];
6305
- return;
6306
- }
6307
-
6308
- if ( o.containment === "document") {
6309
- this.containment = [
6310
- 0,
6311
- 0,
6312
- $( document ).width() - this.helperProportions.width - this.margins.left,
6313
- ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
6314
- ];
6315
- return;
6316
- }
6317
-
6318
- if ( o.containment.constructor === Array ) {
6319
- this.containment = o.containment;
6320
- return;
6321
- }
6322
-
6323
- if ( o.containment === "parent" ) {
6324
- o.containment = this.helper[ 0 ].parentNode;
6325
- }
6326
-
6327
- c = $( o.containment );
6328
- ce = c[ 0 ];
6329
-
6330
- if ( !ce ) {
6331
- return;
6332
- }
6333
-
6334
- isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
6335
-
6336
- this.containment = [
6337
- ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
6338
- ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
6339
- ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
6340
- ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
6341
- ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
6342
- this.helperProportions.width -
6343
- this.margins.left -
6344
- this.margins.right,
6345
- ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
6346
- ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
6347
- ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
6348
- this.helperProportions.height -
6349
- this.margins.top -
6350
- this.margins.bottom
6351
- ];
6352
- this.relativeContainer = c;
6353
- },
6354
-
6355
- _convertPositionTo: function(d, pos) {
6356
-
6357
- if (!pos) {
6358
- pos = this.position;
6359
- }
6360
-
6361
- var mod = d === "absolute" ? 1 : -1,
6362
- scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
6363
-
6364
- return {
6365
- top: (
6366
- pos.top + // The absolute mouse position
6367
- this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
6368
- this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
6369
- ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
6370
- ),
6371
- left: (
6372
- pos.left + // The absolute mouse position
6373
- this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
6374
- this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
6375
- ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
6376
- )
6377
- };
6378
-
6379
- },
6380
-
6381
- _generatePosition: function( event, constrainPosition ) {
6382
-
6383
- var containment, co, top, left,
6384
- o = this.options,
6385
- scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
6386
- pageX = event.pageX,
6387
- pageY = event.pageY;
6388
-
6389
- // Cache the scroll
6390
- if ( !scrollIsRootNode || !this.offset.scroll ) {
6391
- this.offset.scroll = {
6392
- top: this.scrollParent.scrollTop(),
6393
- left: this.scrollParent.scrollLeft()
6394
- };
6395
- }
6396
-
6397
- /*
6398
- * - Position constraining -
6399
- * Constrain the position to a mix of grid, containment.
6400
- */
6401
-
6402
- // If we are not dragging yet, we won't check for options
6403
- if ( constrainPosition ) {
6404
- if ( this.containment ) {
6405
- if ( this.relativeContainer ){
6406
- co = this.relativeContainer.offset();
6407
- containment = [
6408
- this.containment[ 0 ] + co.left,
6409
- this.containment[ 1 ] + co.top,
6410
- this.containment[ 2 ] + co.left,
6411
- this.containment[ 3 ] + co.top
6412
- ];
6413
- } else {
6414
- containment = this.containment;
6415
- }
6416
-
6417
- if (event.pageX - this.offset.click.left < containment[0]) {
6418
- pageX = containment[0] + this.offset.click.left;
6419
- }
6420
- if (event.pageY - this.offset.click.top < containment[1]) {
6421
- pageY = containment[1] + this.offset.click.top;
6422
- }
6423
- if (event.pageX - this.offset.click.left > containment[2]) {
6424
- pageX = containment[2] + this.offset.click.left;
6425
- }
6426
- if (event.pageY - this.offset.click.top > containment[3]) {
6427
- pageY = containment[3] + this.offset.click.top;
6428
- }
6429
- }
6430
-
6431
- if (o.grid) {
6432
- //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
6433
- top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
6434
- 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;
6435
-
6436
- left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
6437
- 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;
6438
- }
6439
-
6440
- if ( o.axis === "y" ) {
6441
- pageX = this.originalPageX;
6442
- }
6443
-
6444
- if ( o.axis === "x" ) {
6445
- pageY = this.originalPageY;
6446
- }
6447
- }
6448
-
6449
- return {
6450
- top: (
6451
- pageY - // The absolute mouse position
6452
- this.offset.click.top - // Click offset (relative to the element)
6453
- this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
6454
- this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
6455
- ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
6456
- ),
6457
- left: (
6458
- pageX - // The absolute mouse position
6459
- this.offset.click.left - // Click offset (relative to the element)
6460
- this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
6461
- this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
6462
- ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
6463
- )
6464
- };
6465
-
6466
- },
6467
-
6468
- _clear: function() {
6469
- this.helper.removeClass("ui-draggable-dragging");
6470
- if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
6471
- this.helper.remove();
6472
- }
6473
- this.helper = null;
6474
- this.cancelHelperRemoval = false;
6475
- if ( this.destroyOnClear ) {
6476
- this.destroy();
6477
- }
6478
- },
6479
-
6480
- _normalizeRightBottom: function() {
6481
- if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
6482
- this.helper.width( this.helper.width() );
6483
- this.helper.css( "right", "auto" );
6484
- }
6485
- if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
6486
- this.helper.height( this.helper.height() );
6487
- this.helper.css( "bottom", "auto" );
6488
- }
6489
- },
6490
-
6491
- // From now on bulk stuff - mainly helpers
6492
-
6493
- _trigger: function( type, event, ui ) {
6494
- ui = ui || this._uiHash();
6495
- $.ui.plugin.call( this, type, [ event, ui, this ], true );
6496
-
6497
- // Absolute position and offset (see #6884 ) have to be recalculated after plugins
6498
- if ( /^(drag|start|stop)/.test( type ) ) {
6499
- this.positionAbs = this._convertPositionTo( "absolute" );
6500
- ui.offset = this.positionAbs;
6501
- }
6502
- return $.Widget.prototype._trigger.call( this, type, event, ui );
6503
- },
6504
-
6505
- plugins: {},
6506
-
6507
- _uiHash: function() {
6508
- return {
6509
- helper: this.helper,
6510
- position: this.position,
6511
- originalPosition: this.originalPosition,
6512
- offset: this.positionAbs
6513
- };
6514
- }
6515
-
6516
- });
6517
-
6518
- $.ui.plugin.add( "draggable", "connectToSortable", {
6519
- start: function( event, ui, draggable ) {
6520
- var uiSortable = $.extend( {}, ui, {
6521
- item: draggable.element
6522
- });
6523
-
6524
- draggable.sortables = [];
6525
- $( draggable.options.connectToSortable ).each(function() {
6526
- var sortable = $( this ).sortable( "instance" );
6527
-
6528
- if ( sortable && !sortable.options.disabled ) {
6529
- draggable.sortables.push( sortable );
6530
-
6531
- // refreshPositions is called at drag start to refresh the containerCache
6532
- // which is used in drag. This ensures it's initialized and synchronized
6533
- // with any changes that might have happened on the page since initialization.
6534
- sortable.refreshPositions();
6535
- sortable._trigger("activate", event, uiSortable);
6536
- }
6537
- });
6538
- },
6539
- stop: function( event, ui, draggable ) {
6540
- var uiSortable = $.extend( {}, ui, {
6541
- item: draggable.element
6542
- });
6543
-
6544
- draggable.cancelHelperRemoval = false;
6545
-
6546
- $.each( draggable.sortables, function() {
6547
- var sortable = this;
6548
-
6549
- if ( sortable.isOver ) {
6550
- sortable.isOver = 0;
6551
-
6552
- // Allow this sortable to handle removing the helper
6553
- draggable.cancelHelperRemoval = true;
6554
- sortable.cancelHelperRemoval = false;
6555
-
6556
- // Use _storedCSS To restore properties in the sortable,
6557
- // as this also handles revert (#9675) since the draggable
6558
- // may have modified them in unexpected ways (#8809)
6559
- sortable._storedCSS = {
6560
- position: sortable.placeholder.css( "position" ),
6561
- top: sortable.placeholder.css( "top" ),
6562
- left: sortable.placeholder.css( "left" )
6563
- };
6564
-
6565
- sortable._mouseStop(event);
6566
-
6567
- // Once drag has ended, the sortable should return to using
6568
- // its original helper, not the shared helper from draggable
6569
- sortable.options.helper = sortable.options._helper;
6570
- } else {
6571
- // Prevent this Sortable from removing the helper.
6572
- // However, don't set the draggable to remove the helper
6573
- // either as another connected Sortable may yet handle the removal.
6574
- sortable.cancelHelperRemoval = true;
6575
-
6576
- sortable._trigger( "deactivate", event, uiSortable );
6577
- }
6578
- });
6579
- },
6580
- drag: function( event, ui, draggable ) {
6581
- $.each( draggable.sortables, function() {
6582
- var innermostIntersecting = false,
6583
- sortable = this;
6584
-
6585
- // Copy over variables that sortable's _intersectsWith uses
6586
- sortable.positionAbs = draggable.positionAbs;
6587
- sortable.helperProportions = draggable.helperProportions;
6588
- sortable.offset.click = draggable.offset.click;
6589
-
6590
- if ( sortable._intersectsWith( sortable.containerCache ) ) {
6591
- innermostIntersecting = true;
6592
-
6593
- $.each( draggable.sortables, function() {
6594
- // Copy over variables that sortable's _intersectsWith uses
6595
- this.positionAbs = draggable.positionAbs;
6596
- this.helperProportions = draggable.helperProportions;
6597
- this.offset.click = draggable.offset.click;
6598
-
6599
- if ( this !== sortable &&
6600
- this._intersectsWith( this.containerCache ) &&
6601
- $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
6602
- innermostIntersecting = false;
6603
- }
6604
-
6605
- return innermostIntersecting;
6606
- });
6607
- }
6608
-
6609
- if ( innermostIntersecting ) {
6610
- // If it intersects, we use a little isOver variable and set it once,
6611
- // so that the move-in stuff gets fired only once.
6612
- if ( !sortable.isOver ) {
6613
- sortable.isOver = 1;
6614
-
6615
- sortable.currentItem = ui.helper
6616
- .appendTo( sortable.element )
6617
- .data( "ui-sortable-item", true );
6618
-
6619
- // Store helper option to later restore it
6620
- sortable.options._helper = sortable.options.helper;
6621
-
6622
- sortable.options.helper = function() {
6623
- return ui.helper[ 0 ];
6624
- };
6625
-
6626
- // Fire the start events of the sortable with our passed browser event,
6627
- // and our own helper (so it doesn't create a new one)
6628
- event.target = sortable.currentItem[ 0 ];
6629
- sortable._mouseCapture( event, true );
6630
- sortable._mouseStart( event, true, true );
6631
-
6632
- // Because the browser event is way off the new appended portlet,
6633
- // modify necessary variables to reflect the changes
6634
- sortable.offset.click.top = draggable.offset.click.top;
6635
- sortable.offset.click.left = draggable.offset.click.left;
6636
- sortable.offset.parent.left -= draggable.offset.parent.left -
6637
- sortable.offset.parent.left;
6638
- sortable.offset.parent.top -= draggable.offset.parent.top -
6639
- sortable.offset.parent.top;
6640
-
6641
- draggable._trigger( "toSortable", event );
6642
-
6643
- // Inform draggable that the helper is in a valid drop zone,
6644
- // used solely in the revert option to handle "valid/invalid".
6645
- draggable.dropped = sortable.element;
6646
-
6647
- // Need to refreshPositions of all sortables in the case that
6648
- // adding to one sortable changes the location of the other sortables (#9675)
6649
- $.each( draggable.sortables, function() {
6650
- this.refreshPositions();
6651
- });
6652
-
6653
- // hack so receive/update callbacks work (mostly)
6654
- draggable.currentItem = draggable.element;
6655
- sortable.fromOutside = draggable;
6656
- }
6657
-
6658
- if ( sortable.currentItem ) {
6659
- sortable._mouseDrag( event );
6660
- // Copy the sortable's position because the draggable's can potentially reflect
6661
- // a relative position, while sortable is always absolute, which the dragged
6662
- // element has now become. (#8809)
6663
- ui.position = sortable.position;
6664
- }
6665
- } else {
6666
- // If it doesn't intersect with the sortable, and it intersected before,
6667
- // we fake the drag stop of the sortable, but make sure it doesn't remove
6668
- // the helper by using cancelHelperRemoval.
6669
- if ( sortable.isOver ) {
6670
-
6671
- sortable.isOver = 0;
6672
- sortable.cancelHelperRemoval = true;
6673
-
6674
- // Calling sortable's mouseStop would trigger a revert,
6675
- // so revert must be temporarily false until after mouseStop is called.
6676
- sortable.options._revert = sortable.options.revert;
6677
- sortable.options.revert = false;
6678
-
6679
- sortable._trigger( "out", event, sortable._uiHash( sortable ) );
6680
- sortable._mouseStop( event, true );
6681
-
6682
- // restore sortable behaviors that were modfied
6683
- // when the draggable entered the sortable area (#9481)
6684
- sortable.options.revert = sortable.options._revert;
6685
- sortable.options.helper = sortable.options._helper;
6686
-
6687
- if ( sortable.placeholder ) {
6688
- sortable.placeholder.remove();
6689
- }
6690
-
6691
- // Recalculate the draggable's offset considering the sortable
6692
- // may have modified them in unexpected ways (#8809)
6693
- draggable._refreshOffsets( event );
6694
- ui.position = draggable._generatePosition( event, true );
6695
-
6696
- draggable._trigger( "fromSortable", event );
6697
-
6698
- // Inform draggable that the helper is no longer in a valid drop zone
6699
- draggable.dropped = false;
6700
-
6701
- // Need to refreshPositions of all sortables just in case removing
6702
- // from one sortable changes the location of other sortables (#9675)
6703
- $.each( draggable.sortables, function() {
6704
- this.refreshPositions();
6705
- });
6706
- }
6707
- }
6708
- });
6709
- }
6710
- });
6711
-
6712
- $.ui.plugin.add("draggable", "cursor", {
6713
- start: function( event, ui, instance ) {
6714
- var t = $( "body" ),
6715
- o = instance.options;
6716
-
6717
- if (t.css("cursor")) {
6718
- o._cursor = t.css("cursor");
6719
- }
6720
- t.css("cursor", o.cursor);
6721
- },
6722
- stop: function( event, ui, instance ) {
6723
- var o = instance.options;
6724
- if (o._cursor) {
6725
- $("body").css("cursor", o._cursor);
6726
- }
6727
- }
6728
- });
6729
-
6730
- $.ui.plugin.add("draggable", "opacity", {
6731
- start: function( event, ui, instance ) {
6732
- var t = $( ui.helper ),
6733
- o = instance.options;
6734
- if (t.css("opacity")) {
6735
- o._opacity = t.css("opacity");
6736
- }
6737
- t.css("opacity", o.opacity);
6738
- },
6739
- stop: function( event, ui, instance ) {
6740
- var o = instance.options;
6741
- if (o._opacity) {
6742
- $(ui.helper).css("opacity", o._opacity);
6743
- }
6744
- }
6745
- });
6746
-
6747
- $.ui.plugin.add("draggable", "scroll", {
6748
- start: function( event, ui, i ) {
6749
- if ( !i.scrollParentNotHidden ) {
6750
- i.scrollParentNotHidden = i.helper.scrollParent( false );
6751
- }
6752
-
6753
- if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
6754
- i.overflowOffset = i.scrollParentNotHidden.offset();
6755
- }
6756
- },
6757
- drag: function( event, ui, i ) {
6758
-
6759
- var o = i.options,
6760
- scrolled = false,
6761
- scrollParent = i.scrollParentNotHidden[ 0 ],
6762
- document = i.document[ 0 ];
6763
-
6764
- if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
6765
- if ( !o.axis || o.axis !== "x" ) {
6766
- if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
6767
- scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
6768
- } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
6769
- scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
6770
- }
6771
- }
6772
-
6773
- if ( !o.axis || o.axis !== "y" ) {
6774
- if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
6775
- scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
6776
- } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
6777
- scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
6778
- }
6779
- }
6780
-
6781
- } else {
6782
-
6783
- if (!o.axis || o.axis !== "x") {
6784
- if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
6785
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
6786
- } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
6787
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
6788
- }
6789
- }
6790
-
6791
- if (!o.axis || o.axis !== "y") {
6792
- if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
6793
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
6794
- } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
6795
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
6796
- }
6797
- }
6798
-
6799
- }
6800
-
6801
- if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
6802
- $.ui.ddmanager.prepareOffsets(i, event);
6803
- }
6804
-
6805
- }
6806
- });
6807
-
6808
- $.ui.plugin.add("draggable", "snap", {
6809
- start: function( event, ui, i ) {
6810
-
6811
- var o = i.options;
6812
-
6813
- i.snapElements = [];
6814
-
6815
- $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
6816
- var $t = $(this),
6817
- $o = $t.offset();
6818
- if (this !== i.element[0]) {
6819
- i.snapElements.push({
6820
- item: this,
6821
- width: $t.outerWidth(), height: $t.outerHeight(),
6822
- top: $o.top, left: $o.left
6823
- });
6824
- }
6825
- });
6826
-
6827
- },
6828
- drag: function( event, ui, inst ) {
6829
-
6830
- var ts, bs, ls, rs, l, r, t, b, i, first,
6831
- o = inst.options,
6832
- d = o.snapTolerance,
6833
- x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
6834
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
6835
-
6836
- for (i = inst.snapElements.length - 1; i >= 0; i--){
6837
-
6838
- l = inst.snapElements[i].left - inst.margins.left;
6839
- r = l + inst.snapElements[i].width;
6840
- t = inst.snapElements[i].top - inst.margins.top;
6841
- b = t + inst.snapElements[i].height;
6842
-
6843
- if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
6844
- if (inst.snapElements[i].snapping) {
6845
- (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
6846
- }
6847
- inst.snapElements[i].snapping = false;
6848
- continue;
6849
- }
6850
-
6851
- if (o.snapMode !== "inner") {
6852
- ts = Math.abs(t - y2) <= d;
6853
- bs = Math.abs(b - y1) <= d;
6854
- ls = Math.abs(l - x2) <= d;
6855
- rs = Math.abs(r - x1) <= d;
6856
- if (ts) {
6857
- ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
6858
- }
6859
- if (bs) {
6860
- ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
6861
- }
6862
- if (ls) {
6863
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
6864
- }
6865
- if (rs) {
6866
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
6867
- }
6868
- }
6869
-
6870
- first = (ts || bs || ls || rs);
6871
-
6872
- if (o.snapMode !== "outer") {
6873
- ts = Math.abs(t - y1) <= d;
6874
- bs = Math.abs(b - y2) <= d;
6875
- ls = Math.abs(l - x1) <= d;
6876
- rs = Math.abs(r - x2) <= d;
6877
- if (ts) {
6878
- ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
6879
- }
6880
- if (bs) {
6881
- ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
6882
- }
6883
- if (ls) {
6884
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
6885
- }
6886
- if (rs) {
6887
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
6888
- }
6889
- }
6890
-
6891
- if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
6892
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
6893
- }
6894
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
6895
-
6896
- }
6897
-
6898
- }
6899
- });
6900
-
6901
- $.ui.plugin.add("draggable", "stack", {
6902
- start: function( event, ui, instance ) {
6903
- var min,
6904
- o = instance.options,
6905
- group = $.makeArray($(o.stack)).sort(function(a, b) {
6906
- return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
6907
- });
6908
-
6909
- if (!group.length) { return; }
6910
-
6911
- min = parseInt($(group[0]).css("zIndex"), 10) || 0;
6912
- $(group).each(function(i) {
6913
- $(this).css("zIndex", min + i);
6914
- });
6915
- this.css("zIndex", (min + group.length));
6916
- }
6917
- });
6918
-
6919
- $.ui.plugin.add("draggable", "zIndex", {
6920
- start: function( event, ui, instance ) {
6921
- var t = $( ui.helper ),
6922
- o = instance.options;
6923
-
6924
- if (t.css("zIndex")) {
6925
- o._zIndex = t.css("zIndex");
6926
- }
6927
- t.css("zIndex", o.zIndex);
6928
- },
6929
- stop: function( event, ui, instance ) {
6930
- var o = instance.options;
6931
-
6932
- if (o._zIndex) {
6933
- $(ui.helper).css("zIndex", o._zIndex);
6934
- }
6935
- }
6936
- });
6937
-
6938
- var draggable = $.ui.draggable;
6939
-
6940
-
6941
- /*!
6942
- * jQuery UI Resizable 1.11.2
6943
- * http://jqueryui.com
6944
- *
6945
- * Copyright 2014 jQuery Foundation and other contributors
6946
- * Released under the MIT license.
6947
- * http://jquery.org/license
6948
- *
6949
- * http://api.jqueryui.com/resizable/
6950
- */
6951
-
6952
-
6953
- $.widget("ui.resizable", $.ui.mouse, {
6954
- version: "1.11.2",
6955
- widgetEventPrefix: "resize",
6956
- options: {
6957
- alsoResize: false,
6958
- animate: false,
6959
- animateDuration: "slow",
6960
- animateEasing: "swing",
6961
- aspectRatio: false,
6962
- autoHide: false,
6963
- containment: false,
6964
- ghost: false,
6965
- grid: false,
6966
- handles: "e,s,se",
6967
- helper: false,
6968
- maxHeight: null,
6969
- maxWidth: null,
6970
- minHeight: 10,
6971
- minWidth: 10,
6972
- // See #7960
6973
- zIndex: 90,
6974
-
6975
- // callbacks
6976
- resize: null,
6977
- start: null,
6978
- stop: null
6979
- },
6980
-
6981
- _num: function( value ) {
6982
- return parseInt( value, 10 ) || 0;
6983
- },
6984
-
6985
- _isNumber: function( value ) {
6986
- return !isNaN( parseInt( value, 10 ) );
6987
- },
6988
-
6989
- _hasScroll: function( el, a ) {
6990
-
6991
- if ( $( el ).css( "overflow" ) === "hidden") {
6992
- return false;
6993
- }
6994
-
6995
- var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
6996
- has = false;
6997
-
6998
- if ( el[ scroll ] > 0 ) {
6999
- return true;
7000
- }
7001
-
7002
- // TODO: determine which cases actually cause this to happen
7003
- // if the element doesn't have the scroll set, see if it's possible to
7004
- // set the scroll
7005
- el[ scroll ] = 1;
7006
- has = ( el[ scroll ] > 0 );
7007
- el[ scroll ] = 0;
7008
- return has;
7009
- },
7010
-
7011
- _create: function() {
7012
-
7013
- var n, i, handle, axis, hname,
7014
- that = this,
7015
- o = this.options;
7016
- this.element.addClass("ui-resizable");
7017
-
7018
- $.extend(this, {
7019
- _aspectRatio: !!(o.aspectRatio),
7020
- aspectRatio: o.aspectRatio,
7021
- originalElement: this.element,
7022
- _proportionallyResizeElements: [],
7023
- _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
7024
- });
7025
-
7026
- // Wrap the element if it cannot hold child nodes
7027
- if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
7028
-
7029
- this.element.wrap(
7030
- $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
7031
- position: this.element.css("position"),
7032
- width: this.element.outerWidth(),
7033
- height: this.element.outerHeight(),
7034
- top: this.element.css("top"),
7035
- left: this.element.css("left")
7036
- })
7037
- );
7038
-
7039
- this.element = this.element.parent().data(
7040
- "ui-resizable", this.element.resizable( "instance" )
7041
- );
7042
-
7043
- this.elementIsWrapper = true;
7044
-
7045
- this.element.css({
7046
- marginLeft: this.originalElement.css("marginLeft"),
7047
- marginTop: this.originalElement.css("marginTop"),
7048
- marginRight: this.originalElement.css("marginRight"),
7049
- marginBottom: this.originalElement.css("marginBottom")
7050
- });
7051
- this.originalElement.css({
7052
- marginLeft: 0,
7053
- marginTop: 0,
7054
- marginRight: 0,
7055
- marginBottom: 0
7056
- });
7057
- // support: Safari
7058
- // Prevent Safari textarea resize
7059
- this.originalResizeStyle = this.originalElement.css("resize");
7060
- this.originalElement.css("resize", "none");
7061
-
7062
- this._proportionallyResizeElements.push( this.originalElement.css({
7063
- position: "static",
7064
- zoom: 1,
7065
- display: "block"
7066
- }) );
7067
-
7068
- // support: IE9
7069
- // avoid IE jump (hard set the margin)
7070
- this.originalElement.css({ margin: this.originalElement.css("margin") });
7071
-
7072
- this._proportionallyResize();
7073
- }
7074
-
7075
- this.handles = o.handles ||
7076
- ( !$(".ui-resizable-handle", this.element).length ?
7077
- "e,s,se" : {
7078
- n: ".ui-resizable-n",
7079
- e: ".ui-resizable-e",
7080
- s: ".ui-resizable-s",
7081
- w: ".ui-resizable-w",
7082
- se: ".ui-resizable-se",
7083
- sw: ".ui-resizable-sw",
7084
- ne: ".ui-resizable-ne",
7085
- nw: ".ui-resizable-nw"
7086
- } );
7087
-
7088
- if (this.handles.constructor === String) {
7089
-
7090
- if ( this.handles === "all") {
7091
- this.handles = "n,e,s,w,se,sw,ne,nw";
7092
- }
7093
-
7094
- n = this.handles.split(",");
7095
- this.handles = {};
7096
-
7097
- for (i = 0; i < n.length; i++) {
7098
-
7099
- handle = $.trim(n[i]);
7100
- hname = "ui-resizable-" + handle;
7101
- axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
7102
-
7103
- axis.css({ zIndex: o.zIndex });
7104
-
7105
- // TODO : What's going on here?
7106
- if ("se" === handle) {
7107
- axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
7108
- }
7109
-
7110
- this.handles[handle] = ".ui-resizable-" + handle;
7111
- this.element.append(axis);
7112
- }
7113
-
7114
- }
7115
-
7116
- this._renderAxis = function(target) {
7117
-
7118
- var i, axis, padPos, padWrapper;
7119
-
7120
- target = target || this.element;
7121
-
7122
- for (i in this.handles) {
7123
-
7124
- if (this.handles[i].constructor === String) {
7125
- this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
7126
- }
7127
-
7128
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
7129
-
7130
- axis = $(this.handles[i], this.element);
7131
-
7132
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
7133
-
7134
- padPos = [ "padding",
7135
- /ne|nw|n/.test(i) ? "Top" :
7136
- /se|sw|s/.test(i) ? "Bottom" :
7137
- /^e$/.test(i) ? "Right" : "Left" ].join("");
7138
-
7139
- target.css(padPos, padWrapper);
7140
-
7141
- this._proportionallyResize();
7142
-
7143
- }
7144
-
7145
- // TODO: What's that good for? There's not anything to be executed left
7146
- if (!$(this.handles[i]).length) {
7147
- continue;
7148
- }
7149
- }
7150
- };
7151
-
7152
- // TODO: make renderAxis a prototype function
7153
- this._renderAxis(this.element);
7154
-
7155
- this._handles = $(".ui-resizable-handle", this.element)
7156
- .disableSelection();
7157
-
7158
- this._handles.mouseover(function() {
7159
- if (!that.resizing) {
7160
- if (this.className) {
7161
- axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
7162
- }
7163
- that.axis = axis && axis[1] ? axis[1] : "se";
7164
- }
7165
- });
7166
-
7167
- if (o.autoHide) {
7168
- this._handles.hide();
7169
- $(this.element)
7170
- .addClass("ui-resizable-autohide")
7171
- .mouseenter(function() {
7172
- if (o.disabled) {
7173
- return;
7174
- }
7175
- $(this).removeClass("ui-resizable-autohide");
7176
- that._handles.show();
7177
- })
7178
- .mouseleave(function() {
7179
- if (o.disabled) {
7180
- return;
7181
- }
7182
- if (!that.resizing) {
7183
- $(this).addClass("ui-resizable-autohide");
7184
- that._handles.hide();
7185
- }
7186
- });
7187
- }
7188
-
7189
- this._mouseInit();
7190
-
7191
- },
7192
-
7193
- _destroy: function() {
7194
-
7195
- this._mouseDestroy();
7196
-
7197
- var wrapper,
7198
- _destroy = function(exp) {
7199
- $(exp)
7200
- .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
7201
- .removeData("resizable")
7202
- .removeData("ui-resizable")
7203
- .unbind(".resizable")
7204
- .find(".ui-resizable-handle")
7205
- .remove();
7206
- };
7207
-
7208
- // TODO: Unwrap at same DOM position
7209
- if (this.elementIsWrapper) {
7210
- _destroy(this.element);
7211
- wrapper = this.element;
7212
- this.originalElement.css({
7213
- position: wrapper.css("position"),
7214
- width: wrapper.outerWidth(),
7215
- height: wrapper.outerHeight(),
7216
- top: wrapper.css("top"),
7217
- left: wrapper.css("left")
7218
- }).insertAfter( wrapper );
7219
- wrapper.remove();
7220
- }
7221
-
7222
- this.originalElement.css("resize", this.originalResizeStyle);
7223
- _destroy(this.originalElement);
7224
-
7225
- return this;
7226
- },
7227
-
7228
- _mouseCapture: function(event) {
7229
- var i, handle,
7230
- capture = false;
7231
-
7232
- for (i in this.handles) {
7233
- handle = $(this.handles[i])[0];
7234
- if (handle === event.target || $.contains(handle, event.target)) {
7235
- capture = true;
7236
- }
7237
- }
7238
-
7239
- return !this.options.disabled && capture;
7240
- },
7241
-
7242
- _mouseStart: function(event) {
7243
-
7244
- var curleft, curtop, cursor,
7245
- o = this.options,
7246
- el = this.element;
7247
-
7248
- this.resizing = true;
7249
-
7250
- this._renderProxy();
7251
-
7252
- curleft = this._num(this.helper.css("left"));
7253
- curtop = this._num(this.helper.css("top"));
7254
-
7255
- if (o.containment) {
7256
- curleft += $(o.containment).scrollLeft() || 0;
7257
- curtop += $(o.containment).scrollTop() || 0;
7258
- }
7259
-
7260
- this.offset = this.helper.offset();
7261
- this.position = { left: curleft, top: curtop };
7262
-
7263
- this.size = this._helper ? {
7264
- width: this.helper.width(),
7265
- height: this.helper.height()
7266
- } : {
7267
- width: el.width(),
7268
- height: el.height()
7269
- };
7270
-
7271
- this.originalSize = this._helper ? {
7272
- width: el.outerWidth(),
7273
- height: el.outerHeight()
7274
- } : {
7275
- width: el.width(),
7276
- height: el.height()
7277
- };
7278
-
7279
- this.sizeDiff = {
7280
- width: el.outerWidth() - el.width(),
7281
- height: el.outerHeight() - el.height()
7282
- };
7283
-
7284
- this.originalPosition = { left: curleft, top: curtop };
7285
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
7286
-
7287
- this.aspectRatio = (typeof o.aspectRatio === "number") ?
7288
- o.aspectRatio :
7289
- ((this.originalSize.width / this.originalSize.height) || 1);
7290
-
7291
- cursor = $(".ui-resizable-" + this.axis).css("cursor");
7292
- $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
7293
-
7294
- el.addClass("ui-resizable-resizing");
7295
- this._propagate("start", event);
7296
- return true;
7297
- },
7298
-
7299
- _mouseDrag: function(event) {
7300
-
7301
- var data, props,
7302
- smp = this.originalMousePosition,
7303
- a = this.axis,
7304
- dx = (event.pageX - smp.left) || 0,
7305
- dy = (event.pageY - smp.top) || 0,
7306
- trigger = this._change[a];
7307
-
7308
- this._updatePrevProperties();
7309
-
7310
- if (!trigger) {
7311
- return false;
7312
- }
7313
-
7314
- data = trigger.apply(this, [ event, dx, dy ]);
7315
-
7316
- this._updateVirtualBoundaries(event.shiftKey);
7317
- if (this._aspectRatio || event.shiftKey) {
7318
- data = this._updateRatio(data, event);
7319
- }
7320
-
7321
- data = this._respectSize(data, event);
7322
-
7323
- this._updateCache(data);
7324
-
7325
- this._propagate("resize", event);
7326
-
7327
- props = this._applyChanges();
7328
-
7329
- if ( !this._helper && this._proportionallyResizeElements.length ) {
7330
- this._proportionallyResize();
7331
- }
7332
-
7333
- if ( !$.isEmptyObject( props ) ) {
7334
- this._updatePrevProperties();
7335
- this._trigger( "resize", event, this.ui() );
7336
- this._applyChanges();
7337
- }
7338
-
7339
- return false;
7340
- },
7341
-
7342
- _mouseStop: function(event) {
7343
-
7344
- this.resizing = false;
7345
- var pr, ista, soffseth, soffsetw, s, left, top,
7346
- o = this.options, that = this;
7347
-
7348
- if (this._helper) {
7349
-
7350
- pr = this._proportionallyResizeElements;
7351
- ista = pr.length && (/textarea/i).test(pr[0].nodeName);
7352
- soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
7353
- soffsetw = ista ? 0 : that.sizeDiff.width;
7354
-
7355
- s = {
7356
- width: (that.helper.width() - soffsetw),
7357
- height: (that.helper.height() - soffseth)
7358
- };
7359
- left = (parseInt(that.element.css("left"), 10) +
7360
- (that.position.left - that.originalPosition.left)) || null;
7361
- top = (parseInt(that.element.css("top"), 10) +
7362
- (that.position.top - that.originalPosition.top)) || null;
7363
-
7364
- if (!o.animate) {
7365
- this.element.css($.extend(s, { top: top, left: left }));
7366
- }
7367
-
7368
- that.helper.height(that.size.height);
7369
- that.helper.width(that.size.width);
7370
-
7371
- if (this._helper && !o.animate) {
7372
- this._proportionallyResize();
7373
- }
7374
- }
7375
-
7376
- $("body").css("cursor", "auto");
7377
-
7378
- this.element.removeClass("ui-resizable-resizing");
7379
-
7380
- this._propagate("stop", event);
7381
-
7382
- if (this._helper) {
7383
- this.helper.remove();
7384
- }
7385
-
7386
- return false;
7387
-
7388
- },
7389
-
7390
- _updatePrevProperties: function() {
7391
- this.prevPosition = {
7392
- top: this.position.top,
7393
- left: this.position.left
7394
- };
7395
- this.prevSize = {
7396
- width: this.size.width,
7397
- height: this.size.height
7398
- };
7399
- },
7400
-
7401
- _applyChanges: function() {
7402
- var props = {};
7403
-
7404
- if ( this.position.top !== this.prevPosition.top ) {
7405
- props.top = this.position.top + "px";
7406
- }
7407
- if ( this.position.left !== this.prevPosition.left ) {
7408
- props.left = this.position.left + "px";
7409
- }
7410
- if ( this.size.width !== this.prevSize.width ) {
7411
- props.width = this.size.width + "px";
7412
- }
7413
- if ( this.size.height !== this.prevSize.height ) {
7414
- props.height = this.size.height + "px";
7415
- }
7416
-
7417
- this.helper.css( props );
7418
-
7419
- return props;
7420
- },
7421
-
7422
- _updateVirtualBoundaries: function(forceAspectRatio) {
7423
- var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
7424
- o = this.options;
7425
-
7426
- b = {
7427
- minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
7428
- maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
7429
- minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
7430
- maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
7431
- };
7432
-
7433
- if (this._aspectRatio || forceAspectRatio) {
7434
- pMinWidth = b.minHeight * this.aspectRatio;
7435
- pMinHeight = b.minWidth / this.aspectRatio;
7436
- pMaxWidth = b.maxHeight * this.aspectRatio;
7437
- pMaxHeight = b.maxWidth / this.aspectRatio;
7438
-
7439
- if (pMinWidth > b.minWidth) {
7440
- b.minWidth = pMinWidth;
7441
- }
7442
- if (pMinHeight > b.minHeight) {
7443
- b.minHeight = pMinHeight;
7444
- }
7445
- if (pMaxWidth < b.maxWidth) {
7446
- b.maxWidth = pMaxWidth;
7447
- }
7448
- if (pMaxHeight < b.maxHeight) {
7449
- b.maxHeight = pMaxHeight;
7450
- }
7451
- }
7452
- this._vBoundaries = b;
7453
- },
7454
-
7455
- _updateCache: function(data) {
7456
- this.offset = this.helper.offset();
7457
- if (this._isNumber(data.left)) {
7458
- this.position.left = data.left;
7459
- }
7460
- if (this._isNumber(data.top)) {
7461
- this.position.top = data.top;
7462
- }
7463
- if (this._isNumber(data.height)) {
7464
- this.size.height = data.height;
7465
- }
7466
- if (this._isNumber(data.width)) {
7467
- this.size.width = data.width;
7468
- }
7469
- },
7470
-
7471
- _updateRatio: function( data ) {
7472
-
7473
- var cpos = this.position,
7474
- csize = this.size,
7475
- a = this.axis;
7476
-
7477
- if (this._isNumber(data.height)) {
7478
- data.width = (data.height * this.aspectRatio);
7479
- } else if (this._isNumber(data.width)) {
7480
- data.height = (data.width / this.aspectRatio);
7481
- }
7482
-
7483
- if (a === "sw") {
7484
- data.left = cpos.left + (csize.width - data.width);
7485
- data.top = null;
7486
- }
7487
- if (a === "nw") {
7488
- data.top = cpos.top + (csize.height - data.height);
7489
- data.left = cpos.left + (csize.width - data.width);
7490
- }
7491
-
7492
- return data;
7493
- },
7494
-
7495
- _respectSize: function( data ) {
7496
-
7497
- var o = this._vBoundaries,
7498
- a = this.axis,
7499
- ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
7500
- ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
7501
- isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
7502
- isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
7503
- dw = this.originalPosition.left + this.originalSize.width,
7504
- dh = this.position.top + this.size.height,
7505
- cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
7506
- if (isminw) {
7507
- data.width = o.minWidth;
7508
- }
7509
- if (isminh) {
7510
- data.height = o.minHeight;
7511
- }
7512
- if (ismaxw) {
7513
- data.width = o.maxWidth;
7514
- }
7515
- if (ismaxh) {
7516
- data.height = o.maxHeight;
7517
- }
7518
-
7519
- if (isminw && cw) {
7520
- data.left = dw - o.minWidth;
7521
- }
7522
- if (ismaxw && cw) {
7523
- data.left = dw - o.maxWidth;
7524
- }
7525
- if (isminh && ch) {
7526
- data.top = dh - o.minHeight;
7527
- }
7528
- if (ismaxh && ch) {
7529
- data.top = dh - o.maxHeight;
7530
- }
7531
-
7532
- // Fixing jump error on top/left - bug #2330
7533
- if (!data.width && !data.height && !data.left && data.top) {
7534
- data.top = null;
7535
- } else if (!data.width && !data.height && !data.top && data.left) {
7536
- data.left = null;
7537
- }
7538
-
7539
- return data;
7540
- },
7541
-
7542
- _getPaddingPlusBorderDimensions: function( element ) {
7543
- var i = 0,
7544
- widths = [],
7545
- borders = [
7546
- element.css( "borderTopWidth" ),
7547
- element.css( "borderRightWidth" ),
7548
- element.css( "borderBottomWidth" ),
7549
- element.css( "borderLeftWidth" )
7550
- ],
7551
- paddings = [
7552
- element.css( "paddingTop" ),
7553
- element.css( "paddingRight" ),
7554
- element.css( "paddingBottom" ),
7555
- element.css( "paddingLeft" )
7556
- ];
7557
-
7558
- for ( ; i < 4; i++ ) {
7559
- widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
7560
- widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
7561
- }
7562
-
7563
- return {
7564
- height: widths[ 0 ] + widths[ 2 ],
7565
- width: widths[ 1 ] + widths[ 3 ]
7566
- };
7567
- },
7568
-
7569
- _proportionallyResize: function() {
7570
-
7571
- if (!this._proportionallyResizeElements.length) {
7572
- return;
7573
- }
7574
-
7575
- var prel,
7576
- i = 0,
7577
- element = this.helper || this.element;
7578
-
7579
- for ( ; i < this._proportionallyResizeElements.length; i++) {
7580
-
7581
- prel = this._proportionallyResizeElements[i];
7582
-
7583
- // TODO: Seems like a bug to cache this.outerDimensions
7584
- // considering that we are in a loop.
7585
- if (!this.outerDimensions) {
7586
- this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
7587
- }
7588
-
7589
- prel.css({
7590
- height: (element.height() - this.outerDimensions.height) || 0,
7591
- width: (element.width() - this.outerDimensions.width) || 0
7592
- });
7593
-
7594
- }
7595
-
7596
- },
7597
-
7598
- _renderProxy: function() {
7599
-
7600
- var el = this.element, o = this.options;
7601
- this.elementOffset = el.offset();
7602
-
7603
- if (this._helper) {
7604
-
7605
- this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
7606
-
7607
- this.helper.addClass(this._helper).css({
7608
- width: this.element.outerWidth() - 1,
7609
- height: this.element.outerHeight() - 1,
7610
- position: "absolute",
7611
- left: this.elementOffset.left + "px",
7612
- top: this.elementOffset.top + "px",
7613
- zIndex: ++o.zIndex //TODO: Don't modify option
7614
- });
7615
-
7616
- this.helper
7617
- .appendTo("body")
7618
- .disableSelection();
7619
-
7620
- } else {
7621
- this.helper = this.element;
7622
- }
7623
-
7624
- },
7625
-
7626
- _change: {
7627
- e: function(event, dx) {
7628
- return { width: this.originalSize.width + dx };
7629
- },
7630
- w: function(event, dx) {
7631
- var cs = this.originalSize, sp = this.originalPosition;
7632
- return { left: sp.left + dx, width: cs.width - dx };
7633
- },
7634
- n: function(event, dx, dy) {
7635
- var cs = this.originalSize, sp = this.originalPosition;
7636
- return { top: sp.top + dy, height: cs.height - dy };
7637
- },
7638
- s: function(event, dx, dy) {
7639
- return { height: this.originalSize.height + dy };
7640
- },
7641
- se: function(event, dx, dy) {
7642
- return $.extend(this._change.s.apply(this, arguments),
7643
- this._change.e.apply(this, [ event, dx, dy ]));
7644
- },
7645
- sw: function(event, dx, dy) {
7646
- return $.extend(this._change.s.apply(this, arguments),
7647
- this._change.w.apply(this, [ event, dx, dy ]));
7648
- },
7649
- ne: function(event, dx, dy) {
7650
- return $.extend(this._change.n.apply(this, arguments),
7651
- this._change.e.apply(this, [ event, dx, dy ]));
7652
- },
7653
- nw: function(event, dx, dy) {
7654
- return $.extend(this._change.n.apply(this, arguments),
7655
- this._change.w.apply(this, [ event, dx, dy ]));
7656
- }
7657
- },
7658
-
7659
- _propagate: function(n, event) {
7660
- $.ui.plugin.call(this, n, [ event, this.ui() ]);
7661
- (n !== "resize" && this._trigger(n, event, this.ui()));
7662
- },
7663
-
7664
- plugins: {},
7665
-
7666
- ui: function() {
7667
- return {
7668
- originalElement: this.originalElement,
7669
- element: this.element,
7670
- helper: this.helper,
7671
- position: this.position,
7672
- size: this.size,
7673
- originalSize: this.originalSize,
7674
- originalPosition: this.originalPosition
7675
- };
7676
- }
7677
-
7678
- });
7679
-
7680
- /*
7681
- * Resizable Extensions
7682
- */
7683
-
7684
- $.ui.plugin.add("resizable", "animate", {
7685
-
7686
- stop: function( event ) {
7687
- var that = $(this).resizable( "instance" ),
7688
- o = that.options,
7689
- pr = that._proportionallyResizeElements,
7690
- ista = pr.length && (/textarea/i).test(pr[0].nodeName),
7691
- soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
7692
- soffsetw = ista ? 0 : that.sizeDiff.width,
7693
- style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
7694
- left = (parseInt(that.element.css("left"), 10) +
7695
- (that.position.left - that.originalPosition.left)) || null,
7696
- top = (parseInt(that.element.css("top"), 10) +
7697
- (that.position.top - that.originalPosition.top)) || null;
7698
-
7699
- that.element.animate(
7700
- $.extend(style, top && left ? { top: top, left: left } : {}), {
7701
- duration: o.animateDuration,
7702
- easing: o.animateEasing,
7703
- step: function() {
7704
-
7705
- var data = {
7706
- width: parseInt(that.element.css("width"), 10),
7707
- height: parseInt(that.element.css("height"), 10),
7708
- top: parseInt(that.element.css("top"), 10),
7709
- left: parseInt(that.element.css("left"), 10)
7710
- };
7711
-
7712
- if (pr && pr.length) {
7713
- $(pr[0]).css({ width: data.width, height: data.height });
7714
- }
7715
-
7716
- // propagating resize, and updating values for each animation step
7717
- that._updateCache(data);
7718
- that._propagate("resize", event);
7719
-
7720
- }
7721
- }
7722
- );
7723
- }
7724
-
7725
- });
7726
-
7727
- $.ui.plugin.add( "resizable", "containment", {
7728
-
7729
- start: function() {
7730
- var element, p, co, ch, cw, width, height,
7731
- that = $( this ).resizable( "instance" ),
7732
- o = that.options,
7733
- el = that.element,
7734
- oc = o.containment,
7735
- ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
7736
-
7737
- if ( !ce ) {
7738
- return;
7739
- }
7740
-
7741
- that.containerElement = $( ce );
7742
-
7743
- if ( /document/.test( oc ) || oc === document ) {
7744
- that.containerOffset = {
7745
- left: 0,
7746
- top: 0
7747
- };
7748
- that.containerPosition = {
7749
- left: 0,
7750
- top: 0
7751
- };
7752
-
7753
- that.parentData = {
7754
- element: $( document ),
7755
- left: 0,
7756
- top: 0,
7757
- width: $( document ).width(),
7758
- height: $( document ).height() || document.body.parentNode.scrollHeight
7759
- };
7760
- } else {
7761
- element = $( ce );
7762
- p = [];
7763
- $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
7764
- p[ i ] = that._num( element.css( "padding" + name ) );
7765
- });
7766
-
7767
- that.containerOffset = element.offset();
7768
- that.containerPosition = element.position();
7769
- that.containerSize = {
7770
- height: ( element.innerHeight() - p[ 3 ] ),
7771
- width: ( element.innerWidth() - p[ 1 ] )
7772
- };
7773
-
7774
- co = that.containerOffset;
7775
- ch = that.containerSize.height;
7776
- cw = that.containerSize.width;
7777
- width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
7778
- height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
7779
-
7780
- that.parentData = {
7781
- element: ce,
7782
- left: co.left,
7783
- top: co.top,
7784
- width: width,
7785
- height: height
7786
- };
7787
- }
7788
- },
7789
-
7790
- resize: function( event ) {
7791
- var woset, hoset, isParent, isOffsetRelative,
7792
- that = $( this ).resizable( "instance" ),
7793
- o = that.options,
7794
- co = that.containerOffset,
7795
- cp = that.position,
7796
- pRatio = that._aspectRatio || event.shiftKey,
7797
- cop = {
7798
- top: 0,
7799
- left: 0
7800
- },
7801
- ce = that.containerElement,
7802
- continueResize = true;
7803
-
7804
- if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
7805
- cop = co;
7806
- }
7807
-
7808
- if ( cp.left < ( that._helper ? co.left : 0 ) ) {
7809
- that.size.width = that.size.width +
7810
- ( that._helper ?
7811
- ( that.position.left - co.left ) :
7812
- ( that.position.left - cop.left ) );
7813
-
7814
- if ( pRatio ) {
7815
- that.size.height = that.size.width / that.aspectRatio;
7816
- continueResize = false;
7817
- }
7818
- that.position.left = o.helper ? co.left : 0;
7819
- }
7820
-
7821
- if ( cp.top < ( that._helper ? co.top : 0 ) ) {
7822
- that.size.height = that.size.height +
7823
- ( that._helper ?
7824
- ( that.position.top - co.top ) :
7825
- that.position.top );
7826
-
7827
- if ( pRatio ) {
7828
- that.size.width = that.size.height * that.aspectRatio;
7829
- continueResize = false;
7830
- }
7831
- that.position.top = that._helper ? co.top : 0;
7832
- }
7833
-
7834
- isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
7835
- isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
7836
-
7837
- if ( isParent && isOffsetRelative ) {
7838
- that.offset.left = that.parentData.left + that.position.left;
7839
- that.offset.top = that.parentData.top + that.position.top;
7840
- } else {
7841
- that.offset.left = that.element.offset().left;
7842
- that.offset.top = that.element.offset().top;
7843
- }
7844
-
7845
- woset = Math.abs( that.sizeDiff.width +
7846
- (that._helper ?
7847
- that.offset.left - cop.left :
7848
- (that.offset.left - co.left)) );
7849
-
7850
- hoset = Math.abs( that.sizeDiff.height +
7851
- (that._helper ?
7852
- that.offset.top - cop.top :
7853
- (that.offset.top - co.top)) );
7854
-
7855
- if ( woset + that.size.width >= that.parentData.width ) {
7856
- that.size.width = that.parentData.width - woset;
7857
- if ( pRatio ) {
7858
- that.size.height = that.size.width / that.aspectRatio;
7859
- continueResize = false;
7860
- }
7861
- }
7862
-
7863
- if ( hoset + that.size.height >= that.parentData.height ) {
7864
- that.size.height = that.parentData.height - hoset;
7865
- if ( pRatio ) {
7866
- that.size.width = that.size.height * that.aspectRatio;
7867
- continueResize = false;
7868
- }
7869
- }
7870
-
7871
- if ( !continueResize ){
7872
- that.position.left = that.prevPosition.left;
7873
- that.position.top = that.prevPosition.top;
7874
- that.size.width = that.prevSize.width;
7875
- that.size.height = that.prevSize.height;
7876
- }
7877
- },
7878
-
7879
- stop: function() {
7880
- var that = $( this ).resizable( "instance" ),
7881
- o = that.options,
7882
- co = that.containerOffset,
7883
- cop = that.containerPosition,
7884
- ce = that.containerElement,
7885
- helper = $( that.helper ),
7886
- ho = helper.offset(),
7887
- w = helper.outerWidth() - that.sizeDiff.width,
7888
- h = helper.outerHeight() - that.sizeDiff.height;
7889
-
7890
- if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
7891
- $( this ).css({
7892
- left: ho.left - cop.left - co.left,
7893
- width: w,
7894
- height: h
7895
- });
7896
- }
7897
-
7898
- if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
7899
- $( this ).css({
7900
- left: ho.left - cop.left - co.left,
7901
- width: w,
7902
- height: h
7903
- });
7904
- }
7905
- }
7906
- });
7907
-
7908
- $.ui.plugin.add("resizable", "alsoResize", {
7909
-
7910
- start: function() {
7911
- var that = $(this).resizable( "instance" ),
7912
- o = that.options,
7913
- _store = function(exp) {
7914
- $(exp).each(function() {
7915
- var el = $(this);
7916
- el.data("ui-resizable-alsoresize", {
7917
- width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
7918
- left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
7919
- });
7920
- });
7921
- };
7922
-
7923
- if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
7924
- if (o.alsoResize.length) {
7925
- o.alsoResize = o.alsoResize[0];
7926
- _store(o.alsoResize);
7927
- } else {
7928
- $.each(o.alsoResize, function(exp) {
7929
- _store(exp);
7930
- });
7931
- }
7932
- } else {
7933
- _store(o.alsoResize);
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
- _alsoResize = function(exp, c) {
7950
- $(exp).each(function() {
7951
- var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
7952
- css = c && c.length ?
7953
- c :
7954
- el.parents(ui.originalElement[0]).length ?
7955
- [ "width", "height" ] :
7956
- [ "width", "height", "top", "left" ];
7957
-
7958
- $.each(css, function(i, prop) {
7959
- var sum = (start[prop] || 0) + (delta[prop] || 0);
7960
- if (sum && sum >= 0) {
7961
- style[prop] = sum || null;
7962
- }
7963
- });
7964
-
7965
- el.css(style);
7966
- });
7967
- };
7968
-
7969
- if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
7970
- $.each(o.alsoResize, function(exp, c) {
7971
- _alsoResize(exp, c);
7972
- });
7973
- } else {
7974
- _alsoResize(o.alsoResize);
7975
- }
7976
- },
7977
-
7978
- stop: function() {
7979
- $(this).removeData("resizable-alsoresize");
7980
- }
7981
- });
7982
-
7983
- $.ui.plugin.add("resizable", "ghost", {
7984
-
7985
- start: function() {
7986
-
7987
- var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
7988
-
7989
- that.ghost = that.originalElement.clone();
7990
- that.ghost
7991
- .css({
7992
- opacity: 0.25,
7993
- display: "block",
7994
- position: "relative",
7995
- height: cs.height,
7996
- width: cs.width,
7997
- margin: 0,
7998
- left: 0,
7999
- top: 0
8000
- })
8001
- .addClass("ui-resizable-ghost")
8002
- .addClass(typeof o.ghost === "string" ? o.ghost : "");
8003
-
8004
- that.ghost.appendTo(that.helper);
8005
-
8006
- },
8007
-
8008
- resize: function() {
8009
- var that = $(this).resizable( "instance" );
8010
- if (that.ghost) {
8011
- that.ghost.css({
8012
- position: "relative",
8013
- height: that.size.height,
8014
- width: that.size.width
8015
- });
8016
- }
8017
- },
8018
-
8019
- stop: function() {
8020
- var that = $(this).resizable( "instance" );
8021
- if (that.ghost && that.helper) {
8022
- that.helper.get(0).removeChild(that.ghost.get(0));
8023
- }
8024
- }
8025
-
8026
- });
8027
-
8028
- $.ui.plugin.add("resizable", "grid", {
8029
-
8030
- resize: function() {
8031
- var outerDimensions,
8032
- that = $(this).resizable( "instance" ),
8033
- o = that.options,
8034
- cs = that.size,
8035
- os = that.originalSize,
8036
- op = that.originalPosition,
8037
- a = that.axis,
8038
- grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
8039
- gridX = (grid[0] || 1),
8040
- gridY = (grid[1] || 1),
8041
- ox = Math.round((cs.width - os.width) / gridX) * gridX,
8042
- oy = Math.round((cs.height - os.height) / gridY) * gridY,
8043
- newWidth = os.width + ox,
8044
- newHeight = os.height + oy,
8045
- isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
8046
- isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
8047
- isMinWidth = o.minWidth && (o.minWidth > newWidth),
8048
- isMinHeight = o.minHeight && (o.minHeight > newHeight);
8049
-
8050
- o.grid = grid;
8051
-
8052
- if (isMinWidth) {
8053
- newWidth += gridX;
8054
- }
8055
- if (isMinHeight) {
8056
- newHeight += gridY;
8057
- }
8058
- if (isMaxWidth) {
8059
- newWidth -= gridX;
8060
- }
8061
- if (isMaxHeight) {
8062
- newHeight -= gridY;
8063
- }
8064
-
8065
- if (/^(se|s|e)$/.test(a)) {
8066
- that.size.width = newWidth;
8067
- that.size.height = newHeight;
8068
- } else if (/^(ne)$/.test(a)) {
8069
- that.size.width = newWidth;
8070
- that.size.height = newHeight;
8071
- that.position.top = op.top - oy;
8072
- } else if (/^(sw)$/.test(a)) {
8073
- that.size.width = newWidth;
8074
- that.size.height = newHeight;
8075
- that.position.left = op.left - ox;
8076
- } else {
8077
- if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
8078
- outerDimensions = that._getPaddingPlusBorderDimensions( this );
8079
- }
8080
-
8081
- if ( newHeight - gridY > 0 ) {
8082
- that.size.height = newHeight;
8083
- that.position.top = op.top - oy;
8084
- } else {
8085
- newHeight = gridY - outerDimensions.height;
8086
- that.size.height = newHeight;
8087
- that.position.top = op.top + os.height - newHeight;
8088
- }
8089
- if ( newWidth - gridX > 0 ) {
8090
- that.size.width = newWidth;
8091
- that.position.left = op.left - ox;
8092
- } else {
8093
- newWidth = gridY - outerDimensions.height;
8094
- that.size.width = newWidth;
8095
- that.position.left = op.left + os.width - newWidth;
8096
- }
8097
- }
8098
- }
8099
-
8100
- });
8101
-
8102
- var resizable = $.ui.resizable;
8103
-
8104
-
8105
- /*!
8106
- * jQuery UI Dialog 1.11.2
8107
- * http://jqueryui.com
8108
- *
8109
- * Copyright 2014 jQuery Foundation and other contributors
8110
- * Released under the MIT license.
8111
- * http://jquery.org/license
8112
- *
8113
- * http://api.jqueryui.com/dialog/
8114
- */
8115
-
8116
-
8117
- var dialog = $.widget( "ui.dialog", {
8118
- version: "1.11.2",
8119
- options: {
8120
- appendTo: "body",
8121
- autoOpen: true,
8122
- buttons: [],
8123
- closeOnEscape: true,
8124
- closeText: "Close",
8125
- dialogClass: "",
8126
- draggable: true,
8127
- hide: null,
8128
- height: "auto",
8129
- maxHeight: null,
8130
- maxWidth: null,
8131
- minHeight: 150,
8132
- minWidth: 150,
8133
- modal: false,
8134
- position: {
8135
- my: "center",
8136
- at: "center",
8137
- of: window,
8138
- collision: "fit",
8139
- // Ensure the titlebar is always visible
8140
- using: function( pos ) {
8141
- var topOffset = $( this ).css( pos ).offset().top;
8142
- if ( topOffset < 0 ) {
8143
- $( this ).css( "top", pos.top - topOffset );
8144
- }
8145
- }
8146
- },
8147
- resizable: true,
8148
- show: null,
8149
- title: null,
8150
- width: 300,
8151
-
8152
- // callbacks
8153
- beforeClose: null,
8154
- close: null,
8155
- drag: null,
8156
- dragStart: null,
8157
- dragStop: null,
8158
- focus: null,
8159
- open: null,
8160
- resize: null,
8161
- resizeStart: null,
8162
- resizeStop: null
8163
- },
8164
-
8165
- sizeRelatedOptions: {
8166
- buttons: true,
8167
- height: true,
8168
- maxHeight: true,
8169
- maxWidth: true,
8170
- minHeight: true,
8171
- minWidth: true,
8172
- width: true
8173
- },
8174
-
8175
- resizableRelatedOptions: {
8176
- maxHeight: true,
8177
- maxWidth: true,
8178
- minHeight: true,
8179
- minWidth: true
8180
- },
8181
-
8182
- _create: function() {
8183
- this.originalCss = {
8184
- display: this.element[ 0 ].style.display,
8185
- width: this.element[ 0 ].style.width,
8186
- minHeight: this.element[ 0 ].style.minHeight,
8187
- maxHeight: this.element[ 0 ].style.maxHeight,
8188
- height: this.element[ 0 ].style.height
8189
- };
8190
- this.originalPosition = {
8191
- parent: this.element.parent(),
8192
- index: this.element.parent().children().index( this.element )
8193
- };
8194
- this.originalTitle = this.element.attr( "title" );
8195
- this.options.title = this.options.title || this.originalTitle;
8196
-
8197
- this._createWrapper();
8198
-
8199
- this.element
8200
- .show()
8201
- .removeAttr( "title" )
8202
- .addClass( "ui-dialog-content ui-widget-content" )
8203
- .appendTo( this.uiDialog );
8204
-
8205
- this._createTitlebar();
8206
- this._createButtonPane();
8207
-
8208
- if ( this.options.draggable && $.fn.draggable ) {
8209
- this._makeDraggable();
8210
- }
8211
- if ( this.options.resizable && $.fn.resizable ) {
8212
- this._makeResizable();
8213
- }
8214
-
8215
- this._isOpen = false;
8216
-
8217
- this._trackFocus();
8218
- },
8219
-
8220
- _init: function() {
8221
- if ( this.options.autoOpen ) {
8222
- this.open();
8223
- }
8224
- },
8225
-
8226
- _appendTo: function() {
8227
- var element = this.options.appendTo;
8228
- if ( element && (element.jquery || element.nodeType) ) {
8229
- return $( element );
8230
- }
8231
- return this.document.find( element || "body" ).eq( 0 );
8232
- },
8233
-
8234
- _destroy: function() {
8235
- var next,
8236
- originalPosition = this.originalPosition;
8237
-
8238
- this._destroyOverlay();
8239
-
8240
- this.element
8241
- .removeUniqueId()
8242
- .removeClass( "ui-dialog-content ui-widget-content" )
8243
- .css( this.originalCss )
8244
- // Without detaching first, the following becomes really slow
8245
- .detach();
8246
-
8247
- this.uiDialog.stop( true, true ).remove();
8248
-
8249
- if ( this.originalTitle ) {
8250
- this.element.attr( "title", this.originalTitle );
8251
- }
8252
-
8253
- next = originalPosition.parent.children().eq( originalPosition.index );
8254
- // Don't try to place the dialog next to itself (#8613)
8255
- if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
8256
- next.before( this.element );
8257
- } else {
8258
- originalPosition.parent.append( this.element );
8259
- }
8260
- },
8261
-
8262
- widget: function() {
8263
- return this.uiDialog;
8264
- },
8265
-
8266
- disable: $.noop,
8267
- enable: $.noop,
8268
-
8269
- close: function( event ) {
8270
- var activeElement,
8271
- that = this;
8272
-
8273
- if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
8274
- return;
8275
- }
8276
-
8277
- this._isOpen = false;
8278
- this._focusedElement = null;
8279
- this._destroyOverlay();
8280
- this._untrackInstance();
8281
-
8282
- if ( !this.opener.filter( ":focusable" ).focus().length ) {
8283
-
8284
- // support: IE9
8285
- // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
8286
- try {
8287
- activeElement = this.document[ 0 ].activeElement;
8288
-
8289
- // Support: IE9, IE10
8290
- // If the <body> is blurred, IE will switch windows, see #4520
8291
- if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
8292
-
8293
- // Hiding a focused element doesn't trigger blur in WebKit
8294
- // so in case we have nothing to focus on, explicitly blur the active element
8295
- // https://bugs.webkit.org/show_bug.cgi?id=47182
8296
- $( activeElement ).blur();
8297
- }
8298
- } catch ( error ) {}
8299
- }
8300
-
8301
- this._hide( this.uiDialog, this.options.hide, function() {
8302
- that._trigger( "close", event );
8303
- });
8304
- },
8305
-
8306
- isOpen: function() {
8307
- return this._isOpen;
8308
- },
8309
-
8310
- moveToTop: function() {
8311
- this._moveToTop();
8312
- },
8313
-
8314
- _moveToTop: function( event, silent ) {
8315
- var moved = false,
8316
- zIndicies = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
8317
- return +$( this ).css( "z-index" );
8318
- }).get(),
8319
- zIndexMax = Math.max.apply( null, zIndicies );
8320
-
8321
- if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
8322
- this.uiDialog.css( "z-index", zIndexMax + 1 );
8323
- moved = true;
8324
- }
8325
-
8326
- if ( moved && !silent ) {
8327
- this._trigger( "focus", event );
8328
- }
8329
- return moved;
8330
- },
8331
-
8332
- open: function() {
8333
- var that = this;
8334
- if ( this._isOpen ) {
8335
- if ( this._moveToTop() ) {
8336
- this._focusTabbable();
8337
- }
8338
- return;
8339
- }
8340
-
8341
- this._isOpen = true;
8342
- this.opener = $( this.document[ 0 ].activeElement );
8343
-
8344
- this._size();
8345
- this._position();
8346
- this._createOverlay();
8347
- this._moveToTop( null, true );
8348
-
8349
- // Ensure the overlay is moved to the top with the dialog, but only when
8350
- // opening. The overlay shouldn't move after the dialog is open so that
8351
- // modeless dialogs opened after the modal dialog stack properly.
8352
- if ( this.overlay ) {
8353
- this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
8354
- }
8355
-
8356
- this._show( this.uiDialog, this.options.show, function() {
8357
- that._focusTabbable();
8358
- that._trigger( "focus" );
8359
- });
8360
-
8361
- // Track the dialog immediately upon openening in case a focus event
8362
- // somehow occurs outside of the dialog before an element inside the
8363
- // dialog is focused (#10152)
8364
- this._makeFocusTarget();
8365
-
8366
- this._trigger( "open" );
8367
- },
8368
-
8369
- _focusTabbable: function() {
8370
- // Set focus to the first match:
8371
- // 1. An element that was focused previously
8372
- // 2. First element inside the dialog matching [autofocus]
8373
- // 3. Tabbable element inside the content element
8374
- // 4. Tabbable element inside the buttonpane
8375
- // 5. The close button
8376
- // 6. The dialog itself
8377
- var hasFocus = this._focusedElement;
8378
- if ( !hasFocus ) {
8379
- hasFocus = this.element.find( "[autofocus]" );
8380
- }
8381
- if ( !hasFocus.length ) {
8382
- hasFocus = this.element.find( ":tabbable" );
8383
- }
8384
- if ( !hasFocus.length ) {
8385
- hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
8386
- }
8387
- if ( !hasFocus.length ) {
8388
- hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
8389
- }
8390
- if ( !hasFocus.length ) {
8391
- hasFocus = this.uiDialog;
8392
- }
8393
- hasFocus.eq( 0 ).focus();
8394
- },
8395
-
8396
- _keepFocus: function( event ) {
8397
- function checkFocus() {
8398
- var activeElement = this.document[0].activeElement,
8399
- isActive = this.uiDialog[0] === activeElement ||
8400
- $.contains( this.uiDialog[0], activeElement );
8401
- if ( !isActive ) {
8402
- this._focusTabbable();
8403
- }
8404
- }
8405
- event.preventDefault();
8406
- checkFocus.call( this );
8407
- // support: IE
8408
- // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
8409
- // so we check again later
8410
- this._delay( checkFocus );
8411
- },
8412
-
8413
- _createWrapper: function() {
8414
- this.uiDialog = $("<div>")
8415
- .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
8416
- this.options.dialogClass )
8417
- .hide()
8418
- .attr({
8419
- // Setting tabIndex makes the div focusable
8420
- tabIndex: -1,
8421
- role: "dialog"
8422
- })
8423
- .appendTo( this._appendTo() );
8424
-
8425
- this._on( this.uiDialog, {
8426
- keydown: function( event ) {
8427
- if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
8428
- event.keyCode === $.ui.keyCode.ESCAPE ) {
8429
- event.preventDefault();
8430
- this.close( event );
8431
- return;
8432
- }
8433
-
8434
- // prevent tabbing out of dialogs
8435
- if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
8436
- return;
8437
- }
8438
- var tabbables = this.uiDialog.find( ":tabbable" ),
8439
- first = tabbables.filter( ":first" ),
8440
- last = tabbables.filter( ":last" );
8441
-
8442
- if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
8443
- this._delay(function() {
8444
- first.focus();
8445
- });
8446
- event.preventDefault();
8447
- } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
8448
- this._delay(function() {
8449
- last.focus();
8450
- });
8451
- event.preventDefault();
8452
- }
8453
- },
8454
- mousedown: function( event ) {
8455
- if ( this._moveToTop( event ) ) {
8456
- this._focusTabbable();
8457
- }
8458
- }
8459
- });
8460
-
8461
- // We assume that any existing aria-describedby attribute means
8462
- // that the dialog content is marked up properly
8463
- // otherwise we brute force the content as the description
8464
- if ( !this.element.find( "[aria-describedby]" ).length ) {
8465
- this.uiDialog.attr({
8466
- "aria-describedby": this.element.uniqueId().attr( "id" )
8467
- });
8468
- }
8469
- },
8470
-
8471
- _createTitlebar: function() {
8472
- var uiDialogTitle;
8473
-
8474
- this.uiDialogTitlebar = $( "<div>" )
8475
- .addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
8476
- .prependTo( this.uiDialog );
8477
- this._on( this.uiDialogTitlebar, {
8478
- mousedown: function( event ) {
8479
- // Don't prevent click on close button (#8838)
8480
- // Focusing a dialog that is partially scrolled out of view
8481
- // causes the browser to scroll it into view, preventing the click event
8482
- if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
8483
- // Dialog isn't getting focus when dragging (#8063)
8484
- this.uiDialog.focus();
8485
- }
8486
- }
8487
- });
8488
-
8489
- // support: IE
8490
- // Use type="button" to prevent enter keypresses in textboxes from closing the
8491
- // dialog in IE (#9312)
8492
- this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
8493
- .button({
8494
- label: this.options.closeText,
8495
- icons: {
8496
- primary: "ui-icon-closethick"
8497
- },
8498
- text: false
8499
- })
8500
- .addClass( "ui-dialog-titlebar-close" )
8501
- .appendTo( this.uiDialogTitlebar );
8502
- this._on( this.uiDialogTitlebarClose, {
8503
- click: function( event ) {
8504
- event.preventDefault();
8505
- this.close( event );
8506
- }
8507
- });
8508
-
8509
- uiDialogTitle = $( "<span>" )
8510
- .uniqueId()
8511
- .addClass( "ui-dialog-title" )
8512
- .prependTo( this.uiDialogTitlebar );
8513
- this._title( uiDialogTitle );
8514
-
8515
- this.uiDialog.attr({
8516
- "aria-labelledby": uiDialogTitle.attr( "id" )
8517
- });
8518
- },
8519
-
8520
- _title: function( title ) {
8521
- if ( !this.options.title ) {
8522
- title.html( "&#160;" );
8523
- }
8524
- title.text( this.options.title );
8525
- },
8526
-
8527
- _createButtonPane: function() {
8528
- this.uiDialogButtonPane = $( "<div>" )
8529
- .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
8530
-
8531
- this.uiButtonSet = $( "<div>" )
8532
- .addClass( "ui-dialog-buttonset" )
8533
- .appendTo( this.uiDialogButtonPane );
8534
-
8535
- this._createButtons();
8536
- },
8537
-
8538
- _createButtons: function() {
8539
- var that = this,
8540
- buttons = this.options.buttons;
8541
-
8542
- // if we already have a button pane, remove it
8543
- this.uiDialogButtonPane.remove();
8544
- this.uiButtonSet.empty();
8545
-
8546
- if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
8547
- this.uiDialog.removeClass( "ui-dialog-buttons" );
8548
- return;
8549
- }
8550
-
8551
- $.each( buttons, function( name, props ) {
8552
- var click, buttonOptions;
8553
- props = $.isFunction( props ) ?
8554
- { click: props, text: name } :
8555
- props;
8556
- // Default to a non-submitting button
8557
- props = $.extend( { type: "button" }, props );
8558
- // Change the context for the click callback to be the main element
8559
- click = props.click;
8560
- props.click = function() {
8561
- click.apply( that.element[ 0 ], arguments );
8562
- };
8563
- buttonOptions = {
8564
- icons: props.icons,
8565
- text: props.showText
8566
- };
8567
- delete props.icons;
8568
- delete props.showText;
8569
- $( "<button></button>", props )
8570
- .button( buttonOptions )
8571
- .appendTo( that.uiButtonSet );
8572
- });
8573
- this.uiDialog.addClass( "ui-dialog-buttons" );
8574
- this.uiDialogButtonPane.appendTo( this.uiDialog );
8575
- },
8576
-
8577
- _makeDraggable: function() {
8578
- var that = this,
8579
- options = this.options;
8580
-
8581
- function filteredUi( ui ) {
8582
- return {
8583
- position: ui.position,
8584
- offset: ui.offset
8585
- };
8586
- }
8587
-
8588
- this.uiDialog.draggable({
8589
- cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
8590
- handle: ".ui-dialog-titlebar",
8591
- containment: "document",
8592
- start: function( event, ui ) {
8593
- $( this ).addClass( "ui-dialog-dragging" );
8594
- that._blockFrames();
8595
- that._trigger( "dragStart", event, filteredUi( ui ) );
8596
- },
8597
- drag: function( event, ui ) {
8598
- that._trigger( "drag", event, filteredUi( ui ) );
8599
- },
8600
- stop: function( event, ui ) {
8601
- var left = ui.offset.left - that.document.scrollLeft(),
8602
- top = ui.offset.top - that.document.scrollTop();
8603
-
8604
- options.position = {
8605
- my: "left top",
8606
- at: "left" + (left >= 0 ? "+" : "") + left + " " +
8607
- "top" + (top >= 0 ? "+" : "") + top,
8608
- of: that.window
8609
- };
8610
- $( this ).removeClass( "ui-dialog-dragging" );
8611
- that._unblockFrames();
8612
- that._trigger( "dragStop", event, filteredUi( ui ) );
8613
- }
8614
- });
8615
- },
8616
-
8617
- _makeResizable: function() {
8618
- var that = this,
8619
- options = this.options,
8620
- handles = options.resizable,
8621
- // .ui-resizable has position: relative defined in the stylesheet
8622
- // but dialogs have to use absolute or fixed positioning
8623
- position = this.uiDialog.css("position"),
8624
- resizeHandles = typeof handles === "string" ?
8625
- handles :
8626
- "n,e,s,w,se,sw,ne,nw";
8627
-
8628
- function filteredUi( ui ) {
8629
- return {
8630
- originalPosition: ui.originalPosition,
8631
- originalSize: ui.originalSize,
8632
- position: ui.position,
8633
- size: ui.size
8634
- };
8635
- }
8636
-
8637
- this.uiDialog.resizable({
8638
- cancel: ".ui-dialog-content",
8639
- containment: "document",
8640
- alsoResize: this.element,
8641
- maxWidth: options.maxWidth,
8642
- maxHeight: options.maxHeight,
8643
- minWidth: options.minWidth,
8644
- minHeight: this._minHeight(),
8645
- handles: resizeHandles,
8646
- start: function( event, ui ) {
8647
- $( this ).addClass( "ui-dialog-resizing" );
8648
- that._blockFrames();
8649
- that._trigger( "resizeStart", event, filteredUi( ui ) );
8650
- },
8651
- resize: function( event, ui ) {
8652
- that._trigger( "resize", event, filteredUi( ui ) );
8653
- },
8654
- stop: function( event, ui ) {
8655
- var offset = that.uiDialog.offset(),
8656
- left = offset.left - that.document.scrollLeft(),
8657
- top = offset.top - that.document.scrollTop();
8658
-
8659
- options.height = that.uiDialog.height();
8660
- options.width = that.uiDialog.width();
8661
- options.position = {
8662
- my: "left top",
8663
- at: "left" + (left >= 0 ? "+" : "") + left + " " +
8664
- "top" + (top >= 0 ? "+" : "") + top,
8665
- of: that.window
8666
- };
8667
- $( this ).removeClass( "ui-dialog-resizing" );
8668
- that._unblockFrames();
8669
- that._trigger( "resizeStop", event, filteredUi( ui ) );
8670
- }
8671
- })
8672
- .css( "position", position );
8673
- },
8674
-
8675
- _trackFocus: function() {
8676
- this._on( this.widget(), {
8677
- focusin: function( event ) {
8678
- this._makeFocusTarget();
8679
- this._focusedElement = $( event.target );
8680
- }
8681
- });
8682
- },
8683
-
8684
- _makeFocusTarget: function() {
8685
- this._untrackInstance();
8686
- this._trackingInstances().unshift( this );
8687
- },
8688
-
8689
- _untrackInstance: function() {
8690
- var instances = this._trackingInstances(),
8691
- exists = $.inArray( this, instances );
8692
- if ( exists !== -1 ) {
8693
- instances.splice( exists, 1 );
8694
- }
8695
- },
8696
-
8697
- _trackingInstances: function() {
8698
- var instances = this.document.data( "ui-dialog-instances" );
8699
- if ( !instances ) {
8700
- instances = [];
8701
- this.document.data( "ui-dialog-instances", instances );
8702
- }
8703
- return instances;
8704
- },
8705
-
8706
- _minHeight: function() {
8707
- var options = this.options;
8708
-
8709
- return options.height === "auto" ?
8710
- options.minHeight :
8711
- Math.min( options.minHeight, options.height );
8712
- },
8713
-
8714
- _position: function() {
8715
- // Need to show the dialog to get the actual offset in the position plugin
8716
- var isVisible = this.uiDialog.is( ":visible" );
8717
- if ( !isVisible ) {
8718
- this.uiDialog.show();
8719
- }
8720
- this.uiDialog.position( this.options.position );
8721
- if ( !isVisible ) {
8722
- this.uiDialog.hide();
8723
- }
8724
- },
8725
-
8726
- _setOptions: function( options ) {
8727
- var that = this,
8728
- resize = false,
8729
- resizableOptions = {};
8730
-
8731
- $.each( options, function( key, value ) {
8732
- that._setOption( key, value );
8733
-
8734
- if ( key in that.sizeRelatedOptions ) {
8735
- resize = true;
8736
- }
8737
- if ( key in that.resizableRelatedOptions ) {
8738
- resizableOptions[ key ] = value;
8739
- }
8740
- });
8741
-
8742
- if ( resize ) {
8743
- this._size();
8744
- this._position();
8745
- }
8746
- if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
8747
- this.uiDialog.resizable( "option", resizableOptions );
8748
- }
8749
- },
8750
-
8751
- _setOption: function( key, value ) {
8752
- var isDraggable, isResizable,
8753
- uiDialog = this.uiDialog;
8754
-
8755
- if ( key === "dialogClass" ) {
8756
- uiDialog
8757
- .removeClass( this.options.dialogClass )
8758
- .addClass( value );
8759
- }
8760
-
8761
- if ( key === "disabled" ) {
8762
- return;
8763
- }
8764
-
8765
- this._super( key, value );
8766
-
8767
- if ( key === "appendTo" ) {
8768
- this.uiDialog.appendTo( this._appendTo() );
8769
- }
8770
-
8771
- if ( key === "buttons" ) {
8772
- this._createButtons();
8773
- }
8774
-
8775
- if ( key === "closeText" ) {
8776
- this.uiDialogTitlebarClose.button({
8777
- // Ensure that we always pass a string
8778
- label: "" + value
8779
- });
8780
- }
8781
-
8782
- if ( key === "draggable" ) {
8783
- isDraggable = uiDialog.is( ":data(ui-draggable)" );
8784
- if ( isDraggable && !value ) {
8785
- uiDialog.draggable( "destroy" );
8786
- }
8787
-
8788
- if ( !isDraggable && value ) {
8789
- this._makeDraggable();
8790
- }
8791
- }
8792
-
8793
- if ( key === "position" ) {
8794
- this._position();
8795
- }
8796
-
8797
- if ( key === "resizable" ) {
8798
- // currently resizable, becoming non-resizable
8799
- isResizable = uiDialog.is( ":data(ui-resizable)" );
8800
- if ( isResizable && !value ) {
8801
- uiDialog.resizable( "destroy" );
8802
- }
8803
-
8804
- // currently resizable, changing handles
8805
- if ( isResizable && typeof value === "string" ) {
8806
- uiDialog.resizable( "option", "handles", value );
8807
- }
8808
-
8809
- // currently non-resizable, becoming resizable
8810
- if ( !isResizable && value !== false ) {
8811
- this._makeResizable();
8812
- }
8813
- }
8814
-
8815
- if ( key === "title" ) {
8816
- this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
8817
- }
8818
- },
8819
-
8820
- _size: function() {
8821
- // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
8822
- // divs will both have width and height set, so we need to reset them
8823
- var nonContentHeight, minContentHeight, maxContentHeight,
8824
- options = this.options;
8825
-
8826
- // Reset content sizing
8827
- this.element.show().css({
8828
- width: "auto",
8829
- minHeight: 0,
8830
- maxHeight: "none",
8831
- height: 0
8832
- });
8833
-
8834
- if ( options.minWidth > options.width ) {
8835
- options.width = options.minWidth;
8836
- }
8837
-
8838
- // reset wrapper sizing
8839
- // determine the height of all the non-content elements
8840
- nonContentHeight = this.uiDialog.css({
8841
- height: "auto",
8842
- width: options.width
8843
- })
8844
- .outerHeight();
8845
- minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
8846
- maxContentHeight = typeof options.maxHeight === "number" ?
8847
- Math.max( 0, options.maxHeight - nonContentHeight ) :
8848
- "none";
8849
-
8850
- if ( options.height === "auto" ) {
8851
- this.element.css({
8852
- minHeight: minContentHeight,
8853
- maxHeight: maxContentHeight,
8854
- height: "auto"
8855
- });
8856
- } else {
8857
- this.element.height( Math.max( 0, options.height - nonContentHeight ) );
8858
- }
8859
-
8860
- if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
8861
- this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
8862
- }
8863
- },
8864
-
8865
- _blockFrames: function() {
8866
- this.iframeBlocks = this.document.find( "iframe" ).map(function() {
8867
- var iframe = $( this );
8868
-
8869
- return $( "<div>" )
8870
- .css({
8871
- position: "absolute",
8872
- width: iframe.outerWidth(),
8873
- height: iframe.outerHeight()
8874
- })
8875
- .appendTo( iframe.parent() )
8876
- .offset( iframe.offset() )[0];
8877
- });
8878
- },
8879
-
8880
- _unblockFrames: function() {
8881
- if ( this.iframeBlocks ) {
8882
- this.iframeBlocks.remove();
8883
- delete this.iframeBlocks;
8884
- }
8885
- },
8886
-
8887
- _allowInteraction: function( event ) {
8888
- if ( $( event.target ).closest( ".ui-dialog" ).length ) {
8889
- return true;
8890
- }
8891
-
8892
- // TODO: Remove hack when datepicker implements
8893
- // the .ui-front logic (#8989)
8894
- return !!$( event.target ).closest( ".ui-datepicker" ).length;
8895
- },
8896
-
8897
- _createOverlay: function() {
8898
- if ( !this.options.modal ) {
8899
- return;
8900
- }
8901
-
8902
- // We use a delay in case the overlay is created from an
8903
- // event that we're going to be cancelling (#2804)
8904
- var isOpening = true;
8905
- this._delay(function() {
8906
- isOpening = false;
8907
- });
8908
-
8909
- if ( !this.document.data( "ui-dialog-overlays" ) ) {
8910
-
8911
- // Prevent use of anchors and inputs
8912
- // Using _on() for an event handler shared across many instances is
8913
- // safe because the dialogs stack and must be closed in reverse order
8914
- this._on( this.document, {
8915
- focusin: function( event ) {
8916
- if ( isOpening ) {
8917
- return;
8918
- }
8919
-
8920
- if ( !this._allowInteraction( event ) ) {
8921
- event.preventDefault();
8922
- this._trackingInstances()[ 0 ]._focusTabbable();
8923
- }
8924
- }
8925
- });
8926
- }
8927
-
8928
- this.overlay = $( "<div>" )
8929
- .addClass( "ui-widget-overlay ui-front" )
8930
- .appendTo( this._appendTo() );
8931
- this._on( this.overlay, {
8932
- mousedown: "_keepFocus"
8933
- });
8934
- this.document.data( "ui-dialog-overlays",
8935
- (this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
8936
- },
8937
-
8938
- _destroyOverlay: function() {
8939
- if ( !this.options.modal ) {
8940
- return;
8941
- }
8942
-
8943
- if ( this.overlay ) {
8944
- var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
8945
-
8946
- if ( !overlays ) {
8947
- this.document
8948
- .unbind( "focusin" )
8949
- .removeData( "ui-dialog-overlays" );
8950
- } else {
8951
- this.document.data( "ui-dialog-overlays", overlays );
8952
- }
8953
-
8954
- this.overlay.remove();
8955
- this.overlay = null;
8956
- }
8957
- }
8958
- });
8959
-
8960
-
8961
- /*!
8962
- * jQuery UI Droppable 1.11.2
8963
- * http://jqueryui.com
8964
- *
8965
- * Copyright 2014 jQuery Foundation and other contributors
8966
- * Released under the MIT license.
8967
- * http://jquery.org/license
8968
- *
8969
- * http://api.jqueryui.com/droppable/
8970
- */
8971
-
8972
-
8973
- $.widget( "ui.droppable", {
8974
- version: "1.11.2",
8975
- widgetEventPrefix: "drop",
8976
- options: {
8977
- accept: "*",
8978
- activeClass: false,
8979
- addClasses: true,
8980
- greedy: false,
8981
- hoverClass: false,
8982
- scope: "default",
8983
- tolerance: "intersect",
8984
-
8985
- // callbacks
8986
- activate: null,
8987
- deactivate: null,
8988
- drop: null,
8989
- out: null,
8990
- over: null
8991
- },
8992
- _create: function() {
8993
-
8994
- var proportions,
8995
- o = this.options,
8996
- accept = o.accept;
8997
-
8998
- this.isover = false;
8999
- this.isout = true;
9000
-
9001
- this.accept = $.isFunction( accept ) ? accept : function( d ) {
9002
- return d.is( accept );
9003
- };
9004
-
9005
- this.proportions = function( /* valueToWrite */ ) {
9006
- if ( arguments.length ) {
9007
- // Store the droppable's proportions
9008
- proportions = arguments[ 0 ];
9009
- } else {
9010
- // Retrieve or derive the droppable's proportions
9011
- return proportions ?
9012
- proportions :
9013
- proportions = {
9014
- width: this.element[ 0 ].offsetWidth,
9015
- height: this.element[ 0 ].offsetHeight
9016
- };
9017
- }
9018
- };
9019
-
9020
- this._addToManager( o.scope );
9021
-
9022
- o.addClasses && this.element.addClass( "ui-droppable" );
9023
-
9024
- },
9025
-
9026
- _addToManager: function( scope ) {
9027
- // Add the reference and positions to the manager
9028
- $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
9029
- $.ui.ddmanager.droppables[ scope ].push( this );
9030
- },
9031
-
9032
- _splice: function( drop ) {
9033
- var i = 0;
9034
- for ( ; i < drop.length; i++ ) {
9035
- if ( drop[ i ] === this ) {
9036
- drop.splice( i, 1 );
9037
- }
9038
- }
9039
- },
9040
-
9041
- _destroy: function() {
9042
- var drop = $.ui.ddmanager.droppables[ this.options.scope ];
9043
-
9044
- this._splice( drop );
9045
-
9046
- this.element.removeClass( "ui-droppable ui-droppable-disabled" );
9047
- },
9048
-
9049
- _setOption: function( key, value ) {
9050
-
9051
- if ( key === "accept" ) {
9052
- this.accept = $.isFunction( value ) ? value : function( d ) {
9053
- return d.is( value );
9054
- };
9055
- } else if ( key === "scope" ) {
9056
- var drop = $.ui.ddmanager.droppables[ this.options.scope ];
9057
-
9058
- this._splice( drop );
9059
- this._addToManager( value );
9060
- }
9061
-
9062
- this._super( key, value );
9063
- },
9064
-
9065
- _activate: function( event ) {
9066
- var draggable = $.ui.ddmanager.current;
9067
- if ( this.options.activeClass ) {
9068
- this.element.addClass( this.options.activeClass );
9069
- }
9070
- if ( draggable ){
9071
- this._trigger( "activate", event, this.ui( draggable ) );
9072
- }
9073
- },
9074
-
9075
- _deactivate: function( event ) {
9076
- var draggable = $.ui.ddmanager.current;
9077
- if ( this.options.activeClass ) {
9078
- this.element.removeClass( this.options.activeClass );
9079
- }
9080
- if ( draggable ){
9081
- this._trigger( "deactivate", event, this.ui( draggable ) );
9082
- }
9083
- },
9084
-
9085
- _over: function( event ) {
9086
-
9087
- var draggable = $.ui.ddmanager.current;
9088
-
9089
- // Bail if draggable and droppable are same element
9090
- if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9091
- return;
9092
- }
9093
-
9094
- if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9095
- if ( this.options.hoverClass ) {
9096
- this.element.addClass( this.options.hoverClass );
9097
- }
9098
- this._trigger( "over", event, this.ui( draggable ) );
9099
- }
9100
-
9101
- },
9102
-
9103
- _out: function( event ) {
9104
-
9105
- var draggable = $.ui.ddmanager.current;
9106
-
9107
- // Bail if draggable and droppable are same element
9108
- if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9109
- return;
9110
- }
9111
-
9112
- if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9113
- if ( this.options.hoverClass ) {
9114
- this.element.removeClass( this.options.hoverClass );
9115
- }
9116
- this._trigger( "out", event, this.ui( draggable ) );
9117
- }
9118
-
9119
- },
9120
-
9121
- _drop: function( event, custom ) {
9122
-
9123
- var draggable = custom || $.ui.ddmanager.current,
9124
- childrenIntersection = false;
9125
-
9126
- // Bail if draggable and droppable are same element
9127
- if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9128
- return false;
9129
- }
9130
-
9131
- this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
9132
- var inst = $( this ).droppable( "instance" );
9133
- if (
9134
- inst.options.greedy &&
9135
- !inst.options.disabled &&
9136
- inst.options.scope === draggable.options.scope &&
9137
- inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
9138
- $.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
9139
- ) { childrenIntersection = true; return false; }
9140
- });
9141
- if ( childrenIntersection ) {
9142
- return false;
9143
- }
9144
-
9145
- if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9146
- if ( this.options.activeClass ) {
9147
- this.element.removeClass( this.options.activeClass );
9148
- }
9149
- if ( this.options.hoverClass ) {
9150
- this.element.removeClass( this.options.hoverClass );
9151
- }
9152
- this._trigger( "drop", event, this.ui( draggable ) );
9153
- return this.element;
9154
- }
9155
-
9156
- return false;
9157
-
9158
- },
9159
-
9160
- ui: function( c ) {
9161
- return {
9162
- draggable: ( c.currentItem || c.element ),
9163
- helper: c.helper,
9164
- position: c.position,
9165
- offset: c.positionAbs
9166
- };
9167
- }
9168
-
9169
- });
9170
-
9171
- $.ui.intersect = (function() {
9172
- function isOverAxis( x, reference, size ) {
9173
- return ( x >= reference ) && ( x < ( reference + size ) );
9174
- }
9175
-
9176
- return function( draggable, droppable, toleranceMode, event ) {
9177
-
9178
- if ( !droppable.offset ) {
9179
- return false;
9180
- }
9181
-
9182
- var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
9183
- y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
9184
- x2 = x1 + draggable.helperProportions.width,
9185
- y2 = y1 + draggable.helperProportions.height,
9186
- l = droppable.offset.left,
9187
- t = droppable.offset.top,
9188
- r = l + droppable.proportions().width,
9189
- b = t + droppable.proportions().height;
9190
-
9191
- switch ( toleranceMode ) {
9192
- case "fit":
9193
- return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
9194
- case "intersect":
9195
- return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
9196
- x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
9197
- t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
9198
- y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
9199
- case "pointer":
9200
- return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
9201
- case "touch":
9202
- return (
9203
- ( y1 >= t && y1 <= b ) || // Top edge touching
9204
- ( y2 >= t && y2 <= b ) || // Bottom edge touching
9205
- ( y1 < t && y2 > b ) // Surrounded vertically
9206
- ) && (
9207
- ( x1 >= l && x1 <= r ) || // Left edge touching
9208
- ( x2 >= l && x2 <= r ) || // Right edge touching
9209
- ( x1 < l && x2 > r ) // Surrounded horizontally
9210
- );
9211
- default:
9212
- return false;
9213
- }
9214
- };
9215
- })();
9216
-
9217
- /*
9218
- This manager tracks offsets of draggables and droppables
9219
- */
9220
- $.ui.ddmanager = {
9221
- current: null,
9222
- droppables: { "default": [] },
9223
- prepareOffsets: function( t, event ) {
9224
-
9225
- var i, j,
9226
- m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
9227
- type = event ? event.type : null, // workaround for #2317
9228
- list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
9229
-
9230
- droppablesLoop: for ( i = 0; i < m.length; i++ ) {
9231
-
9232
- // No disabled and non-accepted
9233
- if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
9234
- continue;
9235
- }
9236
-
9237
- // Filter out elements in the current dragged item
9238
- for ( j = 0; j < list.length; j++ ) {
9239
- if ( list[ j ] === m[ i ].element[ 0 ] ) {
9240
- m[ i ].proportions().height = 0;
9241
- continue droppablesLoop;
9242
- }
9243
- }
9244
-
9245
- m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
9246
- if ( !m[ i ].visible ) {
9247
- continue;
9248
- }
9249
-
9250
- // Activate the droppable if used directly from draggables
9251
- if ( type === "mousedown" ) {
9252
- m[ i ]._activate.call( m[ i ], event );
9253
- }
9254
-
9255
- m[ i ].offset = m[ i ].element.offset();
9256
- m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
9257
-
9258
- }
9259
-
9260
- },
9261
- drop: function( draggable, event ) {
9262
-
9263
- var dropped = false;
9264
- // Create a copy of the droppables in case the list changes during the drop (#9116)
9265
- $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
9266
-
9267
- if ( !this.options ) {
9268
- return;
9269
- }
9270
- if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
9271
- dropped = this._drop.call( this, event ) || dropped;
9272
- }
9273
-
9274
- if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9275
- this.isout = true;
9276
- this.isover = false;
9277
- this._deactivate.call( this, event );
9278
- }
9279
-
9280
- });
9281
- return dropped;
9282
-
9283
- },
9284
- dragStart: function( draggable, event ) {
9285
- // Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
9286
- draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
9287
- if ( !draggable.options.refreshPositions ) {
9288
- $.ui.ddmanager.prepareOffsets( draggable, event );
9289
- }
9290
- });
9291
- },
9292
- drag: function( draggable, event ) {
9293
-
9294
- // If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
9295
- if ( draggable.options.refreshPositions ) {
9296
- $.ui.ddmanager.prepareOffsets( draggable, event );
9297
- }
9298
-
9299
- // Run through all droppables and check their positions based on specific tolerance options
9300
- $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
9301
-
9302
- if ( this.options.disabled || this.greedyChild || !this.visible ) {
9303
- return;
9304
- }
9305
-
9306
- var parentInstance, scope, parent,
9307
- intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
9308
- c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
9309
- if ( !c ) {
9310
- return;
9311
- }
9312
-
9313
- if ( this.options.greedy ) {
9314
- // find droppable parents with same scope
9315
- scope = this.options.scope;
9316
- parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
9317
- return $( this ).droppable( "instance" ).options.scope === scope;
9318
- });
9319
-
9320
- if ( parent.length ) {
9321
- parentInstance = $( parent[ 0 ] ).droppable( "instance" );
9322
- parentInstance.greedyChild = ( c === "isover" );
9323
- }
9324
- }
9325
-
9326
- // we just moved into a greedy child
9327
- if ( parentInstance && c === "isover" ) {
9328
- parentInstance.isover = false;
9329
- parentInstance.isout = true;
9330
- parentInstance._out.call( parentInstance, event );
9331
- }
9332
-
9333
- this[ c ] = true;
9334
- this[c === "isout" ? "isover" : "isout"] = false;
9335
- this[c === "isover" ? "_over" : "_out"].call( this, event );
9336
-
9337
- // we just moved out of a greedy child
9338
- if ( parentInstance && c === "isout" ) {
9339
- parentInstance.isout = false;
9340
- parentInstance.isover = true;
9341
- parentInstance._over.call( parentInstance, event );
9342
- }
9343
- });
9344
-
9345
- },
9346
- dragStop: function( draggable, event ) {
9347
- draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
9348
- // Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
9349
- if ( !draggable.options.refreshPositions ) {
9350
- $.ui.ddmanager.prepareOffsets( draggable, event );
9351
- }
9352
- }
9353
- };
9354
-
9355
- var droppable = $.ui.droppable;
9356
-
9357
-
9358
- /*!
9359
- * jQuery UI Effects 1.11.2
9360
- * http://jqueryui.com
9361
- *
9362
- * Copyright 2014 jQuery Foundation and other contributors
9363
- * Released under the MIT license.
9364
- * http://jquery.org/license
9365
- *
9366
- * http://api.jqueryui.com/category/effects-core/
9367
- */
9368
-
9369
-
9370
- var dataSpace = "ui-effects-",
9371
-
9372
- // Create a local jQuery because jQuery Color relies on it and the
9373
- // global may not exist with AMD and a custom build (#10199)
9374
- jQuery = $;
9375
-
9376
- $.effects = {
9377
- effect: {}
9378
- };
9379
-
9380
- /*!
9381
- * jQuery Color Animations v2.1.2
9382
- * https://github.com/jquery/jquery-color
9383
- *
9384
- * Copyright 2014 jQuery Foundation and other contributors
9385
- * Released under the MIT license.
9386
- * http://jquery.org/license
9387
- *
9388
- * Date: Wed Jan 16 08:47:09 2013 -0600
9389
- */
9390
- (function( jQuery, undefined ) {
9391
-
9392
- var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
9393
-
9394
- // plusequals test for += 100 -= 100
9395
- rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
9396
- // a set of RE's that can match strings and generate color tuples.
9397
- stringParsers = [ {
9398
- re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9399
- parse: function( execResult ) {
9400
- return [
9401
- execResult[ 1 ],
9402
- execResult[ 2 ],
9403
- execResult[ 3 ],
9404
- execResult[ 4 ]
9405
- ];
9406
- }
9407
- }, {
9408
- re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9409
- parse: function( execResult ) {
9410
- return [
9411
- execResult[ 1 ] * 2.55,
9412
- execResult[ 2 ] * 2.55,
9413
- execResult[ 3 ] * 2.55,
9414
- execResult[ 4 ]
9415
- ];
9416
- }
9417
- }, {
9418
- // this regex ignores A-F because it's compared against an already lowercased string
9419
- re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
9420
- parse: function( execResult ) {
9421
- return [
9422
- parseInt( execResult[ 1 ], 16 ),
9423
- parseInt( execResult[ 2 ], 16 ),
9424
- parseInt( execResult[ 3 ], 16 )
9425
- ];
9426
- }
9427
- }, {
9428
- // this regex ignores A-F because it's compared against an already lowercased string
9429
- re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
9430
- parse: function( execResult ) {
9431
- return [
9432
- parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
9433
- parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
9434
- parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
9435
- ];
9436
- }
9437
- }, {
9438
- re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9439
- space: "hsla",
9440
- parse: function( execResult ) {
9441
- return [
9442
- execResult[ 1 ],
9443
- execResult[ 2 ] / 100,
9444
- execResult[ 3 ] / 100,
9445
- execResult[ 4 ]
9446
- ];
9447
- }
9448
- } ],
9449
-
9450
- // jQuery.Color( )
9451
- color = jQuery.Color = function( color, green, blue, alpha ) {
9452
- return new jQuery.Color.fn.parse( color, green, blue, alpha );
9453
- },
9454
- spaces = {
9455
- rgba: {
9456
- props: {
9457
- red: {
9458
- idx: 0,
9459
- type: "byte"
9460
- },
9461
- green: {
9462
- idx: 1,
9463
- type: "byte"
9464
- },
9465
- blue: {
9466
- idx: 2,
9467
- type: "byte"
9468
- }
9469
- }
9470
- },
9471
-
9472
- hsla: {
9473
- props: {
9474
- hue: {
9475
- idx: 0,
9476
- type: "degrees"
9477
- },
9478
- saturation: {
9479
- idx: 1,
9480
- type: "percent"
9481
- },
9482
- lightness: {
9483
- idx: 2,
9484
- type: "percent"
9485
- }
9486
- }
9487
- }
9488
- },
9489
- propTypes = {
9490
- "byte": {
9491
- floor: true,
9492
- max: 255
9493
- },
9494
- "percent": {
9495
- max: 1
9496
- },
9497
- "degrees": {
9498
- mod: 360,
9499
- floor: true
9500
- }
9501
- },
9502
- support = color.support = {},
9503
-
9504
- // element for support tests
9505
- supportElem = jQuery( "<p>" )[ 0 ],
9506
-
9507
- // colors = jQuery.Color.names
9508
- colors,
9509
-
9510
- // local aliases of functions called often
9511
- each = jQuery.each;
9512
-
9513
- // determine rgba support immediately
9514
- supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
9515
- support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
9516
-
9517
- // define cache name and alpha properties
9518
- // for rgba and hsla spaces
9519
- each( spaces, function( spaceName, space ) {
9520
- space.cache = "_" + spaceName;
9521
- space.props.alpha = {
9522
- idx: 3,
9523
- type: "percent",
9524
- def: 1
9525
- };
9526
- });
9527
-
9528
- function clamp( value, prop, allowEmpty ) {
9529
- var type = propTypes[ prop.type ] || {};
9530
-
9531
- if ( value == null ) {
9532
- return (allowEmpty || !prop.def) ? null : prop.def;
9533
- }
9534
-
9535
- // ~~ is an short way of doing floor for positive numbers
9536
- value = type.floor ? ~~value : parseFloat( value );
9537
-
9538
- // IE will pass in empty strings as value for alpha,
9539
- // which will hit this case
9540
- if ( isNaN( value ) ) {
9541
- return prop.def;
9542
- }
9543
-
9544
- if ( type.mod ) {
9545
- // we add mod before modding to make sure that negatives values
9546
- // get converted properly: -10 -> 350
9547
- return (value + type.mod) % type.mod;
9548
- }
9549
-
9550
- // for now all property types without mod have min and max
9551
- return 0 > value ? 0 : type.max < value ? type.max : value;
9552
- }
9553
-
9554
- function stringParse( string ) {
9555
- var inst = color(),
9556
- rgba = inst._rgba = [];
9557
-
9558
- string = string.toLowerCase();
9559
-
9560
- each( stringParsers, function( i, parser ) {
9561
- var parsed,
9562
- match = parser.re.exec( string ),
9563
- values = match && parser.parse( match ),
9564
- spaceName = parser.space || "rgba";
9565
-
9566
- if ( values ) {
9567
- parsed = inst[ spaceName ]( values );
9568
-
9569
- // if this was an rgba parse the assignment might happen twice
9570
- // oh well....
9571
- inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
9572
- rgba = inst._rgba = parsed._rgba;
9573
-
9574
- // exit each( stringParsers ) here because we matched
9575
- return false;
9576
- }
9577
- });
9578
-
9579
- // Found a stringParser that handled it
9580
- if ( rgba.length ) {
9581
-
9582
- // if this came from a parsed string, force "transparent" when alpha is 0
9583
- // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
9584
- if ( rgba.join() === "0,0,0,0" ) {
9585
- jQuery.extend( rgba, colors.transparent );
9586
- }
9587
- return inst;
9588
- }
9589
-
9590
- // named colors
9591
- return colors[ string ];
9592
- }
9593
-
9594
- color.fn = jQuery.extend( color.prototype, {
9595
- parse: function( red, green, blue, alpha ) {
9596
- if ( red === undefined ) {
9597
- this._rgba = [ null, null, null, null ];
9598
- return this;
9599
- }
9600
- if ( red.jquery || red.nodeType ) {
9601
- red = jQuery( red ).css( green );
9602
- green = undefined;
9603
- }
9604
-
9605
- var inst = this,
9606
- type = jQuery.type( red ),
9607
- rgba = this._rgba = [];
9608
-
9609
- // more than 1 argument specified - assume ( red, green, blue, alpha )
9610
- if ( green !== undefined ) {
9611
- red = [ red, green, blue, alpha ];
9612
- type = "array";
9613
- }
9614
-
9615
- if ( type === "string" ) {
9616
- return this.parse( stringParse( red ) || colors._default );
9617
- }
9618
-
9619
- if ( type === "array" ) {
9620
- each( spaces.rgba.props, function( key, prop ) {
9621
- rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
9622
- });
9623
- return this;
9624
- }
9625
-
9626
- if ( type === "object" ) {
9627
- if ( red instanceof color ) {
9628
- each( spaces, function( spaceName, space ) {
9629
- if ( red[ space.cache ] ) {
9630
- inst[ space.cache ] = red[ space.cache ].slice();
9631
- }
9632
- });
9633
- } else {
9634
- each( spaces, function( spaceName, space ) {
9635
- var cache = space.cache;
9636
- each( space.props, function( key, prop ) {
9637
-
9638
- // if the cache doesn't exist, and we know how to convert
9639
- if ( !inst[ cache ] && space.to ) {
9640
-
9641
- // if the value was null, we don't need to copy it
9642
- // if the key was alpha, we don't need to copy it either
9643
- if ( key === "alpha" || red[ key ] == null ) {
9644
- return;
9645
- }
9646
- inst[ cache ] = space.to( inst._rgba );
9647
- }
9648
-
9649
- // this is the only case where we allow nulls for ALL properties.
9650
- // call clamp with alwaysAllowEmpty
9651
- inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
9652
- });
9653
-
9654
- // everything defined but alpha?
9655
- if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
9656
- // use the default of 1
9657
- inst[ cache ][ 3 ] = 1;
9658
- if ( space.from ) {
9659
- inst._rgba = space.from( inst[ cache ] );
9660
- }
9661
- }
9662
- });
9663
- }
9664
- return this;
9665
- }
9666
- },
9667
- is: function( compare ) {
9668
- var is = color( compare ),
9669
- same = true,
9670
- inst = this;
9671
-
9672
- each( spaces, function( _, space ) {
9673
- var localCache,
9674
- isCache = is[ space.cache ];
9675
- if (isCache) {
9676
- localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
9677
- each( space.props, function( _, prop ) {
9678
- if ( isCache[ prop.idx ] != null ) {
9679
- same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
9680
- return same;
9681
- }
9682
- });
9683
- }
9684
- return same;
9685
- });
9686
- return same;
9687
- },
9688
- _space: function() {
9689
- var used = [],
9690
- inst = this;
9691
- each( spaces, function( spaceName, space ) {
9692
- if ( inst[ space.cache ] ) {
9693
- used.push( spaceName );
9694
- }
9695
- });
9696
- return used.pop();
9697
- },
9698
- transition: function( other, distance ) {
9699
- var end = color( other ),
9700
- spaceName = end._space(),
9701
- space = spaces[ spaceName ],
9702
- startColor = this.alpha() === 0 ? color( "transparent" ) : this,
9703
- start = startColor[ space.cache ] || space.to( startColor._rgba ),
9704
- result = start.slice();
9705
-
9706
- end = end[ space.cache ];
9707
- each( space.props, function( key, prop ) {
9708
- var index = prop.idx,
9709
- startValue = start[ index ],
9710
- endValue = end[ index ],
9711
- type = propTypes[ prop.type ] || {};
9712
-
9713
- // if null, don't override start value
9714
- if ( endValue === null ) {
9715
- return;
9716
- }
9717
- // if null - use end
9718
- if ( startValue === null ) {
9719
- result[ index ] = endValue;
9720
- } else {
9721
- if ( type.mod ) {
9722
- if ( endValue - startValue > type.mod / 2 ) {
9723
- startValue += type.mod;
9724
- } else if ( startValue - endValue > type.mod / 2 ) {
9725
- startValue -= type.mod;
9726
- }
9727
- }
9728
- result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
9729
- }
9730
- });
9731
- return this[ spaceName ]( result );
9732
- },
9733
- blend: function( opaque ) {
9734
- // if we are already opaque - return ourself
9735
- if ( this._rgba[ 3 ] === 1 ) {
9736
- return this;
9737
- }
9738
-
9739
- var rgb = this._rgba.slice(),
9740
- a = rgb.pop(),
9741
- blend = color( opaque )._rgba;
9742
-
9743
- return color( jQuery.map( rgb, function( v, i ) {
9744
- return ( 1 - a ) * blend[ i ] + a * v;
9745
- }));
9746
- },
9747
- toRgbaString: function() {
9748
- var prefix = "rgba(",
9749
- rgba = jQuery.map( this._rgba, function( v, i ) {
9750
- return v == null ? ( i > 2 ? 1 : 0 ) : v;
9751
- });
9752
-
9753
- if ( rgba[ 3 ] === 1 ) {
9754
- rgba.pop();
9755
- prefix = "rgb(";
9756
- }
9757
-
9758
- return prefix + rgba.join() + ")";
9759
- },
9760
- toHslaString: function() {
9761
- var prefix = "hsla(",
9762
- hsla = jQuery.map( this.hsla(), function( v, i ) {
9763
- if ( v == null ) {
9764
- v = i > 2 ? 1 : 0;
9765
- }
9766
-
9767
- // catch 1 and 2
9768
- if ( i && i < 3 ) {
9769
- v = Math.round( v * 100 ) + "%";
9770
- }
9771
- return v;
9772
- });
9773
-
9774
- if ( hsla[ 3 ] === 1 ) {
9775
- hsla.pop();
9776
- prefix = "hsl(";
9777
- }
9778
- return prefix + hsla.join() + ")";
9779
- },
9780
- toHexString: function( includeAlpha ) {
9781
- var rgba = this._rgba.slice(),
9782
- alpha = rgba.pop();
9783
-
9784
- if ( includeAlpha ) {
9785
- rgba.push( ~~( alpha * 255 ) );
9786
- }
9787
-
9788
- return "#" + jQuery.map( rgba, function( v ) {
9789
-
9790
- // default to 0 when nulls exist
9791
- v = ( v || 0 ).toString( 16 );
9792
- return v.length === 1 ? "0" + v : v;
9793
- }).join("");
9794
- },
9795
- toString: function() {
9796
- return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
9797
- }
9798
- });
9799
- color.fn.parse.prototype = color.fn;
9800
-
9801
- // hsla conversions adapted from:
9802
- // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
9803
-
9804
- function hue2rgb( p, q, h ) {
9805
- h = ( h + 1 ) % 1;
9806
- if ( h * 6 < 1 ) {
9807
- return p + ( q - p ) * h * 6;
9808
- }
9809
- if ( h * 2 < 1) {
9810
- return q;
9811
- }
9812
- if ( h * 3 < 2 ) {
9813
- return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
9814
- }
9815
- return p;
9816
- }
9817
-
9818
- spaces.hsla.to = function( rgba ) {
9819
- if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
9820
- return [ null, null, null, rgba[ 3 ] ];
9821
- }
9822
- var r = rgba[ 0 ] / 255,
9823
- g = rgba[ 1 ] / 255,
9824
- b = rgba[ 2 ] / 255,
9825
- a = rgba[ 3 ],
9826
- max = Math.max( r, g, b ),
9827
- min = Math.min( r, g, b ),
9828
- diff = max - min,
9829
- add = max + min,
9830
- l = add * 0.5,
9831
- h, s;
9832
-
9833
- if ( min === max ) {
9834
- h = 0;
9835
- } else if ( r === max ) {
9836
- h = ( 60 * ( g - b ) / diff ) + 360;
9837
- } else if ( g === max ) {
9838
- h = ( 60 * ( b - r ) / diff ) + 120;
9839
- } else {
9840
- h = ( 60 * ( r - g ) / diff ) + 240;
9841
- }
9842
-
9843
- // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
9844
- // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
9845
- if ( diff === 0 ) {
9846
- s = 0;
9847
- } else if ( l <= 0.5 ) {
9848
- s = diff / add;
9849
- } else {
9850
- s = diff / ( 2 - add );
9851
- }
9852
- return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
9853
- };
9854
-
9855
- spaces.hsla.from = function( hsla ) {
9856
- if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
9857
- return [ null, null, null, hsla[ 3 ] ];
9858
- }
9859
- var h = hsla[ 0 ] / 360,
9860
- s = hsla[ 1 ],
9861
- l = hsla[ 2 ],
9862
- a = hsla[ 3 ],
9863
- q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
9864
- p = 2 * l - q;
9865
-
9866
- return [
9867
- Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
9868
- Math.round( hue2rgb( p, q, h ) * 255 ),
9869
- Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
9870
- a
9871
- ];
9872
- };
9873
-
9874
- each( spaces, function( spaceName, space ) {
9875
- var props = space.props,
9876
- cache = space.cache,
9877
- to = space.to,
9878
- from = space.from;
9879
-
9880
- // makes rgba() and hsla()
9881
- color.fn[ spaceName ] = function( value ) {
9882
-
9883
- // generate a cache for this space if it doesn't exist
9884
- if ( to && !this[ cache ] ) {
9885
- this[ cache ] = to( this._rgba );
9886
- }
9887
- if ( value === undefined ) {
9888
- return this[ cache ].slice();
9889
- }
9890
-
9891
- var ret,
9892
- type = jQuery.type( value ),
9893
- arr = ( type === "array" || type === "object" ) ? value : arguments,
9894
- local = this[ cache ].slice();
9895
-
9896
- each( props, function( key, prop ) {
9897
- var val = arr[ type === "object" ? key : prop.idx ];
9898
- if ( val == null ) {
9899
- val = local[ prop.idx ];
9900
- }
9901
- local[ prop.idx ] = clamp( val, prop );
9902
- });
9903
-
9904
- if ( from ) {
9905
- ret = color( from( local ) );
9906
- ret[ cache ] = local;
9907
- return ret;
9908
- } else {
9909
- return color( local );
9910
- }
9911
- };
9912
-
9913
- // makes red() green() blue() alpha() hue() saturation() lightness()
9914
- each( props, function( key, prop ) {
9915
- // alpha is included in more than one space
9916
- if ( color.fn[ key ] ) {
9917
- return;
9918
- }
9919
- color.fn[ key ] = function( value ) {
9920
- var vtype = jQuery.type( value ),
9921
- fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
9922
- local = this[ fn ](),
9923
- cur = local[ prop.idx ],
9924
- match;
9925
-
9926
- if ( vtype === "undefined" ) {
9927
- return cur;
9928
- }
9929
-
9930
- if ( vtype === "function" ) {
9931
- value = value.call( this, cur );
9932
- vtype = jQuery.type( value );
9933
- }
9934
- if ( value == null && prop.empty ) {
9935
- return this;
9936
- }
9937
- if ( vtype === "string" ) {
9938
- match = rplusequals.exec( value );
9939
- if ( match ) {
9940
- value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
9941
- }
9942
- }
9943
- local[ prop.idx ] = value;
9944
- return this[ fn ]( local );
9945
- };
9946
- });
9947
- });
9948
-
9949
- // add cssHook and .fx.step function for each named hook.
9950
- // accept a space separated string of properties
9951
- color.hook = function( hook ) {
9952
- var hooks = hook.split( " " );
9953
- each( hooks, function( i, hook ) {
9954
- jQuery.cssHooks[ hook ] = {
9955
- set: function( elem, value ) {
9956
- var parsed, curElem,
9957
- backgroundColor = "";
9958
-
9959
- if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
9960
- value = color( parsed || value );
9961
- if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
9962
- curElem = hook === "backgroundColor" ? elem.parentNode : elem;
9963
- while (
9964
- (backgroundColor === "" || backgroundColor === "transparent") &&
9965
- curElem && curElem.style
9966
- ) {
9967
- try {
9968
- backgroundColor = jQuery.css( curElem, "backgroundColor" );
9969
- curElem = curElem.parentNode;
9970
- } catch ( e ) {
9971
- }
9972
- }
9973
-
9974
- value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
9975
- backgroundColor :
9976
- "_default" );
9977
- }
9978
-
9979
- value = value.toRgbaString();
9980
- }
9981
- try {
9982
- elem.style[ hook ] = value;
9983
- } catch ( e ) {
9984
- // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
9985
- }
9986
- }
9987
- };
9988
- jQuery.fx.step[ hook ] = function( fx ) {
9989
- if ( !fx.colorInit ) {
9990
- fx.start = color( fx.elem, hook );
9991
- fx.end = color( fx.end );
9992
- fx.colorInit = true;
9993
- }
9994
- jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
9995
- };
9996
- });
9997
-
9998
- };
9999
-
10000
- color.hook( stepHooks );
10001
-
10002
- jQuery.cssHooks.borderColor = {
10003
- expand: function( value ) {
10004
- var expanded = {};
10005
-
10006
- each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
10007
- expanded[ "border" + part + "Color" ] = value;
10008
- });
10009
- return expanded;
10010
- }
10011
- };
10012
-
10013
- // Basic color names only.
10014
- // Usage of any of the other color names requires adding yourself or including
10015
- // jquery.color.svg-names.js.
10016
- colors = jQuery.Color.names = {
10017
- // 4.1. Basic color keywords
10018
- aqua: "#00ffff",
10019
- black: "#000000",
10020
- blue: "#0000ff",
10021
- fuchsia: "#ff00ff",
10022
- gray: "#808080",
10023
- green: "#008000",
10024
- lime: "#00ff00",
10025
- maroon: "#800000",
10026
- navy: "#000080",
10027
- olive: "#808000",
10028
- purple: "#800080",
10029
- red: "#ff0000",
10030
- silver: "#c0c0c0",
10031
- teal: "#008080",
10032
- white: "#ffffff",
10033
- yellow: "#ffff00",
10034
-
10035
- // 4.2.3. "transparent" color keyword
10036
- transparent: [ null, null, null, 0 ],
10037
-
10038
- _default: "#ffffff"
10039
- };
10040
-
10041
- })( jQuery );
10042
-
10043
- /******************************************************************************/
10044
- /****************************** CLASS ANIMATIONS ******************************/
10045
- /******************************************************************************/
10046
- (function() {
10047
-
10048
- var classAnimationActions = [ "add", "remove", "toggle" ],
10049
- shorthandStyles = {
10050
- border: 1,
10051
- borderBottom: 1,
10052
- borderColor: 1,
10053
- borderLeft: 1,
10054
- borderRight: 1,
10055
- borderTop: 1,
10056
- borderWidth: 1,
10057
- margin: 1,
10058
- padding: 1
10059
- };
10060
-
10061
- $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
10062
- $.fx.step[ prop ] = function( fx ) {
10063
- if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
10064
- jQuery.style( fx.elem, prop, fx.end );
10065
- fx.setAttr = true;
10066
- }
10067
- };
10068
- });
10069
-
10070
- function getElementStyles( elem ) {
10071
- var key, len,
10072
- style = elem.ownerDocument.defaultView ?
10073
- elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
10074
- elem.currentStyle,
10075
- styles = {};
10076
-
10077
- if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
10078
- len = style.length;
10079
- while ( len-- ) {
10080
- key = style[ len ];
10081
- if ( typeof style[ key ] === "string" ) {
10082
- styles[ $.camelCase( key ) ] = style[ key ];
10083
- }
10084
- }
10085
- // support: Opera, IE <9
10086
- } else {
10087
- for ( key in style ) {
10088
- if ( typeof style[ key ] === "string" ) {
10089
- styles[ key ] = style[ key ];
10090
- }
10091
- }
10092
- }
10093
-
10094
- return styles;
10095
- }
10096
-
10097
- function styleDifference( oldStyle, newStyle ) {
10098
- var diff = {},
10099
- name, value;
10100
-
10101
- for ( name in newStyle ) {
10102
- value = newStyle[ name ];
10103
- if ( oldStyle[ name ] !== value ) {
10104
- if ( !shorthandStyles[ name ] ) {
10105
- if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
10106
- diff[ name ] = value;
10107
- }
10108
- }
10109
- }
10110
- }
10111
-
10112
- return diff;
10113
- }
10114
-
10115
- // support: jQuery <1.8
10116
- if ( !$.fn.addBack ) {
10117
- $.fn.addBack = function( selector ) {
10118
- return this.add( selector == null ?
10119
- this.prevObject : this.prevObject.filter( selector )
10120
- );
10121
- };
10122
- }
10123
-
10124
- $.effects.animateClass = function( value, duration, easing, callback ) {
10125
- var o = $.speed( duration, easing, callback );
10126
-
10127
- return this.queue( function() {
10128
- var animated = $( this ),
10129
- baseClass = animated.attr( "class" ) || "",
10130
- applyClassChange,
10131
- allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
10132
-
10133
- // map the animated objects to store the original styles.
10134
- allAnimations = allAnimations.map(function() {
10135
- var el = $( this );
10136
- return {
10137
- el: el,
10138
- start: getElementStyles( this )
10139
- };
10140
- });
10141
-
10142
- // apply class change
10143
- applyClassChange = function() {
10144
- $.each( classAnimationActions, function(i, action) {
10145
- if ( value[ action ] ) {
10146
- animated[ action + "Class" ]( value[ action ] );
10147
- }
10148
- });
10149
- };
10150
- applyClassChange();
10151
-
10152
- // map all animated objects again - calculate new styles and diff
10153
- allAnimations = allAnimations.map(function() {
10154
- this.end = getElementStyles( this.el[ 0 ] );
10155
- this.diff = styleDifference( this.start, this.end );
10156
- return this;
10157
- });
10158
-
10159
- // apply original class
10160
- animated.attr( "class", baseClass );
10161
-
10162
- // map all animated objects again - this time collecting a promise
10163
- allAnimations = allAnimations.map(function() {
10164
- var styleInfo = this,
10165
- dfd = $.Deferred(),
10166
- opts = $.extend({}, o, {
10167
- queue: false,
10168
- complete: function() {
10169
- dfd.resolve( styleInfo );
10170
- }
10171
- });
10172
-
10173
- this.el.animate( this.diff, opts );
10174
- return dfd.promise();
10175
- });
10176
-
10177
- // once all animations have completed:
10178
- $.when.apply( $, allAnimations.get() ).done(function() {
10179
-
10180
- // set the final class
10181
- applyClassChange();
10182
-
10183
- // for each animated element,
10184
- // clear all css properties that were animated
10185
- $.each( arguments, function() {
10186
- var el = this.el;
10187
- $.each( this.diff, function(key) {
10188
- el.css( key, "" );
10189
- });
10190
- });
10191
-
10192
- // this is guarnteed to be there if you use jQuery.speed()
10193
- // it also handles dequeuing the next anim...
10194
- o.complete.call( animated[ 0 ] );
10195
- });
10196
- });
10197
- };
10198
-
10199
- $.fn.extend({
10200
- addClass: (function( orig ) {
10201
- return function( classNames, speed, easing, callback ) {
10202
- return speed ?
10203
- $.effects.animateClass.call( this,
10204
- { add: classNames }, speed, easing, callback ) :
10205
- orig.apply( this, arguments );
10206
- };
10207
- })( $.fn.addClass ),
10208
-
10209
- removeClass: (function( orig ) {
10210
- return function( classNames, speed, easing, callback ) {
10211
- return arguments.length > 1 ?
10212
- $.effects.animateClass.call( this,
10213
- { remove: classNames }, speed, easing, callback ) :
10214
- orig.apply( this, arguments );
10215
- };
10216
- })( $.fn.removeClass ),
10217
-
10218
- toggleClass: (function( orig ) {
10219
- return function( classNames, force, speed, easing, callback ) {
10220
- if ( typeof force === "boolean" || force === undefined ) {
10221
- if ( !speed ) {
10222
- // without speed parameter
10223
- return orig.apply( this, arguments );
10224
- } else {
10225
- return $.effects.animateClass.call( this,
10226
- (force ? { add: classNames } : { remove: classNames }),
10227
- speed, easing, callback );
10228
- }
10229
- } else {
10230
- // without force parameter
10231
- return $.effects.animateClass.call( this,
10232
- { toggle: classNames }, force, speed, easing );
10233
- }
10234
- };
10235
- })( $.fn.toggleClass ),
10236
-
10237
- switchClass: function( remove, add, speed, easing, callback) {
10238
- return $.effects.animateClass.call( this, {
10239
- add: add,
10240
- remove: remove
10241
- }, speed, easing, callback );
10242
- }
10243
- });
10244
-
10245
- })();
10246
-
10247
- /******************************************************************************/
10248
- /*********************************** EFFECTS **********************************/
10249
- /******************************************************************************/
10250
-
10251
- (function() {
10252
-
10253
- $.extend( $.effects, {
10254
- version: "1.11.2",
10255
-
10256
- // Saves a set of properties in a data storage
10257
- save: function( element, set ) {
10258
- for ( var i = 0; i < set.length; i++ ) {
10259
- if ( set[ i ] !== null ) {
10260
- element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
10261
- }
10262
- }
10263
- },
10264
-
10265
- // Restores a set of previously saved properties from a data storage
10266
- restore: function( element, set ) {
10267
- var val, i;
10268
- for ( i = 0; i < set.length; i++ ) {
10269
- if ( set[ i ] !== null ) {
10270
- val = element.data( dataSpace + set[ i ] );
10271
- // support: jQuery 1.6.2
10272
- // http://bugs.jquery.com/ticket/9917
10273
- // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
10274
- // We can't differentiate between "" and 0 here, so we just assume
10275
- // empty string since it's likely to be a more common value...
10276
- if ( val === undefined ) {
10277
- val = "";
10278
- }
10279
- element.css( set[ i ], val );
10280
- }
10281
- }
10282
- },
10283
-
10284
- setMode: function( el, mode ) {
10285
- if (mode === "toggle") {
10286
- mode = el.is( ":hidden" ) ? "show" : "hide";
10287
- }
10288
- return mode;
10289
- },
10290
-
10291
- // Translates a [top,left] array into a baseline value
10292
- // this should be a little more flexible in the future to handle a string & hash
10293
- getBaseline: function( origin, original ) {
10294
- var y, x;
10295
- switch ( origin[ 0 ] ) {
10296
- case "top": y = 0; break;
10297
- case "middle": y = 0.5; break;
10298
- case "bottom": y = 1; break;
10299
- default: y = origin[ 0 ] / original.height;
10300
- }
10301
- switch ( origin[ 1 ] ) {
10302
- case "left": x = 0; break;
10303
- case "center": x = 0.5; break;
10304
- case "right": x = 1; break;
10305
- default: x = origin[ 1 ] / original.width;
10306
- }
10307
- return {
10308
- x: x,
10309
- y: y
10310
- };
10311
- },
10312
-
10313
- // Wraps the element around a wrapper that copies position properties
10314
- createWrapper: function( element ) {
10315
-
10316
- // if the element is already wrapped, return it
10317
- if ( element.parent().is( ".ui-effects-wrapper" )) {
10318
- return element.parent();
10319
- }
10320
-
10321
- // wrap the element
10322
- var props = {
10323
- width: element.outerWidth(true),
10324
- height: element.outerHeight(true),
10325
- "float": element.css( "float" )
10326
- },
10327
- wrapper = $( "<div></div>" )
10328
- .addClass( "ui-effects-wrapper" )
10329
- .css({
10330
- fontSize: "100%",
10331
- background: "transparent",
10332
- border: "none",
10333
- margin: 0,
10334
- padding: 0
10335
- }),
10336
- // Store the size in case width/height are defined in % - Fixes #5245
10337
- size = {
10338
- width: element.width(),
10339
- height: element.height()
10340
- },
10341
- active = document.activeElement;
10342
-
10343
- // support: Firefox
10344
- // Firefox incorrectly exposes anonymous content
10345
- // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
10346
- try {
10347
- active.id;
10348
- } catch ( e ) {
10349
- active = document.body;
10350
- }
10351
-
10352
- element.wrap( wrapper );
10353
-
10354
- // Fixes #7595 - Elements lose focus when wrapped.
10355
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
10356
- $( active ).focus();
10357
- }
10358
-
10359
- wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
10360
-
10361
- // transfer positioning properties to the wrapper
10362
- if ( element.css( "position" ) === "static" ) {
10363
- wrapper.css({ position: "relative" });
10364
- element.css({ position: "relative" });
10365
- } else {
10366
- $.extend( props, {
10367
- position: element.css( "position" ),
10368
- zIndex: element.css( "z-index" )
10369
- });
10370
- $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
10371
- props[ pos ] = element.css( pos );
10372
- if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
10373
- props[ pos ] = "auto";
10374
- }
10375
- });
10376
- element.css({
10377
- position: "relative",
10378
- top: 0,
10379
- left: 0,
10380
- right: "auto",
10381
- bottom: "auto"
10382
- });
10383
- }
10384
- element.css(size);
10385
-
10386
- return wrapper.css( props ).show();
10387
- },
10388
-
10389
- removeWrapper: function( element ) {
10390
- var active = document.activeElement;
10391
-
10392
- if ( element.parent().is( ".ui-effects-wrapper" ) ) {
10393
- element.parent().replaceWith( element );
10394
-
10395
- // Fixes #7595 - Elements lose focus when wrapped.
10396
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
10397
- $( active ).focus();
10398
- }
10399
- }
10400
-
10401
- return element;
10402
- },
10403
-
10404
- setTransition: function( element, list, factor, value ) {
10405
- value = value || {};
10406
- $.each( list, function( i, x ) {
10407
- var unit = element.cssUnit( x );
10408
- if ( unit[ 0 ] > 0 ) {
10409
- value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
10410
- }
10411
- });
10412
- return value;
10413
- }
10414
- });
10415
-
10416
- // return an effect options object for the given parameters:
10417
- function _normalizeArguments( effect, options, speed, callback ) {
10418
-
10419
- // allow passing all options as the first parameter
10420
- if ( $.isPlainObject( effect ) ) {
10421
- options = effect;
10422
- effect = effect.effect;
10423
- }
10424
-
10425
- // convert to an object
10426
- effect = { effect: effect };
10427
-
10428
- // catch (effect, null, ...)
10429
- if ( options == null ) {
10430
- options = {};
10431
- }
10432
-
10433
- // catch (effect, callback)
10434
- if ( $.isFunction( options ) ) {
10435
- callback = options;
10436
- speed = null;
10437
- options = {};
10438
- }
10439
-
10440
- // catch (effect, speed, ?)
10441
- if ( typeof options === "number" || $.fx.speeds[ options ] ) {
10442
- callback = speed;
10443
- speed = options;
10444
- options = {};
10445
- }
10446
-
10447
- // catch (effect, options, callback)
10448
- if ( $.isFunction( speed ) ) {
10449
- callback = speed;
10450
- speed = null;
10451
- }
10452
-
10453
- // add options to effect
10454
- if ( options ) {
10455
- $.extend( effect, options );
10456
- }
10457
-
10458
- speed = speed || options.duration;
10459
- effect.duration = $.fx.off ? 0 :
10460
- typeof speed === "number" ? speed :
10461
- speed in $.fx.speeds ? $.fx.speeds[ speed ] :
10462
- $.fx.speeds._default;
10463
-
10464
- effect.complete = callback || options.complete;
10465
-
10466
- return effect;
10467
- }
10468
-
10469
- function standardAnimationOption( option ) {
10470
- // Valid standard speeds (nothing, number, named speed)
10471
- if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
10472
- return true;
10473
- }
10474
-
10475
- // Invalid strings - treat as "normal" speed
10476
- if ( typeof option === "string" && !$.effects.effect[ option ] ) {
10477
- return true;
10478
- }
10479
-
10480
- // Complete callback
10481
- if ( $.isFunction( option ) ) {
10482
- return true;
10483
- }
10484
-
10485
- // Options hash (but not naming an effect)
10486
- if ( typeof option === "object" && !option.effect ) {
10487
- return true;
10488
- }
10489
-
10490
- // Didn't match any standard API
10491
- return false;
10492
- }
10493
-
10494
- $.fn.extend({
10495
- effect: function( /* effect, options, speed, callback */ ) {
10496
- var args = _normalizeArguments.apply( this, arguments ),
10497
- mode = args.mode,
10498
- queue = args.queue,
10499
- effectMethod = $.effects.effect[ args.effect ];
10500
-
10501
- if ( $.fx.off || !effectMethod ) {
10502
- // delegate to the original method (e.g., .show()) if possible
10503
- if ( mode ) {
10504
- return this[ mode ]( args.duration, args.complete );
10505
- } else {
10506
- return this.each( function() {
10507
- if ( args.complete ) {
10508
- args.complete.call( this );
10509
- }
10510
- });
10511
- }
10512
- }
10513
-
10514
- function run( next ) {
10515
- var elem = $( this ),
10516
- complete = args.complete,
10517
- mode = args.mode;
10518
-
10519
- function done() {
10520
- if ( $.isFunction( complete ) ) {
10521
- complete.call( elem[0] );
10522
- }
10523
- if ( $.isFunction( next ) ) {
10524
- next();
10525
- }
10526
- }
10527
-
10528
- // If the element already has the correct final state, delegate to
10529
- // the core methods so the internal tracking of "olddisplay" works.
10530
- if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
10531
- elem[ mode ]();
10532
- done();
10533
- } else {
10534
- effectMethod.call( elem[0], args, done );
10535
- }
10536
- }
10537
-
10538
- return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
10539
- },
10540
-
10541
- show: (function( orig ) {
10542
- return function( option ) {
10543
- if ( standardAnimationOption( option ) ) {
10544
- return orig.apply( this, arguments );
10545
- } else {
10546
- var args = _normalizeArguments.apply( this, arguments );
10547
- args.mode = "show";
10548
- return this.effect.call( this, args );
10549
- }
10550
- };
10551
- })( $.fn.show ),
10552
-
10553
- hide: (function( orig ) {
10554
- return function( option ) {
10555
- if ( standardAnimationOption( option ) ) {
10556
- return orig.apply( this, arguments );
10557
- } else {
10558
- var args = _normalizeArguments.apply( this, arguments );
10559
- args.mode = "hide";
10560
- return this.effect.call( this, args );
10561
- }
10562
- };
10563
- })( $.fn.hide ),
10564
-
10565
- toggle: (function( orig ) {
10566
- return function( option ) {
10567
- if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
10568
- return orig.apply( this, arguments );
10569
- } else {
10570
- var args = _normalizeArguments.apply( this, arguments );
10571
- args.mode = "toggle";
10572
- return this.effect.call( this, args );
10573
- }
10574
- };
10575
- })( $.fn.toggle ),
10576
-
10577
- // helper functions
10578
- cssUnit: function(key) {
10579
- var style = this.css( key ),
10580
- val = [];
10581
-
10582
- $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
10583
- if ( style.indexOf( unit ) > 0 ) {
10584
- val = [ parseFloat( style ), unit ];
10585
- }
10586
- });
10587
- return val;
10588
- }
10589
- });
10590
-
10591
- })();
10592
-
10593
- /******************************************************************************/
10594
- /*********************************** EASING ***********************************/
10595
- /******************************************************************************/
10596
-
10597
- (function() {
10598
-
10599
- // based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
10600
-
10601
- var baseEasings = {};
10602
-
10603
- $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
10604
- baseEasings[ name ] = function( p ) {
10605
- return Math.pow( p, i + 2 );
10606
- };
10607
- });
10608
-
10609
- $.extend( baseEasings, {
10610
- Sine: function( p ) {
10611
- return 1 - Math.cos( p * Math.PI / 2 );
10612
- },
10613
- Circ: function( p ) {
10614
- return 1 - Math.sqrt( 1 - p * p );
10615
- },
10616
- Elastic: function( p ) {
10617
- return p === 0 || p === 1 ? p :
10618
- -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
10619
- },
10620
- Back: function( p ) {
10621
- return p * p * ( 3 * p - 2 );
10622
- },
10623
- Bounce: function( p ) {
10624
- var pow2,
10625
- bounce = 4;
10626
-
10627
- while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
10628
- return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
10629
- }
10630
- });
10631
-
10632
- $.each( baseEasings, function( name, easeIn ) {
10633
- $.easing[ "easeIn" + name ] = easeIn;
10634
- $.easing[ "easeOut" + name ] = function( p ) {
10635
- return 1 - easeIn( 1 - p );
10636
- };
10637
- $.easing[ "easeInOut" + name ] = function( p ) {
10638
- return p < 0.5 ?
10639
- easeIn( p * 2 ) / 2 :
10640
- 1 - easeIn( p * -2 + 2 ) / 2;
10641
- };
10642
- });
10643
-
10644
- })();
10645
-
10646
- var effect = $.effects;
10647
-
10648
-
10649
- /*!
10650
- * jQuery UI Effects Blind 1.11.2
10651
- * http://jqueryui.com
10652
- *
10653
- * Copyright 2014 jQuery Foundation and other contributors
10654
- * Released under the MIT license.
10655
- * http://jquery.org/license
10656
- *
10657
- * http://api.jqueryui.com/blind-effect/
10658
- */
10659
-
10660
-
10661
- var effectBlind = $.effects.effect.blind = function( o, done ) {
10662
- // Create element
10663
- var el = $( this ),
10664
- rvertical = /up|down|vertical/,
10665
- rpositivemotion = /up|left|vertical|horizontal/,
10666
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10667
- mode = $.effects.setMode( el, o.mode || "hide" ),
10668
- direction = o.direction || "up",
10669
- vertical = rvertical.test( direction ),
10670
- ref = vertical ? "height" : "width",
10671
- ref2 = vertical ? "top" : "left",
10672
- motion = rpositivemotion.test( direction ),
10673
- animation = {},
10674
- show = mode === "show",
10675
- wrapper, distance, margin;
10676
-
10677
- // if already wrapped, the wrapper's properties are my property. #6245
10678
- if ( el.parent().is( ".ui-effects-wrapper" ) ) {
10679
- $.effects.save( el.parent(), props );
10680
- } else {
10681
- $.effects.save( el, props );
10682
- }
10683
- el.show();
10684
- wrapper = $.effects.createWrapper( el ).css({
10685
- overflow: "hidden"
10686
- });
10687
-
10688
- distance = wrapper[ ref ]();
10689
- margin = parseFloat( wrapper.css( ref2 ) ) || 0;
10690
-
10691
- animation[ ref ] = show ? distance : 0;
10692
- if ( !motion ) {
10693
- el
10694
- .css( vertical ? "bottom" : "right", 0 )
10695
- .css( vertical ? "top" : "left", "auto" )
10696
- .css({ position: "absolute" });
10697
-
10698
- animation[ ref2 ] = show ? margin : distance + margin;
10699
- }
10700
-
10701
- // start at 0 if we are showing
10702
- if ( show ) {
10703
- wrapper.css( ref, 0 );
10704
- if ( !motion ) {
10705
- wrapper.css( ref2, margin + distance );
10706
- }
10707
- }
10708
-
10709
- // Animate
10710
- wrapper.animate( animation, {
10711
- duration: o.duration,
10712
- easing: o.easing,
10713
- queue: false,
10714
- complete: function() {
10715
- if ( mode === "hide" ) {
10716
- el.hide();
10717
- }
10718
- $.effects.restore( el, props );
10719
- $.effects.removeWrapper( el );
10720
- done();
10721
- }
10722
- });
10723
- };
10724
-
10725
-
10726
- /*!
10727
- * jQuery UI Effects Bounce 1.11.2
10728
- * http://jqueryui.com
10729
- *
10730
- * Copyright 2014 jQuery Foundation and other contributors
10731
- * Released under the MIT license.
10732
- * http://jquery.org/license
10733
- *
10734
- * http://api.jqueryui.com/bounce-effect/
10735
- */
10736
-
10737
-
10738
- var effectBounce = $.effects.effect.bounce = function( o, done ) {
10739
- var el = $( this ),
10740
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10741
-
10742
- // defaults:
10743
- mode = $.effects.setMode( el, o.mode || "effect" ),
10744
- hide = mode === "hide",
10745
- show = mode === "show",
10746
- direction = o.direction || "up",
10747
- distance = o.distance,
10748
- times = o.times || 5,
10749
-
10750
- // number of internal animations
10751
- anims = times * 2 + ( show || hide ? 1 : 0 ),
10752
- speed = o.duration / anims,
10753
- easing = o.easing,
10754
-
10755
- // utility:
10756
- ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10757
- motion = ( direction === "up" || direction === "left" ),
10758
- i,
10759
- upAnim,
10760
- downAnim,
10761
-
10762
- // we will need to re-assemble the queue to stack our animations in place
10763
- queue = el.queue(),
10764
- queuelen = queue.length;
10765
-
10766
- // Avoid touching opacity to prevent clearType and PNG issues in IE
10767
- if ( show || hide ) {
10768
- props.push( "opacity" );
10769
- }
10770
-
10771
- $.effects.save( el, props );
10772
- el.show();
10773
- $.effects.createWrapper( el ); // Create Wrapper
10774
-
10775
- // default distance for the BIGGEST bounce is the outer Distance / 3
10776
- if ( !distance ) {
10777
- distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
10778
- }
10779
-
10780
- if ( show ) {
10781
- downAnim = { opacity: 1 };
10782
- downAnim[ ref ] = 0;
10783
-
10784
- // if we are showing, force opacity 0 and set the initial position
10785
- // then do the "first" animation
10786
- el.css( "opacity", 0 )
10787
- .css( ref, motion ? -distance * 2 : distance * 2 )
10788
- .animate( downAnim, speed, easing );
10789
- }
10790
-
10791
- // start at the smallest distance if we are hiding
10792
- if ( hide ) {
10793
- distance = distance / Math.pow( 2, times - 1 );
10794
- }
10795
-
10796
- downAnim = {};
10797
- downAnim[ ref ] = 0;
10798
- // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
10799
- for ( i = 0; i < times; i++ ) {
10800
- upAnim = {};
10801
- upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
10802
-
10803
- el.animate( upAnim, speed, easing )
10804
- .animate( downAnim, speed, easing );
10805
-
10806
- distance = hide ? distance * 2 : distance / 2;
10807
- }
10808
-
10809
- // Last Bounce when Hiding
10810
- if ( hide ) {
10811
- upAnim = { opacity: 0 };
10812
- upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
10813
-
10814
- el.animate( upAnim, speed, easing );
10815
- }
10816
-
10817
- el.queue(function() {
10818
- if ( hide ) {
10819
- el.hide();
10820
- }
10821
- $.effects.restore( el, props );
10822
- $.effects.removeWrapper( el );
10823
- done();
10824
- });
10825
-
10826
- // inject all the animations we just queued to be first in line (after "inprogress")
10827
- if ( queuelen > 1) {
10828
- queue.splice.apply( queue,
10829
- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
10830
- }
10831
- el.dequeue();
10832
-
10833
- };
10834
-
10835
-
10836
- /*!
10837
- * jQuery UI Effects Clip 1.11.2
10838
- * http://jqueryui.com
10839
- *
10840
- * Copyright 2014 jQuery Foundation and other contributors
10841
- * Released under the MIT license.
10842
- * http://jquery.org/license
10843
- *
10844
- * http://api.jqueryui.com/clip-effect/
10845
- */
10846
-
10847
-
10848
- var effectClip = $.effects.effect.clip = function( o, done ) {
10849
- // Create element
10850
- var el = $( this ),
10851
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10852
- mode = $.effects.setMode( el, o.mode || "hide" ),
10853
- show = mode === "show",
10854
- direction = o.direction || "vertical",
10855
- vert = direction === "vertical",
10856
- size = vert ? "height" : "width",
10857
- position = vert ? "top" : "left",
10858
- animation = {},
10859
- wrapper, animate, distance;
10860
-
10861
- // Save & Show
10862
- $.effects.save( el, props );
10863
- el.show();
10864
-
10865
- // Create Wrapper
10866
- wrapper = $.effects.createWrapper( el ).css({
10867
- overflow: "hidden"
10868
- });
10869
- animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
10870
- distance = animate[ size ]();
10871
-
10872
- // Shift
10873
- if ( show ) {
10874
- animate.css( size, 0 );
10875
- animate.css( position, distance / 2 );
10876
- }
10877
-
10878
- // Create Animation Object:
10879
- animation[ size ] = show ? distance : 0;
10880
- animation[ position ] = show ? 0 : distance / 2;
10881
-
10882
- // Animate
10883
- animate.animate( animation, {
10884
- queue: false,
10885
- duration: o.duration,
10886
- easing: o.easing,
10887
- complete: function() {
10888
- if ( !show ) {
10889
- el.hide();
10890
- }
10891
- $.effects.restore( el, props );
10892
- $.effects.removeWrapper( el );
10893
- done();
10894
- }
10895
- });
10896
-
10897
- };
10898
-
10899
-
10900
- /*!
10901
- * jQuery UI Effects Drop 1.11.2
10902
- * http://jqueryui.com
10903
- *
10904
- * Copyright 2014 jQuery Foundation and other contributors
10905
- * Released under the MIT license.
10906
- * http://jquery.org/license
10907
- *
10908
- * http://api.jqueryui.com/drop-effect/
10909
- */
10910
-
10911
-
10912
- var effectDrop = $.effects.effect.drop = function( o, done ) {
10913
-
10914
- var el = $( this ),
10915
- props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
10916
- mode = $.effects.setMode( el, o.mode || "hide" ),
10917
- show = mode === "show",
10918
- direction = o.direction || "left",
10919
- ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10920
- motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
10921
- animation = {
10922
- opacity: show ? 1 : 0
10923
- },
10924
- distance;
10925
-
10926
- // Adjust
10927
- $.effects.save( el, props );
10928
- el.show();
10929
- $.effects.createWrapper( el );
10930
-
10931
- distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
10932
-
10933
- if ( show ) {
10934
- el
10935
- .css( "opacity", 0 )
10936
- .css( ref, motion === "pos" ? -distance : distance );
10937
- }
10938
-
10939
- // Animation
10940
- animation[ ref ] = ( show ?
10941
- ( motion === "pos" ? "+=" : "-=" ) :
10942
- ( motion === "pos" ? "-=" : "+=" ) ) +
10943
- distance;
10944
-
10945
- // Animate
10946
- el.animate( animation, {
10947
- queue: false,
10948
- duration: o.duration,
10949
- easing: o.easing,
10950
- complete: function() {
10951
- if ( mode === "hide" ) {
10952
- el.hide();
10953
- }
10954
- $.effects.restore( el, props );
10955
- $.effects.removeWrapper( el );
10956
- done();
10957
- }
10958
- });
10959
- };
10960
-
10961
-
10962
- /*!
10963
- * jQuery UI Effects Explode 1.11.2
10964
- * http://jqueryui.com
10965
- *
10966
- * Copyright 2014 jQuery Foundation and other contributors
10967
- * Released under the MIT license.
10968
- * http://jquery.org/license
10969
- *
10970
- * http://api.jqueryui.com/explode-effect/
10971
- */
10972
-
10973
-
10974
- var effectExplode = $.effects.effect.explode = function( o, done ) {
10975
-
10976
- var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
10977
- cells = rows,
10978
- el = $( this ),
10979
- mode = $.effects.setMode( el, o.mode || "hide" ),
10980
- show = mode === "show",
10981
-
10982
- // show and then visibility:hidden the element before calculating offset
10983
- offset = el.show().css( "visibility", "hidden" ).offset(),
10984
-
10985
- // width and height of a piece
10986
- width = Math.ceil( el.outerWidth() / cells ),
10987
- height = Math.ceil( el.outerHeight() / rows ),
10988
- pieces = [],
10989
-
10990
- // loop
10991
- i, j, left, top, mx, my;
10992
-
10993
- // children animate complete:
10994
- function childComplete() {
10995
- pieces.push( this );
10996
- if ( pieces.length === rows * cells ) {
10997
- animComplete();
10998
- }
10999
- }
11000
-
11001
- // clone the element for each row and cell.
11002
- for ( i = 0; i < rows ; i++ ) { // ===>
11003
- top = offset.top + i * height;
11004
- my = i - ( rows - 1 ) / 2 ;
11005
-
11006
- for ( j = 0; j < cells ; j++ ) { // |||
11007
- left = offset.left + j * width;
11008
- mx = j - ( cells - 1 ) / 2 ;
11009
-
11010
- // Create a clone of the now hidden main element that will be absolute positioned
11011
- // within a wrapper div off the -left and -top equal to size of our pieces
11012
- el
11013
- .clone()
11014
- .appendTo( "body" )
11015
- .wrap( "<div></div>" )
11016
- .css({
11017
- position: "absolute",
11018
- visibility: "visible",
11019
- left: -j * width,
11020
- top: -i * height
11021
- })
11022
-
11023
- // select the wrapper - make it overflow: hidden and absolute positioned based on
11024
- // where the original was located +left and +top equal to the size of pieces
11025
- .parent()
11026
- .addClass( "ui-effects-explode" )
11027
- .css({
11028
- position: "absolute",
11029
- overflow: "hidden",
11030
- width: width,
11031
- height: height,
11032
- left: left + ( show ? mx * width : 0 ),
11033
- top: top + ( show ? my * height : 0 ),
11034
- opacity: show ? 0 : 1
11035
- }).animate({
11036
- left: left + ( show ? 0 : mx * width ),
11037
- top: top + ( show ? 0 : my * height ),
11038
- opacity: show ? 1 : 0
11039
- }, o.duration || 500, o.easing, childComplete );
11040
- }
11041
- }
11042
-
11043
- function animComplete() {
11044
- el.css({
11045
- visibility: "visible"
11046
- });
11047
- $( pieces ).remove();
11048
- if ( !show ) {
11049
- el.hide();
11050
- }
11051
- done();
11052
- }
11053
- };
11054
-
11055
-
11056
- /*!
11057
- * jQuery UI Effects Fade 1.11.2
11058
- * http://jqueryui.com
11059
- *
11060
- * Copyright 2014 jQuery Foundation and other contributors
11061
- * Released under the MIT license.
11062
- * http://jquery.org/license
11063
- *
11064
- * http://api.jqueryui.com/fade-effect/
11065
- */
11066
-
11067
-
11068
- var effectFade = $.effects.effect.fade = function( o, done ) {
11069
- var el = $( this ),
11070
- mode = $.effects.setMode( el, o.mode || "toggle" );
11071
-
11072
- el.animate({
11073
- opacity: mode
11074
- }, {
11075
- queue: false,
11076
- duration: o.duration,
11077
- easing: o.easing,
11078
- complete: done
11079
- });
11080
- };
11081
-
11082
-
11083
- /*!
11084
- * jQuery UI Effects Fold 1.11.2
11085
- * http://jqueryui.com
11086
- *
11087
- * Copyright 2014 jQuery Foundation and other contributors
11088
- * Released under the MIT license.
11089
- * http://jquery.org/license
11090
- *
11091
- * http://api.jqueryui.com/fold-effect/
11092
- */
11093
-
11094
-
11095
- var effectFold = $.effects.effect.fold = function( o, done ) {
11096
-
11097
- // Create element
11098
- var el = $( this ),
11099
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11100
- mode = $.effects.setMode( el, o.mode || "hide" ),
11101
- show = mode === "show",
11102
- hide = mode === "hide",
11103
- size = o.size || 15,
11104
- percent = /([0-9]+)%/.exec( size ),
11105
- horizFirst = !!o.horizFirst,
11106
- widthFirst = show !== horizFirst,
11107
- ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
11108
- duration = o.duration / 2,
11109
- wrapper, distance,
11110
- animation1 = {},
11111
- animation2 = {};
11112
-
11113
- $.effects.save( el, props );
11114
- el.show();
11115
-
11116
- // Create Wrapper
11117
- wrapper = $.effects.createWrapper( el ).css({
11118
- overflow: "hidden"
11119
- });
11120
- distance = widthFirst ?
11121
- [ wrapper.width(), wrapper.height() ] :
11122
- [ wrapper.height(), wrapper.width() ];
11123
-
11124
- if ( percent ) {
11125
- size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
11126
- }
11127
- if ( show ) {
11128
- wrapper.css( horizFirst ? {
11129
- height: 0,
11130
- width: size
11131
- } : {
11132
- height: size,
11133
- width: 0
11134
- });
11135
- }
11136
-
11137
- // Animation
11138
- animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
11139
- animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
11140
-
11141
- // Animate
11142
- wrapper
11143
- .animate( animation1, duration, o.easing )
11144
- .animate( animation2, duration, o.easing, function() {
11145
- if ( hide ) {
11146
- el.hide();
11147
- }
11148
- $.effects.restore( el, props );
11149
- $.effects.removeWrapper( el );
11150
- done();
11151
- });
11152
-
11153
- };
11154
-
11155
-
11156
- /*!
11157
- * jQuery UI Effects Highlight 1.11.2
11158
- * http://jqueryui.com
11159
- *
11160
- * Copyright 2014 jQuery Foundation and other contributors
11161
- * Released under the MIT license.
11162
- * http://jquery.org/license
11163
- *
11164
- * http://api.jqueryui.com/highlight-effect/
11165
- */
11166
-
11167
-
11168
- var effectHighlight = $.effects.effect.highlight = function( o, done ) {
11169
- var elem = $( this ),
11170
- props = [ "backgroundImage", "backgroundColor", "opacity" ],
11171
- mode = $.effects.setMode( elem, o.mode || "show" ),
11172
- animation = {
11173
- backgroundColor: elem.css( "backgroundColor" )
11174
- };
11175
-
11176
- if (mode === "hide") {
11177
- animation.opacity = 0;
11178
- }
11179
-
11180
- $.effects.save( elem, props );
11181
-
11182
- elem
11183
- .show()
11184
- .css({
11185
- backgroundImage: "none",
11186
- backgroundColor: o.color || "#ffff99"
11187
- })
11188
- .animate( animation, {
11189
- queue: false,
11190
- duration: o.duration,
11191
- easing: o.easing,
11192
- complete: function() {
11193
- if ( mode === "hide" ) {
11194
- elem.hide();
11195
- }
11196
- $.effects.restore( elem, props );
11197
- done();
11198
- }
11199
- });
11200
- };
11201
-
11202
-
11203
- /*!
11204
- * jQuery UI Effects Size 1.11.2
11205
- * http://jqueryui.com
11206
- *
11207
- * Copyright 2014 jQuery Foundation and other contributors
11208
- * Released under the MIT license.
11209
- * http://jquery.org/license
11210
- *
11211
- * http://api.jqueryui.com/size-effect/
11212
- */
11213
-
11214
-
11215
- var effectSize = $.effects.effect.size = function( o, done ) {
11216
-
11217
- // Create element
11218
- var original, baseline, factor,
11219
- el = $( this ),
11220
- props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
11221
-
11222
- // Always restore
11223
- props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
11224
-
11225
- // Copy for children
11226
- props2 = [ "width", "height", "overflow" ],
11227
- cProps = [ "fontSize" ],
11228
- vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
11229
- hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
11230
-
11231
- // Set options
11232
- mode = $.effects.setMode( el, o.mode || "effect" ),
11233
- restore = o.restore || mode !== "effect",
11234
- scale = o.scale || "both",
11235
- origin = o.origin || [ "middle", "center" ],
11236
- position = el.css( "position" ),
11237
- props = restore ? props0 : props1,
11238
- zero = {
11239
- height: 0,
11240
- width: 0,
11241
- outerHeight: 0,
11242
- outerWidth: 0
11243
- };
11244
-
11245
- if ( mode === "show" ) {
11246
- el.show();
11247
- }
11248
- original = {
11249
- height: el.height(),
11250
- width: el.width(),
11251
- outerHeight: el.outerHeight(),
11252
- outerWidth: el.outerWidth()
11253
- };
11254
-
11255
- if ( o.mode === "toggle" && mode === "show" ) {
11256
- el.from = o.to || zero;
11257
- el.to = o.from || original;
11258
- } else {
11259
- el.from = o.from || ( mode === "show" ? zero : original );
11260
- el.to = o.to || ( mode === "hide" ? zero : original );
11261
- }
11262
-
11263
- // Set scaling factor
11264
- factor = {
11265
- from: {
11266
- y: el.from.height / original.height,
11267
- x: el.from.width / original.width
11268
- },
11269
- to: {
11270
- y: el.to.height / original.height,
11271
- x: el.to.width / original.width
11272
- }
11273
- };
11274
-
11275
- // Scale the css box
11276
- if ( scale === "box" || scale === "both" ) {
11277
-
11278
- // Vertical props scaling
11279
- if ( factor.from.y !== factor.to.y ) {
11280
- props = props.concat( vProps );
11281
- el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
11282
- el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
11283
- }
11284
-
11285
- // Horizontal props scaling
11286
- if ( factor.from.x !== factor.to.x ) {
11287
- props = props.concat( hProps );
11288
- el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
11289
- el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
11290
- }
11291
- }
11292
-
11293
- // Scale the content
11294
- if ( scale === "content" || scale === "both" ) {
11295
-
11296
- // Vertical props scaling
11297
- if ( factor.from.y !== factor.to.y ) {
11298
- props = props.concat( cProps ).concat( props2 );
11299
- el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
11300
- el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
11301
- }
11302
- }
11303
-
11304
- $.effects.save( el, props );
11305
- el.show();
11306
- $.effects.createWrapper( el );
11307
- el.css( "overflow", "hidden" ).css( el.from );
11308
-
11309
- // Adjust
11310
- if (origin) { // Calculate baseline shifts
11311
- baseline = $.effects.getBaseline( origin, original );
11312
- el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
11313
- el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
11314
- el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
11315
- el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
11316
- }
11317
- el.css( el.from ); // set top & left
11318
-
11319
- // Animate
11320
- if ( scale === "content" || scale === "both" ) { // Scale the children
11321
-
11322
- // Add margins/font-size
11323
- vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
11324
- hProps = hProps.concat([ "marginLeft", "marginRight" ]);
11325
- props2 = props0.concat(vProps).concat(hProps);
11326
-
11327
- el.find( "*[width]" ).each( function() {
11328
- var child = $( this ),
11329
- c_original = {
11330
- height: child.height(),
11331
- width: child.width(),
11332
- outerHeight: child.outerHeight(),
11333
- outerWidth: child.outerWidth()
11334
- };
11335
- if (restore) {
11336
- $.effects.save(child, props2);
11337
- }
11338
-
11339
- child.from = {
11340
- height: c_original.height * factor.from.y,
11341
- width: c_original.width * factor.from.x,
11342
- outerHeight: c_original.outerHeight * factor.from.y,
11343
- outerWidth: c_original.outerWidth * factor.from.x
11344
- };
11345
- child.to = {
11346
- height: c_original.height * factor.to.y,
11347
- width: c_original.width * factor.to.x,
11348
- outerHeight: c_original.height * factor.to.y,
11349
- outerWidth: c_original.width * factor.to.x
11350
- };
11351
-
11352
- // Vertical props scaling
11353
- if ( factor.from.y !== factor.to.y ) {
11354
- child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
11355
- child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
11356
- }
11357
-
11358
- // Horizontal props scaling
11359
- if ( factor.from.x !== factor.to.x ) {
11360
- child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
11361
- child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
11362
- }
11363
-
11364
- // Animate children
11365
- child.css( child.from );
11366
- child.animate( child.to, o.duration, o.easing, function() {
11367
-
11368
- // Restore children
11369
- if ( restore ) {
11370
- $.effects.restore( child, props2 );
11371
- }
11372
- });
11373
- });
11374
- }
11375
-
11376
- // Animate
11377
- el.animate( el.to, {
11378
- queue: false,
11379
- duration: o.duration,
11380
- easing: o.easing,
11381
- complete: function() {
11382
- if ( el.to.opacity === 0 ) {
11383
- el.css( "opacity", el.from.opacity );
11384
- }
11385
- if ( mode === "hide" ) {
11386
- el.hide();
11387
- }
11388
- $.effects.restore( el, props );
11389
- if ( !restore ) {
11390
-
11391
- // we need to calculate our new positioning based on the scaling
11392
- if ( position === "static" ) {
11393
- el.css({
11394
- position: "relative",
11395
- top: el.to.top,
11396
- left: el.to.left
11397
- });
11398
- } else {
11399
- $.each([ "top", "left" ], function( idx, pos ) {
11400
- el.css( pos, function( _, str ) {
11401
- var val = parseInt( str, 10 ),
11402
- toRef = idx ? el.to.left : el.to.top;
11403
-
11404
- // if original was "auto", recalculate the new value from wrapper
11405
- if ( str === "auto" ) {
11406
- return toRef + "px";
11407
- }
11408
-
11409
- return val + toRef + "px";
11410
- });
11411
- });
11412
- }
11413
- }
11414
-
11415
- $.effects.removeWrapper( el );
11416
- done();
11417
- }
11418
- });
11419
-
11420
- };
11421
-
11422
-
11423
- /*!
11424
- * jQuery UI Effects Scale 1.11.2
11425
- * http://jqueryui.com
11426
- *
11427
- * Copyright 2014 jQuery Foundation and other contributors
11428
- * Released under the MIT license.
11429
- * http://jquery.org/license
11430
- *
11431
- * http://api.jqueryui.com/scale-effect/
11432
- */
11433
-
11434
-
11435
- var effectScale = $.effects.effect.scale = function( o, done ) {
11436
-
11437
- // Create element
11438
- var el = $( this ),
11439
- options = $.extend( true, {}, o ),
11440
- mode = $.effects.setMode( el, o.mode || "effect" ),
11441
- percent = parseInt( o.percent, 10 ) ||
11442
- ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
11443
- direction = o.direction || "both",
11444
- origin = o.origin,
11445
- original = {
11446
- height: el.height(),
11447
- width: el.width(),
11448
- outerHeight: el.outerHeight(),
11449
- outerWidth: el.outerWidth()
11450
- },
11451
- factor = {
11452
- y: direction !== "horizontal" ? (percent / 100) : 1,
11453
- x: direction !== "vertical" ? (percent / 100) : 1
11454
- };
11455
-
11456
- // We are going to pass this effect to the size effect:
11457
- options.effect = "size";
11458
- options.queue = false;
11459
- options.complete = done;
11460
-
11461
- // Set default origin and restore for show/hide
11462
- if ( mode !== "effect" ) {
11463
- options.origin = origin || [ "middle", "center" ];
11464
- options.restore = true;
11465
- }
11466
-
11467
- options.from = o.from || ( mode === "show" ? {
11468
- height: 0,
11469
- width: 0,
11470
- outerHeight: 0,
11471
- outerWidth: 0
11472
- } : original );
11473
- options.to = {
11474
- height: original.height * factor.y,
11475
- width: original.width * factor.x,
11476
- outerHeight: original.outerHeight * factor.y,
11477
- outerWidth: original.outerWidth * factor.x
11478
- };
11479
-
11480
- // Fade option to support puff
11481
- if ( options.fade ) {
11482
- if ( mode === "show" ) {
11483
- options.from.opacity = 0;
11484
- options.to.opacity = 1;
11485
- }
11486
- if ( mode === "hide" ) {
11487
- options.from.opacity = 1;
11488
- options.to.opacity = 0;
11489
- }
11490
- }
11491
-
11492
- // Animate
11493
- el.effect( options );
11494
-
11495
- };
11496
-
11497
-
11498
- /*!
11499
- * jQuery UI Effects Puff 1.11.2
11500
- * http://jqueryui.com
11501
- *
11502
- * Copyright 2014 jQuery Foundation and other contributors
11503
- * Released under the MIT license.
11504
- * http://jquery.org/license
11505
- *
11506
- * http://api.jqueryui.com/puff-effect/
11507
- */
11508
-
11509
-
11510
- var effectPuff = $.effects.effect.puff = function( o, done ) {
11511
- var elem = $( this ),
11512
- mode = $.effects.setMode( elem, o.mode || "hide" ),
11513
- hide = mode === "hide",
11514
- percent = parseInt( o.percent, 10 ) || 150,
11515
- factor = percent / 100,
11516
- original = {
11517
- height: elem.height(),
11518
- width: elem.width(),
11519
- outerHeight: elem.outerHeight(),
11520
- outerWidth: elem.outerWidth()
11521
- };
11522
-
11523
- $.extend( o, {
11524
- effect: "scale",
11525
- queue: false,
11526
- fade: true,
11527
- mode: mode,
11528
- complete: done,
11529
- percent: hide ? percent : 100,
11530
- from: hide ?
11531
- original :
11532
- {
11533
- height: original.height * factor,
11534
- width: original.width * factor,
11535
- outerHeight: original.outerHeight * factor,
11536
- outerWidth: original.outerWidth * factor
11537
- }
11538
- });
11539
-
11540
- elem.effect( o );
11541
- };
11542
-
11543
-
11544
- /*!
11545
- * jQuery UI Effects Pulsate 1.11.2
11546
- * http://jqueryui.com
11547
- *
11548
- * Copyright 2014 jQuery Foundation and other contributors
11549
- * Released under the MIT license.
11550
- * http://jquery.org/license
11551
- *
11552
- * http://api.jqueryui.com/pulsate-effect/
11553
- */
11554
-
11555
-
11556
- var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
11557
- var elem = $( this ),
11558
- mode = $.effects.setMode( elem, o.mode || "show" ),
11559
- show = mode === "show",
11560
- hide = mode === "hide",
11561
- showhide = ( show || mode === "hide" ),
11562
-
11563
- // showing or hiding leaves of the "last" animation
11564
- anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
11565
- duration = o.duration / anims,
11566
- animateTo = 0,
11567
- queue = elem.queue(),
11568
- queuelen = queue.length,
11569
- i;
11570
-
11571
- if ( show || !elem.is(":visible")) {
11572
- elem.css( "opacity", 0 ).show();
11573
- animateTo = 1;
11574
- }
11575
-
11576
- // anims - 1 opacity "toggles"
11577
- for ( i = 1; i < anims; i++ ) {
11578
- elem.animate({
11579
- opacity: animateTo
11580
- }, duration, o.easing );
11581
- animateTo = 1 - animateTo;
11582
- }
11583
-
11584
- elem.animate({
11585
- opacity: animateTo
11586
- }, duration, o.easing);
11587
-
11588
- elem.queue(function() {
11589
- if ( hide ) {
11590
- elem.hide();
11591
- }
11592
- done();
11593
- });
11594
-
11595
- // We just queued up "anims" animations, we need to put them next in the queue
11596
- if ( queuelen > 1 ) {
11597
- queue.splice.apply( queue,
11598
- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
11599
- }
11600
- elem.dequeue();
11601
- };
11602
-
11603
-
11604
- /*!
11605
- * jQuery UI Effects Shake 1.11.2
11606
- * http://jqueryui.com
11607
- *
11608
- * Copyright 2014 jQuery Foundation and other contributors
11609
- * Released under the MIT license.
11610
- * http://jquery.org/license
11611
- *
11612
- * http://api.jqueryui.com/shake-effect/
11613
- */
11614
-
11615
-
11616
- var effectShake = $.effects.effect.shake = function( o, done ) {
11617
-
11618
- var el = $( this ),
11619
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11620
- mode = $.effects.setMode( el, o.mode || "effect" ),
11621
- direction = o.direction || "left",
11622
- distance = o.distance || 20,
11623
- times = o.times || 3,
11624
- anims = times * 2 + 1,
11625
- speed = Math.round( o.duration / anims ),
11626
- ref = (direction === "up" || direction === "down") ? "top" : "left",
11627
- positiveMotion = (direction === "up" || direction === "left"),
11628
- animation = {},
11629
- animation1 = {},
11630
- animation2 = {},
11631
- i,
11632
-
11633
- // we will need to re-assemble the queue to stack our animations in place
11634
- queue = el.queue(),
11635
- queuelen = queue.length;
11636
-
11637
- $.effects.save( el, props );
11638
- el.show();
11639
- $.effects.createWrapper( el );
11640
-
11641
- // Animation
11642
- animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
11643
- animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
11644
- animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
11645
-
11646
- // Animate
11647
- el.animate( animation, speed, o.easing );
11648
-
11649
- // Shakes
11650
- for ( i = 1; i < times; i++ ) {
11651
- el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
11652
- }
11653
- el
11654
- .animate( animation1, speed, o.easing )
11655
- .animate( animation, speed / 2, o.easing )
11656
- .queue(function() {
11657
- if ( mode === "hide" ) {
11658
- el.hide();
11659
- }
11660
- $.effects.restore( el, props );
11661
- $.effects.removeWrapper( el );
11662
- done();
11663
- });
11664
-
11665
- // inject all the animations we just queued to be first in line (after "inprogress")
11666
- if ( queuelen > 1) {
11667
- queue.splice.apply( queue,
11668
- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
11669
- }
11670
- el.dequeue();
11671
-
11672
- };
11673
-
11674
-
11675
- /*!
11676
- * jQuery UI Effects Slide 1.11.2
11677
- * http://jqueryui.com
11678
- *
11679
- * Copyright 2014 jQuery Foundation and other contributors
11680
- * Released under the MIT license.
11681
- * http://jquery.org/license
11682
- *
11683
- * http://api.jqueryui.com/slide-effect/
11684
- */
11685
-
11686
-
11687
- var effectSlide = $.effects.effect.slide = function( o, done ) {
11688
-
11689
- // Create element
11690
- var el = $( this ),
11691
- props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
11692
- mode = $.effects.setMode( el, o.mode || "show" ),
11693
- show = mode === "show",
11694
- direction = o.direction || "left",
11695
- ref = (direction === "up" || direction === "down") ? "top" : "left",
11696
- positiveMotion = (direction === "up" || direction === "left"),
11697
- distance,
11698
- animation = {};
11699
-
11700
- // Adjust
11701
- $.effects.save( el, props );
11702
- el.show();
11703
- distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
11704
-
11705
- $.effects.createWrapper( el ).css({
11706
- overflow: "hidden"
11707
- });
11708
-
11709
- if ( show ) {
11710
- el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
11711
- }
11712
-
11713
- // Animation
11714
- animation[ ref ] = ( show ?
11715
- ( positiveMotion ? "+=" : "-=") :
11716
- ( positiveMotion ? "-=" : "+=")) +
11717
- distance;
11718
-
11719
- // Animate
11720
- el.animate( animation, {
11721
- queue: false,
11722
- duration: o.duration,
11723
- easing: o.easing,
11724
- complete: function() {
11725
- if ( mode === "hide" ) {
11726
- el.hide();
11727
- }
11728
- $.effects.restore( el, props );
11729
- $.effects.removeWrapper( el );
11730
- done();
11731
- }
11732
- });
11733
- };
11734
-
11735
-
11736
- /*!
11737
- * jQuery UI Effects Transfer 1.11.2
11738
- * http://jqueryui.com
11739
- *
11740
- * Copyright 2014 jQuery Foundation and other contributors
11741
- * Released under the MIT license.
11742
- * http://jquery.org/license
11743
- *
11744
- * http://api.jqueryui.com/transfer-effect/
11745
- */
11746
-
11747
-
11748
- var effectTransfer = $.effects.effect.transfer = function( o, done ) {
11749
- var elem = $( this ),
11750
- target = $( o.to ),
11751
- targetFixed = target.css( "position" ) === "fixed",
11752
- body = $("body"),
11753
- fixTop = targetFixed ? body.scrollTop() : 0,
11754
- fixLeft = targetFixed ? body.scrollLeft() : 0,
11755
- endPosition = target.offset(),
11756
- animation = {
11757
- top: endPosition.top - fixTop,
11758
- left: endPosition.left - fixLeft,
11759
- height: target.innerHeight(),
11760
- width: target.innerWidth()
11761
- },
11762
- startPosition = elem.offset(),
11763
- transfer = $( "<div class='ui-effects-transfer'></div>" )
11764
- .appendTo( document.body )
11765
- .addClass( o.className )
11766
- .css({
11767
- top: startPosition.top - fixTop,
11768
- left: startPosition.left - fixLeft,
11769
- height: elem.innerHeight(),
11770
- width: elem.innerWidth(),
11771
- position: targetFixed ? "fixed" : "absolute"
11772
- })
11773
- .animate( animation, o.duration, o.easing, function() {
11774
- transfer.remove();
11775
- done();
11776
- });
11777
- };
11778
-
11779
-
11780
- /*!
11781
- * jQuery UI Progressbar 1.11.2
11782
- * http://jqueryui.com
11783
- *
11784
- * Copyright 2014 jQuery Foundation and other contributors
11785
- * Released under the MIT license.
11786
- * http://jquery.org/license
11787
- *
11788
- * http://api.jqueryui.com/progressbar/
11789
- */
11790
-
11791
-
11792
- var progressbar = $.widget( "ui.progressbar", {
11793
- version: "1.11.2",
11794
- options: {
11795
- max: 100,
11796
- value: 0,
11797
-
11798
- change: null,
11799
- complete: null
11800
- },
11801
-
11802
- min: 0,
11803
-
11804
- _create: function() {
11805
- // Constrain initial value
11806
- this.oldValue = this.options.value = this._constrainedValue();
11807
-
11808
- this.element
11809
- .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
11810
- .attr({
11811
- // Only set static values, aria-valuenow and aria-valuemax are
11812
- // set inside _refreshValue()
11813
- role: "progressbar",
11814
- "aria-valuemin": this.min
11815
- });
11816
-
11817
- this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
11818
- .appendTo( this.element );
11819
-
11820
- this._refreshValue();
11821
- },
11822
-
11823
- _destroy: function() {
11824
- this.element
11825
- .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
11826
- .removeAttr( "role" )
11827
- .removeAttr( "aria-valuemin" )
11828
- .removeAttr( "aria-valuemax" )
11829
- .removeAttr( "aria-valuenow" );
11830
-
11831
- this.valueDiv.remove();
11832
- },
11833
-
11834
- value: function( newValue ) {
11835
- if ( newValue === undefined ) {
11836
- return this.options.value;
11837
- }
11838
-
11839
- this.options.value = this._constrainedValue( newValue );
11840
- this._refreshValue();
11841
- },
11842
-
11843
- _constrainedValue: function( newValue ) {
11844
- if ( newValue === undefined ) {
11845
- newValue = this.options.value;
11846
- }
11847
-
11848
- this.indeterminate = newValue === false;
11849
-
11850
- // sanitize value
11851
- if ( typeof newValue !== "number" ) {
11852
- newValue = 0;
11853
- }
11854
-
11855
- return this.indeterminate ? false :
11856
- Math.min( this.options.max, Math.max( this.min, newValue ) );
11857
- },
11858
-
11859
- _setOptions: function( options ) {
11860
- // Ensure "value" option is set after other values (like max)
11861
- var value = options.value;
11862
- delete options.value;
11863
-
11864
- this._super( options );
11865
-
11866
- this.options.value = this._constrainedValue( value );
11867
- this._refreshValue();
11868
- },
11869
-
11870
- _setOption: function( key, value ) {
11871
- if ( key === "max" ) {
11872
- // Don't allow a max less than min
11873
- value = Math.max( this.min, value );
11874
- }
11875
- if ( key === "disabled" ) {
11876
- this.element
11877
- .toggleClass( "ui-state-disabled", !!value )
11878
- .attr( "aria-disabled", value );
11879
- }
11880
- this._super( key, value );
11881
- },
11882
-
11883
- _percentage: function() {
11884
- return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
11885
- },
11886
-
11887
- _refreshValue: function() {
11888
- var value = this.options.value,
11889
- percentage = this._percentage();
11890
-
11891
- this.valueDiv
11892
- .toggle( this.indeterminate || value > this.min )
11893
- .toggleClass( "ui-corner-right", value === this.options.max )
11894
- .width( percentage.toFixed(0) + "%" );
11895
-
11896
- this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
11897
-
11898
- if ( this.indeterminate ) {
11899
- this.element.removeAttr( "aria-valuenow" );
11900
- if ( !this.overlayDiv ) {
11901
- this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
11902
- }
11903
- } else {
11904
- this.element.attr({
11905
- "aria-valuemax": this.options.max,
11906
- "aria-valuenow": value
11907
- });
11908
- if ( this.overlayDiv ) {
11909
- this.overlayDiv.remove();
11910
- this.overlayDiv = null;
11911
- }
11912
- }
11913
-
11914
- if ( this.oldValue !== value ) {
11915
- this.oldValue = value;
11916
- this._trigger( "change" );
11917
- }
11918
- if ( value === this.options.max ) {
11919
- this._trigger( "complete" );
11920
- }
11921
- }
11922
- });
11923
-
11924
-
11925
- /*!
11926
- * jQuery UI Selectable 1.11.2
11927
- * http://jqueryui.com
11928
- *
11929
- * Copyright 2014 jQuery Foundation and other contributors
11930
- * Released under the MIT license.
11931
- * http://jquery.org/license
11932
- *
11933
- * http://api.jqueryui.com/selectable/
11934
- */
11935
-
11936
-
11937
- var selectable = $.widget("ui.selectable", $.ui.mouse, {
11938
- version: "1.11.2",
11939
- options: {
11940
- appendTo: "body",
11941
- autoRefresh: true,
11942
- distance: 0,
11943
- filter: "*",
11944
- tolerance: "touch",
11945
-
11946
- // callbacks
11947
- selected: null,
11948
- selecting: null,
11949
- start: null,
11950
- stop: null,
11951
- unselected: null,
11952
- unselecting: null
11953
- },
11954
- _create: function() {
11955
- var selectees,
11956
- that = this;
11957
-
11958
- this.element.addClass("ui-selectable");
11959
-
11960
- this.dragged = false;
11961
-
11962
- // cache selectee children based on filter
11963
- this.refresh = function() {
11964
- selectees = $(that.options.filter, that.element[0]);
11965
- selectees.addClass("ui-selectee");
11966
- selectees.each(function() {
11967
- var $this = $(this),
11968
- pos = $this.offset();
11969
- $.data(this, "selectable-item", {
11970
- element: this,
11971
- $element: $this,
11972
- left: pos.left,
11973
- top: pos.top,
11974
- right: pos.left + $this.outerWidth(),
11975
- bottom: pos.top + $this.outerHeight(),
11976
- startselected: false,
11977
- selected: $this.hasClass("ui-selected"),
11978
- selecting: $this.hasClass("ui-selecting"),
11979
- unselecting: $this.hasClass("ui-unselecting")
11980
- });
11981
- });
11982
- };
11983
- this.refresh();
11984
-
11985
- this.selectees = selectees.addClass("ui-selectee");
11986
-
11987
- this._mouseInit();
11988
-
11989
- this.helper = $("<div class='ui-selectable-helper'></div>");
11990
- },
11991
-
11992
- _destroy: function() {
11993
- this.selectees
11994
- .removeClass("ui-selectee")
11995
- .removeData("selectable-item");
11996
- this.element
11997
- .removeClass("ui-selectable ui-selectable-disabled");
11998
- this._mouseDestroy();
11999
- },
12000
-
12001
- _mouseStart: function(event) {
12002
- var that = this,
12003
- options = this.options;
12004
-
12005
- this.opos = [ event.pageX, event.pageY ];
12006
-
12007
- if (this.options.disabled) {
12008
- return;
12009
- }
12010
-
12011
- this.selectees = $(options.filter, this.element[0]);
12012
-
12013
- this._trigger("start", event);
12014
-
12015
- $(options.appendTo).append(this.helper);
12016
- // position helper (lasso)
12017
- this.helper.css({
12018
- "left": event.pageX,
12019
- "top": event.pageY,
12020
- "width": 0,
12021
- "height": 0
12022
- });
12023
-
12024
- if (options.autoRefresh) {
12025
- this.refresh();
12026
- }
12027
-
12028
- this.selectees.filter(".ui-selected").each(function() {
12029
- var selectee = $.data(this, "selectable-item");
12030
- selectee.startselected = true;
12031
- if (!event.metaKey && !event.ctrlKey) {
12032
- selectee.$element.removeClass("ui-selected");
12033
- selectee.selected = false;
12034
- selectee.$element.addClass("ui-unselecting");
12035
- selectee.unselecting = true;
12036
- // selectable UNSELECTING callback
12037
- that._trigger("unselecting", event, {
12038
- unselecting: selectee.element
12039
- });
12040
- }
12041
- });
12042
-
12043
- $(event.target).parents().addBack().each(function() {
12044
- var doSelect,
12045
- selectee = $.data(this, "selectable-item");
12046
- if (selectee) {
12047
- doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
12048
- selectee.$element
12049
- .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
12050
- .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
12051
- selectee.unselecting = !doSelect;
12052
- selectee.selecting = doSelect;
12053
- selectee.selected = doSelect;
12054
- // selectable (UN)SELECTING callback
12055
- if (doSelect) {
12056
- that._trigger("selecting", event, {
12057
- selecting: selectee.element
12058
- });
12059
- } else {
12060
- that._trigger("unselecting", event, {
12061
- unselecting: selectee.element
12062
- });
12063
- }
12064
- return false;
12065
- }
12066
- });
12067
-
12068
- },
12069
-
12070
- _mouseDrag: function(event) {
12071
-
12072
- this.dragged = true;
12073
-
12074
- if (this.options.disabled) {
12075
- return;
12076
- }
12077
-
12078
- var tmp,
12079
- that = this,
12080
- options = this.options,
12081
- x1 = this.opos[0],
12082
- y1 = this.opos[1],
12083
- x2 = event.pageX,
12084
- y2 = event.pageY;
12085
-
12086
- if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
12087
- if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
12088
- this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
12089
-
12090
- this.selectees.each(function() {
12091
- var selectee = $.data(this, "selectable-item"),
12092
- hit = false;
12093
-
12094
- //prevent helper from being selected if appendTo: selectable
12095
- if (!selectee || selectee.element === that.element[0]) {
12096
- return;
12097
- }
12098
-
12099
- if (options.tolerance === "touch") {
12100
- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
12101
- } else if (options.tolerance === "fit") {
12102
- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
12103
- }
12104
-
12105
- if (hit) {
12106
- // SELECT
12107
- if (selectee.selected) {
12108
- selectee.$element.removeClass("ui-selected");
12109
- selectee.selected = false;
12110
- }
12111
- if (selectee.unselecting) {
12112
- selectee.$element.removeClass("ui-unselecting");
12113
- selectee.unselecting = false;
12114
- }
12115
- if (!selectee.selecting) {
12116
- selectee.$element.addClass("ui-selecting");
12117
- selectee.selecting = true;
12118
- // selectable SELECTING callback
12119
- that._trigger("selecting", event, {
12120
- selecting: selectee.element
12121
- });
12122
- }
12123
- } else {
12124
- // UNSELECT
12125
- if (selectee.selecting) {
12126
- if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
12127
- selectee.$element.removeClass("ui-selecting");
12128
- selectee.selecting = false;
12129
- selectee.$element.addClass("ui-selected");
12130
- selectee.selected = true;
12131
- } else {
12132
- selectee.$element.removeClass("ui-selecting");
12133
- selectee.selecting = false;
12134
- if (selectee.startselected) {
12135
- selectee.$element.addClass("ui-unselecting");
12136
- selectee.unselecting = true;
12137
- }
12138
- // selectable UNSELECTING callback
12139
- that._trigger("unselecting", event, {
12140
- unselecting: selectee.element
12141
- });
12142
- }
12143
- }
12144
- if (selectee.selected) {
12145
- if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
12146
- selectee.$element.removeClass("ui-selected");
12147
- selectee.selected = false;
12148
-
12149
- selectee.$element.addClass("ui-unselecting");
12150
- selectee.unselecting = true;
12151
- // selectable UNSELECTING callback
12152
- that._trigger("unselecting", event, {
12153
- unselecting: selectee.element
12154
- });
12155
- }
12156
- }
12157
- }
12158
- });
12159
-
12160
- return false;
12161
- },
12162
-
12163
- _mouseStop: function(event) {
12164
- var that = this;
12165
-
12166
- this.dragged = false;
12167
-
12168
- $(".ui-unselecting", this.element[0]).each(function() {
12169
- var selectee = $.data(this, "selectable-item");
12170
- selectee.$element.removeClass("ui-unselecting");
12171
- selectee.unselecting = false;
12172
- selectee.startselected = false;
12173
- that._trigger("unselected", event, {
12174
- unselected: selectee.element
12175
- });
12176
- });
12177
- $(".ui-selecting", this.element[0]).each(function() {
12178
- var selectee = $.data(this, "selectable-item");
12179
- selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
12180
- selectee.selecting = false;
12181
- selectee.selected = true;
12182
- selectee.startselected = true;
12183
- that._trigger("selected", event, {
12184
- selected: selectee.element
12185
- });
12186
- });
12187
- this._trigger("stop", event);
12188
-
12189
- this.helper.remove();
12190
-
12191
- return false;
12192
- }
12193
-
12194
- });
12195
-
12196
-
12197
- /*!
12198
- * jQuery UI Selectmenu 1.11.2
12199
- * http://jqueryui.com
12200
- *
12201
- * Copyright 2014 jQuery Foundation and other contributors
12202
- * Released under the MIT license.
12203
- * http://jquery.org/license
12204
- *
12205
- * http://api.jqueryui.com/selectmenu
12206
- */
12207
-
12208
-
12209
- var selectmenu = $.widget( "ui.selectmenu", {
12210
- version: "1.11.2",
12211
- defaultElement: "<select>",
12212
- options: {
12213
- appendTo: null,
12214
- disabled: null,
12215
- icons: {
12216
- button: "ui-icon-triangle-1-s"
12217
- },
12218
- position: {
12219
- my: "left top",
12220
- at: "left bottom",
12221
- collision: "none"
12222
- },
12223
- width: null,
12224
-
12225
- // callbacks
12226
- change: null,
12227
- close: null,
12228
- focus: null,
12229
- open: null,
12230
- select: null
12231
- },
12232
-
12233
- _create: function() {
12234
- var selectmenuId = this.element.uniqueId().attr( "id" );
12235
- this.ids = {
12236
- element: selectmenuId,
12237
- button: selectmenuId + "-button",
12238
- menu: selectmenuId + "-menu"
12239
- };
12240
-
12241
- this._drawButton();
12242
- this._drawMenu();
12243
-
12244
- if ( this.options.disabled ) {
12245
- this.disable();
12246
- }
12247
- },
12248
-
12249
- _drawButton: function() {
12250
- var that = this,
12251
- tabindex = this.element.attr( "tabindex" );
12252
-
12253
- // Associate existing label with the new button
12254
- this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
12255
- this._on( this.label, {
12256
- click: function( event ) {
12257
- this.button.focus();
12258
- event.preventDefault();
12259
- }
12260
- });
12261
-
12262
- // Hide original select element
12263
- this.element.hide();
12264
-
12265
- // Create button
12266
- this.button = $( "<span>", {
12267
- "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
12268
- tabindex: tabindex || this.options.disabled ? -1 : 0,
12269
- id: this.ids.button,
12270
- role: "combobox",
12271
- "aria-expanded": "false",
12272
- "aria-autocomplete": "list",
12273
- "aria-owns": this.ids.menu,
12274
- "aria-haspopup": "true"
12275
- })
12276
- .insertAfter( this.element );
12277
-
12278
- $( "<span>", {
12279
- "class": "ui-icon " + this.options.icons.button
12280
- })
12281
- .prependTo( this.button );
12282
-
12283
- this.buttonText = $( "<span>", {
12284
- "class": "ui-selectmenu-text"
12285
- })
12286
- .appendTo( this.button );
12287
-
12288
- this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
12289
- this._resizeButton();
12290
-
12291
- this._on( this.button, this._buttonEvents );
12292
- this.button.one( "focusin", function() {
12293
-
12294
- // Delay rendering the menu items until the button receives focus.
12295
- // The menu may have already been rendered via a programmatic open.
12296
- if ( !that.menuItems ) {
12297
- that._refreshMenu();
12298
- }
12299
- });
12300
- this._hoverable( this.button );
12301
- this._focusable( this.button );
12302
- },
12303
-
12304
- _drawMenu: function() {
12305
- var that = this;
12306
-
12307
- // Create menu
12308
- this.menu = $( "<ul>", {
12309
- "aria-hidden": "true",
12310
- "aria-labelledby": this.ids.button,
12311
- id: this.ids.menu
12312
- });
12313
-
12314
- // Wrap menu
12315
- this.menuWrap = $( "<div>", {
12316
- "class": "ui-selectmenu-menu ui-front"
12317
- })
12318
- .append( this.menu )
12319
- .appendTo( this._appendTo() );
12320
-
12321
- // Initialize menu widget
12322
- this.menuInstance = this.menu
12323
- .menu({
12324
- role: "listbox",
12325
- select: function( event, ui ) {
12326
- event.preventDefault();
12327
-
12328
- // support: IE8
12329
- // If the item was selected via a click, the text selection
12330
- // will be destroyed in IE
12331
- that._setSelection();
12332
-
12333
- that._select( ui.item.data( "ui-selectmenu-item" ), event );
12334
- },
12335
- focus: function( event, ui ) {
12336
- var item = ui.item.data( "ui-selectmenu-item" );
12337
-
12338
- // Prevent inital focus from firing and check if its a newly focused item
12339
- if ( that.focusIndex != null && item.index !== that.focusIndex ) {
12340
- that._trigger( "focus", event, { item: item } );
12341
- if ( !that.isOpen ) {
12342
- that._select( item, event );
12343
- }
12344
- }
12345
- that.focusIndex = item.index;
12346
-
12347
- that.button.attr( "aria-activedescendant",
12348
- that.menuItems.eq( item.index ).attr( "id" ) );
12349
- }
12350
- })
12351
- .menu( "instance" );
12352
-
12353
- // Adjust menu styles to dropdown
12354
- this.menu
12355
- .addClass( "ui-corner-bottom" )
12356
- .removeClass( "ui-corner-all" );
12357
-
12358
- // Don't close the menu on mouseleave
12359
- this.menuInstance._off( this.menu, "mouseleave" );
12360
-
12361
- // Cancel the menu's collapseAll on document click
12362
- this.menuInstance._closeOnDocumentClick = function() {
12363
- return false;
12364
- };
12365
-
12366
- // Selects often contain empty items, but never contain dividers
12367
- this.menuInstance._isDivider = function() {
12368
- return false;
12369
- };
12370
- },
12371
-
12372
- refresh: function() {
12373
- this._refreshMenu();
12374
- this._setText( this.buttonText, this._getSelectedItem().text() );
12375
- if ( !this.options.width ) {
12376
- this._resizeButton();
12377
- }
12378
- },
12379
-
12380
- _refreshMenu: function() {
12381
- this.menu.empty();
12382
-
12383
- var item,
12384
- options = this.element.find( "option" );
12385
-
12386
- if ( !options.length ) {
12387
- return;
12388
- }
12389
-
12390
- this._parseOptions( options );
12391
- this._renderMenu( this.menu, this.items );
12392
-
12393
- this.menuInstance.refresh();
12394
- this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
12395
-
12396
- item = this._getSelectedItem();
12397
-
12398
- // Update the menu to have the correct item focused
12399
- this.menuInstance.focus( null, item );
12400
- this._setAria( item.data( "ui-selectmenu-item" ) );
12401
-
12402
- // Set disabled state
12403
- this._setOption( "disabled", this.element.prop( "disabled" ) );
12404
- },
12405
-
12406
- open: function( event ) {
12407
- if ( this.options.disabled ) {
12408
- return;
12409
- }
12410
-
12411
- // If this is the first time the menu is being opened, render the items
12412
- if ( !this.menuItems ) {
12413
- this._refreshMenu();
12414
- } else {
12415
-
12416
- // Menu clears focus on close, reset focus to selected item
12417
- this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
12418
- this.menuInstance.focus( null, this._getSelectedItem() );
12419
- }
12420
-
12421
- this.isOpen = true;
12422
- this._toggleAttr();
12423
- this._resizeMenu();
12424
- this._position();
12425
-
12426
- this._on( this.document, this._documentClick );
12427
-
12428
- this._trigger( "open", event );
12429
- },
12430
-
12431
- _position: function() {
12432
- this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
12433
- },
12434
-
12435
- close: function( event ) {
12436
- if ( !this.isOpen ) {
12437
- return;
12438
- }
12439
-
12440
- this.isOpen = false;
12441
- this._toggleAttr();
12442
-
12443
- this.range = null;
12444
- this._off( this.document );
12445
-
12446
- this._trigger( "close", event );
12447
- },
12448
-
12449
- widget: function() {
12450
- return this.button;
12451
- },
12452
-
12453
- menuWidget: function() {
12454
- return this.menu;
12455
- },
12456
-
12457
- _renderMenu: function( ul, items ) {
12458
- var that = this,
12459
- currentOptgroup = "";
12460
-
12461
- $.each( items, function( index, item ) {
12462
- if ( item.optgroup !== currentOptgroup ) {
12463
- $( "<li>", {
12464
- "class": "ui-selectmenu-optgroup ui-menu-divider" +
12465
- ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
12466
- " ui-state-disabled" :
12467
- "" ),
12468
- text: item.optgroup
12469
- })
12470
- .appendTo( ul );
12471
-
12472
- currentOptgroup = item.optgroup;
12473
- }
12474
-
12475
- that._renderItemData( ul, item );
12476
- });
12477
- },
12478
-
12479
- _renderItemData: function( ul, item ) {
12480
- return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
12481
- },
12482
-
12483
- _renderItem: function( ul, item ) {
12484
- var li = $( "<li>" );
12485
-
12486
- if ( item.disabled ) {
12487
- li.addClass( "ui-state-disabled" );
12488
- }
12489
- this._setText( li, item.label );
12490
-
12491
- return li.appendTo( ul );
12492
- },
12493
-
12494
- _setText: function( element, value ) {
12495
- if ( value ) {
12496
- element.text( value );
12497
- } else {
12498
- element.html( "&#160;" );
12499
- }
12500
- },
12501
-
12502
- _move: function( direction, event ) {
12503
- var item, next,
12504
- filter = ".ui-menu-item";
12505
-
12506
- if ( this.isOpen ) {
12507
- item = this.menuItems.eq( this.focusIndex );
12508
- } else {
12509
- item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
12510
- filter += ":not(.ui-state-disabled)";
12511
- }
12512
-
12513
- if ( direction === "first" || direction === "last" ) {
12514
- next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
12515
- } else {
12516
- next = item[ direction + "All" ]( filter ).eq( 0 );
12517
- }
12518
-
12519
- if ( next.length ) {
12520
- this.menuInstance.focus( event, next );
12521
- }
12522
- },
12523
-
12524
- _getSelectedItem: function() {
12525
- return this.menuItems.eq( this.element[ 0 ].selectedIndex );
12526
- },
12527
-
12528
- _toggle: function( event ) {
12529
- this[ this.isOpen ? "close" : "open" ]( event );
12530
- },
12531
-
12532
- _setSelection: function() {
12533
- var selection;
12534
-
12535
- if ( !this.range ) {
12536
- return;
12537
- }
12538
-
12539
- if ( window.getSelection ) {
12540
- selection = window.getSelection();
12541
- selection.removeAllRanges();
12542
- selection.addRange( this.range );
12543
-
12544
- // support: IE8
12545
- } else {
12546
- this.range.select();
12547
- }
12548
-
12549
- // support: IE
12550
- // Setting the text selection kills the button focus in IE, but
12551
- // restoring the focus doesn't kill the selection.
12552
- this.button.focus();
12553
- },
12554
-
12555
- _documentClick: {
12556
- mousedown: function( event ) {
12557
- if ( !this.isOpen ) {
12558
- return;
12559
- }
12560
-
12561
- if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
12562
- this.close( event );
12563
- }
12564
- }
12565
- },
12566
-
12567
- _buttonEvents: {
12568
-
12569
- // Prevent text selection from being reset when interacting with the selectmenu (#10144)
12570
- mousedown: function() {
12571
- var selection;
12572
-
12573
- if ( window.getSelection ) {
12574
- selection = window.getSelection();
12575
- if ( selection.rangeCount ) {
12576
- this.range = selection.getRangeAt( 0 );
12577
- }
12578
-
12579
- // support: IE8
12580
- } else {
12581
- this.range = document.selection.createRange();
12582
- }
12583
- },
12584
-
12585
- click: function( event ) {
12586
- this._setSelection();
12587
- this._toggle( event );
12588
- },
12589
-
12590
- keydown: function( event ) {
12591
- var preventDefault = true;
12592
- switch ( event.keyCode ) {
12593
- case $.ui.keyCode.TAB:
12594
- case $.ui.keyCode.ESCAPE:
12595
- this.close( event );
12596
- preventDefault = false;
12597
- break;
12598
- case $.ui.keyCode.ENTER:
12599
- if ( this.isOpen ) {
12600
- this._selectFocusedItem( event );
12601
- }
12602
- break;
12603
- case $.ui.keyCode.UP:
12604
- if ( event.altKey ) {
12605
- this._toggle( event );
12606
- } else {
12607
- this._move( "prev", event );
12608
- }
12609
- break;
12610
- case $.ui.keyCode.DOWN:
12611
- if ( event.altKey ) {
12612
- this._toggle( event );
12613
- } else {
12614
- this._move( "next", event );
12615
- }
12616
- break;
12617
- case $.ui.keyCode.SPACE:
12618
- if ( this.isOpen ) {
12619
- this._selectFocusedItem( event );
12620
- } else {
12621
- this._toggle( event );
12622
- }
12623
- break;
12624
- case $.ui.keyCode.LEFT:
12625
- this._move( "prev", event );
12626
- break;
12627
- case $.ui.keyCode.RIGHT:
12628
- this._move( "next", event );
12629
- break;
12630
- case $.ui.keyCode.HOME:
12631
- case $.ui.keyCode.PAGE_UP:
12632
- this._move( "first", event );
12633
- break;
12634
- case $.ui.keyCode.END:
12635
- case $.ui.keyCode.PAGE_DOWN:
12636
- this._move( "last", event );
12637
- break;
12638
- default:
12639
- this.menu.trigger( event );
12640
- preventDefault = false;
12641
- }
12642
-
12643
- if ( preventDefault ) {
12644
- event.preventDefault();
12645
- }
12646
- }
12647
- },
12648
-
12649
- _selectFocusedItem: function( event ) {
12650
- var item = this.menuItems.eq( this.focusIndex );
12651
- if ( !item.hasClass( "ui-state-disabled" ) ) {
12652
- this._select( item.data( "ui-selectmenu-item" ), event );
12653
- }
12654
- },
12655
-
12656
- _select: function( item, event ) {
12657
- var oldIndex = this.element[ 0 ].selectedIndex;
12658
-
12659
- // Change native select element
12660
- this.element[ 0 ].selectedIndex = item.index;
12661
- this._setText( this.buttonText, item.label );
12662
- this._setAria( item );
12663
- this._trigger( "select", event, { item: item } );
12664
-
12665
- if ( item.index !== oldIndex ) {
12666
- this._trigger( "change", event, { item: item } );
12667
- }
12668
-
12669
- this.close( event );
12670
- },
12671
-
12672
- _setAria: function( item ) {
12673
- var id = this.menuItems.eq( item.index ).attr( "id" );
12674
-
12675
- this.button.attr({
12676
- "aria-labelledby": id,
12677
- "aria-activedescendant": id
12678
- });
12679
- this.menu.attr( "aria-activedescendant", id );
12680
- },
12681
-
12682
- _setOption: function( key, value ) {
12683
- if ( key === "icons" ) {
12684
- this.button.find( "span.ui-icon" )
12685
- .removeClass( this.options.icons.button )
12686
- .addClass( value.button );
12687
- }
12688
-
12689
- this._super( key, value );
12690
-
12691
- if ( key === "appendTo" ) {
12692
- this.menuWrap.appendTo( this._appendTo() );
12693
- }
12694
-
12695
- if ( key === "disabled" ) {
12696
- this.menuInstance.option( "disabled", value );
12697
- this.button
12698
- .toggleClass( "ui-state-disabled", value )
12699
- .attr( "aria-disabled", value );
12700
-
12701
- this.element.prop( "disabled", value );
12702
- if ( value ) {
12703
- this.button.attr( "tabindex", -1 );
12704
- this.close();
12705
- } else {
12706
- this.button.attr( "tabindex", 0 );
12707
- }
12708
- }
12709
-
12710
- if ( key === "width" ) {
12711
- this._resizeButton();
12712
- }
12713
- },
12714
-
12715
- _appendTo: function() {
12716
- var element = this.options.appendTo;
12717
-
12718
- if ( element ) {
12719
- element = element.jquery || element.nodeType ?
12720
- $( element ) :
12721
- this.document.find( element ).eq( 0 );
12722
- }
12723
-
12724
- if ( !element || !element[ 0 ] ) {
12725
- element = this.element.closest( ".ui-front" );
12726
- }
12727
-
12728
- if ( !element.length ) {
12729
- element = this.document[ 0 ].body;
12730
- }
12731
-
12732
- return element;
12733
- },
12734
-
12735
- _toggleAttr: function() {
12736
- this.button
12737
- .toggleClass( "ui-corner-top", this.isOpen )
12738
- .toggleClass( "ui-corner-all", !this.isOpen )
12739
- .attr( "aria-expanded", this.isOpen );
12740
- this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
12741
- this.menu.attr( "aria-hidden", !this.isOpen );
12742
- },
12743
-
12744
- _resizeButton: function() {
12745
- var width = this.options.width;
12746
-
12747
- if ( !width ) {
12748
- width = this.element.show().outerWidth();
12749
- this.element.hide();
12750
- }
12751
-
12752
- this.button.outerWidth( width );
12753
- },
12754
-
12755
- _resizeMenu: function() {
12756
- this.menu.outerWidth( Math.max(
12757
- this.button.outerWidth(),
12758
-
12759
- // support: IE10
12760
- // IE10 wraps long text (possibly a rounding bug)
12761
- // so we add 1px to avoid the wrapping
12762
- this.menu.width( "" ).outerWidth() + 1
12763
- ) );
12764
- },
12765
-
12766
- _getCreateOptions: function() {
12767
- return { disabled: this.element.prop( "disabled" ) };
12768
- },
12769
-
12770
- _parseOptions: function( options ) {
12771
- var data = [];
12772
- options.each(function( index, item ) {
12773
- var option = $( item ),
12774
- optgroup = option.parent( "optgroup" );
12775
- data.push({
12776
- element: option,
12777
- index: index,
12778
- value: option.attr( "value" ),
12779
- label: option.text(),
12780
- optgroup: optgroup.attr( "label" ) || "",
12781
- disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
12782
- });
12783
- });
12784
- this.items = data;
12785
- },
12786
-
12787
- _destroy: function() {
12788
- this.menuWrap.remove();
12789
- this.button.remove();
12790
- this.element.show();
12791
- this.element.removeUniqueId();
12792
- this.label.attr( "for", this.ids.element );
12793
- }
12794
- });
12795
-
12796
-
12797
- /*!
12798
- * jQuery UI Slider 1.11.2
12799
- * http://jqueryui.com
12800
- *
12801
- * Copyright 2014 jQuery Foundation and other contributors
12802
- * Released under the MIT license.
12803
- * http://jquery.org/license
12804
- *
12805
- * http://api.jqueryui.com/slider/
12806
- */
12807
-
12808
-
12809
- var slider = $.widget( "ui.slider", $.ui.mouse, {
12810
- version: "1.11.2",
12811
- widgetEventPrefix: "slide",
12812
-
12813
- options: {
12814
- animate: false,
12815
- distance: 0,
12816
- max: 100,
12817
- min: 0,
12818
- orientation: "horizontal",
12819
- range: false,
12820
- step: 1,
12821
- value: 0,
12822
- values: null,
12823
-
12824
- // callbacks
12825
- change: null,
12826
- slide: null,
12827
- start: null,
12828
- stop: null
12829
- },
12830
-
12831
- // number of pages in a slider
12832
- // (how many times can you page up/down to go through the whole range)
12833
- numPages: 5,
12834
-
12835
- _create: function() {
12836
- this._keySliding = false;
12837
- this._mouseSliding = false;
12838
- this._animateOff = true;
12839
- this._handleIndex = null;
12840
- this._detectOrientation();
12841
- this._mouseInit();
12842
- this._calculateNewMax();
12843
-
12844
- this.element
12845
- .addClass( "ui-slider" +
12846
- " ui-slider-" + this.orientation +
12847
- " ui-widget" +
12848
- " ui-widget-content" +
12849
- " ui-corner-all");
12850
-
12851
- this._refresh();
12852
- this._setOption( "disabled", this.options.disabled );
12853
-
12854
- this._animateOff = false;
12855
- },
12856
-
12857
- _refresh: function() {
12858
- this._createRange();
12859
- this._createHandles();
12860
- this._setupEvents();
12861
- this._refreshValue();
12862
- },
12863
-
12864
- _createHandles: function() {
12865
- var i, handleCount,
12866
- options = this.options,
12867
- existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
12868
- handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
12869
- handles = [];
12870
-
12871
- handleCount = ( options.values && options.values.length ) || 1;
12872
-
12873
- if ( existingHandles.length > handleCount ) {
12874
- existingHandles.slice( handleCount ).remove();
12875
- existingHandles = existingHandles.slice( 0, handleCount );
12876
- }
12877
-
12878
- for ( i = existingHandles.length; i < handleCount; i++ ) {
12879
- handles.push( handle );
12880
- }
12881
-
12882
- this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
12883
-
12884
- this.handle = this.handles.eq( 0 );
12885
-
12886
- this.handles.each(function( i ) {
12887
- $( this ).data( "ui-slider-handle-index", i );
12888
- });
12889
- },
12890
-
12891
- _createRange: function() {
12892
- var options = this.options,
12893
- classes = "";
12894
-
12895
- if ( options.range ) {
12896
- if ( options.range === true ) {
12897
- if ( !options.values ) {
12898
- options.values = [ this._valueMin(), this._valueMin() ];
12899
- } else if ( options.values.length && options.values.length !== 2 ) {
12900
- options.values = [ options.values[0], options.values[0] ];
12901
- } else if ( $.isArray( options.values ) ) {
12902
- options.values = options.values.slice(0);
12903
- }
12904
- }
12905
-
12906
- if ( !this.range || !this.range.length ) {
12907
- this.range = $( "<div></div>" )
12908
- .appendTo( this.element );
12909
-
12910
- classes = "ui-slider-range" +
12911
- // note: this isn't the most fittingly semantic framework class for this element,
12912
- // but worked best visually with a variety of themes
12913
- " ui-widget-header ui-corner-all";
12914
- } else {
12915
- this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
12916
- // Handle range switching from true to min/max
12917
- .css({
12918
- "left": "",
12919
- "bottom": ""
12920
- });
12921
- }
12922
-
12923
- this.range.addClass( classes +
12924
- ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
12925
- } else {
12926
- if ( this.range ) {
12927
- this.range.remove();
12928
- }
12929
- this.range = null;
12930
- }
12931
- },
12932
-
12933
- _setupEvents: function() {
12934
- this._off( this.handles );
12935
- this._on( this.handles, this._handleEvents );
12936
- this._hoverable( this.handles );
12937
- this._focusable( this.handles );
12938
- },
12939
-
12940
- _destroy: function() {
12941
- this.handles.remove();
12942
- if ( this.range ) {
12943
- this.range.remove();
12944
- }
12945
-
12946
- this.element
12947
- .removeClass( "ui-slider" +
12948
- " ui-slider-horizontal" +
12949
- " ui-slider-vertical" +
12950
- " ui-widget" +
12951
- " ui-widget-content" +
12952
- " ui-corner-all" );
12953
-
12954
- this._mouseDestroy();
12955
- },
12956
-
12957
- _mouseCapture: function( event ) {
12958
- var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
12959
- that = this,
12960
- o = this.options;
12961
-
12962
- if ( o.disabled ) {
12963
- return false;
12964
- }
12965
-
12966
- this.elementSize = {
12967
- width: this.element.outerWidth(),
12968
- height: this.element.outerHeight()
12969
- };
12970
- this.elementOffset = this.element.offset();
12971
-
12972
- position = { x: event.pageX, y: event.pageY };
12973
- normValue = this._normValueFromMouse( position );
12974
- distance = this._valueMax() - this._valueMin() + 1;
12975
- this.handles.each(function( i ) {
12976
- var thisDistance = Math.abs( normValue - that.values(i) );
12977
- if (( distance > thisDistance ) ||
12978
- ( distance === thisDistance &&
12979
- (i === that._lastChangedValue || that.values(i) === o.min ))) {
12980
- distance = thisDistance;
12981
- closestHandle = $( this );
12982
- index = i;
12983
- }
12984
- });
12985
-
12986
- allowed = this._start( event, index );
12987
- if ( allowed === false ) {
12988
- return false;
12989
- }
12990
- this._mouseSliding = true;
12991
-
12992
- this._handleIndex = index;
12993
-
12994
- closestHandle
12995
- .addClass( "ui-state-active" )
12996
- .focus();
12997
-
12998
- offset = closestHandle.offset();
12999
- mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
13000
- this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
13001
- left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
13002
- top: event.pageY - offset.top -
13003
- ( closestHandle.height() / 2 ) -
13004
- ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
13005
- ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
13006
- ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
13007
- };
13008
-
13009
- if ( !this.handles.hasClass( "ui-state-hover" ) ) {
13010
- this._slide( event, index, normValue );
13011
- }
13012
- this._animateOff = true;
13013
- return true;
13014
- },
13015
-
13016
- _mouseStart: function() {
13017
- return true;
13018
- },
13019
-
13020
- _mouseDrag: function( event ) {
13021
- var position = { x: event.pageX, y: event.pageY },
13022
- normValue = this._normValueFromMouse( position );
13023
-
13024
- this._slide( event, this._handleIndex, normValue );
13025
-
13026
- return false;
13027
- },
13028
-
13029
- _mouseStop: function( event ) {
13030
- this.handles.removeClass( "ui-state-active" );
13031
- this._mouseSliding = false;
13032
-
13033
- this._stop( event, this._handleIndex );
13034
- this._change( event, this._handleIndex );
13035
-
13036
- this._handleIndex = null;
13037
- this._clickOffset = null;
13038
- this._animateOff = false;
13039
-
13040
- return false;
13041
- },
13042
-
13043
- _detectOrientation: function() {
13044
- this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
13045
- },
13046
-
13047
- _normValueFromMouse: function( position ) {
13048
- var pixelTotal,
13049
- pixelMouse,
13050
- percentMouse,
13051
- valueTotal,
13052
- valueMouse;
13053
-
13054
- if ( this.orientation === "horizontal" ) {
13055
- pixelTotal = this.elementSize.width;
13056
- pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
13057
- } else {
13058
- pixelTotal = this.elementSize.height;
13059
- pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
13060
- }
13061
-
13062
- percentMouse = ( pixelMouse / pixelTotal );
13063
- if ( percentMouse > 1 ) {
13064
- percentMouse = 1;
13065
- }
13066
- if ( percentMouse < 0 ) {
13067
- percentMouse = 0;
13068
- }
13069
- if ( this.orientation === "vertical" ) {
13070
- percentMouse = 1 - percentMouse;
13071
- }
13072
-
13073
- valueTotal = this._valueMax() - this._valueMin();
13074
- valueMouse = this._valueMin() + percentMouse * valueTotal;
13075
-
13076
- return this._trimAlignValue( valueMouse );
13077
- },
13078
-
13079
- _start: function( event, index ) {
13080
- var uiHash = {
13081
- handle: this.handles[ index ],
13082
- value: this.value()
13083
- };
13084
- if ( this.options.values && this.options.values.length ) {
13085
- uiHash.value = this.values( index );
13086
- uiHash.values = this.values();
13087
- }
13088
- return this._trigger( "start", event, uiHash );
13089
- },
13090
-
13091
- _slide: function( event, index, newVal ) {
13092
- var otherVal,
13093
- newValues,
13094
- allowed;
13095
-
13096
- if ( this.options.values && this.options.values.length ) {
13097
- otherVal = this.values( index ? 0 : 1 );
13098
-
13099
- if ( ( this.options.values.length === 2 && this.options.range === true ) &&
13100
- ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
13101
- ) {
13102
- newVal = otherVal;
13103
- }
13104
-
13105
- if ( newVal !== this.values( index ) ) {
13106
- newValues = this.values();
13107
- newValues[ index ] = newVal;
13108
- // A slide can be canceled by returning false from the slide callback
13109
- allowed = this._trigger( "slide", event, {
13110
- handle: this.handles[ index ],
13111
- value: newVal,
13112
- values: newValues
13113
- } );
13114
- otherVal = this.values( index ? 0 : 1 );
13115
- if ( allowed !== false ) {
13116
- this.values( index, newVal );
13117
- }
13118
- }
13119
- } else {
13120
- if ( newVal !== this.value() ) {
13121
- // A slide can be canceled by returning false from the slide callback
13122
- allowed = this._trigger( "slide", event, {
13123
- handle: this.handles[ index ],
13124
- value: newVal
13125
- } );
13126
- if ( allowed !== false ) {
13127
- this.value( newVal );
13128
- }
13129
- }
13130
- }
13131
- },
13132
-
13133
- _stop: function( event, index ) {
13134
- var uiHash = {
13135
- handle: this.handles[ index ],
13136
- value: this.value()
13137
- };
13138
- if ( this.options.values && this.options.values.length ) {
13139
- uiHash.value = this.values( index );
13140
- uiHash.values = this.values();
13141
- }
13142
-
13143
- this._trigger( "stop", event, uiHash );
13144
- },
13145
-
13146
- _change: function( event, index ) {
13147
- if ( !this._keySliding && !this._mouseSliding ) {
13148
- var uiHash = {
13149
- handle: this.handles[ index ],
13150
- value: this.value()
13151
- };
13152
- if ( this.options.values && this.options.values.length ) {
13153
- uiHash.value = this.values( index );
13154
- uiHash.values = this.values();
13155
- }
13156
-
13157
- //store the last changed value index for reference when handles overlap
13158
- this._lastChangedValue = index;
13159
-
13160
- this._trigger( "change", event, uiHash );
13161
- }
13162
- },
13163
-
13164
- value: function( newValue ) {
13165
- if ( arguments.length ) {
13166
- this.options.value = this._trimAlignValue( newValue );
13167
- this._refreshValue();
13168
- this._change( null, 0 );
13169
- return;
13170
- }
13171
-
13172
- return this._value();
13173
- },
13174
-
13175
- values: function( index, newValue ) {
13176
- var vals,
13177
- newValues,
13178
- i;
13179
-
13180
- if ( arguments.length > 1 ) {
13181
- this.options.values[ index ] = this._trimAlignValue( newValue );
13182
- this._refreshValue();
13183
- this._change( null, index );
13184
- return;
13185
- }
13186
-
13187
- if ( arguments.length ) {
13188
- if ( $.isArray( arguments[ 0 ] ) ) {
13189
- vals = this.options.values;
13190
- newValues = arguments[ 0 ];
13191
- for ( i = 0; i < vals.length; i += 1 ) {
13192
- vals[ i ] = this._trimAlignValue( newValues[ i ] );
13193
- this._change( null, i );
13194
- }
13195
- this._refreshValue();
13196
- } else {
13197
- if ( this.options.values && this.options.values.length ) {
13198
- return this._values( index );
13199
- } else {
13200
- return this.value();
13201
- }
13202
- }
13203
- } else {
13204
- return this._values();
13205
- }
13206
- },
13207
-
13208
- _setOption: function( key, value ) {
13209
- var i,
13210
- valsLength = 0;
13211
-
13212
- if ( key === "range" && this.options.range === true ) {
13213
- if ( value === "min" ) {
13214
- this.options.value = this._values( 0 );
13215
- this.options.values = null;
13216
- } else if ( value === "max" ) {
13217
- this.options.value = this._values( this.options.values.length - 1 );
13218
- this.options.values = null;
13219
- }
13220
- }
13221
-
13222
- if ( $.isArray( this.options.values ) ) {
13223
- valsLength = this.options.values.length;
13224
- }
13225
-
13226
- if ( key === "disabled" ) {
13227
- this.element.toggleClass( "ui-state-disabled", !!value );
13228
- }
13229
-
13230
- this._super( key, value );
13231
-
13232
- switch ( key ) {
13233
- case "orientation":
13234
- this._detectOrientation();
13235
- this.element
13236
- .removeClass( "ui-slider-horizontal ui-slider-vertical" )
13237
- .addClass( "ui-slider-" + this.orientation );
13238
- this._refreshValue();
13239
-
13240
- // Reset positioning from previous orientation
13241
- this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
13242
- break;
13243
- case "value":
13244
- this._animateOff = true;
13245
- this._refreshValue();
13246
- this._change( null, 0 );
13247
- this._animateOff = false;
13248
- break;
13249
- case "values":
13250
- this._animateOff = true;
13251
- this._refreshValue();
13252
- for ( i = 0; i < valsLength; i += 1 ) {
13253
- this._change( null, i );
13254
- }
13255
- this._animateOff = false;
13256
- break;
13257
- case "step":
13258
- case "min":
13259
- case "max":
13260
- this._animateOff = true;
13261
- this._calculateNewMax();
13262
- this._refreshValue();
13263
- this._animateOff = false;
13264
- break;
13265
- case "range":
13266
- this._animateOff = true;
13267
- this._refresh();
13268
- this._animateOff = false;
13269
- break;
13270
- }
13271
- },
13272
-
13273
- //internal value getter
13274
- // _value() returns value trimmed by min and max, aligned by step
13275
- _value: function() {
13276
- var val = this.options.value;
13277
- val = this._trimAlignValue( val );
13278
-
13279
- return val;
13280
- },
13281
-
13282
- //internal values getter
13283
- // _values() returns array of values trimmed by min and max, aligned by step
13284
- // _values( index ) returns single value trimmed by min and max, aligned by step
13285
- _values: function( index ) {
13286
- var val,
13287
- vals,
13288
- i;
13289
-
13290
- if ( arguments.length ) {
13291
- val = this.options.values[ index ];
13292
- val = this._trimAlignValue( val );
13293
-
13294
- return val;
13295
- } else if ( this.options.values && this.options.values.length ) {
13296
- // .slice() creates a copy of the array
13297
- // this copy gets trimmed by min and max and then returned
13298
- vals = this.options.values.slice();
13299
- for ( i = 0; i < vals.length; i += 1) {
13300
- vals[ i ] = this._trimAlignValue( vals[ i ] );
13301
- }
13302
-
13303
- return vals;
13304
- } else {
13305
- return [];
13306
- }
13307
- },
13308
-
13309
- // returns the step-aligned value that val is closest to, between (inclusive) min and max
13310
- _trimAlignValue: function( val ) {
13311
- if ( val <= this._valueMin() ) {
13312
- return this._valueMin();
13313
- }
13314
- if ( val >= this._valueMax() ) {
13315
- return this._valueMax();
13316
- }
13317
- var step = ( this.options.step > 0 ) ? this.options.step : 1,
13318
- valModStep = (val - this._valueMin()) % step,
13319
- alignValue = val - valModStep;
13320
-
13321
- if ( Math.abs(valModStep) * 2 >= step ) {
13322
- alignValue += ( valModStep > 0 ) ? step : ( -step );
13323
- }
13324
-
13325
- // Since JavaScript has problems with large floats, round
13326
- // the final value to 5 digits after the decimal point (see #4124)
13327
- return parseFloat( alignValue.toFixed(5) );
13328
- },
13329
-
13330
- _calculateNewMax: function() {
13331
- var remainder = ( this.options.max - this._valueMin() ) % this.options.step;
13332
- this.max = this.options.max - remainder;
13333
- },
13334
-
13335
- _valueMin: function() {
13336
- return this.options.min;
13337
- },
13338
-
13339
- _valueMax: function() {
13340
- return this.max;
13341
- },
13342
-
13343
- _refreshValue: function() {
13344
- var lastValPercent, valPercent, value, valueMin, valueMax,
13345
- oRange = this.options.range,
13346
- o = this.options,
13347
- that = this,
13348
- animate = ( !this._animateOff ) ? o.animate : false,
13349
- _set = {};
13350
-
13351
- if ( this.options.values && this.options.values.length ) {
13352
- this.handles.each(function( i ) {
13353
- valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
13354
- _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
13355
- $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
13356
- if ( that.options.range === true ) {
13357
- if ( that.orientation === "horizontal" ) {
13358
- if ( i === 0 ) {
13359
- that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
13360
- }
13361
- if ( i === 1 ) {
13362
- that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
13363
- }
13364
- } else {
13365
- if ( i === 0 ) {
13366
- that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
13367
- }
13368
- if ( i === 1 ) {
13369
- that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
13370
- }
13371
- }
13372
- }
13373
- lastValPercent = valPercent;
13374
- });
13375
- } else {
13376
- value = this.value();
13377
- valueMin = this._valueMin();
13378
- valueMax = this._valueMax();
13379
- valPercent = ( valueMax !== valueMin ) ?
13380
- ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
13381
- 0;
13382
- _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
13383
- this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
13384
-
13385
- if ( oRange === "min" && this.orientation === "horizontal" ) {
13386
- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
13387
- }
13388
- if ( oRange === "max" && this.orientation === "horizontal" ) {
13389
- this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
13390
- }
13391
- if ( oRange === "min" && this.orientation === "vertical" ) {
13392
- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
13393
- }
13394
- if ( oRange === "max" && this.orientation === "vertical" ) {
13395
- this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
13396
- }
13397
- }
13398
- },
13399
-
13400
- _handleEvents: {
13401
- keydown: function( event ) {
13402
- var allowed, curVal, newVal, step,
13403
- index = $( event.target ).data( "ui-slider-handle-index" );
13404
-
13405
- switch ( event.keyCode ) {
13406
- case $.ui.keyCode.HOME:
13407
- case $.ui.keyCode.END:
13408
- case $.ui.keyCode.PAGE_UP:
13409
- case $.ui.keyCode.PAGE_DOWN:
13410
- case $.ui.keyCode.UP:
13411
- case $.ui.keyCode.RIGHT:
13412
- case $.ui.keyCode.DOWN:
13413
- case $.ui.keyCode.LEFT:
13414
- event.preventDefault();
13415
- if ( !this._keySliding ) {
13416
- this._keySliding = true;
13417
- $( event.target ).addClass( "ui-state-active" );
13418
- allowed = this._start( event, index );
13419
- if ( allowed === false ) {
13420
- return;
13421
- }
13422
- }
13423
- break;
13424
- }
13425
-
13426
- step = this.options.step;
13427
- if ( this.options.values && this.options.values.length ) {
13428
- curVal = newVal = this.values( index );
13429
- } else {
13430
- curVal = newVal = this.value();
13431
- }
13432
-
13433
- switch ( event.keyCode ) {
13434
- case $.ui.keyCode.HOME:
13435
- newVal = this._valueMin();
13436
- break;
13437
- case $.ui.keyCode.END:
13438
- newVal = this._valueMax();
13439
- break;
13440
- case $.ui.keyCode.PAGE_UP:
13441
- newVal = this._trimAlignValue(
13442
- curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
13443
- );
13444
- break;
13445
- case $.ui.keyCode.PAGE_DOWN:
13446
- newVal = this._trimAlignValue(
13447
- curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
13448
- break;
13449
- case $.ui.keyCode.UP:
13450
- case $.ui.keyCode.RIGHT:
13451
- if ( curVal === this._valueMax() ) {
13452
- return;
13453
- }
13454
- newVal = this._trimAlignValue( curVal + step );
13455
- break;
13456
- case $.ui.keyCode.DOWN:
13457
- case $.ui.keyCode.LEFT:
13458
- if ( curVal === this._valueMin() ) {
13459
- return;
13460
- }
13461
- newVal = this._trimAlignValue( curVal - step );
13462
- break;
13463
- }
13464
-
13465
- this._slide( event, index, newVal );
13466
- },
13467
- keyup: function( event ) {
13468
- var index = $( event.target ).data( "ui-slider-handle-index" );
13469
-
13470
- if ( this._keySliding ) {
13471
- this._keySliding = false;
13472
- this._stop( event, index );
13473
- this._change( event, index );
13474
- $( event.target ).removeClass( "ui-state-active" );
13475
- }
13476
- }
13477
- }
13478
- });
13479
-
13480
-
13481
- /*!
13482
- * jQuery UI Sortable 1.11.2
13483
- * http://jqueryui.com
13484
- *
13485
- * Copyright 2014 jQuery Foundation and other contributors
13486
- * Released under the MIT license.
13487
- * http://jquery.org/license
13488
- *
13489
- * http://api.jqueryui.com/sortable/
13490
- */
13491
-
13492
-
13493
- var sortable = $.widget("ui.sortable", $.ui.mouse, {
13494
- version: "1.11.2",
13495
- widgetEventPrefix: "sort",
13496
- ready: false,
13497
- options: {
13498
- appendTo: "parent",
13499
- axis: false,
13500
- connectWith: false,
13501
- containment: false,
13502
- cursor: "auto",
13503
- cursorAt: false,
13504
- dropOnEmpty: true,
13505
- forcePlaceholderSize: false,
13506
- forceHelperSize: false,
13507
- grid: false,
13508
- handle: false,
13509
- helper: "original",
13510
- items: "> *",
13511
- opacity: false,
13512
- placeholder: false,
13513
- revert: false,
13514
- scroll: true,
13515
- scrollSensitivity: 20,
13516
- scrollSpeed: 20,
13517
- scope: "default",
13518
- tolerance: "intersect",
13519
- zIndex: 1000,
13520
-
13521
- // callbacks
13522
- activate: null,
13523
- beforeStop: null,
13524
- change: null,
13525
- deactivate: null,
13526
- out: null,
13527
- over: null,
13528
- receive: null,
13529
- remove: null,
13530
- sort: null,
13531
- start: null,
13532
- stop: null,
13533
- update: null
13534
- },
13535
-
13536
- _isOverAxis: function( x, reference, size ) {
13537
- return ( x >= reference ) && ( x < ( reference + size ) );
13538
- },
13539
-
13540
- _isFloating: function( item ) {
13541
- return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
13542
- },
13543
-
13544
- _create: function() {
13545
-
13546
- var o = this.options;
13547
- this.containerCache = {};
13548
- this.element.addClass("ui-sortable");
13549
-
13550
- //Get the items
13551
- this.refresh();
13552
-
13553
- //Let's determine if the items are being displayed horizontally
13554
- this.floating = this.items.length ? o.axis === "x" || this._isFloating(this.items[0].item) : false;
13555
-
13556
- //Let's determine the parent's offset
13557
- this.offset = this.element.offset();
13558
-
13559
- //Initialize mouse events for interaction
13560
- this._mouseInit();
13561
-
13562
- this._setHandleClassName();
13563
-
13564
- //We're ready to go
13565
- this.ready = true;
13566
-
13567
- },
13568
-
13569
- _setOption: function( key, value ) {
13570
- this._super( key, value );
13571
-
13572
- if ( key === "handle" ) {
13573
- this._setHandleClassName();
13574
- }
13575
- },
13576
-
13577
- _setHandleClassName: function() {
13578
- this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
13579
- $.each( this.items, function() {
13580
- ( this.instance.options.handle ?
13581
- this.item.find( this.instance.options.handle ) : this.item )
13582
- .addClass( "ui-sortable-handle" );
13583
- });
13584
- },
13585
-
13586
- _destroy: function() {
13587
- this.element
13588
- .removeClass( "ui-sortable ui-sortable-disabled" )
13589
- .find( ".ui-sortable-handle" )
13590
- .removeClass( "ui-sortable-handle" );
13591
- this._mouseDestroy();
13592
-
13593
- for ( var i = this.items.length - 1; i >= 0; i-- ) {
13594
- this.items[i].item.removeData(this.widgetName + "-item");
13595
- }
13596
-
13597
- return this;
13598
- },
13599
-
13600
- _mouseCapture: function(event, overrideHandle) {
13601
- var currentItem = null,
13602
- validHandle = false,
13603
- that = this;
13604
-
13605
- if (this.reverting) {
13606
- return false;
13607
- }
13608
-
13609
- if(this.options.disabled || this.options.type === "static") {
13610
- return false;
13611
- }
13612
-
13613
- //We have to refresh the items data once first
13614
- this._refreshItems(event);
13615
-
13616
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
13617
- $(event.target).parents().each(function() {
13618
- if($.data(this, that.widgetName + "-item") === that) {
13619
- currentItem = $(this);
13620
- return false;
13621
- }
13622
- });
13623
- if($.data(event.target, that.widgetName + "-item") === that) {
13624
- currentItem = $(event.target);
13625
- }
13626
-
13627
- if(!currentItem) {
13628
- return false;
13629
- }
13630
- if(this.options.handle && !overrideHandle) {
13631
- $(this.options.handle, currentItem).find("*").addBack().each(function() {
13632
- if(this === event.target) {
13633
- validHandle = true;
13634
- }
13635
- });
13636
- if(!validHandle) {
13637
- return false;
13638
- }
13639
- }
13640
-
13641
- this.currentItem = currentItem;
13642
- this._removeCurrentsFromItems();
13643
- return true;
13644
-
13645
- },
13646
-
13647
- _mouseStart: function(event, overrideHandle, noActivation) {
13648
-
13649
- var i, body,
13650
- o = this.options;
13651
-
13652
- this.currentContainer = this;
13653
-
13654
- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
13655
- this.refreshPositions();
13656
-
13657
- //Create and append the visible helper
13658
- this.helper = this._createHelper(event);
13659
-
13660
- //Cache the helper size
13661
- this._cacheHelperProportions();
13662
-
13663
- /*
13664
- * - Position generation -
13665
- * This block generates everything position related - it's the core of draggables.
13666
- */
13667
-
13668
- //Cache the margins of the original element
13669
- this._cacheMargins();
13670
-
13671
- //Get the next scrolling parent
13672
- this.scrollParent = this.helper.scrollParent();
13673
-
13674
- //The element's absolute position on the page minus margins
13675
- this.offset = this.currentItem.offset();
13676
- this.offset = {
13677
- top: this.offset.top - this.margins.top,
13678
- left: this.offset.left - this.margins.left
13679
- };
13680
-
13681
- $.extend(this.offset, {
13682
- click: { //Where the click happened, relative to the element
13683
- left: event.pageX - this.offset.left,
13684
- top: event.pageY - this.offset.top
13685
- },
13686
- parent: this._getParentOffset(),
13687
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
13688
- });
13689
-
13690
- // Only after we got the offset, we can change the helper's position to absolute
13691
- // TODO: Still need to figure out a way to make relative sorting possible
13692
- this.helper.css("position", "absolute");
13693
- this.cssPosition = this.helper.css("position");
13694
-
13695
- //Generate the original position
13696
- this.originalPosition = this._generatePosition(event);
13697
- this.originalPageX = event.pageX;
13698
- this.originalPageY = event.pageY;
13699
-
13700
- //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
13701
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
13702
-
13703
- //Cache the former DOM position
13704
- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
13705
-
13706
- //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
13707
- if(this.helper[0] !== this.currentItem[0]) {
13708
- this.currentItem.hide();
13709
- }
13710
-
13711
- //Create the placeholder
13712
- this._createPlaceholder();
13713
-
13714
- //Set a containment if given in the options
13715
- if(o.containment) {
13716
- this._setContainment();
13717
- }
13718
-
13719
- if( o.cursor && o.cursor !== "auto" ) { // cursor option
13720
- body = this.document.find( "body" );
13721
-
13722
- // support: IE
13723
- this.storedCursor = body.css( "cursor" );
13724
- body.css( "cursor", o.cursor );
13725
-
13726
- this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
13727
- }
13728
-
13729
- if(o.opacity) { // opacity option
13730
- if (this.helper.css("opacity")) {
13731
- this._storedOpacity = this.helper.css("opacity");
13732
- }
13733
- this.helper.css("opacity", o.opacity);
13734
- }
13735
-
13736
- if(o.zIndex) { // zIndex option
13737
- if (this.helper.css("zIndex")) {
13738
- this._storedZIndex = this.helper.css("zIndex");
13739
- }
13740
- this.helper.css("zIndex", o.zIndex);
13741
- }
13742
-
13743
- //Prepare scrolling
13744
- if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
13745
- this.overflowOffset = this.scrollParent.offset();
13746
- }
13747
-
13748
- //Call callbacks
13749
- this._trigger("start", event, this._uiHash());
13750
-
13751
- //Recache the helper size
13752
- if(!this._preserveHelperProportions) {
13753
- this._cacheHelperProportions();
13754
- }
13755
-
13756
-
13757
- //Post "activate" events to possible containers
13758
- if( !noActivation ) {
13759
- for ( i = this.containers.length - 1; i >= 0; i-- ) {
13760
- this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
13761
- }
13762
- }
13763
-
13764
- //Prepare possible droppables
13765
- if($.ui.ddmanager) {
13766
- $.ui.ddmanager.current = this;
13767
- }
13768
-
13769
- if ($.ui.ddmanager && !o.dropBehaviour) {
13770
- $.ui.ddmanager.prepareOffsets(this, event);
13771
- }
13772
-
13773
- this.dragging = true;
13774
-
13775
- this.helper.addClass("ui-sortable-helper");
13776
- this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
13777
- return true;
13778
-
13779
- },
13780
-
13781
- _mouseDrag: function(event) {
13782
- var i, item, itemElement, intersection,
13783
- o = this.options,
13784
- scrolled = false;
13785
-
13786
- //Compute the helpers position
13787
- this.position = this._generatePosition(event);
13788
- this.positionAbs = this._convertPositionTo("absolute");
13789
-
13790
- if (!this.lastPositionAbs) {
13791
- this.lastPositionAbs = this.positionAbs;
13792
- }
13793
-
13794
- //Do scrolling
13795
- if(this.options.scroll) {
13796
- if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
13797
-
13798
- if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
13799
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
13800
- } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
13801
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
13802
- }
13803
-
13804
- if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
13805
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
13806
- } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
13807
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
13808
- }
13809
-
13810
- } else {
13811
-
13812
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
13813
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
13814
- } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
13815
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
13816
- }
13817
-
13818
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
13819
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
13820
- } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
13821
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
13822
- }
13823
-
13824
- }
13825
-
13826
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
13827
- $.ui.ddmanager.prepareOffsets(this, event);
13828
- }
13829
- }
13830
-
13831
- //Regenerate the absolute position used for position checks
13832
- this.positionAbs = this._convertPositionTo("absolute");
13833
-
13834
- //Set the helper position
13835
- if(!this.options.axis || this.options.axis !== "y") {
13836
- this.helper[0].style.left = this.position.left+"px";
13837
- }
13838
- if(!this.options.axis || this.options.axis !== "x") {
13839
- this.helper[0].style.top = this.position.top+"px";
13840
- }
13841
-
13842
- //Rearrange
13843
- for (i = this.items.length - 1; i >= 0; i--) {
13844
-
13845
- //Cache variables and intersection, continue if no intersection
13846
- item = this.items[i];
13847
- itemElement = item.item[0];
13848
- intersection = this._intersectsWithPointer(item);
13849
- if (!intersection) {
13850
- continue;
13851
- }
13852
-
13853
- // Only put the placeholder inside the current Container, skip all
13854
- // items from other containers. This works because when moving
13855
- // an item from one container to another the
13856
- // currentContainer is switched before the placeholder is moved.
13857
- //
13858
- // Without this, moving items in "sub-sortables" can cause
13859
- // the placeholder to jitter between the outer and inner container.
13860
- if (item.instance !== this.currentContainer) {
13861
- continue;
13862
- }
13863
-
13864
- // cannot intersect with itself
13865
- // no useless actions that have been done before
13866
- // no action if the item moved is the parent of the item checked
13867
- if (itemElement !== this.currentItem[0] &&
13868
- this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
13869
- !$.contains(this.placeholder[0], itemElement) &&
13870
- (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
13871
- ) {
13872
-
13873
- this.direction = intersection === 1 ? "down" : "up";
13874
-
13875
- if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
13876
- this._rearrange(event, item);
13877
- } else {
13878
- break;
13879
- }
13880
-
13881
- this._trigger("change", event, this._uiHash());
13882
- break;
13883
- }
13884
- }
13885
-
13886
- //Post events to containers
13887
- this._contactContainers(event);
13888
-
13889
- //Interconnect with droppables
13890
- if($.ui.ddmanager) {
13891
- $.ui.ddmanager.drag(this, event);
13892
- }
13893
-
13894
- //Call callbacks
13895
- this._trigger("sort", event, this._uiHash());
13896
-
13897
- this.lastPositionAbs = this.positionAbs;
13898
- return false;
13899
-
13900
- },
13901
-
13902
- _mouseStop: function(event, noPropagation) {
13903
-
13904
- if(!event) {
13905
- return;
13906
- }
13907
-
13908
- //If we are using droppables, inform the manager about the drop
13909
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
13910
- $.ui.ddmanager.drop(this, event);
13911
- }
13912
-
13913
- if(this.options.revert) {
13914
- var that = this,
13915
- cur = this.placeholder.offset(),
13916
- axis = this.options.axis,
13917
- animation = {};
13918
-
13919
- if ( !axis || axis === "x" ) {
13920
- animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
13921
- }
13922
- if ( !axis || axis === "y" ) {
13923
- animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
13924
- }
13925
- this.reverting = true;
13926
- $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
13927
- that._clear(event);
13928
- });
13929
- } else {
13930
- this._clear(event, noPropagation);
13931
- }
13932
-
13933
- return false;
13934
-
13935
- },
13936
-
13937
- cancel: function() {
13938
-
13939
- if(this.dragging) {
13940
-
13941
- this._mouseUp({ target: null });
13942
-
13943
- if(this.options.helper === "original") {
13944
- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
13945
- } else {
13946
- this.currentItem.show();
13947
- }
13948
-
13949
- //Post deactivating events to containers
13950
- for (var i = this.containers.length - 1; i >= 0; i--){
13951
- this.containers[i]._trigger("deactivate", null, this._uiHash(this));
13952
- if(this.containers[i].containerCache.over) {
13953
- this.containers[i]._trigger("out", null, this._uiHash(this));
13954
- this.containers[i].containerCache.over = 0;
13955
- }
13956
- }
13957
-
13958
- }
13959
-
13960
- if (this.placeholder) {
13961
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
13962
- if(this.placeholder[0].parentNode) {
13963
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
13964
- }
13965
- if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
13966
- this.helper.remove();
13967
- }
13968
-
13969
- $.extend(this, {
13970
- helper: null,
13971
- dragging: false,
13972
- reverting: false,
13973
- _noFinalSort: null
13974
- });
13975
-
13976
- if(this.domPosition.prev) {
13977
- $(this.domPosition.prev).after(this.currentItem);
13978
- } else {
13979
- $(this.domPosition.parent).prepend(this.currentItem);
13980
- }
13981
- }
13982
-
13983
- return this;
13984
-
13985
- },
13986
-
13987
- serialize: function(o) {
13988
-
13989
- var items = this._getItemsAsjQuery(o && o.connected),
13990
- str = [];
13991
- o = o || {};
13992
-
13993
- $(items).each(function() {
13994
- var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
13995
- if (res) {
13996
- str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
13997
- }
13998
- });
13999
-
14000
- if(!str.length && o.key) {
14001
- str.push(o.key + "=");
14002
- }
14003
-
14004
- return str.join("&");
14005
-
14006
- },
14007
-
14008
- toArray: function(o) {
14009
-
14010
- var items = this._getItemsAsjQuery(o && o.connected),
14011
- ret = [];
14012
-
14013
- o = o || {};
14014
-
14015
- items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
14016
- return ret;
14017
-
14018
- },
14019
-
14020
- /* Be careful with the following core functions */
14021
- _intersectsWith: function(item) {
14022
-
14023
- var x1 = this.positionAbs.left,
14024
- x2 = x1 + this.helperProportions.width,
14025
- y1 = this.positionAbs.top,
14026
- y2 = y1 + this.helperProportions.height,
14027
- l = item.left,
14028
- r = l + item.width,
14029
- t = item.top,
14030
- b = t + item.height,
14031
- dyClick = this.offset.click.top,
14032
- dxClick = this.offset.click.left,
14033
- isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
14034
- isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
14035
- isOverElement = isOverElementHeight && isOverElementWidth;
14036
-
14037
- if ( this.options.tolerance === "pointer" ||
14038
- this.options.forcePointerForContainers ||
14039
- (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
14040
- ) {
14041
- return isOverElement;
14042
- } else {
14043
-
14044
- return (l < x1 + (this.helperProportions.width / 2) && // Right Half
14045
- x2 - (this.helperProportions.width / 2) < r && // Left Half
14046
- t < y1 + (this.helperProportions.height / 2) && // Bottom Half
14047
- y2 - (this.helperProportions.height / 2) < b ); // Top Half
14048
-
14049
- }
14050
- },
14051
-
14052
- _intersectsWithPointer: function(item) {
14053
-
14054
- var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
14055
- isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
14056
- isOverElement = isOverElementHeight && isOverElementWidth,
14057
- verticalDirection = this._getDragVerticalDirection(),
14058
- horizontalDirection = this._getDragHorizontalDirection();
14059
-
14060
- if (!isOverElement) {
14061
- return false;
14062
- }
14063
-
14064
- return this.floating ?
14065
- ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
14066
- : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
14067
-
14068
- },
14069
-
14070
- _intersectsWithSides: function(item) {
14071
-
14072
- var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
14073
- isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
14074
- verticalDirection = this._getDragVerticalDirection(),
14075
- horizontalDirection = this._getDragHorizontalDirection();
14076
-
14077
- if (this.floating && horizontalDirection) {
14078
- return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
14079
- } else {
14080
- return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
14081
- }
14082
-
14083
- },
14084
-
14085
- _getDragVerticalDirection: function() {
14086
- var delta = this.positionAbs.top - this.lastPositionAbs.top;
14087
- return delta !== 0 && (delta > 0 ? "down" : "up");
14088
- },
14089
-
14090
- _getDragHorizontalDirection: function() {
14091
- var delta = this.positionAbs.left - this.lastPositionAbs.left;
14092
- return delta !== 0 && (delta > 0 ? "right" : "left");
14093
- },
14094
-
14095
- refresh: function(event) {
14096
- this._refreshItems(event);
14097
- this._setHandleClassName();
14098
- this.refreshPositions();
14099
- return this;
14100
- },
14101
-
14102
- _connectWith: function() {
14103
- var options = this.options;
14104
- return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
14105
- },
14106
-
14107
- _getItemsAsjQuery: function(connected) {
14108
-
14109
- var i, j, cur, inst,
14110
- items = [],
14111
- queries = [],
14112
- connectWith = this._connectWith();
14113
-
14114
- if(connectWith && connected) {
14115
- for (i = connectWith.length - 1; i >= 0; i--){
14116
- cur = $(connectWith[i]);
14117
- for ( j = cur.length - 1; j >= 0; j--){
14118
- inst = $.data(cur[j], this.widgetFullName);
14119
- if(inst && inst !== this && !inst.options.disabled) {
14120
- 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]);
14121
- }
14122
- }
14123
- }
14124
- }
14125
-
14126
- 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]);
14127
-
14128
- function addItems() {
14129
- items.push( this );
14130
- }
14131
- for (i = queries.length - 1; i >= 0; i--){
14132
- queries[i][0].each( addItems );
14133
- }
14134
-
14135
- return $(items);
14136
-
14137
- },
14138
-
14139
- _removeCurrentsFromItems: function() {
14140
-
14141
- var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
14142
-
14143
- this.items = $.grep(this.items, function (item) {
14144
- for (var j=0; j < list.length; j++) {
14145
- if(list[j] === item.item[0]) {
14146
- return false;
14147
- }
14148
- }
14149
- return true;
14150
- });
14151
-
14152
- },
14153
-
14154
- _refreshItems: function(event) {
14155
-
14156
- this.items = [];
14157
- this.containers = [this];
14158
-
14159
- var i, j, cur, inst, targetData, _queries, item, queriesLength,
14160
- items = this.items,
14161
- queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
14162
- connectWith = this._connectWith();
14163
-
14164
- if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
14165
- for (i = connectWith.length - 1; i >= 0; i--){
14166
- cur = $(connectWith[i]);
14167
- for (j = cur.length - 1; j >= 0; j--){
14168
- inst = $.data(cur[j], this.widgetFullName);
14169
- if(inst && inst !== this && !inst.options.disabled) {
14170
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
14171
- this.containers.push(inst);
14172
- }
14173
- }
14174
- }
14175
- }
14176
-
14177
- for (i = queries.length - 1; i >= 0; i--) {
14178
- targetData = queries[i][1];
14179
- _queries = queries[i][0];
14180
-
14181
- for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
14182
- item = $(_queries[j]);
14183
-
14184
- item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
14185
-
14186
- items.push({
14187
- item: item,
14188
- instance: targetData,
14189
- width: 0, height: 0,
14190
- left: 0, top: 0
14191
- });
14192
- }
14193
- }
14194
-
14195
- },
14196
-
14197
- refreshPositions: function(fast) {
14198
-
14199
- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
14200
- if(this.offsetParent && this.helper) {
14201
- this.offset.parent = this._getParentOffset();
14202
- }
14203
-
14204
- var i, item, t, p;
14205
-
14206
- for (i = this.items.length - 1; i >= 0; i--){
14207
- item = this.items[i];
14208
-
14209
- //We ignore calculating positions of all connected containers when we're not over them
14210
- if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
14211
- continue;
14212
- }
14213
-
14214
- t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
14215
-
14216
- if (!fast) {
14217
- item.width = t.outerWidth();
14218
- item.height = t.outerHeight();
14219
- }
14220
-
14221
- p = t.offset();
14222
- item.left = p.left;
14223
- item.top = p.top;
14224
- }
14225
-
14226
- if(this.options.custom && this.options.custom.refreshContainers) {
14227
- this.options.custom.refreshContainers.call(this);
14228
- } else {
14229
- for (i = this.containers.length - 1; i >= 0; i--){
14230
- p = this.containers[i].element.offset();
14231
- this.containers[i].containerCache.left = p.left;
14232
- this.containers[i].containerCache.top = p.top;
14233
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
14234
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
14235
- }
14236
- }
14237
-
14238
- return this;
14239
- },
14240
-
14241
- _createPlaceholder: function(that) {
14242
- that = that || this;
14243
- var className,
14244
- o = that.options;
14245
-
14246
- if(!o.placeholder || o.placeholder.constructor === String) {
14247
- className = o.placeholder;
14248
- o.placeholder = {
14249
- element: function() {
14250
-
14251
- var nodeName = that.currentItem[0].nodeName.toLowerCase(),
14252
- element = $( "<" + nodeName + ">", that.document[0] )
14253
- .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
14254
- .removeClass("ui-sortable-helper");
14255
-
14256
- if ( nodeName === "tr" ) {
14257
- that.currentItem.children().each(function() {
14258
- $( "<td>&#160;</td>", that.document[0] )
14259
- .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
14260
- .appendTo( element );
14261
- });
14262
- } else if ( nodeName === "img" ) {
14263
- element.attr( "src", that.currentItem.attr( "src" ) );
14264
- }
14265
-
14266
- if ( !className ) {
14267
- element.css( "visibility", "hidden" );
14268
- }
14269
-
14270
- return element;
14271
- },
14272
- update: function(container, p) {
14273
-
14274
- // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
14275
- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
14276
- if(className && !o.forcePlaceholderSize) {
14277
- return;
14278
- }
14279
-
14280
- //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
14281
- if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
14282
- if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
14283
- }
14284
- };
14285
- }
14286
-
14287
- //Create the placeholder
14288
- that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
14289
-
14290
- //Append it after the actual current item
14291
- that.currentItem.after(that.placeholder);
14292
-
14293
- //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
14294
- o.placeholder.update(that, that.placeholder);
14295
-
14296
- },
14297
-
14298
- _contactContainers: function(event) {
14299
- var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
14300
- innermostContainer = null,
14301
- innermostIndex = null;
14302
-
14303
- // get innermost container that intersects with item
14304
- for (i = this.containers.length - 1; i >= 0; i--) {
14305
-
14306
- // never consider a container that's located within the item itself
14307
- if($.contains(this.currentItem[0], this.containers[i].element[0])) {
14308
- continue;
14309
- }
14310
-
14311
- if(this._intersectsWith(this.containers[i].containerCache)) {
14312
-
14313
- // if we've already found a container and it's more "inner" than this, then continue
14314
- if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
14315
- continue;
14316
- }
14317
-
14318
- innermostContainer = this.containers[i];
14319
- innermostIndex = i;
14320
-
14321
- } else {
14322
- // container doesn't intersect. trigger "out" event if necessary
14323
- if(this.containers[i].containerCache.over) {
14324
- this.containers[i]._trigger("out", event, this._uiHash(this));
14325
- this.containers[i].containerCache.over = 0;
14326
- }
14327
- }
14328
-
14329
- }
14330
-
14331
- // if no intersecting containers found, return
14332
- if(!innermostContainer) {
14333
- return;
14334
- }
14335
-
14336
- // move the item into the container if it's not there already
14337
- if(this.containers.length === 1) {
14338
- if (!this.containers[innermostIndex].containerCache.over) {
14339
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
14340
- this.containers[innermostIndex].containerCache.over = 1;
14341
- }
14342
- } else {
14343
-
14344
- //When entering a new container, we will find the item with the least distance and append our item near it
14345
- dist = 10000;
14346
- itemWithLeastDistance = null;
14347
- floating = innermostContainer.floating || this._isFloating(this.currentItem);
14348
- posProperty = floating ? "left" : "top";
14349
- sizeProperty = floating ? "width" : "height";
14350
- axis = floating ? "clientX" : "clientY";
14351
-
14352
- for (j = this.items.length - 1; j >= 0; j--) {
14353
- if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
14354
- continue;
14355
- }
14356
- if(this.items[j].item[0] === this.currentItem[0]) {
14357
- continue;
14358
- }
14359
-
14360
- cur = this.items[j].item.offset()[posProperty];
14361
- nearBottom = false;
14362
- if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
14363
- nearBottom = true;
14364
- }
14365
-
14366
- if ( Math.abs( event[ axis ] - cur ) < dist ) {
14367
- dist = Math.abs( event[ axis ] - cur );
14368
- itemWithLeastDistance = this.items[ j ];
14369
- this.direction = nearBottom ? "up": "down";
14370
- }
14371
- }
14372
-
14373
- //Check if dropOnEmpty is enabled
14374
- if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
14375
- return;
14376
- }
14377
-
14378
- if(this.currentContainer === this.containers[innermostIndex]) {
14379
- if ( !this.currentContainer.containerCache.over ) {
14380
- this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
14381
- this.currentContainer.containerCache.over = 1;
14382
- }
14383
- return;
14384
- }
14385
-
14386
- itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
14387
- this._trigger("change", event, this._uiHash());
14388
- this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
14389
- this.currentContainer = this.containers[innermostIndex];
14390
-
14391
- //Update the placeholder
14392
- this.options.placeholder.update(this.currentContainer, this.placeholder);
14393
-
14394
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
14395
- this.containers[innermostIndex].containerCache.over = 1;
14396
- }
14397
-
14398
-
14399
- },
14400
-
14401
- _createHelper: function(event) {
14402
-
14403
- var o = this.options,
14404
- helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
14405
-
14406
- //Add the helper to the DOM if that didn't happen already
14407
- if(!helper.parents("body").length) {
14408
- $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
14409
- }
14410
-
14411
- if(helper[0] === this.currentItem[0]) {
14412
- 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") };
14413
- }
14414
-
14415
- if(!helper[0].style.width || o.forceHelperSize) {
14416
- helper.width(this.currentItem.width());
14417
- }
14418
- if(!helper[0].style.height || o.forceHelperSize) {
14419
- helper.height(this.currentItem.height());
14420
- }
14421
-
14422
- return helper;
14423
-
14424
- },
14425
-
14426
- _adjustOffsetFromHelper: function(obj) {
14427
- if (typeof obj === "string") {
14428
- obj = obj.split(" ");
14429
- }
14430
- if ($.isArray(obj)) {
14431
- obj = {left: +obj[0], top: +obj[1] || 0};
14432
- }
14433
- if ("left" in obj) {
14434
- this.offset.click.left = obj.left + this.margins.left;
14435
- }
14436
- if ("right" in obj) {
14437
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
14438
- }
14439
- if ("top" in obj) {
14440
- this.offset.click.top = obj.top + this.margins.top;
14441
- }
14442
- if ("bottom" in obj) {
14443
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
14444
- }
14445
- },
14446
-
14447
- _getParentOffset: function() {
14448
-
14449
-
14450
- //Get the offsetParent and cache its position
14451
- this.offsetParent = this.helper.offsetParent();
14452
- var po = this.offsetParent.offset();
14453
-
14454
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
14455
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
14456
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
14457
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
14458
- if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
14459
- po.left += this.scrollParent.scrollLeft();
14460
- po.top += this.scrollParent.scrollTop();
14461
- }
14462
-
14463
- // This needs to be actually done for all browsers, since pageX/pageY includes this information
14464
- // with an ugly IE fix
14465
- if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
14466
- po = { top: 0, left: 0 };
14467
- }
14468
-
14469
- return {
14470
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
14471
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
14472
- };
14473
-
14474
- },
14475
-
14476
- _getRelativeOffset: function() {
14477
-
14478
- if(this.cssPosition === "relative") {
14479
- var p = this.currentItem.position();
14480
- return {
14481
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
14482
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
14483
- };
14484
- } else {
14485
- return { top: 0, left: 0 };
14486
- }
14487
-
14488
- },
14489
-
14490
- _cacheMargins: function() {
14491
- this.margins = {
14492
- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
14493
- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
14494
- };
14495
- },
14496
-
14497
- _cacheHelperProportions: function() {
14498
- this.helperProportions = {
14499
- width: this.helper.outerWidth(),
14500
- height: this.helper.outerHeight()
14501
- };
14502
- },
14503
-
14504
- _setContainment: function() {
14505
-
14506
- var ce, co, over,
14507
- o = this.options;
14508
- if(o.containment === "parent") {
14509
- o.containment = this.helper[0].parentNode;
14510
- }
14511
- if(o.containment === "document" || o.containment === "window") {
14512
- this.containment = [
14513
- 0 - this.offset.relative.left - this.offset.parent.left,
14514
- 0 - this.offset.relative.top - this.offset.parent.top,
14515
- $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,
14516
- ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
14517
- ];
14518
- }
14519
-
14520
- if(!(/^(document|window|parent)$/).test(o.containment)) {
14521
- ce = $(o.containment)[0];
14522
- co = $(o.containment).offset();
14523
- over = ($(ce).css("overflow") !== "hidden");
14524
-
14525
- this.containment = [
14526
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
14527
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
14528
- 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,
14529
- 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
14530
- ];
14531
- }
14532
-
14533
- },
14534
-
14535
- _convertPositionTo: function(d, pos) {
14536
-
14537
- if(!pos) {
14538
- pos = this.position;
14539
- }
14540
- var mod = d === "absolute" ? 1 : -1,
14541
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
14542
- scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
14543
-
14544
- return {
14545
- top: (
14546
- pos.top + // The absolute mouse position
14547
- this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
14548
- this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
14549
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
14550
- ),
14551
- left: (
14552
- pos.left + // The absolute mouse position
14553
- this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
14554
- this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
14555
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
14556
- )
14557
- };
14558
-
14559
- },
14560
-
14561
- _generatePosition: function(event) {
14562
-
14563
- var top, left,
14564
- o = this.options,
14565
- pageX = event.pageX,
14566
- pageY = event.pageY,
14567
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
14568
-
14569
- // This is another very weird special case that only happens for relative elements:
14570
- // 1. If the css position is relative
14571
- // 2. and the scroll parent is the document or similar to the offset parent
14572
- // we have to refresh the relative offset during the scroll so there are no jumps
14573
- if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {
14574
- this.offset.relative = this._getRelativeOffset();
14575
- }
14576
-
14577
- /*
14578
- * - Position constraining -
14579
- * Constrain the position to a mix of grid, containment.
14580
- */
14581
-
14582
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
14583
-
14584
- if(this.containment) {
14585
- if(event.pageX - this.offset.click.left < this.containment[0]) {
14586
- pageX = this.containment[0] + this.offset.click.left;
14587
- }
14588
- if(event.pageY - this.offset.click.top < this.containment[1]) {
14589
- pageY = this.containment[1] + this.offset.click.top;
14590
- }
14591
- if(event.pageX - this.offset.click.left > this.containment[2]) {
14592
- pageX = this.containment[2] + this.offset.click.left;
14593
- }
14594
- if(event.pageY - this.offset.click.top > this.containment[3]) {
14595
- pageY = this.containment[3] + this.offset.click.top;
14596
- }
14597
- }
14598
-
14599
- if(o.grid) {
14600
- top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
14601
- 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;
14602
-
14603
- left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
14604
- 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;
14605
- }
14606
-
14607
- }
14608
-
14609
- return {
14610
- top: (
14611
- pageY - // The absolute mouse position
14612
- this.offset.click.top - // Click offset (relative to the element)
14613
- this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
14614
- this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
14615
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
14616
- ),
14617
- left: (
14618
- pageX - // The absolute mouse position
14619
- this.offset.click.left - // Click offset (relative to the element)
14620
- this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
14621
- this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
14622
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
14623
- )
14624
- };
14625
-
14626
- },
14627
-
14628
- _rearrange: function(event, i, a, hardRefresh) {
14629
-
14630
- 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));
14631
-
14632
- //Various things done here to improve the performance:
14633
- // 1. we create a setTimeout, that calls refreshPositions
14634
- // 2. on the instance, we have a counter variable, that get's higher after every append
14635
- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
14636
- // 4. this lets only the last addition to the timeout stack through
14637
- this.counter = this.counter ? ++this.counter : 1;
14638
- var counter = this.counter;
14639
-
14640
- this._delay(function() {
14641
- if(counter === this.counter) {
14642
- this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
14643
- }
14644
- });
14645
-
14646
- },
14647
-
14648
- _clear: function(event, noPropagation) {
14649
-
14650
- this.reverting = false;
14651
- // We delay all events that have to be triggered to after the point where the placeholder has been removed and
14652
- // everything else normalized again
14653
- var i,
14654
- delayedTriggers = [];
14655
-
14656
- // We first have to update the dom position of the actual currentItem
14657
- // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
14658
- if(!this._noFinalSort && this.currentItem.parent().length) {
14659
- this.placeholder.before(this.currentItem);
14660
- }
14661
- this._noFinalSort = null;
14662
-
14663
- if(this.helper[0] === this.currentItem[0]) {
14664
- for(i in this._storedCSS) {
14665
- if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
14666
- this._storedCSS[i] = "";
14667
- }
14668
- }
14669
- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
14670
- } else {
14671
- this.currentItem.show();
14672
- }
14673
-
14674
- if(this.fromOutside && !noPropagation) {
14675
- delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
14676
- }
14677
- if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
14678
- delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
14679
- }
14680
-
14681
- // Check if the items Container has Changed and trigger appropriate
14682
- // events.
14683
- if (this !== this.currentContainer) {
14684
- if(!noPropagation) {
14685
- delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
14686
- delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
14687
- delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
14688
- }
14689
- }
14690
-
14691
-
14692
- //Post events to containers
14693
- function delayEvent( type, instance, container ) {
14694
- return function( event ) {
14695
- container._trigger( type, event, instance._uiHash( instance ) );
14696
- };
14697
- }
14698
- for (i = this.containers.length - 1; i >= 0; i--){
14699
- if (!noPropagation) {
14700
- delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
14701
- }
14702
- if(this.containers[i].containerCache.over) {
14703
- delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
14704
- this.containers[i].containerCache.over = 0;
14705
- }
14706
- }
14707
-
14708
- //Do what was originally in plugins
14709
- if ( this.storedCursor ) {
14710
- this.document.find( "body" ).css( "cursor", this.storedCursor );
14711
- this.storedStylesheet.remove();
14712
- }
14713
- if(this._storedOpacity) {
14714
- this.helper.css("opacity", this._storedOpacity);
14715
- }
14716
- if(this._storedZIndex) {
14717
- this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
14718
- }
14719
-
14720
- this.dragging = false;
14721
-
14722
- if(!noPropagation) {
14723
- this._trigger("beforeStop", event, this._uiHash());
14724
- }
14725
-
14726
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
14727
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
14728
-
14729
- if ( !this.cancelHelperRemoval ) {
14730
- if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
14731
- this.helper.remove();
14732
- }
14733
- this.helper = null;
14734
- }
14735
-
14736
- if(!noPropagation) {
14737
- for (i=0; i < delayedTriggers.length; i++) {
14738
- delayedTriggers[i].call(this, event);
14739
- } //Trigger all delayed events
14740
- this._trigger("stop", event, this._uiHash());
14741
- }
14742
-
14743
- this.fromOutside = false;
14744
- return !this.cancelHelperRemoval;
14745
-
14746
- },
14747
-
14748
- _trigger: function() {
14749
- if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
14750
- this.cancel();
14751
- }
14752
- },
14753
-
14754
- _uiHash: function(_inst) {
14755
- var inst = _inst || this;
14756
- return {
14757
- helper: inst.helper,
14758
- placeholder: inst.placeholder || $([]),
14759
- position: inst.position,
14760
- originalPosition: inst.originalPosition,
14761
- offset: inst.positionAbs,
14762
- item: inst.currentItem,
14763
- sender: _inst ? _inst.element : null
14764
- };
14765
- }
14766
-
14767
- });
14768
-
14769
-
14770
- /*!
14771
- * jQuery UI Spinner 1.11.2
14772
- * http://jqueryui.com
14773
- *
14774
- * Copyright 2014 jQuery Foundation and other contributors
14775
- * Released under the MIT license.
14776
- * http://jquery.org/license
14777
- *
14778
- * http://api.jqueryui.com/spinner/
14779
- */
14780
-
14781
-
14782
- function spinner_modifier( fn ) {
14783
- return function() {
14784
- var previous = this.element.val();
14785
- fn.apply( this, arguments );
14786
- this._refresh();
14787
- if ( previous !== this.element.val() ) {
14788
- this._trigger( "change" );
14789
- }
14790
- };
14791
- }
14792
-
14793
- var spinner = $.widget( "ui.spinner", {
14794
- version: "1.11.2",
14795
- defaultElement: "<input>",
14796
- widgetEventPrefix: "spin",
14797
- options: {
14798
- culture: null,
14799
- icons: {
14800
- down: "ui-icon-triangle-1-s",
14801
- up: "ui-icon-triangle-1-n"
14802
- },
14803
- incremental: true,
14804
- max: null,
14805
- min: null,
14806
- numberFormat: null,
14807
- page: 10,
14808
- step: 1,
14809
-
14810
- change: null,
14811
- spin: null,
14812
- start: null,
14813
- stop: null
14814
- },
14815
-
14816
- _create: function() {
14817
- // handle string values that need to be parsed
14818
- this._setOption( "max", this.options.max );
14819
- this._setOption( "min", this.options.min );
14820
- this._setOption( "step", this.options.step );
14821
-
14822
- // Only format if there is a value, prevents the field from being marked
14823
- // as invalid in Firefox, see #9573.
14824
- if ( this.value() !== "" ) {
14825
- // Format the value, but don't constrain.
14826
- this._value( this.element.val(), true );
14827
- }
14828
-
14829
- this._draw();
14830
- this._on( this._events );
14831
- this._refresh();
14832
-
14833
- // turning off autocomplete prevents the browser from remembering the
14834
- // value when navigating through history, so we re-enable autocomplete
14835
- // if the page is unloaded before the widget is destroyed. #7790
14836
- this._on( this.window, {
14837
- beforeunload: function() {
14838
- this.element.removeAttr( "autocomplete" );
14839
- }
14840
- });
14841
- },
14842
-
14843
- _getCreateOptions: function() {
14844
- var options = {},
14845
- element = this.element;
14846
-
14847
- $.each( [ "min", "max", "step" ], function( i, option ) {
14848
- var value = element.attr( option );
14849
- if ( value !== undefined && value.length ) {
14850
- options[ option ] = value;
14851
- }
14852
- });
14853
-
14854
- return options;
14855
- },
14856
-
14857
- _events: {
14858
- keydown: function( event ) {
14859
- if ( this._start( event ) && this._keydown( event ) ) {
14860
- event.preventDefault();
14861
- }
14862
- },
14863
- keyup: "_stop",
14864
- focus: function() {
14865
- this.previous = this.element.val();
14866
- },
14867
- blur: function( event ) {
14868
- if ( this.cancelBlur ) {
14869
- delete this.cancelBlur;
14870
- return;
14871
- }
14872
-
14873
- this._stop();
14874
- this._refresh();
14875
- if ( this.previous !== this.element.val() ) {
14876
- this._trigger( "change", event );
14877
- }
14878
- },
14879
- mousewheel: function( event, delta ) {
14880
- if ( !delta ) {
14881
- return;
14882
- }
14883
- if ( !this.spinning && !this._start( event ) ) {
14884
- return false;
14885
- }
14886
-
14887
- this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
14888
- clearTimeout( this.mousewheelTimer );
14889
- this.mousewheelTimer = this._delay(function() {
14890
- if ( this.spinning ) {
14891
- this._stop( event );
14892
- }
14893
- }, 100 );
14894
- event.preventDefault();
14895
- },
14896
- "mousedown .ui-spinner-button": function( event ) {
14897
- var previous;
14898
-
14899
- // We never want the buttons to have focus; whenever the user is
14900
- // interacting with the spinner, the focus should be on the input.
14901
- // If the input is focused then this.previous is properly set from
14902
- // when the input first received focus. If the input is not focused
14903
- // then we need to set this.previous based on the value before spinning.
14904
- previous = this.element[0] === this.document[0].activeElement ?
14905
- this.previous : this.element.val();
14906
- function checkFocus() {
14907
- var isActive = this.element[0] === this.document[0].activeElement;
14908
- if ( !isActive ) {
14909
- this.element.focus();
14910
- this.previous = previous;
14911
- // support: IE
14912
- // IE sets focus asynchronously, so we need to check if focus
14913
- // moved off of the input because the user clicked on the button.
14914
- this._delay(function() {
14915
- this.previous = previous;
14916
- });
14917
- }
14918
- }
14919
-
14920
- // ensure focus is on (or stays on) the text field
14921
- event.preventDefault();
14922
- checkFocus.call( this );
14923
-
14924
- // support: IE
14925
- // IE doesn't prevent moving focus even with event.preventDefault()
14926
- // so we set a flag to know when we should ignore the blur event
14927
- // and check (again) if focus moved off of the input.
14928
- this.cancelBlur = true;
14929
- this._delay(function() {
14930
- delete this.cancelBlur;
14931
- checkFocus.call( this );
14932
- });
14933
-
14934
- if ( this._start( event ) === false ) {
14935
- return;
14936
- }
14937
-
14938
- this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14939
- },
14940
- "mouseup .ui-spinner-button": "_stop",
14941
- "mouseenter .ui-spinner-button": function( event ) {
14942
- // button will add ui-state-active if mouse was down while mouseleave and kept down
14943
- if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
14944
- return;
14945
- }
14946
-
14947
- if ( this._start( event ) === false ) {
14948
- return false;
14949
- }
14950
- this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14951
- },
14952
- // TODO: do we really want to consider this a stop?
14953
- // shouldn't we just stop the repeater and wait until mouseup before
14954
- // we trigger the stop event?
14955
- "mouseleave .ui-spinner-button": "_stop"
14956
- },
14957
-
14958
- _draw: function() {
14959
- var uiSpinner = this.uiSpinner = this.element
14960
- .addClass( "ui-spinner-input" )
14961
- .attr( "autocomplete", "off" )
14962
- .wrap( this._uiSpinnerHtml() )
14963
- .parent()
14964
- // add buttons
14965
- .append( this._buttonHtml() );
14966
-
14967
- this.element.attr( "role", "spinbutton" );
14968
-
14969
- // button bindings
14970
- this.buttons = uiSpinner.find( ".ui-spinner-button" )
14971
- .attr( "tabIndex", -1 )
14972
- .button()
14973
- .removeClass( "ui-corner-all" );
14974
-
14975
- // IE 6 doesn't understand height: 50% for the buttons
14976
- // unless the wrapper has an explicit height
14977
- if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
14978
- uiSpinner.height() > 0 ) {
14979
- uiSpinner.height( uiSpinner.height() );
14980
- }
14981
-
14982
- // disable spinner if element was already disabled
14983
- if ( this.options.disabled ) {
14984
- this.disable();
14985
- }
14986
- },
14987
-
14988
- _keydown: function( event ) {
14989
- var options = this.options,
14990
- keyCode = $.ui.keyCode;
14991
-
14992
- switch ( event.keyCode ) {
14993
- case keyCode.UP:
14994
- this._repeat( null, 1, event );
14995
- return true;
14996
- case keyCode.DOWN:
14997
- this._repeat( null, -1, event );
14998
- return true;
14999
- case keyCode.PAGE_UP:
15000
- this._repeat( null, options.page, event );
15001
- return true;
15002
- case keyCode.PAGE_DOWN:
15003
- this._repeat( null, -options.page, event );
15004
- return true;
15005
- }
15006
-
15007
- return false;
15008
- },
15009
-
15010
- _uiSpinnerHtml: function() {
15011
- return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
15012
- },
15013
-
15014
- _buttonHtml: function() {
15015
- return "" +
15016
- "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
15017
- "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
15018
- "</a>" +
15019
- "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
15020
- "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
15021
- "</a>";
15022
- },
15023
-
15024
- _start: function( event ) {
15025
- if ( !this.spinning && this._trigger( "start", event ) === false ) {
15026
- return false;
15027
- }
15028
-
15029
- if ( !this.counter ) {
15030
- this.counter = 1;
15031
- }
15032
- this.spinning = true;
15033
- return true;
15034
- },
15035
-
15036
- _repeat: function( i, steps, event ) {
15037
- i = i || 500;
15038
-
15039
- clearTimeout( this.timer );
15040
- this.timer = this._delay(function() {
15041
- this._repeat( 40, steps, event );
15042
- }, i );
15043
-
15044
- this._spin( steps * this.options.step, event );
15045
- },
15046
-
15047
- _spin: function( step, event ) {
15048
- var value = this.value() || 0;
15049
-
15050
- if ( !this.counter ) {
15051
- this.counter = 1;
15052
- }
15053
-
15054
- value = this._adjustValue( value + step * this._increment( this.counter ) );
15055
-
15056
- if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
15057
- this._value( value );
15058
- this.counter++;
15059
- }
15060
- },
15061
-
15062
- _increment: function( i ) {
15063
- var incremental = this.options.incremental;
15064
-
15065
- if ( incremental ) {
15066
- return $.isFunction( incremental ) ?
15067
- incremental( i ) :
15068
- Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
15069
- }
15070
-
15071
- return 1;
15072
- },
15073
-
15074
- _precision: function() {
15075
- var precision = this._precisionOf( this.options.step );
15076
- if ( this.options.min !== null ) {
15077
- precision = Math.max( precision, this._precisionOf( this.options.min ) );
15078
- }
15079
- return precision;
15080
- },
15081
-
15082
- _precisionOf: function( num ) {
15083
- var str = num.toString(),
15084
- decimal = str.indexOf( "." );
15085
- return decimal === -1 ? 0 : str.length - decimal - 1;
15086
- },
15087
-
15088
- _adjustValue: function( value ) {
15089
- var base, aboveMin,
15090
- options = this.options;
15091
-
15092
- // make sure we're at a valid step
15093
- // - find out where we are relative to the base (min or 0)
15094
- base = options.min !== null ? options.min : 0;
15095
- aboveMin = value - base;
15096
- // - round to the nearest step
15097
- aboveMin = Math.round(aboveMin / options.step) * options.step;
15098
- // - rounding is based on 0, so adjust back to our base
15099
- value = base + aboveMin;
15100
-
15101
- // fix precision from bad JS floating point math
15102
- value = parseFloat( value.toFixed( this._precision() ) );
15103
-
15104
- // clamp the value
15105
- if ( options.max !== null && value > options.max) {
15106
- return options.max;
15107
- }
15108
- if ( options.min !== null && value < options.min ) {
15109
- return options.min;
15110
- }
15111
-
15112
- return value;
15113
- },
15114
-
15115
- _stop: function( event ) {
15116
- if ( !this.spinning ) {
15117
- return;
15118
- }
15119
-
15120
- clearTimeout( this.timer );
15121
- clearTimeout( this.mousewheelTimer );
15122
- this.counter = 0;
15123
- this.spinning = false;
15124
- this._trigger( "stop", event );
15125
- },
15126
-
15127
- _setOption: function( key, value ) {
15128
- if ( key === "culture" || key === "numberFormat" ) {
15129
- var prevValue = this._parse( this.element.val() );
15130
- this.options[ key ] = value;
15131
- this.element.val( this._format( prevValue ) );
15132
- return;
15133
- }
15134
-
15135
- if ( key === "max" || key === "min" || key === "step" ) {
15136
- if ( typeof value === "string" ) {
15137
- value = this._parse( value );
15138
- }
15139
- }
15140
- if ( key === "icons" ) {
15141
- this.buttons.first().find( ".ui-icon" )
15142
- .removeClass( this.options.icons.up )
15143
- .addClass( value.up );
15144
- this.buttons.last().find( ".ui-icon" )
15145
- .removeClass( this.options.icons.down )
15146
- .addClass( value.down );
15147
- }
15148
-
15149
- this._super( key, value );
15150
-
15151
- if ( key === "disabled" ) {
15152
- this.widget().toggleClass( "ui-state-disabled", !!value );
15153
- this.element.prop( "disabled", !!value );
15154
- this.buttons.button( value ? "disable" : "enable" );
15155
- }
15156
- },
15157
-
15158
- _setOptions: spinner_modifier(function( options ) {
15159
- this._super( options );
15160
- }),
15161
-
15162
- _parse: function( val ) {
15163
- if ( typeof val === "string" && val !== "" ) {
15164
- val = window.Globalize && this.options.numberFormat ?
15165
- Globalize.parseFloat( val, 10, this.options.culture ) : +val;
15166
- }
15167
- return val === "" || isNaN( val ) ? null : val;
15168
- },
15169
-
15170
- _format: function( value ) {
15171
- if ( value === "" ) {
15172
- return "";
15173
- }
15174
- return window.Globalize && this.options.numberFormat ?
15175
- Globalize.format( value, this.options.numberFormat, this.options.culture ) :
15176
- value;
15177
- },
15178
-
15179
- _refresh: function() {
15180
- this.element.attr({
15181
- "aria-valuemin": this.options.min,
15182
- "aria-valuemax": this.options.max,
15183
- // TODO: what should we do with values that can't be parsed?
15184
- "aria-valuenow": this._parse( this.element.val() )
15185
- });
15186
- },
15187
-
15188
- isValid: function() {
15189
- var value = this.value();
15190
-
15191
- // null is invalid
15192
- if ( value === null ) {
15193
- return false;
15194
- }
15195
-
15196
- // if value gets adjusted, it's invalid
15197
- return value === this._adjustValue( value );
15198
- },
15199
-
15200
- // update the value without triggering change
15201
- _value: function( value, allowAny ) {
15202
- var parsed;
15203
- if ( value !== "" ) {
15204
- parsed = this._parse( value );
15205
- if ( parsed !== null ) {
15206
- if ( !allowAny ) {
15207
- parsed = this._adjustValue( parsed );
15208
- }
15209
- value = this._format( parsed );
15210
- }
15211
- }
15212
- this.element.val( value );
15213
- this._refresh();
15214
- },
15215
-
15216
- _destroy: function() {
15217
- this.element
15218
- .removeClass( "ui-spinner-input" )
15219
- .prop( "disabled", false )
15220
- .removeAttr( "autocomplete" )
15221
- .removeAttr( "role" )
15222
- .removeAttr( "aria-valuemin" )
15223
- .removeAttr( "aria-valuemax" )
15224
- .removeAttr( "aria-valuenow" );
15225
- this.uiSpinner.replaceWith( this.element );
15226
- },
15227
-
15228
- stepUp: spinner_modifier(function( steps ) {
15229
- this._stepUp( steps );
15230
- }),
15231
- _stepUp: function( steps ) {
15232
- if ( this._start() ) {
15233
- this._spin( (steps || 1) * this.options.step );
15234
- this._stop();
15235
- }
15236
- },
15237
-
15238
- stepDown: spinner_modifier(function( steps ) {
15239
- this._stepDown( steps );
15240
- }),
15241
- _stepDown: function( steps ) {
15242
- if ( this._start() ) {
15243
- this._spin( (steps || 1) * -this.options.step );
15244
- this._stop();
15245
- }
15246
- },
15247
-
15248
- pageUp: spinner_modifier(function( pages ) {
15249
- this._stepUp( (pages || 1) * this.options.page );
15250
- }),
15251
-
15252
- pageDown: spinner_modifier(function( pages ) {
15253
- this._stepDown( (pages || 1) * this.options.page );
15254
- }),
15255
-
15256
- value: function( newVal ) {
15257
- if ( !arguments.length ) {
15258
- return this._parse( this.element.val() );
15259
- }
15260
- spinner_modifier( this._value ).call( this, newVal );
15261
- },
15262
-
15263
- widget: function() {
15264
- return this.uiSpinner;
15265
- }
15266
- });
15267
-
15268
-
15269
- /*!
15270
- * jQuery UI Tabs 1.11.2
15271
- * http://jqueryui.com
15272
- *
15273
- * Copyright 2014 jQuery Foundation and other contributors
15274
- * Released under the MIT license.
15275
- * http://jquery.org/license
15276
- *
15277
- * http://api.jqueryui.com/tabs/
15278
- */
15279
-
15280
-
15281
- var tabs = $.widget( "ui.tabs", {
15282
- version: "1.11.2",
15283
- delay: 300,
15284
- options: {
15285
- active: null,
15286
- collapsible: false,
15287
- event: "click",
15288
- heightStyle: "content",
15289
- hide: null,
15290
- show: null,
15291
-
15292
- // callbacks
15293
- activate: null,
15294
- beforeActivate: null,
15295
- beforeLoad: null,
15296
- load: null
15297
- },
15298
-
15299
- _isLocal: (function() {
15300
- var rhash = /#.*$/;
15301
-
15302
- return function( anchor ) {
15303
- var anchorUrl, locationUrl;
15304
-
15305
- // support: IE7
15306
- // IE7 doesn't normalize the href property when set via script (#9317)
15307
- anchor = anchor.cloneNode( false );
15308
-
15309
- anchorUrl = anchor.href.replace( rhash, "" );
15310
- locationUrl = location.href.replace( rhash, "" );
15311
-
15312
- // decoding may throw an error if the URL isn't UTF-8 (#9518)
15313
- try {
15314
- anchorUrl = decodeURIComponent( anchorUrl );
15315
- } catch ( error ) {}
15316
- try {
15317
- locationUrl = decodeURIComponent( locationUrl );
15318
- } catch ( error ) {}
15319
-
15320
- return anchor.hash.length > 1 && anchorUrl === locationUrl;
15321
- };
15322
- })(),
15323
-
15324
- _create: function() {
15325
- var that = this,
15326
- options = this.options;
15327
-
15328
- this.running = false;
15329
-
15330
- this.element
15331
- .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
15332
- .toggleClass( "ui-tabs-collapsible", options.collapsible );
15333
-
15334
- this._processTabs();
15335
- options.active = this._initialActive();
15336
-
15337
- // Take disabling tabs via class attribute from HTML
15338
- // into account and update option properly.
15339
- if ( $.isArray( options.disabled ) ) {
15340
- options.disabled = $.unique( options.disabled.concat(
15341
- $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
15342
- return that.tabs.index( li );
15343
- })
15344
- ) ).sort();
15345
- }
15346
-
15347
- // check for length avoids error when initializing empty list
15348
- if ( this.options.active !== false && this.anchors.length ) {
15349
- this.active = this._findActive( options.active );
15350
- } else {
15351
- this.active = $();
15352
- }
15353
-
15354
- this._refresh();
15355
-
15356
- if ( this.active.length ) {
15357
- this.load( options.active );
15358
- }
15359
- },
15360
-
15361
- _initialActive: function() {
15362
- var active = this.options.active,
15363
- collapsible = this.options.collapsible,
15364
- locationHash = location.hash.substring( 1 );
15365
-
15366
- if ( active === null ) {
15367
- // check the fragment identifier in the URL
15368
- if ( locationHash ) {
15369
- this.tabs.each(function( i, tab ) {
15370
- if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
15371
- active = i;
15372
- return false;
15373
- }
15374
- });
15375
- }
15376
-
15377
- // check for a tab marked active via a class
15378
- if ( active === null ) {
15379
- active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
15380
- }
15381
-
15382
- // no active tab, set to false
15383
- if ( active === null || active === -1 ) {
15384
- active = this.tabs.length ? 0 : false;
15385
- }
15386
- }
15387
-
15388
- // handle numbers: negative, out of range
15389
- if ( active !== false ) {
15390
- active = this.tabs.index( this.tabs.eq( active ) );
15391
- if ( active === -1 ) {
15392
- active = collapsible ? false : 0;
15393
- }
15394
- }
15395
-
15396
- // don't allow collapsible: false and active: false
15397
- if ( !collapsible && active === false && this.anchors.length ) {
15398
- active = 0;
15399
- }
15400
-
15401
- return active;
15402
- },
15403
-
15404
- _getCreateEventData: function() {
15405
- return {
15406
- tab: this.active,
15407
- panel: !this.active.length ? $() : this._getPanelForTab( this.active )
15408
- };
15409
- },
15410
-
15411
- _tabKeydown: function( event ) {
15412
- var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
15413
- selectedIndex = this.tabs.index( focusedTab ),
15414
- goingForward = true;
15415
-
15416
- if ( this._handlePageNav( event ) ) {
15417
- return;
15418
- }
15419
-
15420
- switch ( event.keyCode ) {
15421
- case $.ui.keyCode.RIGHT:
15422
- case $.ui.keyCode.DOWN:
15423
- selectedIndex++;
15424
- break;
15425
- case $.ui.keyCode.UP:
15426
- case $.ui.keyCode.LEFT:
15427
- goingForward = false;
15428
- selectedIndex--;
15429
- break;
15430
- case $.ui.keyCode.END:
15431
- selectedIndex = this.anchors.length - 1;
15432
- break;
15433
- case $.ui.keyCode.HOME:
15434
- selectedIndex = 0;
15435
- break;
15436
- case $.ui.keyCode.SPACE:
15437
- // Activate only, no collapsing
15438
- event.preventDefault();
15439
- clearTimeout( this.activating );
15440
- this._activate( selectedIndex );
15441
- return;
15442
- case $.ui.keyCode.ENTER:
15443
- // Toggle (cancel delayed activation, allow collapsing)
15444
- event.preventDefault();
15445
- clearTimeout( this.activating );
15446
- // Determine if we should collapse or activate
15447
- this._activate( selectedIndex === this.options.active ? false : selectedIndex );
15448
- return;
15449
- default:
15450
- return;
15451
- }
15452
-
15453
- // Focus the appropriate tab, based on which key was pressed
15454
- event.preventDefault();
15455
- clearTimeout( this.activating );
15456
- selectedIndex = this._focusNextTab( selectedIndex, goingForward );
15457
-
15458
- // Navigating with control key will prevent automatic activation
15459
- if ( !event.ctrlKey ) {
15460
- // Update aria-selected immediately so that AT think the tab is already selected.
15461
- // Otherwise AT may confuse the user by stating that they need to activate the tab,
15462
- // but the tab will already be activated by the time the announcement finishes.
15463
- focusedTab.attr( "aria-selected", "false" );
15464
- this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
15465
-
15466
- this.activating = this._delay(function() {
15467
- this.option( "active", selectedIndex );
15468
- }, this.delay );
15469
- }
15470
- },
15471
-
15472
- _panelKeydown: function( event ) {
15473
- if ( this._handlePageNav( event ) ) {
15474
- return;
15475
- }
15476
-
15477
- // Ctrl+up moves focus to the current tab
15478
- if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
15479
- event.preventDefault();
15480
- this.active.focus();
15481
- }
15482
- },
15483
-
15484
- // Alt+page up/down moves focus to the previous/next tab (and activates)
15485
- _handlePageNav: function( event ) {
15486
- if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
15487
- this._activate( this._focusNextTab( this.options.active - 1, false ) );
15488
- return true;
15489
- }
15490
- if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
15491
- this._activate( this._focusNextTab( this.options.active + 1, true ) );
15492
- return true;
15493
- }
15494
- },
15495
-
15496
- _findNextTab: function( index, goingForward ) {
15497
- var lastTabIndex = this.tabs.length - 1;
15498
-
15499
- function constrain() {
15500
- if ( index > lastTabIndex ) {
15501
- index = 0;
15502
- }
15503
- if ( index < 0 ) {
15504
- index = lastTabIndex;
15505
- }
15506
- return index;
15507
- }
15508
-
15509
- while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
15510
- index = goingForward ? index + 1 : index - 1;
15511
- }
15512
-
15513
- return index;
15514
- },
15515
-
15516
- _focusNextTab: function( index, goingForward ) {
15517
- index = this._findNextTab( index, goingForward );
15518
- this.tabs.eq( index ).focus();
15519
- return index;
15520
- },
15521
-
15522
- _setOption: function( key, value ) {
15523
- if ( key === "active" ) {
15524
- // _activate() will handle invalid values and update this.options
15525
- this._activate( value );
15526
- return;
15527
- }
15528
-
15529
- if ( key === "disabled" ) {
15530
- // don't use the widget factory's disabled handling
15531
- this._setupDisabled( value );
15532
- return;
15533
- }
15534
-
15535
- this._super( key, value);
15536
-
15537
- if ( key === "collapsible" ) {
15538
- this.element.toggleClass( "ui-tabs-collapsible", value );
15539
- // Setting collapsible: false while collapsed; open first panel
15540
- if ( !value && this.options.active === false ) {
15541
- this._activate( 0 );
15542
- }
15543
- }
15544
-
15545
- if ( key === "event" ) {
15546
- this._setupEvents( value );
15547
- }
15548
-
15549
- if ( key === "heightStyle" ) {
15550
- this._setupHeightStyle( value );
15551
- }
15552
- },
15553
-
15554
- _sanitizeSelector: function( hash ) {
15555
- return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
15556
- },
15557
-
15558
- refresh: function() {
15559
- var options = this.options,
15560
- lis = this.tablist.children( ":has(a[href])" );
15561
-
15562
- // get disabled tabs from class attribute from HTML
15563
- // this will get converted to a boolean if needed in _refresh()
15564
- options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
15565
- return lis.index( tab );
15566
- });
15567
-
15568
- this._processTabs();
15569
-
15570
- // was collapsed or no tabs
15571
- if ( options.active === false || !this.anchors.length ) {
15572
- options.active = false;
15573
- this.active = $();
15574
- // was active, but active tab is gone
15575
- } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
15576
- // all remaining tabs are disabled
15577
- if ( this.tabs.length === options.disabled.length ) {
15578
- options.active = false;
15579
- this.active = $();
15580
- // activate previous tab
15581
- } else {
15582
- this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
15583
- }
15584
- // was active, active tab still exists
15585
- } else {
15586
- // make sure active index is correct
15587
- options.active = this.tabs.index( this.active );
15588
- }
15589
-
15590
- this._refresh();
15591
- },
15592
-
15593
- _refresh: function() {
15594
- this._setupDisabled( this.options.disabled );
15595
- this._setupEvents( this.options.event );
15596
- this._setupHeightStyle( this.options.heightStyle );
15597
-
15598
- this.tabs.not( this.active ).attr({
15599
- "aria-selected": "false",
15600
- "aria-expanded": "false",
15601
- tabIndex: -1
15602
- });
15603
- this.panels.not( this._getPanelForTab( this.active ) )
15604
- .hide()
15605
- .attr({
15606
- "aria-hidden": "true"
15607
- });
15608
-
15609
- // Make sure one tab is in the tab order
15610
- if ( !this.active.length ) {
15611
- this.tabs.eq( 0 ).attr( "tabIndex", 0 );
15612
- } else {
15613
- this.active
15614
- .addClass( "ui-tabs-active ui-state-active" )
15615
- .attr({
15616
- "aria-selected": "true",
15617
- "aria-expanded": "true",
15618
- tabIndex: 0
15619
- });
15620
- this._getPanelForTab( this.active )
15621
- .show()
15622
- .attr({
15623
- "aria-hidden": "false"
15624
- });
15625
- }
15626
- },
15627
-
15628
- _processTabs: function() {
15629
- var that = this,
15630
- prevTabs = this.tabs,
15631
- prevAnchors = this.anchors,
15632
- prevPanels = this.panels;
15633
-
15634
- this.tablist = this._getList()
15635
- .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
15636
- .attr( "role", "tablist" )
15637
-
15638
- // Prevent users from focusing disabled tabs via click
15639
- .delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
15640
- if ( $( this ).is( ".ui-state-disabled" ) ) {
15641
- event.preventDefault();
15642
- }
15643
- })
15644
-
15645
- // support: IE <9
15646
- // Preventing the default action in mousedown doesn't prevent IE
15647
- // from focusing the element, so if the anchor gets focused, blur.
15648
- // We don't have to worry about focusing the previously focused
15649
- // element since clicking on a non-focusable element should focus
15650
- // the body anyway.
15651
- .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
15652
- if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
15653
- this.blur();
15654
- }
15655
- });
15656
-
15657
- this.tabs = this.tablist.find( "> li:has(a[href])" )
15658
- .addClass( "ui-state-default ui-corner-top" )
15659
- .attr({
15660
- role: "tab",
15661
- tabIndex: -1
15662
- });
15663
-
15664
- this.anchors = this.tabs.map(function() {
15665
- return $( "a", this )[ 0 ];
15666
- })
15667
- .addClass( "ui-tabs-anchor" )
15668
- .attr({
15669
- role: "presentation",
15670
- tabIndex: -1
15671
- });
15672
-
15673
- this.panels = $();
15674
-
15675
- this.anchors.each(function( i, anchor ) {
15676
- var selector, panel, panelId,
15677
- anchorId = $( anchor ).uniqueId().attr( "id" ),
15678
- tab = $( anchor ).closest( "li" ),
15679
- originalAriaControls = tab.attr( "aria-controls" );
15680
-
15681
- // inline tab
15682
- if ( that._isLocal( anchor ) ) {
15683
- selector = anchor.hash;
15684
- panelId = selector.substring( 1 );
15685
- panel = that.element.find( that._sanitizeSelector( selector ) );
15686
- // remote tab
15687
- } else {
15688
- // If the tab doesn't already have aria-controls,
15689
- // generate an id by using a throw-away element
15690
- panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
15691
- selector = "#" + panelId;
15692
- panel = that.element.find( selector );
15693
- if ( !panel.length ) {
15694
- panel = that._createPanel( panelId );
15695
- panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
15696
- }
15697
- panel.attr( "aria-live", "polite" );
15698
- }
15699
-
15700
- if ( panel.length) {
15701
- that.panels = that.panels.add( panel );
15702
- }
15703
- if ( originalAriaControls ) {
15704
- tab.data( "ui-tabs-aria-controls", originalAriaControls );
15705
- }
15706
- tab.attr({
15707
- "aria-controls": panelId,
15708
- "aria-labelledby": anchorId
15709
- });
15710
- panel.attr( "aria-labelledby", anchorId );
15711
- });
15712
-
15713
- this.panels
15714
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
15715
- .attr( "role", "tabpanel" );
15716
-
15717
- // Avoid memory leaks (#10056)
15718
- if ( prevTabs ) {
15719
- this._off( prevTabs.not( this.tabs ) );
15720
- this._off( prevAnchors.not( this.anchors ) );
15721
- this._off( prevPanels.not( this.panels ) );
15722
- }
15723
- },
15724
-
15725
- // allow overriding how to find the list for rare usage scenarios (#7715)
15726
- _getList: function() {
15727
- return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
15728
- },
15729
-
15730
- _createPanel: function( id ) {
15731
- return $( "<div>" )
15732
- .attr( "id", id )
15733
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
15734
- .data( "ui-tabs-destroy", true );
15735
- },
15736
-
15737
- _setupDisabled: function( disabled ) {
15738
- if ( $.isArray( disabled ) ) {
15739
- if ( !disabled.length ) {
15740
- disabled = false;
15741
- } else if ( disabled.length === this.anchors.length ) {
15742
- disabled = true;
15743
- }
15744
- }
15745
-
15746
- // disable tabs
15747
- for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
15748
- if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
15749
- $( li )
15750
- .addClass( "ui-state-disabled" )
15751
- .attr( "aria-disabled", "true" );
15752
- } else {
15753
- $( li )
15754
- .removeClass( "ui-state-disabled" )
15755
- .removeAttr( "aria-disabled" );
15756
- }
15757
- }
15758
-
15759
- this.options.disabled = disabled;
15760
- },
15761
-
15762
- _setupEvents: function( event ) {
15763
- var events = {};
15764
- if ( event ) {
15765
- $.each( event.split(" "), function( index, eventName ) {
15766
- events[ eventName ] = "_eventHandler";
15767
- });
15768
- }
15769
-
15770
- this._off( this.anchors.add( this.tabs ).add( this.panels ) );
15771
- // Always prevent the default action, even when disabled
15772
- this._on( true, this.anchors, {
15773
- click: function( event ) {
15774
- event.preventDefault();
15775
- }
15776
- });
15777
- this._on( this.anchors, events );
15778
- this._on( this.tabs, { keydown: "_tabKeydown" } );
15779
- this._on( this.panels, { keydown: "_panelKeydown" } );
15780
-
15781
- this._focusable( this.tabs );
15782
- this._hoverable( this.tabs );
15783
- },
15784
-
15785
- _setupHeightStyle: function( heightStyle ) {
15786
- var maxHeight,
15787
- parent = this.element.parent();
15788
-
15789
- if ( heightStyle === "fill" ) {
15790
- maxHeight = parent.height();
15791
- maxHeight -= this.element.outerHeight() - this.element.height();
15792
-
15793
- this.element.siblings( ":visible" ).each(function() {
15794
- var elem = $( this ),
15795
- position = elem.css( "position" );
15796
-
15797
- if ( position === "absolute" || position === "fixed" ) {
15798
- return;
15799
- }
15800
- maxHeight -= elem.outerHeight( true );
15801
- });
15802
-
15803
- this.element.children().not( this.panels ).each(function() {
15804
- maxHeight -= $( this ).outerHeight( true );
15805
- });
15806
-
15807
- this.panels.each(function() {
15808
- $( this ).height( Math.max( 0, maxHeight -
15809
- $( this ).innerHeight() + $( this ).height() ) );
15810
- })
15811
- .css( "overflow", "auto" );
15812
- } else if ( heightStyle === "auto" ) {
15813
- maxHeight = 0;
15814
- this.panels.each(function() {
15815
- maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
15816
- }).height( maxHeight );
15817
- }
15818
- },
15819
-
15820
- _eventHandler: function( event ) {
15821
- var options = this.options,
15822
- active = this.active,
15823
- anchor = $( event.currentTarget ),
15824
- tab = anchor.closest( "li" ),
15825
- clickedIsActive = tab[ 0 ] === active[ 0 ],
15826
- collapsing = clickedIsActive && options.collapsible,
15827
- toShow = collapsing ? $() : this._getPanelForTab( tab ),
15828
- toHide = !active.length ? $() : this._getPanelForTab( active ),
15829
- eventData = {
15830
- oldTab: active,
15831
- oldPanel: toHide,
15832
- newTab: collapsing ? $() : tab,
15833
- newPanel: toShow
15834
- };
15835
-
15836
- event.preventDefault();
15837
-
15838
- if ( tab.hasClass( "ui-state-disabled" ) ||
15839
- // tab is already loading
15840
- tab.hasClass( "ui-tabs-loading" ) ||
15841
- // can't switch durning an animation
15842
- this.running ||
15843
- // click on active header, but not collapsible
15844
- ( clickedIsActive && !options.collapsible ) ||
15845
- // allow canceling activation
15846
- ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
15847
- return;
15848
- }
15849
-
15850
- options.active = collapsing ? false : this.tabs.index( tab );
15851
-
15852
- this.active = clickedIsActive ? $() : tab;
15853
- if ( this.xhr ) {
15854
- this.xhr.abort();
15855
- }
15856
-
15857
- if ( !toHide.length && !toShow.length ) {
15858
- $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
15859
- }
15860
-
15861
- if ( toShow.length ) {
15862
- this.load( this.tabs.index( tab ), event );
15863
- }
15864
- this._toggle( event, eventData );
15865
- },
15866
-
15867
- // handles show/hide for selecting tabs
15868
- _toggle: function( event, eventData ) {
15869
- var that = this,
15870
- toShow = eventData.newPanel,
15871
- toHide = eventData.oldPanel;
15872
-
15873
- this.running = true;
15874
-
15875
- function complete() {
15876
- that.running = false;
15877
- that._trigger( "activate", event, eventData );
15878
- }
15879
-
15880
- function show() {
15881
- eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
15882
-
15883
- if ( toShow.length && that.options.show ) {
15884
- that._show( toShow, that.options.show, complete );
15885
- } else {
15886
- toShow.show();
15887
- complete();
15888
- }
15889
- }
15890
-
15891
- // start out by hiding, then showing, then completing
15892
- if ( toHide.length && this.options.hide ) {
15893
- this._hide( toHide, this.options.hide, function() {
15894
- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
15895
- show();
15896
- });
15897
- } else {
15898
- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
15899
- toHide.hide();
15900
- show();
15901
- }
15902
-
15903
- toHide.attr( "aria-hidden", "true" );
15904
- eventData.oldTab.attr({
15905
- "aria-selected": "false",
15906
- "aria-expanded": "false"
15907
- });
15908
- // If we're switching tabs, remove the old tab from the tab order.
15909
- // If we're opening from collapsed state, remove the previous tab from the tab order.
15910
- // If we're collapsing, then keep the collapsing tab in the tab order.
15911
- if ( toShow.length && toHide.length ) {
15912
- eventData.oldTab.attr( "tabIndex", -1 );
15913
- } else if ( toShow.length ) {
15914
- this.tabs.filter(function() {
15915
- return $( this ).attr( "tabIndex" ) === 0;
15916
- })
15917
- .attr( "tabIndex", -1 );
15918
- }
15919
-
15920
- toShow.attr( "aria-hidden", "false" );
15921
- eventData.newTab.attr({
15922
- "aria-selected": "true",
15923
- "aria-expanded": "true",
15924
- tabIndex: 0
15925
- });
15926
- },
15927
-
15928
- _activate: function( index ) {
15929
- var anchor,
15930
- active = this._findActive( index );
15931
-
15932
- // trying to activate the already active panel
15933
- if ( active[ 0 ] === this.active[ 0 ] ) {
15934
- return;
15935
- }
15936
-
15937
- // trying to collapse, simulate a click on the current active header
15938
- if ( !active.length ) {
15939
- active = this.active;
15940
- }
15941
-
15942
- anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
15943
- this._eventHandler({
15944
- target: anchor,
15945
- currentTarget: anchor,
15946
- preventDefault: $.noop
15947
- });
15948
- },
15949
-
15950
- _findActive: function( index ) {
15951
- return index === false ? $() : this.tabs.eq( index );
15952
- },
15953
-
15954
- _getIndex: function( index ) {
15955
- // meta-function to give users option to provide a href string instead of a numerical index.
15956
- if ( typeof index === "string" ) {
15957
- index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
15958
- }
15959
-
15960
- return index;
15961
- },
15962
-
15963
- _destroy: function() {
15964
- if ( this.xhr ) {
15965
- this.xhr.abort();
15966
- }
15967
-
15968
- this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
15969
-
15970
- this.tablist
15971
- .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
15972
- .removeAttr( "role" );
15973
-
15974
- this.anchors
15975
- .removeClass( "ui-tabs-anchor" )
15976
- .removeAttr( "role" )
15977
- .removeAttr( "tabIndex" )
15978
- .removeUniqueId();
15979
-
15980
- this.tablist.unbind( this.eventNamespace );
15981
-
15982
- this.tabs.add( this.panels ).each(function() {
15983
- if ( $.data( this, "ui-tabs-destroy" ) ) {
15984
- $( this ).remove();
15985
- } else {
15986
- $( this )
15987
- .removeClass( "ui-state-default ui-state-active ui-state-disabled " +
15988
- "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
15989
- .removeAttr( "tabIndex" )
15990
- .removeAttr( "aria-live" )
15991
- .removeAttr( "aria-busy" )
15992
- .removeAttr( "aria-selected" )
15993
- .removeAttr( "aria-labelledby" )
15994
- .removeAttr( "aria-hidden" )
15995
- .removeAttr( "aria-expanded" )
15996
- .removeAttr( "role" );
15997
- }
15998
- });
15999
-
16000
- this.tabs.each(function() {
16001
- var li = $( this ),
16002
- prev = li.data( "ui-tabs-aria-controls" );
16003
- if ( prev ) {
16004
- li
16005
- .attr( "aria-controls", prev )
16006
- .removeData( "ui-tabs-aria-controls" );
16007
- } else {
16008
- li.removeAttr( "aria-controls" );
16009
- }
16010
- });
16011
-
16012
- this.panels.show();
16013
-
16014
- if ( this.options.heightStyle !== "content" ) {
16015
- this.panels.css( "height", "" );
16016
- }
16017
- },
16018
-
16019
- enable: function( index ) {
16020
- var disabled = this.options.disabled;
16021
- if ( disabled === false ) {
16022
- return;
16023
- }
16024
-
16025
- if ( index === undefined ) {
16026
- disabled = false;
16027
- } else {
16028
- index = this._getIndex( index );
16029
- if ( $.isArray( disabled ) ) {
16030
- disabled = $.map( disabled, function( num ) {
16031
- return num !== index ? num : null;
16032
- });
16033
- } else {
16034
- disabled = $.map( this.tabs, function( li, num ) {
16035
- return num !== index ? num : null;
16036
- });
16037
- }
16038
- }
16039
- this._setupDisabled( disabled );
16040
- },
16041
-
16042
- disable: function( index ) {
16043
- var disabled = this.options.disabled;
16044
- if ( disabled === true ) {
16045
- return;
16046
- }
16047
-
16048
- if ( index === undefined ) {
16049
- disabled = true;
16050
- } else {
16051
- index = this._getIndex( index );
16052
- if ( $.inArray( index, disabled ) !== -1 ) {
16053
- return;
16054
- }
16055
- if ( $.isArray( disabled ) ) {
16056
- disabled = $.merge( [ index ], disabled ).sort();
16057
- } else {
16058
- disabled = [ index ];
16059
- }
16060
- }
16061
- this._setupDisabled( disabled );
16062
- },
16063
-
16064
- load: function( index, event ) {
16065
- index = this._getIndex( index );
16066
- var that = this,
16067
- tab = this.tabs.eq( index ),
16068
- anchor = tab.find( ".ui-tabs-anchor" ),
16069
- panel = this._getPanelForTab( tab ),
16070
- eventData = {
16071
- tab: tab,
16072
- panel: panel
16073
- };
16074
-
16075
- // not remote
16076
- if ( this._isLocal( anchor[ 0 ] ) ) {
16077
- return;
16078
- }
16079
-
16080
- this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
16081
-
16082
- // support: jQuery <1.8
16083
- // jQuery <1.8 returns false if the request is canceled in beforeSend,
16084
- // but as of 1.8, $.ajax() always returns a jqXHR object.
16085
- if ( this.xhr && this.xhr.statusText !== "canceled" ) {
16086
- tab.addClass( "ui-tabs-loading" );
16087
- panel.attr( "aria-busy", "true" );
16088
-
16089
- this.xhr
16090
- .success(function( response ) {
16091
- // support: jQuery <1.8
16092
- // http://bugs.jquery.com/ticket/11778
16093
- setTimeout(function() {
16094
- panel.html( response );
16095
- that._trigger( "load", event, eventData );
16096
- }, 1 );
16097
- })
16098
- .complete(function( jqXHR, status ) {
16099
- // support: jQuery <1.8
16100
- // http://bugs.jquery.com/ticket/11778
16101
- setTimeout(function() {
16102
- if ( status === "abort" ) {
16103
- that.panels.stop( false, true );
16104
- }
16105
-
16106
- tab.removeClass( "ui-tabs-loading" );
16107
- panel.removeAttr( "aria-busy" );
16108
-
16109
- if ( jqXHR === that.xhr ) {
16110
- delete that.xhr;
16111
- }
16112
- }, 1 );
16113
- });
16114
- }
16115
- },
16116
-
16117
- _ajaxSettings: function( anchor, event, eventData ) {
16118
- var that = this;
16119
- return {
16120
- url: anchor.attr( "href" ),
16121
- beforeSend: function( jqXHR, settings ) {
16122
- return that._trigger( "beforeLoad", event,
16123
- $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
16124
- }
16125
- };
16126
- },
16127
-
16128
- _getPanelForTab: function( tab ) {
16129
- var id = $( tab ).attr( "aria-controls" );
16130
- return this.element.find( this._sanitizeSelector( "#" + id ) );
16131
- }
16132
- });
16133
-
16134
-
16135
- /*!
16136
- * jQuery UI Tooltip 1.11.2
16137
- * http://jqueryui.com
16138
- *
16139
- * Copyright 2014 jQuery Foundation and other contributors
16140
- * Released under the MIT license.
16141
- * http://jquery.org/license
16142
- *
16143
- * http://api.jqueryui.com/tooltip/
16144
- */
16145
-
16146
-
16147
- var tooltip = $.widget( "ui.tooltip", {
16148
- version: "1.11.2",
16149
- options: {
16150
- content: function() {
16151
- // support: IE<9, Opera in jQuery <1.7
16152
- // .text() can't accept undefined, so coerce to a string
16153
- var title = $( this ).attr( "title" ) || "";
16154
- // Escape title, since we're going from an attribute to raw HTML
16155
- return $( "<a>" ).text( title ).html();
16156
- },
16157
- hide: true,
16158
- // Disabled elements have inconsistent behavior across browsers (#8661)
16159
- items: "[title]:not([disabled])",
16160
- position: {
16161
- my: "left top+15",
16162
- at: "left bottom",
16163
- collision: "flipfit flip"
16164
- },
16165
- show: true,
16166
- tooltipClass: null,
16167
- track: false,
16168
-
16169
- // callbacks
16170
- close: null,
16171
- open: null
16172
- },
16173
-
16174
- _addDescribedBy: function( elem, id ) {
16175
- var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
16176
- describedby.push( id );
16177
- elem
16178
- .data( "ui-tooltip-id", id )
16179
- .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
16180
- },
16181
-
16182
- _removeDescribedBy: function( elem ) {
16183
- var id = elem.data( "ui-tooltip-id" ),
16184
- describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
16185
- index = $.inArray( id, describedby );
16186
-
16187
- if ( index !== -1 ) {
16188
- describedby.splice( index, 1 );
16189
- }
16190
-
16191
- elem.removeData( "ui-tooltip-id" );
16192
- describedby = $.trim( describedby.join( " " ) );
16193
- if ( describedby ) {
16194
- elem.attr( "aria-describedby", describedby );
16195
- } else {
16196
- elem.removeAttr( "aria-describedby" );
16197
- }
16198
- },
16199
-
16200
- _create: function() {
16201
- this._on({
16202
- mouseover: "open",
16203
- focusin: "open"
16204
- });
16205
-
16206
- // IDs of generated tooltips, needed for destroy
16207
- this.tooltips = {};
16208
-
16209
- // IDs of parent tooltips where we removed the title attribute
16210
- this.parents = {};
16211
-
16212
- if ( this.options.disabled ) {
16213
- this._disable();
16214
- }
16215
-
16216
- // Append the aria-live region so tooltips announce correctly
16217
- this.liveRegion = $( "<div>" )
16218
- .attr({
16219
- role: "log",
16220
- "aria-live": "assertive",
16221
- "aria-relevant": "additions"
16222
- })
16223
- .addClass( "ui-helper-hidden-accessible" )
16224
- .appendTo( this.document[ 0 ].body );
16225
- },
16226
-
16227
- _setOption: function( key, value ) {
16228
- var that = this;
16229
-
16230
- if ( key === "disabled" ) {
16231
- this[ value ? "_disable" : "_enable" ]();
16232
- this.options[ key ] = value;
16233
- // disable element style changes
16234
- return;
16235
- }
16236
-
16237
- this._super( key, value );
16238
-
16239
- if ( key === "content" ) {
16240
- $.each( this.tooltips, function( id, tooltipData ) {
16241
- that._updateContent( tooltipData.element );
16242
- });
16243
- }
16244
- },
16245
-
16246
- _disable: function() {
16247
- var that = this;
16248
-
16249
- // close open tooltips
16250
- $.each( this.tooltips, function( id, tooltipData ) {
16251
- var event = $.Event( "blur" );
16252
- event.target = event.currentTarget = tooltipData.element[ 0 ];
16253
- that.close( event, true );
16254
- });
16255
-
16256
- // remove title attributes to prevent native tooltips
16257
- this.element.find( this.options.items ).addBack().each(function() {
16258
- var element = $( this );
16259
- if ( element.is( "[title]" ) ) {
16260
- element
16261
- .data( "ui-tooltip-title", element.attr( "title" ) )
16262
- .removeAttr( "title" );
16263
- }
16264
- });
16265
- },
16266
-
16267
- _enable: function() {
16268
- // restore title attributes
16269
- this.element.find( this.options.items ).addBack().each(function() {
16270
- var element = $( this );
16271
- if ( element.data( "ui-tooltip-title" ) ) {
16272
- element.attr( "title", element.data( "ui-tooltip-title" ) );
16273
- }
16274
- });
16275
- },
16276
-
16277
- open: function( event ) {
16278
- var that = this,
16279
- target = $( event ? event.target : this.element )
16280
- // we need closest here due to mouseover bubbling,
16281
- // but always pointing at the same event target
16282
- .closest( this.options.items );
16283
-
16284
- // No element to show a tooltip for or the tooltip is already open
16285
- if ( !target.length || target.data( "ui-tooltip-id" ) ) {
16286
- return;
16287
- }
16288
-
16289
- if ( target.attr( "title" ) ) {
16290
- target.data( "ui-tooltip-title", target.attr( "title" ) );
16291
- }
16292
-
16293
- target.data( "ui-tooltip-open", true );
16294
-
16295
- // kill parent tooltips, custom or native, for hover
16296
- if ( event && event.type === "mouseover" ) {
16297
- target.parents().each(function() {
16298
- var parent = $( this ),
16299
- blurEvent;
16300
- if ( parent.data( "ui-tooltip-open" ) ) {
16301
- blurEvent = $.Event( "blur" );
16302
- blurEvent.target = blurEvent.currentTarget = this;
16303
- that.close( blurEvent, true );
16304
- }
16305
- if ( parent.attr( "title" ) ) {
16306
- parent.uniqueId();
16307
- that.parents[ this.id ] = {
16308
- element: this,
16309
- title: parent.attr( "title" )
16310
- };
16311
- parent.attr( "title", "" );
16312
- }
16313
- });
16314
- }
16315
-
16316
- this._updateContent( target, event );
16317
- },
16318
-
16319
- _updateContent: function( target, event ) {
16320
- var content,
16321
- contentOption = this.options.content,
16322
- that = this,
16323
- eventType = event ? event.type : null;
16324
-
16325
- if ( typeof contentOption === "string" ) {
16326
- return this._open( event, target, contentOption );
16327
- }
16328
-
16329
- content = contentOption.call( target[0], function( response ) {
16330
- // ignore async response if tooltip was closed already
16331
- if ( !target.data( "ui-tooltip-open" ) ) {
16332
- return;
16333
- }
16334
- // IE may instantly serve a cached response for ajax requests
16335
- // delay this call to _open so the other call to _open runs first
16336
- that._delay(function() {
16337
- // jQuery creates a special event for focusin when it doesn't
16338
- // exist natively. To improve performance, the native event
16339
- // object is reused and the type is changed. Therefore, we can't
16340
- // rely on the type being correct after the event finished
16341
- // bubbling, so we set it back to the previous value. (#8740)
16342
- if ( event ) {
16343
- event.type = eventType;
16344
- }
16345
- this._open( event, target, response );
16346
- });
16347
- });
16348
- if ( content ) {
16349
- this._open( event, target, content );
16350
- }
16351
- },
16352
-
16353
- _open: function( event, target, content ) {
16354
- var tooltipData, tooltip, events, delayedShow, a11yContent,
16355
- positionOption = $.extend( {}, this.options.position );
16356
-
16357
- if ( !content ) {
16358
- return;
16359
- }
16360
-
16361
- // Content can be updated multiple times. If the tooltip already
16362
- // exists, then just update the content and bail.
16363
- tooltipData = this._find( target );
16364
- if ( tooltipData ) {
16365
- tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
16366
- return;
16367
- }
16368
-
16369
- // if we have a title, clear it to prevent the native tooltip
16370
- // we have to check first to avoid defining a title if none exists
16371
- // (we don't want to cause an element to start matching [title])
16372
- //
16373
- // We use removeAttr only for key events, to allow IE to export the correct
16374
- // accessible attributes. For mouse events, set to empty string to avoid
16375
- // native tooltip showing up (happens only when removing inside mouseover).
16376
- if ( target.is( "[title]" ) ) {
16377
- if ( event && event.type === "mouseover" ) {
16378
- target.attr( "title", "" );
16379
- } else {
16380
- target.removeAttr( "title" );
16381
- }
16382
- }
16383
-
16384
- tooltipData = this._tooltip( target );
16385
- tooltip = tooltipData.tooltip;
16386
- this._addDescribedBy( target, tooltip.attr( "id" ) );
16387
- tooltip.find( ".ui-tooltip-content" ).html( content );
16388
-
16389
- // Support: Voiceover on OS X, JAWS on IE <= 9
16390
- // JAWS announces deletions even when aria-relevant="additions"
16391
- // Voiceover will sometimes re-read the entire log region's contents from the beginning
16392
- this.liveRegion.children().hide();
16393
- if ( content.clone ) {
16394
- a11yContent = content.clone();
16395
- a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
16396
- } else {
16397
- a11yContent = content;
16398
- }
16399
- $( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
16400
-
16401
- function position( event ) {
16402
- positionOption.of = event;
16403
- if ( tooltip.is( ":hidden" ) ) {
16404
- return;
16405
- }
16406
- tooltip.position( positionOption );
16407
- }
16408
- if ( this.options.track && event && /^mouse/.test( event.type ) ) {
16409
- this._on( this.document, {
16410
- mousemove: position
16411
- });
16412
- // trigger once to override element-relative positioning
16413
- position( event );
16414
- } else {
16415
- tooltip.position( $.extend({
16416
- of: target
16417
- }, this.options.position ) );
16418
- }
16419
-
16420
- tooltip.hide();
16421
-
16422
- this._show( tooltip, this.options.show );
16423
- // Handle tracking tooltips that are shown with a delay (#8644). As soon
16424
- // as the tooltip is visible, position the tooltip using the most recent
16425
- // event.
16426
- if ( this.options.show && this.options.show.delay ) {
16427
- delayedShow = this.delayedShow = setInterval(function() {
16428
- if ( tooltip.is( ":visible" ) ) {
16429
- position( positionOption.of );
16430
- clearInterval( delayedShow );
16431
- }
16432
- }, $.fx.interval );
16433
- }
16434
-
16435
- this._trigger( "open", event, { tooltip: tooltip } );
16436
-
16437
- events = {
16438
- keyup: function( event ) {
16439
- if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
16440
- var fakeEvent = $.Event(event);
16441
- fakeEvent.currentTarget = target[0];
16442
- this.close( fakeEvent, true );
16443
- }
16444
- }
16445
- };
16446
-
16447
- // Only bind remove handler for delegated targets. Non-delegated
16448
- // tooltips will handle this in destroy.
16449
- if ( target[ 0 ] !== this.element[ 0 ] ) {
16450
- events.remove = function() {
16451
- this._removeTooltip( tooltip );
16452
- };
16453
- }
16454
-
16455
- if ( !event || event.type === "mouseover" ) {
16456
- events.mouseleave = "close";
16457
- }
16458
- if ( !event || event.type === "focusin" ) {
16459
- events.focusout = "close";
16460
- }
16461
- this._on( true, target, events );
16462
- },
16463
-
16464
- close: function( event ) {
16465
- var tooltip,
16466
- that = this,
16467
- target = $( event ? event.currentTarget : this.element ),
16468
- tooltipData = this._find( target );
16469
-
16470
- // The tooltip may already be closed
16471
- if ( !tooltipData ) {
16472
- return;
16473
- }
16474
-
16475
- tooltip = tooltipData.tooltip;
16476
-
16477
- // disabling closes the tooltip, so we need to track when we're closing
16478
- // to avoid an infinite loop in case the tooltip becomes disabled on close
16479
- if ( tooltipData.closing ) {
16480
- return;
16481
- }
16482
-
16483
- // Clear the interval for delayed tracking tooltips
16484
- clearInterval( this.delayedShow );
16485
-
16486
- // only set title if we had one before (see comment in _open())
16487
- // If the title attribute has changed since open(), don't restore
16488
- if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
16489
- target.attr( "title", target.data( "ui-tooltip-title" ) );
16490
- }
16491
-
16492
- this._removeDescribedBy( target );
16493
-
16494
- tooltipData.hiding = true;
16495
- tooltip.stop( true );
16496
- this._hide( tooltip, this.options.hide, function() {
16497
- that._removeTooltip( $( this ) );
16498
- });
16499
-
16500
- target.removeData( "ui-tooltip-open" );
16501
- this._off( target, "mouseleave focusout keyup" );
16502
-
16503
- // Remove 'remove' binding only on delegated targets
16504
- if ( target[ 0 ] !== this.element[ 0 ] ) {
16505
- this._off( target, "remove" );
16506
- }
16507
- this._off( this.document, "mousemove" );
16508
-
16509
- if ( event && event.type === "mouseleave" ) {
16510
- $.each( this.parents, function( id, parent ) {
16511
- $( parent.element ).attr( "title", parent.title );
16512
- delete that.parents[ id ];
16513
- });
16514
- }
16515
-
16516
- tooltipData.closing = true;
16517
- this._trigger( "close", event, { tooltip: tooltip } );
16518
- if ( !tooltipData.hiding ) {
16519
- tooltipData.closing = false;
16520
- }
16521
- },
16522
-
16523
- _tooltip: function( element ) {
16524
- var tooltip = $( "<div>" )
16525
- .attr( "role", "tooltip" )
16526
- .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
16527
- ( this.options.tooltipClass || "" ) ),
16528
- id = tooltip.uniqueId().attr( "id" );
16529
-
16530
- $( "<div>" )
16531
- .addClass( "ui-tooltip-content" )
16532
- .appendTo( tooltip );
16533
-
16534
- tooltip.appendTo( this.document[0].body );
16535
-
16536
- return this.tooltips[ id ] = {
16537
- element: element,
16538
- tooltip: tooltip
16539
- };
16540
- },
16541
-
16542
- _find: function( target ) {
16543
- var id = target.data( "ui-tooltip-id" );
16544
- return id ? this.tooltips[ id ] : null;
16545
- },
16546
-
16547
- _removeTooltip: function( tooltip ) {
16548
- tooltip.remove();
16549
- delete this.tooltips[ tooltip.attr( "id" ) ];
16550
- },
16551
-
16552
- _destroy: function() {
16553
- var that = this;
16554
-
16555
- // close open tooltips
16556
- $.each( this.tooltips, function( id, tooltipData ) {
16557
- // Delegate to close method to handle common cleanup
16558
- var event = $.Event( "blur" ),
16559
- element = tooltipData.element;
16560
- event.target = event.currentTarget = element[ 0 ];
16561
- that.close( event, true );
16562
-
16563
- // Remove immediately; destroying an open tooltip doesn't use the
16564
- // hide animation
16565
- $( "#" + id ).remove();
16566
-
16567
- // Restore the title
16568
- if ( element.data( "ui-tooltip-title" ) ) {
16569
- // If the title attribute has changed since open(), don't restore
16570
- if ( !element.attr( "title" ) ) {
16571
- element.attr( "title", element.data( "ui-tooltip-title" ) );
16572
- }
16573
- element.removeData( "ui-tooltip-title" );
16574
- }
16575
- });
16576
- this.liveRegion.remove();
16577
- }
16578
- });
16579
-
16580
-
16581
-
16582
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/jquery-ui/jquery-ui.min.js ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.2 - 2014-10-16
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 2014 jQuery Foundation and other contributors; Licensed MIT */
5
+ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(I){
6
+ /*!
7
+ * jQuery UI Core 1.11.2
8
+ * http://jqueryui.com
9
+ *
10
+ * Copyright 2014 jQuery Foundation and other contributors
11
+ * Released under the MIT license.
12
+ * http://jquery.org/license
13
+ *
14
+ * http://api.jqueryui.com/category/ui-core/
15
+ */
16
+ I.ui=I.ui||{};I.extend(I.ui,{version:"1.11.2",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}});I.fn.extend({scrollParent:function(ag){var af=this.css("position"),ae=af==="absolute",ah=ag?/(auto|scroll|hidden)/:/(auto|scroll)/,ai=this.parents().filter(function(){var aj=I(this);if(ae&&aj.css("position")==="static"){return false}return ah.test(aj.css("overflow")+aj.css("overflow-y")+aj.css("overflow-x"))}).eq(0);return af==="fixed"||!ai.length?I(this[0].ownerDocument||document):ai},uniqueId:(function(){var ae=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++ae)}})}})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){I(this).removeAttr("id")}})}});function v(ag,ae){var ai,ah,af,aj=ag.nodeName.toLowerCase();if("area"===aj){ai=ag.parentNode;ah=ai.name;if(!ag.href||!ah||ai.nodeName.toLowerCase()!=="map"){return false}af=I("img[usemap='#"+ah+"']")[0];return !!af&&w(af)}return(/input|select|textarea|button|object/.test(aj)?!ag.disabled:"a"===aj?ag.href||ae:ae)&&w(ag)}function w(ae){return I.expr.filters.visible(ae)&&!I(ae).parents().addBack().filter(function(){return I.css(this,"visibility")==="hidden"}).length}I.extend(I.expr[":"],{data:I.expr.createPseudo?I.expr.createPseudo(function(ae){return function(af){return !!I.data(af,ae)}}):function(ag,af,ae){return !!I.data(ag,ae[3])},focusable:function(ae){return v(ae,!isNaN(I.attr(ae,"tabindex")))},tabbable:function(ag){var ae=I.attr(ag,"tabindex"),af=isNaN(ae);return(af||ae>=0)&&v(ag,!af)}});if(!I("<a>").outerWidth(1).jquery){I.each(["Width","Height"],function(ag,ae){var af=ae==="Width"?["Left","Right"]:["Top","Bottom"],ah=ae.toLowerCase(),aj={innerWidth:I.fn.innerWidth,innerHeight:I.fn.innerHeight,outerWidth:I.fn.outerWidth,outerHeight:I.fn.outerHeight};function ai(am,al,ak,an){I.each(af,function(){al-=parseFloat(I.css(am,"padding"+this))||0;if(ak){al-=parseFloat(I.css(am,"border"+this+"Width"))||0}if(an){al-=parseFloat(I.css(am,"margin"+this))||0}});return al}I.fn["inner"+ae]=function(ak){if(ak===undefined){return aj["inner"+ae].call(this)}return this.each(function(){I(this).css(ah,ai(this,ak)+"px")})};I.fn["outer"+ae]=function(ak,al){if(typeof ak!=="number"){return aj["outer"+ae].call(this,ak)}return this.each(function(){I(this).css(ah,ai(this,ak,true,al)+"px")})}})}if(!I.fn.addBack){I.fn.addBack=function(ae){return this.add(ae==null?this.prevObject:this.prevObject.filter(ae))}}if(I("<a>").data("a-b","a").removeData("a-b").data("a-b")){I.fn.removeData=(function(ae){return function(af){if(arguments.length){return ae.call(this,I.camelCase(af))}else{return ae.call(this)}}})(I.fn.removeData)}I.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());I.fn.extend({focus:(function(ae){return function(af,ag){return typeof af==="number"?this.each(function(){var ah=this;setTimeout(function(){I(ah).focus();if(ag){ag.call(ah)}},af)}):ae.apply(this,arguments)}})(I.fn.focus),disableSelection:(function(){var ae="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(ae+".ui-disableSelection",function(af){af.preventDefault()})}})(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(ah){if(ah!==undefined){return this.css("zIndex",ah)}if(this.length){var af=I(this[0]),ae,ag;while(af.length&&af[0]!==document){ae=af.css("position");if(ae==="absolute"||ae==="relative"||ae==="fixed"){ag=parseInt(af.css("zIndex"),10);if(!isNaN(ag)&&ag!==0){return ag}}af=af.parent()}}return 0}});I.ui.plugin={add:function(af,ag,ai){var ae,ah=I.ui[af].prototype;for(ae in ai){ah.plugins[ae]=ah.plugins[ae]||[];ah.plugins[ae].push([ag,ai[ae]])}},call:function(ae,ah,ag,af){var ai,aj=ae.plugins[ah];if(!aj){return}if(!af&&(!ae.element[0].parentNode||ae.element[0].parentNode.nodeType===11)){return}for(ai=0;ai<aj.length;ai++){if(ae.options[aj[ai][0]]){aj[ai][1].apply(ae.element,ag)}}}};
17
+ /*!
18
+ * jQuery UI Widget 1.11.2
19
+ * http://jqueryui.com
20
+ *
21
+ * Copyright 2014 jQuery Foundation and other contributors
22
+ * Released under the MIT license.
23
+ * http://jquery.org/license
24
+ *
25
+ * http://api.jqueryui.com/jQuery.widget/
26
+ */
27
+ var O=0,i=Array.prototype.slice;I.cleanData=(function(ae){return function(af){var ah,ai,ag;for(ag=0;(ai=af[ag])!=null;ag++){try{ah=I._data(ai,"events");if(ah&&ah.remove){I(ai).triggerHandler("remove")}}catch(aj){}}ae(af)}})(I.cleanData);I.widget=function(ae,af,am){var aj,ak,ah,al,ag={},ai=ae.split(".")[0];ae=ae.split(".")[1];aj=ai+"-"+ae;if(!am){am=af;af=I.Widget}I.expr[":"][aj.toLowerCase()]=function(an){return !!I.data(an,aj)};I[ai]=I[ai]||{};ak=I[ai][ae];ah=I[ai][ae]=function(an,ao){if(!this._createWidget){return new ah(an,ao)}if(arguments.length){this._createWidget(an,ao)}};I.extend(ah,ak,{version:am.version,_proto:I.extend({},am),_childConstructors:[]});al=new af();al.options=I.widget.extend({},al.options);I.each(am,function(ao,an){if(!I.isFunction(an)){ag[ao]=an;return}ag[ao]=(function(){var ap=function(){return af.prototype[ao].apply(this,arguments)},aq=function(ar){return af.prototype[ao].apply(this,ar)};return function(){var au=this._super,ar=this._superApply,at;this._super=ap;this._superApply=aq;at=an.apply(this,arguments);this._super=au;this._superApply=ar;return at}})()});ah.prototype=I.widget.extend(al,{widgetEventPrefix:ak?(al.widgetEventPrefix||ae):ae},ag,{constructor:ah,namespace:ai,widgetName:ae,widgetFullName:aj});if(ak){I.each(ak._childConstructors,function(ao,ap){var an=ap.prototype;I.widget(an.namespace+"."+an.widgetName,ah,ap._proto)});delete ak._childConstructors}else{af._childConstructors.push(ah)}I.widget.bridge(ae,ah);return ah};I.widget.extend=function(aj){var af=i.call(arguments,1),ai=0,ae=af.length,ag,ah;for(;ai<ae;ai++){for(ag in af[ai]){ah=af[ai][ag];if(af[ai].hasOwnProperty(ag)&&ah!==undefined){if(I.isPlainObject(ah)){aj[ag]=I.isPlainObject(aj[ag])?I.widget.extend({},aj[ag],ah):I.widget.extend({},ah)}else{aj[ag]=ah}}}}return aj};I.widget.bridge=function(af,ae){var ag=ae.prototype.widgetFullName||af;I.fn[af]=function(aj){var ah=typeof aj==="string",ai=i.call(arguments,1),ak=this;aj=!ah&&ai.length?I.widget.extend.apply(null,[aj].concat(ai)):aj;if(ah){this.each(function(){var am,al=I.data(this,ag);if(aj==="instance"){ak=al;return false}if(!al){return I.error("cannot call methods on "+af+" prior to initialization; attempted to call method '"+aj+"'")}if(!I.isFunction(al[aj])||aj.charAt(0)==="_"){return I.error("no such method '"+aj+"' for "+af+" widget instance")}am=al[aj].apply(al,ai);if(am!==al&&am!==undefined){ak=am&&am.jquery?ak.pushStack(am.get()):am;return false}})}else{this.each(function(){var al=I.data(this,ag);if(al){al.option(aj||{});if(al._init){al._init()}}else{I.data(this,ag,new ae(aj,this))}})}return ak}};I.Widget=function(){};I.Widget._childConstructors=[];I.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(ae,af){af=I(af||this.defaultElement||this)[0];this.element=I(af);this.uuid=O++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=I();this.hoverable=I();this.focusable=I();if(af!==this){I.data(af,this.widgetFullName,this);this._on(true,this.element,{remove:function(ag){if(ag.target===af){this.destroy()}}});this.document=I(af.style?af.ownerDocument:af.document||af);this.window=I(this.document[0].defaultView||this.document[0].parentWindow)}this.options=I.widget.extend({},this.options,this._getCreateOptions(),ae);this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:I.noop,_getCreateEventData:I.noop,_create:I.noop,_init:I.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(I.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:I.noop,widget:function(){return this.element},option:function(ah,ai){var ae=ah,aj,ag,af;if(arguments.length===0){return I.widget.extend({},this.options)}if(typeof ah==="string"){ae={};aj=ah.split(".");ah=aj.shift();if(aj.length){ag=ae[ah]=I.widget.extend({},this.options[ah]);for(af=0;af<aj.length-1;af++){ag[aj[af]]=ag[aj[af]]||{};ag=ag[aj[af]]}ah=aj.pop();if(arguments.length===1){return ag[ah]===undefined?null:ag[ah]}ag[ah]=ai}else{if(arguments.length===1){return this.options[ah]===undefined?null:this.options[ah]}ae[ah]=ai}}this._setOptions(ae);return this},_setOptions:function(ae){var af;for(af in ae){this._setOption(af,ae[af])}return this},_setOption:function(ae,af){this.options[ae]=af;if(ae==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!af);if(af){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}}return this},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_on:function(ah,ag,af){var ai,ae=this;if(typeof ah!=="boolean"){af=ag;ag=ah;ah=false}if(!af){af=ag;ag=this.element;ai=this.widget()}else{ag=ai=I(ag);this.bindings=this.bindings.add(ag)}I.each(af,function(ao,an){function al(){if(!ah&&(ae.options.disabled===true||I(this).hasClass("ui-state-disabled"))){return}return(typeof an==="string"?ae[an]:an).apply(ae,arguments)}if(typeof an!=="string"){al.guid=an.guid=an.guid||al.guid||I.guid++}var am=ao.match(/^([\w:-]*)\s*(.*)$/),ak=am[1]+ae.eventNamespace,aj=am[2];if(aj){ai.delegate(aj,ak,al)}else{ag.bind(ak,al)}})},_off:function(af,ae){ae=(ae||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;af.unbind(ae).undelegate(ae);this.bindings=I(this.bindings.not(af).get());this.focusable=I(this.focusable.not(af).get());this.hoverable=I(this.hoverable.not(af).get())},_delay:function(ah,ag){function af(){return(typeof ah==="string"?ae[ah]:ah).apply(ae,arguments)}var ae=this;return setTimeout(af,ag||0)},_hoverable:function(ae){this.hoverable=this.hoverable.add(ae);this._on(ae,{mouseenter:function(af){I(af.currentTarget).addClass("ui-state-hover")},mouseleave:function(af){I(af.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(ae){this.focusable=this.focusable.add(ae);this._on(ae,{focusin:function(af){I(af.currentTarget).addClass("ui-state-focus")},focusout:function(af){I(af.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(ae,af,ag){var aj,ai,ah=this.options[ae];ag=ag||{};af=I.Event(af);af.type=(ae===this.widgetEventPrefix?ae:this.widgetEventPrefix+ae).toLowerCase();af.target=this.element[0];ai=af.originalEvent;if(ai){for(aj in ai){if(!(aj in af)){af[aj]=ai[aj]}}}this.element.trigger(af,ag);return !(I.isFunction(ah)&&ah.apply(this.element[0],[af].concat(ag))===false||af.isDefaultPrevented())}};I.each({show:"fadeIn",hide:"fadeOut"},function(af,ae){I.Widget.prototype["_"+af]=function(ai,ah,ak){if(typeof ah==="string"){ah={effect:ah}}var aj,ag=!ah?af:ah===true||typeof ah==="number"?ae:ah.effect||ae;ah=ah||{};if(typeof ah==="number"){ah={duration:ah}}aj=!I.isEmptyObject(ah);ah.complete=ak;if(ah.delay){ai.delay(ah.delay)}if(aj&&I.effects&&I.effects.effect[ag]){ai[af](ah)}else{if(ag!==af&&ai[ag]){ai[ag](ah.duration,ah.easing,ak)}else{ai.queue(function(al){I(this)[af]();if(ak){ak.call(ai[0])}al()})}}}});var J=I.widget;
28
+ /*!
29
+ * jQuery UI Mouse 1.11.2
30
+ * http://jqueryui.com
31
+ *
32
+ * Copyright 2014 jQuery Foundation and other contributors
33
+ * Released under the MIT license.
34
+ * http://jquery.org/license
35
+ *
36
+ * http://api.jqueryui.com/mouse/
37
+ */
38
+ var b=false;I(document).mouseup(function(){b=false});var G=I.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var ae=this;this.element.bind("mousedown."+this.widgetName,function(af){return ae._mouseDown(af)}).bind("click."+this.widgetName,function(af){if(true===I.data(af.target,ae.widgetName+".preventClickEvent")){I.removeData(af.target,ae.widgetName+".preventClickEvent");af.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(ag){if(b){return}this._mouseMoved=false;(this._mouseStarted&&this._mouseUp(ag));this._mouseDownEvent=ag;var af=this,ah=(ag.which===1),ae=(typeof this.options.cancel==="string"&&ag.target.nodeName?I(ag.target).closest(this.options.cancel).length:false);if(!ah||ae||!this._mouseCapture(ag)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){af.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(ag)&&this._mouseDelayMet(ag)){this._mouseStarted=(this._mouseStart(ag)!==false);if(!this._mouseStarted){ag.preventDefault();return true}}if(true===I.data(ag.target,this.widgetName+".preventClickEvent")){I.removeData(ag.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(ai){return af._mouseMove(ai)};this._mouseUpDelegate=function(ai){return af._mouseUp(ai)};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);ag.preventDefault();b=true;return true},_mouseMove:function(ae){if(this._mouseMoved){if(I.ui.ie&&(!document.documentMode||document.documentMode<9)&&!ae.button){return this._mouseUp(ae)}else{if(!ae.which){return this._mouseUp(ae)}}}if(ae.which||ae.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(ae);return ae.preventDefault()}if(this._mouseDistanceMet(ae)&&this._mouseDelayMet(ae)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,ae)!==false);(this._mouseStarted?this._mouseDrag(ae):this._mouseUp(ae))}return !this._mouseStarted},_mouseUp:function(ae){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(ae.target===this._mouseDownEvent.target){I.data(ae.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(ae)}b=false;return false},_mouseDistanceMet:function(ae){return(Math.max(Math.abs(this._mouseDownEvent.pageX-ae.pageX),Math.abs(this._mouseDownEvent.pageY-ae.pageY))>=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});
39
+ /*!
40
+ * jQuery UI Position 1.11.2
41
+ * http://jqueryui.com
42
+ *
43
+ * Copyright 2014 jQuery Foundation and other contributors
44
+ * Released under the MIT license.
45
+ * http://jquery.org/license
46
+ *
47
+ * http://api.jqueryui.com/position/
48
+ */
49
+ (function(){I.ui=I.ui||{};var al,ao,am=Math.max,ar=Math.abs,ap=Math.round,ag=/left|center|right/,aj=/top|center|bottom/,ae=/[\+\-]\d+(\.[\d]+)?%?/,an=/^\w+/,af=/%$/,ai=I.fn.position;function aq(av,au,at){return[parseFloat(av[0])*(af.test(av[0])?au/100:1),parseFloat(av[1])*(af.test(av[1])?at/100:1)]}function ak(at,au){return parseInt(I.css(at,au),10)||0}function ah(au){var at=au[0];if(at.nodeType===9){return{width:au.width(),height:au.height(),offset:{top:0,left:0}}}if(I.isWindow(at)){return{width:au.width(),height:au.height(),offset:{top:au.scrollTop(),left:au.scrollLeft()}}}if(at.preventDefault){return{width:0,height:0,offset:{top:at.pageY,left:at.pageX}}}return{width:au.outerWidth(),height:au.outerHeight(),offset:au.offset()}}I.position={scrollbarWidth:function(){if(al!==undefined){return al}var au,at,aw=I("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),av=aw.children()[0];I("body").append(aw);au=av.offsetWidth;aw.css("overflow","scroll");at=av.offsetWidth;if(au===at){at=aw[0].clientWidth}aw.remove();return(al=au-at)},getScrollInfo:function(ax){var aw=ax.isWindow||ax.isDocument?"":ax.element.css("overflow-x"),av=ax.isWindow||ax.isDocument?"":ax.element.css("overflow-y"),au=aw==="scroll"||(aw==="auto"&&ax.width<ax.element[0].scrollWidth),at=av==="scroll"||(av==="auto"&&ax.height<ax.element[0].scrollHeight);return{width:at?I.position.scrollbarWidth():0,height:au?I.position.scrollbarWidth():0}},getWithinInfo:function(au){var av=I(au||window),at=I.isWindow(av[0]),aw=!!av[0]&&av[0].nodeType===9;return{element:av,isWindow:at,isDocument:aw,offset:av.offset()||{left:0,top:0},scrollLeft:av.scrollLeft(),scrollTop:av.scrollTop(),width:at||aw?av.width():av.outerWidth(),height:at||aw?av.height():av.outerHeight()}}};I.fn.position=function(aD){if(!aD||!aD.of){return ai.apply(this,arguments)}aD=I.extend({},aD);var aE,aA,ay,aC,ax,at,az=I(aD.of),aw=I.position.getWithinInfo(aD.within),au=I.position.getScrollInfo(aw),aB=(aD.collision||"flip").split(" "),av={};at=ah(az);if(az[0].preventDefault){aD.at="left top"}aA=at.width;ay=at.height;aC=at.offset;ax=I.extend({},aC);I.each(["my","at"],function(){var aH=(aD[this]||"").split(" "),aG,aF;if(aH.length===1){aH=ag.test(aH[0])?aH.concat(["center"]):aj.test(aH[0])?["center"].concat(aH):["center","center"]}aH[0]=ag.test(aH[0])?aH[0]:"center";aH[1]=aj.test(aH[1])?aH[1]:"center";aG=ae.exec(aH[0]);aF=ae.exec(aH[1]);av[this]=[aG?aG[0]:0,aF?aF[0]:0];aD[this]=[an.exec(aH[0])[0],an.exec(aH[1])[0]]});if(aB.length===1){aB[1]=aB[0]}if(aD.at[0]==="right"){ax.left+=aA}else{if(aD.at[0]==="center"){ax.left+=aA/2}}if(aD.at[1]==="bottom"){ax.top+=ay}else{if(aD.at[1]==="center"){ax.top+=ay/2}}aE=aq(av.at,aA,ay);ax.left+=aE[0];ax.top+=aE[1];return this.each(function(){var aG,aP,aI=I(this),aK=aI.outerWidth(),aH=aI.outerHeight(),aJ=ak(this,"marginLeft"),aF=ak(this,"marginTop"),aO=aK+aJ+ak(this,"marginRight")+au.width,aN=aH+aF+ak(this,"marginBottom")+au.height,aL=I.extend({},ax),aM=aq(av.my,aI.outerWidth(),aI.outerHeight());if(aD.my[0]==="right"){aL.left-=aK}else{if(aD.my[0]==="center"){aL.left-=aK/2}}if(aD.my[1]==="bottom"){aL.top-=aH}else{if(aD.my[1]==="center"){aL.top-=aH/2}}aL.left+=aM[0];aL.top+=aM[1];if(!ao){aL.left=ap(aL.left);aL.top=ap(aL.top)}aG={marginLeft:aJ,marginTop:aF};I.each(["left","top"],function(aR,aQ){if(I.ui.position[aB[aR]]){I.ui.position[aB[aR]][aQ](aL,{targetWidth:aA,targetHeight:ay,elemWidth:aK,elemHeight:aH,collisionPosition:aG,collisionWidth:aO,collisionHeight:aN,offset:[aE[0]+aM[0],aE[1]+aM[1]],my:aD.my,at:aD.at,within:aw,elem:aI})}});if(aD.using){aP=function(aT){var aV=aC.left-aL.left,aS=aV+aA-aK,aU=aC.top-aL.top,aR=aU+ay-aH,aQ={target:{element:az,left:aC.left,top:aC.top,width:aA,height:ay},element:{element:aI,left:aL.left,top:aL.top,width:aK,height:aH},horizontal:aS<0?"left":aV>0?"right":"center",vertical:aR<0?"top":aU>0?"bottom":"middle"};if(aA<aK&&ar(aV+aS)<aA){aQ.horizontal="center"}if(ay<aH&&ar(aU+aR)<ay){aQ.vertical="middle"}if(am(ar(aV),ar(aS))>am(ar(aU),ar(aR))){aQ.important="horizontal"}else{aQ.important="vertical"}aD.using.call(this,aT,aQ)}}aI.offset(I.extend(aL,{using:aP}))})};I.ui.position={fit:{left:function(ax,aw){var av=aw.within,az=av.isWindow?av.scrollLeft:av.offset.left,aB=av.width,ay=ax.left-aw.collisionPosition.marginLeft,aA=az-ay,au=ay+aw.collisionWidth-aB-az,at;if(aw.collisionWidth>aB){if(aA>0&&au<=0){at=ax.left+aA+aw.collisionWidth-aB-az;ax.left+=aA-at}else{if(au>0&&aA<=0){ax.left=az}else{if(aA>au){ax.left=az+aB-aw.collisionWidth}else{ax.left=az}}}}else{if(aA>0){ax.left+=aA}else{if(au>0){ax.left-=au}else{ax.left=am(ax.left-ay,ax.left)}}}},top:function(aw,av){var au=av.within,aA=au.isWindow?au.scrollTop:au.offset.top,aB=av.within.height,ay=aw.top-av.collisionPosition.marginTop,az=aA-ay,ax=ay+av.collisionHeight-aB-aA,at;if(av.collisionHeight>aB){if(az>0&&ax<=0){at=aw.top+az+av.collisionHeight-aB-aA;aw.top+=az-at}else{if(ax>0&&az<=0){aw.top=aA}else{if(az>ax){aw.top=aA+aB-av.collisionHeight}else{aw.top=aA}}}}else{if(az>0){aw.top+=az}else{if(ax>0){aw.top-=ax}else{aw.top=am(aw.top-ay,aw.top)}}}}},flip:{left:function(az,ay){var ax=ay.within,aD=ax.offset.left+ax.scrollLeft,aG=ax.width,av=ax.isWindow?ax.scrollLeft:ax.offset.left,aA=az.left-ay.collisionPosition.marginLeft,aE=aA-av,au=aA+ay.collisionWidth-aG-av,aC=ay.my[0]==="left"?-ay.elemWidth:ay.my[0]==="right"?ay.elemWidth:0,aF=ay.at[0]==="left"?ay.targetWidth:ay.at[0]==="right"?-ay.targetWidth:0,aw=-2*ay.offset[0],at,aB;if(aE<0){at=az.left+aC+aF+aw+ay.collisionWidth-aG-aD;if(at<0||at<ar(aE)){az.left+=aC+aF+aw}}else{if(au>0){aB=az.left-ay.collisionPosition.marginLeft+aC+aF+aw-av;if(aB>0||ar(aB)<au){az.left+=aC+aF+aw}}}},top:function(ay,ax){var aw=ax.within,aF=aw.offset.top+aw.scrollTop,aG=aw.height,at=aw.isWindow?aw.scrollTop:aw.offset.top,aA=ay.top-ax.collisionPosition.marginTop,aC=aA-at,az=aA+ax.collisionHeight-aG-at,aD=ax.my[1]==="top",aB=aD?-ax.elemHeight:ax.my[1]==="bottom"?ax.elemHeight:0,aH=ax.at[1]==="top"?ax.targetHeight:ax.at[1]==="bottom"?-ax.targetHeight:0,av=-2*ax.offset[1],aE,au;if(aC<0){au=ay.top+aB+aH+av+ax.collisionHeight-aG-aF;if((ay.top+aB+aH+av)>aC&&(au<0||au<ar(aC))){ay.top+=aB+aH+av}}else{if(az>0){aE=ay.top-ax.collisionPosition.marginTop+aB+aH+av-at;if((ay.top+aB+aH+av)>az&&(aE>0||ar(aE)<az)){ay.top+=aB+aH+av}}}}},flipfit:{left:function(){I.ui.position.flip.left.apply(this,arguments);I.ui.position.fit.left.apply(this,arguments)},top:function(){I.ui.position.flip.top.apply(this,arguments);I.ui.position.fit.top.apply(this,arguments)}}};(function(){var ax,az,au,aw,av,at=document.getElementsByTagName("body")[0],ay=document.createElement("div");ax=document.createElement(at?"div":"body");au={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(at){I.extend(au,{position:"absolute",left:"-1000px",top:"-1000px"})}for(av in au){ax.style[av]=au[av]}ax.appendChild(ay);az=at||document.documentElement;az.insertBefore(ax,az.firstChild);ay.style.cssText="position: absolute; left: 10.7432222px;";aw=I(ay).offset().left;ao=aw>10&&aw<11;ax.innerHTML="";az.removeChild(ax)})()})();var P=I.ui.position;
50
+ /*!
51
+ * jQuery UI Accordion 1.11.2
52
+ * http://jqueryui.com
53
+ *
54
+ * Copyright 2014 jQuery Foundation and other contributors
55
+ * Released under the MIT license.
56
+ * http://jquery.org/license
57
+ *
58
+ * http://api.jqueryui.com/accordion/
59
+ */
60
+ var ad=I.widget("ui.accordion",{version:"1.11.2",options:{active:0,animate:{},collapsible:false,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 ae=this.options;this.prevShow=this.prevHide=I();this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist");if(!ae.collapsible&&(ae.active===false||ae.active==null)){ae.active=0}this._processPanels();if(ae.active<0){ae.active+=this.headers.length}this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?I():this.active.next()}},_createIcons:function(){var ae=this.options.icons;if(ae){I("<span>").addClass("ui-accordion-header-icon ui-icon "+ae.header).prependTo(this.headers);this.active.children(".ui-accordion-header-icon").removeClass(ae.header).addClass(ae.activeHeader);this.headers.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var ae;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();ae=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();if(this.options.heightStyle!=="content"){ae.css("height","")}},_setOption:function(ae,af){if(ae==="active"){this._activate(af);return}if(ae==="event"){if(this.options.event){this._off(this.headers,this.options.event)}this._setupEvents(af)}this._super(ae,af);if(ae==="collapsible"&&!af&&this.options.active===false){this._activate(0)}if(ae==="icons"){this._destroyIcons();if(af){this._createIcons()}}if(ae==="disabled"){this.element.toggleClass("ui-state-disabled",!!af).attr("aria-disabled",af);this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!af)}},_keydown:function(ah){if(ah.altKey||ah.ctrlKey){return}var ai=I.ui.keyCode,ag=this.headers.length,ae=this.headers.index(ah.target),af=false;switch(ah.keyCode){case ai.RIGHT:case ai.DOWN:af=this.headers[(ae+1)%ag];break;case ai.LEFT:case ai.UP:af=this.headers[(ae-1+ag)%ag];break;case ai.SPACE:case ai.ENTER:this._eventHandler(ah);break;case ai.HOME:af=this.headers[0];break;case ai.END:af=this.headers[ag-1];break}if(af){I(ah.target).attr("tabIndex",-1);I(af).attr("tabIndex",0);af.focus();ah.preventDefault()}},_panelKeyDown:function(ae){if(ae.keyCode===I.ui.keyCode.UP&&ae.ctrlKey){I(ae.currentTarget).prev().focus()}},refresh:function(){var ae=this.options;this._processPanels();if((ae.active===false&&ae.collapsible===true)||!this.headers.length){ae.active=false;this.active=I()}else{if(ae.active===false){this._activate(0)}else{if(this.active.length&&!I.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){ae.active=false;this.active=I()}else{this._activate(Math.max(0,ae.active-1))}}else{ae.active=this.headers.index(this.active)}}}this._destroyIcons();this._refresh()},_processPanels:function(){var af=this.headers,ae=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();if(ae){this._off(af.not(this.headers));this._off(ae.not(this.panels))}},_refresh:function(){var ah,af=this.options,ae=af.heightStyle,ag=this.element.parent();this.active=this._findActive(af.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 al=I(this),ak=al.uniqueId().attr("id"),ai=al.next(),aj=ai.uniqueId().attr("id");al.attr("aria-controls",aj);ai.attr("aria-labelledby",ak)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0)}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"})}this._createIcons();this._setupEvents(af.event);if(ae==="fill"){ah=ag.height();this.element.siblings(":visible").each(function(){var aj=I(this),ai=aj.css("position");if(ai==="absolute"||ai==="fixed"){return}ah-=aj.outerHeight(true)});this.headers.each(function(){ah-=I(this).outerHeight(true)});this.headers.next().each(function(){I(this).height(Math.max(0,ah-I(this).innerHeight()+I(this).height()))}).css("overflow","auto")}else{if(ae==="auto"){ah=0;this.headers.next().each(function(){ah=Math.max(ah,I(this).css("height","").height())}).height(ah)}}},_activate:function(ae){var af=this._findActive(ae)[0];if(af===this.active[0]){return}af=af||this.active[0];this._eventHandler({target:af,currentTarget:af,preventDefault:I.noop})},_findActive:function(ae){return typeof ae==="number"?this.headers.eq(ae):I()},_setupEvents:function(af){var ae={keydown:"_keydown"};if(af){I.each(af.split(" "),function(ah,ag){ae[ag]="_eventHandler"})}this._off(this.headers.add(this.headers.next()));this._on(this.headers,ae);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers)},_eventHandler:function(ae){var am=this.options,ah=this.active,ai=I(ae.currentTarget),ak=ai[0]===ah[0],af=ak&&am.collapsible,ag=af?I():ai.next(),aj=ah.next(),al={oldHeader:ah,oldPanel:aj,newHeader:af?I():ai,newPanel:ag};ae.preventDefault();if((ak&&!am.collapsible)||(this._trigger("beforeActivate",ae,al)===false)){return}am.active=af?false:this.headers.index(ai);this.active=ak?I():ai;this._toggle(al);ah.removeClass("ui-accordion-header-active ui-state-active");if(am.icons){ah.children(".ui-accordion-header-icon").removeClass(am.icons.activeHeader).addClass(am.icons.header)}if(!ak){ai.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top");if(am.icons){ai.children(".ui-accordion-header-icon").removeClass(am.icons.header).addClass(am.icons.activeHeader)}ai.next().addClass("ui-accordion-content-active")}},_toggle:function(ag){var ae=ag.newPanel,af=this.prevShow.length?this.prevShow:ag.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=ae;this.prevHide=af;if(this.options.animate){this._animate(ae,af,ag)}else{af.hide();ae.show();this._toggleComplete(ag)}af.attr({"aria-hidden":"true"});af.prev().attr("aria-selected","false");if(ae.length&&af.length){af.prev().attr({tabIndex:-1,"aria-expanded":"false"})}else{if(ae.length){this.headers.filter(function(){return I(this).attr("tabIndex")===0}).attr("tabIndex",-1)}}ae.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(ae,am,ai){var al,ak,ah,aj=this,an=0,ao=ae.length&&(!am.length||(ae.index()<am.index())),ag=this.options.animate||{},ap=ao&&ag.down||ag,af=function(){aj._toggleComplete(ai)};if(typeof ap==="number"){ah=ap}if(typeof ap==="string"){ak=ap}ak=ak||ap.easing||ag.easing;ah=ah||ap.duration||ag.duration;if(!am.length){return ae.animate(this.showProps,ah,ak,af)}if(!ae.length){return am.animate(this.hideProps,ah,ak,af)}al=ae.show().outerHeight();am.animate(this.hideProps,{duration:ah,easing:ak,step:function(aq,ar){ar.now=Math.round(aq)}});ae.hide().animate(this.showProps,{duration:ah,easing:ak,complete:af,step:function(aq,ar){ar.now=Math.round(aq);if(ar.prop!=="height"){an+=ar.now}else{if(aj.options.heightStyle!=="content"){ar.now=Math.round(al-am.outerHeight()-an);an=0}}}})},_toggleComplete:function(af){var ae=af.oldPanel;ae.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all");if(ae.length){ae.parent()[0].className=ae.parent()[0].className}this._trigger("activate",null,af)}});
61
+ /*!
62
+ * jQuery UI Menu 1.11.2
63
+ * http://jqueryui.com
64
+ *
65
+ * Copyright 2014 jQuery Foundation and other contributors
66
+ * Released under the MIT license.
67
+ * http://jquery.org/license
68
+ *
69
+ * http://api.jqueryui.com/menu/
70
+ */
71
+ var aa=I.widget("ui.menu",{version:"1.11.2",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=false;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});if(this.options.disabled){this.element.addClass("ui-state-disabled").attr("aria-disabled","true")}this._on({"mousedown .ui-menu-item":function(ae){ae.preventDefault()},"click .ui-menu-item":function(ae){var af=I(ae.target);if(!this.mouseHandled&&af.not(".ui-state-disabled").length){this.select(ae);if(!ae.isPropagationStopped()){this.mouseHandled=true}if(af.has(".ui-menu").length){this.expand(ae)}else{if(!this.element.is(":focus")&&I(this.document[0].activeElement).closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer)}}}}},"mouseenter .ui-menu-item":function(ae){if(this.previousFilter){return}var af=I(ae.currentTarget);af.siblings(".ui-state-active").removeClass("ui-state-active");this.focus(ae,af)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(ag,ae){var af=this.active||this.element.find(this.options.items).eq(0);if(!ae){this.focus(ag,af)}},blur:function(ae){this._delay(function(){if(!I.contains(this.element[0],this.document[0].activeElement)){this.collapseAll(ae)}})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(ae){if(this._closeOnDocumentClick(ae)){this.collapseAll(ae)}this.mouseHandled=false}})},_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 ae=I(this);if(ae.data("ui-menu-submenu-carat")){ae.remove()}});this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(ai){var af,ah,aj,ag,ae=true;switch(ai.keyCode){case I.ui.keyCode.PAGE_UP:this.previousPage(ai);break;case I.ui.keyCode.PAGE_DOWN:this.nextPage(ai);break;case I.ui.keyCode.HOME:this._move("first","first",ai);break;case I.ui.keyCode.END:this._move("last","last",ai);break;case I.ui.keyCode.UP:this.previous(ai);break;case I.ui.keyCode.DOWN:this.next(ai);break;case I.ui.keyCode.LEFT:this.collapse(ai);break;case I.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(ai)}break;case I.ui.keyCode.ENTER:case I.ui.keyCode.SPACE:this._activate(ai);break;case I.ui.keyCode.ESCAPE:this.collapse(ai);break;default:ae=false;ah=this.previousFilter||"";aj=String.fromCharCode(ai.keyCode);ag=false;clearTimeout(this.filterTimer);if(aj===ah){ag=true}else{aj=ah+aj}af=this._filterMenuItems(aj);af=ag&&af.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):af;if(!af.length){aj=String.fromCharCode(ai.keyCode);af=this._filterMenuItems(aj)}if(af.length){this.focus(ai,af);this.previousFilter=aj;this.filterTimer=this._delay(function(){delete this.previousFilter},1000)}else{delete this.previousFilter}}if(ae){ai.preventDefault()}},_activate:function(ae){if(!this.active.is(".ui-state-disabled")){if(this.active.is("[aria-haspopup='true']")){this.expand(ae)}else{this.select(ae)}}},refresh:function(){var ai,af,ah=this,ag=this.options.icons.submenu,ae=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length);ae.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 al=I(this),ak=al.parent(),aj=I("<span>").addClass("ui-menu-icon ui-icon "+ag).data("ui-menu-submenu-carat",true);ak.attr("aria-haspopup","true").prepend(aj);al.attr("aria-labelledby",ak.attr("id"))});ai=ae.add(this.element);af=ai.find(this.options.items);af.not(".ui-menu-item").each(function(){var aj=I(this);if(ah._isDivider(aj)){aj.addClass("ui-widget-content ui-menu-divider")}});af.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()});af.filter(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!I.contains(this.element[0],this.active[0])){this.blur()}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(ae,af){if(ae==="icons"){this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(af.submenu)}if(ae==="disabled"){this.element.toggleClass("ui-state-disabled",!!af).attr("aria-disabled",af)}this._super(ae,af)},focus:function(af,ae){var ah,ag;this.blur(af,af&&af.type==="focus");this._scrollIntoView(ae);this.active=ae.first();ag=this.active.addClass("ui-state-focus").removeClass("ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",ag.attr("id"))}this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");if(af&&af.type==="keydown"){this._close()}else{this.timer=this._delay(function(){this._close()},this.delay)}ah=ae.children(".ui-menu");if(ah.length&&af&&(/^mouse/.test(af.type))){this._startOpening(ah)}this.activeMenu=ae.parent();this._trigger("focus",af,{item:ae})},_scrollIntoView:function(ah){var ak,ag,ai,ae,af,aj;if(this._hasScroll()){ak=parseFloat(I.css(this.activeMenu[0],"borderTopWidth"))||0;ag=parseFloat(I.css(this.activeMenu[0],"paddingTop"))||0;ai=ah.offset().top-this.activeMenu.offset().top-ak-ag;ae=this.activeMenu.scrollTop();af=this.activeMenu.height();aj=ah.outerHeight();if(ai<0){this.activeMenu.scrollTop(ae+ai)}else{if(ai+aj>af){this.activeMenu.scrollTop(ae+ai-af+aj)}}}},blur:function(af,ae){if(!ae){clearTimeout(this.timer)}if(!this.active){return}this.active.removeClass("ui-state-focus");this.active=null;this._trigger("blur",af,{item:this.active})},_startOpening:function(ae){clearTimeout(this.timer);if(ae.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();this._open(ae)},this.delay)},_open:function(af){var ae=I.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(af.parents(".ui-menu")).hide().attr("aria-hidden","true");af.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(ae)},collapseAll:function(af,ae){clearTimeout(this.timer);this.timer=this._delay(function(){var ag=ae?this.element:I(af&&af.target).closest(this.element.find(".ui-menu"));if(!ag.length){ag=this.element}this._close(ag);this.blur(af);this.activeMenu=ag},this.delay)},_close:function(ae){if(!ae){ae=this.active?this.active.parent():this.element}ae.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(ae){return !I(ae.target).closest(".ui-menu").length},_isDivider:function(ae){return !/[^\-\u2014\u2013\s]/.test(ae.text())},collapse:function(af){var ae=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(ae&&ae.length){this._close();this.focus(af,ae)}},expand:function(af){var ae=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();if(ae&&ae.length){this._open(ae.parent());this._delay(function(){this.focus(af,ae)})}},next:function(ae){this._move("next","first",ae)},previous:function(ae){this._move("prev","last",ae)},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(ah,af,ag){var ae;if(this.active){if(ah==="first"||ah==="last"){ae=this.active[ah==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1)}else{ae=this.active[ah+"All"](".ui-menu-item").eq(0)}}if(!ae||!ae.length||!this.active){ae=this.activeMenu.find(this.options.items)[af]()}this.focus(ag,ae)},nextPage:function(ag){var af,ah,ae;if(!this.active){this.next(ag);return}if(this.isLastItem()){return}if(this._hasScroll()){ah=this.active.offset().top;ae=this.element.height();this.active.nextAll(".ui-menu-item").each(function(){af=I(this);return af.offset().top-ah-ae<0});this.focus(ag,af)}else{this.focus(ag,this.activeMenu.find(this.options.items)[!this.active?"first":"last"]())}},previousPage:function(ag){var af,ah,ae;if(!this.active){this.next(ag);return}if(this.isFirstItem()){return}if(this._hasScroll()){ah=this.active.offset().top;ae=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){af=I(this);return af.offset().top-ah+ae>0});this.focus(ag,af)}else{this.focus(ag,this.activeMenu.find(this.options.items).first())}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(ae){this.active=this.active||I(ae.target).closest(".ui-menu-item");var af={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(ae,true)}this._trigger("select",ae,af)},_filterMenuItems:function(ag){var ae=ag.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),af=new RegExp("^"+ae,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return af.test(I.trim(I(this).text()))})}});
72
+ /*!
73
+ * jQuery UI Autocomplete 1.11.2
74
+ * http://jqueryui.com
75
+ *
76
+ * Copyright 2014 jQuery Foundation and other contributors
77
+ * Released under the MIT license.
78
+ * http://jquery.org/license
79
+ *
80
+ * http://api.jqueryui.com/autocomplete/
81
+ */
82
+ I.widget("ui.autocomplete",{version:"1.11.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,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 ag,ae,ah,aj=this.element[0].nodeName.toLowerCase(),ai=aj==="textarea",af=aj==="input";this.isMultiLine=ai?true:af?false:this.element.prop("isContentEditable");this.valueMethod=this.element[ai||af?"val":"text"];this.isNewMenu=true;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off");this._on(this.element,{keydown:function(ak){if(this.element.prop("readOnly")){ag=true;ah=true;ae=true;return}ag=false;ah=false;ae=false;var al=I.ui.keyCode;switch(ak.keyCode){case al.PAGE_UP:ag=true;this._move("previousPage",ak);break;case al.PAGE_DOWN:ag=true;this._move("nextPage",ak);break;case al.UP:ag=true;this._keyEvent("previous",ak);break;case al.DOWN:ag=true;this._keyEvent("next",ak);break;case al.ENTER:if(this.menu.active){ag=true;ak.preventDefault();this.menu.select(ak)}break;case al.TAB:if(this.menu.active){this.menu.select(ak)}break;case al.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term)}this.close(ak);ak.preventDefault()}break;default:ae=true;this._searchTimeout(ak);break}},keypress:function(ak){if(ag){ag=false;if(!this.isMultiLine||this.menu.element.is(":visible")){ak.preventDefault()}return}if(ae){return}var al=I.ui.keyCode;switch(ak.keyCode){case al.PAGE_UP:this._move("previousPage",ak);break;case al.PAGE_DOWN:this._move("nextPage",ak);break;case al.UP:this._keyEvent("previous",ak);break;case al.DOWN:this._keyEvent("next",ak);break}},input:function(ak){if(ah){ah=false;ak.preventDefault();return}this._searchTimeout(ak)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(ak){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching);this.close(ak);this._change(ak)}});this._initSource();this.menu=I("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance");this._on(this.menu.element,{mousedown:function(ak){ak.preventDefault();this.cancelBlur=true;this._delay(function(){delete this.cancelBlur});var al=this.menu.element[0];if(!I(ak.target).closest(".ui-menu-item").length){this._delay(function(){var am=this;this.document.one("mousedown",function(an){if(an.target!==am.element[0]&&an.target!==al&&!I.contains(al,an.target)){am.close()}})})}},menufocus:function(am,an){var ak,al;if(this.isNewMenu){this.isNewMenu=false;if(am.originalEvent&&/^mouse/.test(am.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){I(am.target).trigger(am.originalEvent)});return}}al=an.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",am,{item:al})){if(am.originalEvent&&/^key/.test(am.originalEvent.type)){this._value(al.value)}}ak=an.item.attr("aria-label")||al.value;if(ak&&I.trim(ak).length){this.liveRegion.children().hide();I("<div>").text(ak).appendTo(this.liveRegion)}},menuselect:function(am,an){var al=an.item.data("ui-autocomplete-item"),ak=this.previous;if(this.element[0]!==this.document[0].activeElement){this.element.focus();this.previous=ak;this._delay(function(){this.previous=ak;this.selectedItem=al})}if(false!==this._trigger("select",am,{item:al})){this._value(al.value)}this.term=this._value();this.close(am);this.selectedItem=al}});this.liveRegion=I("<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(ae,af){this._super(ae,af);if(ae==="source"){this._initSource()}if(ae==="appendTo"){this.menu.element.appendTo(this._appendTo())}if(ae==="disabled"&&af&&this.xhr){this.xhr.abort()}},_appendTo:function(){var ae=this.options.appendTo;if(ae){ae=ae.jquery||ae.nodeType?I(ae):this.document.find(ae).eq(0)}if(!ae||!ae[0]){ae=this.element.closest(".ui-front")}if(!ae.length){ae=this.document[0].body}return ae},_initSource:function(){var ag,ae,af=this;if(I.isArray(this.options.source)){ag=this.options.source;this.source=function(ai,ah){ah(I.ui.autocomplete.filter(ag,ai.term))}}else{if(typeof this.options.source==="string"){ae=this.options.source;this.source=function(ai,ah){if(af.xhr){af.xhr.abort()}af.xhr=I.ajax({url:ae,data:ai,dataType:"json",success:function(aj){ah(aj)},error:function(){ah([])}})}}else{this.source=this.options.source}}},_searchTimeout:function(ae){clearTimeout(this.searching);this.searching=this._delay(function(){var ag=this.term===this._value(),af=this.menu.element.is(":visible"),ah=ae.altKey||ae.ctrlKey||ae.metaKey||ae.shiftKey;if(!ag||(ag&&!af&&!ah)){this.selectedItem=null;this.search(null,ae)}},this.options.delay)},search:function(af,ae){af=af!=null?af:this._value();this.term=this._value();if(af.length<this.options.minLength){return this.close(ae)}if(this._trigger("search",ae)===false){return}return this._search(af)},_search:function(ae){this.pending++;this.element.addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:ae},this._response())},_response:function(){var ae=++this.requestIndex;return I.proxy(function(af){if(ae===this.requestIndex){this.__response(af)}this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading")}},this)},__response:function(ae){if(ae){ae=this._normalize(ae)}this._trigger("response",null,{content:ae});if(!this.options.disabled&&ae&&ae.length&&!this.cancelSearch){this._suggest(ae);this._trigger("open")}else{this._close()}},close:function(ae){this.cancelSearch=true;this._close(ae)},_close:function(ae){if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",ae)}},_change:function(ae){if(this.previous!==this._value()){this._trigger("change",ae,{item:this.selectedItem})}},_normalize:function(ae){if(ae.length&&ae[0].label&&ae[0].value){return ae}return I.map(ae,function(af){if(typeof af==="string"){return{label:af,value:af}}return I.extend({},af,{label:af.label||af.value,value:af.value||af.label})})},_suggest:function(ae){var af=this.menu.element.empty();this._renderMenu(af,ae);this.isNewMenu=true;this.menu.refresh();af.show();this._resizeMenu();af.position(I.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next()}},_resizeMenu:function(){var ae=this.menu.element;ae.outerWidth(Math.max(ae.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(af,ae){var ag=this;I.each(ae,function(ah,ai){ag._renderItemData(af,ai)})},_renderItemData:function(ae,af){return this._renderItem(ae,af).data("ui-autocomplete-item",af)},_renderItem:function(ae,af){return I("<li>").text(af.label).appendTo(ae)},_move:function(af,ae){if(!this.menu.element.is(":visible")){this.search(null,ae);return}if(this.menu.isFirstItem()&&/^previous/.test(af)||this.menu.isLastItem()&&/^next/.test(af)){if(!this.isMultiLine){this._value(this.term)}this.menu.blur();return}this.menu[af](ae)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(af,ae){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(af,ae);ae.preventDefault()}}});I.extend(I.ui.autocomplete,{escapeRegex:function(ae){return ae.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(ag,ae){var af=new RegExp(I.ui.autocomplete.escapeRegex(ae),"i");return I.grep(ag,function(ah){return af.test(ah.label||ah.value||ah)})}});I.widget("ui.autocomplete",I.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(ae){return ae+(ae>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(af){var ae;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return}if(af&&af.length){ae=this.options.messages.results(af.length)}else{ae=this.options.messages.noResults}this.liveRegion.children().hide();I("<div>").text(ae).appendTo(this.liveRegion)}});var c=I.ui.autocomplete;
83
+ /*!
84
+ * jQuery UI Button 1.11.2
85
+ * http://jqueryui.com
86
+ *
87
+ * Copyright 2014 jQuery Foundation and other contributors
88
+ * Released under the MIT license.
89
+ * http://jquery.org/license
90
+ *
91
+ * http://api.jqueryui.com/button/
92
+ */
93
+ var r,Y="ui-button ui-widget ui-state-default ui-corner-all",y="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",n=function(){var ae=I(this);setTimeout(function(){ae.find(":ui-button").button("refresh")},1)},z=function(af){var ae=af.name,ag=af.form,ah=I([]);if(ae){ae=ae.replace(/'/g,"\\'");if(ag){ah=I(ag).find("[name='"+ae+"'][type=radio]")}else{ah=I("[name='"+ae+"'][type=radio]",af.ownerDocument).filter(function(){return !this.form})}}return ah};I.widget("ui.button",{version:"1.11.2",defaultElement:"<button>",options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,n);if(typeof this.options.disabled!=="boolean"){this.options.disabled=!!this.element.prop("disabled")}else{this.element.prop("disabled",this.options.disabled)}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var ag=this,ae=this.options,ah=this.type==="checkbox"||this.type==="radio",af=!ah?"ui-state-active":"";if(ae.label===null){ae.label=(this.type==="input"?this.buttonElement.val():this.buttonElement.html())}this._hoverable(this.buttonElement);this.buttonElement.addClass(Y).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(ae.disabled){return}if(this===r){I(this).addClass("ui-state-active")}}).bind("mouseleave"+this.eventNamespace,function(){if(ae.disabled){return}I(this).removeClass(af)}).bind("click"+this.eventNamespace,function(ai){if(ae.disabled){ai.preventDefault();ai.stopImmediatePropagation()}});this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}});if(ah){this.element.bind("change"+this.eventNamespace,function(){ag.refresh()})}if(this.type==="checkbox"){this.buttonElement.bind("click"+this.eventNamespace,function(){if(ae.disabled){return false}})}else{if(this.type==="radio"){this.buttonElement.bind("click"+this.eventNamespace,function(){if(ae.disabled){return false}I(this).addClass("ui-state-active");ag.buttonElement.attr("aria-pressed","true");var ai=ag.element[0];z(ai).not(ai).map(function(){return I(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")})}else{this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(ae.disabled){return false}I(this).addClass("ui-state-active");r=this;ag.document.one("mouseup",function(){r=null})}).bind("mouseup"+this.eventNamespace,function(){if(ae.disabled){return false}I(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(ai){if(ae.disabled){return false}if(ai.keyCode===I.ui.keyCode.SPACE||ai.keyCode===I.ui.keyCode.ENTER){I(this).addClass("ui-state-active")}}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){I(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(ai){if(ai.keyCode===I.ui.keyCode.SPACE){I(this).click()}})}}}this._setOption("disabled",ae.disabled);this._resetButton()},_determineButtonType:function(){var ae,ag,af;if(this.element.is("[type=checkbox]")){this.type="checkbox"}else{if(this.element.is("[type=radio]")){this.type="radio"}else{if(this.element.is("input")){this.type="input"}else{this.type="button"}}}if(this.type==="checkbox"||this.type==="radio"){ae=this.element.parents().last();ag="label[for='"+this.element.attr("id")+"']";this.buttonElement=ae.find(ag);if(!this.buttonElement.length){ae=ae.length?ae.siblings():this.element.siblings();this.buttonElement=ae.filter(ag);if(!this.buttonElement.length){this.buttonElement=ae.find(ag)}}this.element.addClass("ui-helper-hidden-accessible");af=this.element.is(":checked");if(af){this.buttonElement.addClass("ui-state-active")}this.buttonElement.prop("aria-pressed",af)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(Y+" ui-state-active "+y).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}},_setOption:function(ae,af){this._super(ae,af);if(ae==="disabled"){this.widget().toggleClass("ui-state-disabled",!!af);this.element.prop("disabled",!!af);if(af){if(this.type==="checkbox"||this.type==="radio"){this.buttonElement.removeClass("ui-state-focus")}else{this.buttonElement.removeClass("ui-state-focus ui-state-active")}}return}this._resetButton()},refresh:function(){var ae=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");if(ae!==this.options.disabled){this._setOption("disabled",ae)}if(this.type==="radio"){z(this.element[0]).each(function(){if(I(this).is(":checked")){I(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true")}else{I(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}})}else{if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true")}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")}}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var ai=this.buttonElement.removeClass(y),ag=I("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(ai.empty()).text(),af=this.options.icons,ae=af.primary&&af.secondary,ah=[];if(af.primary||af.secondary){if(this.options.text){ah.push("ui-button-text-icon"+(ae?"s":(af.primary?"-primary":"-secondary")))}if(af.primary){ai.prepend("<span class='ui-button-icon-primary ui-icon "+af.primary+"'></span>")}if(af.secondary){ai.append("<span class='ui-button-icon-secondary ui-icon "+af.secondary+"'></span>")}if(!this.options.text){ah.push(ae?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){ai.attr("title",I.trim(ag))}}}else{ah.push("ui-button-text-only")}ai.addClass(ah.join(" "))}});I.widget("ui.buttonset",{version:"1.11.2",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(ae,af){if(ae==="disabled"){this.buttons.button("option",ae,af)}this._super(ae,af)},refresh:function(){var af=this.element.css("direction")==="rtl",ae=this.element.find(this.options.items),ag=ae.filter(":ui-button");ae.not(":ui-button").button();ag.button("refresh");this.buttons=ae.map(function(){return I(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(af?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(af?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return I(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}});var q=I.ui.button;
94
+ /*!
95
+ * jQuery UI Datepicker 1.11.2
96
+ * http://jqueryui.com
97
+ *
98
+ * Copyright 2014 jQuery Foundation and other contributors
99
+ * Released under the MIT license.
100
+ * http://jquery.org/license
101
+ *
102
+ * http://api.jqueryui.com/datepicker/
103
+ */
104
+ I.extend(I.ui,{datepicker:{version:"1.11.2"}});var l;function t(af){var ae,ag;while(af.length&&af[0]!==document){ae=af.css("position");if(ae==="absolute"||ae==="relative"||ae==="fixed"){ag=parseInt(af.css("zIndex"),10);if(!isNaN(ag)&&ag!==0){return ag}}af=af.parent()}return 0}function ac(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;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:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,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:true,showButtonPanel:false,autoSize:false,disabled:false};I.extend(this._defaults,this.regional[""]);this.regional.en=I.extend(true,{},this.regional[""]);this.regional["en-US"]=I.extend(true,{},this.regional.en);this.dpDiv=h(I("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}I.extend(ac.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(ae){x(this._defaults,ae||{});return this},_attachDatepicker:function(ah,ae){var ai,ag,af;ai=ah.nodeName.toLowerCase();ag=(ai==="div"||ai==="span");if(!ah.id){this.uuid+=1;ah.id="dp"+this.uuid}af=this._newInst(I(ah),ag);af.settings=I.extend({},ae||{});if(ai==="input"){this._connectDatepicker(ah,af)}else{if(ag){this._inlineDatepicker(ah,af)}}},_newInst:function(af,ae){var ag=af[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:ag,input:af,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:ae,dpDiv:(!ae?this.dpDiv:h(I("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))}},_connectDatepicker:function(ag,af){var ae=I(ag);af.append=I([]);af.trigger=I([]);if(ae.hasClass(this.markerClassName)){return}this._attachments(ae,af);ae.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp);this._autoSize(af);I.data(ag,"datepicker",af);if(af.settings.disabled){this._disableDatepicker(ag)}},_attachments:function(ag,aj){var af,ai,ae,ak=this._get(aj,"appendText"),ah=this._get(aj,"isRTL");if(aj.append){aj.append.remove()}if(ak){aj.append=I("<span class='"+this._appendClass+"'>"+ak+"</span>");ag[ah?"before":"after"](aj.append)}ag.unbind("focus",this._showDatepicker);if(aj.trigger){aj.trigger.remove()}af=this._get(aj,"showOn");if(af==="focus"||af==="both"){ag.focus(this._showDatepicker)}if(af==="button"||af==="both"){ai=this._get(aj,"buttonText");ae=this._get(aj,"buttonImage");aj.trigger=I(this._get(aj,"buttonImageOnly")?I("<img/>").addClass(this._triggerClass).attr({src:ae,alt:ai,title:ai}):I("<button type='button'></button>").addClass(this._triggerClass).html(!ae?ai:I("<img/>").attr({src:ae,alt:ai,title:ai})));ag[ah?"before":"after"](aj.trigger);aj.trigger.click(function(){if(I.datepicker._datepickerShowing&&I.datepicker._lastInput===ag[0]){I.datepicker._hideDatepicker()}else{if(I.datepicker._datepickerShowing&&I.datepicker._lastInput!==ag[0]){I.datepicker._hideDatepicker();I.datepicker._showDatepicker(ag[0])}else{I.datepicker._showDatepicker(ag[0])}}return false})}},_autoSize:function(ak){if(this._get(ak,"autoSize")&&!ak.inline){var ah,af,ag,aj,ai=new Date(2009,12-1,20),ae=this._get(ak,"dateFormat");if(ae.match(/[DM]/)){ah=function(al){af=0;ag=0;for(aj=0;aj<al.length;aj++){if(al[aj].length>af){af=al[aj].length;ag=aj}}return ag};ai.setMonth(ah(this._get(ak,(ae.match(/MM/)?"monthNames":"monthNamesShort"))));ai.setDate(ah(this._get(ak,(ae.match(/DD/)?"dayNames":"dayNamesShort")))+20-ai.getDay())}ak.input.attr("size",this._formatDate(ak,ai).length)}},_inlineDatepicker:function(af,ae){var ag=I(af);if(ag.hasClass(this.markerClassName)){return}ag.addClass(this.markerClassName).append(ae.dpDiv);I.data(af,"datepicker",ae);this._setDate(ae,this._getDefaultDate(ae),true);this._updateDatepicker(ae);this._updateAlternate(ae);if(ae.settings.disabled){this._disableDatepicker(af)}ae.dpDiv.css("display","block")},_dialogDatepicker:function(al,af,aj,ag,ak){var ae,ao,ai,an,am,ah=this._dialogInst;if(!ah){this.uuid+=1;ae="dp"+this.uuid;this._dialogInput=I("<input type='text' id='"+ae+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.keydown(this._doKeyDown);I("body").append(this._dialogInput);ah=this._dialogInst=this._newInst(this._dialogInput,false);ah.settings={};I.data(this._dialogInput[0],"datepicker",ah)}x(ah.settings,ag||{});af=(af&&af.constructor===Date?this._formatDate(ah,af):af);this._dialogInput.val(af);this._pos=(ak?(ak.length?ak:[ak.pageX,ak.pageY]):null);if(!this._pos){ao=document.documentElement.clientWidth;ai=document.documentElement.clientHeight;an=document.documentElement.scrollLeft||document.body.scrollLeft;am=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(ao/2)-100+an,(ai/2)-150+am]}this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");ah.settings.onSelect=aj;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if(I.blockUI){I.blockUI(this.dpDiv)}I.data(this._dialogInput[0],"datepicker",ah);return this},_destroyDatepicker:function(ag){var ah,ae=I(ag),af=I.data(ag,"datepicker");if(!ae.hasClass(this.markerClassName)){return}ah=ag.nodeName.toLowerCase();I.removeData(ag,"datepicker");if(ah==="input"){af.append.remove();af.trigger.remove();ae.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else{if(ah==="div"||ah==="span"){ae.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(ah){var ai,ag,ae=I(ah),af=I.data(ah,"datepicker");if(!ae.hasClass(this.markerClassName)){return}ai=ah.nodeName.toLowerCase();if(ai==="input"){ah.disabled=false;af.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(ai==="div"||ai==="span"){ag=ae.children("."+this._inlineClass);ag.children().removeClass("ui-state-disabled");ag.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false)}}this._disabledInputs=I.map(this._disabledInputs,function(aj){return(aj===ah?null:aj)})},_disableDatepicker:function(ah){var ai,ag,ae=I(ah),af=I.data(ah,"datepicker");if(!ae.hasClass(this.markerClassName)){return}ai=ah.nodeName.toLowerCase();if(ai==="input"){ah.disabled=true;af.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(ai==="div"||ai==="span"){ag=ae.children("."+this._inlineClass);ag.children().addClass("ui-state-disabled");ag.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true)}}this._disabledInputs=I.map(this._disabledInputs,function(aj){return(aj===ah?null:aj)});this._disabledInputs[this._disabledInputs.length]=ah},_isDisabledDatepicker:function(af){if(!af){return false}for(var ae=0;ae<this._disabledInputs.length;ae++){if(this._disabledInputs[ae]===af){return true}}return false},_getInst:function(af){try{return I.data(af,"datepicker")}catch(ae){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(ak,af,aj){var ag,ae,ai,al,ah=this._getInst(ak);if(arguments.length===2&&typeof af==="string"){return(af==="defaults"?I.extend({},I.datepicker._defaults):(ah?(af==="all"?I.extend({},ah.settings):this._get(ah,af)):null))}ag=af||{};if(typeof af==="string"){ag={};ag[af]=aj}if(ah){if(this._curInst===ah){this._hideDatepicker()}ae=this._getDateDatepicker(ak,true);ai=this._getMinMaxDate(ah,"min");al=this._getMinMaxDate(ah,"max");x(ah.settings,ag);if(ai!==null&&ag.dateFormat!==undefined&&ag.minDate===undefined){ah.settings.minDate=this._formatDate(ah,ai)}if(al!==null&&ag.dateFormat!==undefined&&ag.maxDate===undefined){ah.settings.maxDate=this._formatDate(ah,al)}if("disabled" in ag){if(ag.disabled){this._disableDatepicker(ak)}else{this._enableDatepicker(ak)}}this._attachments(I(ak),ah);this._autoSize(ah);this._setDate(ah,ae);this._updateAlternate(ah);this._updateDatepicker(ah)}},_changeDatepicker:function(ag,ae,af){this._optionDatepicker(ag,ae,af)},_refreshDatepicker:function(af){var ae=this._getInst(af);if(ae){this._updateDatepicker(ae)}},_setDateDatepicker:function(ag,ae){var af=this._getInst(ag);if(af){this._setDate(af,ae);this._updateDatepicker(af);this._updateAlternate(af)}},_getDateDatepicker:function(ag,ae){var af=this._getInst(ag);if(af&&!af.inline){this._setDateFromField(af,ae)}return(af?this._getDate(af):null)},_doKeyDown:function(ah){var af,ae,aj,ai=I.datepicker._getInst(ah.target),ak=true,ag=ai.dpDiv.is(".ui-datepicker-rtl");ai._keyEvent=true;if(I.datepicker._datepickerShowing){switch(ah.keyCode){case 9:I.datepicker._hideDatepicker();ak=false;break;case 13:aj=I("td."+I.datepicker._dayOverClass+":not(."+I.datepicker._currentClass+")",ai.dpDiv);if(aj[0]){I.datepicker._selectDay(ah.target,ai.selectedMonth,ai.selectedYear,aj[0])}af=I.datepicker._get(ai,"onSelect");if(af){ae=I.datepicker._formatDate(ai);af.apply((ai.input?ai.input[0]:null),[ae,ai])}else{I.datepicker._hideDatepicker()}return false;case 27:I.datepicker._hideDatepicker();break;case 33:I.datepicker._adjustDate(ah.target,(ah.ctrlKey?-I.datepicker._get(ai,"stepBigMonths"):-I.datepicker._get(ai,"stepMonths")),"M");break;case 34:I.datepicker._adjustDate(ah.target,(ah.ctrlKey?+I.datepicker._get(ai,"stepBigMonths"):+I.datepicker._get(ai,"stepMonths")),"M");break;case 35:if(ah.ctrlKey||ah.metaKey){I.datepicker._clearDate(ah.target)}ak=ah.ctrlKey||ah.metaKey;break;case 36:if(ah.ctrlKey||ah.metaKey){I.datepicker._gotoToday(ah.target)}ak=ah.ctrlKey||ah.metaKey;break;case 37:if(ah.ctrlKey||ah.metaKey){I.datepicker._adjustDate(ah.target,(ag?+1:-1),"D")}ak=ah.ctrlKey||ah.metaKey;if(ah.originalEvent.altKey){I.datepicker._adjustDate(ah.target,(ah.ctrlKey?-I.datepicker._get(ai,"stepBigMonths"):-I.datepicker._get(ai,"stepMonths")),"M")}break;case 38:if(ah.ctrlKey||ah.metaKey){I.datepicker._adjustDate(ah.target,-7,"D")}ak=ah.ctrlKey||ah.metaKey;break;case 39:if(ah.ctrlKey||ah.metaKey){I.datepicker._adjustDate(ah.target,(ag?-1:+1),"D")}ak=ah.ctrlKey||ah.metaKey;if(ah.originalEvent.altKey){I.datepicker._adjustDate(ah.target,(ah.ctrlKey?+I.datepicker._get(ai,"stepBigMonths"):+I.datepicker._get(ai,"stepMonths")),"M")}break;case 40:if(ah.ctrlKey||ah.metaKey){I.datepicker._adjustDate(ah.target,+7,"D")}ak=ah.ctrlKey||ah.metaKey;break;default:ak=false}}else{if(ah.keyCode===36&&ah.ctrlKey){I.datepicker._showDatepicker(this)}else{ak=false}}if(ak){ah.preventDefault();ah.stopPropagation()}},_doKeyPress:function(ag){var af,ae,ah=I.datepicker._getInst(ag.target);if(I.datepicker._get(ah,"constrainInput")){af=I.datepicker._possibleChars(I.datepicker._get(ah,"dateFormat"));ae=String.fromCharCode(ag.charCode==null?ag.keyCode:ag.charCode);return ag.ctrlKey||ag.metaKey||(ae<" "||!af||af.indexOf(ae)>-1)}},_doKeyUp:function(ag){var ae,ah=I.datepicker._getInst(ag.target);if(ah.input.val()!==ah.lastVal){try{ae=I.datepicker.parseDate(I.datepicker._get(ah,"dateFormat"),(ah.input?ah.input.val():null),I.datepicker._getFormatConfig(ah));if(ae){I.datepicker._setDateFromField(ah);I.datepicker._updateAlternate(ah);I.datepicker._updateDatepicker(ah)}}catch(af){}}return true},_showDatepicker:function(af){af=af.target||af;if(af.nodeName.toLowerCase()!=="input"){af=I("input",af.parentNode)[0]}if(I.datepicker._isDisabledDatepicker(af)||I.datepicker._lastInput===af){return}var ah,al,ag,aj,ak,ae,ai;ah=I.datepicker._getInst(af);if(I.datepicker._curInst&&I.datepicker._curInst!==ah){I.datepicker._curInst.dpDiv.stop(true,true);if(ah&&I.datepicker._datepickerShowing){I.datepicker._hideDatepicker(I.datepicker._curInst.input[0])}}al=I.datepicker._get(ah,"beforeShow");ag=al?al.apply(af,[af,ah]):{};if(ag===false){return}x(ah.settings,ag);ah.lastVal=null;I.datepicker._lastInput=af;I.datepicker._setDateFromField(ah);if(I.datepicker._inDialog){af.value=""}if(!I.datepicker._pos){I.datepicker._pos=I.datepicker._findPos(af);I.datepicker._pos[1]+=af.offsetHeight}aj=false;I(af).parents().each(function(){aj|=I(this).css("position")==="fixed";return !aj});ak={left:I.datepicker._pos[0],top:I.datepicker._pos[1]};I.datepicker._pos=null;ah.dpDiv.empty();ah.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});I.datepicker._updateDatepicker(ah);ak=I.datepicker._checkOffset(ah,ak,aj);ah.dpDiv.css({position:(I.datepicker._inDialog&&I.blockUI?"static":(aj?"fixed":"absolute")),display:"none",left:ak.left+"px",top:ak.top+"px"});if(!ah.inline){ae=I.datepicker._get(ah,"showAnim");ai=I.datepicker._get(ah,"duration");ah.dpDiv.css("z-index",t(I(af))+1);I.datepicker._datepickerShowing=true;if(I.effects&&I.effects.effect[ae]){ah.dpDiv.show(ae,I.datepicker._get(ah,"showOptions"),ai)}else{ah.dpDiv[ae||"show"](ae?ai:null)}if(I.datepicker._shouldFocusInput(ah)){ah.input.focus()}I.datepicker._curInst=ah}},_updateDatepicker:function(ah){this.maxRows=4;l=ah;ah.dpDiv.empty().append(this._generateHTML(ah));this._attachHandlers(ah);var aj,ae=this._getNumberOfMonths(ah),ai=ae[1],ag=17,af=ah.dpDiv.find("."+this._dayOverClass+" a");if(af.length>0){p.apply(af.get(0))}ah.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(ai>1){ah.dpDiv.addClass("ui-datepicker-multi-"+ai).css("width",(ag*ai)+"em")}ah.dpDiv[(ae[0]!==1||ae[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");ah.dpDiv[(this._get(ah,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(ah===I.datepicker._curInst&&I.datepicker._datepickerShowing&&I.datepicker._shouldFocusInput(ah)){ah.input.focus()}if(ah.yearshtml){aj=ah.yearshtml;setTimeout(function(){if(aj===ah.yearshtml&&ah.yearshtml){ah.dpDiv.find("select.ui-datepicker-year:first").replaceWith(ah.yearshtml)}aj=ah.yearshtml=null},0)}},_shouldFocusInput:function(ae){return ae.input&&ae.input.is(":visible")&&!ae.input.is(":disabled")&&!ae.input.is(":focus")},_checkOffset:function(aj,ah,ag){var ai=aj.dpDiv.outerWidth(),am=aj.dpDiv.outerHeight(),al=aj.input?aj.input.outerWidth():0,ae=aj.input?aj.input.outerHeight():0,ak=document.documentElement.clientWidth+(ag?0:I(document).scrollLeft()),af=document.documentElement.clientHeight+(ag?0:I(document).scrollTop());ah.left-=(this._get(aj,"isRTL")?(ai-al):0);ah.left-=(ag&&ah.left===aj.input.offset().left)?I(document).scrollLeft():0;ah.top-=(ag&&ah.top===(aj.input.offset().top+ae))?I(document).scrollTop():0;ah.left-=Math.min(ah.left,(ah.left+ai>ak&&ak>ai)?Math.abs(ah.left+ai-ak):0);ah.top-=Math.min(ah.top,(ah.top+am>af&&af>am)?Math.abs(am+ae):0);return ah},_findPos:function(ah){var ae,ag=this._getInst(ah),af=this._get(ag,"isRTL");while(ah&&(ah.type==="hidden"||ah.nodeType!==1||I.expr.filters.hidden(ah))){ah=ah[af?"previousSibling":"nextSibling"]}ae=I(ah).offset();return[ae.left,ae.top]},_hideDatepicker:function(ag){var af,aj,ai,ae,ah=this._curInst;if(!ah||(ag&&ah!==I.data(ag,"datepicker"))){return}if(this._datepickerShowing){af=this._get(ah,"showAnim");aj=this._get(ah,"duration");ai=function(){I.datepicker._tidyDialog(ah)};if(I.effects&&(I.effects.effect[af]||I.effects[af])){ah.dpDiv.hide(af,I.datepicker._get(ah,"showOptions"),aj,ai)}else{ah.dpDiv[(af==="slideDown"?"slideUp":(af==="fadeIn"?"fadeOut":"hide"))]((af?aj:null),ai)}if(!af){ai()}this._datepickerShowing=false;ae=this._get(ah,"onClose");if(ae){ae.apply((ah.input?ah.input[0]:null),[(ah.input?ah.input.val():""),ah])}this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(I.blockUI){I.unblockUI();I("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(ae){ae.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(af){if(!I.datepicker._curInst){return}var ae=I(af.target),ag=I.datepicker._getInst(ae[0]);if(((ae[0].id!==I.datepicker._mainDivId&&ae.parents("#"+I.datepicker._mainDivId).length===0&&!ae.hasClass(I.datepicker.markerClassName)&&!ae.closest("."+I.datepicker._triggerClass).length&&I.datepicker._datepickerShowing&&!(I.datepicker._inDialog&&I.blockUI)))||(ae.hasClass(I.datepicker.markerClassName)&&I.datepicker._curInst!==ag)){I.datepicker._hideDatepicker()}},_adjustDate:function(ai,ah,ag){var af=I(ai),ae=this._getInst(af[0]);if(this._isDisabledDatepicker(af[0])){return}this._adjustInstDate(ae,ah+(ag==="M"?this._get(ae,"showCurrentAtPos"):0),ag);this._updateDatepicker(ae)},_gotoToday:function(ah){var ae,ag=I(ah),af=this._getInst(ag[0]);if(this._get(af,"gotoCurrent")&&af.currentDay){af.selectedDay=af.currentDay;af.drawMonth=af.selectedMonth=af.currentMonth;af.drawYear=af.selectedYear=af.currentYear}else{ae=new Date();af.selectedDay=ae.getDate();af.drawMonth=af.selectedMonth=ae.getMonth();af.drawYear=af.selectedYear=ae.getFullYear()}this._notifyChange(af);this._adjustDate(ag)},_selectMonthYear:function(ai,ae,ah){var ag=I(ai),af=this._getInst(ag[0]);af["selected"+(ah==="M"?"Month":"Year")]=af["draw"+(ah==="M"?"Month":"Year")]=parseInt(ae.options[ae.selectedIndex].value,10);this._notifyChange(af);this._adjustDate(ag)},_selectDay:function(aj,ah,ae,ai){var af,ag=I(aj);if(I(ai).hasClass(this._unselectableClass)||this._isDisabledDatepicker(ag[0])){return}af=this._getInst(ag[0]);af.selectedDay=af.currentDay=I("a",ai).html();af.selectedMonth=af.currentMonth=ah;af.selectedYear=af.currentYear=ae;this._selectDate(aj,this._formatDate(af,af.currentDay,af.currentMonth,af.currentYear))},_clearDate:function(af){var ae=I(af);this._selectDate(ae,"")},_selectDate:function(ai,ae){var af,ah=I(ai),ag=this._getInst(ah[0]);ae=(ae!=null?ae:this._formatDate(ag));if(ag.input){ag.input.val(ae)}this._updateAlternate(ag);af=this._get(ag,"onSelect");if(af){af.apply((ag.input?ag.input[0]:null),[ae,ag])}else{if(ag.input){ag.input.trigger("change")}}if(ag.inline){this._updateDatepicker(ag)}else{this._hideDatepicker();this._lastInput=ag.input[0];if(typeof(ag.input[0])!=="object"){ag.input.focus()}this._lastInput=null}},_updateAlternate:function(ai){var ah,ag,ae,af=this._get(ai,"altField");if(af){ah=this._get(ai,"altFormat")||this._get(ai,"dateFormat");ag=this._getDate(ai);ae=this.formatDate(ah,ag,this._getFormatConfig(ai));I(af).each(function(){I(this).val(ae)})}},noWeekends:function(af){var ae=af.getDay();return[(ae>0&&ae<6),""]},iso8601Week:function(ae){var af,ag=new Date(ae.getTime());ag.setDate(ag.getDate()+4-(ag.getDay()||7));af=ag.getTime();ag.setMonth(0);ag.setDate(1);return Math.floor(Math.round((af-ag)/86400000)/7)+1},parseDate:function(av,ap,ax){if(av==null||ap==null){throw"Invalid arguments"}ap=(typeof ap==="object"?ap.toString():ap+"");if(ap===""){return null}var ah,ar,af,aw=0,ak=(ax?ax.shortYearCutoff:null)||this._defaults.shortYearCutoff,ag=(typeof ak!=="string"?ak:new Date().getFullYear()%100+parseInt(ak,10)),an=(ax?ax.dayNamesShort:null)||this._defaults.dayNamesShort,az=(ax?ax.dayNames:null)||this._defaults.dayNames,ae=(ax?ax.monthNamesShort:null)||this._defaults.monthNamesShort,ai=(ax?ax.monthNames:null)||this._defaults.monthNames,aj=-1,aA=-1,au=-1,am=-1,at=false,ay,ao=function(aC){var aD=(ah+1<av.length&&av.charAt(ah+1)===aC);if(aD){ah++}return aD},aB=function(aE){var aC=ao(aE),aF=(aE==="@"?14:(aE==="!"?20:(aE==="y"&&aC?4:(aE==="o"?3:2)))),aH=(aE==="y"?aF:1),aG=new RegExp("^\\d{"+aH+","+aF+"}"),aD=ap.substring(aw).match(aG);if(!aD){throw"Missing number at position "+aw}aw+=aD[0].length;return parseInt(aD[0],10)},al=function(aD,aE,aG){var aC=-1,aF=I.map(ao(aD)?aG:aE,function(aI,aH){return[[aH,aI]]}).sort(function(aI,aH){return -(aI[1].length-aH[1].length)});I.each(aF,function(aI,aJ){var aH=aJ[1];if(ap.substr(aw,aH.length).toLowerCase()===aH.toLowerCase()){aC=aJ[0];aw+=aH.length;return false}});if(aC!==-1){return aC+1}else{throw"Unknown name at position "+aw}},aq=function(){if(ap.charAt(aw)!==av.charAt(ah)){throw"Unexpected literal at position "+aw}aw++};for(ah=0;ah<av.length;ah++){if(at){if(av.charAt(ah)==="'"&&!ao("'")){at=false}else{aq()}}else{switch(av.charAt(ah)){case"d":au=aB("d");break;case"D":al("D",an,az);break;case"o":am=aB("o");break;case"m":aA=aB("m");break;case"M":aA=al("M",ae,ai);break;case"y":aj=aB("y");break;case"@":ay=new Date(aB("@"));aj=ay.getFullYear();aA=ay.getMonth()+1;au=ay.getDate();break;case"!":ay=new Date((aB("!")-this._ticksTo1970)/10000);aj=ay.getFullYear();aA=ay.getMonth()+1;au=ay.getDate();break;case"'":if(ao("'")){aq()}else{at=true}break;default:aq()}}}if(aw<ap.length){af=ap.substr(aw);if(!/^\s+/.test(af)){throw"Extra/unparsed characters found in date: "+af}}if(aj===-1){aj=new Date().getFullYear()}else{if(aj<100){aj+=new Date().getFullYear()-new Date().getFullYear()%100+(aj<=ag?0:-100)}}if(am>-1){aA=1;au=am;do{ar=this._getDaysInMonth(aj,aA-1);if(au<=ar){break}aA++;au-=ar}while(true)}ay=this._daylightSavingAdjust(new Date(aj,aA-1,au));if(ay.getFullYear()!==aj||ay.getMonth()+1!==aA||ay.getDate()!==au){throw"Invalid date"}return ay},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:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(an,ah,ai){if(!ah){return""}var ap,aq=(ai?ai.dayNamesShort:null)||this._defaults.dayNamesShort,af=(ai?ai.dayNames:null)||this._defaults.dayNames,al=(ai?ai.monthNamesShort:null)||this._defaults.monthNamesShort,aj=(ai?ai.monthNames:null)||this._defaults.monthNames,ao=function(ar){var at=(ap+1<an.length&&an.charAt(ap+1)===ar);if(at){ap++}return at},ae=function(au,av,ar){var at=""+av;if(ao(au)){while(at.length<ar){at="0"+at}}return at},ak=function(ar,au,at,av){return(ao(ar)?av[au]:at[au])},ag="",am=false;if(ah){for(ap=0;ap<an.length;ap++){if(am){if(an.charAt(ap)==="'"&&!ao("'")){am=false}else{ag+=an.charAt(ap)}}else{switch(an.charAt(ap)){case"d":ag+=ae("d",ah.getDate(),2);break;case"D":ag+=ak("D",ah.getDay(),aq,af);break;case"o":ag+=ae("o",Math.round((new Date(ah.getFullYear(),ah.getMonth(),ah.getDate()).getTime()-new Date(ah.getFullYear(),0,0).getTime())/86400000),3);break;case"m":ag+=ae("m",ah.getMonth()+1,2);break;case"M":ag+=ak("M",ah.getMonth(),al,aj);break;case"y":ag+=(ao("y")?ah.getFullYear():(ah.getYear()%100<10?"0":"")+ah.getYear()%100);break;case"@":ag+=ah.getTime();break;case"!":ag+=ah.getTime()*10000+this._ticksTo1970;break;case"'":if(ao("'")){ag+="'"}else{am=true}break;default:ag+=an.charAt(ap)}}}}return ag},_possibleChars:function(ai){var ah,ag="",af=false,ae=function(aj){var ak=(ah+1<ai.length&&ai.charAt(ah+1)===aj);if(ak){ah++}return ak};for(ah=0;ah<ai.length;ah++){if(af){if(ai.charAt(ah)==="'"&&!ae("'")){af=false}else{ag+=ai.charAt(ah)}}else{switch(ai.charAt(ah)){case"d":case"m":case"y":case"@":ag+="0123456789";break;case"D":case"M":return null;case"'":if(ae("'")){ag+="'"}else{af=true}break;default:ag+=ai.charAt(ah)}}}return ag},_get:function(af,ae){return af.settings[ae]!==undefined?af.settings[ae]:this._defaults[ae]},_setDateFromField:function(aj,ag){if(aj.input.val()===aj.lastVal){return}var ae=this._get(aj,"dateFormat"),al=aj.lastVal=aj.input?aj.input.val():null,ak=this._getDefaultDate(aj),af=ak,ah=this._getFormatConfig(aj);try{af=this.parseDate(ae,al,ah)||ak}catch(ai){al=(ag?"":al)}aj.selectedDay=af.getDate();aj.drawMonth=aj.selectedMonth=af.getMonth();aj.drawYear=aj.selectedYear=af.getFullYear();aj.currentDay=(al?af.getDate():0);aj.currentMonth=(al?af.getMonth():0);aj.currentYear=(al?af.getFullYear():0);this._adjustInstDate(aj)},_getDefaultDate:function(ae){return this._restrictMinMax(ae,this._determineDate(ae,this._get(ae,"defaultDate"),new Date()))},_determineDate:function(ai,af,aj){var ah=function(al){var ak=new Date();ak.setDate(ak.getDate()+al);return ak},ag=function(ar){try{return I.datepicker.parseDate(I.datepicker._get(ai,"dateFormat"),ar,I.datepicker._getFormatConfig(ai))}catch(aq){}var al=(ar.toLowerCase().match(/^c/)?I.datepicker._getDate(ai):null)||new Date(),am=al.getFullYear(),ap=al.getMonth(),ak=al.getDate(),ao=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,an=ao.exec(ar);while(an){switch(an[2]||"d"){case"d":case"D":ak+=parseInt(an[1],10);break;case"w":case"W":ak+=parseInt(an[1],10)*7;break;case"m":case"M":ap+=parseInt(an[1],10);ak=Math.min(ak,I.datepicker._getDaysInMonth(am,ap));break;case"y":case"Y":am+=parseInt(an[1],10);ak=Math.min(ak,I.datepicker._getDaysInMonth(am,ap));break}an=ao.exec(ar)}return new Date(am,ap,ak)},ae=(af==null||af===""?aj:(typeof af==="string"?ag(af):(typeof af==="number"?(isNaN(af)?aj:ah(af)):new Date(af.getTime()))));ae=(ae&&ae.toString()==="Invalid Date"?aj:ae);if(ae){ae.setHours(0);ae.setMinutes(0);ae.setSeconds(0);ae.setMilliseconds(0)}return this._daylightSavingAdjust(ae)},_daylightSavingAdjust:function(ae){if(!ae){return null}ae.setHours(ae.getHours()>12?ae.getHours()+2:0);return ae},_setDate:function(ak,ah,aj){var ae=!ah,ag=ak.selectedMonth,ai=ak.selectedYear,af=this._restrictMinMax(ak,this._determineDate(ak,ah,new Date()));ak.selectedDay=ak.currentDay=af.getDate();ak.drawMonth=ak.selectedMonth=ak.currentMonth=af.getMonth();ak.drawYear=ak.selectedYear=ak.currentYear=af.getFullYear();if((ag!==ak.selectedMonth||ai!==ak.selectedYear)&&!aj){this._notifyChange(ak)}this._adjustInstDate(ak);if(ak.input){ak.input.val(ae?"":this._formatDate(ak))}},_getDate:function(af){var ae=(!af.currentYear||(af.input&&af.input.val()==="")?null:this._daylightSavingAdjust(new Date(af.currentYear,af.currentMonth,af.currentDay)));return ae},_attachHandlers:function(af){var ae=this._get(af,"stepMonths"),ag="#"+af.id.replace(/\\\\/g,"\\");af.dpDiv.find("[data-handler]").map(function(){var ah={prev:function(){I.datepicker._adjustDate(ag,-ae,"M")},next:function(){I.datepicker._adjustDate(ag,+ae,"M")},hide:function(){I.datepicker._hideDatepicker()},today:function(){I.datepicker._gotoToday(ag)},selectDay:function(){I.datepicker._selectDay(ag,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},selectMonth:function(){I.datepicker._selectMonthYear(ag,this,"M");return false},selectYear:function(){I.datepicker._selectMonthYear(ag,this,"Y");return false}};I(this).bind(this.getAttribute("data-event"),ah[this.getAttribute("data-handler")])})},_generateHTML:function(aV){var ay,ax,aQ,aI,ai,aZ,aT,aM,a2,aG,a6,ap,ar,aq,af,aY,an,aB,a1,aO,a7,aA,aF,ao,aj,aR,aK,aN,aL,am,aD,at,aU,aX,ah,a0,a4,aJ,au,aW=new Date(),az=this._daylightSavingAdjust(new Date(aW.getFullYear(),aW.getMonth(),aW.getDate())),a3=this._get(aV,"isRTL"),a5=this._get(aV,"showButtonPanel"),aP=this._get(aV,"hideIfNoPrevNext"),aE=this._get(aV,"navigationAsDateFormat"),av=this._getNumberOfMonths(aV),al=this._get(aV,"showCurrentAtPos"),aH=this._get(aV,"stepMonths"),aC=(av[0]!==1||av[1]!==1),ag=this._daylightSavingAdjust((!aV.currentDay?new Date(9999,9,9):new Date(aV.currentYear,aV.currentMonth,aV.currentDay))),ak=this._getMinMaxDate(aV,"min"),aw=this._getMinMaxDate(aV,"max"),ae=aV.drawMonth-al,aS=aV.drawYear;if(ae<0){ae+=12;aS--}if(aw){ay=this._daylightSavingAdjust(new Date(aw.getFullYear(),aw.getMonth()-(av[0]*av[1])+1,aw.getDate()));ay=(ak&&ay<ak?ak:ay);while(this._daylightSavingAdjust(new Date(aS,ae,1))>ay){ae--;if(ae<0){ae=11;aS--}}}aV.drawMonth=ae;aV.drawYear=aS;ax=this._get(aV,"prevText");ax=(!aE?ax:this.formatDate(ax,this._daylightSavingAdjust(new Date(aS,ae-aH,1)),this._getFormatConfig(aV)));aQ=(this._canAdjustMonth(aV,-1,aS,ae)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+ax+"'><span class='ui-icon ui-icon-circle-triangle-"+(a3?"e":"w")+"'>"+ax+"</span></a>":(aP?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ax+"'><span class='ui-icon ui-icon-circle-triangle-"+(a3?"e":"w")+"'>"+ax+"</span></a>"));aI=this._get(aV,"nextText");aI=(!aE?aI:this.formatDate(aI,this._daylightSavingAdjust(new Date(aS,ae+aH,1)),this._getFormatConfig(aV)));ai=(this._canAdjustMonth(aV,+1,aS,ae)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+aI+"'><span class='ui-icon ui-icon-circle-triangle-"+(a3?"w":"e")+"'>"+aI+"</span></a>":(aP?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+aI+"'><span class='ui-icon ui-icon-circle-triangle-"+(a3?"w":"e")+"'>"+aI+"</span></a>"));aZ=this._get(aV,"currentText");aT=(this._get(aV,"gotoCurrent")&&aV.currentDay?ag:az);aZ=(!aE?aZ:this.formatDate(aZ,aT,this._getFormatConfig(aV)));aM=(!aV.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(aV,"closeText")+"</button>":"");a2=(a5)?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(a3?aM:"")+(this._isInRange(aV,aT)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+aZ+"</button>":"")+(a3?"":aM)+"</div>":"";aG=parseInt(this._get(aV,"firstDay"),10);aG=(isNaN(aG)?0:aG);a6=this._get(aV,"showWeek");ap=this._get(aV,"dayNames");ar=this._get(aV,"dayNamesMin");aq=this._get(aV,"monthNames");af=this._get(aV,"monthNamesShort");aY=this._get(aV,"beforeShowDay");an=this._get(aV,"showOtherMonths");aB=this._get(aV,"selectOtherMonths");a1=this._getDefaultDate(aV);aO="";a7;for(aA=0;aA<av[0];aA++){aF="";this.maxRows=4;for(ao=0;ao<av[1];ao++){aj=this._daylightSavingAdjust(new Date(aS,ae,aV.selectedDay));aR=" ui-corner-all";aK="";if(aC){aK+="<div class='ui-datepicker-group";if(av[1]>1){switch(ao){case 0:aK+=" ui-datepicker-group-first";aR=" ui-corner-"+(a3?"right":"left");break;case av[1]-1:aK+=" ui-datepicker-group-last";aR=" ui-corner-"+(a3?"left":"right");break;default:aK+=" ui-datepicker-group-middle";aR="";break}}aK+="'>"}aK+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+aR+"'>"+(/all|left/.test(aR)&&aA===0?(a3?ai:aQ):"")+(/all|right/.test(aR)&&aA===0?(a3?aQ:ai):"")+this._generateMonthYearHeader(aV,ae,aS,ak,aw,aA>0||ao>0,aq,af)+"</div><table class='ui-datepicker-calendar'><thead><tr>";aN=(a6?"<th class='ui-datepicker-week-col'>"+this._get(aV,"weekHeader")+"</th>":"");for(a7=0;a7<7;a7++){aL=(a7+aG)%7;aN+="<th scope='col'"+((a7+aG+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+ap[aL]+"'>"+ar[aL]+"</span></th>"}aK+=aN+"</tr></thead><tbody>";am=this._getDaysInMonth(aS,ae);if(aS===aV.selectedYear&&ae===aV.selectedMonth){aV.selectedDay=Math.min(aV.selectedDay,am)}aD=(this._getFirstDayOfMonth(aS,ae)-aG+7)%7;at=Math.ceil((aD+am)/7);aU=(aC?this.maxRows>at?this.maxRows:at:at);this.maxRows=aU;aX=this._daylightSavingAdjust(new Date(aS,ae,1-aD));for(ah=0;ah<aU;ah++){aK+="<tr>";a0=(!a6?"":"<td class='ui-datepicker-week-col'>"+this._get(aV,"calculateWeek")(aX)+"</td>");for(a7=0;a7<7;a7++){a4=(aY?aY.apply((aV.input?aV.input[0]:null),[aX]):[true,""]);aJ=(aX.getMonth()!==ae);au=(aJ&&!aB)||!a4[0]||(ak&&aX<ak)||(aw&&aX>aw);a0+="<td class='"+((a7+aG+6)%7>=5?" ui-datepicker-week-end":"")+(aJ?" ui-datepicker-other-month":"")+((aX.getTime()===aj.getTime()&&ae===aV.selectedMonth&&aV._keyEvent)||(a1.getTime()===aX.getTime()&&a1.getTime()===aj.getTime())?" "+this._dayOverClass:"")+(au?" "+this._unselectableClass+" ui-state-disabled":"")+(aJ&&!an?"":" "+a4[1]+(aX.getTime()===ag.getTime()?" "+this._currentClass:"")+(aX.getTime()===az.getTime()?" ui-datepicker-today":""))+"'"+((!aJ||an)&&a4[2]?" title='"+a4[2].replace(/'/g,"&#39;")+"'":"")+(au?"":" data-handler='selectDay' data-event='click' data-month='"+aX.getMonth()+"' data-year='"+aX.getFullYear()+"'")+">"+(aJ&&!an?"&#xa0;":(au?"<span class='ui-state-default'>"+aX.getDate()+"</span>":"<a class='ui-state-default"+(aX.getTime()===az.getTime()?" ui-state-highlight":"")+(aX.getTime()===ag.getTime()?" ui-state-active":"")+(aJ?" ui-priority-secondary":"")+"' href='#'>"+aX.getDate()+"</a>"))+"</td>";aX.setDate(aX.getDate()+1);aX=this._daylightSavingAdjust(aX)}aK+=a0+"</tr>"}ae++;if(ae>11){ae=0;aS++}aK+="</tbody></table>"+(aC?"</div>"+((av[0]>0&&ao===av[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");aF+=aK}aO+=aF}aO+=a2;aV._keyEvent=false;return aO},_generateMonthYearHeader:function(ai,ag,aq,ak,ao,ar,am,ae){var aw,af,ax,au,aj,at,ap,al,ah=this._get(ai,"changeMonth"),ay=this._get(ai,"changeYear"),az=this._get(ai,"showMonthAfterYear"),an="<div class='ui-datepicker-title'>",av="";if(ar||!ah){av+="<span class='ui-datepicker-month'>"+am[ag]+"</span>"}else{aw=(ak&&ak.getFullYear()===aq);af=(ao&&ao.getFullYear()===aq);av+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(ax=0;ax<12;ax++){if((!aw||ax>=ak.getMonth())&&(!af||ax<=ao.getMonth())){av+="<option value='"+ax+"'"+(ax===ag?" selected='selected'":"")+">"+ae[ax]+"</option>"}}av+="</select>"}if(!az){an+=av+(ar||!(ah&&ay)?"&#xa0;":"")}if(!ai.yearshtml){ai.yearshtml="";if(ar||!ay){an+="<span class='ui-datepicker-year'>"+aq+"</span>"}else{au=this._get(ai,"yearRange").split(":");aj=new Date().getFullYear();at=function(aB){var aA=(aB.match(/c[+\-].*/)?aq+parseInt(aB.substring(1),10):(aB.match(/[+\-].*/)?aj+parseInt(aB,10):parseInt(aB,10)));return(isNaN(aA)?aj:aA)};ap=at(au[0]);al=Math.max(ap,at(au[1]||""));ap=(ak?Math.max(ap,ak.getFullYear()):ap);al=(ao?Math.min(al,ao.getFullYear()):al);ai.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;ap<=al;ap++){ai.yearshtml+="<option value='"+ap+"'"+(ap===aq?" selected='selected'":"")+">"+ap+"</option>"}ai.yearshtml+="</select>";an+=ai.yearshtml;ai.yearshtml=null}}an+=this._get(ai,"yearSuffix");if(az){an+=(ar||!(ah&&ay)?"&#xa0;":"")+av}an+="</div>";return an},_adjustInstDate:function(ah,ak,aj){var ag=ah.drawYear+(aj==="Y"?ak:0),ai=ah.drawMonth+(aj==="M"?ak:0),ae=Math.min(ah.selectedDay,this._getDaysInMonth(ag,ai))+(aj==="D"?ak:0),af=this._restrictMinMax(ah,this._daylightSavingAdjust(new Date(ag,ai,ae)));ah.selectedDay=af.getDate();ah.drawMonth=ah.selectedMonth=af.getMonth();ah.drawYear=ah.selectedYear=af.getFullYear();if(aj==="M"||aj==="Y"){this._notifyChange(ah)}},_restrictMinMax:function(ah,af){var ag=this._getMinMaxDate(ah,"min"),ai=this._getMinMaxDate(ah,"max"),ae=(ag&&af<ag?ag:af);return(ai&&ae>ai?ai:ae)},_notifyChange:function(af){var ae=this._get(af,"onChangeMonthYear");if(ae){ae.apply((af.input?af.input[0]:null),[af.selectedYear,af.selectedMonth+1,af])}},_getNumberOfMonths:function(af){var ae=this._get(af,"numberOfMonths");return(ae==null?[1,1]:(typeof ae==="number"?[1,ae]:ae))},_getMinMaxDate:function(af,ae){return this._determineDate(af,this._get(af,ae+"Date"),null)},_getDaysInMonth:function(ae,af){return 32-this._daylightSavingAdjust(new Date(ae,af,32)).getDate()},_getFirstDayOfMonth:function(ae,af){return new Date(ae,af,1).getDay()},_canAdjustMonth:function(ah,aj,ag,ai){var ae=this._getNumberOfMonths(ah),af=this._daylightSavingAdjust(new Date(ag,ai+(aj<0?aj:ae[0]*ae[1]),1));if(aj<0){af.setDate(this._getDaysInMonth(af.getFullYear(),af.getMonth()))}return this._isInRange(ah,af)},_isInRange:function(ai,ag){var af,al,ah=this._getMinMaxDate(ai,"min"),ae=this._getMinMaxDate(ai,"max"),am=null,aj=null,ak=this._get(ai,"yearRange");if(ak){af=ak.split(":");al=new Date().getFullYear();am=parseInt(af[0],10);aj=parseInt(af[1],10);if(af[0].match(/[+\-].*/)){am+=al}if(af[1].match(/[+\-].*/)){aj+=al}}return((!ah||ag.getTime()>=ah.getTime())&&(!ae||ag.getTime()<=ae.getTime())&&(!am||ag.getFullYear()>=am)&&(!aj||ag.getFullYear()<=aj))},_getFormatConfig:function(ae){var af=this._get(ae,"shortYearCutoff");af=(typeof af!=="string"?af:new Date().getFullYear()%100+parseInt(af,10));return{shortYearCutoff:af,dayNamesShort:this._get(ae,"dayNamesShort"),dayNames:this._get(ae,"dayNames"),monthNamesShort:this._get(ae,"monthNamesShort"),monthNames:this._get(ae,"monthNames")}},_formatDate:function(ah,ae,ai,ag){if(!ae){ah.currentDay=ah.selectedDay;ah.currentMonth=ah.selectedMonth;ah.currentYear=ah.selectedYear}var af=(ae?(typeof ae==="object"?ae:this._daylightSavingAdjust(new Date(ag,ai,ae))):this._daylightSavingAdjust(new Date(ah.currentYear,ah.currentMonth,ah.currentDay)));return this.formatDate(this._get(ah,"dateFormat"),af,this._getFormatConfig(ah))}});function h(af){var ae="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return af.delegate(ae,"mouseout",function(){I(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){I(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){I(this).removeClass("ui-datepicker-next-hover")}}).delegate(ae,"mouseover",p)}function p(){if(!I.datepicker._isDisabledDatepicker(l.inline?l.dpDiv.parent()[0]:l.input[0])){I(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");I(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){I(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){I(this).addClass("ui-datepicker-next-hover")}}}function x(ag,af){I.extend(ag,af);for(var ae in af){if(af[ae]==null){ag[ae]=af[ae]}}return ag}I.fn.datepicker=function(af){if(!this.length){return this}if(!I.datepicker.initialized){I(document).mousedown(I.datepicker._checkExternalClick);I.datepicker.initialized=true}if(I("#"+I.datepicker._mainDivId).length===0){I("body").append(I.datepicker.dpDiv)}var ae=Array.prototype.slice.call(arguments,1);if(typeof af==="string"&&(af==="isDisabled"||af==="getDate"||af==="widget")){return I.datepicker["_"+af+"Datepicker"].apply(I.datepicker,[this[0]].concat(ae))}if(af==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return I.datepicker["_"+af+"Datepicker"].apply(I.datepicker,[this[0]].concat(ae))}return this.each(function(){typeof af==="string"?I.datepicker["_"+af+"Datepicker"].apply(I.datepicker,[this].concat(ae)):I.datepicker._attachDatepicker(this,af)})};I.datepicker=new ac();I.datepicker.initialized=false;I.datepicker.uuid=new Date().getTime();I.datepicker.version="1.11.2";var E=I.datepicker;
105
+ /*!
106
+ * jQuery UI Draggable 1.11.2
107
+ * http://jqueryui.com
108
+ *
109
+ * Copyright 2014 jQuery Foundation and other contributors
110
+ * Released under the MIT license.
111
+ * http://jquery.org/license
112
+ *
113
+ * http://api.jqueryui.com/draggable/
114
+ */
115
+ I.widget("ui.draggable",I.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this.element.addClass("ui-draggable")}if(this.options.disabled){this.element.addClass("ui-draggable-disabled")}this._setHandleClassName();this._mouseInit()},_setOption:function(ae,af){this._super(ae,af);if(ae==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(ae){var af=this.options;this._blurActiveElement(ae);if(this.helper||af.disabled||I(ae.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(ae);if(!this.handle){return false}this._blockFrames(af.iframeFix===true?"iframe":af.iframeFix);return true},_blockFrames:function(ae){this.iframeBlocks=this.document.find(ae).map(function(){var af=I(this);return I("<div>").css("position","absolute").appendTo(af.parent()).outerWidth(af.outerWidth()).outerHeight(af.outerHeight()).offset(af.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(ag){var ae=this.document[0];if(!this.handleElement.is(ag.target)){return}try{if(ae.activeElement&&ae.activeElement.nodeName.toLowerCase()!=="body"){I(ae.activeElement).blur()}}catch(af){}},_mouseStart:function(ae){var af=this.options;this.helper=this._createHelper(ae);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();if(I.ui.ddmanager){I.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return I(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(ae);this.originalPosition=this.position=this._generatePosition(ae,false);this.originalPageX=ae.pageX;this.originalPageY=ae.pageY;(af.cursorAt&&this._adjustOffsetFromHelper(af.cursorAt));this._setContainment();if(this._trigger("start",ae)===false){this._clear();return false}this._cacheHelperProportions();if(I.ui.ddmanager&&!af.dropBehaviour){I.ui.ddmanager.prepareOffsets(this,ae)}this._normalizeRightBottom();this._mouseDrag(ae,true);if(I.ui.ddmanager){I.ui.ddmanager.dragStart(this,ae)}return true},_refreshOffsets:function(ae){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:ae.pageX-this.offset.left,top:ae.pageY-this.offset.top}},_mouseDrag:function(ae,ag){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(ae,true);this.positionAbs=this._convertPositionTo("absolute");if(!ag){var af=this._uiHash();if(this._trigger("drag",ae,af)===false){this._mouseUp({});return false}this.position=af.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(I.ui.ddmanager){I.ui.ddmanager.drag(this,ae)}return false},_mouseStop:function(af){var ae=this,ag=false;if(I.ui.ddmanager&&!this.options.dropBehaviour){ag=I.ui.ddmanager.drop(this,af)}if(this.dropped){ag=this.dropped;this.dropped=false}if((this.options.revert==="invalid"&&!ag)||(this.options.revert==="valid"&&ag)||this.options.revert===true||(I.isFunction(this.options.revert)&&this.options.revert.call(this.element,ag))){I(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(ae._trigger("stop",af)!==false){ae._clear()}})}else{if(this._trigger("stop",af)!==false){this._clear()}}return false},_mouseUp:function(ae){this._unblockFrames();if(I.ui.ddmanager){I.ui.ddmanager.dragStop(this,ae)}if(this.handleElement.is(ae.target)){this.element.focus()}return I.ui.mouse.prototype._mouseUp.call(this,ae)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(ae){return this.options.handle?!!I(ae.target).closest(this.element.find(this.options.handle)).length:true},_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(af){var ah=this.options,ag=I.isFunction(ah.helper),ae=ag?I(ah.helper.apply(this.element[0],[af])):(ah.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!ae.parents("body").length){ae.appendTo((ah.appendTo==="parent"?this.element[0].parentNode:ah.appendTo))}if(ag&&ae[0]===this.element[0]){this._setPositionRelative()}if(ae[0]!==this.element[0]&&!(/(fixed|absolute)/).test(ae.css("position"))){ae.css("position","absolute")}return ae},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(ae){if(typeof ae==="string"){ae=ae.split(" ")}if(I.isArray(ae)){ae={left:+ae[0],top:+ae[1]||0}}if("left" in ae){this.offset.click.left=ae.left+this.margins.left}if("right" in ae){this.offset.click.left=this.helperProportions.width-ae.right+this.margins.left}if("top" in ae){this.offset.click.top=ae.top+this.margins.top}if("bottom" in ae){this.offset.click.top=this.helperProportions.height-ae.bottom+this.margins.top}},_isRootNode:function(ae){return(/(html|body)/i).test(ae.tagName)||ae===this.document[0]},_getParentOffset:function(){var af=this.offsetParent.offset(),ae=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==ae&&I.contains(this.scrollParent[0],this.offsetParent[0])){af.left+=this.scrollParent.scrollLeft();af.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){af={top:0,left:0}}return{top:af.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:af.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var ae=this.element.position(),af=this._isRootNode(this.scrollParent[0]);return{top:ae.top-(parseInt(this.helper.css("top"),10)||0)+(!af?this.scrollParent.scrollTop():0),left:ae.left-(parseInt(this.helper.css("left"),10)||0)+(!af?this.scrollParent.scrollLeft():0)}},_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 af,ai,ag,ah=this.options,ae=this.document[0];this.relativeContainer=null;if(!ah.containment){this.containment=null;return}if(ah.containment==="window"){this.containment=[I(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,I(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,I(window).scrollLeft()+I(window).width()-this.helperProportions.width-this.margins.left,I(window).scrollTop()+(I(window).height()||ae.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(ah.containment==="document"){this.containment=[0,0,I(ae).width()-this.helperProportions.width-this.margins.left,(I(ae).height()||ae.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(ah.containment.constructor===Array){this.containment=ah.containment;return}if(ah.containment==="parent"){ah.containment=this.helper[0].parentNode}ai=I(ah.containment);ag=ai[0];if(!ag){return}af=/(scroll|auto)/.test(ai.css("overflow"));this.containment=[(parseInt(ai.css("borderLeftWidth"),10)||0)+(parseInt(ai.css("paddingLeft"),10)||0),(parseInt(ai.css("borderTopWidth"),10)||0)+(parseInt(ai.css("paddingTop"),10)||0),(af?Math.max(ag.scrollWidth,ag.offsetWidth):ag.offsetWidth)-(parseInt(ai.css("borderRightWidth"),10)||0)-(parseInt(ai.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(af?Math.max(ag.scrollHeight,ag.offsetHeight):ag.offsetHeight)-(parseInt(ai.css("borderBottomWidth"),10)||0)-(parseInt(ai.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=ai},_convertPositionTo:function(af,ah){if(!ah){ah=this.position}var ae=af==="absolute"?1:-1,ag=this._isRootNode(this.scrollParent[0]);return{top:(ah.top+this.offset.relative.top*ae+this.offset.parent.top*ae-((this.cssPosition==="fixed"?-this.offset.scroll.top:(ag?0:this.offset.scroll.top))*ae)),left:(ah.left+this.offset.relative.left*ae+this.offset.parent.left*ae-((this.cssPosition==="fixed"?-this.offset.scroll.left:(ag?0:this.offset.scroll.left))*ae))}},_generatePosition:function(af,al){var ae,am,an,ah,ag=this.options,ak=this._isRootNode(this.scrollParent[0]),aj=af.pageX,ai=af.pageY;if(!ak||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(al){if(this.containment){if(this.relativeContainer){am=this.relativeContainer.offset();ae=[this.containment[0]+am.left,this.containment[1]+am.top,this.containment[2]+am.left,this.containment[3]+am.top]}else{ae=this.containment}if(af.pageX-this.offset.click.left<ae[0]){aj=ae[0]+this.offset.click.left}if(af.pageY-this.offset.click.top<ae[1]){ai=ae[1]+this.offset.click.top}if(af.pageX-this.offset.click.left>ae[2]){aj=ae[2]+this.offset.click.left}if(af.pageY-this.offset.click.top>ae[3]){ai=ae[3]+this.offset.click.top}}if(ag.grid){an=ag.grid[1]?this.originalPageY+Math.round((ai-this.originalPageY)/ag.grid[1])*ag.grid[1]:this.originalPageY;ai=ae?((an-this.offset.click.top>=ae[1]||an-this.offset.click.top>ae[3])?an:((an-this.offset.click.top>=ae[1])?an-ag.grid[1]:an+ag.grid[1])):an;ah=ag.grid[0]?this.originalPageX+Math.round((aj-this.originalPageX)/ag.grid[0])*ag.grid[0]:this.originalPageX;aj=ae?((ah-this.offset.click.left>=ae[0]||ah-this.offset.click.left>ae[2])?ah:((ah-this.offset.click.left>=ae[0])?ah-ag.grid[0]:ah+ag.grid[0])):ah}if(ag.axis==="y"){aj=this.originalPageX}if(ag.axis==="x"){ai=this.originalPageY}}return{top:(ai-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(ak?0:this.offset.scroll.top))),left:(aj-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(ak?0:this.offset.scroll.left)))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_normalizeRightBottom:function(){if(this.options.axis!=="y"&&this.helper.css("right")!=="auto"){this.helper.width(this.helper.width());this.helper.css("right","auto")}if(this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"){this.helper.height(this.helper.height());this.helper.css("bottom","auto")}},_trigger:function(ae,af,ag){ag=ag||this._uiHash();I.ui.plugin.call(this,ae,[af,ag,this],true);if(/^(drag|start|stop)/.test(ae)){this.positionAbs=this._convertPositionTo("absolute");ag.offset=this.positionAbs}return I.Widget.prototype._trigger.call(this,ae,af,ag)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});I.ui.plugin.add("draggable","connectToSortable",{start:function(ag,ah,ae){var af=I.extend({},ah,{item:ae.element});ae.sortables=[];I(ae.options.connectToSortable).each(function(){var ai=I(this).sortable("instance");if(ai&&!ai.options.disabled){ae.sortables.push(ai);ai.refreshPositions();ai._trigger("activate",ag,af)}})},stop:function(ag,ah,ae){var af=I.extend({},ah,{item:ae.element});ae.cancelHelperRemoval=false;I.each(ae.sortables,function(){var ai=this;if(ai.isOver){ai.isOver=0;ae.cancelHelperRemoval=true;ai.cancelHelperRemoval=false;ai._storedCSS={position:ai.placeholder.css("position"),top:ai.placeholder.css("top"),left:ai.placeholder.css("left")};ai._mouseStop(ag);ai.options.helper=ai.options._helper}else{ai.cancelHelperRemoval=true;ai._trigger("deactivate",ag,af)}})},drag:function(af,ag,ae){I.each(ae.sortables,function(){var ah=false,ai=this;ai.positionAbs=ae.positionAbs;ai.helperProportions=ae.helperProportions;ai.offset.click=ae.offset.click;if(ai._intersectsWith(ai.containerCache)){ah=true;I.each(ae.sortables,function(){this.positionAbs=ae.positionAbs;this.helperProportions=ae.helperProportions;this.offset.click=ae.offset.click;if(this!==ai&&this._intersectsWith(this.containerCache)&&I.contains(ai.element[0],this.element[0])){ah=false}return ah})}if(ah){if(!ai.isOver){ai.isOver=1;ai.currentItem=ag.helper.appendTo(ai.element).data("ui-sortable-item",true);ai.options._helper=ai.options.helper;ai.options.helper=function(){return ag.helper[0]};af.target=ai.currentItem[0];ai._mouseCapture(af,true);ai._mouseStart(af,true,true);ai.offset.click.top=ae.offset.click.top;ai.offset.click.left=ae.offset.click.left;ai.offset.parent.left-=ae.offset.parent.left-ai.offset.parent.left;ai.offset.parent.top-=ae.offset.parent.top-ai.offset.parent.top;ae._trigger("toSortable",af);ae.dropped=ai.element;I.each(ae.sortables,function(){this.refreshPositions()});ae.currentItem=ae.element;ai.fromOutside=ae}if(ai.currentItem){ai._mouseDrag(af);ag.position=ai.position}}else{if(ai.isOver){ai.isOver=0;ai.cancelHelperRemoval=true;ai.options._revert=ai.options.revert;ai.options.revert=false;ai._trigger("out",af,ai._uiHash(ai));ai._mouseStop(af,true);ai.options.revert=ai.options._revert;ai.options.helper=ai.options._helper;if(ai.placeholder){ai.placeholder.remove()}ae._refreshOffsets(af);ag.position=ae._generatePosition(af,true);ae._trigger("fromSortable",af);ae.dropped=false;I.each(ae.sortables,function(){this.refreshPositions()})}}})}});I.ui.plugin.add("draggable","cursor",{start:function(ag,ah,ae){var af=I("body"),ai=ae.options;if(af.css("cursor")){ai._cursor=af.css("cursor")}af.css("cursor",ai.cursor)},stop:function(af,ag,ae){var ah=ae.options;if(ah._cursor){I("body").css("cursor",ah._cursor)}}});I.ui.plugin.add("draggable","opacity",{start:function(ag,ah,ae){var af=I(ah.helper),ai=ae.options;if(af.css("opacity")){ai._opacity=af.css("opacity")}af.css("opacity",ai.opacity)},stop:function(af,ag,ae){var ah=ae.options;if(ah._opacity){I(ag.helper).css("opacity",ah._opacity)}}});I.ui.plugin.add("draggable","scroll",{start:function(af,ag,ae){if(!ae.scrollParentNotHidden){ae.scrollParentNotHidden=ae.helper.scrollParent(false)}if(ae.scrollParentNotHidden[0]!==ae.document[0]&&ae.scrollParentNotHidden[0].tagName!=="HTML"){ae.overflowOffset=ae.scrollParentNotHidden.offset()}},drag:function(ah,ai,ag){var aj=ag.options,af=false,ak=ag.scrollParentNotHidden[0],ae=ag.document[0];if(ak!==ae&&ak.tagName!=="HTML"){if(!aj.axis||aj.axis!=="x"){if((ag.overflowOffset.top+ak.offsetHeight)-ah.pageY<aj.scrollSensitivity){ak.scrollTop=af=ak.scrollTop+aj.scrollSpeed}else{if(ah.pageY-ag.overflowOffset.top<aj.scrollSensitivity){ak.scrollTop=af=ak.scrollTop-aj.scrollSpeed}}}if(!aj.axis||aj.axis!=="y"){if((ag.overflowOffset.left+ak.offsetWidth)-ah.pageX<aj.scrollSensitivity){ak.scrollLeft=af=ak.scrollLeft+aj.scrollSpeed}else{if(ah.pageX-ag.overflowOffset.left<aj.scrollSensitivity){ak.scrollLeft=af=ak.scrollLeft-aj.scrollSpeed}}}}else{if(!aj.axis||aj.axis!=="x"){if(ah.pageY-I(ae).scrollTop()<aj.scrollSensitivity){af=I(ae).scrollTop(I(ae).scrollTop()-aj.scrollSpeed)}else{if(I(window).height()-(ah.pageY-I(ae).scrollTop())<aj.scrollSensitivity){af=I(ae).scrollTop(I(ae).scrollTop()+aj.scrollSpeed)}}}if(!aj.axis||aj.axis!=="y"){if(ah.pageX-I(ae).scrollLeft()<aj.scrollSensitivity){af=I(ae).scrollLeft(I(ae).scrollLeft()-aj.scrollSpeed)}else{if(I(window).width()-(ah.pageX-I(ae).scrollLeft())<aj.scrollSensitivity){af=I(ae).scrollLeft(I(ae).scrollLeft()+aj.scrollSpeed)}}}}if(af!==false&&I.ui.ddmanager&&!aj.dropBehaviour){I.ui.ddmanager.prepareOffsets(ag,ah)}}});I.ui.plugin.add("draggable","snap",{start:function(af,ag,ae){var ah=ae.options;ae.snapElements=[];I(ah.snap.constructor!==String?(ah.snap.items||":data(ui-draggable)"):ah.snap).each(function(){var aj=I(this),ai=aj.offset();if(this!==ae.element[0]){ae.snapElements.push({item:this,width:aj.outerWidth(),height:aj.outerHeight(),top:ai.top,left:ai.left})}})},drag:function(aq,an,ah){var ae,aw,aj,ak,ap,am,al,ax,ar,ai,ao=ah.options,av=ao.snapTolerance,au=an.offset.left,at=au+ah.helperProportions.width,ag=an.offset.top,af=ag+ah.helperProportions.height;for(ar=ah.snapElements.length-1;ar>=0;ar--){ap=ah.snapElements[ar].left-ah.margins.left;am=ap+ah.snapElements[ar].width;al=ah.snapElements[ar].top-ah.margins.top;ax=al+ah.snapElements[ar].height;if(at<ap-av||au>am+av||af<al-av||ag>ax+av||!I.contains(ah.snapElements[ar].item.ownerDocument,ah.snapElements[ar].item)){if(ah.snapElements[ar].snapping){(ah.options.snap.release&&ah.options.snap.release.call(ah.element,aq,I.extend(ah._uiHash(),{snapItem:ah.snapElements[ar].item})))}ah.snapElements[ar].snapping=false;continue}if(ao.snapMode!=="inner"){ae=Math.abs(al-af)<=av;aw=Math.abs(ax-ag)<=av;aj=Math.abs(ap-at)<=av;ak=Math.abs(am-au)<=av;if(ae){an.position.top=ah._convertPositionTo("relative",{top:al-ah.helperProportions.height,left:0}).top}if(aw){an.position.top=ah._convertPositionTo("relative",{top:ax,left:0}).top}if(aj){an.position.left=ah._convertPositionTo("relative",{top:0,left:ap-ah.helperProportions.width}).left}if(ak){an.position.left=ah._convertPositionTo("relative",{top:0,left:am}).left}}ai=(ae||aw||aj||ak);if(ao.snapMode!=="outer"){ae=Math.abs(al-ag)<=av;aw=Math.abs(ax-af)<=av;aj=Math.abs(ap-au)<=av;ak=Math.abs(am-at)<=av;if(ae){an.position.top=ah._convertPositionTo("relative",{top:al,left:0}).top}if(aw){an.position.top=ah._convertPositionTo("relative",{top:ax-ah.helperProportions.height,left:0}).top}if(aj){an.position.left=ah._convertPositionTo("relative",{top:0,left:ap}).left}if(ak){an.position.left=ah._convertPositionTo("relative",{top:0,left:am-ah.helperProportions.width}).left}}if(!ah.snapElements[ar].snapping&&(ae||aw||aj||ak||ai)){(ah.options.snap.snap&&ah.options.snap.snap.call(ah.element,aq,I.extend(ah._uiHash(),{snapItem:ah.snapElements[ar].item})))}ah.snapElements[ar].snapping=(ae||aw||aj||ak||ai)}}});I.ui.plugin.add("draggable","stack",{start:function(ag,ah,ae){var af,aj=ae.options,ai=I.makeArray(I(aj.stack)).sort(function(al,ak){return(parseInt(I(al).css("zIndex"),10)||0)-(parseInt(I(ak).css("zIndex"),10)||0)});if(!ai.length){return}af=parseInt(I(ai[0]).css("zIndex"),10)||0;I(ai).each(function(ak){I(this).css("zIndex",af+ak)});this.css("zIndex",(af+ai.length))}});I.ui.plugin.add("draggable","zIndex",{start:function(ag,ah,ae){var af=I(ah.helper),ai=ae.options;if(af.css("zIndex")){ai._zIndex=af.css("zIndex")}af.css("zIndex",ai.zIndex)},stop:function(af,ag,ae){var ah=ae.options;if(ah._zIndex){I(ag.helper).css("zIndex",ah._zIndex)}}});var X=I.ui.draggable;
116
+ /*!
117
+ * jQuery UI Resizable 1.11.2
118
+ * http://jqueryui.com
119
+ *
120
+ * Copyright 2014 jQuery Foundation and other contributors
121
+ * Released under the MIT license.
122
+ * http://jquery.org/license
123
+ *
124
+ * http://api.jqueryui.com/resizable/
125
+ */
126
+ I.widget("ui.resizable",I.ui.mouse,{version:"1.11.2",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(ae){return parseInt(ae,10)||0},_isNumber:function(ae){return !isNaN(parseInt(ae,10))},_hasScroll:function(ah,af){if(I(ah).css("overflow")==="hidden"){return false}var ae=(af&&af==="left")?"scrollLeft":"scrollTop",ag=false;if(ah[ae]>0){return true}ah[ae]=1;ag=(ah[ae]>0);ah[ae]=0;return ag},_create:function(){var ak,af,ai,ag,ae,ah=this,aj=this.options;this.element.addClass("ui-resizable");I.extend(this,{_aspectRatio:!!(aj.aspectRatio),aspectRatio:aj.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:aj.helper||aj.ghost||aj.animate?aj.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(I("<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=true;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=aj.handles||(!I(".ui-resizable-handle",this.element).length?"e,s,se":{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"});if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}ak=this.handles.split(",");this.handles={};for(af=0;af<ak.length;af++){ai=I.trim(ak[af]);ae="ui-resizable-"+ai;ag=I("<div class='ui-resizable-handle "+ae+"'></div>");ag.css({zIndex:aj.zIndex});if("se"===ai){ag.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[ai]=".ui-resizable-"+ai;this.element.append(ag)}}this._renderAxis=function(ap){var am,an,al,ao;ap=ap||this.element;for(am in this.handles){if(this.handles[am].constructor===String){this.handles[am]=this.element.children(this.handles[am]).first().show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){an=I(this.handles[am],this.element);ao=/sw|ne|nw|se|n|s/.test(am)?an.outerHeight():an.outerWidth();al=["padding",/ne|nw|n/.test(am)?"Top":/se|sw|s/.test(am)?"Bottom":/^e$/.test(am)?"Right":"Left"].join("");ap.css(al,ao);this._proportionallyResize()}if(!I(this.handles[am]).length){continue}}};this._renderAxis(this.element);this._handles=I(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!ah.resizing){if(this.className){ag=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}ah.axis=ag&&ag[1]?ag[1]:"se"}});if(aj.autoHide){this._handles.hide();I(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(aj.disabled){return}I(this).removeClass("ui-resizable-autohide");ah._handles.show()}).mouseleave(function(){if(aj.disabled){return}if(!ah.resizing){I(this).addClass("ui-resizable-autohide");ah._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();var af,ae=function(ag){I(ag).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){ae(this.element);af=this.element;this.originalElement.css({position:af.css("position"),width:af.outerWidth(),height:af.outerHeight(),top:af.css("top"),left:af.css("left")}).insertAfter(af);af.remove()}this.originalElement.css("resize",this.originalResizeStyle);ae(this.originalElement);return this},_mouseCapture:function(ag){var af,ah,ae=false;for(af in this.handles){ah=I(this.handles[af])[0];if(ah===ag.target||I.contains(ah,ag.target)){ae=true}}return !this.options.disabled&&ae},_mouseStart:function(af){var aj,ag,ai,ah=this.options,ae=this.element;this.resizing=true;this._renderProxy();aj=this._num(this.helper.css("left"));ag=this._num(this.helper.css("top"));if(ah.containment){aj+=I(ah.containment).scrollLeft()||0;ag+=I(ah.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:aj,top:ag};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:ae.width(),height:ae.height()};this.originalSize=this._helper?{width:ae.outerWidth(),height:ae.outerHeight()}:{width:ae.width(),height:ae.height()};this.sizeDiff={width:ae.outerWidth()-ae.width(),height:ae.outerHeight()-ae.height()};this.originalPosition={left:aj,top:ag};this.originalMousePosition={left:af.pageX,top:af.pageY};this.aspectRatio=(typeof ah.aspectRatio==="number")?ah.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);ai=I(".ui-resizable-"+this.axis).css("cursor");I("body").css("cursor",ai==="auto"?this.axis+"-resize":ai);ae.addClass("ui-resizable-resizing");this._propagate("start",af);return true},_mouseDrag:function(aj){var ak,ai,al=this.originalMousePosition,af=this.axis,ag=(aj.pageX-al.left)||0,ae=(aj.pageY-al.top)||0,ah=this._change[af];this._updatePrevProperties();if(!ah){return false}ak=ah.apply(this,[aj,ag,ae]);this._updateVirtualBoundaries(aj.shiftKey);if(this._aspectRatio||aj.shiftKey){ak=this._updateRatio(ak,aj)}ak=this._respectSize(ak,aj);this._updateCache(ak);this._propagate("resize",aj);ai=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!I.isEmptyObject(ai)){this._updatePrevProperties();this._trigger("resize",aj,this.ui());this._applyChanges()}return false},_mouseStop:function(ah){this.resizing=false;var ag,ae,af,ak,an,aj,am,ai=this.options,al=this;if(this._helper){ag=this._proportionallyResizeElements;ae=ag.length&&(/textarea/i).test(ag[0].nodeName);af=ae&&this._hasScroll(ag[0],"left")?0:al.sizeDiff.height;ak=ae?0:al.sizeDiff.width;an={width:(al.helper.width()-ak),height:(al.helper.height()-af)};aj=(parseInt(al.element.css("left"),10)+(al.position.left-al.originalPosition.left))||null;am=(parseInt(al.element.css("top"),10)+(al.position.top-al.originalPosition.top))||null;if(!ai.animate){this.element.css(I.extend(an,{top:am,left:aj}))}al.helper.height(al.size.height);al.helper.width(al.size.width);if(this._helper&&!ai.animate){this._proportionallyResize()}}I("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",ah);if(this._helper){this.helper.remove()}return false},_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 ae={};if(this.position.top!==this.prevPosition.top){ae.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){ae.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){ae.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){ae.height=this.size.height+"px"}this.helper.css(ae);return ae},_updateVirtualBoundaries:function(ag){var ai,ah,af,ak,ae,aj=this.options;ae={minWidth:this._isNumber(aj.minWidth)?aj.minWidth:0,maxWidth:this._isNumber(aj.maxWidth)?aj.maxWidth:Infinity,minHeight:this._isNumber(aj.minHeight)?aj.minHeight:0,maxHeight:this._isNumber(aj.maxHeight)?aj.maxHeight:Infinity};if(this._aspectRatio||ag){ai=ae.minHeight*this.aspectRatio;af=ae.minWidth/this.aspectRatio;ah=ae.maxHeight*this.aspectRatio;ak=ae.maxWidth/this.aspectRatio;if(ai>ae.minWidth){ae.minWidth=ai}if(af>ae.minHeight){ae.minHeight=af}if(ah<ae.maxWidth){ae.maxWidth=ah}if(ak<ae.maxHeight){ae.maxHeight=ak}}this._vBoundaries=ae},_updateCache:function(ae){this.offset=this.helper.offset();if(this._isNumber(ae.left)){this.position.left=ae.left}if(this._isNumber(ae.top)){this.position.top=ae.top}if(this._isNumber(ae.height)){this.size.height=ae.height}if(this._isNumber(ae.width)){this.size.width=ae.width}},_updateRatio:function(ag){var ah=this.position,af=this.size,ae=this.axis;if(this._isNumber(ag.height)){ag.width=(ag.height*this.aspectRatio)}else{if(this._isNumber(ag.width)){ag.height=(ag.width/this.aspectRatio)}}if(ae==="sw"){ag.left=ah.left+(af.width-ag.width);ag.top=null}if(ae==="nw"){ag.top=ah.top+(af.height-ag.height);ag.left=ah.left+(af.width-ag.width)}return ag},_respectSize:function(aj){var ag=this._vBoundaries,am=this.axis,ao=this._isNumber(aj.width)&&ag.maxWidth&&(ag.maxWidth<aj.width),ak=this._isNumber(aj.height)&&ag.maxHeight&&(ag.maxHeight<aj.height),ah=this._isNumber(aj.width)&&ag.minWidth&&(ag.minWidth>aj.width),an=this._isNumber(aj.height)&&ag.minHeight&&(ag.minHeight>aj.height),af=this.originalPosition.left+this.originalSize.width,al=this.position.top+this.size.height,ai=/sw|nw|w/.test(am),ae=/nw|ne|n/.test(am);if(ah){aj.width=ag.minWidth}if(an){aj.height=ag.minHeight}if(ao){aj.width=ag.maxWidth}if(ak){aj.height=ag.maxHeight}if(ah&&ai){aj.left=af-ag.minWidth}if(ao&&ai){aj.left=af-ag.maxWidth}if(an&&ae){aj.top=al-ag.minHeight}if(ak&&ae){aj.top=al-ag.maxHeight}if(!aj.width&&!aj.height&&!aj.left&&aj.top){aj.top=null}else{if(!aj.width&&!aj.height&&!aj.top&&aj.left){aj.left=null}}return aj},_getPaddingPlusBorderDimensions:function(ag){var af=0,ah=[],ai=[ag.css("borderTopWidth"),ag.css("borderRightWidth"),ag.css("borderBottomWidth"),ag.css("borderLeftWidth")],ae=[ag.css("paddingTop"),ag.css("paddingRight"),ag.css("paddingBottom"),ag.css("paddingLeft")];for(;af<4;af++){ah[af]=(parseInt(ai[af],10)||0);ah[af]+=(parseInt(ae[af],10)||0)}return{height:ah[0]+ah[2],width:ah[1]+ah[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var ag,af=0,ae=this.helper||this.element;for(;af<this._proportionallyResizeElements.length;af++){ag=this._proportionallyResizeElements[af];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(ag)}ag.css({height:(ae.height()-this.outerDimensions.height)||0,width:(ae.width()-this.outerDimensions.width)||0})}},_renderProxy:function(){var ae=this.element,af=this.options;this.elementOffset=ae.offset();if(this._helper){this.helper=this.helper||I("<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:++af.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(af,ae){return{width:this.originalSize.width+ae}},w:function(ag,ae){var af=this.originalSize,ah=this.originalPosition;return{left:ah.left+ae,width:af.width-ae}},n:function(ah,af,ae){var ag=this.originalSize,ai=this.originalPosition;return{top:ai.top+ae,height:ag.height-ae}},s:function(ag,af,ae){return{height:this.originalSize.height+ae}},se:function(ag,af,ae){return I.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[ag,af,ae]))},sw:function(ag,af,ae){return I.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[ag,af,ae]))},ne:function(ag,af,ae){return I.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[ag,af,ae]))},nw:function(ag,af,ae){return I.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[ag,af,ae]))}},_propagate:function(af,ae){I.ui.plugin.call(this,af,[ae,this.ui()]);(af!=="resize"&&this._trigger(af,ae,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}}});I.ui.plugin.add("resizable","animate",{stop:function(ah){var am=I(this).resizable("instance"),aj=am.options,ag=am._proportionallyResizeElements,ae=ag.length&&(/textarea/i).test(ag[0].nodeName),af=ae&&am._hasScroll(ag[0],"left")?0:am.sizeDiff.height,al=ae?0:am.sizeDiff.width,ai={width:(am.size.width-al),height:(am.size.height-af)},ak=(parseInt(am.element.css("left"),10)+(am.position.left-am.originalPosition.left))||null,an=(parseInt(am.element.css("top"),10)+(am.position.top-am.originalPosition.top))||null;am.element.animate(I.extend(ai,an&&ak?{top:an,left:ak}:{}),{duration:aj.animateDuration,easing:aj.animateEasing,step:function(){var ao={width:parseInt(am.element.css("width"),10),height:parseInt(am.element.css("height"),10),top:parseInt(am.element.css("top"),10),left:parseInt(am.element.css("left"),10)};if(ag&&ag.length){I(ag[0]).css({width:ao.width,height:ao.height})}am._updateCache(ao);am._propagate("resize",ah)}})}});I.ui.plugin.add("resizable","containment",{start:function(){var am,ag,ao,ae,al,ah,ap,an=I(this).resizable("instance"),ak=an.options,aj=an.element,af=ak.containment,ai=(af instanceof I)?af.get(0):(/parent/.test(af))?aj.parent().get(0):af;if(!ai){return}an.containerElement=I(ai);if(/document/.test(af)||af===document){an.containerOffset={left:0,top:0};an.containerPosition={left:0,top:0};an.parentData={element:I(document),left:0,top:0,width:I(document).width(),height:I(document).height()||document.body.parentNode.scrollHeight}}else{am=I(ai);ag=[];I(["Top","Right","Left","Bottom"]).each(function(ar,aq){ag[ar]=an._num(am.css("padding"+aq))});an.containerOffset=am.offset();an.containerPosition=am.position();an.containerSize={height:(am.innerHeight()-ag[3]),width:(am.innerWidth()-ag[1])};ao=an.containerOffset;ae=an.containerSize.height;al=an.containerSize.width;ah=(an._hasScroll(ai,"left")?ai.scrollWidth:al);ap=(an._hasScroll(ai)?ai.scrollHeight:ae);an.parentData={element:ai,left:ao.left,top:ao.top,width:ah,height:ap}}},resize:function(af){var al,aq,ak,ai,am=I(this).resizable("instance"),ah=am.options,ao=am.containerOffset,an=am.position,ap=am._aspectRatio||af.shiftKey,ae={top:0,left:0},ag=am.containerElement,aj=true;if(ag[0]!==document&&(/static/).test(ag.css("position"))){ae=ao}if(an.left<(am._helper?ao.left:0)){am.size.width=am.size.width+(am._helper?(am.position.left-ao.left):(am.position.left-ae.left));if(ap){am.size.height=am.size.width/am.aspectRatio;aj=false}am.position.left=ah.helper?ao.left:0}if(an.top<(am._helper?ao.top:0)){am.size.height=am.size.height+(am._helper?(am.position.top-ao.top):am.position.top);if(ap){am.size.width=am.size.height*am.aspectRatio;aj=false}am.position.top=am._helper?ao.top:0}ak=am.containerElement.get(0)===am.element.parent().get(0);ai=/relative|absolute/.test(am.containerElement.css("position"));if(ak&&ai){am.offset.left=am.parentData.left+am.position.left;am.offset.top=am.parentData.top+am.position.top}else{am.offset.left=am.element.offset().left;am.offset.top=am.element.offset().top}al=Math.abs(am.sizeDiff.width+(am._helper?am.offset.left-ae.left:(am.offset.left-ao.left)));aq=Math.abs(am.sizeDiff.height+(am._helper?am.offset.top-ae.top:(am.offset.top-ao.top)));if(al+am.size.width>=am.parentData.width){am.size.width=am.parentData.width-al;if(ap){am.size.height=am.size.width/am.aspectRatio;aj=false}}if(aq+am.size.height>=am.parentData.height){am.size.height=am.parentData.height-aq;if(ap){am.size.width=am.size.height*am.aspectRatio;aj=false}}if(!aj){am.position.left=am.prevPosition.left;am.position.top=am.prevPosition.top;am.size.width=am.prevSize.width;am.size.height=am.prevSize.height}},stop:function(){var aj=I(this).resizable("instance"),af=aj.options,ak=aj.containerOffset,ae=aj.containerPosition,ag=aj.containerElement,ah=I(aj.helper),am=ah.offset(),al=ah.outerWidth()-aj.sizeDiff.width,ai=ah.outerHeight()-aj.sizeDiff.height;if(aj._helper&&!af.animate&&(/relative/).test(ag.css("position"))){I(this).css({left:am.left-ae.left-ak.left,width:al,height:ai})}if(aj._helper&&!af.animate&&(/static/).test(ag.css("position"))){I(this).css({left:am.left-ae.left-ak.left,width:al,height:ai})}}});I.ui.plugin.add("resizable","alsoResize",{start:function(){var ae=I(this).resizable("instance"),ag=ae.options,af=function(ah){I(ah).each(function(){var ai=I(this);ai.data("ui-resizable-alsoresize",{width:parseInt(ai.width(),10),height:parseInt(ai.height(),10),left:parseInt(ai.css("left"),10),top:parseInt(ai.css("top"),10)})})};if(typeof(ag.alsoResize)==="object"&&!ag.alsoResize.parentNode){if(ag.alsoResize.length){ag.alsoResize=ag.alsoResize[0];af(ag.alsoResize)}else{I.each(ag.alsoResize,function(ah){af(ah)})}}else{af(ag.alsoResize)}},resize:function(ag,ai){var af=I(this).resizable("instance"),aj=af.options,ah=af.originalSize,al=af.originalPosition,ak={height:(af.size.height-ah.height)||0,width:(af.size.width-ah.width)||0,top:(af.position.top-al.top)||0,left:(af.position.left-al.left)||0},ae=function(am,an){I(am).each(function(){var aq=I(this),ar=I(this).data("ui-resizable-alsoresize"),ap={},ao=an&&an.length?an:aq.parents(ai.originalElement[0]).length?["width","height"]:["width","height","top","left"];I.each(ao,function(at,av){var au=(ar[av]||0)+(ak[av]||0);if(au&&au>=0){ap[av]=au||null}});aq.css(ap)})};if(typeof(aj.alsoResize)==="object"&&!aj.alsoResize.nodeType){I.each(aj.alsoResize,function(am,an){ae(am,an)})}else{ae(aj.alsoResize)}},stop:function(){I(this).removeData("resizable-alsoresize")}});I.ui.plugin.add("resizable","ghost",{start:function(){var af=I(this).resizable("instance"),ag=af.options,ae=af.size;af.ghost=af.originalElement.clone();af.ghost.css({opacity:0.25,display:"block",position:"relative",height:ae.height,width:ae.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof ag.ghost==="string"?ag.ghost:"");af.ghost.appendTo(af.helper)},resize:function(){var ae=I(this).resizable("instance");if(ae.ghost){ae.ghost.css({position:"relative",height:ae.size.height,width:ae.size.width})}},stop:function(){var ae=I(this).resizable("instance");if(ae.ghost&&ae.helper){ae.helper.get(0).removeChild(ae.ghost.get(0))}}});I.ui.plugin.add("resizable","grid",{resize:function(){var ah,am=I(this).resizable("instance"),aq=am.options,ak=am.size,al=am.originalSize,an=am.originalPosition,aw=am.axis,ae=typeof aq.grid==="number"?[aq.grid,aq.grid]:aq.grid,au=(ae[0]||1),at=(ae[1]||1),aj=Math.round((ak.width-al.width)/au)*au,ai=Math.round((ak.height-al.height)/at)*at,ao=al.width+aj,ar=al.height+ai,ag=aq.maxWidth&&(aq.maxWidth<ao),ap=aq.maxHeight&&(aq.maxHeight<ar),av=aq.minWidth&&(aq.minWidth>ao),af=aq.minHeight&&(aq.minHeight>ar);aq.grid=ae;if(av){ao+=au}if(af){ar+=at}if(ag){ao-=au}if(ap){ar-=at}if(/^(se|s|e)$/.test(aw)){am.size.width=ao;am.size.height=ar}else{if(/^(ne)$/.test(aw)){am.size.width=ao;am.size.height=ar;am.position.top=an.top-ai}else{if(/^(sw)$/.test(aw)){am.size.width=ao;am.size.height=ar;am.position.left=an.left-aj}else{if(ar-at<=0||ao-au<=0){ah=am._getPaddingPlusBorderDimensions(this)}if(ar-at>0){am.size.height=ar;am.position.top=an.top-ai}else{ar=at-ah.height;am.size.height=ar;am.position.top=an.top+al.height-ar}if(ao-au>0){am.size.width=ao;am.position.left=an.left-aj}else{ao=at-ah.height;am.size.width=ao;am.position.left=an.left+al.width-ao}}}}}});var N=I.ui.resizable;
127
+ /*!
128
+ * jQuery UI Dialog 1.11.2
129
+ * http://jqueryui.com
130
+ *
131
+ * Copyright 2014 jQuery Foundation and other contributors
132
+ * Released under the MIT license.
133
+ * http://jquery.org/license
134
+ *
135
+ * http://api.jqueryui.com/dialog/
136
+ */
137
+ var V=I.widget("ui.dialog",{version:"1.11.2",options:{appendTo:"body",autoOpen:true,buttons:[],closeOnEscape:true,closeText:"Close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(af){var ae=I(this).css(af).offset().top;if(ae<0){I(this).css("top",af.top-ae)}}},resizable:true,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:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_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();if(this.options.draggable&&I.fn.draggable){this._makeDraggable()}if(this.options.resizable&&I.fn.resizable){this._makeResizable()}this._isOpen=false;this._trackFocus()},_init:function(){if(this.options.autoOpen){this.open()}},_appendTo:function(){var ae=this.options.appendTo;if(ae&&(ae.jquery||ae.nodeType)){return I(ae)}return this.document.find(ae||"body").eq(0)},_destroy:function(){var af,ae=this.originalPosition;this._destroyOverlay();this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach();this.uiDialog.stop(true,true).remove();if(this.originalTitle){this.element.attr("title",this.originalTitle)}af=ae.parent.children().eq(ae.index);if(af.length&&af[0]!==this.element[0]){af.before(this.element)}else{ae.parent.append(this.element)}},widget:function(){return this.uiDialog},disable:I.noop,enable:I.noop,close:function(ah){var ag,af=this;if(!this._isOpen||this._trigger("beforeClose",ah)===false){return}this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").focus().length){try{ag=this.document[0].activeElement;if(ag&&ag.nodeName.toLowerCase()!=="body"){I(ag).blur()}}catch(ae){}}this._hide(this.uiDialog,this.options.hide,function(){af._trigger("close",ah)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(ai,af){var ah=false,ae=this.uiDialog.siblings(".ui-front:visible").map(function(){return +I(this).css("z-index")}).get(),ag=Math.max.apply(null,ae);if(ag>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",ag+1);ah=true}if(ah&&!af){this._trigger("focus",ai)}return ah},open:function(){var ae=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable()}return}this._isOpen=true;this.opener=I(this.document[0].activeElement);this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",this.uiDialog.css("z-index")-1)}this._show(this.uiDialog,this.options.show,function(){ae._focusTabbable();ae._trigger("focus")});this._makeFocusTarget();this._trigger("open")},_focusTabbable:function(){var ae=this._focusedElement;if(!ae){ae=this.element.find("[autofocus]")}if(!ae.length){ae=this.element.find(":tabbable")}if(!ae.length){ae=this.uiDialogButtonPane.find(":tabbable")}if(!ae.length){ae=this.uiDialogTitlebarClose.filter(":tabbable")}if(!ae.length){ae=this.uiDialog}ae.eq(0).focus()},_keepFocus:function(ae){function af(){var ah=this.document[0].activeElement,ag=this.uiDialog[0]===ah||I.contains(this.uiDialog[0],ah);if(!ag){this._focusTabbable()}}ae.preventDefault();af.call(this);this._delay(af)},_createWrapper:function(){this.uiDialog=I("<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(ag){if(this.options.closeOnEscape&&!ag.isDefaultPrevented()&&ag.keyCode&&ag.keyCode===I.ui.keyCode.ESCAPE){ag.preventDefault();this.close(ag);return}if(ag.keyCode!==I.ui.keyCode.TAB||ag.isDefaultPrevented()){return}var af=this.uiDialog.find(":tabbable"),ah=af.filter(":first"),ae=af.filter(":last");if((ag.target===ae[0]||ag.target===this.uiDialog[0])&&!ag.shiftKey){this._delay(function(){ah.focus()});ag.preventDefault()}else{if((ag.target===ah[0]||ag.target===this.uiDialog[0])&&ag.shiftKey){this._delay(function(){ae.focus()});ag.preventDefault()}}},mousedown:function(ae){if(this._moveToTop(ae)){this._focusTabbable()}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})}},_createTitlebar:function(){var ae;this.uiDialogTitlebar=I("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog);this._on(this.uiDialogTitlebar,{mousedown:function(af){if(!I(af.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.focus()}}});this.uiDialogTitlebarClose=I("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:false}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar);this._on(this.uiDialogTitlebarClose,{click:function(af){af.preventDefault();this.close(af)}});ae=I("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar);this._title(ae);this.uiDialog.attr({"aria-labelledby":ae.attr("id")})},_title:function(ae){if(!this.options.title){ae.html("&#160;")}ae.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=I("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiButtonSet=I("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane);this._createButtons()},_createButtons:function(){var af=this,ae=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if(I.isEmptyObject(ae)||(I.isArray(ae)&&!ae.length)){this.uiDialog.removeClass("ui-dialog-buttons");return}I.each(ae,function(ag,ah){var ai,aj;ah=I.isFunction(ah)?{click:ah,text:ag}:ah;ah=I.extend({type:"button"},ah);ai=ah.click;ah.click=function(){ai.apply(af.element[0],arguments)};aj={icons:ah.icons,text:ah.showText};delete ah.icons;delete ah.showText;I("<button></button>",ah).button(aj).appendTo(af.uiButtonSet)});this.uiDialog.addClass("ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){var ag=this,af=this.options;function ae(ah){return{position:ah.position,offset:ah.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(ah,ai){I(this).addClass("ui-dialog-dragging");ag._blockFrames();ag._trigger("dragStart",ah,ae(ai))},drag:function(ah,ai){ag._trigger("drag",ah,ae(ai))},stop:function(ah,ai){var ak=ai.offset.left-ag.document.scrollLeft(),aj=ai.offset.top-ag.document.scrollTop();af.position={my:"left top",at:"left"+(ak>=0?"+":"")+ak+" top"+(aj>=0?"+":"")+aj,of:ag.window};I(this).removeClass("ui-dialog-dragging");ag._unblockFrames();ag._trigger("dragStop",ah,ae(ai))}})},_makeResizable:function(){var aj=this,ah=this.options,ai=ah.resizable,ae=this.uiDialog.css("position"),ag=typeof ai==="string"?ai:"n,e,s,w,se,sw,ne,nw";function af(ak){return{originalPosition:ak.originalPosition,originalSize:ak.originalSize,position:ak.position,size:ak.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:ah.maxWidth,maxHeight:ah.maxHeight,minWidth:ah.minWidth,minHeight:this._minHeight(),handles:ag,start:function(ak,al){I(this).addClass("ui-dialog-resizing");aj._blockFrames();aj._trigger("resizeStart",ak,af(al))},resize:function(ak,al){aj._trigger("resize",ak,af(al))},stop:function(ak,al){var ao=aj.uiDialog.offset(),an=ao.left-aj.document.scrollLeft(),am=ao.top-aj.document.scrollTop();ah.height=aj.uiDialog.height();ah.width=aj.uiDialog.width();ah.position={my:"left top",at:"left"+(an>=0?"+":"")+an+" top"+(am>=0?"+":"")+am,of:aj.window};I(this).removeClass("ui-dialog-resizing");aj._unblockFrames();aj._trigger("resizeStop",ak,af(al))}}).css("position",ae)},_trackFocus:function(){this._on(this.widget(),{focusin:function(ae){this._makeFocusTarget();this._focusedElement=I(ae.target)}})},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this)},_untrackInstance:function(){var af=this._trackingInstances(),ae=I.inArray(this,af);if(ae!==-1){af.splice(ae,1)}},_trackingInstances:function(){var ae=this.document.data("ui-dialog-instances");if(!ae){ae=[];this.document.data("ui-dialog-instances",ae)}return ae},_minHeight:function(){var ae=this.options;return ae.height==="auto"?ae.minHeight:Math.min(ae.minHeight,ae.height)},_position:function(){var ae=this.uiDialog.is(":visible");if(!ae){this.uiDialog.show()}this.uiDialog.position(this.options.position);if(!ae){this.uiDialog.hide()}},_setOptions:function(ag){var ah=this,af=false,ae={};I.each(ag,function(ai,aj){ah._setOption(ai,aj);if(ai in ah.sizeRelatedOptions){af=true}if(ai in ah.resizableRelatedOptions){ae[ai]=aj}});if(af){this._size();this._position()}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",ae)}},_setOption:function(ag,ah){var af,ai,ae=this.uiDialog;if(ag==="dialogClass"){ae.removeClass(this.options.dialogClass).addClass(ah)}if(ag==="disabled"){return}this._super(ag,ah);if(ag==="appendTo"){this.uiDialog.appendTo(this._appendTo())}if(ag==="buttons"){this._createButtons()}if(ag==="closeText"){this.uiDialogTitlebarClose.button({label:""+ah})}if(ag==="draggable"){af=ae.is(":data(ui-draggable)");if(af&&!ah){ae.draggable("destroy")}if(!af&&ah){this._makeDraggable()}}if(ag==="position"){this._position()}if(ag==="resizable"){ai=ae.is(":data(ui-resizable)");if(ai&&!ah){ae.resizable("destroy")}if(ai&&typeof ah==="string"){ae.resizable("option","handles",ah)}if(!ai&&ah!==false){this._makeResizable()}}if(ag==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))}},_size:function(){var ae,ag,ah,af=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(af.minWidth>af.width){af.width=af.minWidth}ae=this.uiDialog.css({height:"auto",width:af.width}).outerHeight();ag=Math.max(0,af.minHeight-ae);ah=typeof af.maxHeight==="number"?Math.max(0,af.maxHeight-ae):"none";if(af.height==="auto"){this.element.css({minHeight:ag,maxHeight:ah,height:"auto"})}else{this.element.height(Math.max(0,af.height-ae))}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var ae=I(this);return I("<div>").css({position:"absolute",width:ae.outerWidth(),height:ae.outerHeight()}).appendTo(ae.parent()).offset(ae.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_allowInteraction:function(ae){if(I(ae.target).closest(".ui-dialog").length){return true}return !!I(ae.target).closest(".ui-datepicker").length},_createOverlay:function(){if(!this.options.modal){return}var ae=true;this._delay(function(){ae=false});if(!this.document.data("ui-dialog-overlays")){this._on(this.document,{focusin:function(af){if(ae){return}if(!this._allowInteraction(af)){af.preventDefault();this._trackingInstances()[0]._focusTabbable()}}})}this.overlay=I("<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){return}if(this.overlay){var ae=this.document.data("ui-dialog-overlays")-1;if(!ae){this.document.unbind("focusin").removeData("ui-dialog-overlays")}else{this.document.data("ui-dialog-overlays",ae)}this.overlay.remove();this.overlay=null}}});
138
+ /*!
139
+ * jQuery UI Droppable 1.11.2
140
+ * http://jqueryui.com
141
+ *
142
+ * Copyright 2014 jQuery Foundation and other contributors
143
+ * Released under the MIT license.
144
+ * http://jquery.org/license
145
+ *
146
+ * http://api.jqueryui.com/droppable/
147
+ */
148
+ I.widget("ui.droppable",{version:"1.11.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var af,ag=this.options,ae=ag.accept;this.isover=false;this.isout=true;this.accept=I.isFunction(ae)?ae:function(ah){return ah.is(ae)};this.proportions=function(){if(arguments.length){af=arguments[0]}else{return af?af:af={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(ag.scope);ag.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(ae){I.ui.ddmanager.droppables[ae]=I.ui.ddmanager.droppables[ae]||[];I.ui.ddmanager.droppables[ae].push(this)},_splice:function(ae){var af=0;for(;af<ae.length;af++){if(ae[af]===this){ae.splice(af,1)}}},_destroy:function(){var ae=I.ui.ddmanager.droppables[this.options.scope];this._splice(ae);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(af,ag){if(af==="accept"){this.accept=I.isFunction(ag)?ag:function(ah){return ah.is(ag)}}else{if(af==="scope"){var ae=I.ui.ddmanager.droppables[this.options.scope];this._splice(ae);this._addToManager(ag)}}this._super(af,ag)},_activate:function(af){var ae=I.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}if(ae){this._trigger("activate",af,this.ui(ae))}},_deactivate:function(af){var ae=I.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(ae){this._trigger("deactivate",af,this.ui(ae))}},_over:function(af){var ae=I.ui.ddmanager.current;if(!ae||(ae.currentItem||ae.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],(ae.currentItem||ae.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",af,this.ui(ae))}},_out:function(af){var ae=I.ui.ddmanager.current;if(!ae||(ae.currentItem||ae.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],(ae.currentItem||ae.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",af,this.ui(ae))}},_drop:function(af,ag){var ae=ag||I.ui.ddmanager.current,ah=false;if(!ae||(ae.currentItem||ae.element)[0]===this.element[0]){return false}this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var ai=I(this).droppable("instance");if(ai.options.greedy&&!ai.options.disabled&&ai.options.scope===ae.options.scope&&ai.accept.call(ai.element[0],(ae.currentItem||ae.element))&&I.ui.intersect(ae,I.extend(ai,{offset:ai.element.offset()}),ai.options.tolerance,af)){ah=true;return false}});if(ah){return false}if(this.accept.call(this.element[0],(ae.currentItem||ae.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",af,this.ui(ae));return this.element}return false},ui:function(ae){return{draggable:(ae.currentItem||ae.element),helper:ae.helper,position:ae.position,offset:ae.positionAbs}}});I.ui.intersect=(function(){function ae(ag,af,ah){return(ag>=af)&&(ag<(af+ah))}return function(aq,ak,ao,ag){if(!ak.offset){return false}var ai=(aq.positionAbs||aq.position.absolute).left+aq.margins.left,an=(aq.positionAbs||aq.position.absolute).top+aq.margins.top,ah=ai+aq.helperProportions.width,am=an+aq.helperProportions.height,aj=ak.offset.left,ap=ak.offset.top,af=aj+ak.proportions().width,al=ap+ak.proportions().height;switch(ao){case"fit":return(aj<=ai&&ah<=af&&ap<=an&&am<=al);case"intersect":return(aj<ai+(aq.helperProportions.width/2)&&ah-(aq.helperProportions.width/2)<af&&ap<an+(aq.helperProportions.height/2)&&am-(aq.helperProportions.height/2)<al);case"pointer":return ae(ag.pageY,ap,ak.proportions().height)&&ae(ag.pageX,aj,ak.proportions().width);case"touch":return((an>=ap&&an<=al)||(am>=ap&&am<=al)||(an<ap&&am>al))&&((ai>=aj&&ai<=af)||(ah>=aj&&ah<=af)||(ai<aj&&ah>af));default:return false}}})();I.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(ah,aj){var ag,af,ae=I.ui.ddmanager.droppables[ah.options.scope]||[],ai=aj?aj.type:null,ak=(ah.currentItem||ah.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(ag=0;ag<ae.length;ag++){if(ae[ag].options.disabled||(ah&&!ae[ag].accept.call(ae[ag].element[0],(ah.currentItem||ah.element)))){continue}for(af=0;af<ak.length;af++){if(ak[af]===ae[ag].element[0]){ae[ag].proportions().height=0;continue droppablesLoop}}ae[ag].visible=ae[ag].element.css("display")!=="none";if(!ae[ag].visible){continue}if(ai==="mousedown"){ae[ag]._activate.call(ae[ag],aj)}ae[ag].offset=ae[ag].element.offset();ae[ag].proportions({width:ae[ag].element[0].offsetWidth,height:ae[ag].element[0].offsetHeight})}},drop:function(ae,af){var ag=false;I.each((I.ui.ddmanager.droppables[ae.options.scope]||[]).slice(),function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&I.ui.intersect(ae,this,this.options.tolerance,af)){ag=this._drop.call(this,af)||ag}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(ae.currentItem||ae.element))){this.isout=true;this.isover=false;this._deactivate.call(this,af)}});return ag},dragStart:function(ae,af){ae.element.parentsUntil("body").bind("scroll.droppable",function(){if(!ae.options.refreshPositions){I.ui.ddmanager.prepareOffsets(ae,af)}})},drag:function(ae,af){if(ae.options.refreshPositions){I.ui.ddmanager.prepareOffsets(ae,af)}I.each(I.ui.ddmanager.droppables[ae.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var aj,ah,ag,ai=I.ui.intersect(ae,this,this.options.tolerance,af),ak=!ai&&this.isover?"isout":(ai&&!this.isover?"isover":null);if(!ak){return}if(this.options.greedy){ah=this.options.scope;ag=this.element.parents(":data(ui-droppable)").filter(function(){return I(this).droppable("instance").options.scope===ah});if(ag.length){aj=I(ag[0]).droppable("instance");aj.greedyChild=(ak==="isover")}}if(aj&&ak==="isover"){aj.isover=false;aj.isout=true;aj._out.call(aj,af)}this[ak]=true;this[ak==="isout"?"isover":"isout"]=false;this[ak==="isover"?"_over":"_out"].call(this,af);if(aj&&ak==="isout"){aj.isout=false;aj.isover=true;aj._over.call(aj,af)}})},dragStop:function(ae,af){ae.element.parentsUntil("body").unbind("scroll.droppable");if(!ae.options.refreshPositions){I.ui.ddmanager.prepareOffsets(ae,af)}}};var d=I.ui.droppable;
149
+ /*!
150
+ * jQuery UI Effects 1.11.2
151
+ * http://jqueryui.com
152
+ *
153
+ * Copyright 2014 jQuery Foundation and other contributors
154
+ * Released under the MIT license.
155
+ * http://jquery.org/license
156
+ *
157
+ * http://api.jqueryui.com/category/effects-core/
158
+ */
159
+ var k="ui-effects-",s=I;I.effects={effect:{}};
160
+ /*!
161
+ * jQuery Color Animations v2.1.2
162
+ * https://github.com/jquery/jquery-color
163
+ *
164
+ * Copyright 2014 jQuery Foundation and other contributors
165
+ * Released under the MIT license.
166
+ * http://jquery.org/license
167
+ *
168
+ * Date: Wed Jan 16 08:47:09 2013 -0600
169
+ */
170
+ (function(at,ah){var ao="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",al=/^([\-+])=\s*(\d+\.?\d*)/,ak=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(au){return[au[1],au[2],au[3],au[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(au){return[au[1]*2.55,au[2]*2.55,au[3]*2.55,au[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(au){return[parseInt(au[1],16),parseInt(au[2],16),parseInt(au[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(au){return[parseInt(au[1]+au[1],16),parseInt(au[2]+au[2],16),parseInt(au[3]+au[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(au){return[au[1],au[2]/100,au[3]/100,au[4]]}}],ai=at.Color=function(av,aw,au,ax){return new at.Color.fn.parse(av,aw,au,ax)},an={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"}}}},ar={"byte":{floor:true,max:255},percent:{max:1},degrees:{mod:360,floor:true}},aq=ai.support={},af=at("<p>")[0],ae,ap=at.each;af.style.cssText="background-color:rgba(1,1,1,.5)";aq.rgba=af.style.backgroundColor.indexOf("rgba")>-1;ap(an,function(au,av){av.cache="_"+au;av.props.alpha={idx:3,type:"percent",def:1}});function am(av,ax,aw){var au=ar[ax.type]||{};if(av==null){return(aw||!ax.def)?null:ax.def}av=au.floor?~~av:parseFloat(av);if(isNaN(av)){return ax.def}if(au.mod){return(av+au.mod)%au.mod}return 0>av?0:au.max<av?au.max:av}function aj(au){var aw=ai(),av=aw._rgba=[];au=au.toLowerCase();ap(ak,function(aB,aC){var az,aA=aC.re.exec(au),ay=aA&&aC.parse(aA),ax=aC.space||"rgba";if(ay){az=aw[ax](ay);aw[an[ax].cache]=az[an[ax].cache];av=aw._rgba=az._rgba;return false}});if(av.length){if(av.join()==="0,0,0,0"){at.extend(av,ae.transparent)}return aw}return ae[au]}ai.fn=at.extend(ai.prototype,{parse:function(aA,ay,au,az){if(aA===ah){this._rgba=[null,null,null,null];return this}if(aA.jquery||aA.nodeType){aA=at(aA).css(ay);ay=ah}var ax=this,aw=at.type(aA),av=this._rgba=[];if(ay!==ah){aA=[aA,ay,au,az];aw="array"}if(aw==="string"){return this.parse(aj(aA)||ae._default)}if(aw==="array"){ap(an.rgba.props,function(aB,aC){av[aC.idx]=am(aA[aC.idx],aC)});return this}if(aw==="object"){if(aA instanceof ai){ap(an,function(aB,aC){if(aA[aC.cache]){ax[aC.cache]=aA[aC.cache].slice()}})}else{ap(an,function(aC,aD){var aB=aD.cache;ap(aD.props,function(aE,aF){if(!ax[aB]&&aD.to){if(aE==="alpha"||aA[aE]==null){return}ax[aB]=aD.to(ax._rgba)}ax[aB][aF.idx]=am(aA[aE],aF,true)});if(ax[aB]&&at.inArray(null,ax[aB].slice(0,3))<0){ax[aB][3]=1;if(aD.from){ax._rgba=aD.from(ax[aB])}}})}return this}},is:function(aw){var au=ai(aw),ax=true,av=this;ap(an,function(ay,aA){var aB,az=au[aA.cache];if(az){aB=av[aA.cache]||aA.to&&aA.to(av._rgba)||[];ap(aA.props,function(aC,aD){if(az[aD.idx]!=null){ax=(az[aD.idx]===aB[aD.idx]);return ax}})}return ax});return ax},_space:function(){var au=[],av=this;ap(an,function(aw,ax){if(av[ax.cache]){au.push(aw)}});return au.pop()},transition:function(av,aB){var aw=ai(av),ax=aw._space(),ay=an[ax],az=this.alpha()===0?ai("transparent"):this,aA=az[ay.cache]||ay.to(az._rgba),au=aA.slice();aw=aw[ay.cache];ap(ay.props,function(aF,aH){var aE=aH.idx,aD=aA[aE],aC=aw[aE],aG=ar[aH.type]||{};if(aC===null){return}if(aD===null){au[aE]=aC}else{if(aG.mod){if(aC-aD>aG.mod/2){aD+=aG.mod}else{if(aD-aC>aG.mod/2){aD-=aG.mod}}}au[aE]=am((aC-aD)*aB+aD,aH)}});return this[ax](au)},blend:function(ax){if(this._rgba[3]===1){return this}var aw=this._rgba.slice(),av=aw.pop(),au=ai(ax)._rgba;return ai(at.map(aw,function(ay,az){return(1-av)*au[az]+av*ay}))},toRgbaString:function(){var av="rgba(",au=at.map(this._rgba,function(aw,ax){return aw==null?(ax>2?1:0):aw});if(au[3]===1){au.pop();av="rgb("}return av+au.join()+")"},toHslaString:function(){var av="hsla(",au=at.map(this.hsla(),function(aw,ax){if(aw==null){aw=ax>2?1:0}if(ax&&ax<3){aw=Math.round(aw*100)+"%"}return aw});if(au[3]===1){au.pop();av="hsl("}return av+au.join()+")"},toHexString:function(au){var av=this._rgba.slice(),aw=av.pop();if(au){av.push(~~(aw*255))}return"#"+at.map(av,function(ax){ax=(ax||0).toString(16);return ax.length===1?"0"+ax:ax}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}});ai.fn.parse.prototype=ai.fn;function ag(aw,av,au){au=(au+1)%1;if(au*6<1){return aw+(av-aw)*au*6}if(au*2<1){return av}if(au*3<2){return aw+(av-aw)*((2/3)-au)*6}return aw}an.hsla.to=function(aw){if(aw[0]==null||aw[1]==null||aw[2]==null){return[null,null,null,aw[3]]}var au=aw[0]/255,az=aw[1]/255,aA=aw[2]/255,aC=aw[3],aB=Math.max(au,az,aA),ax=Math.min(au,az,aA),aD=aB-ax,aE=aB+ax,av=aE*0.5,ay,aF;if(ax===aB){ay=0}else{if(au===aB){ay=(60*(az-aA)/aD)+360}else{if(az===aB){ay=(60*(aA-au)/aD)+120}else{ay=(60*(au-az)/aD)+240}}}if(aD===0){aF=0}else{if(av<=0.5){aF=aD/aE}else{aF=aD/(2-aE)}}return[Math.round(ay)%360,aF,av,aC==null?1:aC]};an.hsla.from=function(ay){if(ay[0]==null||ay[1]==null||ay[2]==null){return[null,null,null,ay[3]]}var ax=ay[0]/360,aw=ay[1],av=ay[2],au=ay[3],az=av<=0.5?av*(1+aw):av+aw-av*aw,aA=2*av-az;return[Math.round(ag(aA,az,ax+(1/3))*255),Math.round(ag(aA,az,ax)*255),Math.round(ag(aA,az,ax-(1/3))*255),au]};ap(an,function(av,ax){var aw=ax.props,au=ax.cache,az=ax.to,ay=ax.from;ai.fn[av]=function(aE){if(az&&!this[au]){this[au]=az(this._rgba)}if(aE===ah){return this[au].slice()}var aB,aD=at.type(aE),aA=(aD==="array"||aD==="object")?aE:arguments,aC=this[au].slice();ap(aw,function(aF,aH){var aG=aA[aD==="object"?aF:aH.idx];if(aG==null){aG=aC[aH.idx]}aC[aH.idx]=am(aG,aH)});if(ay){aB=ai(ay(aC));aB[au]=aC;return aB}else{return ai(aC)}};ap(aw,function(aA,aB){if(ai.fn[aA]){return}ai.fn[aA]=function(aF){var aH=at.type(aF),aE=(aA==="alpha"?(this._hsla?"hsla":"rgba"):av),aD=this[aE](),aG=aD[aB.idx],aC;if(aH==="undefined"){return aG}if(aH==="function"){aF=aF.call(this,aG);aH=at.type(aF)}if(aF==null&&aB.empty){return this}if(aH==="string"){aC=al.exec(aF);if(aC){aF=aG+parseFloat(aC[2])*(aC[1]==="+"?1:-1)}}aD[aB.idx]=aF;return this[aE](aD)}})});ai.hook=function(av){var au=av.split(" ");ap(au,function(aw,ax){at.cssHooks[ax]={set:function(aB,aC){var az,aA,ay="";if(aC!=="transparent"&&(at.type(aC)!=="string"||(az=aj(aC)))){aC=ai(az||aC);if(!aq.rgba&&aC._rgba[3]!==1){aA=ax==="backgroundColor"?aB.parentNode:aB;while((ay===""||ay==="transparent")&&aA&&aA.style){try{ay=at.css(aA,"backgroundColor");aA=aA.parentNode}catch(aD){}}aC=aC.blend(ay&&ay!=="transparent"?ay:"_default")}aC=aC.toRgbaString()}try{aB.style[ax]=aC}catch(aD){}}};at.fx.step[ax]=function(ay){if(!ay.colorInit){ay.start=ai(ay.elem,ax);ay.end=ai(ay.end);ay.colorInit=true}at.cssHooks[ax].set(ay.elem,ay.start.transition(ay.end,ay.pos))}})};ai.hook(ao);at.cssHooks.borderColor={expand:function(av){var au={};ap(["Top","Right","Bottom","Left"],function(ax,aw){au["border"+aw+"Color"]=av});return au}};ae=at.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"}})(s);(function(){var af=["add","remove","toggle"],ag={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};I.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(ai,aj){I.fx.step[aj]=function(ak){if(ak.end!=="none"&&!ak.setAttr||ak.pos===1&&!ak.setAttr){s.style(ak.elem,aj,ak.end);ak.setAttr=true}}});function ah(am){var aj,ai,ak=am.ownerDocument.defaultView?am.ownerDocument.defaultView.getComputedStyle(am,null):am.currentStyle,al={};if(ak&&ak.length&&ak[0]&&ak[ak[0]]){ai=ak.length;while(ai--){aj=ak[ai];if(typeof ak[aj]==="string"){al[I.camelCase(aj)]=ak[aj]}}}else{for(aj in ak){if(typeof ak[aj]==="string"){al[aj]=ak[aj]}}}return al}function ae(ai,ak){var am={},aj,al;for(aj in ak){al=ak[aj];if(ai[aj]!==al){if(!ag[aj]){if(I.fx.step[aj]||!isNaN(parseFloat(al))){am[aj]=al}}}}return am}if(!I.fn.addBack){I.fn.addBack=function(ai){return this.add(ai==null?this.prevObject:this.prevObject.filter(ai))}}I.effects.animateClass=function(ai,aj,am,al){var ak=I.speed(aj,am,al);return this.queue(function(){var ap=I(this),an=ap.attr("class")||"",ao,aq=ak.children?ap.find("*").addBack():ap;aq=aq.map(function(){var ar=I(this);return{el:ar,start:ah(this)}});ao=function(){I.each(af,function(ar,at){if(ai[at]){ap[at+"Class"](ai[at])}})};ao();aq=aq.map(function(){this.end=ah(this.el[0]);this.diff=ae(this.start,this.end);return this});ap.attr("class",an);aq=aq.map(function(){var au=this,ar=I.Deferred(),at=I.extend({},ak,{queue:false,complete:function(){ar.resolve(au)}});this.el.animate(this.diff,at);return ar.promise()});I.when.apply(I,aq.get()).done(function(){ao();I.each(arguments,function(){var ar=this.el;I.each(this.diff,function(at){ar.css(at,"")})});ak.complete.call(ap[0])})})};I.fn.extend({addClass:(function(ai){return function(ak,aj,am,al){return aj?I.effects.animateClass.call(this,{add:ak},aj,am,al):ai.apply(this,arguments)}})(I.fn.addClass),removeClass:(function(ai){return function(ak,aj,am,al){return arguments.length>1?I.effects.animateClass.call(this,{remove:ak},aj,am,al):ai.apply(this,arguments)}})(I.fn.removeClass),toggleClass:(function(ai){return function(al,ak,aj,an,am){if(typeof ak==="boolean"||ak===undefined){if(!aj){return ai.apply(this,arguments)}else{return I.effects.animateClass.call(this,(ak?{add:al}:{remove:al}),aj,an,am)}}else{return I.effects.animateClass.call(this,{toggle:al},ak,aj,an)}}})(I.fn.toggleClass),switchClass:function(ai,ak,aj,am,al){return I.effects.animateClass.call(this,{add:ak,remove:ai},aj,am,al)}})})();(function(){I.extend(I.effects,{version:"1.11.2",save:function(ah,ai){for(var ag=0;ag<ai.length;ag++){if(ai[ag]!==null){ah.data(k+ai[ag],ah[0].style[ai[ag]])}}},restore:function(ah,aj){var ai,ag;for(ag=0;ag<aj.length;ag++){if(aj[ag]!==null){ai=ah.data(k+aj[ag]);if(ai===undefined){ai=""}ah.css(aj[ag],ai)}}},setMode:function(ag,ah){if(ah==="toggle"){ah=ag.is(":hidden")?"show":"hide"}return ah},getBaseline:function(ah,ai){var aj,ag;switch(ah[0]){case"top":aj=0;break;case"middle":aj=0.5;break;case"bottom":aj=1;break;default:aj=ah[0]/ai.height}switch(ah[1]){case"left":ag=0;break;case"center":ag=0.5;break;case"right":ag=1;break;default:ag=ah[1]/ai.width}return{x:ag,y:aj}},createWrapper:function(ah){if(ah.parent().is(".ui-effects-wrapper")){return ah.parent()}var ai={width:ah.outerWidth(true),height:ah.outerHeight(true),"float":ah.css("float")},al=I("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),ag={width:ah.width(),height:ah.height()},ak=document.activeElement;try{ak.id}catch(aj){ak=document.body}ah.wrap(al);if(ah[0]===ak||I.contains(ah[0],ak)){I(ak).focus()}al=ah.parent();if(ah.css("position")==="static"){al.css({position:"relative"});ah.css({position:"relative"})}else{I.extend(ai,{position:ah.css("position"),zIndex:ah.css("z-index")});I.each(["top","left","bottom","right"],function(am,an){ai[an]=ah.css(an);if(isNaN(parseInt(ai[an],10))){ai[an]="auto"}});ah.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}ah.css(ag);return al.css(ai).show()},removeWrapper:function(ag){var ah=document.activeElement;if(ag.parent().is(".ui-effects-wrapper")){ag.parent().replaceWith(ag);if(ag[0]===ah||I.contains(ag[0],ah)){I(ah).focus()}}return ag},setTransition:function(ah,aj,ag,ai){ai=ai||{};I.each(aj,function(al,ak){var am=ah.cssUnit(ak);if(am[0]>0){ai[ak]=am[0]*ag+am[1]}});return ai}});function ae(ah,ag,ai,aj){if(I.isPlainObject(ah)){ag=ah;ah=ah.effect}ah={effect:ah};if(ag==null){ag={}}if(I.isFunction(ag)){aj=ag;ai=null;ag={}}if(typeof ag==="number"||I.fx.speeds[ag]){aj=ai;ai=ag;ag={}}if(I.isFunction(ai)){aj=ai;ai=null}if(ag){I.extend(ah,ag)}ai=ai||ag.duration;ah.duration=I.fx.off?0:typeof ai==="number"?ai:ai in I.fx.speeds?I.fx.speeds[ai]:I.fx.speeds._default;ah.complete=aj||ag.complete;return ah}function af(ag){if(!ag||typeof ag==="number"||I.fx.speeds[ag]){return true}if(typeof ag==="string"&&!I.effects.effect[ag]){return true}if(I.isFunction(ag)){return true}if(typeof ag==="object"&&!ag.effect){return true}return false}I.fn.extend({effect:function(){var ai=ae.apply(this,arguments),ak=ai.mode,ag=ai.queue,ah=I.effects.effect[ai.effect];if(I.fx.off||!ah){if(ak){return this[ak](ai.duration,ai.complete)}else{return this.each(function(){if(ai.complete){ai.complete.call(this)}})}}function aj(an){var ao=I(this),am=ai.complete,ap=ai.mode;function al(){if(I.isFunction(am)){am.call(ao[0])}if(I.isFunction(an)){an()}}if(ao.is(":hidden")?ap==="hide":ap==="show"){ao[ap]();al()}else{ah.call(ao[0],ai,al)}}return ag===false?this.each(aj):this.queue(ag||"fx",aj)},show:(function(ag){return function(ai){if(af(ai)){return ag.apply(this,arguments)}else{var ah=ae.apply(this,arguments);ah.mode="show";return this.effect.call(this,ah)}}})(I.fn.show),hide:(function(ag){return function(ai){if(af(ai)){return ag.apply(this,arguments)}else{var ah=ae.apply(this,arguments);ah.mode="hide";return this.effect.call(this,ah)}}})(I.fn.hide),toggle:(function(ag){return function(ai){if(af(ai)||typeof ai==="boolean"){return ag.apply(this,arguments)}else{var ah=ae.apply(this,arguments);ah.mode="toggle";return this.effect.call(this,ah)}}})(I.fn.toggle),cssUnit:function(ag){var ah=this.css(ag),ai=[];I.each(["em","px","%","pt"],function(aj,ak){if(ah.indexOf(ak)>0){ai=[parseFloat(ah),ak]}});return ai}})})();(function(){var ae={};I.each(["Quad","Cubic","Quart","Quint","Expo"],function(ag,af){ae[af]=function(ah){return Math.pow(ah,ag+2)}});I.extend(ae,{Sine:function(af){return 1-Math.cos(af*Math.PI/2)},Circ:function(af){return 1-Math.sqrt(1-af*af)},Elastic:function(af){return af===0||af===1?af:-Math.pow(2,8*(af-1))*Math.sin(((af-1)*80-7.5)*Math.PI/15)},Back:function(af){return af*af*(3*af-2)},Bounce:function(ah){var af,ag=4;while(ah<((af=Math.pow(2,--ag))-1)/11){}return 1/Math.pow(4,3-ag)-7.5625*Math.pow((af*3-2)/22-ah,2)}});I.each(ae,function(ag,af){I.easing["easeIn"+ag]=af;I.easing["easeOut"+ag]=function(ah){return 1-af(1-ah)};I.easing["easeInOut"+ag]=function(ah){return ah<0.5?af(ah*2)/2:1-af(ah*-2+2)/2}})})();var T=I.effects;
171
+ /*!
172
+ * jQuery UI Effects Blind 1.11.2
173
+ * http://jqueryui.com
174
+ *
175
+ * Copyright 2014 jQuery Foundation and other contributors
176
+ * Released under the MIT license.
177
+ * http://jquery.org/license
178
+ *
179
+ * http://api.jqueryui.com/blind-effect/
180
+ */
181
+ var Z=I.effects.effect.blind=function(ag,am){var ah=I(this),aq=/up|down|vertical/,ap=/up|left|vertical|horizontal/,ar=["position","top","bottom","left","right","height","width"],an=I.effects.setMode(ah,ag.mode||"hide"),at=ag.direction||"up",aj=aq.test(at),ai=aj?"height":"width",ao=aj?"top":"left",av=ap.test(at),al={},au=an==="show",af,ae,ak;if(ah.parent().is(".ui-effects-wrapper")){I.effects.save(ah.parent(),ar)}else{I.effects.save(ah,ar)}ah.show();af=I.effects.createWrapper(ah).css({overflow:"hidden"});ae=af[ai]();ak=parseFloat(af.css(ao))||0;al[ai]=au?ae:0;if(!av){ah.css(aj?"bottom":"right",0).css(aj?"top":"left","auto").css({position:"absolute"});al[ao]=au?ak:ae+ak}if(au){af.css(ai,0);if(!av){af.css(ao,ak+ae)}}af.animate(al,{duration:ag.duration,easing:ag.easing,queue:false,complete:function(){if(an==="hide"){ah.hide()}I.effects.restore(ah,ar);I.effects.removeWrapper(ah);am()}})};
182
+ /*!
183
+ * jQuery UI Effects Bounce 1.11.2
184
+ * http://jqueryui.com
185
+ *
186
+ * Copyright 2014 jQuery Foundation and other contributors
187
+ * Released under the MIT license.
188
+ * http://jquery.org/license
189
+ *
190
+ * http://api.jqueryui.com/bounce-effect/
191
+ */
192
+ var S=I.effects.effect.bounce=function(an,am){var ae=I(this),af=["position","top","bottom","left","right","height","width"],al=I.effects.setMode(ae,an.mode||"effect"),ak=al==="hide",aw=al==="show",ax=an.direction||"up",ag=an.distance,aj=an.times||5,ay=aj*2+(aw||ak?1:0),av=an.duration/ay,ap=an.easing,ah=(ax==="up"||ax==="down")?"top":"left",ao=(ax==="up"||ax==="left"),au,ai,at,aq=ae.queue(),ar=aq.length;if(aw||ak){af.push("opacity")}I.effects.save(ae,af);ae.show();I.effects.createWrapper(ae);if(!ag){ag=ae[ah==="top"?"outerHeight":"outerWidth"]()/3}if(aw){at={opacity:1};at[ah]=0;ae.css("opacity",0).css(ah,ao?-ag*2:ag*2).animate(at,av,ap)}if(ak){ag=ag/Math.pow(2,aj-1)}at={};at[ah]=0;for(au=0;au<aj;au++){ai={};ai[ah]=(ao?"-=":"+=")+ag;ae.animate(ai,av,ap).animate(at,av,ap);ag=ak?ag*2:ag/2}if(ak){ai={opacity:0};ai[ah]=(ao?"-=":"+=")+ag;ae.animate(ai,av,ap)}ae.queue(function(){if(ak){ae.hide()}I.effects.restore(ae,af);I.effects.removeWrapper(ae);am()});if(ar>1){aq.splice.apply(aq,[1,0].concat(aq.splice(ar,ay+1)))}ae.dequeue()};
193
+ /*!
194
+ * jQuery UI Effects Clip 1.11.2
195
+ * http://jqueryui.com
196
+ *
197
+ * Copyright 2014 jQuery Foundation and other contributors
198
+ * Released under the MIT license.
199
+ * http://jquery.org/license
200
+ *
201
+ * http://api.jqueryui.com/clip-effect/
202
+ */
203
+ var D=I.effects.effect.clip=function(ah,ak){var ai=I(this),ao=["position","top","bottom","left","right","height","width"],an=I.effects.setMode(ai,ah.mode||"hide"),aq=an==="show",ap=ah.direction||"vertical",am=ap==="vertical",ar=am?"height":"width",al=am?"top":"left",aj={},af,ag,ae;I.effects.save(ai,ao);ai.show();af=I.effects.createWrapper(ai).css({overflow:"hidden"});ag=(ai[0].tagName==="IMG")?af:ai;ae=ag[ar]();if(aq){ag.css(ar,0);ag.css(al,ae/2)}aj[ar]=aq?ae:0;aj[al]=aq?0:ae/2;ag.animate(aj,{queue:false,duration:ah.duration,easing:ah.easing,complete:function(){if(!aq){ai.hide()}I.effects.restore(ai,ao);I.effects.removeWrapper(ai);ak()}})};
204
+ /*!
205
+ * jQuery UI Effects Drop 1.11.2
206
+ * http://jqueryui.com
207
+ *
208
+ * Copyright 2014 jQuery Foundation and other contributors
209
+ * Released under the MIT license.
210
+ * http://jquery.org/license
211
+ *
212
+ * http://api.jqueryui.com/drop-effect/
213
+ */
214
+ var o=I.effects.effect.drop=function(af,aj){var ag=I(this),al=["position","top","bottom","left","right","opacity","height","width"],ak=I.effects.setMode(ag,af.mode||"hide"),an=ak==="show",am=af.direction||"left",ah=(am==="up"||am==="down")?"top":"left",ao=(am==="up"||am==="left")?"pos":"neg",ai={opacity:an?1:0},ae;I.effects.save(ag,al);ag.show();I.effects.createWrapper(ag);ae=af.distance||ag[ah==="top"?"outerHeight":"outerWidth"](true)/2;if(an){ag.css("opacity",0).css(ah,ao==="pos"?-ae:ae)}ai[ah]=(an?(ao==="pos"?"+=":"-="):(ao==="pos"?"-=":"+="))+ae;ag.animate(ai,{queue:false,duration:af.duration,easing:af.easing,complete:function(){if(ak==="hide"){ag.hide()}I.effects.restore(ag,al);I.effects.removeWrapper(ag);aj()}})};
215
+ /*!
216
+ * jQuery UI Effects Explode 1.11.2
217
+ * http://jqueryui.com
218
+ *
219
+ * Copyright 2014 jQuery Foundation and other contributors
220
+ * Released under the MIT license.
221
+ * http://jquery.org/license
222
+ *
223
+ * http://api.jqueryui.com/explode-effect/
224
+ */
225
+ var Q=I.effects.effect.explode=function(ar,aq){var ak=ar.pieces?Math.round(Math.sqrt(ar.pieces)):3,af=ak,ae=I(this),am=I.effects.setMode(ae,ar.mode||"hide"),aw=am==="show",ai=ae.show().css("visibility","hidden").offset(),at=Math.ceil(ae.outerWidth()/af),ap=Math.ceil(ae.outerHeight()/ak),aj=[],av,au,ag,ao,an,al;function ax(){aj.push(this);if(aj.length===ak*af){ah()}}for(av=0;av<ak;av++){ao=ai.top+av*ap;al=av-(ak-1)/2;for(au=0;au<af;au++){ag=ai.left+au*at;an=au-(af-1)/2;ae.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-au*at,top:-av*ap}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:at,height:ap,left:ag+(aw?an*at:0),top:ao+(aw?al*ap:0),opacity:aw?0:1}).animate({left:ag+(aw?0:an*at),top:ao+(aw?0:al*ap),opacity:aw?1:0},ar.duration||500,ar.easing,ax)}}function ah(){ae.css({visibility:"visible"});I(aj).remove();if(!aw){ae.hide()}aq()}};
226
+ /*!
227
+ * jQuery UI Effects Fade 1.11.2
228
+ * http://jqueryui.com
229
+ *
230
+ * Copyright 2014 jQuery Foundation and other contributors
231
+ * Released under the MIT license.
232
+ * http://jquery.org/license
233
+ *
234
+ * http://api.jqueryui.com/fade-effect/
235
+ */
236
+ var R=I.effects.effect.fade=function(ah,ae){var af=I(this),ag=I.effects.setMode(af,ah.mode||"toggle");af.animate({opacity:ag},{queue:false,duration:ah.duration,easing:ah.easing,complete:ae})};
237
+ /*!
238
+ * jQuery UI Effects Fold 1.11.2
239
+ * http://jqueryui.com
240
+ *
241
+ * Copyright 2014 jQuery Foundation and other contributors
242
+ * Released under the MIT license.
243
+ * http://jquery.org/license
244
+ *
245
+ * http://api.jqueryui.com/fold-effect/
246
+ */
247
+ var F=I.effects.effect.fold=function(ag,ak){var ah=I(this),ap=["position","top","bottom","left","right","height","width"],am=I.effects.setMode(ah,ag.mode||"hide"),at=am==="show",an=am==="hide",av=ag.size||15,ao=/([0-9]+)%/.exec(av),au=!!ag.horizFirst,al=at!==au,ai=al?["width","height"]:["height","width"],aj=ag.duration/2,af,ae,ar={},aq={};I.effects.save(ah,ap);ah.show();af=I.effects.createWrapper(ah).css({overflow:"hidden"});ae=al?[af.width(),af.height()]:[af.height(),af.width()];if(ao){av=parseInt(ao[1],10)/100*ae[an?0:1]}if(at){af.css(au?{height:0,width:av}:{height:av,width:0})}ar[ai[0]]=at?ae[0]:av;aq[ai[1]]=at?ae[1]:0;af.animate(ar,aj,ag.easing).animate(aq,aj,ag.easing,function(){if(an){ah.hide()}I.effects.restore(ah,ap);I.effects.removeWrapper(ah);ak()})};
248
+ /*!
249
+ * jQuery UI Effects Highlight 1.11.2
250
+ * http://jqueryui.com
251
+ *
252
+ * Copyright 2014 jQuery Foundation and other contributors
253
+ * Released under the MIT license.
254
+ * http://jquery.org/license
255
+ *
256
+ * http://api.jqueryui.com/highlight-effect/
257
+ */
258
+ var M=I.effects.effect.highlight=function(aj,ae){var ag=I(this),af=["backgroundImage","backgroundColor","opacity"],ai=I.effects.setMode(ag,aj.mode||"show"),ah={backgroundColor:ag.css("backgroundColor")};if(ai==="hide"){ah.opacity=0}I.effects.save(ag,af);ag.show().css({backgroundImage:"none",backgroundColor:aj.color||"#ffff99"}).animate(ah,{queue:false,duration:aj.duration,easing:aj.easing,complete:function(){if(ai==="hide"){ag.hide()}I.effects.restore(ag,af);ae()}})};
259
+ /*!
260
+ * jQuery UI Effects Size 1.11.2
261
+ * http://jqueryui.com
262
+ *
263
+ * Copyright 2014 jQuery Foundation and other contributors
264
+ * Released under the MIT license.
265
+ * http://jquery.org/license
266
+ *
267
+ * http://api.jqueryui.com/size-effect/
268
+ */
269
+ var a=I.effects.effect.size=function(an,am){var ar,ak,al,ae=I(this),aq=["position","top","bottom","left","right","width","height","overflow","opacity"],ap=["position","top","bottom","left","right","overflow","opacity"],ao=["width","height","overflow"],ai=["fontSize"],au=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],af=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],aj=I.effects.setMode(ae,an.mode||"effect"),at=an.restore||aj!=="effect",ax=an.scale||"both",av=an.origin||["middle","center"],aw=ae.css("position"),ag=at?aq:ap,ah={height:0,width:0,outerHeight:0,outerWidth:0};if(aj==="show"){ae.show()}ar={height:ae.height(),width:ae.width(),outerHeight:ae.outerHeight(),outerWidth:ae.outerWidth()};if(an.mode==="toggle"&&aj==="show"){ae.from=an.to||ah;ae.to=an.from||ar}else{ae.from=an.from||(aj==="show"?ah:ar);ae.to=an.to||(aj==="hide"?ah:ar)}al={from:{y:ae.from.height/ar.height,x:ae.from.width/ar.width},to:{y:ae.to.height/ar.height,x:ae.to.width/ar.width}};if(ax==="box"||ax==="both"){if(al.from.y!==al.to.y){ag=ag.concat(au);ae.from=I.effects.setTransition(ae,au,al.from.y,ae.from);ae.to=I.effects.setTransition(ae,au,al.to.y,ae.to)}if(al.from.x!==al.to.x){ag=ag.concat(af);ae.from=I.effects.setTransition(ae,af,al.from.x,ae.from);ae.to=I.effects.setTransition(ae,af,al.to.x,ae.to)}}if(ax==="content"||ax==="both"){if(al.from.y!==al.to.y){ag=ag.concat(ai).concat(ao);ae.from=I.effects.setTransition(ae,ai,al.from.y,ae.from);ae.to=I.effects.setTransition(ae,ai,al.to.y,ae.to)}}I.effects.save(ae,ag);ae.show();I.effects.createWrapper(ae);ae.css("overflow","hidden").css(ae.from);if(av){ak=I.effects.getBaseline(av,ar);ae.from.top=(ar.outerHeight-ae.outerHeight())*ak.y;ae.from.left=(ar.outerWidth-ae.outerWidth())*ak.x;ae.to.top=(ar.outerHeight-ae.to.outerHeight)*ak.y;ae.to.left=(ar.outerWidth-ae.to.outerWidth)*ak.x}ae.css(ae.from);if(ax==="content"||ax==="both"){au=au.concat(["marginTop","marginBottom"]).concat(ai);af=af.concat(["marginLeft","marginRight"]);ao=aq.concat(au).concat(af);ae.find("*[width]").each(function(){var az=I(this),ay={height:az.height(),width:az.width(),outerHeight:az.outerHeight(),outerWidth:az.outerWidth()};if(at){I.effects.save(az,ao)}az.from={height:ay.height*al.from.y,width:ay.width*al.from.x,outerHeight:ay.outerHeight*al.from.y,outerWidth:ay.outerWidth*al.from.x};az.to={height:ay.height*al.to.y,width:ay.width*al.to.x,outerHeight:ay.height*al.to.y,outerWidth:ay.width*al.to.x};if(al.from.y!==al.to.y){az.from=I.effects.setTransition(az,au,al.from.y,az.from);az.to=I.effects.setTransition(az,au,al.to.y,az.to)}if(al.from.x!==al.to.x){az.from=I.effects.setTransition(az,af,al.from.x,az.from);az.to=I.effects.setTransition(az,af,al.to.x,az.to)}az.css(az.from);az.animate(az.to,an.duration,an.easing,function(){if(at){I.effects.restore(az,ao)}})})}ae.animate(ae.to,{queue:false,duration:an.duration,easing:an.easing,complete:function(){if(ae.to.opacity===0){ae.css("opacity",ae.from.opacity)}if(aj==="hide"){ae.hide()}I.effects.restore(ae,ag);if(!at){if(aw==="static"){ae.css({position:"relative",top:ae.to.top,left:ae.to.left})}else{I.each(["top","left"],function(ay,az){ae.css(az,function(aB,aD){var aC=parseInt(aD,10),aA=ay?ae.to.left:ae.to.top;if(aD==="auto"){return aA+"px"}return aC+aA+"px"})})}}I.effects.removeWrapper(ae);am()}})};
270
+ /*!
271
+ * jQuery UI Effects Scale 1.11.2
272
+ * http://jqueryui.com
273
+ *
274
+ * Copyright 2014 jQuery Foundation and other contributors
275
+ * Released under the MIT license.
276
+ * http://jquery.org/license
277
+ *
278
+ * http://api.jqueryui.com/scale-effect/
279
+ */
280
+ var f=I.effects.effect.scale=function(ae,ah){var af=I(this),an=I.extend(true,{},ae),ai=I.effects.setMode(af,ae.mode||"effect"),aj=parseInt(ae.percent,10)||(parseInt(ae.percent,10)===0?0:(ai==="hide"?0:100)),al=ae.direction||"both",am=ae.origin,ag={height:af.height(),width:af.width(),outerHeight:af.outerHeight(),outerWidth:af.outerWidth()},ak={y:al!=="horizontal"?(aj/100):1,x:al!=="vertical"?(aj/100):1};an.effect="size";an.queue=false;an.complete=ah;if(ai!=="effect"){an.origin=am||["middle","center"];an.restore=true}an.from=ae.from||(ai==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:ag);an.to={height:ag.height*ak.y,width:ag.width*ak.x,outerHeight:ag.outerHeight*ak.y,outerWidth:ag.outerWidth*ak.x};if(an.fade){if(ai==="show"){an.from.opacity=0;an.to.opacity=1}if(ai==="hide"){an.from.opacity=1;an.to.opacity=0}}af.effect(an)};
281
+ /*!
282
+ * jQuery UI Effects Puff 1.11.2
283
+ * http://jqueryui.com
284
+ *
285
+ * Copyright 2014 jQuery Foundation and other contributors
286
+ * Released under the MIT license.
287
+ * http://jquery.org/license
288
+ *
289
+ * http://api.jqueryui.com/puff-effect/
290
+ */
291
+ var ab=I.effects.effect.puff=function(al,ae){var aj=I(this),ak=I.effects.setMode(aj,al.mode||"hide"),ah=ak==="hide",ai=parseInt(al.percent,10)||150,ag=ai/100,af={height:aj.height(),width:aj.width(),outerHeight:aj.outerHeight(),outerWidth:aj.outerWidth()};I.extend(al,{effect:"scale",queue:false,fade:true,mode:ak,complete:ae,percent:ah?ai:100,from:ah?af:{height:af.height*ag,width:af.width*ag,outerHeight:af.outerHeight*ag,outerWidth:af.outerWidth*ag}});aj.effect(al)};
292
+ /*!
293
+ * jQuery UI Effects Pulsate 1.11.2
294
+ * http://jqueryui.com
295
+ *
296
+ * Copyright 2014 jQuery Foundation and other contributors
297
+ * Released under the MIT license.
298
+ * http://jquery.org/license
299
+ *
300
+ * http://api.jqueryui.com/pulsate-effect/
301
+ */
302
+ var H=I.effects.effect.pulsate=function(ae,ai){var ag=I(this),al=I.effects.setMode(ag,ae.mode||"show"),ap=al==="show",am=al==="hide",aq=(ap||al==="hide"),an=((ae.times||5)*2)+(aq?1:0),ah=ae.duration/an,ao=0,ak=ag.queue(),af=ak.length,aj;if(ap||!ag.is(":visible")){ag.css("opacity",0).show();ao=1}for(aj=1;aj<an;aj++){ag.animate({opacity:ao},ah,ae.easing);ao=1-ao}ag.animate({opacity:ao},ah,ae.easing);ag.queue(function(){if(am){ag.hide()}ai()});if(af>1){ak.splice.apply(ak,[1,0].concat(ak.splice(af,an+1)))}ag.dequeue()};
303
+ /*!
304
+ * jQuery UI Effects Shake 1.11.2
305
+ * http://jqueryui.com
306
+ *
307
+ * Copyright 2014 jQuery Foundation and other contributors
308
+ * Released under the MIT license.
309
+ * http://jquery.org/license
310
+ *
311
+ * http://api.jqueryui.com/shake-effect/
312
+ */
313
+ var C=I.effects.effect.shake=function(am,al){var ae=I(this),af=["position","top","bottom","left","right","height","width"],ak=I.effects.setMode(ae,am.mode||"effect"),av=am.direction||"left",ag=am.distance||20,aj=am.times||3,aw=aj*2+1,aq=Math.round(am.duration/aw),ai=(av==="up"||av==="down")?"top":"left",ah=(av==="up"||av==="left"),au={},at={},ar={},ap,an=ae.queue(),ao=an.length;I.effects.save(ae,af);ae.show();I.effects.createWrapper(ae);au[ai]=(ah?"-=":"+=")+ag;at[ai]=(ah?"+=":"-=")+ag*2;ar[ai]=(ah?"-=":"+=")+ag*2;ae.animate(au,aq,am.easing);for(ap=1;ap<aj;ap++){ae.animate(at,aq,am.easing).animate(ar,aq,am.easing)}ae.animate(at,aq,am.easing).animate(au,aq/2,am.easing).queue(function(){if(ak==="hide"){ae.hide()}I.effects.restore(ae,af);I.effects.removeWrapper(ae);al()});if(ao>1){an.splice.apply(an,[1,0].concat(an.splice(ao,aw+1)))}ae.dequeue()};
314
+ /*!
315
+ * jQuery UI Effects Slide 1.11.2
316
+ * http://jqueryui.com
317
+ *
318
+ * Copyright 2014 jQuery Foundation and other contributors
319
+ * Released under the MIT license.
320
+ * http://jquery.org/license
321
+ *
322
+ * http://api.jqueryui.com/slide-effect/
323
+ */
324
+ var B=I.effects.effect.slide=function(ag,ak){var ah=I(this),am=["position","top","bottom","left","right","width","height"],al=I.effects.setMode(ah,ag.mode||"show"),ao=al==="show",an=ag.direction||"left",ai=(an==="up"||an==="down")?"top":"left",af=(an==="up"||an==="left"),ae,aj={};I.effects.save(ah,am);ah.show();ae=ag.distance||ah[ai==="top"?"outerHeight":"outerWidth"](true);I.effects.createWrapper(ah).css({overflow:"hidden"});if(ao){ah.css(ai,af?(isNaN(ae)?"-"+ae:-ae):ae)}aj[ai]=(ao?(af?"+=":"-="):(af?"-=":"+="))+ae;ah.animate(aj,{queue:false,duration:ag.duration,easing:ag.easing,complete:function(){if(al==="hide"){ah.hide()}I.effects.restore(ah,am);I.effects.removeWrapper(ah);ak()}})};
325
+ /*!
326
+ * jQuery UI Effects Transfer 1.11.2
327
+ * http://jqueryui.com
328
+ *
329
+ * Copyright 2014 jQuery Foundation and other contributors
330
+ * Released under the MIT license.
331
+ * http://jquery.org/license
332
+ *
333
+ * http://api.jqueryui.com/transfer-effect/
334
+ */
335
+ var m=I.effects.effect.transfer=function(af,aj){var ah=I(this),am=I(af.to),ap=am.css("position")==="fixed",al=I("body"),an=ap?al.scrollTop():0,ao=ap?al.scrollLeft():0,ae=am.offset(),ai={top:ae.top-an,left:ae.left-ao,height:am.innerHeight(),width:am.innerWidth()},ak=ah.offset(),ag=I("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(af.className).css({top:ak.top-an,left:ak.left-ao,height:ah.innerHeight(),width:ah.innerWidth(),position:ap?"fixed":"absolute"}).animate(ai,af.duration,af.easing,function(){ag.remove();aj()})};
336
+ /*!
337
+ * jQuery UI Progressbar 1.11.2
338
+ * http://jqueryui.com
339
+ *
340
+ * Copyright 2014 jQuery Foundation and other contributors
341
+ * Released under the MIT license.
342
+ * http://jquery.org/license
343
+ *
344
+ * http://api.jqueryui.com/progressbar/
345
+ */
346
+ var U=I.widget("ui.progressbar",{version:"1.11.2",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=I("<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(ae){if(ae===undefined){return this.options.value}this.options.value=this._constrainedValue(ae);this._refreshValue()},_constrainedValue:function(ae){if(ae===undefined){ae=this.options.value}this.indeterminate=ae===false;if(typeof ae!=="number"){ae=0}return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,ae))},_setOptions:function(ae){var af=ae.value;delete ae.value;this._super(ae);this.options.value=this._constrainedValue(af);this._refreshValue()},_setOption:function(ae,af){if(ae==="max"){af=Math.max(this.min,af)}if(ae==="disabled"){this.element.toggleClass("ui-state-disabled",!!af).attr("aria-disabled",af)}this._super(ae,af)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var af=this.options.value,ae=this._percentage();this.valueDiv.toggle(this.indeterminate||af>this.min).toggleClass("ui-corner-right",af===this.options.max).width(ae.toFixed(0)+"%");this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate);if(this.indeterminate){this.element.removeAttr("aria-valuenow");if(!this.overlayDiv){this.overlayDiv=I("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv)}}else{this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":af});if(this.overlayDiv){this.overlayDiv.remove();this.overlayDiv=null}}if(this.oldValue!==af){this.oldValue=af;this._trigger("change")}if(af===this.options.max){this._trigger("complete")}}});
347
+ /*!
348
+ * jQuery UI Selectable 1.11.2
349
+ * http://jqueryui.com
350
+ *
351
+ * Copyright 2014 jQuery Foundation and other contributors
352
+ * Released under the MIT license.
353
+ * http://jquery.org/license
354
+ *
355
+ * http://api.jqueryui.com/selectable/
356
+ */
357
+ var e=I.widget("ui.selectable",I.ui.mouse,{version:"1.11.2",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var af,ae=this;this.element.addClass("ui-selectable");this.dragged=false;this.refresh=function(){af=I(ae.options.filter,ae.element[0]);af.addClass("ui-selectee");af.each(function(){var ag=I(this),ah=ag.offset();I.data(this,"selectable-item",{element:this,$element:ag,left:ah.left,top:ah.top,right:ah.left+ag.outerWidth(),bottom:ah.top+ag.outerHeight(),startselected:false,selected:ag.hasClass("ui-selected"),selecting:ag.hasClass("ui-selecting"),unselecting:ag.hasClass("ui-unselecting")})})};this.refresh();this.selectees=af.addClass("ui-selectee");this._mouseInit();this.helper=I("<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(ag){var af=this,ae=this.options;this.opos=[ag.pageX,ag.pageY];if(this.options.disabled){return}this.selectees=I(ae.filter,this.element[0]);this._trigger("start",ag);I(ae.appendTo).append(this.helper);this.helper.css({left:ag.pageX,top:ag.pageY,width:0,height:0});if(ae.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var ah=I.data(this,"selectable-item");ah.startselected=true;if(!ag.metaKey&&!ag.ctrlKey){ah.$element.removeClass("ui-selected");ah.selected=false;ah.$element.addClass("ui-unselecting");ah.unselecting=true;af._trigger("unselecting",ag,{unselecting:ah.element})}});I(ag.target).parents().addBack().each(function(){var ah,ai=I.data(this,"selectable-item");if(ai){ah=(!ag.metaKey&&!ag.ctrlKey)||!ai.$element.hasClass("ui-selected");ai.$element.removeClass(ah?"ui-unselecting":"ui-selected").addClass(ah?"ui-selecting":"ui-unselecting");ai.unselecting=!ah;ai.selecting=ah;ai.selected=ah;if(ah){af._trigger("selecting",ag,{selecting:ai.element})}else{af._trigger("unselecting",ag,{unselecting:ai.element})}return false}})},_mouseDrag:function(al){this.dragged=true;if(this.options.disabled){return}var ai,ak=this,ag=this.options,af=this.opos[0],aj=this.opos[1],ae=al.pageX,ah=al.pageY;if(af>ae){ai=ae;ae=af;af=ai}if(aj>ah){ai=ah;ah=aj;aj=ai}this.helper.css({left:af,top:aj,width:ae-af,height:ah-aj});this.selectees.each(function(){var am=I.data(this,"selectable-item"),an=false;if(!am||am.element===ak.element[0]){return}if(ag.tolerance==="touch"){an=(!(am.left>ae||am.right<af||am.top>ah||am.bottom<aj))}else{if(ag.tolerance==="fit"){an=(am.left>af&&am.right<ae&&am.top>aj&&am.bottom<ah)}}if(an){if(am.selected){am.$element.removeClass("ui-selected");am.selected=false}if(am.unselecting){am.$element.removeClass("ui-unselecting");am.unselecting=false}if(!am.selecting){am.$element.addClass("ui-selecting");am.selecting=true;ak._trigger("selecting",al,{selecting:am.element})}}else{if(am.selecting){if((al.metaKey||al.ctrlKey)&&am.startselected){am.$element.removeClass("ui-selecting");am.selecting=false;am.$element.addClass("ui-selected");am.selected=true}else{am.$element.removeClass("ui-selecting");am.selecting=false;if(am.startselected){am.$element.addClass("ui-unselecting");am.unselecting=true}ak._trigger("unselecting",al,{unselecting:am.element})}}if(am.selected){if(!al.metaKey&&!al.ctrlKey&&!am.startselected){am.$element.removeClass("ui-selected");am.selected=false;am.$element.addClass("ui-unselecting");am.unselecting=true;ak._trigger("unselecting",al,{unselecting:am.element})}}}});return false},_mouseStop:function(af){var ae=this;this.dragged=false;I(".ui-unselecting",this.element[0]).each(function(){var ag=I.data(this,"selectable-item");ag.$element.removeClass("ui-unselecting");ag.unselecting=false;ag.startselected=false;ae._trigger("unselected",af,{unselected:ag.element})});I(".ui-selecting",this.element[0]).each(function(){var ag=I.data(this,"selectable-item");ag.$element.removeClass("ui-selecting").addClass("ui-selected");ag.selecting=false;ag.selected=true;ag.startselected=true;ae._trigger("selected",af,{selected:ag.element})});this._trigger("stop",af);this.helper.remove();return false}});
358
+ /*!
359
+ * jQuery UI Selectmenu 1.11.2
360
+ * http://jqueryui.com
361
+ *
362
+ * Copyright 2014 jQuery Foundation and other contributors
363
+ * Released under the MIT license.
364
+ * http://jquery.org/license
365
+ *
366
+ * http://api.jqueryui.com/selectmenu
367
+ */
368
+ var W=I.widget("ui.selectmenu",{version:"1.11.2",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 ae=this.element.uniqueId().attr("id");this.ids={element:ae,button:ae+"-button",menu:ae+"-menu"};this._drawButton();this._drawMenu();if(this.options.disabled){this.disable()}},_drawButton:function(){var af=this,ae=this.element.attr("tabindex");this.label=I("label[for='"+this.ids.element+"']").attr("for",this.ids.button);this._on(this.label,{click:function(ag){this.button.focus();ag.preventDefault()}});this.element.hide();this.button=I("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:ae||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);I("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button);this.buttonText=I("<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(){if(!af.menuItems){af._refreshMenu()}});this._hoverable(this.button);this._focusable(this.button)},_drawMenu:function(){var ae=this;this.menu=I("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=I("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo());this.menuInstance=this.menu.menu({role:"listbox",select:function(af,ag){af.preventDefault();ae._setSelection();ae._select(ag.item.data("ui-selectmenu-item"),af)},focus:function(ag,ah){var af=ah.item.data("ui-selectmenu-item");if(ae.focusIndex!=null&&af.index!==ae.focusIndex){ae._trigger("focus",ag,{item:af});if(!ae.isOpen){ae._select(af,ag)}}ae.focusIndex=af.index;ae.button.attr("aria-activedescendant",ae.menuItems.eq(af.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 false};this.menuInstance._isDivider=function(){return false}},refresh:function(){this._refreshMenu();this._setText(this.buttonText,this._getSelectedItem().text());if(!this.options.width){this._resizeButton()}},_refreshMenu:function(){this.menu.empty();var af,ae=this.element.find("option");if(!ae.length){return}this._parseOptions(ae);this._renderMenu(this.menu,this.items);this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup");af=this._getSelectedItem();this.menuInstance.focus(null,af);this._setAria(af.data("ui-selectmenu-item"));this._setOption("disabled",this.element.prop("disabled"))},open:function(ae){if(this.options.disabled){return}if(!this.menuItems){this._refreshMenu()}else{this.menu.find(".ui-state-focus").removeClass("ui-state-focus");this.menuInstance.focus(null,this._getSelectedItem())}this.isOpen=true;this._toggleAttr();this._resizeMenu();this._position();this._on(this.document,this._documentClick);this._trigger("open",ae)},_position:function(){this.menuWrap.position(I.extend({of:this.button},this.options.position))},close:function(ae){if(!this.isOpen){return}this.isOpen=false;this._toggleAttr();this.range=null;this._off(this.document);this._trigger("close",ae)},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(ag,af){var ah=this,ae="";I.each(af,function(ai,aj){if(aj.optgroup!==ae){I("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(aj.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:aj.optgroup}).appendTo(ag);ae=aj.optgroup}ah._renderItemData(ag,aj)})},_renderItemData:function(ae,af){return this._renderItem(ae,af).data("ui-selectmenu-item",af)},_renderItem:function(af,ag){var ae=I("<li>");if(ag.disabled){ae.addClass("ui-state-disabled")}this._setText(ae,ag.label);return ae.appendTo(af)},_setText:function(ae,af){if(af){ae.text(af)}else{ae.html("&#160;")}},_move:function(ai,ah){var ag,af,ae=".ui-menu-item";if(this.isOpen){ag=this.menuItems.eq(this.focusIndex)}else{ag=this.menuItems.eq(this.element[0].selectedIndex);ae+=":not(.ui-state-disabled)"}if(ai==="first"||ai==="last"){af=ag[ai==="first"?"prevAll":"nextAll"](ae).eq(-1)}else{af=ag[ai+"All"](ae).eq(0)}if(af.length){this.menuInstance.focus(ah,af)}},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(ae){this[this.isOpen?"close":"open"](ae)},_setSelection:function(){var ae;if(!this.range){return}if(window.getSelection){ae=window.getSelection();ae.removeAllRanges();ae.addRange(this.range)}else{this.range.select()}this.button.focus()},_documentClick:{mousedown:function(ae){if(!this.isOpen){return}if(!I(ae.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length){this.close(ae)}}},_buttonEvents:{mousedown:function(){var ae;if(window.getSelection){ae=window.getSelection();if(ae.rangeCount){this.range=ae.getRangeAt(0)}}else{this.range=document.selection.createRange()}},click:function(ae){this._setSelection();this._toggle(ae)},keydown:function(af){var ae=true;switch(af.keyCode){case I.ui.keyCode.TAB:case I.ui.keyCode.ESCAPE:this.close(af);ae=false;break;case I.ui.keyCode.ENTER:if(this.isOpen){this._selectFocusedItem(af)}break;case I.ui.keyCode.UP:if(af.altKey){this._toggle(af)}else{this._move("prev",af)}break;case I.ui.keyCode.DOWN:if(af.altKey){this._toggle(af)}else{this._move("next",af)}break;case I.ui.keyCode.SPACE:if(this.isOpen){this._selectFocusedItem(af)}else{this._toggle(af)}break;case I.ui.keyCode.LEFT:this._move("prev",af);break;case I.ui.keyCode.RIGHT:this._move("next",af);break;case I.ui.keyCode.HOME:case I.ui.keyCode.PAGE_UP:this._move("first",af);break;case I.ui.keyCode.END:case I.ui.keyCode.PAGE_DOWN:this._move("last",af);break;default:this.menu.trigger(af);ae=false}if(ae){af.preventDefault()}}},_selectFocusedItem:function(af){var ae=this.menuItems.eq(this.focusIndex);if(!ae.hasClass("ui-state-disabled")){this._select(ae.data("ui-selectmenu-item"),af)}},_select:function(af,ae){var ag=this.element[0].selectedIndex;this.element[0].selectedIndex=af.index;this._setText(this.buttonText,af.label);this._setAria(af);this._trigger("select",ae,{item:af});if(af.index!==ag){this._trigger("change",ae,{item:af})}this.close(ae)},_setAria:function(ae){var af=this.menuItems.eq(ae.index).attr("id");this.button.attr({"aria-labelledby":af,"aria-activedescendant":af});this.menu.attr("aria-activedescendant",af)},_setOption:function(ae,af){if(ae==="icons"){this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(af.button)}this._super(ae,af);if(ae==="appendTo"){this.menuWrap.appendTo(this._appendTo())}if(ae==="disabled"){this.menuInstance.option("disabled",af);this.button.toggleClass("ui-state-disabled",af).attr("aria-disabled",af);this.element.prop("disabled",af);if(af){this.button.attr("tabindex",-1);this.close()}else{this.button.attr("tabindex",0)}}if(ae==="width"){this._resizeButton()}},_appendTo:function(){var ae=this.options.appendTo;if(ae){ae=ae.jquery||ae.nodeType?I(ae):this.document.find(ae).eq(0)}if(!ae||!ae[0]){ae=this.element.closest(".ui-front")}if(!ae.length){ae=this.document[0].body}return ae},_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 ae=this.options.width;if(!ae){ae=this.element.show().outerWidth();this.element.hide()}this.button.outerWidth(ae)},_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(ae){var af=[];ae.each(function(ah,aj){var ai=I(aj),ag=ai.parent("optgroup");af.push({element:ai,index:ah,value:ai.attr("value"),label:ai.text(),optgroup:ag.attr("label")||"",disabled:ag.prop("disabled")||ai.prop("disabled")})});this.items=af},_destroy:function(){this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.label.attr("for",this.ids.element)}});
369
+ /*!
370
+ * jQuery UI Slider 1.11.2
371
+ * http://jqueryui.com
372
+ *
373
+ * Copyright 2014 jQuery Foundation and other contributors
374
+ * Released under the MIT license.
375
+ * http://jquery.org/license
376
+ *
377
+ * http://api.jqueryui.com/slider/
378
+ */
379
+ var g=I.widget("ui.slider",I.ui.mouse,{version:"1.11.2",widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;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=false},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var ah,ae,af=this.options,aj=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),ai="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",ag=[];ae=(af.values&&af.values.length)||1;if(aj.length>ae){aj.slice(ae).remove();aj=aj.slice(0,ae)}for(ah=aj.length;ah<ae;ah++){ag.push(ai)}this.handles=aj.add(I(ag.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(ak){I(this).data("ui-slider-handle-index",ak)})},_createRange:function(){var ae=this.options,af="";if(ae.range){if(ae.range===true){if(!ae.values){ae.values=[this._valueMin(),this._valueMin()]}else{if(ae.values.length&&ae.values.length!==2){ae.values=[ae.values[0],ae.values[0]]}else{if(I.isArray(ae.values)){ae.values=ae.values.slice(0)}}}}if(!this.range||!this.range.length){this.range=I("<div></div>").appendTo(this.element);af="ui-slider-range ui-widget-header ui-corner-all"}else{this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""})}this.range.addClass(af+((ae.range==="min"||ae.range==="max")?" ui-slider-range-"+ae.range:""))}else{if(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();if(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(ag){var ak,an,af,ai,am,ao,aj,ae,al=this,ah=this.options;if(ah.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();ak={x:ag.pageX,y:ag.pageY};an=this._normValueFromMouse(ak);af=this._valueMax()-this._valueMin()+1;this.handles.each(function(ap){var aq=Math.abs(an-al.values(ap));if((af>aq)||(af===aq&&(ap===al._lastChangedValue||al.values(ap)===ah.min))){af=aq;ai=I(this);am=ap}});ao=this._start(ag,am);if(ao===false){return false}this._mouseSliding=true;this._handleIndex=am;ai.addClass("ui-state-active").focus();aj=ai.offset();ae=!I(ag.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=ae?{left:0,top:0}:{left:ag.pageX-aj.left-(ai.width()/2),top:ag.pageY-aj.top-(ai.height()/2)-(parseInt(ai.css("borderTopWidth"),10)||0)-(parseInt(ai.css("borderBottomWidth"),10)||0)+(parseInt(ai.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(ag,am,an)}this._animateOff=true;return true},_mouseStart:function(){return true},_mouseDrag:function(ag){var ae={x:ag.pageX,y:ag.pageY},af=this._normValueFromMouse(ae);this._slide(ag,this._handleIndex,af);return false},_mouseStop:function(ae){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(ae,this._handleIndex);this._change(ae,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(af){var ae,ai,ah,ag,aj;if(this.orientation==="horizontal"){ae=this.elementSize.width;ai=af.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{ae=this.elementSize.height;ai=af.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}ah=(ai/ae);if(ah>1){ah=1}if(ah<0){ah=0}if(this.orientation==="vertical"){ah=1-ah}ag=this._valueMax()-this._valueMin();aj=this._valueMin()+ah*ag;return this._trimAlignValue(aj)},_start:function(ag,af){var ae={handle:this.handles[af],value:this.value()};if(this.options.values&&this.options.values.length){ae.value=this.values(af);ae.values=this.values()}return this._trigger("start",ag,ae)},_slide:function(ai,ah,ag){var ae,af,aj;if(this.options.values&&this.options.values.length){ae=this.values(ah?0:1);if((this.options.values.length===2&&this.options.range===true)&&((ah===0&&ag>ae)||(ah===1&&ag<ae))){ag=ae}if(ag!==this.values(ah)){af=this.values();af[ah]=ag;aj=this._trigger("slide",ai,{handle:this.handles[ah],value:ag,values:af});ae=this.values(ah?0:1);if(aj!==false){this.values(ah,ag)}}}else{if(ag!==this.value()){aj=this._trigger("slide",ai,{handle:this.handles[ah],value:ag});if(aj!==false){this.value(ag)}}}},_stop:function(ag,af){var ae={handle:this.handles[af],value:this.value()};if(this.options.values&&this.options.values.length){ae.value=this.values(af);ae.values=this.values()}this._trigger("stop",ag,ae)},_change:function(ag,af){if(!this._keySliding&&!this._mouseSliding){var ae={handle:this.handles[af],value:this.value()};if(this.options.values&&this.options.values.length){ae.value=this.values(af);ae.values=this.values()}this._lastChangedValue=af;this._trigger("change",ag,ae)}},value:function(ae){if(arguments.length){this.options.value=this._trimAlignValue(ae);this._refreshValue();this._change(null,0);return}return this._value()},values:function(af,ai){var ah,ae,ag;if(arguments.length>1){this.options.values[af]=this._trimAlignValue(ai);this._refreshValue();this._change(null,af);return}if(arguments.length){if(I.isArray(arguments[0])){ah=this.options.values;ae=arguments[0];for(ag=0;ag<ah.length;ag+=1){ah[ag]=this._trimAlignValue(ae[ag]);this._change(null,ag)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(af)}else{return this.value()}}}else{return this._values()}},_setOption:function(af,ag){var ae,ah=0;if(af==="range"&&this.options.range===true){if(ag==="min"){this.options.value=this._values(0);this.options.values=null}else{if(ag==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null}}}if(I.isArray(this.options.values)){ah=this.options.values.length}if(af==="disabled"){this.element.toggleClass("ui-state-disabled",!!ag)}this._super(af,ag);switch(af){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();this.handles.css(ag==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(ae=0;ae<ah;ae+=1){this._change(null,ae)}this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break}},_value:function(){var ae=this.options.value;ae=this._trimAlignValue(ae);return ae},_values:function(ae){var ah,ag,af;if(arguments.length){ah=this.options.values[ae];ah=this._trimAlignValue(ah);return ah}else{if(this.options.values&&this.options.values.length){ag=this.options.values.slice();for(af=0;af<ag.length;af+=1){ag[af]=this._trimAlignValue(ag[af])}return ag}else{return[]}}},_trimAlignValue:function(ah){if(ah<=this._valueMin()){return this._valueMin()}if(ah>=this._valueMax()){return this._valueMax()}var ae=(this.options.step>0)?this.options.step:1,ag=(ah-this._valueMin())%ae,af=ah-ag;if(Math.abs(ag)*2>=ae){af+=(ag>0)?ae:(-ae)}return parseFloat(af.toFixed(5))},_calculateNewMax:function(){var ae=(this.options.max-this._valueMin())%this.options.step;this.max=this.options.max-ae},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var aj,ai,am,ak,an,ah=this.options.range,ag=this.options,al=this,af=(!this._animateOff)?ag.animate:false,ae={};if(this.options.values&&this.options.values.length){this.handles.each(function(ao){ai=(al.values(ao)-al._valueMin())/(al._valueMax()-al._valueMin())*100;ae[al.orientation==="horizontal"?"left":"bottom"]=ai+"%";I(this).stop(1,1)[af?"animate":"css"](ae,ag.animate);if(al.options.range===true){if(al.orientation==="horizontal"){if(ao===0){al.range.stop(1,1)[af?"animate":"css"]({left:ai+"%"},ag.animate)}if(ao===1){al.range[af?"animate":"css"]({width:(ai-aj)+"%"},{queue:false,duration:ag.animate})}}else{if(ao===0){al.range.stop(1,1)[af?"animate":"css"]({bottom:(ai)+"%"},ag.animate)}if(ao===1){al.range[af?"animate":"css"]({height:(ai-aj)+"%"},{queue:false,duration:ag.animate})}}}aj=ai})}else{am=this.value();ak=this._valueMin();an=this._valueMax();ai=(an!==ak)?(am-ak)/(an-ak)*100:0;ae[this.orientation==="horizontal"?"left":"bottom"]=ai+"%";this.handle.stop(1,1)[af?"animate":"css"](ae,ag.animate);if(ah==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[af?"animate":"css"]({width:ai+"%"},ag.animate)}if(ah==="max"&&this.orientation==="horizontal"){this.range[af?"animate":"css"]({width:(100-ai)+"%"},{queue:false,duration:ag.animate})}if(ah==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[af?"animate":"css"]({height:ai+"%"},ag.animate)}if(ah==="max"&&this.orientation==="vertical"){this.range[af?"animate":"css"]({height:(100-ai)+"%"},{queue:false,duration:ag.animate})}}},_handleEvents:{keydown:function(ai){var aj,ag,af,ah,ae=I(ai.target).data("ui-slider-handle-index");switch(ai.keyCode){case I.ui.keyCode.HOME:case I.ui.keyCode.END:case I.ui.keyCode.PAGE_UP:case I.ui.keyCode.PAGE_DOWN:case I.ui.keyCode.UP:case I.ui.keyCode.RIGHT:case I.ui.keyCode.DOWN:case I.ui.keyCode.LEFT:ai.preventDefault();if(!this._keySliding){this._keySliding=true;I(ai.target).addClass("ui-state-active");aj=this._start(ai,ae);if(aj===false){return}}break}ah=this.options.step;if(this.options.values&&this.options.values.length){ag=af=this.values(ae)}else{ag=af=this.value()}switch(ai.keyCode){case I.ui.keyCode.HOME:af=this._valueMin();break;case I.ui.keyCode.END:af=this._valueMax();break;case I.ui.keyCode.PAGE_UP:af=this._trimAlignValue(ag+((this._valueMax()-this._valueMin())/this.numPages));break;case I.ui.keyCode.PAGE_DOWN:af=this._trimAlignValue(ag-((this._valueMax()-this._valueMin())/this.numPages));break;case I.ui.keyCode.UP:case I.ui.keyCode.RIGHT:if(ag===this._valueMax()){return}af=this._trimAlignValue(ag+ah);break;case I.ui.keyCode.DOWN:case I.ui.keyCode.LEFT:if(ag===this._valueMin()){return}af=this._trimAlignValue(ag-ah);break}this._slide(ai,ae,af)},keyup:function(af){var ae=I(af.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(af,ae);this._change(af,ae);I(af.target).removeClass("ui-state-active")}}}});
380
+ /*!
381
+ * jQuery UI Sortable 1.11.2
382
+ * http://jqueryui.com
383
+ *
384
+ * Copyright 2014 jQuery Foundation and other contributors
385
+ * Released under the MIT license.
386
+ * http://jquery.org/license
387
+ *
388
+ * http://api.jqueryui.com/sortable/
389
+ */
390
+ var A=I.widget("ui.sortable",I.ui.mouse,{version:"1.11.2",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,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(af,ae,ag){return(af>=ae)&&(af<(ae+ag))},_isFloating:function(ae){return(/left|right/).test(ae.css("float"))||(/inline|table-cell/).test(ae.css("display"))},_create:function(){var ae=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?ae.axis==="x"||this._isFloating(this.items[0].item):false;this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true},_setOption:function(ae,af){this._super(ae,af);if(ae==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");I.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 ae=this.items.length-1;ae>=0;ae--){this.items[ae].item.removeData(this.widgetName+"-item")}return this},_mouseCapture:function(ag,ah){var ae=null,ai=false,af=this;if(this.reverting){return false}if(this.options.disabled||this.options.type==="static"){return false}this._refreshItems(ag);I(ag.target).parents().each(function(){if(I.data(this,af.widgetName+"-item")===af){ae=I(this);return false}});if(I.data(ag.target,af.widgetName+"-item")===af){ae=I(ag.target)}if(!ae){return false}if(this.options.handle&&!ah){I(this.options.handle,ae).find("*").addBack().each(function(){if(this===ag.target){ai=true}});if(!ai){return false}}this.currentItem=ae;this._removeCurrentsFromItems();return true},_mouseStart:function(ah,ai,af){var ag,ae,aj=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(ah);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};I.extend(this.offset,{click:{left:ah.pageX-this.offset.left,top:ah.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(ah);this.originalPageX=ah.pageX;this.originalPageY=ah.pageY;(aj.cursorAt&&this._adjustOffsetFromHelper(aj.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(aj.containment){this._setContainment()}if(aj.cursor&&aj.cursor!=="auto"){ae=this.document.find("body");this.storedCursor=ae.css("cursor");ae.css("cursor",aj.cursor);this.storedStylesheet=I("<style>*{ cursor: "+aj.cursor+" !important; }</style>").appendTo(ae)}if(aj.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",aj.opacity)}if(aj.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",aj.zIndex)}if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",ah,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!af){for(ag=this.containers.length-1;ag>=0;ag--){this.containers[ag]._trigger("activate",ah,this._uiHash(this))}}if(I.ui.ddmanager){I.ui.ddmanager.current=this}if(I.ui.ddmanager&&!aj.dropBehaviour){I.ui.ddmanager.prepareOffsets(this,ah)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(ah);return true},_mouseDrag:function(ai){var ag,ah,af,ak,aj=this.options,ae=false;this.position=this._generatePosition(ai);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-ai.pageY<aj.scrollSensitivity){this.scrollParent[0].scrollTop=ae=this.scrollParent[0].scrollTop+aj.scrollSpeed}else{if(ai.pageY-this.overflowOffset.top<aj.scrollSensitivity){this.scrollParent[0].scrollTop=ae=this.scrollParent[0].scrollTop-aj.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-ai.pageX<aj.scrollSensitivity){this.scrollParent[0].scrollLeft=ae=this.scrollParent[0].scrollLeft+aj.scrollSpeed}else{if(ai.pageX-this.overflowOffset.left<aj.scrollSensitivity){this.scrollParent[0].scrollLeft=ae=this.scrollParent[0].scrollLeft-aj.scrollSpeed}}}else{if(ai.pageY-I(document).scrollTop()<aj.scrollSensitivity){ae=I(document).scrollTop(I(document).scrollTop()-aj.scrollSpeed)}else{if(I(window).height()-(ai.pageY-I(document).scrollTop())<aj.scrollSensitivity){ae=I(document).scrollTop(I(document).scrollTop()+aj.scrollSpeed)}}if(ai.pageX-I(document).scrollLeft()<aj.scrollSensitivity){ae=I(document).scrollLeft(I(document).scrollLeft()-aj.scrollSpeed)}else{if(I(window).width()-(ai.pageX-I(document).scrollLeft())<aj.scrollSensitivity){ae=I(document).scrollLeft(I(document).scrollLeft()+aj.scrollSpeed)}}}if(ae!==false&&I.ui.ddmanager&&!aj.dropBehaviour){I.ui.ddmanager.prepareOffsets(this,ai)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}for(ag=this.items.length-1;ag>=0;ag--){ah=this.items[ag];af=ah.item[0];ak=this._intersectsWithPointer(ah);if(!ak){continue}if(ah.instance!==this.currentContainer){continue}if(af!==this.currentItem[0]&&this.placeholder[ak===1?"next":"prev"]()[0]!==af&&!I.contains(this.placeholder[0],af)&&(this.options.type==="semi-dynamic"?!I.contains(this.element[0],af):true)){this.direction=ak===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(ah)){this._rearrange(ai,ah)}else{break}this._trigger("change",ai,this._uiHash());break}}this._contactContainers(ai);if(I.ui.ddmanager){I.ui.ddmanager.drag(this,ai)}this._trigger("sort",ai,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(ag,ai){if(!ag){return}if(I.ui.ddmanager&&!this.options.dropBehaviour){I.ui.ddmanager.drop(this,ag)}if(this.options.revert){var af=this,aj=this.placeholder.offset(),ae=this.options.axis,ah={};if(!ae||ae==="x"){ah.left=aj.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)}if(!ae||ae==="y"){ah.top=aj.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)}this.reverting=true;I(this.helper).animate(ah,parseInt(this.options.revert,10)||500,function(){af._clear(ag)})}else{this._clear(ag,ai)}return false},cancel:function(){if(this.dragging){this._mouseUp({target:null});if(this.options.helper==="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var ae=this.containers.length-1;ae>=0;ae--){this.containers[ae]._trigger("deactivate",null,this._uiHash(this));if(this.containers[ae].containerCache.over){this.containers[ae]._trigger("out",null,this._uiHash(this));this.containers[ae].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}I.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){I(this.domPosition.prev).after(this.currentItem)}else{I(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(ag){var ae=this._getItemsAsjQuery(ag&&ag.connected),af=[];ag=ag||{};I(ae).each(function(){var ah=(I(ag.item||this).attr(ag.attribute||"id")||"").match(ag.expression||(/(.+)[\-=_](.+)/));if(ah){af.push((ag.key||ah[1]+"[]")+"="+(ag.key&&ag.expression?ah[1]:ah[2]))}});if(!af.length&&ag.key){af.push(ag.key+"=")}return af.join("&")},toArray:function(ag){var ae=this._getItemsAsjQuery(ag&&ag.connected),af=[];ag=ag||{};ae.each(function(){af.push(I(ag.item||this).attr(ag.attribute||"id")||"")});return af},_intersectsWith:function(ap){var ag=this.positionAbs.left,af=ag+this.helperProportions.width,an=this.positionAbs.top,am=an+this.helperProportions.height,ah=ap.left,ae=ah+ap.width,aq=ap.top,al=aq+ap.height,ar=this.offset.click.top,ak=this.offset.click.left,aj=(this.options.axis==="x")||((an+ar)>aq&&(an+ar)<al),ao=(this.options.axis==="y")||((ag+ak)>ah&&(ag+ak)<ae),ai=aj&&ao;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>ap[this.floating?"width":"height"])){return ai}else{return(ah<ag+(this.helperProportions.width/2)&&af-(this.helperProportions.width/2)<ae&&aq<an+(this.helperProportions.height/2)&&am-(this.helperProportions.height/2)<al)}},_intersectsWithPointer:function(ag){var ah=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,ag.top,ag.height),af=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,ag.left,ag.width),aj=ah&&af,ae=this._getDragVerticalDirection(),ai=this._getDragHorizontalDirection();if(!aj){return false}return this.floating?(((ai&&ai==="right")||ae==="down")?2:1):(ae&&(ae==="down"?2:1))},_intersectsWithSides:function(ah){var af=this._isOverAxis(this.positionAbs.top+this.offset.click.top,ah.top+(ah.height/2),ah.height),ag=this._isOverAxis(this.positionAbs.left+this.offset.click.left,ah.left+(ah.width/2),ah.width),ae=this._getDragVerticalDirection(),ai=this._getDragHorizontalDirection();if(this.floating&&ai){return((ai==="right"&&ag)||(ai==="left"&&!ag))}else{return ae&&((ae==="down"&&af)||(ae==="up"&&!af))}},_getDragVerticalDirection:function(){var ae=this.positionAbs.top-this.lastPositionAbs.top;return ae!==0&&(ae>0?"down":"up")},_getDragHorizontalDirection:function(){var ae=this.positionAbs.left-this.lastPositionAbs.left;return ae!==0&&(ae>0?"right":"left")},refresh:function(ae){this._refreshItems(ae);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var ae=this.options;return ae.connectWith.constructor===String?[ae.connectWith]:ae.connectWith},_getItemsAsjQuery:function(ae){var ag,af,al,ai,aj=[],ah=[],ak=this._connectWith();if(ak&&ae){for(ag=ak.length-1;ag>=0;ag--){al=I(ak[ag]);for(af=al.length-1;af>=0;af--){ai=I.data(al[af],this.widgetFullName);if(ai&&ai!==this&&!ai.options.disabled){ah.push([I.isFunction(ai.options.items)?ai.options.items.call(ai.element):I(ai.options.items,ai.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),ai])}}}}ah.push([I.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):I(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function am(){aj.push(this)}for(ag=ah.length-1;ag>=0;ag--){ah[ag][0].each(am)}return I(aj)},_removeCurrentsFromItems:function(){var ae=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=I.grep(this.items,function(ag){for(var af=0;af<ae.length;af++){if(ae[af]===ag.item[0]){return false}}return true})},_refreshItems:function(ae){this.items=[];this.containers=[this];var ai,ag,an,aj,am,af,ap,ao,ak=this.items,ah=[[I.isFunction(this.options.items)?this.options.items.call(this.element[0],ae,{item:this.currentItem}):I(this.options.items,this.element),this]],al=this._connectWith();if(al&&this.ready){for(ai=al.length-1;ai>=0;ai--){an=I(al[ai]);for(ag=an.length-1;ag>=0;ag--){aj=I.data(an[ag],this.widgetFullName);if(aj&&aj!==this&&!aj.options.disabled){ah.push([I.isFunction(aj.options.items)?aj.options.items.call(aj.element[0],ae,{item:this.currentItem}):I(aj.options.items,aj.element),aj]);this.containers.push(aj)}}}}for(ai=ah.length-1;ai>=0;ai--){am=ah[ai][1];af=ah[ai][0];for(ag=0,ao=af.length;ag<ao;ag++){ap=I(af[ag]);ap.data(this.widgetName+"-item",am);ak.push({item:ap,instance:am,width:0,height:0,left:0,top:0})}}},refreshPositions:function(ae){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}var ag,ah,af,ai;for(ag=this.items.length-1;ag>=0;ag--){ah=this.items[ag];if(ah.instance!==this.currentContainer&&this.currentContainer&&ah.item[0]!==this.currentItem[0]){continue}af=this.options.toleranceElement?I(this.options.toleranceElement,ah.item):ah.item;if(!ae){ah.width=af.outerWidth();ah.height=af.outerHeight()}ai=af.offset();ah.left=ai.left;ah.top=ai.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(ag=this.containers.length-1;ag>=0;ag--){ai=this.containers[ag].element.offset();this.containers[ag].containerCache.left=ai.left;this.containers[ag].containerCache.top=ai.top;this.containers[ag].containerCache.width=this.containers[ag].element.outerWidth();this.containers[ag].containerCache.height=this.containers[ag].element.outerHeight()}}return this},_createPlaceholder:function(af){af=af||this;var ae,ag=af.options;if(!ag.placeholder||ag.placeholder.constructor===String){ae=ag.placeholder;ag.placeholder={element:function(){var ai=af.currentItem[0].nodeName.toLowerCase(),ah=I("<"+ai+">",af.document[0]).addClass(ae||af.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");if(ai==="tr"){af.currentItem.children().each(function(){I("<td>&#160;</td>",af.document[0]).attr("colspan",I(this).attr("colspan")||1).appendTo(ah)})}else{if(ai==="img"){ah.attr("src",af.currentItem.attr("src"))}}if(!ae){ah.css("visibility","hidden")}return ah},update:function(ah,ai){if(ae&&!ag.forcePlaceholderSize){return}if(!ai.height()){ai.height(af.currentItem.innerHeight()-parseInt(af.currentItem.css("paddingTop")||0,10)-parseInt(af.currentItem.css("paddingBottom")||0,10))}if(!ai.width()){ai.width(af.currentItem.innerWidth()-parseInt(af.currentItem.css("paddingLeft")||0,10)-parseInt(af.currentItem.css("paddingRight")||0,10))}}}}af.placeholder=I(ag.placeholder.element.call(af.element,af.currentItem));af.currentItem.after(af.placeholder);ag.placeholder.update(af,af.placeholder)},_contactContainers:function(ae){var aj,ah,an,ak,al,ap,aq,ai,am,ag,af=null,ao=null;for(aj=this.containers.length-1;aj>=0;aj--){if(I.contains(this.currentItem[0],this.containers[aj].element[0])){continue}if(this._intersectsWith(this.containers[aj].containerCache)){if(af&&I.contains(this.containers[aj].element[0],af.element[0])){continue}af=this.containers[aj];ao=aj}else{if(this.containers[aj].containerCache.over){this.containers[aj]._trigger("out",ae,this._uiHash(this));this.containers[aj].containerCache.over=0}}}if(!af){return}if(this.containers.length===1){if(!this.containers[ao].containerCache.over){this.containers[ao]._trigger("over",ae,this._uiHash(this));this.containers[ao].containerCache.over=1}}else{an=10000;ak=null;am=af.floating||this._isFloating(this.currentItem);al=am?"left":"top";ap=am?"width":"height";ag=am?"clientX":"clientY";for(ah=this.items.length-1;ah>=0;ah--){if(!I.contains(this.containers[ao].element[0],this.items[ah].item[0])){continue}if(this.items[ah].item[0]===this.currentItem[0]){continue}aq=this.items[ah].item.offset()[al];ai=false;if(ae[ag]-aq>this.items[ah][ap]/2){ai=true}if(Math.abs(ae[ag]-aq)<an){an=Math.abs(ae[ag]-aq);ak=this.items[ah];this.direction=ai?"up":"down"}}if(!ak&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[ao]){if(!this.currentContainer.containerCache.over){this.containers[ao]._trigger("over",ae,this._uiHash());this.currentContainer.containerCache.over=1}return}ak?this._rearrange(ae,ak,null,true):this._rearrange(ae,null,this.containers[ao].element,true);this._trigger("change",ae,this._uiHash());this.containers[ao]._trigger("change",ae,this._uiHash(this));this.currentContainer=this.containers[ao];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[ao]._trigger("over",ae,this._uiHash(this));this.containers[ao].containerCache.over=1}},_createHelper:function(af){var ag=this.options,ae=I.isFunction(ag.helper)?I(ag.helper.apply(this.element[0],[af,this.currentItem])):(ag.helper==="clone"?this.currentItem.clone():this.currentItem);if(!ae.parents("body").length){I(ag.appendTo!=="parent"?ag.appendTo:this.currentItem[0].parentNode)[0].appendChild(ae[0])}if(ae[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")}}if(!ae[0].style.width||ag.forceHelperSize){ae.width(this.currentItem.width())}if(!ae[0].style.height||ag.forceHelperSize){ae.height(this.currentItem.height())}return ae},_adjustOffsetFromHelper:function(ae){if(typeof ae==="string"){ae=ae.split(" ")}if(I.isArray(ae)){ae={left:+ae[0],top:+ae[1]||0}}if("left" in ae){this.offset.click.left=ae.left+this.margins.left}if("right" in ae){this.offset.click.left=this.helperProportions.width-ae.right+this.margins.left}if("top" in ae){this.offset.click.top=ae.top+this.margins.top}if("bottom" in ae){this.offset.click.top=this.helperProportions.height-ae.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var ae=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&I.contains(this.scrollParent[0],this.offsetParent[0])){ae.left+=this.scrollParent.scrollLeft();ae.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===document.body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&I.ui.ie)){ae={top:0,left:0}}return{top:ae.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:ae.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var ae=this.currentItem.position();return{top:ae.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:ae.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{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 af,ah,ae,ag=this.options;if(ag.containment==="parent"){ag.containment=this.helper[0].parentNode}if(ag.containment==="document"||ag.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,I(ag.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(I(ag.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(ag.containment)){af=I(ag.containment)[0];ah=I(ag.containment).offset();ae=(I(af).css("overflow")!=="hidden");this.containment=[ah.left+(parseInt(I(af).css("borderLeftWidth"),10)||0)+(parseInt(I(af).css("paddingLeft"),10)||0)-this.margins.left,ah.top+(parseInt(I(af).css("borderTopWidth"),10)||0)+(parseInt(I(af).css("paddingTop"),10)||0)-this.margins.top,ah.left+(ae?Math.max(af.scrollWidth,af.offsetWidth):af.offsetWidth)-(parseInt(I(af).css("borderLeftWidth"),10)||0)-(parseInt(I(af).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,ah.top+(ae?Math.max(af.scrollHeight,af.offsetHeight):af.offsetHeight)-(parseInt(I(af).css("borderTopWidth"),10)||0)-(parseInt(I(af).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(ag,ai){if(!ai){ai=this.position}var af=ag==="absolute"?1:-1,ae=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&I.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,ah=(/(html|body)/i).test(ae[0].tagName);return{top:(ai.top+this.offset.relative.top*af+this.offset.parent.top*af-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(ah?0:ae.scrollTop()))*af)),left:(ai.left+this.offset.relative.left*af+this.offset.parent.left*af-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():ah?0:ae.scrollLeft())*af))}},_generatePosition:function(ah){var aj,ai,ak=this.options,ag=ah.pageX,af=ah.pageY,ae=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&I.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,al=(/(html|body)/i).test(ae[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}if(this.originalPosition){if(this.containment){if(ah.pageX-this.offset.click.left<this.containment[0]){ag=this.containment[0]+this.offset.click.left}if(ah.pageY-this.offset.click.top<this.containment[1]){af=this.containment[1]+this.offset.click.top}if(ah.pageX-this.offset.click.left>this.containment[2]){ag=this.containment[2]+this.offset.click.left}if(ah.pageY-this.offset.click.top>this.containment[3]){af=this.containment[3]+this.offset.click.top}}if(ak.grid){aj=this.originalPageY+Math.round((af-this.originalPageY)/ak.grid[1])*ak.grid[1];af=this.containment?((aj-this.offset.click.top>=this.containment[1]&&aj-this.offset.click.top<=this.containment[3])?aj:((aj-this.offset.click.top>=this.containment[1])?aj-ak.grid[1]:aj+ak.grid[1])):aj;ai=this.originalPageX+Math.round((ag-this.originalPageX)/ak.grid[0])*ak.grid[0];ag=this.containment?((ai-this.offset.click.left>=this.containment[0]&&ai-this.offset.click.left<=this.containment[2])?ai:((ai-this.offset.click.left>=this.containment[0])?ai-ak.grid[0]:ai+ak.grid[0])):ai}}return{top:(af-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(al?0:ae.scrollTop())))),left:(ag-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():al?0:ae.scrollLeft())))}},_rearrange:function(ai,ah,af,ag){af?af[0].appendChild(this.placeholder[0]):ah.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?ah.item[0]:ah.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var ae=this.counter;this._delay(function(){if(ae===this.counter){this.refreshPositions(!ag)}})},_clear:function(af,ah){this.reverting=false;var ae,ai=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(ae in this._storedCSS){if(this._storedCSS[ae]==="auto"||this._storedCSS[ae]==="static"){this._storedCSS[ae]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!ah){ai.push(function(aj){this._trigger("receive",aj,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!ah){ai.push(function(aj){this._trigger("update",aj,this._uiHash())})}if(this!==this.currentContainer){if(!ah){ai.push(function(aj){this._trigger("remove",aj,this._uiHash())});ai.push((function(aj){return function(ak){aj._trigger("receive",ak,this._uiHash(this))}}).call(this,this.currentContainer));ai.push((function(aj){return function(ak){aj._trigger("update",ak,this._uiHash(this))}}).call(this,this.currentContainer))}}function ag(al,aj,ak){return function(am){ak._trigger(al,am,aj._uiHash(aj))}}for(ae=this.containers.length-1;ae>=0;ae--){if(!ah){ai.push(ag("deactivate",this,this.containers[ae]))}if(this.containers[ae].containerCache.over){ai.push(ag("out",this,this.containers[ae]));this.containers[ae].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(!ah){this._trigger("beforeStop",af,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}this.helper=null}if(!ah){for(ae=0;ae<ai.length;ae++){ai[ae].call(this,af)}this._trigger("stop",af,this._uiHash())}this.fromOutside=false;return !this.cancelHelperRemoval},_trigger:function(){if(I.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(ae){var af=ae||this;return{helper:af.helper,placeholder:af.placeholder||I([]),position:af.position,originalPosition:af.originalPosition,offset:af.positionAbs,item:af.currentItem,sender:ae?ae.element:null}}});
391
+ /*!
392
+ * jQuery UI Spinner 1.11.2
393
+ * http://jqueryui.com
394
+ *
395
+ * Copyright 2014 jQuery Foundation and other contributors
396
+ * Released under the MIT license.
397
+ * http://jquery.org/license
398
+ *
399
+ * http://api.jqueryui.com/spinner/
400
+ */
401
+ function u(ae){return function(){var af=this.element.val();ae.apply(this,arguments);this._refresh();if(af!==this.element.val()){this._trigger("change")}}}var K=I.widget("ui.spinner",{version:"1.11.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,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);if(this.value()!==""){this._value(this.element.val(),true)}this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var ae={},af=this.element;I.each(["min","max","step"],function(ag,ah){var ai=af.attr(ah);if(ai!==undefined&&ai.length){ae[ah]=ai}});return ae},_events:{keydown:function(ae){if(this._start(ae)&&this._keydown(ae)){ae.preventDefault()}},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(ae){if(this.cancelBlur){delete this.cancelBlur;return}this._stop();this._refresh();if(this.previous!==this.element.val()){this._trigger("change",ae)}},mousewheel:function(ae,af){if(!af){return}if(!this.spinning&&!this._start(ae)){return false}this._spin((af>0?1:-1)*this.options.step,ae);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){if(this.spinning){this._stop(ae)}},100);ae.preventDefault()},"mousedown .ui-spinner-button":function(af){var ae;ae=this.element[0]===this.document[0].activeElement?this.previous:this.element.val();function ag(){var ah=this.element[0]===this.document[0].activeElement;if(!ah){this.element.focus();this.previous=ae;this._delay(function(){this.previous=ae})}}af.preventDefault();ag.call(this);this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;ag.call(this)});if(this._start(af)===false){return}this._repeat(null,I(af.currentTarget).hasClass("ui-spinner-up")?1:-1,af)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(ae){if(!I(ae.currentTarget).hasClass("ui-state-active")){return}if(this._start(ae)===false){return false}this._repeat(null,I(ae.currentTarget).hasClass("ui-spinner-up")?1:-1,ae)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var ae=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=ae.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all");if(this.buttons.height()>Math.ceil(ae.height()*0.5)&&ae.height()>0){ae.height(ae.height())}if(this.options.disabled){this.disable()}},_keydown:function(af){var ae=this.options,ag=I.ui.keyCode;switch(af.keyCode){case ag.UP:this._repeat(null,1,af);return true;case ag.DOWN:this._repeat(null,-1,af);return true;case ag.PAGE_UP:this._repeat(null,ae.page,af);return true;case ag.PAGE_DOWN:this._repeat(null,-ae.page,af);return true}return false},_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(ae){if(!this.spinning&&this._trigger("start",ae)===false){return false}if(!this.counter){this.counter=1}this.spinning=true;return true},_repeat:function(af,ae,ag){af=af||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,ae,ag)},af);this._spin(ae*this.options.step,ag)},_spin:function(af,ae){var ag=this.value()||0;if(!this.counter){this.counter=1}ag=this._adjustValue(ag+af*this._increment(this.counter));if(!this.spinning||this._trigger("spin",ae,{value:ag})!==false){this._value(ag);this.counter++}},_increment:function(ae){var af=this.options.incremental;if(af){return I.isFunction(af)?af(ae):Math.floor(ae*ae*ae/50000-ae*ae/500+17*ae/200+1)}return 1},_precision:function(){var ae=this._precisionOf(this.options.step);if(this.options.min!==null){ae=Math.max(ae,this._precisionOf(this.options.min))}return ae},_precisionOf:function(af){var ag=af.toString(),ae=ag.indexOf(".");return ae===-1?0:ag.length-ae-1},_adjustValue:function(ag){var af,ah,ae=this.options;af=ae.min!==null?ae.min:0;ah=ag-af;ah=Math.round(ah/ae.step)*ae.step;ag=af+ah;ag=parseFloat(ag.toFixed(this._precision()));if(ae.max!==null&&ag>ae.max){return ae.max}if(ae.min!==null&&ag<ae.min){return ae.min}return ag},_stop:function(ae){if(!this.spinning){return}clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;this.spinning=false;this._trigger("stop",ae)},_setOption:function(ae,af){if(ae==="culture"||ae==="numberFormat"){var ag=this._parse(this.element.val());this.options[ae]=af;this.element.val(this._format(ag));return}if(ae==="max"||ae==="min"||ae==="step"){if(typeof af==="string"){af=this._parse(af)}}if(ae==="icons"){this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(af.up);this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(af.down)}this._super(ae,af);if(ae==="disabled"){this.widget().toggleClass("ui-state-disabled",!!af);this.element.prop("disabled",!!af);this.buttons.button(af?"disable":"enable")}},_setOptions:u(function(ae){this._super(ae)}),_parse:function(ae){if(typeof ae==="string"&&ae!==""){ae=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(ae,10,this.options.culture):+ae}return ae===""||isNaN(ae)?null:ae},_format:function(ae){if(ae===""){return""}return window.Globalize&&this.options.numberFormat?Globalize.format(ae,this.options.numberFormat,this.options.culture):ae},_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 ae=this.value();if(ae===null){return false}return ae===this._adjustValue(ae)},_value:function(ag,ae){var af;if(ag!==""){af=this._parse(ag);if(af!==null){if(!ae){af=this._adjustValue(af)}ag=this._format(af)}}this.element.val(ag);this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",false).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.uiSpinner.replaceWith(this.element)},stepUp:u(function(ae){this._stepUp(ae)}),_stepUp:function(ae){if(this._start()){this._spin((ae||1)*this.options.step);this._stop()}},stepDown:u(function(ae){this._stepDown(ae)}),_stepDown:function(ae){if(this._start()){this._spin((ae||1)*-this.options.step);this._stop()}},pageUp:u(function(ae){this._stepUp((ae||1)*this.options.page)}),pageDown:u(function(ae){this._stepDown((ae||1)*this.options.page)}),value:function(ae){if(!arguments.length){return this._parse(this.element.val())}u(this._value).call(this,ae)},widget:function(){return this.uiSpinner}});
402
+ /*!
403
+ * jQuery UI Tabs 1.11.2
404
+ * http://jqueryui.com
405
+ *
406
+ * Copyright 2014 jQuery Foundation and other contributors
407
+ * Released under the MIT license.
408
+ * http://jquery.org/license
409
+ *
410
+ * http://api.jqueryui.com/tabs/
411
+ */
412
+ var j=I.widget("ui.tabs",{version:"1.11.2",delay:300,options:{active:null,collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(function(){var ae=/#.*$/;return function(ag){var ai,ah;ag=ag.cloneNode(false);ai=ag.href.replace(ae,"");ah=location.href.replace(ae,"");try{ai=decodeURIComponent(ai)}catch(af){}try{ah=decodeURIComponent(ah)}catch(af){}return ag.hash.length>1&&ai===ah}})(),_create:function(){var af=this,ae=this.options;this.running=false;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",ae.collapsible);this._processTabs();ae.active=this._initialActive();if(I.isArray(ae.disabled)){ae.disabled=I.unique(ae.disabled.concat(I.map(this.tabs.filter(".ui-state-disabled"),function(ag){return af.tabs.index(ag)}))).sort()}if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(ae.active)}else{this.active=I()}this._refresh();if(this.active.length){this.load(ae.active)}},_initialActive:function(){var af=this.options.active,ae=this.options.collapsible,ag=location.hash.substring(1);if(af===null){if(ag){this.tabs.each(function(ah,ai){if(I(ai).attr("aria-controls")===ag){af=ah;return false}})}if(af===null){af=this.tabs.index(this.tabs.filter(".ui-tabs-active"))}if(af===null||af===-1){af=this.tabs.length?0:false}}if(af!==false){af=this.tabs.index(this.tabs.eq(af));if(af===-1){af=ae?false:0}}if(!ae&&af===false&&this.anchors.length){af=0}return af},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?I():this._getPanelForTab(this.active)}},_tabKeydown:function(ag){var af=I(this.document[0].activeElement).closest("li"),ae=this.tabs.index(af),ah=true;if(this._handlePageNav(ag)){return}switch(ag.keyCode){case I.ui.keyCode.RIGHT:case I.ui.keyCode.DOWN:ae++;break;case I.ui.keyCode.UP:case I.ui.keyCode.LEFT:ah=false;ae--;break;case I.ui.keyCode.END:ae=this.anchors.length-1;break;case I.ui.keyCode.HOME:ae=0;break;case I.ui.keyCode.SPACE:ag.preventDefault();clearTimeout(this.activating);this._activate(ae);return;case I.ui.keyCode.ENTER:ag.preventDefault();clearTimeout(this.activating);this._activate(ae===this.options.active?false:ae);return;default:return}ag.preventDefault();clearTimeout(this.activating);ae=this._focusNextTab(ae,ah);if(!ag.ctrlKey){af.attr("aria-selected","false");this.tabs.eq(ae).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",ae)},this.delay)}},_panelKeydown:function(ae){if(this._handlePageNav(ae)){return}if(ae.ctrlKey&&ae.keyCode===I.ui.keyCode.UP){ae.preventDefault();this.active.focus()}},_handlePageNav:function(ae){if(ae.altKey&&ae.keyCode===I.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true}if(ae.altKey&&ae.keyCode===I.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true}},_findNextTab:function(af,ag){var ae=this.tabs.length-1;function ah(){if(af>ae){af=0}if(af<0){af=ae}return af}while(I.inArray(ah(),this.options.disabled)!==-1){af=ag?af+1:af-1}return af},_focusNextTab:function(ae,af){ae=this._findNextTab(ae,af);this.tabs.eq(ae).focus();return ae},_setOption:function(ae,af){if(ae==="active"){this._activate(af);return}if(ae==="disabled"){this._setupDisabled(af);return}this._super(ae,af);if(ae==="collapsible"){this.element.toggleClass("ui-tabs-collapsible",af);if(!af&&this.options.active===false){this._activate(0)}}if(ae==="event"){this._setupEvents(af)}if(ae==="heightStyle"){this._setupHeightStyle(af)}},_sanitizeSelector:function(ae){return ae?ae.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var af=this.options,ae=this.tablist.children(":has(a[href])");af.disabled=I.map(ae.filter(".ui-state-disabled"),function(ag){return ae.index(ag)});this._processTabs();if(af.active===false||!this.anchors.length){af.active=false;this.active=I()}else{if(this.active.length&&!I.contains(this.tablist[0],this.active[0])){if(this.tabs.length===af.disabled.length){af.active=false;this.active=I()}else{this._activate(this._findNextTab(Math.max(0,af.active-1),false))}}else{af.active=this.tabs.index(this.active)}}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"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0)}else{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"})}},_processTabs:function(){var ag=this,ah=this.tabs,af=this.anchors,ae=this.panels;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(ai){if(I(this).is(".ui-state-disabled")){ai.preventDefault()}}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){if(I(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 I("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=I();this.anchors.each(function(an,al){var ai,aj,am,ak=I(al).uniqueId().attr("id"),ao=I(al).closest("li"),ap=ao.attr("aria-controls");if(ag._isLocal(al)){ai=al.hash;am=ai.substring(1);aj=ag.element.find(ag._sanitizeSelector(ai))}else{am=ao.attr("aria-controls")||I({}).uniqueId()[0].id;ai="#"+am;aj=ag.element.find(ai);if(!aj.length){aj=ag._createPanel(am);aj.insertAfter(ag.panels[an-1]||ag.tablist)}aj.attr("aria-live","polite")}if(aj.length){ag.panels=ag.panels.add(aj)}if(ap){ao.data("ui-tabs-aria-controls",ap)}ao.attr({"aria-controls":am,"aria-labelledby":ak});aj.attr("aria-labelledby",ak)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel");if(ah){this._off(ah.not(this.tabs));this._off(af.not(this.anchors));this._off(ae.not(this.panels))}},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(ae){return I("<div>").attr("id",ae).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",true)},_setupDisabled:function(ag){if(I.isArray(ag)){if(!ag.length){ag=false}else{if(ag.length===this.anchors.length){ag=true}}}for(var af=0,ae;(ae=this.tabs[af]);af++){if(ag===true||I.inArray(af,ag)!==-1){I(ae).addClass("ui-state-disabled").attr("aria-disabled","true")}else{I(ae).removeClass("ui-state-disabled").removeAttr("aria-disabled")}}this.options.disabled=ag},_setupEvents:function(af){var ae={};if(af){I.each(af.split(" "),function(ah,ag){ae[ag]="_eventHandler"})}this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(ag){ag.preventDefault()}});this._on(this.anchors,ae);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(ae){var ag,af=this.element.parent();if(ae==="fill"){ag=af.height();ag-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var ai=I(this),ah=ai.css("position");if(ah==="absolute"||ah==="fixed"){return}ag-=ai.outerHeight(true)});this.element.children().not(this.panels).each(function(){ag-=I(this).outerHeight(true)});this.panels.each(function(){I(this).height(Math.max(0,ag-I(this).innerHeight()+I(this).height()))}).css("overflow","auto")}else{if(ae==="auto"){ag=0;this.panels.each(function(){ag=Math.max(ag,I(this).height("").height())}).height(ag)}}},_eventHandler:function(ae){var an=this.options,ai=this.active,aj=I(ae.currentTarget),ah=aj.closest("li"),al=ah[0]===ai[0],af=al&&an.collapsible,ag=af?I():this._getPanelForTab(ah),ak=!ai.length?I():this._getPanelForTab(ai),am={oldTab:ai,oldPanel:ak,newTab:af?I():ah,newPanel:ag};ae.preventDefault();if(ah.hasClass("ui-state-disabled")||ah.hasClass("ui-tabs-loading")||this.running||(al&&!an.collapsible)||(this._trigger("beforeActivate",ae,am)===false)){return}an.active=af?false:this.tabs.index(ah);this.active=al?I():ah;if(this.xhr){this.xhr.abort()}if(!ak.length&&!ag.length){I.error("jQuery UI Tabs: Mismatching fragment identifier.")}if(ag.length){this.load(this.tabs.index(ah),ae)}this._toggle(ae,am)},_toggle:function(ak,aj){var ai=this,ae=aj.newPanel,ah=aj.oldPanel;this.running=true;function ag(){ai.running=false;ai._trigger("activate",ak,aj)}function af(){aj.newTab.closest("li").addClass("ui-tabs-active ui-state-active");if(ae.length&&ai.options.show){ai._show(ae,ai.options.show,ag)}else{ae.show();ag()}}if(ah.length&&this.options.hide){this._hide(ah,this.options.hide,function(){aj.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");af()})}else{aj.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");ah.hide();af()}ah.attr("aria-hidden","true");aj.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(ae.length&&ah.length){aj.oldTab.attr("tabIndex",-1)}else{if(ae.length){this.tabs.filter(function(){return I(this).attr("tabIndex")===0}).attr("tabIndex",-1)}}ae.attr("aria-hidden","false");aj.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(af){var ae,ag=this._findActive(af);if(ag[0]===this.active[0]){return}if(!ag.length){ag=this.active}ae=ag.find(".ui-tabs-anchor")[0];this._eventHandler({target:ae,currentTarget:ae,preventDefault:I.noop})},_findActive:function(ae){return ae===false?I():this.tabs.eq(ae)},_getIndex:function(ae){if(typeof ae==="string"){ae=this.anchors.index(this.anchors.filter("[href$='"+ae+"']"))}return ae},_destroy:function(){if(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(){if(I.data(this,"ui-tabs-destroy")){I(this).remove()}else{I(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 ae=I(this),af=ae.data("ui-tabs-aria-controls");if(af){ae.attr("aria-controls",af).removeData("ui-tabs-aria-controls")}else{ae.removeAttr("aria-controls")}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","")}},enable:function(ae){var af=this.options.disabled;if(af===false){return}if(ae===undefined){af=false}else{ae=this._getIndex(ae);if(I.isArray(af)){af=I.map(af,function(ag){return ag!==ae?ag:null})}else{af=I.map(this.tabs,function(ag,ah){return ah!==ae?ah:null})}}this._setupDisabled(af)},disable:function(ae){var af=this.options.disabled;if(af===true){return}if(ae===undefined){af=true}else{ae=this._getIndex(ae);if(I.inArray(ae,af)!==-1){return}if(I.isArray(af)){af=I.merge([ae],af).sort()}else{af=[ae]}}this._setupDisabled(af)},load:function(ag,ak){ag=this._getIndex(ag);var aj=this,ah=this.tabs.eq(ag),af=ah.find(".ui-tabs-anchor"),ae=this._getPanelForTab(ah),ai={tab:ah,panel:ae};if(this._isLocal(af[0])){return}this.xhr=I.ajax(this._ajaxSettings(af,ak,ai));if(this.xhr&&this.xhr.statusText!=="canceled"){ah.addClass("ui-tabs-loading");ae.attr("aria-busy","true");this.xhr.success(function(al){setTimeout(function(){ae.html(al);aj._trigger("load",ak,ai)},1)}).complete(function(am,al){setTimeout(function(){if(al==="abort"){aj.panels.stop(false,true)}ah.removeClass("ui-tabs-loading");ae.removeAttr("aria-busy");if(am===aj.xhr){delete aj.xhr}},1)})}},_ajaxSettings:function(ae,ah,ag){var af=this;return{url:ae.attr("href"),beforeSend:function(aj,ai){return af._trigger("beforeLoad",ah,I.extend({jqXHR:aj,ajaxSettings:ai},ag))}}},_getPanelForTab:function(ae){var af=I(ae).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+af))}});
413
+ /*!
414
+ * jQuery UI Tooltip 1.11.2
415
+ * http://jqueryui.com
416
+ *
417
+ * Copyright 2014 jQuery Foundation and other contributors
418
+ * Released under the MIT license.
419
+ * http://jquery.org/license
420
+ *
421
+ * http://api.jqueryui.com/tooltip/
422
+ */
423
+ var L=I.widget("ui.tooltip",{version:"1.11.2",options:{content:function(){var ae=I(this).attr("title")||"";return I("<a>").text(ae).html()},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,tooltipClass:null,track:false,close:null,open:null},_addDescribedBy:function(af,ag){var ae=(af.attr("aria-describedby")||"").split(/\s+/);ae.push(ag);af.data("ui-tooltip-id",ag).attr("aria-describedby",I.trim(ae.join(" ")))},_removeDescribedBy:function(ag){var ah=ag.data("ui-tooltip-id"),af=(ag.attr("aria-describedby")||"").split(/\s+/),ae=I.inArray(ah,af);if(ae!==-1){af.splice(ae,1)}ag.removeData("ui-tooltip-id");af=I.trim(af.join(" "));if(af){ag.attr("aria-describedby",af)}else{ag.removeAttr("aria-describedby")}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};if(this.options.disabled){this._disable()}this.liveRegion=I("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(ae,ag){var af=this;if(ae==="disabled"){this[ag?"_disable":"_enable"]();this.options[ae]=ag;return}this._super(ae,ag);if(ae==="content"){I.each(this.tooltips,function(ai,ah){af._updateContent(ah.element)})}},_disable:function(){var ae=this;I.each(this.tooltips,function(ah,ag){var af=I.Event("blur");af.target=af.currentTarget=ag.element[0];ae.close(af,true)});this.element.find(this.options.items).addBack().each(function(){var af=I(this);if(af.is("[title]")){af.data("ui-tooltip-title",af.attr("title")).removeAttr("title")}})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var ae=I(this);if(ae.data("ui-tooltip-title")){ae.attr("title",ae.data("ui-tooltip-title"))}})},open:function(af){var ae=this,ag=I(af?af.target:this.element).closest(this.options.items);if(!ag.length||ag.data("ui-tooltip-id")){return}if(ag.attr("title")){ag.data("ui-tooltip-title",ag.attr("title"))}ag.data("ui-tooltip-open",true);if(af&&af.type==="mouseover"){ag.parents().each(function(){var ai=I(this),ah;if(ai.data("ui-tooltip-open")){ah=I.Event("blur");ah.target=ah.currentTarget=this;ae.close(ah,true)}if(ai.attr("title")){ai.uniqueId();ae.parents[this.id]={element:this,title:ai.attr("title")};ai.attr("title","")}})}this._updateContent(ag,af)},_updateContent:function(aj,ai){var ah,ae=this.options.content,ag=this,af=ai?ai.type:null;if(typeof ae==="string"){return this._open(ai,aj,ae)}ah=ae.call(aj[0],function(ak){if(!aj.data("ui-tooltip-open")){return}ag._delay(function(){if(ai){ai.type=af}this._open(ai,aj,ak)})});if(ah){this._open(ai,aj,ah)}},_open:function(af,ai,aj){var ae,an,am,al,ag,ak=I.extend({},this.options.position);if(!aj){return}ae=this._find(ai);if(ae){ae.tooltip.find(".ui-tooltip-content").html(aj);return}if(ai.is("[title]")){if(af&&af.type==="mouseover"){ai.attr("title","")}else{ai.removeAttr("title")}}ae=this._tooltip(ai);an=ae.tooltip;this._addDescribedBy(ai,an.attr("id"));an.find(".ui-tooltip-content").html(aj);this.liveRegion.children().hide();if(aj.clone){ag=aj.clone();ag.removeAttr("id").find("[id]").removeAttr("id")}else{ag=aj}I("<div>").html(ag).appendTo(this.liveRegion);function ah(ao){ak.of=ao;if(an.is(":hidden")){return}an.position(ak)}if(this.options.track&&af&&/^mouse/.test(af.type)){this._on(this.document,{mousemove:ah});ah(af)}else{an.position(I.extend({of:ai},this.options.position))}an.hide();this._show(an,this.options.show);if(this.options.show&&this.options.show.delay){al=this.delayedShow=setInterval(function(){if(an.is(":visible")){ah(ak.of);clearInterval(al)}},I.fx.interval)}this._trigger("open",af,{tooltip:an});am={keyup:function(ao){if(ao.keyCode===I.ui.keyCode.ESCAPE){var ap=I.Event(ao);ap.currentTarget=ai[0];this.close(ap,true)}}};if(ai[0]!==this.element[0]){am.remove=function(){this._removeTooltip(an)}}if(!af||af.type==="mouseover"){am.mouseleave="close"}if(!af||af.type==="focusin"){am.focusout="close"}this._on(true,ai,am)},close:function(af){var ah,ae=this,ai=I(af?af.currentTarget:this.element),ag=this._find(ai);if(!ag){return}ah=ag.tooltip;if(ag.closing){return}clearInterval(this.delayedShow);if(ai.data("ui-tooltip-title")&&!ai.attr("title")){ai.attr("title",ai.data("ui-tooltip-title"))}this._removeDescribedBy(ai);ag.hiding=true;ah.stop(true);this._hide(ah,this.options.hide,function(){ae._removeTooltip(I(this))});ai.removeData("ui-tooltip-open");this._off(ai,"mouseleave focusout keyup");if(ai[0]!==this.element[0]){this._off(ai,"remove")}this._off(this.document,"mousemove");if(af&&af.type==="mouseleave"){I.each(this.parents,function(ak,aj){I(aj.element).attr("title",aj.title);delete ae.parents[ak]})}ag.closing=true;this._trigger("close",af,{tooltip:ah});if(!ag.hiding){ag.closing=false}},_tooltip:function(ae){var af=I("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),ag=af.uniqueId().attr("id");I("<div>").addClass("ui-tooltip-content").appendTo(af);af.appendTo(this.document[0].body);return this.tooltips[ag]={element:ae,tooltip:af}},_find:function(ae){var af=ae.data("ui-tooltip-id");return af?this.tooltips[af]:null},_removeTooltip:function(ae){ae.remove();delete this.tooltips[ae.attr("id")]},_destroy:function(){var ae=this;I.each(this.tooltips,function(ai,ah){var ag=I.Event("blur"),af=ah.element;ag.target=ag.currentTarget=af[0];ae.close(ag,true);I("#"+ai).remove();if(af.data("ui-tooltip-title")){if(!af.attr("title")){af.attr("title",af.data("ui-tooltip-title"))}af.removeData("ui-tooltip-title")}});this.liveRegion.remove()}})}));
files/third-party/modal-box/modal-box-ie.css DELETED
@@ -1,8 +0,0 @@
1
- /*the colorpicker dialog style in IE*/
2
- .modalDialog {
3
- display:none;
4
- }
5
-
6
- .modalDialog:target {
7
- display:block;
8
- }
 
 
 
 
 
 
 
 
files/third-party/modal-box/modal-box-ie.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .modalDialog{display:none}.modalDialog:target{display:block}
files/third-party/modal-box/modal-box.css DELETED
@@ -1,75 +0,0 @@
1
-
2
- /*= MODAL DIALOG BOX =*/
3
-
4
- .modalDialog {
5
- position: fixed;
6
- font-family: Arial, Helvetica, sans-serif;
7
- top: 0;
8
- right: 0;
9
- bottom: 0;
10
- left: 0;
11
- background: rgba(0,0,0,0.4);
12
- z-index: 99999;
13
- opacity:0;
14
- -webkit-transition: opacity 400ms ease-in;
15
- -moz-transition: opacity 400ms ease-in;
16
- transition: opacity 400ms ease-in;
17
- pointer-events: none;
18
- }
19
-
20
- .modalDialog:target {
21
- opacity:1;
22
- pointer-events: auto;
23
- }
24
-
25
- .modalDialog > div {
26
- width: 400px;
27
- position: relative;
28
- margin: 10% auto;
29
- padding: 5px 20px 13px 20px;
30
- -webkit-border-top-left-radius: 10px;
31
- -webkit-border-top-right-radius: 10px;
32
- -webkit-border-bottom-right-radius: 10px;
33
- -webkit-border-bottom-left-radius: 10px;
34
-
35
- -moz-border-radius-topleft: 10px;
36
- -moz-border-radius-topright: 10px;
37
- -moz-border-radius-bottomright: 10px;
38
- -moz-border-radius-bottomleft: 10px;
39
-
40
- border-top-left-radius: 10px;
41
- border-top-right-radius: 10px;
42
- border-bottom-right-radius: 10px;
43
- border-bottom-left-radius: 10px;
44
- background: #fff;
45
- background: -moz-linear-gradient(#fff, #999);
46
- background: -webkit-linear-gradient(#fff, #999);
47
- background: -o-linear-gradient(#fff, #999);
48
- background: -ms-linear-gradient(#fff, #999);
49
- background: linear-gradient(#fff, #999);
50
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#999999');
51
- }
52
-
53
- .modalDialog input {font-size: 10px !important;}
54
-
55
- .close {
56
- background: #606061;
57
- color: #FFFFFF;
58
- line-height: 25px;
59
- position: absolute;
60
- right: -12px;
61
- text-align: center;
62
- top: -10px;
63
- width: 24px;
64
- text-decoration: none;
65
- font-weight: bold;
66
- -webkit-border-radius: 12px;
67
- -moz-border-radius: 12px;
68
- border-radius: 12px;
69
- -moz-box-shadow: 1px 1px 3px #000;
70
- -webkit-box-shadow: 1px 1px 3px #000;
71
- box-shadow: 1px 1px 3px #000;
72
- opacity: 1 !important;
73
- }
74
-
75
- .close:hover { background: #00d9ff; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/modal-box/modal-box.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .modalDialog{position:fixed;font-family:Arial,Helvetica,sans-serif;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.4);z-index:99999;opacity:0;-webkit-transition:opacity 400ms ease-in;-moz-transition:opacity 400ms ease-in;transition:opacity 400ms ease-in;pointer-events:none}.modalDialog:target{opacity:1;pointer-events:auto}.modalDialog>div{width:400px;position:relative;margin:10% auto;padding:5px 20px 13px 20px;-webkit-border-top-left-radius:10px;-webkit-border-top-right-radius:10px;-webkit-border-bottom-right-radius:10px;-webkit-border-bottom-left-radius:10px;-moz-border-radius-topleft:10px;-moz-border-radius-topright:10px;-moz-border-radius-bottomright:10px;-moz-border-radius-bottomleft:10px;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;background:#fff;background:-moz-linear-gradient(#fff,#999);background:-webkit-linear-gradient(#fff,#999);background:-o-linear-gradient(#fff,#999);background:-ms-linear-gradient(#fff,#999);background:linear-gradient(#fff,#999);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#999999')}.modalDialog input{font-size:10px!important}.close{background:#606061;color:#fff;line-height:25px;position:absolute;right:-12px;text-align:center;top:-10px;width:24px;text-decoration:none;font-weight:bold;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;-moz-box-shadow:1px 1px 3px #000;-webkit-box-shadow:1px 1px 3px #000;box-shadow:1px 1px 3px #000;opacity:1!important}.close:hover{background:#00d9ff}
files/third-party/tooltipster/css/tooltipster.css DELETED
@@ -1,274 +0,0 @@
1
- /* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */
2
- .tooltipster-default {
3
- border-radius: 5px;
4
- border: 2px solid #000;
5
- background: #4c4c4c;
6
- color: #fff;
7
- }
8
-
9
- /* Use this next selector to style things like font-size and line-height: */
10
- .tooltipster-default .tooltipster-content {
11
- font-family: Arial, sans-serif;
12
- font-size: 14px;
13
- line-height: 16px;
14
- padding: 8px 10px;
15
- overflow: hidden;
16
- }
17
-
18
- /* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */
19
- .tooltipster-default .tooltipster-arrow .tooltipster-arrow-border {
20
- /* border-color: ... !important; */
21
- }
22
-
23
-
24
- /* If you're using the icon option, use this next selector to style them */
25
- .tooltipster-icon {
26
- cursor: help;
27
- margin-left: 4px;
28
- }
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
- /* This is the base styling required to make all Tooltipsters work */
38
- .tooltipster-base {
39
- padding: 0;
40
- font-size: 0;
41
- line-height: 0;
42
- position: absolute;
43
- left: 0;
44
- top: 0;
45
- z-index: 9999999;
46
- pointer-events: none;
47
- width: auto;
48
- overflow: visible;
49
- }
50
- .tooltipster-base .tooltipster-content {
51
- overflow: hidden;
52
- }
53
-
54
-
55
- /* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */
56
- .tooltipster-arrow {
57
- display: block;
58
- text-align: center;
59
- width: 100%;
60
- height: 100%;
61
- position: absolute;
62
- top: 0;
63
- left: 0;
64
- z-index: -1;
65
- }
66
- .tooltipster-arrow span, .tooltipster-arrow-border {
67
- display: block;
68
- width: 0;
69
- height: 0;
70
- position: absolute;
71
- }
72
- .tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span {
73
- border-left: 8px solid transparent !important;
74
- border-right: 8px solid transparent !important;
75
- border-top: 8px solid;
76
- bottom: -7px;
77
- }
78
- .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border {
79
- border-left: 9px solid transparent !important;
80
- border-right: 9px solid transparent !important;
81
- border-top: 9px solid;
82
- bottom: -7px;
83
- }
84
-
85
- .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span {
86
- border-left: 8px solid transparent !important;
87
- border-right: 8px solid transparent !important;
88
- border-bottom: 8px solid;
89
- top: -7px;
90
- }
91
- .tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
92
- border-left: 9px solid transparent !important;
93
- border-right: 9px solid transparent !important;
94
- border-bottom: 9px solid;
95
- top: -7px;
96
- }
97
- .tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border {
98
- left: 0;
99
- right: 0;
100
- margin: 0 auto;
101
- }
102
- .tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span {
103
- left: 6px;
104
- }
105
- .tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
106
- left: 5px;
107
- }
108
- .tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span {
109
- right: 6px;
110
- }
111
- .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border {
112
- right: 5px;
113
- }
114
- .tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border {
115
- border-top: 8px solid transparent !important;
116
- border-bottom: 8px solid transparent !important;
117
- border-left: 8px solid;
118
- top: 50%;
119
- margin-top: -7px;
120
- right: -7px;
121
- }
122
- .tooltipster-arrow-left .tooltipster-arrow-border {
123
- border-top: 9px solid transparent !important;
124
- border-bottom: 9px solid transparent !important;
125
- border-left: 9px solid;
126
- margin-top: -8px;
127
- }
128
- .tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border {
129
- border-top: 8px solid transparent !important;
130
- border-bottom: 8px solid transparent !important;
131
- border-right: 8px solid;
132
- top: 50%;
133
- margin-top: -7px;
134
- left: -7px;
135
- }
136
- .tooltipster-arrow-right .tooltipster-arrow-border {
137
- border-top: 9px solid transparent !important;
138
- border-bottom: 9px solid transparent !important;
139
- border-right: 9px solid;
140
- margin-top: -8px;
141
- }
142
-
143
-
144
- /* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */
145
-
146
- .tooltipster-fade {
147
- opacity: 0;
148
- -webkit-transition-property: opacity;
149
- -moz-transition-property: opacity;
150
- -o-transition-property: opacity;
151
- -ms-transition-property: opacity;
152
- transition-property: opacity;
153
- }
154
- .tooltipster-fade-show {
155
- opacity: 1;
156
- }
157
-
158
- .tooltipster-grow {
159
- -webkit-transform: scale(0,0);
160
- -moz-transform: scale(0,0);
161
- -o-transform: scale(0,0);
162
- -ms-transform: scale(0,0);
163
- transform: scale(0,0);
164
- -webkit-transition-property: -webkit-transform;
165
- -moz-transition-property: -moz-transform;
166
- -o-transition-property: -o-transform;
167
- -ms-transition-property: -ms-transform;
168
- transition-property: transform;
169
- -webkit-backface-visibility: hidden;
170
- }
171
- .tooltipster-grow-show {
172
- -webkit-transform: scale(1,1);
173
- -moz-transform: scale(1,1);
174
- -o-transform: scale(1,1);
175
- -ms-transform: scale(1,1);
176
- transform: scale(1,1);
177
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
178
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
179
- -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
180
- -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
181
- -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
182
- transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
183
- }
184
-
185
- .tooltipster-swing {
186
- opacity: 0;
187
- -webkit-transform: rotateZ(4deg);
188
- -moz-transform: rotateZ(4deg);
189
- -o-transform: rotateZ(4deg);
190
- -ms-transform: rotateZ(4deg);
191
- transform: rotateZ(4deg);
192
- -webkit-transition-property: -webkit-transform, opacity;
193
- -moz-transition-property: -moz-transform;
194
- -o-transition-property: -o-transform;
195
- -ms-transition-property: -ms-transform;
196
- transition-property: transform;
197
- }
198
- .tooltipster-swing-show {
199
- opacity: 1;
200
- -webkit-transform: rotateZ(0deg);
201
- -moz-transform: rotateZ(0deg);
202
- -o-transform: rotateZ(0deg);
203
- -ms-transform: rotateZ(0deg);
204
- transform: rotateZ(0deg);
205
- -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1);
206
- -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
207
- -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
208
- -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
209
- -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
210
- transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
211
- }
212
-
213
- .tooltipster-fall {
214
- top: 0;
215
- -webkit-transition-property: top;
216
- -moz-transition-property: top;
217
- -o-transition-property: top;
218
- -ms-transition-property: top;
219
- transition-property: top;
220
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
221
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
222
- -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
223
- -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
224
- -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
225
- transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
226
- }
227
- .tooltipster-fall-show {
228
- }
229
- .tooltipster-fall.tooltipster-dying {
230
- -webkit-transition-property: all;
231
- -moz-transition-property: all;
232
- -o-transition-property: all;
233
- -ms-transition-property: all;
234
- transition-property: all;
235
- top: 0px !important;
236
- opacity: 0;
237
- }
238
-
239
- .tooltipster-slide {
240
- left: -40px;
241
- -webkit-transition-property: left;
242
- -moz-transition-property: left;
243
- -o-transition-property: left;
244
- -ms-transition-property: left;
245
- transition-property: left;
246
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
247
- -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
248
- -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
249
- -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
250
- -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
251
- transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
252
- }
253
- .tooltipster-slide.tooltipster-slide-show {
254
- }
255
- .tooltipster-slide.tooltipster-dying {
256
- -webkit-transition-property: all;
257
- -moz-transition-property: all;
258
- -o-transition-property: all;
259
- -ms-transition-property: all;
260
- transition-property: all;
261
- left: 0px !important;
262
- opacity: 0;
263
- }
264
-
265
-
266
- /* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */
267
- .tooltipster-content-changing {
268
- opacity: 0.5;
269
- -webkit-transform: scale(1.1, 1.1);
270
- -moz-transform: scale(1.1, 1.1);
271
- -o-transform: scale(1.1, 1.1);
272
- -ms-transform: scale(1.1, 1.1);
273
- transform: scale(1.1, 1.1);
274
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files/third-party/tooltipster/css/tooltipster.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .tooltipster-default{border-radius:5px;border:2px solid #000;background:#4c4c4c;color:#fff}.tooltipster-default .tooltipster-content{font-family:Arial,sans-serif;font-size:14px;line-height:16px;padding:8px 10px;overflow:hidden}.tooltipster-icon{cursor:help;margin-left:4px}.tooltipster-base{padding:0;font-size:0;line-height:0;position:absolute;left:0;top:0;z-index:9999999;pointer-events:none;width:auto;overflow:visible}.tooltipster-base .tooltipster-content{overflow:hidden}.tooltipster-arrow{display:block;text-align:center;width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1}.tooltipster-arrow span,.tooltipster-arrow-border{display:block;width:0;height:0;position:absolute}.tooltipster-arrow-top span,.tooltipster-arrow-top-right span,.tooltipster-arrow-top-left span{border-left:8px solid transparent!important;border-right:8px solid transparent!important;border-top:8px solid;bottom:-7px}.tooltipster-arrow-top .tooltipster-arrow-border,.tooltipster-arrow-top-right .tooltipster-arrow-border,.tooltipster-arrow-top-left .tooltipster-arrow-border{border-left:9px solid transparent!important;border-right:9px solid transparent!important;border-top:9px solid;bottom:-7px}.tooltipster-arrow-bottom span,.tooltipster-arrow-bottom-right span,.tooltipster-arrow-bottom-left span{border-left:8px solid transparent!important;border-right:8px solid transparent!important;border-bottom:8px solid;top:-7px}.tooltipster-arrow-bottom .tooltipster-arrow-border,.tooltipster-arrow-bottom-right .tooltipster-arrow-border,.tooltipster-arrow-bottom-left .tooltipster-arrow-border{border-left:9px solid transparent!important;border-right:9px solid transparent!important;border-bottom:9px solid;top:-7px}.tooltipster-arrow-top span,.tooltipster-arrow-top .tooltipster-arrow-border,.tooltipster-arrow-bottom span,.tooltipster-arrow-bottom .tooltipster-arrow-border{left:0;right:0;margin:0 auto}.tooltipster-arrow-top-left span,.tooltipster-arrow-bottom-left span{left:6px}.tooltipster-arrow-top-left .tooltipster-arrow-border,.tooltipster-arrow-bottom-left .tooltipster-arrow-border{left:5px}.tooltipster-arrow-top-right span,.tooltipster-arrow-bottom-right span{right:6px}.tooltipster-arrow-top-right .tooltipster-arrow-border,.tooltipster-arrow-bottom-right .tooltipster-arrow-border{right:5px}.tooltipster-arrow-left span,.tooltipster-arrow-left .tooltipster-arrow-border{border-top:8px solid transparent!important;border-bottom:8px solid transparent!important;border-left:8px solid;top:50%;margin-top:-7px;right:-7px}.tooltipster-arrow-left .tooltipster-arrow-border{border-top:9px solid transparent!important;border-bottom:9px solid transparent!important;border-left:9px solid;margin-top:-8px}.tooltipster-arrow-right span,.tooltipster-arrow-right .tooltipster-arrow-border{border-top:8px solid transparent!important;border-bottom:8px solid transparent!important;border-right:8px solid;top:50%;margin-top:-7px;left:-7px}.tooltipster-arrow-right .tooltipster-arrow-border{border-top:9px solid transparent!important;border-bottom:9px solid transparent!important;border-right:9px solid;margin-top:-8px}.tooltipster-fade{opacity:0;-webkit-transition-property:opacity;-moz-transition-property:opacity;-o-transition-property:opacity;-ms-transition-property:opacity;transition-property:opacity}.tooltipster-fade-show{opacity:1}.tooltipster-grow{-webkit-transform:scale(0,0);-moz-transform:scale(0,0);-o-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0);-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-backface-visibility:hidden}.tooltipster-grow-show{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1);-webkit-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1);-webkit-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-moz-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-ms-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-o-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15)}.tooltipster-swing{opacity:0;-webkit-transform:rotateZ(4deg);-moz-transform:rotateZ(4deg);-o-transform:rotateZ(4deg);-ms-transform:rotateZ(4deg);transform:rotateZ(4deg);-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform}.tooltipster-swing-show{opacity:1;-webkit-transform:rotateZ(0deg);-moz-transform:rotateZ(0deg);-o-transform:rotateZ(0deg);-ms-transform:rotateZ(0deg);transform:rotateZ(0deg);-webkit-transition-timing-function:cubic-bezier(0.230,0.635,0.495,1);-webkit-transition-timing-function:cubic-bezier(0.230,0.635,0.495,2.4);-moz-transition-timing-function:cubic-bezier(0.230,0.635,0.495,2.4);-ms-transition-timing-function:cubic-bezier(0.230,0.635,0.495,2.4);-o-transition-timing-function:cubic-bezier(0.230,0.635,0.495,2.4);transition-timing-function:cubic-bezier(0.230,0.635,0.495,2.4)}.tooltipster-fall{top:0;-webkit-transition-property:top;-moz-transition-property:top;-o-transition-property:top;-ms-transition-property:top;transition-property:top;-webkit-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1);-webkit-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-moz-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-ms-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-o-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15)}.tooltipster-fall.tooltipster-dying{-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;-ms-transition-property:all;transition-property:all;top:0!important;opacity:0}.tooltipster-slide{left:-40px;-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;-ms-transition-property:left;transition-property:left;-webkit-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1);-webkit-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-moz-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-ms-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);-o-transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15);transition-timing-function:cubic-bezier(0.175,0.885,0.320,1.15)}.tooltipster-slide.tooltipster-dying{-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;-ms-transition-property:all;transition-property:all;left:0!important;opacity:0}.tooltipster-content-changing{opacity:.5;-webkit-transform:scale(1.1,1.1);-moz-transform:scale(1.1,1.1);-o-transform:scale(1.1,1.1);-ms-transform:scale(1.1,1.1);transform:scale(1.1,1.1)}
files/third-party/tooltipster/js/html5.js DELETED
@@ -1,8 +0,0 @@
1
- /*
2
- HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3
- */
4
- (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
5
- a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
6
- c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
7
- "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
8
- if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
 
 
 
 
 
 
 
 
files/third-party/tooltipster/js/html5.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(w,C){function v(){var e=D.elements;return"string"==typeof e?e.split(" "):e}function z(f){var e=u[f[d]];e||(e={},A++,f[d]=A,u[A]=e);return e}function c(f,e,g){e||(e=C);if(B){return e.createElement(f)}g||(g=z(e));e=g.cache[f]?g.cache[f].cloneNode():a.test(f)?(g.cache[f]=g.createElem(f)).cloneNode():g.createElem(f);return e.canHaveChildren&&!F.test(f)?g.frag.appendChild(e):e}function E(f,e){if(!e.cache){e.cache={},e.createElem=f.createElement,e.createFrag=f.createDocumentFragment,e.frag=e.createFrag()}f.createElement=function(g){return !D.shivMethods?e.createElem(g):c(g,f,e)};f.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+v().join().replace(/[\w\-]+/g,function(g){e.createElem(g);e.frag.createElement(g);return'c("'+g+'")'})+");return n}")(D,e.frag)}function b(f){f||(f=C);var e=z(f);if(D.shivCSS&&!y&&!e.hasCSS){var h,g=f;h=g.createElement("p");g=g.getElementsByTagName("head")[0]||g.documentElement;h.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";h=g.insertBefore(h.lastChild,g.firstChild);e.hasCSS=!!h}B||E(f,e);return f}var x=w.html5||{},F=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,a=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,y,d="_html5shiv",A=0,u={},B;(function(){try{var f=C.createElement("a");f.innerHTML="<xyz></xyz>";y="hidden" in f;var e;if(!(e=1==f.childNodes.length)){C.createElement("a");var h=C.createDocumentFragment();e="undefined"==typeof h.cloneNode||"undefined"==typeof h.createDocumentFragment||"undefined"==typeof h.createElement}B=e}catch(g){B=y=!0}})();var D={elements:x.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==x.shivCSS,supportsUnknownElements:B,shivMethods:!1!==x.shivMethods,type:"default",shivDocument:b,createElement:c,createDocumentFragment:function(g,f){g||(g=C);if(B){return g.createDocumentFragment()}for(var f=f||z(g),l=f.frag.cloneNode(),k=0,j=v(),i=j.length;k<i;k++){l.createElement(j[k])}return l}};w.html5=D;b(C)})(this,document);
includes/wc-db-helper.php CHANGED
@@ -140,9 +140,9 @@ class WC_DB_Helper {
140
  $phrase_value = $phrase_value[WC_Helper::$datetime][0];
141
  }
142
  if ($this->is_phrase_exists($phrase_key)) {
143
- $sql = $this->db->prepare("UPDATE `" . $this->phrases . "` SET `phrase_value` = %s WHERE `phrase_key` = %s;", $phrase_value, $phrase_key);
144
  } else {
145
- $sql = $this->db->prepare("INSERT INTO `" . $this->phrases . "`(`phrase_key`, `phrase_value`)VALUES(%s, %s);", $phrase_key, $phrase_value);
146
  }
147
  $this->db->query($sql);
148
  }
140
  $phrase_value = $phrase_value[WC_Helper::$datetime][0];
141
  }
142
  if ($this->is_phrase_exists($phrase_key)) {
143
+ $sql = $this->db->prepare("UPDATE `" . $this->phrases . "` SET `phrase_value` = %s WHERE `phrase_key` = %s;", str_replace('"','&#34;',$phrase_value), $phrase_key);
144
  } else {
145
+ $sql = $this->db->prepare("INSERT INTO `" . $this->phrases . "`(`phrase_key`, `phrase_value`)VALUES(%s, %s);", $phrase_key, str_replace('"','&#34;',$phrase_value));
146
  }
147
  $this->db->query($sql);
148
  }
languages/wpdiscuz-ru_RU.po CHANGED
@@ -298,7 +298,7 @@ msgstr "Управление Подпиской"
298
 
299
  #: options-templates/options-template-phrases.php:126
300
  msgid "Notify on new comments (checkbox)"
301
- msgstr "Сообщать о новых комментариях (галочка)"
302
 
303
  #: options-templates/options-template-phrases.php:130
304
  msgid "Notify of all new follow-up comments"
@@ -306,7 +306,7 @@ msgstr "Сообщать о всех последующих комментари
306
 
307
  #: options-templates/options-template-phrases.php:137
308
  msgid "Notify on all new replies (checkbox)"
309
- msgstr "Сообщать об ответах (галочка)"
310
 
311
  #: options-templates/options-template-phrases.php:141
312
  msgid "Notify of new replies to all my comments"
298
 
299
  #: options-templates/options-template-phrases.php:126
300
  msgid "Notify on new comments (checkbox)"
301
+ msgstr "Сообщать о новых ответах на этот коментарий (галочка)"
302
 
303
  #: options-templates/options-template-phrases.php:130
304
  msgid "Notify of all new follow-up comments"
306
 
307
  #: options-templates/options-template-phrases.php:137
308
  msgid "Notify on all new replies (checkbox)"
309
+ msgstr "Сообщать об ответах на все мои коментарии (галочка)"
310
 
311
  #: options-templates/options-template-phrases.php:141
312
  msgid "Notify of new replies to all my comments"
options/options-layouts/settings-general.php CHANGED
@@ -41,6 +41,28 @@
41
  </td>
42
  </tr>
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <tr valign="top">
45
  <th scope="row">
46
  <?php _e('Show the latest comments on', WC_Core::$TEXT_DOMAIN); ?>
41
  </td>
42
  </tr>
43
 
44
+ <tr valign="top">
45
+ <th scope="row" style="width:55%">
46
+ <?php _e('Comment author must fill out name', WC_Core::$TEXT_DOMAIN); ?>
47
+ </th>
48
+ <td>
49
+ <label for="wc_is_name_field_required">
50
+ <input type="checkbox" <?php checked($this->wc_options_serialized->wc_is_name_field_required == 1) ?> value="1" name="wc_is_name_field_required" id="wc_is_name_field_required" />
51
+ </label>
52
+ </td>
53
+ </tr>
54
+
55
+ <tr valign="top">
56
+ <th scope="row" style="width:55%">
57
+ <?php _e('Comment author must fill out email', WC_Core::$TEXT_DOMAIN); ?>
58
+ </th>
59
+ <td>
60
+ <label for="wc_is_email_field_required">
61
+ <input type="checkbox" <?php checked($this->wc_options_serialized->wc_is_email_field_required == 1) ?> value="1" name="wc_is_email_field_required" id="wc_is_email_field_required" />
62
+ </label>
63
+ </td>
64
+ </tr>
65
+
66
  <tr valign="top">
67
  <th scope="row">
68
  <?php _e('Show the latest comments on', WC_Core::$TEXT_DOMAIN); ?>
options/options-layouts/settings-show-hide.php CHANGED
@@ -12,7 +12,6 @@
12
  </label>
13
  </td>
14
  </tr>
15
-
16
  <tr valign="top">
17
  <th scope="row">
18
  <?php _e('Hide Reply button for Guests', WC_Core::$TEXT_DOMAIN); ?>
@@ -23,7 +22,6 @@
23
  </label>
24
  </td>
25
  </tr>
26
-
27
  <tr valign="top">
28
  <th scope="row">
29
  <?php _e('Hide Reply button for Members', WC_Core::$TEXT_DOMAIN); ?>
@@ -34,40 +32,36 @@
34
  </label>
35
  </td>
36
  </tr>
37
-
38
  <tr valign="top">
39
  <th scope="row">
40
  <?php _e('Hide Author Titles', WC_Core::$TEXT_DOMAIN); ?>
41
  </th>
42
  <td>
43
  <label for="wc_author_titles_show_hide">
44
- <input type="checkbox" <?php checked($this->wc_options_serialized->wc_author_titles_show_hide == 1) ?> value="1" name="wc_author_titles_show_hide" id="wc_author_titles_show_hide" />
45
  </label>
46
  </td>
47
  </tr>
48
-
49
  <tr valign="top">
50
  <th scope="row">
51
  <?php _e('Hide Voting buttons', WC_Core::$TEXT_DOMAIN); ?>
52
  </th>
53
  <td>
54
  <label for="wc_voting_buttons_show_hide">
55
- <input type="checkbox" <?php checked($this->wc_options_serialized->wc_voting_buttons_show_hide == 1) ?> value="1" name="wc_voting_buttons_show_hide" id="wc_voting_buttons_show_hide" />
56
  </label>
57
  </td>
58
  </tr>
59
-
60
  <tr valign="top">
61
  <th scope="row">
62
- <?php _e('Hide Share Button', WC_Core::$TEXT_DOMAIN); ?>
63
  </th>
64
  <td>
65
  <label for="wc_share_buttons_show_hide">
66
- <input type="checkbox" <?php checked($this->wc_options_serialized->wc_share_buttons_show_hide == 1) ?> value="1" name="wc_share_buttons_show_hide" id="wc_share_buttons_show_hide" />
67
  </label>
68
  </td>
69
  </tr>
70
-
71
  <tr valign="top">
72
  <th scope="row">
73
  <?php _e('Hide the CAPTCHA field', WC_Core::$TEXT_DOMAIN); ?>
@@ -75,11 +69,19 @@
75
  <td>
76
  <label for="wc_captcha_show_hide">
77
  <input type="checkbox" <?php checked($this->wc_options_serialized->wc_captcha_show_hide == 1) ?> value="1" name="wc_captcha_show_hide" id="wc_captcha_show_hide" />
 
 
 
 
 
 
 
 
 
 
78
  </label>
79
  </td>
80
  </tr>
81
-
82
-
83
  </tbody>
84
  </table>
85
  </div>
12
  </label>
13
  </td>
14
  </tr>
 
15
  <tr valign="top">
16
  <th scope="row">
17
  <?php _e('Hide Reply button for Guests', WC_Core::$TEXT_DOMAIN); ?>
22
  </label>
23
  </td>
24
  </tr>
 
25
  <tr valign="top">
26
  <th scope="row">
27
  <?php _e('Hide Reply button for Members', WC_Core::$TEXT_DOMAIN); ?>
32
  </label>
33
  </td>
34
  </tr>
 
35
  <tr valign="top">
36
  <th scope="row">
37
  <?php _e('Hide Author Titles', WC_Core::$TEXT_DOMAIN); ?>
38
  </th>
39
  <td>
40
  <label for="wc_author_titles_show_hide">
41
+ <input type="checkbox" <?php checked($this->wc_options_serialized->wc_author_titles_show_hide == 1 ) ?> value="1" name="wc_author_titles_show_hide" id="wc_author_titles_show_hide" />
42
  </label>
43
  </td>
44
  </tr>
 
45
  <tr valign="top">
46
  <th scope="row">
47
  <?php _e('Hide Voting buttons', WC_Core::$TEXT_DOMAIN); ?>
48
  </th>
49
  <td>
50
  <label for="wc_voting_buttons_show_hide">
51
+ <input type="checkbox" <?php checked($this->wc_options_serialized->wc_voting_buttons_show_hide == 1 ) ?> value="1" name="wc_voting_buttons_show_hide" id="wc_voting_buttons_show_hide" />
52
  </label>
53
  </td>
54
  </tr>
 
55
  <tr valign="top">
56
  <th scope="row">
57
+ <?php _e('Hide Share Buttons', WC_Core::$TEXT_DOMAIN); ?>
58
  </th>
59
  <td>
60
  <label for="wc_share_buttons_show_hide">
61
+ <input type="checkbox" <?php checked($this->wc_options_serialized->wc_share_buttons_show_hide == 1 ) ?> value="1" name="wc_share_buttons_show_hide" id="wc_share_buttons_show_hide" />
62
  </label>
63
  </td>
64
  </tr>
 
65
  <tr valign="top">
66
  <th scope="row">
67
  <?php _e('Hide the CAPTCHA field', WC_Core::$TEXT_DOMAIN); ?>
69
  <td>
70
  <label for="wc_captcha_show_hide">
71
  <input type="checkbox" <?php checked($this->wc_options_serialized->wc_captcha_show_hide == 1) ?> value="1" name="wc_captcha_show_hide" id="wc_captcha_show_hide" />
72
+ </label>
73
+ </td>
74
+ </tr>
75
+ <tr valign="top">
76
+ <th scope="row">
77
+ <?php _e('Hide the Website URL field', WC_Core::$TEXT_DOMAIN); ?>
78
+ </th>
79
+ <td>
80
+ <label for="wc_weburl_show_hide">
81
+ <input type="checkbox" <?php checked($this->wc_options_serialized->wc_weburl_show_hide == 1) ?> value="1" name="wc_weburl_show_hide" id="wc_weburl_show_hide" />
82
  </label>
83
  </td>
84
  </tr>
 
 
85
  </tbody>
86
  </table>
87
  </div>
options/options-layouts/settings-social.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* 1. WordPress Social Login
3
+ 2. Social Login
4
+ 3 Super Socializer
5
+ 4. Social Connect
6
+ 5. uLogin
7
+ */
8
+ add_thickbox();
9
+ if (function_exists('wsl_render_auth_widget_in_comment_form')) {
10
+ $wc_social_plugin = '<tr valign="top"><td>WordPress Social Login</td><td><a href="options-general.php?page=wordpress-social-login" class="button button-primary">' . __('Settings', 'default') . '</a></td></tr>';
11
+ } else if (function_exists('the_champ_login_button')) {
12
+ $wc_social_plugin = '<tr valign="top"><td>Super Socializer</td><td><a href="admin.php?page=the-champ-social-login" class="button button-primary">' . __('Settings', 'default') . '</a></td></tr>';
13
+ } else if (function_exists('sc_render_comment_form_social_connect')) {
14
+ $wc_social_plugin = '<tr valign="top"><td>Social Connect</td><td><a href="options-general.php?page=social-connect-id" class="button button-primary">' . __('Settings', 'default') . '</a></td></tr>';
15
+ } else {
16
+ $plugins_directory = ABSPATH . 'wp-content/plugins/';
17
+ // wordpress social login
18
+ if (file_exists($plugins_directory . 'wordpress-social-login/')) {
19
+ $wc_wordpress_social_login_text = __('Activate', WC_Core::$TEXT_DOMAIN);
20
+ $wc_wordpress_social_login_link = 'admin.php?page=wpdiscuz_options_page&wc_social_action=wordpress-social-login';
21
+ $wc_wordpress_social_login_thickbox = '';
22
+ } else {
23
+ $wc_wordpress_social_login_text = __('View details/Install', WC_Core::$TEXT_DOMAIN);
24
+ $wc_wordpress_social_login_link = 'plugin-install.php?tab=plugin-information&plugin=wordpress-social-login&TB_iframe=true&width=772&height=342';
25
+ $wc_wordpress_social_login_thickbox = 'thickbox';
26
+ }
27
+ // super socializer
28
+ if (file_exists($plugins_directory . 'super-socializer/')) {
29
+ $wc_super_socializer_text = __('Activate', WC_Core::$TEXT_DOMAIN);
30
+ $wc_super_socializer_link = 'admin.php?page=wpdiscuz_options_page&wc_social_action=super-socializer';
31
+ $wc_super_socializer_thickbox = '';
32
+ } else {
33
+ $wc_super_socializer_text = __('View details/Install', WC_Core::$TEXT_DOMAIN);
34
+ $wc_super_socializer_link = 'plugin-install.php?tab=plugin-information&plugin=super-socializer&TB_iframe=true&width=772&height=342';
35
+ $wc_super_socializer_thickbox = 'thickbox';
36
+ }
37
+ // social connect
38
+ if (file_exists($plugins_directory . 'social-connect/')) {
39
+ $wc_social_connect_text = __('Activate', WC_Core::$TEXT_DOMAIN);
40
+ $wc_social_connect_link = 'admin.php?page=wpdiscuz_options_page&wc_social_action=social-connect';
41
+ $wc_social_connect_thickbox = '';
42
+ } else {
43
+ $wc_social_connect_text = __('View details/Install', WC_Core::$TEXT_DOMAIN);
44
+ $wc_social_connect_link = 'plugin-install.php?tab=plugin-information&plugin=social-connect&TB_iframe=true&width=772&height=342';
45
+ $wc_social_connect_thickbox = 'thickbox';
46
+ }
47
+
48
+ $wc_social_plugin = '<tr valign="top"><td>WordPress Social Login</td><td><a href="' . $wc_wordpress_social_login_link . '" class="button button-primary ' . $wc_wordpress_social_login_thickbox . '">' . $wc_wordpress_social_login_text . '</a></td></tr>';
49
+ $wc_social_plugin .= '<tr valign="top"><td>Super Socializer</td><td><a href="' . $wc_super_socializer_link . '" class="button button-primary ' . $wc_super_socializer_thickbox . '">' . $wc_super_socializer_text . '</a></td></tr>';
50
+ $wc_social_plugin .= '<tr valign="top"><td>Social Connect</td><td><a href="' . $wc_social_connect_link . '" class="button button-primary ' . $wc_social_connect_thickbox . '">' . $wc_social_connect_text . '</a></td></tr>';
51
+ }
52
+
53
+ if (isset($_GET['wc_social_action'])) {
54
+ $plugin_name = $_GET['wc_social_action'];
55
+ $wc_activation_redirect_url = '';
56
+ $wc_social_plugin_file = '';
57
+ switch ($plugin_name) {
58
+ case 'wordpress-social-login':
59
+ $wc_activation_redirect_url = 'options-general.php?page=wordpress-social-login';
60
+ $wc_social_plugin_file = 'wordpress-social-login/wp-social-login.php';
61
+ break;
62
+ case 'super-socializer':
63
+ $wc_activation_redirect_url = 'admin.php?page=the-champ-social-login';
64
+ $wc_social_plugin_file = 'super-socializer/super_socializer.php';
65
+ break;
66
+ case 'social-connect':
67
+ $wc_activation_redirect_url = 'options-general.php?page=social-connect-id';
68
+ $wc_social_plugin_file = 'social-connect/social-connect.php';
69
+ break;
70
+ }
71
+ activate_plugin($wc_social_plugin_file, $wc_activation_redirect_url);
72
+ }
73
+ ?>
74
+ <div>
75
+ <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Social Login', WC_Core::$TEXT_DOMAIN); ?> </h2>
76
+ <p style="padding-bottom:10px; padding-left:10px;">You can use one of these most popular Social Login Plugins to allow your visitors login and comment with Facebook, Twitter, Google+, Wordpress, VK, OK and lots of other social network service accounts. All social login buttons will be fully integrated with wpDiscuz comment forms. </p>
77
+ <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
78
+ <tbody>
79
+ <?php echo $wc_social_plugin; ?>
80
+ </tbody>
81
+ </table>
82
+ </div>
options/phrases-layout/phrases-comment.php CHANGED
@@ -22,6 +22,16 @@
22
  </label>
23
  </td>
24
  </tr>
 
 
 
 
 
 
 
 
 
 
25
  <tr valign="top">
26
  <th scope="row">
27
  <?php _e('Share On Facebook', WC_Core::$TEXT_DOMAIN); ?>
@@ -52,6 +62,26 @@
52
  </label>
53
  </td>
54
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  <tr valign="top" >
56
  <th scope="row">
57
  <?php _e('Hide Replies', WC_Core::$TEXT_DOMAIN); ?>
22
  </label>
23
  </td>
24
  </tr>
25
+ <tr valign="top">
26
+ <th scope="row">
27
+ <?php _e('Edit', WC_Core::$TEXT_DOMAIN); ?>
28
+ </th>
29
+ <td colspan="3">
30
+ <label for="wc_edit_text">
31
+ <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_edit_text']; ?>" name="wc_edit_text" id="wc_edit_text" />
32
+ </label>
33
+ </td>
34
+ </tr>
35
  <tr valign="top">
36
  <th scope="row">
37
  <?php _e('Share On Facebook', WC_Core::$TEXT_DOMAIN); ?>
62
  </label>
63
  </td>
64
  </tr>
65
+ <tr valign="top">
66
+ <th scope="row">
67
+ <?php _e('Share On vKontakte', WC_Core::$TEXT_DOMAIN); ?>
68
+ </th>
69
+ <td colspan="3">
70
+ <label for="wc_share_vk">
71
+ <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_share_vk']; ?>" name="wc_share_vk" id="wc_share_vk" />
72
+ </label>
73
+ </td>
74
+ </tr>
75
+ <tr valign="top">
76
+ <th scope="row">
77
+ <?php _e('Share On Odnoklassniki', WC_Core::$TEXT_DOMAIN); ?>
78
+ </th>
79
+ <td colspan="3">
80
+ <label for="wc_share_ok">
81
+ <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_share_ok']; ?>" name="wc_share_ok" id="wc_share_ok" />
82
+ </label>
83
+ </td>
84
+ </tr>
85
  <tr valign="top" >
86
  <th scope="row">
87
  <?php _e('Hide Replies', WC_Core::$TEXT_DOMAIN); ?>
options/phrases-layout/phrases-form.php CHANGED
@@ -38,10 +38,20 @@
38
  </th>
39
  <td colspan="3">
40
  <label for="wc_name_text">
41
- <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_name_text']; ?>" name="wc_name_text" id="wc_email_text" />
42
  </label>
43
  </td>
44
  </tr>
 
 
 
 
 
 
 
 
 
 
45
  <tr valign="top">
46
  <th scope="row">
47
  <?php _e('CAPTCHA Field', WC_Core::$TEXT_DOMAIN); ?>
38
  </th>
39
  <td colspan="3">
40
  <label for="wc_name_text">
41
+ <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_name_text']; ?>" name="wc_name_text" id="wc_name_text" />
42
  </label>
43
  </td>
44
  </tr>
45
+ <tr valign="top">
46
+ <th scope="row">
47
+ <?php _e('WebSite URL Field', WC_Core::$TEXT_DOMAIN); ?>
48
+ </th>
49
+ <td colspan="3">
50
+ <label for="wc_website_text">
51
+ <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_website_text']; ?>" name="wc_website_text" id="wc_website_text" />
52
+ </label>
53
+ </td>
54
+ </tr>
55
  <tr valign="top">
56
  <th scope="row">
57
  <?php _e('CAPTCHA Field', WC_Core::$TEXT_DOMAIN); ?>
options/phrases-layout/phrases-notification.php CHANGED
@@ -33,6 +33,16 @@
33
  </label>
34
  </td>
35
  </tr>
 
 
 
 
 
 
 
 
 
 
36
  <tr valign="top">
37
  <th scope="row">
38
  <?php _e('You must be', WC_Core::$TEXT_DOMAIN); ?>
33
  </label>
34
  </td>
35
  </tr>
36
+ <tr valign="top">
37
+ <th scope="row">
38
+ <?php _e('Error message for invalid website url field', WC_Core::$TEXT_DOMAIN); ?>
39
+ </th>
40
+ <td colspan="3">
41
+ <label for="wc_error_url_text">
42
+ <input type="text" value="<?php echo $this->wc_options_serialized->wc_phrases['wc_error_url_text']; ?>" name="wc_error_url_text" id="wc_error_url_text" />
43
+ </label>
44
+ </td>
45
+ </tr>
46
  <tr valign="top">
47
  <th scope="row">
48
  <?php _e('You must be', WC_Core::$TEXT_DOMAIN); ?>
options/wc-options-serialize.php CHANGED
@@ -44,6 +44,14 @@ class WC_Options_Serialize {
44
  */
45
  public $wc_comment_editable_time;
46
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Type - Checkbox
49
  * Available Values - Checked/Unchecked
@@ -84,6 +92,14 @@ class WC_Options_Serialize {
84
  */
85
  public $wc_captcha_show_hide;
86
 
 
 
 
 
 
 
 
 
87
  /**
88
  * Type - Radiobutton
89
  * Available Values - Yes/No
@@ -94,6 +110,22 @@ class WC_Options_Serialize {
94
  */
95
  public $wc_user_must_be_registered;
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  /**
98
  * Type - Checkbox
99
  * Available Values - Checked/Unchecked
@@ -291,14 +323,6 @@ class WC_Options_Serialize {
291
  */
292
  public $wc_show_plugin_powerid_by;
293
 
294
- /**
295
- * Type - Dropdown menu
296
- * Available Values - list of pages (ids)
297
- * Description - Redirect first commenter to the selected page
298
- * Default Value - 0
299
- */
300
- public $wpdiscuz_redirect_page;
301
-
302
  function __construct($wc_db_helper) {
303
  $this->wc_db_helper = $wc_db_helper;
304
  $this->init_phrases();
@@ -320,7 +344,10 @@ class WC_Options_Serialize {
320
  $this->wc_voting_buttons_show_hide = $options['wc_voting_buttons_show_hide'];
321
  $this->wc_share_buttons_show_hide = $options['wc_share_buttons_show_hide'];
322
  $this->wc_captcha_show_hide = $options['wc_captcha_show_hide'];
 
323
  $this->wc_user_must_be_registered = $options['wc_user_must_be_registered'];
 
 
324
  $this->wc_show_hide_loggedin_username = isset($options['wc_show_hide_loggedin_username']) ? $options['wc_show_hide_loggedin_username'] : 0;
325
  $this->wc_reply_button_guests_show_hide = $options['wc_reply_button_guests_show_hide'];
326
  $this->wc_reply_button_members_show_hide = $options['wc_reply_button_members_show_hide'];
@@ -360,6 +387,7 @@ class WC_Options_Serialize {
360
  'wc_comment_join_text' => __('Join the discussion', WC_Core::$TEXT_DOMAIN),
361
  'wc_email_text' => __('Email', WC_Core::$TEXT_DOMAIN),
362
  'wc_name_text' => __('Name', WC_Core::$TEXT_DOMAIN),
 
363
  'wc_captcha_text' => __('Please insert the code above to comment', WC_Core::$TEXT_DOMAIN),
364
  'wc_submit_text' => __('Post Comment', WC_Core::$TEXT_DOMAIN),
365
  'wc_manage_subscribtions' => __('Manage Subscriptions', WC_Core::$TEXT_DOMAIN),
@@ -371,9 +399,12 @@ class WC_Options_Serialize {
371
  'wc_load_rest_comments_submit_text' => __('Load Rest of Comments', WC_Core::$TEXT_DOMAIN),
372
  'wc_reply_text' => __('Reply', WC_Core::$TEXT_DOMAIN),
373
  'wc_share_text' => __('Share', WC_Core::$TEXT_DOMAIN),
 
374
  'wc_share_facebook' => __('Share On Facebook', WC_Core::$TEXT_DOMAIN),
375
  'wc_share_twitter' => __('Share On Twitter', WC_Core::$TEXT_DOMAIN),
376
  'wc_share_google' => __('Share On Google', WC_Core::$TEXT_DOMAIN),
 
 
377
  'wc_hide_replies_text' => __('Hide Replies', WC_Core::$TEXT_DOMAIN),
378
  'wc_show_replies_text' => __('Show Replies', WC_Core::$TEXT_DOMAIN),
379
  'wc_user_title_guest_text' => __('Guest', WC_Core::$TEXT_DOMAIN),
@@ -396,6 +427,7 @@ class WC_Options_Serialize {
396
  'wc_confirm_email_message' => __('Hi, <br/> You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you\'ve chosen. <br/> To activate, click confirm below. If you believe this is an error, ignore this message and we\'ll never bother you again.', WC_Core::$TEXT_DOMAIN),
397
  'wc_error_empty_text' => __('please fill out this field to comment', WC_Core::$TEXT_DOMAIN),
398
  'wc_error_email_text' => __('email address is invalid', WC_Core::$TEXT_DOMAIN),
 
399
  'wc_year_text' => array('datetime' => array(__('year', WC_Core::$TEXT_DOMAIN), 1)),
400
  'wc_year_text_plural' => array('datetime' => array(__('years', WC_Core::$TEXT_DOMAIN), 1)), // PLURAL
401
  'wc_month_text' => array('datetime' => array(__('month', WC_Core::$TEXT_DOMAIN), 2)),
@@ -428,7 +460,7 @@ class WC_Options_Serialize {
428
  'wc_invalid_field' => __('Some of field value is invalid', WC_Core::$TEXT_DOMAIN),
429
  'wc_new_comment_button_text' => __('new comment', WC_Core::$TEXT_DOMAIN),
430
  'wc_new_comments_button_text' => __('new comments', WC_Core::$TEXT_DOMAIN), // PLURAL
431
- 'wc_held_for_moderate' => __('Your Comment awaiting moderation', WC_Core::$TEXT_DOMAIN),
432
  'wc_new_reply_button_text' => __('new reply on your comment', WC_Core::$TEXT_DOMAIN),
433
  'wc_new_replies_button_text' => __('new replies on your comments', WC_Core::$TEXT_DOMAIN), // PLURAL
434
  'wc_new_comments_text' => __('New', WC_Core::$TEXT_DOMAIN),
@@ -453,7 +485,10 @@ class WC_Options_Serialize {
453
  'wc_voting_buttons_show_hide' => $this->wc_voting_buttons_show_hide,
454
  'wc_share_buttons_show_hide' => $this->wc_share_buttons_show_hide,
455
  'wc_captcha_show_hide' => $this->wc_captcha_show_hide,
 
456
  'wc_user_must_be_registered' => $this->wc_user_must_be_registered,
 
 
457
  'wc_show_hide_loggedin_username' => $this->wc_show_hide_loggedin_username,
458
  'wc_reply_button_guests_show_hide' => $this->wc_reply_button_guests_show_hide,
459
  'wc_reply_button_members_show_hide' => $this->wc_reply_button_members_show_hide,
@@ -499,7 +534,10 @@ class WC_Options_Serialize {
499
  'wc_voting_buttons_show_hide' => '0',
500
  'wc_share_buttons_show_hide' => '0',
501
  'wc_captcha_show_hide' => '0',
 
502
  'wc_user_must_be_registered' => '0',
 
 
503
  'wc_show_hide_loggedin_username' => '1',
504
  'wc_reply_button_guests_show_hide' => '0',
505
  'wc_reply_button_members_show_hide' => '0',
@@ -521,7 +559,7 @@ class WC_Options_Serialize {
521
  'wc_vote_reply_color' => '#666666',
522
  'wc_input_border_color' => '#d9d9d9',
523
  'wc_new_loaded_comment_bg_color' => 'rgb(255,250,214)',
524
- 'wc_custom_css' => '.comments-area{width:auto; margin: 0 auto;}',
525
  'wc_show_plugin_powerid_by' => '0'
526
  );
527
  add_option($this->wc_options_slug, serialize($options));
@@ -533,4 +571,4 @@ class WC_Options_Serialize {
533
  }
534
  }
535
 
536
- }
44
  */
45
  public $wc_comment_editable_time;
46
 
47
+ /**
48
+ * Type - Dropdown menu
49
+ * Available Values - list of pages (ids)
50
+ * Description - Redirect first commenter to the selected page
51
+ * Default Value - 0
52
+ */
53
+ public $wpdiscuz_redirect_page;
54
+
55
  /**
56
  * Type - Checkbox
57
  * Available Values - Checked/Unchecked
92
  */
93
  public $wc_captcha_show_hide;
94
 
95
+ /*
96
+ * Type - Checkbox
97
+ * Available Values - Checked/Unchecked
98
+ * Description - Show/Hide the Web URL field
99
+ * Default Value - Unchecked
100
+ */
101
+ public $wc_weburl_show_hide;
102
+
103
  /**
104
  * Type - Radiobutton
105
  * Available Values - Yes/No
110
  */
111
  public $wc_user_must_be_registered;
112
 
113
+ /**
114
+ * Type - Checkbox
115
+ * Available Values - Checked/Unchecked
116
+ * Description - If checked user must fill this field
117
+ * Default Value - Checked
118
+ */
119
+ public $wc_is_name_field_required;
120
+
121
+ /**
122
+ * Type - Checkbox
123
+ * Available Values - Checked/Unchecked
124
+ * Description - If checked user must fill this field
125
+ * Default Value - Checked
126
+ */
127
+ public $wc_is_email_field_required;
128
+
129
  /**
130
  * Type - Checkbox
131
  * Available Values - Checked/Unchecked
323
  */
324
  public $wc_show_plugin_powerid_by;
325
 
 
 
 
 
 
 
 
 
326
  function __construct($wc_db_helper) {
327
  $this->wc_db_helper = $wc_db_helper;
328
  $this->init_phrases();
344
  $this->wc_voting_buttons_show_hide = $options['wc_voting_buttons_show_hide'];
345
  $this->wc_share_buttons_show_hide = $options['wc_share_buttons_show_hide'];
346
  $this->wc_captcha_show_hide = $options['wc_captcha_show_hide'];
347
+ $this->wc_weburl_show_hide = isset($options['wc_weburl_show_hide']) ? $options['wc_weburl_show_hide'] : 0;
348
  $this->wc_user_must_be_registered = $options['wc_user_must_be_registered'];
349
+ $this->wc_is_name_field_required = isset($options['wc_is_name_field_required']) ? $options['wc_is_name_field_required'] : 0;
350
+ $this->wc_is_email_field_required = isset($options['wc_is_email_field_required']) ? $options['wc_is_email_field_required'] : 0;
351
  $this->wc_show_hide_loggedin_username = isset($options['wc_show_hide_loggedin_username']) ? $options['wc_show_hide_loggedin_username'] : 0;
352
  $this->wc_reply_button_guests_show_hide = $options['wc_reply_button_guests_show_hide'];
353
  $this->wc_reply_button_members_show_hide = $options['wc_reply_button_members_show_hide'];
387
  'wc_comment_join_text' => __('Join the discussion', WC_Core::$TEXT_DOMAIN),
388
  'wc_email_text' => __('Email', WC_Core::$TEXT_DOMAIN),
389
  'wc_name_text' => __('Name', WC_Core::$TEXT_DOMAIN),
390
+ 'wc_website_text' => __('WebSite URL', WC_Core::$TEXT_DOMAIN),
391
  'wc_captcha_text' => __('Please insert the code above to comment', WC_Core::$TEXT_DOMAIN),
392
  'wc_submit_text' => __('Post Comment', WC_Core::$TEXT_DOMAIN),
393
  'wc_manage_subscribtions' => __('Manage Subscriptions', WC_Core::$TEXT_DOMAIN),
399
  'wc_load_rest_comments_submit_text' => __('Load Rest of Comments', WC_Core::$TEXT_DOMAIN),
400
  'wc_reply_text' => __('Reply', WC_Core::$TEXT_DOMAIN),
401
  'wc_share_text' => __('Share', WC_Core::$TEXT_DOMAIN),
402
+ 'wc_edit_text' => __('Edit', WC_Core::$TEXT_DOMAIN),
403
  'wc_share_facebook' => __('Share On Facebook', WC_Core::$TEXT_DOMAIN),
404
  'wc_share_twitter' => __('Share On Twitter', WC_Core::$TEXT_DOMAIN),
405
  'wc_share_google' => __('Share On Google', WC_Core::$TEXT_DOMAIN),
406
+ 'wc_share_vk' => __('Share On vKontakte', WC_Core::$TEXT_DOMAIN),
407
+ 'wc_share_ok' => __('Share On Odnoklassniki', WC_Core::$TEXT_DOMAIN),
408
  'wc_hide_replies_text' => __('Hide Replies', WC_Core::$TEXT_DOMAIN),
409
  'wc_show_replies_text' => __('Show Replies', WC_Core::$TEXT_DOMAIN),
410
  'wc_user_title_guest_text' => __('Guest', WC_Core::$TEXT_DOMAIN),
427
  'wc_confirm_email_message' => __('Hi, <br/> You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you\'ve chosen. <br/> To activate, click confirm below. If you believe this is an error, ignore this message and we\'ll never bother you again.', WC_Core::$TEXT_DOMAIN),
428
  'wc_error_empty_text' => __('please fill out this field to comment', WC_Core::$TEXT_DOMAIN),
429
  'wc_error_email_text' => __('email address is invalid', WC_Core::$TEXT_DOMAIN),
430
+ 'wc_error_url_text' => __('url is invalid', WC_Core::$TEXT_DOMAIN),
431
  'wc_year_text' => array('datetime' => array(__('year', WC_Core::$TEXT_DOMAIN), 1)),
432
  'wc_year_text_plural' => array('datetime' => array(__('years', WC_Core::$TEXT_DOMAIN), 1)), // PLURAL
433
  'wc_month_text' => array('datetime' => array(__('month', WC_Core::$TEXT_DOMAIN), 2)),
460
  'wc_invalid_field' => __('Some of field value is invalid', WC_Core::$TEXT_DOMAIN),
461
  'wc_new_comment_button_text' => __('new comment', WC_Core::$TEXT_DOMAIN),
462
  'wc_new_comments_button_text' => __('new comments', WC_Core::$TEXT_DOMAIN), // PLURAL
463
+ 'wc_held_for_moderate' => __('Comment awaiting moderation', WC_Core::$TEXT_DOMAIN),
464
  'wc_new_reply_button_text' => __('new reply on your comment', WC_Core::$TEXT_DOMAIN),
465
  'wc_new_replies_button_text' => __('new replies on your comments', WC_Core::$TEXT_DOMAIN), // PLURAL
466
  'wc_new_comments_text' => __('New', WC_Core::$TEXT_DOMAIN),
485
  'wc_voting_buttons_show_hide' => $this->wc_voting_buttons_show_hide,
486
  'wc_share_buttons_show_hide' => $this->wc_share_buttons_show_hide,
487
  'wc_captcha_show_hide' => $this->wc_captcha_show_hide,
488
+ 'wc_weburl_show_hide' => $this->wc_weburl_show_hide,
489
  'wc_user_must_be_registered' => $this->wc_user_must_be_registered,
490
+ 'wc_is_name_field_required' => $this->wc_is_name_field_required,
491
+ 'wc_is_email_field_required' => $this->wc_is_email_field_required,
492
  'wc_show_hide_loggedin_username' => $this->wc_show_hide_loggedin_username,
493
  'wc_reply_button_guests_show_hide' => $this->wc_reply_button_guests_show_hide,
494
  'wc_reply_button_members_show_hide' => $this->wc_reply_button_members_show_hide,
534
  'wc_voting_buttons_show_hide' => '0',
535
  'wc_share_buttons_show_hide' => '0',
536
  'wc_captcha_show_hide' => '0',
537
+ 'wc_weburl_show_hide' => '1',
538
  'wc_user_must_be_registered' => '0',
539
+ 'wc_is_name_field_required' => '1',
540
+ 'wc_is_email_field_required' => '1',
541
  'wc_show_hide_loggedin_username' => '1',
542
  'wc_reply_button_guests_show_hide' => '0',
543
  'wc_reply_button_members_show_hide' => '0',
559
  'wc_vote_reply_color' => '#666666',
560
  'wc_input_border_color' => '#d9d9d9',
561
  'wc_new_loaded_comment_bg_color' => 'rgb(255,250,214)',
562
+ 'wc_custom_css' => '.comments-area{width:auto;}',
563
  'wc_show_plugin_powerid_by' => '0'
564
  );
565
  add_option($this->wc_options_slug, serialize($options));
571
  }
572
  }
573
 
574
+ }
options/wc-options.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  class WC_Options {
4
 
5
  public $wc_options_serialized;
@@ -44,7 +43,10 @@ class WC_Options {
44
  $this->wc_options_serialized->wc_voting_buttons_show_hide = isset($_POST['wc_voting_buttons_show_hide']) ? $_POST['wc_voting_buttons_show_hide'] : 0;
45
  $this->wc_options_serialized->wc_share_buttons_show_hide = isset($_POST['wc_share_buttons_show_hide']) ? $_POST['wc_share_buttons_show_hide'] : 0;
46
  $this->wc_options_serialized->wc_captcha_show_hide = isset($_POST['wc_captcha_show_hide']) ? $_POST['wc_captcha_show_hide'] : 0;
 
47
  $this->wc_options_serialized->wc_user_must_be_registered = isset($_POST['wc_user_must_be_registered']) ? $_POST['wc_user_must_be_registered'] : 0;
 
 
48
  $this->wc_options_serialized->wc_show_hide_loggedin_username = isset($_POST['wc_show_hide_loggedin_username']) ? $_POST['wc_show_hide_loggedin_username'] : 0;
49
  $this->wc_options_serialized->wc_reply_button_guests_show_hide = isset($_POST['wc_reply_button_guests_show_hide']) ? $_POST['wc_reply_button_guests_show_hide'] : 0;
50
  $this->wc_options_serialized->wc_reply_button_members_show_hide = isset($_POST['wc_reply_button_members_show_hide']) ? $_POST['wc_reply_button_members_show_hide'] : 0;
@@ -175,6 +177,7 @@ class WC_Options {
175
  <li><?php _e('Show/Hide Components', WC_Core::$TEXT_DOMAIN); ?></li>
176
  <li><?php _e('Email Subscription', WC_Core::$TEXT_DOMAIN); ?> <?php if (class_exists('Prompt_Comment_Form_Handling')): ?> <?php _e('and Postmatic', WC_Core::$TEXT_DOMAIN); ?> <?php endif; ?></li>
177
  <li><?php _e('Background and Colors', WC_Core::$TEXT_DOMAIN); ?></li>
 
178
  </ul>
179
  <div class="resp-tabs-container hor_1">
180
  <?php
@@ -183,6 +186,7 @@ class WC_Options {
183
  include 'options-layouts/settings-show-hide.php';
184
  include 'options-layouts/settings-subscription.php';
185
  include 'options-layouts/settings-style.php';
 
186
  ?>
187
  </div>
188
  </div>
@@ -237,6 +241,7 @@ class WC_Options {
237
  $this->wc_options_serialized->wc_phrases['wc_comment_join_text'] = $_POST['wc_comment_join_text'];
238
  $this->wc_options_serialized->wc_phrases['wc_email_text'] = $_POST['wc_email_text'];
239
  $this->wc_options_serialized->wc_phrases['wc_name_text'] = $_POST['wc_name_text'];
 
240
  $this->wc_options_serialized->wc_phrases['wc_captcha_text'] = $_POST['wc_captcha_text'];
241
  $this->wc_options_serialized->wc_phrases['wc_submit_text'] = $_POST['wc_submit_text'];
242
  $this->wc_options_serialized->wc_phrases['wc_manage_subscribtions'] = $_POST['wc_manage_subscribtions'];
@@ -248,9 +253,12 @@ class WC_Options {
248
  $this->wc_options_serialized->wc_phrases['wc_load_rest_comments_submit_text'] = $_POST['wc_load_rest_comments_submit_text'];
249
  $this->wc_options_serialized->wc_phrases['wc_reply_text'] = $_POST['wc_reply_text'];
250
  $this->wc_options_serialized->wc_phrases['wc_share_text'] = $_POST['wc_share_text'];
 
251
  $this->wc_options_serialized->wc_phrases['wc_share_facebook'] = $_POST['wc_share_facebook'];
252
  $this->wc_options_serialized->wc_phrases['wc_share_twitter'] = $_POST['wc_share_twitter'];
253
  $this->wc_options_serialized->wc_phrases['wc_share_google'] = $_POST['wc_share_google'];
 
 
254
  $this->wc_options_serialized->wc_phrases['wc_hide_replies_text'] = $_POST['wc_hide_replies_text'];
255
  $this->wc_options_serialized->wc_phrases['wc_show_replies_text'] = $_POST['wc_show_replies_text'];
256
  $this->wc_options_serialized->wc_phrases['wc_user_title_guest_text'] = $_POST['wc_user_title_guest_text'];
@@ -273,6 +281,7 @@ class WC_Options {
273
  $this->wc_options_serialized->wc_phrases['wc_confirm_email_message'] = $_POST['wc_confirm_email_message'];
274
  $this->wc_options_serialized->wc_phrases['wc_error_empty_text'] = $_POST['wc_error_empty_text'];
275
  $this->wc_options_serialized->wc_phrases['wc_error_email_text'] = $_POST['wc_error_email_text'];
 
276
  $this->wc_options_serialized->wc_phrases['wc_year_text']['datetime'][0] = $_POST['wc_year_text'];
277
  $this->wc_options_serialized->wc_phrases['wc_year_text_plural']['datetime'][0] = $_POST['wc_year_text_plural'];
278
  $this->wc_options_serialized->wc_phrases['wc_month_text']['datetime'][0] = $_POST['wc_month_text'];
1
  <?php
 
2
  class WC_Options {
3
 
4
  public $wc_options_serialized;
43
  $this->wc_options_serialized->wc_voting_buttons_show_hide = isset($_POST['wc_voting_buttons_show_hide']) ? $_POST['wc_voting_buttons_show_hide'] : 0;
44
  $this->wc_options_serialized->wc_share_buttons_show_hide = isset($_POST['wc_share_buttons_show_hide']) ? $_POST['wc_share_buttons_show_hide'] : 0;
45
  $this->wc_options_serialized->wc_captcha_show_hide = isset($_POST['wc_captcha_show_hide']) ? $_POST['wc_captcha_show_hide'] : 0;
46
+ $this->wc_options_serialized->wc_weburl_show_hide = isset($_POST['wc_weburl_show_hide']) ? $_POST['wc_weburl_show_hide'] : 0;
47
  $this->wc_options_serialized->wc_user_must_be_registered = isset($_POST['wc_user_must_be_registered']) ? $_POST['wc_user_must_be_registered'] : 0;
48
+ $this->wc_options_serialized->wc_is_name_field_required = isset($_POST['wc_is_name_field_required']) ? $_POST['wc_is_name_field_required'] : 0;
49
+ $this->wc_options_serialized->wc_is_email_field_required = isset($_POST['wc_is_email_field_required']) ? $_POST['wc_is_email_field_required'] : 0;
50
  $this->wc_options_serialized->wc_show_hide_loggedin_username = isset($_POST['wc_show_hide_loggedin_username']) ? $_POST['wc_show_hide_loggedin_username'] : 0;
51
  $this->wc_options_serialized->wc_reply_button_guests_show_hide = isset($_POST['wc_reply_button_guests_show_hide']) ? $_POST['wc_reply_button_guests_show_hide'] : 0;
52
  $this->wc_options_serialized->wc_reply_button_members_show_hide = isset($_POST['wc_reply_button_members_show_hide']) ? $_POST['wc_reply_button_members_show_hide'] : 0;
177
  <li><?php _e('Show/Hide Components', WC_Core::$TEXT_DOMAIN); ?></li>
178
  <li><?php _e('Email Subscription', WC_Core::$TEXT_DOMAIN); ?> <?php if (class_exists('Prompt_Comment_Form_Handling')): ?> <?php _e('and Postmatic', WC_Core::$TEXT_DOMAIN); ?> <?php endif; ?></li>
179
  <li><?php _e('Background and Colors', WC_Core::$TEXT_DOMAIN); ?></li>
180
+ <li><?php _e('Social Login', WC_Core::$TEXT_DOMAIN); ?></li>
181
  </ul>
182
  <div class="resp-tabs-container hor_1">
183
  <?php
186
  include 'options-layouts/settings-show-hide.php';
187
  include 'options-layouts/settings-subscription.php';
188
  include 'options-layouts/settings-style.php';
189
+ include 'options-layouts/settings-social.php';
190
  ?>
191
  </div>
192
  </div>
241
  $this->wc_options_serialized->wc_phrases['wc_comment_join_text'] = $_POST['wc_comment_join_text'];
242
  $this->wc_options_serialized->wc_phrases['wc_email_text'] = $_POST['wc_email_text'];
243
  $this->wc_options_serialized->wc_phrases['wc_name_text'] = $_POST['wc_name_text'];
244
+ $this->wc_options_serialized->wc_phrases['wc_website_text'] = $_POST['wc_website_text'];
245
  $this->wc_options_serialized->wc_phrases['wc_captcha_text'] = $_POST['wc_captcha_text'];
246
  $this->wc_options_serialized->wc_phrases['wc_submit_text'] = $_POST['wc_submit_text'];
247
  $this->wc_options_serialized->wc_phrases['wc_manage_subscribtions'] = $_POST['wc_manage_subscribtions'];
253
  $this->wc_options_serialized->wc_phrases['wc_load_rest_comments_submit_text'] = $_POST['wc_load_rest_comments_submit_text'];
254
  $this->wc_options_serialized->wc_phrases['wc_reply_text'] = $_POST['wc_reply_text'];
255
  $this->wc_options_serialized->wc_phrases['wc_share_text'] = $_POST['wc_share_text'];
256
+ $this->wc_options_serialized->wc_phrases['wc_edit_text'] = $_POST['wc_edit_text'];
257
  $this->wc_options_serialized->wc_phrases['wc_share_facebook'] = $_POST['wc_share_facebook'];
258
  $this->wc_options_serialized->wc_phrases['wc_share_twitter'] = $_POST['wc_share_twitter'];
259
  $this->wc_options_serialized->wc_phrases['wc_share_google'] = $_POST['wc_share_google'];
260
+ $this->wc_options_serialized->wc_phrases['wc_share_vk'] = $_POST['wc_share_vk'];
261
+ $this->wc_options_serialized->wc_phrases['wc_share_ok'] = $_POST['wc_share_ok'];
262
  $this->wc_options_serialized->wc_phrases['wc_hide_replies_text'] = $_POST['wc_hide_replies_text'];
263
  $this->wc_options_serialized->wc_phrases['wc_show_replies_text'] = $_POST['wc_show_replies_text'];
264
  $this->wc_options_serialized->wc_phrases['wc_user_title_guest_text'] = $_POST['wc_user_title_guest_text'];
281
  $this->wc_options_serialized->wc_phrases['wc_confirm_email_message'] = $_POST['wc_confirm_email_message'];
282
  $this->wc_options_serialized->wc_phrases['wc_error_empty_text'] = $_POST['wc_error_empty_text'];
283
  $this->wc_options_serialized->wc_phrases['wc_error_email_text'] = $_POST['wc_error_email_text'];
284
+ $this->wc_options_serialized->wc_phrases['wc_error_url_text'] = $_POST['wc_error_url_text'];
285
  $this->wc_options_serialized->wc_phrases['wc_year_text']['datetime'][0] = $_POST['wc_year_text'];
286
  $this->wc_options_serialized->wc_phrases['wc_year_text_plural']['datetime'][0] = $_POST['wc_year_text_plural'];
287
  $this->wc_options_serialized->wc_phrases['wc_month_text']['datetime'][0] = $_POST['wc_month_text'];
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === wpDiscuz - Wordpress Comments ===
2
  Contributors: gVectors Team
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UC44WQM5XJFPA
4
- Tags: wordpress comments, ajax comments, ajax, live update, theme, post comments, comments box, community, discussion, discuss, comment form, reply, comments, discussions, comment template, activity, comment author, comment system, redirect, comment redirect, first commenter
5
  Requires at least: 2.7
6
- Tested up to: 4.2
7
- Stable tag: 2.1.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -32,6 +32,8 @@ New interactive, AJAX comment system. Responsive comment plugin with Live Update
32
  * | Responsive comments form and comment threads design
33
  * | Clean, simple and easy user interface and user experience
34
  * | Live update of new comments with notifier buttons
 
 
35
  * | Multi-level (nested) comment threads, with maximum levels depth setting option
36
  * | Allows to create a new discussion thread and reply to existing comment
37
  * | Ajax button "Load More Comments" instead of simple comments pagination
@@ -116,22 +118,37 @@ http://www.gvectors.com/questions/wpdiscuz-comment-form-is-missing/
116
 
117
  == Screenshots ==
118
 
119
- 1. wpDiscuz ajax comment form for Guests Screenshot #1
120
- 2. wpDiscuz ajax comment form for logged in user Screenshot #2
121
  3. Discussion Threads with Reply Form Screenshot #3
122
- 4. Live Update: checks for new comments and shows update buttons #4
123
- 5. Front-End View with different colors Screenshot #5
124
- 6. Full Front-End View Screenshot #6
125
- 7. wpDiscuz General Settings #7
 
126
 
127
 
128
  == Changelog ==
129
-
130
- = 2.1.10 =
131
- Fixed Bug: First comment redirection without setting the destination page
 
 
 
 
 
 
 
 
 
 
 
132
 
133
  IMPORTANT: If you have a Cache Plugin, please delete all caches after wpDiscuz update.
134
 
 
 
 
135
  = 2.1.9 =
136
  * Added: Option to redirect first commenters to "Thank You" page
137
  * Fixed Bug: Issues with guest voting (more secure and stable)
@@ -280,4 +297,4 @@ http://www.gvectors.com/questions/wpdiscuz-comment-form-is-missing/
280
  * Fixed Bug : Layout Issues with some themes
281
 
282
  = 1.0.0 =
283
- Initial version
1
  === wpDiscuz - Wordpress Comments ===
2
  Contributors: gVectors Team
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UC44WQM5XJFPA
4
+ Tags: wordpress comments, ajax comments, ajax, live update, theme, post comments, comments box, community, discussion, discuss, comment form, reply, comments, discussions, comment template, activity, comment author, comment system, redirect, comment redirect, first commenter, social login
5
  Requires at least: 2.7
6
+ Tested up to: 4.2.2
7
+ Stable tag: 2.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
32
  * | Responsive comments form and comment threads design
33
  * | Clean, simple and easy user interface and user experience
34
  * | Live update of new comments with notifier buttons
35
+ * | Anonymous comments ( name and email can be set as not required )
36
+ * | Social Network Login - Facebook, Twitter, Google+, Wordpress, VK, OK and others
37
  * | Multi-level (nested) comment threads, with maximum levels depth setting option
38
  * | Allows to create a new discussion thread and reply to existing comment
39
  * | Ajax button "Load More Comments" instead of simple comments pagination
118
 
119
  == Screenshots ==
120
 
121
+ 1. wpDiscuz ajax comment list for logged in user Screenshot #1
122
+ 2. wpDiscuz ajax comment list for guests Screenshot #2
123
  3. Discussion Threads with Reply Form Screenshot #3
124
+ 4. Comment editing #4
125
+ 5. Live Update: checks for new comments and shows update buttons #5
126
+ 6. wpDiscuz ajax comment form with social login buttons Screenshot #6
127
+ 7. Full Front-End View Screenshot #7
128
+ 8. wpDiscuz General Settings #8
129
 
130
 
131
  == Changelog ==
132
+ = 2.2.1 =
133
+ * Fixed Bug : Front-end Phrases don't suport Special Characters
134
+
135
+ = 2.2.0 =
136
+ * Added: Social Network Login:
137
+ Facebook, Google, Twitter, Wordpress, Vkontakte, Mail.ru, Yandex, Odnoklassniki, 500px, Windows Live, Yahoo!, LinkedIn, Reddit, Disqus, Tumblr, Stackoverflow, GitHub, Dribbble, Instagram, Foursquare, Steam, Twitch.tv, Mixi, Goodreads, Skyrock, Last.fm, AOL and PixelPin.
138
+ Integrated with WordPress Social Login, Super Socializer and Social Connect plugins.
139
+ * Added: New "WebSite" field in comment form
140
+ * Added: Anonymous commenting ( Name and Email can be optional )
141
+ * Added: VK.com and OK.ru social network share buttons
142
+ * Added: New {rel, target, ...} attributes for <a> link tag
143
+ * Added: CSS and JavaScrip file/code optimization and minifying
144
+ * Fixed Bug: Issues with comment editing
145
+ * Fixed Bug: Custom "Phrases" fail to display if apostrophes are used
146
 
147
  IMPORTANT: If you have a Cache Plugin, please delete all caches after wpDiscuz update.
148
 
149
+ = 2.1.10 =
150
+ * Fixed Bug: First comment redirection without setting the destination page
151
+
152
  = 2.1.9 =
153
  * Added: Option to redirect first commenters to "Thank You" page
154
  * Fixed Bug: Issues with guest voting (more secure and stable)
297
  * Fixed Bug : Layout Issues with some themes
298
 
299
  = 1.0.0 =
300
+ Initial version
wc.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: wpDiscuz - Wordpress Comments
5
  Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
- Version: 2.1.10
7
  Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  Author URI: http://www.gvectors.com/
9
  Plugin URI: http://www.gvectors.com/wpdiscuz/
@@ -56,7 +56,7 @@ class WC_Core {
56
 
57
  add_action('admin_enqueue_scripts', array(&$this, 'admin_page_styles_scripts'), 2315);
58
  add_action('wp_enqueue_scripts', array(&$this, 'front_end_styles_scripts'));
59
- add_action('wp_enqueue_scripts', array(&$this->wc_css, 'init_styles'));
60
 
61
  add_action('admin_menu', array(&$this, 'add_plugin_options_page'), -191);
62
 
@@ -199,45 +199,45 @@ class WC_Core {
199
  if (is_singular()) {
200
  $u_agent = $_SERVER['HTTP_USER_AGENT'];
201
 
202
- wp_register_style('wpdiscuz-frontend-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/wpdiscuz.css'));
203
  wp_enqueue_style('wpdiscuz-frontend-css');
204
 
205
  if (is_rtl()) {
206
- wp_register_style('wpdiscuz-frontend-rtl-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/wpdiscuz-rtl.css'));
207
  wp_enqueue_style('wpdiscuz-frontend-rtl-css');
208
  }
209
 
210
  if ($this->wc_options_serialized->wc_comment_list_update_type != 0) {
211
- wp_enqueue_script('wpdiscuz-jquery-ui', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/jquery-ui/jquery-ui.js'), array('jquery'), '1.11.2', false);
212
  }
213
 
214
  if (preg_match('/MSIE/i', $u_agent)) {
215
- wp_enqueue_script('wpdiscuz-html5-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/tooltipster/js/html5.js'), array('jquery'), '1.2', false);
216
 
217
- wp_register_style('wpdiscuz-modal-css-ie', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box-ie.css'));
218
  wp_enqueue_style('wpdiscuz-modal-css-ie');
219
  }
220
 
221
- wp_register_style('wpdiscuz-modal-box-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box.css'));
222
  wp_enqueue_style('wpdiscuz-modal-box-css');
223
 
224
- wp_enqueue_script('wpdiscuz-validator-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/validator.js'), array('jquery'), '1.0.0', false);
225
 
226
- wp_register_sty
3
  /*
4
  Plugin Name: wpDiscuz - Wordpress Comments
5
  Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
+ Version: 2.2.1
7
  Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  Author URI: http://www.gvectors.com/
9
  Plugin URI: http://www.gvectors.com/wpdiscuz/
56
 
57
  add_action('admin_enqueue_scripts', array(&$this, 'admin_page_styles_scripts'), 2315);
58
  add_action('wp_enqueue_scripts', array(&$this, 'front_end_styles_scripts'));
59
+ add_action('wp_head', array(&$this->wc_css, 'init_styles'));
60
 
61
  add_action('admin_menu', array(&$this, 'add_plugin_options_page'), -191);
62
 
199
  if (is_singular()) {
200
  $u_agent = $_SERVER['HTTP_USER_AGENT'];
201
 
202
+ wp_register_style('wpdiscuz-frontend-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/wpdiscuz.min.css'));
203
  wp_enqueue_style('wpdiscuz-frontend-css');
204
 
205
  if (is_rtl()) {
206
+ wp_register_style('wpdiscuz-frontend-rtl-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/wpdiscuz-rtl.min.css'));
207
  wp_enqueue_style('wpdiscuz-frontend-rtl-css');
208
  }
209
 
210
  if ($this->wc_options_serialized->wc_comment_list_update_type != 0) {
211
+ wp_enqueue_script('wpdiscuz-jquery-ui', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/jquery-ui/jquery-ui.min.js'), array('jquery'), '1.11.2', false);
212
  }
213
 
214
  if (preg_match('/MSIE/i', $u_agent)) {
215
+ wp_enqueue_script('wpdiscuz-html5-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/tooltipster/js/html5.min.js'), array('jquery'), '1.2', false);
216
 
217
+ wp_register_style('wpdiscuz-modal-css-ie', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box-ie.min.css'));
218
  wp_enqueue_style('wpdiscuz-modal-css-ie');
219
  }
220
 
221
+ wp_register_style('wpdiscuz-modal-box-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box.min.css'));
222
  wp_enqueue_style('wpdiscuz-modal-box-css');
223
 
224
+ wp_enqueue_script('wpdiscuz-validator-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/validator.min.js'), array('jquery'), '1.0.0', false);
225