Version Description
- December 28th 2020 =
New Features & Enhancements
- Added: Custom no access message for templates. #5875 (@JoryHogeveen)
- Added: New filter
pods_field_validate_{$type}
. #1106 (@JoryHogeveen)
Bug Fixes
- Fixed: Ensure compatibility with the WordPress 5.6 jQuery update. #5892, #5896 & #5897 (@JoryHogeveen)
- Fixed: Prevent
wp_unslash()
from unnecessarily over sanitizing input. #5040 & #4424 (@JoryHogeveen) - Fixed: Prevent issues with HTML entities in custom relationship values when it gets to JavaScript. #5894 (@JoryHogeveen)
- Fixed: Better support multiple languages in the Relationship AJAX search. #5888 (@JoryHogeveen)
- Fixed: Include the
post_type
value in attachment saves so that the more WordPress core actions trigger. #5748 (@JoryHogeveen) - Fixed: Allow
the_excerpt
to be used as custom filter on singular pages. #5899 (@JoryHogeveen) - Fixed: Better support caching of the avatar images/data and integrate with the
get_avatar_data
filter. #5771 (@JoryHogeveen)
Download this release
Release Info
Developer | sc0ttkclark |
Plugin | Pods – Custom Content Types and Fields |
Version | 2.7.25 |
Comparing to | |
See all releases |
Code changes from version 2.7.24 to 2.7.25
- classes/PodsAPI.php +20 -2
- classes/PodsField.php +21 -1
- classes/PodsI18n.php +33 -21
- classes/PodsInit.php +11 -10
- classes/PodsMeta.php +1 -1
- classes/fields/avatar.php +198 -38
- classes/fields/boolean.php +9 -3
- classes/fields/color.php +6 -1
- classes/fields/datetime.php +14 -2
- classes/fields/email.php +6 -1
- classes/fields/file.php +7 -1
- classes/fields/link.php +5 -1
- classes/fields/number.php +14 -2
- classes/fields/oembed.php +6 -1
- classes/fields/password.php +6 -1
- classes/fields/phone.php +6 -1
- classes/fields/pick.php +16 -3
- classes/fields/text.php +6 -1
- classes/fields/website.php +7 -1
- components/Templates/Templates.php +26 -2
- components/Templates/includes/auto-template/Pods_Templates_Auto_Template_Front_End.php +2 -9
- includes/general.php +1 -1
- init.php +2 -2
- readme.txt +20 -2
- ui/admin/setup-add.php +17 -12
- ui/fields/_db.php +1 -1
- ui/fields/slug.php +1 -1
- ui/js/admin-importer.js +10 -10
- ui/js/advanced.js +7 -7
- ui/js/cleditor/images/buttons.gif +0 -0
- ui/js/cleditor/images/toolbar.gif +0 -0
- ui/js/cleditor/jquery.cleditor.css +26 -0
- ui/js/cleditor/jquery.cleditor.js +1190 -0
- ui/js/cleditor/jquery.cleditor.min.js +8 -0
- ui/js/jquery.cleditor.min.js +0 -31
- ui/js/jquery.json.js +0 -37
- ui/js/jquery.maskedinput-1.3.min.js +0 -7
- ui/js/jquery.pods.attach.js +2 -2
- ui/js/jquery.pods.js +508 -506
- ui/js/jquery.pods.upgrade.js +2 -2
- ui/js/jquery.qtip.min.js +0 -4
- ui/js/pods-dfv/_src/core/iframe-frame.js +1 -1
- ui/js/pods-dfv/pods-dfv.min.js +1 -1
- ui/js/qtip/jquery.qtip.css +617 -0
- ui/js/qtip/jquery.qtip.js +3487 -0
- ui/js/qtip/jquery.qtip.min.css +1 -0
- ui/js/qtip/jquery.qtip.min.js +4 -0
- ui/js/selectWoo/i18n/af.js +3 -0
- ui/js/selectWoo/i18n/ar.js +1 -1
- ui/js/selectWoo/i18n/az.js +1 -1
- ui/js/selectWoo/i18n/bg.js +1 -1
- ui/js/selectWoo/i18n/bs.js +3 -0
- ui/js/selectWoo/i18n/ca.js +1 -1
- ui/js/selectWoo/i18n/cs.js +2 -2
- ui/js/selectWoo/i18n/da.js +1 -1
- ui/js/selectWoo/i18n/de.js +1 -1
- ui/js/selectWoo/i18n/dsb.js +3 -0
- ui/js/selectWoo/i18n/el.js +1 -1
- ui/js/selectWoo/i18n/en.js +1 -1
- ui/js/selectWoo/i18n/es.js +2 -2
- ui/js/selectWoo/i18n/et.js +1 -1
- ui/js/selectWoo/i18n/eu.js +1 -1
- ui/js/selectWoo/i18n/fa.js +1 -1
- ui/js/selectWoo/i18n/fi.js +1 -1
- ui/js/selectWoo/i18n/fr.js +2 -2
- ui/js/selectWoo/i18n/gl.js +1 -1
- ui/js/selectWoo/i18n/he.js +1 -1
- ui/js/selectWoo/i18n/hi.js +1 -1
- ui/js/selectWoo/i18n/hr.js +1 -1
- ui/js/selectWoo/i18n/hsb.js +3 -0
- ui/js/selectWoo/i18n/hu.js +1 -1
- ui/js/selectWoo/i18n/hy.js +1 -1
- ui/js/selectWoo/i18n/id.js +1 -1
- ui/js/selectWoo/i18n/is.js +1 -1
- ui/js/selectWoo/i18n/it.js +1 -1
- ui/js/selectWoo/i18n/ja.js +1 -1
- ui/js/selectWoo/i18n/km.js +1 -1
- ui/js/selectWoo/i18n/ko.js +1 -1
- ui/js/selectWoo/i18n/lt.js +1 -1
- ui/js/selectWoo/i18n/lv.js +1 -1
- ui/js/selectWoo/i18n/mk.js +1 -1
- ui/js/selectWoo/i18n/ms.js +1 -1
- ui/js/selectWoo/i18n/nb.js +2 -2
- ui/js/selectWoo/i18n/nl.js +1 -1
- ui/js/selectWoo/i18n/pl.js +1 -1
- ui/js/selectWoo/i18n/ps.js +3 -0
- ui/js/selectWoo/i18n/pt-BR.js +1 -1
- ui/js/selectWoo/i18n/pt.js +1 -1
- ui/js/selectWoo/i18n/ro.js +2 -2
- ui/js/selectWoo/i18n/ru.js +1 -1
- ui/js/selectWoo/i18n/sk.js +2 -2
- ui/js/selectWoo/i18n/sl.js +1 -1
- ui/js/selectWoo/i18n/sr-Cyrl.js +1 -1
- ui/js/selectWoo/i18n/sr.js +1 -1
- ui/js/selectWoo/i18n/sv.js +1 -1
- ui/js/selectWoo/i18n/th.js +1 -1
- ui/js/selectWoo/i18n/tr.js +1 -1
- ui/js/selectWoo/i18n/uk.js +1 -1
- ui/js/selectWoo/i18n/vi.js +2 -2
- ui/js/selectWoo/i18n/zh-CN.js +1 -1
- ui/js/selectWoo/i18n/zh-TW.js +1 -1
- ui/js/selectWoo/selectWoo.full.js +19 -12
- ui/js/selectWoo/selectWoo.full.min.js +1 -1
- ui/js/selectWoo/selectWoo.js +19 -12
- ui/js/selectWoo/selectWoo.min.js +1 -1
classes/PodsAPI.php
CHANGED
@@ -155,12 +155,14 @@ class PodsAPI {
|
|
155 |
$object_type = 'term';
|
156 |
}
|
157 |
|
|
|
|
|
158 |
if ( $sanitized ) {
|
159 |
$data = pods_unsanitize( $data );
|
160 |
-
|
161 |
}
|
162 |
|
163 |
-
if (
|
164 |
return call_user_func( array( $this, 'save_' . $object_type ), $data, $meta, $strict, false, $fields );
|
165 |
} elseif ( 'settings' === $object_type ) {
|
166 |
// Nothing to save
|
@@ -310,6 +312,10 @@ class PodsAPI {
|
|
310 |
}
|
311 |
|
312 |
foreach ( $post_meta as $meta_key => $meta_value ) {
|
|
|
|
|
|
|
|
|
313 |
if ( null === $meta_value || ( $strict && '' === $post_meta[ $meta_key ] ) ) {
|
314 |
$old_meta_value = '';
|
315 |
|
@@ -462,6 +468,10 @@ class PodsAPI {
|
|
462 |
$meta = get_user_meta( $id );
|
463 |
|
464 |
foreach ( $user_meta as $meta_key => $meta_value ) {
|
|
|
|
|
|
|
|
|
465 |
if ( null === $meta_value ) {
|
466 |
$old_meta_value = '';
|
467 |
|
@@ -605,6 +615,10 @@ class PodsAPI {
|
|
605 |
$meta = get_comment_meta( $id );
|
606 |
|
607 |
foreach ( $comment_meta as $meta_key => $meta_value ) {
|
|
|
|
|
|
|
|
|
608 |
if ( null === $meta_value ) {
|
609 |
$old_meta_value = '';
|
610 |
|
@@ -771,6 +785,10 @@ class PodsAPI {
|
|
771 |
}
|
772 |
|
773 |
foreach ( $term_meta as $meta_key => $meta_value ) {
|
|
|
|
|
|
|
|
|
774 |
if ( null === $meta_value || ( $strict && '' === $term_meta[ $meta_key ] ) ) {
|
775 |
$old_meta_value = '';
|
776 |
|
155 |
$object_type = 'term';
|
156 |
}
|
157 |
|
158 |
+
$is_meta_object = in_array( $object_type, array( 'post', 'term', 'user', 'comment' ), true );
|
159 |
+
|
160 |
if ( $sanitized ) {
|
161 |
$data = pods_unsanitize( $data );
|
162 |
+
// Do not unsanitize $meta. This is already done by WP.
|
163 |
}
|
164 |
|
165 |
+
if ( $is_meta_object ) {
|
166 |
return call_user_func( array( $this, 'save_' . $object_type ), $data, $meta, $strict, false, $fields );
|
167 |
} elseif ( 'settings' === $object_type ) {
|
168 |
// Nothing to save
|
312 |
}
|
313 |
|
314 |
foreach ( $post_meta as $meta_key => $meta_value ) {
|
315 |
+
|
316 |
+
// Prevent WP unslash removing already sanitized input.
|
317 |
+
$meta_value = pods_slash( $meta_value );
|
318 |
+
|
319 |
if ( null === $meta_value || ( $strict && '' === $post_meta[ $meta_key ] ) ) {
|
320 |
$old_meta_value = '';
|
321 |
|
468 |
$meta = get_user_meta( $id );
|
469 |
|
470 |
foreach ( $user_meta as $meta_key => $meta_value ) {
|
471 |
+
|
472 |
+
// Prevent WP unslash removing already sanitized input.
|
473 |
+
$meta_value = pods_slash( $meta_value );
|
474 |
+
|
475 |
if ( null === $meta_value ) {
|
476 |
$old_meta_value = '';
|
477 |
|
615 |
$meta = get_comment_meta( $id );
|
616 |
|
617 |
foreach ( $comment_meta as $meta_key => $meta_value ) {
|
618 |
+
|
619 |
+
// Prevent WP unslash removing already sanitized input.
|
620 |
+
$meta_value = pods_slash( $meta_value );
|
621 |
+
|
622 |
if ( null === $meta_value ) {
|
623 |
$old_meta_value = '';
|
624 |
|
785 |
}
|
786 |
|
787 |
foreach ( $term_meta as $meta_key => $meta_value ) {
|
788 |
+
|
789 |
+
// Prevent WP unslash removing already sanitized input.
|
790 |
+
$meta_value = pods_slash( $meta_value );
|
791 |
+
|
792 |
if ( null === $meta_value || ( $strict && '' === $term_meta[ $meta_key ] ) ) {
|
793 |
$old_meta_value = '';
|
794 |
|
classes/PodsField.php
CHANGED
@@ -603,7 +603,27 @@ class PodsField {
|
|
603 |
*/
|
604 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
605 |
|
606 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
|
608 |
}
|
609 |
|
603 |
*/
|
604 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
605 |
|
606 |
+
/**
|
607 |
+
* Filter field validation return.
|
608 |
+
*
|
609 |
+
* @since 2.7.24
|
610 |
+
*
|
611 |
+
* @param true $true Default validation return.
|
612 |
+
* @param mixed|null $value Current value.
|
613 |
+
* @param string|null $name Field name.
|
614 |
+
* @param array|null $options Field options.
|
615 |
+
* @param array|null $fields Pod fields.
|
616 |
+
* @param array|null $pod Pod information.
|
617 |
+
* @param int|string|null $id Current item ID.
|
618 |
+
* @param array|null $params Additional parameters.
|
619 |
+
*/
|
620 |
+
$validate = apply_filters( 'pods_field_validate_' . static::$type, true, $value, $name, $options, $fields, $pod, $id, $params );
|
621 |
+
|
622 |
+
if ( ! is_bool( $validate ) ) {
|
623 |
+
$validate = (array) $validate;
|
624 |
+
}
|
625 |
+
|
626 |
+
return $validate;
|
627 |
|
628 |
}
|
629 |
|
classes/PodsI18n.php
CHANGED
@@ -226,12 +226,12 @@ final class PodsI18n {
|
|
226 |
*/
|
227 |
public function get_current_language( $args = array() ) {
|
228 |
|
229 |
-
$
|
230 |
-
|
231 |
-
'refresh' => false,
|
232 |
-
)
|
233 |
);
|
234 |
|
|
|
|
|
235 |
if ( ! $args['refresh'] && ! empty( self::$current_language ) ) {
|
236 |
return self::$current_language;
|
237 |
}
|
@@ -256,12 +256,12 @@ final class PodsI18n {
|
|
256 |
*/
|
257 |
public function get_current_language_data( $args = array() ) {
|
258 |
|
259 |
-
$
|
260 |
-
|
261 |
-
'refresh' => false,
|
262 |
-
)
|
263 |
);
|
264 |
|
|
|
|
|
265 |
if ( ! $args['refresh'] && ! empty( self::$current_language_data ) ) {
|
266 |
return self::$current_language_data;
|
267 |
}
|
@@ -313,15 +313,25 @@ final class PodsI18n {
|
|
313 |
$current_language = get_user_meta( get_current_user_id(), 'pll_filter_content', true );
|
314 |
}
|
315 |
|
|
|
|
|
316 |
// Get current language based on the object language if available.
|
317 |
-
$page = basename( $_SERVER
|
|
|
|
|
|
|
|
|
|
|
318 |
|
319 |
/**
|
320 |
* Overwrite the current language if needed for post types.
|
321 |
*/
|
322 |
if ( 'post.php' === $page || 'edit.php' === $page ) {
|
323 |
|
324 |
-
$current_post = (
|
|
|
|
|
|
|
325 |
|
326 |
if ( $current_post ) {
|
327 |
|
@@ -356,9 +366,7 @@ final class PodsI18n {
|
|
356 |
* Polylang (1.0.1+).
|
357 |
* When we're adding a new object and language is set we only want the related objects if they are not translatable OR the same language.
|
358 |
*/
|
359 |
-
|
360 |
-
$current_language = $_GET['new_lang'];
|
361 |
-
}
|
362 |
}
|
363 |
}
|
364 |
} //end if
|
@@ -368,13 +376,19 @@ final class PodsI18n {
|
|
368 |
*/
|
369 |
elseif ( 'term.php' === $page || 'edit-tags.php' === $page ) {
|
370 |
|
371 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
|
373 |
// @todo MAYBE: Similar function like get_post_type for taxonomies so we don't need to check for $_GET['taxonomy']
|
374 |
if ( $current_taxonomy ) {
|
375 |
|
376 |
-
$current_tag_id = ( ! empty( $_GET['tag_ID'] ) ) ? (int) $_GET['tag_ID'] : 0;
|
377 |
-
|
378 |
/*
|
379 |
* @todo wpml-comp API call for taxonomy needed!
|
380 |
* Suggested API call:
|
@@ -400,18 +414,16 @@ final class PodsI18n {
|
|
400 |
* Polylang (1.5.4+).
|
401 |
* We only want the related objects if they are not translatable OR the same language as the current object.
|
402 |
*/
|
403 |
-
if ( $
|
404 |
// Overwrite the current language if this is a translatable taxonomy
|
405 |
-
$current_language = pll_get_term_language( $
|
406 |
}
|
407 |
|
408 |
/**
|
409 |
* Polylang (1.0.1+).
|
410 |
* When we're adding a new object and language is set we only want the related objects if they are not translatable OR the same language.
|
411 |
*/
|
412 |
-
|
413 |
-
$current_language = $_GET['new_lang'];
|
414 |
-
}
|
415 |
}
|
416 |
}//end if
|
417 |
}//end if
|
226 |
*/
|
227 |
public function get_current_language( $args = array() ) {
|
228 |
|
229 |
+
$defaults = array(
|
230 |
+
'refresh' => false,
|
|
|
|
|
231 |
);
|
232 |
|
233 |
+
$args = wp_parse_args( $args, $defaults );
|
234 |
+
|
235 |
if ( ! $args['refresh'] && ! empty( self::$current_language ) ) {
|
236 |
return self::$current_language;
|
237 |
}
|
256 |
*/
|
257 |
public function get_current_language_data( $args = array() ) {
|
258 |
|
259 |
+
$defaults = array(
|
260 |
+
'refresh' => false,
|
|
|
|
|
261 |
);
|
262 |
|
263 |
+
$args = wp_parse_args( $args, $defaults );
|
264 |
+
|
265 |
if ( ! $args['refresh'] && ! empty( self::$current_language_data ) ) {
|
266 |
return self::$current_language_data;
|
267 |
}
|
313 |
$current_language = get_user_meta( get_current_user_id(), 'pll_filter_content', true );
|
314 |
}
|
315 |
|
316 |
+
$pods_ajax = pods_v( 'pods_ajax', 'request', false );
|
317 |
+
|
318 |
// Get current language based on the object language if available.
|
319 |
+
$page = basename( pods_v( 'SCRIPT_NAME', $_SERVER, '' ) );
|
320 |
+
if ( $pods_ajax && 'admin-ajax.php' === $page ) {
|
321 |
+
$page = basename( pods_v( 'HTTP_REFERER', $_SERVER, '' ) );
|
322 |
+
}
|
323 |
+
$page = explode( '?', $page );
|
324 |
+
$page = reset( $page );
|
325 |
|
326 |
/**
|
327 |
* Overwrite the current language if needed for post types.
|
328 |
*/
|
329 |
if ( 'post.php' === $page || 'edit.php' === $page ) {
|
330 |
|
331 |
+
$current_post = (int) pods_v( 'post', 'request', 0 );
|
332 |
+
if ( $pods_ajax ) {
|
333 |
+
$current_post = (int) pods_v( 'id', 'request', $current_post );
|
334 |
+
}
|
335 |
|
336 |
if ( $current_post ) {
|
337 |
|
366 |
* Polylang (1.0.1+).
|
367 |
* When we're adding a new object and language is set we only want the related objects if they are not translatable OR the same language.
|
368 |
*/
|
369 |
+
$current_language = pods_v( 'new_lang', 'request', $current_language );
|
|
|
|
|
370 |
}
|
371 |
}
|
372 |
} //end if
|
376 |
*/
|
377 |
elseif ( 'term.php' === $page || 'edit-tags.php' === $page ) {
|
378 |
|
379 |
+
$current_term_id = pods_v( 'tag_ID', 'request', 0 );
|
380 |
+
if ( $pods_ajax ) {
|
381 |
+
$current_term_id = (int) pods_v( 'id', 'request', $current_term_id );
|
382 |
+
}
|
383 |
+
|
384 |
+
$current_taxonomy = pods_v( 'taxonomy', 'request', '' );
|
385 |
+
if ( ! $current_taxonomy && $current_term_id ) {
|
386 |
+
$current_taxonomy = pods_v( 'taxonomy', get_term( $current_term_id ), null );
|
387 |
+
}
|
388 |
|
389 |
// @todo MAYBE: Similar function like get_post_type for taxonomies so we don't need to check for $_GET['taxonomy']
|
390 |
if ( $current_taxonomy ) {
|
391 |
|
|
|
|
|
392 |
/*
|
393 |
* @todo wpml-comp API call for taxonomy needed!
|
394 |
* Suggested API call:
|
414 |
* Polylang (1.5.4+).
|
415 |
* We only want the related objects if they are not translatable OR the same language as the current object.
|
416 |
*/
|
417 |
+
if ( $current_term_id && function_exists( 'pll_get_term_language' ) ) {
|
418 |
// Overwrite the current language if this is a translatable taxonomy
|
419 |
+
$current_language = pll_get_term_language( $current_term_id );
|
420 |
}
|
421 |
|
422 |
/**
|
423 |
* Polylang (1.0.1+).
|
424 |
* When we're adding a new object and language is set we only want the related objects if they are not translatable OR the same language.
|
425 |
*/
|
426 |
+
$current_language = pods_v( 'new_lang', 'request', $current_language );
|
|
|
|
|
427 |
}
|
428 |
}//end if
|
429 |
}//end if
|
classes/PodsInit.php
CHANGED
@@ -469,6 +469,10 @@ class PodsInit {
|
|
469 |
if ( method_exists( $avatar, 'get_avatar' ) ) {
|
470 |
add_filter( 'get_avatar', array( $avatar, 'get_avatar' ), 10, 4 );
|
471 |
}
|
|
|
|
|
|
|
|
|
472 |
}
|
473 |
|
474 |
/**
|
@@ -487,10 +491,8 @@ class PodsInit {
|
|
487 |
*/
|
488 |
do_action( 'pods_before_enqueue_scripts', $suffix_min );
|
489 |
|
490 |
-
wp_register_script( 'pods-json', PODS_URL . 'ui/js/jquery.json.js', array( 'jquery' ), '2.3' );
|
491 |
-
|
492 |
if ( ! wp_script_is( 'jquery-qtip2', 'registered' ) ) {
|
493 |
-
wp_register_script( 'jquery-qtip2', PODS_URL .
|
494 |
}
|
495 |
|
496 |
wp_register_script(
|
@@ -500,14 +502,13 @@ class PodsInit {
|
|
500 |
'jquery',
|
501 |
'pods-dfv',
|
502 |
'pods-i18n',
|
503 |
-
'pods-json',
|
504 |
'jquery-qtip2',
|
505 |
),
|
506 |
PODS_VERSION,
|
507 |
true
|
508 |
);
|
509 |
|
510 |
-
wp_register_script( 'pods-cleditor', PODS_URL .
|
511 |
|
512 |
wp_register_script( 'pods-codemirror', PODS_URL . 'ui/js/codemirror.js', array(), '4.8', true );
|
513 |
wp_register_script( 'pods-codemirror-loadmode', PODS_URL . 'ui/js/codemirror/addon/mode/loadmode.js', array( 'pods-codemirror' ), '4.8', true );
|
@@ -546,12 +547,12 @@ class PodsInit {
|
|
546 |
);
|
547 |
}
|
548 |
|
549 |
-
|
550 |
wp_register_style(
|
551 |
'pods-select2',
|
552 |
PODS_URL . "ui/js/selectWoo/selectWoo{$suffix_min}.css",
|
553 |
array(),
|
554 |
-
'1.0.
|
555 |
);
|
556 |
|
557 |
$select2_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
|
@@ -574,10 +575,10 @@ class PodsInit {
|
|
574 |
'jquery',
|
575 |
'pods-i18n',
|
576 |
),
|
577 |
-
'1.0.
|
578 |
true
|
579 |
);
|
580 |
-
wp_register_script( 'pods-select2', $select2_i18n, array( 'pods-select2-core' ), '1.0.
|
581 |
} else {
|
582 |
wp_register_script(
|
583 |
'pods-select2',
|
@@ -586,7 +587,7 @@ class PodsInit {
|
|
586 |
'jquery',
|
587 |
'pods-i18n',
|
588 |
),
|
589 |
-
'1.0.
|
590 |
true
|
591 |
);
|
592 |
}
|
469 |
if ( method_exists( $avatar, 'get_avatar' ) ) {
|
470 |
add_filter( 'get_avatar', array( $avatar, 'get_avatar' ), 10, 4 );
|
471 |
}
|
472 |
+
|
473 |
+
if ( method_exists( $avatar, 'get_avatar_data' ) ) {
|
474 |
+
add_filter( 'get_avatar_data', array( $avatar, 'get_avatar_data' ), 10, 2 );
|
475 |
+
}
|
476 |
}
|
477 |
|
478 |
/**
|
491 |
*/
|
492 |
do_action( 'pods_before_enqueue_scripts', $suffix_min );
|
493 |
|
|
|
|
|
494 |
if ( ! wp_script_is( 'jquery-qtip2', 'registered' ) ) {
|
495 |
+
wp_register_script( 'jquery-qtip2', PODS_URL . "ui/js/qtip/jquery.qtip{$suffix_min}.js", array( 'jquery' ), '3.0.3', true );
|
496 |
}
|
497 |
|
498 |
wp_register_script(
|
502 |
'jquery',
|
503 |
'pods-dfv',
|
504 |
'pods-i18n',
|
|
|
505 |
'jquery-qtip2',
|
506 |
),
|
507 |
PODS_VERSION,
|
508 |
true
|
509 |
);
|
510 |
|
511 |
+
wp_register_script( 'pods-cleditor', PODS_URL . "ui/js/cleditor/jquery.cleditor{$suffix_min}.js", array( 'jquery' ), '1.4.5', true );
|
512 |
|
513 |
wp_register_script( 'pods-codemirror', PODS_URL . 'ui/js/codemirror.js', array(), '4.8', true );
|
514 |
wp_register_script( 'pods-codemirror-loadmode', PODS_URL . 'ui/js/codemirror/addon/mode/loadmode.js', array( 'pods-codemirror' ), '4.8', true );
|
547 |
);
|
548 |
}
|
549 |
|
550 |
+
// Select2/SelectWoo.
|
551 |
wp_register_style(
|
552 |
'pods-select2',
|
553 |
PODS_URL . "ui/js/selectWoo/selectWoo{$suffix_min}.css",
|
554 |
array(),
|
555 |
+
'1.0.8'
|
556 |
);
|
557 |
|
558 |
$select2_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
|
575 |
'jquery',
|
576 |
'pods-i18n',
|
577 |
),
|
578 |
+
'1.0.8',
|
579 |
true
|
580 |
);
|
581 |
+
wp_register_script( 'pods-select2', $select2_i18n, array( 'pods-select2-core' ), '1.0.8', true );
|
582 |
} else {
|
583 |
wp_register_script(
|
584 |
'pods-select2',
|
587 |
'jquery',
|
588 |
'pods-i18n',
|
589 |
),
|
590 |
+
'1.0.8',
|
591 |
true
|
592 |
);
|
593 |
}
|
classes/PodsMeta.php
CHANGED
@@ -1377,7 +1377,7 @@ class PodsMeta {
|
|
1377 |
pods_no_conflict_on( 'post' );
|
1378 |
|
1379 |
if ( ! empty( $pod ) ) {
|
1380 |
-
// Fix for Pods doing it's own sanitizing
|
1381 |
$data = pods_unslash( (array) $data );
|
1382 |
|
1383 |
$pod->save( $data, null, null, array( 'is_new_item' => $is_new_item, 'podsmeta' => true ) );
|
1377 |
pods_no_conflict_on( 'post' );
|
1378 |
|
1379 |
if ( ! empty( $pod ) ) {
|
1380 |
+
// Fix for Pods doing it's own sanitizing.
|
1381 |
$data = pods_unslash( (array) $data );
|
1382 |
|
1383 |
$pod->save( $data, null, null, array( 'is_new_item' => $is_new_item, 'podsmeta' => true ) );
|
classes/fields/avatar.php
CHANGED
@@ -79,39 +79,161 @@ class PodsField_Avatar extends PodsField_File {
|
|
79 |
*/
|
80 |
public function get_avatar( $avatar, $id_or_email, $size, $default = '', $alt = '' ) {
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
}
|
90 |
|
91 |
-
$
|
|
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
// Include PodsMeta if not already included.
|
108 |
pods_meta();
|
|
|
109 |
|
110 |
if ( 0 < $user_id && ! empty( PodsMeta::$user ) ) {
|
111 |
-
$avatar_cached = pods_cache_get( $user_id
|
112 |
|
113 |
if ( ! empty( $avatar_cached ) ) {
|
114 |
-
$
|
115 |
} else {
|
116 |
$avatar_field = pods_transient_get( 'pods_avatar_field' );
|
117 |
|
@@ -132,33 +254,71 @@ class PodsField_Avatar extends PodsField_File {
|
|
132 |
}
|
133 |
|
134 |
if ( ! empty( $avatar_field ) ) {
|
135 |
-
$
|
136 |
-
$user_avatar = ! empty( $user_meta[ $avatar_field ][0] ) ? $user_meta[ $avatar_field ][0] : false;
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
);
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
-
|
|
|
|
|
|
|
149 |
|
150 |
-
|
151 |
-
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
159 |
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
|
|
162 |
}
|
163 |
|
164 |
}
|
79 |
*/
|
80 |
public function get_avatar( $avatar, $id_or_email, $size, $default = '', $alt = '' ) {
|
81 |
|
82 |
+
if ( ! $this->allow_avatar_overwrite() ) {
|
83 |
+
return $avatar;
|
84 |
+
}
|
85 |
+
|
86 |
+
$user_id = $this->get_avatar_user_id( $id_or_email );
|
87 |
+
|
88 |
+
if ( 0 < $user_id && ! empty( PodsMeta::$user ) ) {
|
89 |
+
$avatar_cached = pods_cache_get( $user_id . '-' . $size, 'pods_avatars' );
|
90 |
+
|
91 |
+
if ( ! empty( $avatar_cached ) ) {
|
92 |
+
$avatar = $avatar_cached;
|
93 |
+
} else {
|
94 |
+
|
95 |
+
$user_avatar = $this->get_avatar_id( $user_id );
|
96 |
+
|
97 |
+
if ( ! empty( $user_avatar ) ) {
|
98 |
+
$attributes = array(
|
99 |
+
'alt' => '',
|
100 |
+
'class' => 'avatar avatar-' . $size . ' photo',
|
101 |
+
);
|
102 |
|
103 |
+
if ( ! empty( $alt ) ) {
|
104 |
+
$attributes['alt'] = $alt;
|
105 |
+
}
|
106 |
+
|
107 |
+
$user_avatar = pods_image( $user_avatar, array( $size, $size ), 0, $attributes );
|
108 |
+
|
109 |
+
if ( ! empty( $user_avatar ) ) {
|
110 |
+
$avatar = $user_avatar;
|
111 |
+
|
112 |
+
pods_cache_set( $user_id . '-' . $size, $avatar, 'pods_avatars', WEEK_IN_SECONDS );
|
113 |
+
}
|
114 |
+
}
|
115 |
}
|
116 |
}
|
117 |
|
118 |
+
return $avatar;
|
119 |
+
}
|
120 |
|
121 |
+
/**
|
122 |
+
* Take over the avatar data served from WordPress
|
123 |
+
*
|
124 |
+
* @since 2.7.22
|
125 |
+
*
|
126 |
+
* @param array $args {
|
127 |
+
* Optional. Arguments to return instead of the default arguments.
|
128 |
+
*
|
129 |
+
* @type int $size Height and width of the avatar image file in pixels. Default 96.
|
130 |
+
* @type int $height Display height of the avatar in pixels. Defaults to $size.
|
131 |
+
* @type int $width Display width of the avatar in pixels. Defaults to $size.
|
132 |
+
* @type string $default URL for the default image or a default type. Accepts '404' (return
|
133 |
+
* a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster),
|
134 |
+
* 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm',
|
135 |
+
* or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or
|
136 |
+
* 'gravatar_default' (the Gravatar logo). Default is the value of the
|
137 |
+
* 'avatar_default' option, with a fallback of 'mystery'.
|
138 |
+
* @type bool $force_default Whether to always show the default image, never the Gravatar. Default false.
|
139 |
+
* @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are
|
140 |
+
* judged in that order. Default is the value of the 'avatar_rating' option.
|
141 |
+
* @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
|
142 |
+
* Default null.
|
143 |
+
* @type array $processed_args When the function returns, the value will be the processed/sanitized $args
|
144 |
+
* plus a "found_avatar" guess. Pass as a reference. Default null.
|
145 |
+
* @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty.
|
146 |
+
* }
|
147 |
+
* @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
|
148 |
+
* user email, WP_User object, WP_Post object, or WP_Comment object.
|
149 |
+
* @return array {
|
150 |
+
* Along with the arguments passed in `$args`, this will contain a couple of extra arguments.
|
151 |
+
*
|
152 |
+
* @type bool $found_avatar True if we were able to find an avatar for this user,
|
153 |
+
* false or not set if we couldn't.
|
154 |
+
* @type string $url The URL of the avatar we found.
|
155 |
+
* }
|
156 |
+
*/
|
157 |
+
public function get_avatar_data( $args, $id_or_email ) {
|
158 |
+
if ( ! $this->allow_avatar_overwrite() ) {
|
159 |
+
return $args;
|
160 |
+
}
|
161 |
|
162 |
+
$return_args = $args;
|
163 |
+
|
164 |
+
$args = wp_parse_args(
|
165 |
+
$args,
|
166 |
+
array(
|
167 |
+
'size' => 96,
|
168 |
+
'height' => null,
|
169 |
+
'width' => null,
|
170 |
+
'default' => get_option( 'avatar_default', 'mystery' ),
|
171 |
+
'force_default' => false,
|
172 |
+
'rating' => get_option( 'avatar_rating' ),
|
173 |
+
'scheme' => null,
|
174 |
+
'processed_args' => null, // If used, should be a reference.
|
175 |
+
'extra_attr' => '',
|
176 |
+
)
|
177 |
+
);
|
178 |
+
|
179 |
+
$size = $args['size'];
|
180 |
+
if ( $args['width'] !== $args['height'] ) {
|
181 |
+
$size = $args['width'] . 'x' . $args['height'];
|
182 |
+
}
|
183 |
+
|
184 |
+
$user_id = $this->get_avatar_user_id( $id_or_email );
|
185 |
+
|
186 |
+
if ( 0 < $user_id && ! empty( PodsMeta::$user ) ) {
|
187 |
+
$user_avatar_url = null;
|
188 |
+
$avatar_cached = pods_cache_get( $user_id . '-' . $size, 'pods_avatar_urls' );
|
189 |
+
|
190 |
+
if ( ! empty( $avatar_cached ) ) {
|
191 |
+
$user_avatar_url = $avatar_cached;
|
192 |
+
} else {
|
193 |
+
|
194 |
+
$user_avatar_id = $this->get_avatar_id( $user_id );
|
195 |
+
|
196 |
+
if ( ! empty( $user_avatar_id ) ) {
|
197 |
+
|
198 |
+
$user_avatar_url = pods_image_url( $user_avatar_id, array( $args['width'], $args['height'] ), 0 );
|
199 |
+
|
200 |
+
if ( ! empty( $user_avatar_url ) ) {
|
201 |
+
pods_cache_set( $user_id . '-' . $size, $user_avatar_url, 'pods_avatar_urls', WEEK_IN_SECONDS );
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
if ( $user_avatar_url ) {
|
207 |
+
$return_args['url'] = $user_avatar_url;
|
208 |
+
$return_args['found_avatar'] = true;
|
209 |
}
|
210 |
}
|
211 |
|
212 |
+
return $return_args;
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Get the custom user avatar ID.
|
217 |
+
*
|
218 |
+
* @since 2.7.22
|
219 |
+
*
|
220 |
+
* @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
|
221 |
+
* user email, WP_User object, WP_Post object, or WP_Comment object.
|
222 |
+
*
|
223 |
+
* @return int
|
224 |
+
*/
|
225 |
+
public function get_avatar_id( $id_or_email ) {
|
226 |
+
$user_id = $this->get_avatar_user_id( $id_or_email );
|
227 |
+
|
228 |
// Include PodsMeta if not already included.
|
229 |
pods_meta();
|
230 |
+
$avatar_id = 0;
|
231 |
|
232 |
if ( 0 < $user_id && ! empty( PodsMeta::$user ) ) {
|
233 |
+
$avatar_cached = pods_cache_get( $user_id, 'pods_avatar_ids' );
|
234 |
|
235 |
if ( ! empty( $avatar_cached ) ) {
|
236 |
+
$avatar_id = $avatar_cached;
|
237 |
} else {
|
238 |
$avatar_field = pods_transient_get( 'pods_avatar_field' );
|
239 |
|
254 |
}
|
255 |
|
256 |
if ( ! empty( $avatar_field ) ) {
|
257 |
+
$avatar_id = get_user_meta( $user_id, $avatar_field . '.ID', true );
|
|
|
258 |
|
259 |
+
pods_cache_set( $user_id, $avatar_id, 'pods_avatar_ids', WEEK_IN_SECONDS );
|
260 |
+
}//end if
|
261 |
+
}//end if
|
262 |
+
}//end if
|
|
|
263 |
|
264 |
+
return (int) $avatar_id;
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Get the avatar user ID based on parameter provided.
|
269 |
+
*
|
270 |
+
* @since 2.7.22
|
271 |
+
*
|
272 |
+
* @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
|
273 |
+
* user email, WP_User object, WP_Post object, or WP_Comment object.
|
274 |
+
*
|
275 |
+
* @return int
|
276 |
+
*/
|
277 |
+
public function get_avatar_user_id( $id_or_email ) {
|
278 |
+
$user_id = 0;
|
279 |
+
|
280 |
+
if ( is_numeric( $id_or_email ) && 0 < $id_or_email ) {
|
281 |
+
$user_id = $id_or_email;
|
282 |
+
} elseif ( is_object( $id_or_email ) && isset( $id_or_email->user_id ) && 0 < $id_or_email->user_id ) {
|
283 |
+
$user_id = $id_or_email->user_id;
|
284 |
+
} elseif ( is_object( $id_or_email ) && isset( $id_or_email->ID ) && isset( $id_or_email->user_login ) && 0 < $id_or_email->ID ) {
|
285 |
+
$user_id = $id_or_email->ID;
|
286 |
+
} elseif ( ! is_object( $id_or_email ) && false !== strpos( $id_or_email, '@' ) ) {
|
287 |
+
$_user = get_user_by( 'email', $id_or_email );
|
288 |
|
289 |
+
if ( ! empty( $_user ) ) {
|
290 |
+
$user_id = $_user->ID;
|
291 |
+
}
|
292 |
+
}
|
293 |
|
294 |
+
return (int) $user_id;
|
295 |
+
}
|
296 |
|
297 |
+
/**
|
298 |
+
* Checks if we're not on WordPress admin pages where we shouldn't overwrite.
|
299 |
+
*
|
300 |
+
* @since 2.7.22
|
301 |
+
*
|
302 |
+
* @return bool
|
303 |
+
*/
|
304 |
+
public function allow_avatar_overwrite() {
|
305 |
|
306 |
+
// Don't replace for the Avatars section of the Discussion settings page.
|
307 |
+
if ( is_admin() && ! doing_action( 'admin_bar_menu' ) ) {
|
308 |
+
$current_screen = get_current_screen();
|
309 |
+
|
310 |
+
$screens = array(
|
311 |
+
'profile',
|
312 |
+
'user-edit',
|
313 |
+
'options-discussion',
|
314 |
+
);
|
315 |
+
|
316 |
+
if ( null !== $current_screen && in_array( $current_screen->id, $screens, true ) ) {
|
317 |
+
return false;
|
318 |
+
}
|
319 |
+
}
|
320 |
|
321 |
+
return true;
|
322 |
}
|
323 |
|
324 |
}
|
classes/fields/boolean.php
CHANGED
@@ -174,14 +174,20 @@ class PodsField_Boolean extends PodsField {
|
|
174 |
* {@inheritdoc}
|
175 |
*/
|
176 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
177 |
|
178 |
if ( ! $this->is_required( $options ) ) {
|
179 |
// Any value can be parsed to boolean.
|
180 |
-
return
|
181 |
}
|
182 |
|
183 |
$errors = array();
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
185 |
|
186 |
$yes_required = ( 'checkbox' === pods_v( static::$type . '_format_type', $options ) );
|
187 |
|
@@ -193,7 +199,7 @@ class PodsField_Boolean extends PodsField {
|
|
193 |
return $errors;
|
194 |
}
|
195 |
|
196 |
-
return
|
197 |
}
|
198 |
|
199 |
/**
|
174 |
* {@inheritdoc}
|
175 |
*/
|
176 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
177 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
178 |
|
179 |
if ( ! $this->is_required( $options ) ) {
|
180 |
// Any value can be parsed to boolean.
|
181 |
+
return $validate;
|
182 |
}
|
183 |
|
184 |
$errors = array();
|
185 |
+
|
186 |
+
if ( is_array( $validate ) ) {
|
187 |
+
$errors = $validate;
|
188 |
+
}
|
189 |
+
|
190 |
+
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
191 |
|
192 |
$yes_required = ( 'checkbox' === pods_v( static::$type . '_format_type', $options ) );
|
193 |
|
199 |
return $errors;
|
200 |
}
|
201 |
|
202 |
+
return $validate;
|
203 |
}
|
204 |
|
205 |
/**
|
classes/fields/color.php
CHANGED
@@ -94,9 +94,14 @@ class PodsField_Color extends PodsField {
|
|
94 |
* {@inheritdoc}
|
95 |
*/
|
96 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
97 |
|
98 |
$errors = array();
|
99 |
|
|
|
|
|
|
|
|
|
100 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
101 |
|
102 |
if ( is_array( $check ) ) {
|
@@ -120,7 +125,7 @@ class PodsField_Color extends PodsField {
|
|
120 |
return $errors;
|
121 |
}
|
122 |
|
123 |
-
return
|
124 |
}
|
125 |
|
126 |
/**
|
94 |
* {@inheritdoc}
|
95 |
*/
|
96 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
97 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
98 |
|
99 |
$errors = array();
|
100 |
|
101 |
+
if ( is_array( $validate ) ) {
|
102 |
+
$errors = $validate;
|
103 |
+
}
|
104 |
+
|
105 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
106 |
|
107 |
if ( is_array( $check ) ) {
|
125 |
return $errors;
|
126 |
}
|
127 |
|
128 |
+
return $validate;
|
129 |
}
|
130 |
|
131 |
/**
|
classes/fields/datetime.php
CHANGED
@@ -307,6 +307,13 @@ class PodsField_DateTime extends PodsField {
|
|
307 |
* {@inheritdoc}
|
308 |
*/
|
309 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
|
311 |
if ( ! $this->is_empty( $value ) ) {
|
312 |
|
@@ -323,11 +330,16 @@ class PodsField_DateTime extends PodsField {
|
|
323 |
if ( false === $check ) {
|
324 |
$label = pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) );
|
325 |
|
326 |
-
|
|
|
327 |
}
|
328 |
}
|
329 |
|
330 |
-
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
|
333 |
/**
|
307 |
* {@inheritdoc}
|
308 |
*/
|
309 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
310 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
311 |
+
|
312 |
+
$errors = array();
|
313 |
+
|
314 |
+
if ( is_array( $validate ) ) {
|
315 |
+
$errors = $validate;
|
316 |
+
}
|
317 |
|
318 |
if ( ! $this->is_empty( $value ) ) {
|
319 |
|
330 |
if ( false === $check ) {
|
331 |
$label = pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) );
|
332 |
|
333 |
+
// Translators: %1$s is the field label and %2$s is the input value.
|
334 |
+
$errors[] = sprintf( esc_html__( '%1$s was not provided in a recognizable format: "%2$s"', 'pods' ), $label, $value );
|
335 |
}
|
336 |
}
|
337 |
|
338 |
+
if ( ! empty( $errors ) ) {
|
339 |
+
return $errors;
|
340 |
+
}
|
341 |
+
|
342 |
+
return $validate;
|
343 |
}
|
344 |
|
345 |
/**
|
classes/fields/email.php
CHANGED
@@ -124,9 +124,14 @@ class PodsField_Email extends PodsField {
|
|
124 |
* {@inheritdoc}
|
125 |
*/
|
126 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
127 |
|
128 |
$errors = array();
|
129 |
|
|
|
|
|
|
|
|
|
130 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
131 |
|
132 |
if ( is_array( $check ) ) {
|
@@ -147,7 +152,7 @@ class PodsField_Email extends PodsField {
|
|
147 |
return $errors;
|
148 |
}
|
149 |
|
150 |
-
return
|
151 |
}
|
152 |
|
153 |
/**
|
124 |
* {@inheritdoc}
|
125 |
*/
|
126 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
127 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
128 |
|
129 |
$errors = array();
|
130 |
|
131 |
+
if ( is_array( $validate ) ) {
|
132 |
+
$errors = $validate;
|
133 |
+
}
|
134 |
+
|
135 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
136 |
|
137 |
if ( is_array( $check ) ) {
|
152 |
return $errors;
|
153 |
}
|
154 |
|
155 |
+
return $validate;
|
156 |
}
|
157 |
|
158 |
/**
|
classes/fields/file.php
CHANGED
@@ -579,7 +579,7 @@ class PodsField_File extends PodsField {
|
|
579 |
|
580 |
// @todo Check file size
|
581 |
// @todo Check file extensions
|
582 |
-
return
|
583 |
|
584 |
}
|
585 |
|
@@ -612,6 +612,7 @@ class PodsField_File extends PodsField {
|
|
612 |
continue;
|
613 |
}
|
614 |
|
|
|
615 |
$attachment_data = array();
|
616 |
|
617 |
// Update the title if set.
|
@@ -632,6 +633,11 @@ class PodsField_File extends PodsField {
|
|
632 |
if ( ! empty( $attachment_data ) ) {
|
633 |
$attachment_data['ID'] = $id;
|
634 |
|
|
|
|
|
|
|
|
|
|
|
635 |
self::$api->save_wp_object( 'media', $attachment_data );
|
636 |
}
|
637 |
}//end foreach
|
579 |
|
580 |
// @todo Check file size
|
581 |
// @todo Check file extensions
|
582 |
+
return parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
583 |
|
584 |
}
|
585 |
|
612 |
continue;
|
613 |
}
|
614 |
|
615 |
+
$attachment = null;
|
616 |
$attachment_data = array();
|
617 |
|
618 |
// Update the title if set.
|
633 |
if ( ! empty( $attachment_data ) ) {
|
634 |
$attachment_data['ID'] = $id;
|
635 |
|
636 |
+
if ( $attachment ) {
|
637 |
+
// Add post type to trigger attachment update filters from other plugins.
|
638 |
+
$attachment_data['post_type'] = $attachment->post_type;
|
639 |
+
}
|
640 |
+
|
641 |
self::$api->save_wp_object( 'media', $attachment_data );
|
642 |
}
|
643 |
}//end foreach
|
classes/fields/link.php
CHANGED
@@ -206,8 +206,12 @@ class PodsField_Link extends PodsField_Website {
|
|
206 |
* {@inheritdoc}
|
207 |
*/
|
208 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
209 |
|
210 |
$errors = array();
|
|
|
|
|
|
|
211 |
|
212 |
$label = strip_tags( pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) ) );
|
213 |
|
@@ -231,7 +235,7 @@ class PodsField_Link extends PodsField_Website {
|
|
231 |
return $errors;
|
232 |
}
|
233 |
|
234 |
-
return
|
235 |
|
236 |
}
|
237 |
|
206 |
* {@inheritdoc}
|
207 |
*/
|
208 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
209 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
210 |
|
211 |
$errors = array();
|
212 |
+
if ( is_array( $validate ) ) {
|
213 |
+
$errors = $validate;
|
214 |
+
}
|
215 |
|
216 |
$label = strip_tags( pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) ) );
|
217 |
|
235 |
return $errors;
|
236 |
}
|
237 |
|
238 |
+
return $validate;
|
239 |
|
240 |
}
|
241 |
|
classes/fields/number.php
CHANGED
@@ -246,6 +246,13 @@ class PodsField_Number extends PodsField {
|
|
246 |
* {@inheritdoc}
|
247 |
*/
|
248 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
|
250 |
$format_args = $this->get_number_format_args( $options );
|
251 |
$thousands = $format_args['thousands'];
|
@@ -263,10 +270,15 @@ class PodsField_Number extends PodsField {
|
|
263 |
$label = pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) );
|
264 |
|
265 |
if ( 0 < strlen( $check ) ) {
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
267 |
}
|
268 |
|
269 |
-
return
|
270 |
}
|
271 |
|
272 |
/**
|
246 |
* {@inheritdoc}
|
247 |
*/
|
248 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
249 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
250 |
+
|
251 |
+
$errors = array();
|
252 |
+
|
253 |
+
if ( is_array( $validate ) ) {
|
254 |
+
$errors = $validate;
|
255 |
+
}
|
256 |
|
257 |
$format_args = $this->get_number_format_args( $options );
|
258 |
$thousands = $format_args['thousands'];
|
270 |
$label = pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) );
|
271 |
|
272 |
if ( 0 < strlen( $check ) ) {
|
273 |
+
// Translators: %s stands for the input value.
|
274 |
+
$errors[] = sprintf( esc_html__( '%s is not numeric', 'pods' ), $label );
|
275 |
+
}
|
276 |
+
|
277 |
+
if ( ! empty( $errors ) ) {
|
278 |
+
return $errors;
|
279 |
}
|
280 |
|
281 |
+
return $validate;
|
282 |
}
|
283 |
|
284 |
/**
|
classes/fields/oembed.php
CHANGED
@@ -197,9 +197,14 @@ class PodsField_OEmbed extends PodsField {
|
|
197 |
* {@inheritdoc}
|
198 |
*/
|
199 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
200 |
|
201 |
$errors = array();
|
202 |
|
|
|
|
|
|
|
|
|
203 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
204 |
|
205 |
if ( is_array( $check ) ) {
|
@@ -216,7 +221,7 @@ class PodsField_OEmbed extends PodsField {
|
|
216 |
return $errors;
|
217 |
}
|
218 |
|
219 |
-
return
|
220 |
}
|
221 |
|
222 |
/**
|
197 |
* {@inheritdoc}
|
198 |
*/
|
199 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
200 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
201 |
|
202 |
$errors = array();
|
203 |
|
204 |
+
if ( is_array( $validate ) ) {
|
205 |
+
$errors = $validate;
|
206 |
+
}
|
207 |
+
|
208 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
209 |
|
210 |
if ( is_array( $check ) ) {
|
221 |
return $errors;
|
222 |
}
|
223 |
|
224 |
+
return $validate;
|
225 |
}
|
226 |
|
227 |
/**
|
classes/fields/password.php
CHANGED
@@ -104,9 +104,14 @@ class PodsField_Password extends PodsField {
|
|
104 |
* {@inheritdoc}
|
105 |
*/
|
106 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
107 |
|
108 |
$errors = array();
|
109 |
|
|
|
|
|
|
|
|
|
110 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
111 |
|
112 |
if ( is_array( $check ) ) {
|
@@ -123,7 +128,7 @@ class PodsField_Password extends PodsField {
|
|
123 |
return $errors;
|
124 |
}
|
125 |
|
126 |
-
return
|
127 |
}
|
128 |
|
129 |
/**
|
104 |
* {@inheritdoc}
|
105 |
*/
|
106 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
107 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
108 |
|
109 |
$errors = array();
|
110 |
|
111 |
+
if ( is_array( $validate ) ) {
|
112 |
+
$errors = $validate;
|
113 |
+
}
|
114 |
+
|
115 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
116 |
|
117 |
if ( is_array( $check ) ) {
|
128 |
return $errors;
|
129 |
}
|
130 |
|
131 |
+
return $validate;
|
132 |
}
|
133 |
|
134 |
/**
|
classes/fields/phone.php
CHANGED
@@ -149,9 +149,14 @@ class PodsField_Phone extends PodsField {
|
|
149 |
* {@inheritdoc}
|
150 |
*/
|
151 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
152 |
|
153 |
$errors = array();
|
154 |
|
|
|
|
|
|
|
|
|
155 |
$label = strip_tags( pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) ) );
|
156 |
|
157 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
@@ -172,7 +177,7 @@ class PodsField_Phone extends PodsField {
|
|
172 |
return $errors;
|
173 |
}
|
174 |
|
175 |
-
return
|
176 |
}
|
177 |
|
178 |
/**
|
149 |
* {@inheritdoc}
|
150 |
*/
|
151 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
152 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
153 |
|
154 |
$errors = array();
|
155 |
|
156 |
+
if ( is_array( $validate ) ) {
|
157 |
+
$errors = $validate;
|
158 |
+
}
|
159 |
+
|
160 |
$label = strip_tags( pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) ) );
|
161 |
|
162 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
177 |
return $errors;
|
178 |
}
|
179 |
|
180 |
+
return $validate;
|
181 |
}
|
182 |
|
183 |
/**
|
classes/fields/pick.php
CHANGED
@@ -1393,7 +1393,7 @@ class PodsField_Pick extends PodsField {
|
|
1393 |
}
|
1394 |
|
1395 |
$item = array(
|
1396 |
-
'id' => esc_html( $item_id ),
|
1397 |
'icon' => esc_attr( $icon ),
|
1398 |
'name' => wp_strip_all_tags( html_entity_decode( $item_title ) ),
|
1399 |
'edit_link' => html_entity_decode( esc_url( $edit_link ) ),
|
@@ -1409,6 +1409,13 @@ class PodsField_Pick extends PodsField {
|
|
1409 |
* {@inheritdoc}
|
1410 |
*/
|
1411 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1412 |
|
1413 |
if ( empty( self::$api ) ) {
|
1414 |
self::$api = pods_api();
|
@@ -1490,7 +1497,9 @@ class PodsField_Pick extends PodsField {
|
|
1490 |
self::$related_data[ $options['id'] ][ 'related_ids_' . $related_id ] = $bidirectional_ids;
|
1491 |
|
1492 |
if ( empty( $bidirectional_ids ) || ( in_array( (int) $id, $bidirectional_ids, true ) && 1 === count( $bidirectional_ids ) ) ) {
|
1493 |
-
|
|
|
|
|
1494 |
}
|
1495 |
}
|
1496 |
}
|
@@ -1526,7 +1535,11 @@ class PodsField_Pick extends PodsField {
|
|
1526 |
}
|
1527 |
}//end if
|
1528 |
|
1529 |
-
|
|
|
|
|
|
|
|
|
1530 |
|
1531 |
}
|
1532 |
|
1393 |
}
|
1394 |
|
1395 |
$item = array(
|
1396 |
+
'id' => html_entity_decode( esc_html( $item_id ) ),
|
1397 |
'icon' => esc_attr( $icon ),
|
1398 |
'name' => wp_strip_all_tags( html_entity_decode( $item_title ) ),
|
1399 |
'edit_link' => html_entity_decode( esc_url( $edit_link ) ),
|
1409 |
* {@inheritdoc}
|
1410 |
*/
|
1411 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
1412 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
1413 |
+
|
1414 |
+
$errors = array();
|
1415 |
+
|
1416 |
+
if ( is_array( $validate ) ) {
|
1417 |
+
$errors = $validate;
|
1418 |
+
}
|
1419 |
|
1420 |
if ( empty( self::$api ) ) {
|
1421 |
self::$api = pods_api();
|
1497 |
self::$related_data[ $options['id'] ][ 'related_ids_' . $related_id ] = $bidirectional_ids;
|
1498 |
|
1499 |
if ( empty( $bidirectional_ids ) || ( in_array( (int) $id, $bidirectional_ids, true ) && 1 === count( $bidirectional_ids ) ) ) {
|
1500 |
+
// Translators: %1$s and %2$s stand for field labels.
|
1501 |
+
$errors[] = sprintf( esc_html__( 'The %1$s field is required and cannot be removed by the %2$s field', 'pods' ), $related_field['label'], $options['label'] );
|
1502 |
+
return $errors;
|
1503 |
}
|
1504 |
}
|
1505 |
}
|
1535 |
}
|
1536 |
}//end if
|
1537 |
|
1538 |
+
if ( ! empty( $errors ) ) {
|
1539 |
+
return $errors;
|
1540 |
+
}
|
1541 |
+
|
1542 |
+
return $validate;
|
1543 |
|
1544 |
}
|
1545 |
|
classes/fields/text.php
CHANGED
@@ -152,9 +152,14 @@ class PodsField_Text extends PodsField {
|
|
152 |
* {@inheritdoc}
|
153 |
*/
|
154 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
155 |
|
156 |
$errors = array();
|
157 |
|
|
|
|
|
|
|
|
|
158 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
159 |
|
160 |
if ( is_array( $check ) ) {
|
@@ -171,7 +176,7 @@ class PodsField_Text extends PodsField {
|
|
171 |
return $errors;
|
172 |
}
|
173 |
|
174 |
-
return
|
175 |
}
|
176 |
|
177 |
/**
|
152 |
* {@inheritdoc}
|
153 |
*/
|
154 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
155 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
156 |
|
157 |
$errors = array();
|
158 |
|
159 |
+
if ( is_array( $validate ) ) {
|
160 |
+
$errors = $validate;
|
161 |
+
}
|
162 |
+
|
163 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
164 |
|
165 |
if ( is_array( $check ) ) {
|
176 |
return $errors;
|
177 |
}
|
178 |
|
179 |
+
return $validate;
|
180 |
}
|
181 |
|
182 |
/**
|
classes/fields/website.php
CHANGED
@@ -175,8 +175,14 @@ class PodsField_Website extends PodsField {
|
|
175 |
* {@inheritdoc}
|
176 |
*/
|
177 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
|
|
|
|
178 |
$errors = array();
|
179 |
|
|
|
|
|
|
|
|
|
180 |
$label = strip_tags( pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) ) );
|
181 |
|
182 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
@@ -197,7 +203,7 @@ class PodsField_Website extends PodsField {
|
|
197 |
return $errors;
|
198 |
}
|
199 |
|
200 |
-
return
|
201 |
}
|
202 |
|
203 |
/**
|
175 |
* {@inheritdoc}
|
176 |
*/
|
177 |
public function validate( $value, $name = null, $options = null, $fields = null, $pod = null, $id = null, $params = null ) {
|
178 |
+
$validate = parent::validate( $value, $name, $options, $fields, $pod, $id, $params );
|
179 |
+
|
180 |
$errors = array();
|
181 |
|
182 |
+
if ( is_array( $validate ) ) {
|
183 |
+
$errors = $validate;
|
184 |
+
}
|
185 |
+
|
186 |
$label = strip_tags( pods_v( 'label', $options, ucwords( str_replace( '_', ' ', $name ) ) ) );
|
187 |
|
188 |
$check = $this->pre_save( $value, $id, $name, $options, $fields, $pod, $params );
|
203 |
return $errors;
|
204 |
}
|
205 |
|
206 |
+
return $validate;
|
207 |
}
|
208 |
|
209 |
/**
|
components/Templates/Templates.php
CHANGED
@@ -395,6 +395,23 @@ class Pods_Templates extends PodsComponent {
|
|
395 |
'restrict_capability' => true,
|
396 |
),
|
397 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
);
|
399 |
|
400 |
pods_group_add( $pod, __( 'Restrict Access', 'pods' ), $fields, 'normal', 'high' );
|
@@ -509,12 +526,19 @@ class Pods_Templates extends PodsComponent {
|
|
509 |
$code = $template['code'];
|
510 |
}
|
511 |
|
512 |
-
$
|
|
|
|
|
513 |
|
514 |
$permission = (boolean) apply_filters( 'pods_templates_permission', $permission, $code, $template, $obj );
|
515 |
|
516 |
if ( ! $permission ) {
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
518 |
}
|
519 |
}
|
520 |
}
|
395 |
'restrict_capability' => true,
|
396 |
),
|
397 |
),
|
398 |
+
array(
|
399 |
+
'name' => 'show_restrict_message',
|
400 |
+
'label' => __( 'Show no access message?', 'pods' ),
|
401 |
+
'default' => 1,
|
402 |
+
'type' => 'boolean',
|
403 |
+
'dependency' => true,
|
404 |
+
),
|
405 |
+
array(
|
406 |
+
'name' => 'restrict_message',
|
407 |
+
'label' => __( 'No access message', 'pods' ),
|
408 |
+
'type' => 'wysiwyg',
|
409 |
+
'default' => __( 'You do not have access to view this content.', 'pods' ),
|
410 |
+
'wysiwyg_editor_height' => 200,
|
411 |
+
'depends-on' => array(
|
412 |
+
'show_restrict_message' => true,
|
413 |
+
),
|
414 |
+
),
|
415 |
);
|
416 |
|
417 |
pods_group_add( $pod, __( 'Restrict Access', 'pods' ), $fields, 'normal', 'high' );
|
526 |
$code = $template['code'];
|
527 |
}
|
528 |
|
529 |
+
$options = pods_v( 'options', $template );
|
530 |
+
|
531 |
+
$permission = pods_permission( $options );
|
532 |
|
533 |
$permission = (boolean) apply_filters( 'pods_templates_permission', $permission, $code, $template, $obj );
|
534 |
|
535 |
if ( ! $permission ) {
|
536 |
+
if ( 1 === (int) pods_v( 'show_restrict_message', $options, 1 ) ) {
|
537 |
+
$message = pods_v( 'restrict_message', $options, __( 'You do not have access to view this content.', 'pods' ), true );
|
538 |
+
$message = PodsForm::field_method( 'wysiwyg', 'display', $message, 'restrict_message', $options );
|
539 |
+
return apply_filters( 'pods_templates_permission_denied', $message, $code, $template, $obj );
|
540 |
+
}
|
541 |
+
return '';
|
542 |
}
|
543 |
}
|
544 |
}
|
components/Templates/includes/auto-template/Pods_Templates_Auto_Template_Front_End.php
CHANGED
@@ -24,7 +24,7 @@ class Pods_Templates_Auto_Template_Front_End {
|
|
24 |
*
|
25 |
* @var array
|
26 |
*
|
27 |
-
* @since
|
28 |
*/
|
29 |
private $auto_pods = [];
|
30 |
|
@@ -434,13 +434,6 @@ class Pods_Templates_Auto_Template_Front_End {
|
|
434 |
|
435 |
return $content;
|
436 |
}
|
437 |
-
|
438 |
-
if ( 'the_excerpt' === $current_filter && ( is_single() || is_singular() ) ) {
|
439 |
-
// Do not run excerpts on single.
|
440 |
-
$running = false;
|
441 |
-
|
442 |
-
return $content;
|
443 |
-
}
|
444 |
}
|
445 |
|
446 |
$pod = pods( $pod_name, $pod_id );
|
@@ -481,7 +474,7 @@ class Pods_Templates_Auto_Template_Front_End {
|
|
481 |
/**
|
482 |
* Get list of pod information based on an object or the detected current context.
|
483 |
*
|
484 |
-
* @since
|
485 |
*
|
486 |
* @param null|object $obj The object to get pod information from or null to detect from current context.
|
487 |
*
|
24 |
*
|
25 |
* @var array
|
26 |
*
|
27 |
+
* @since 2.7.25
|
28 |
*/
|
29 |
private $auto_pods = [];
|
30 |
|
434 |
|
435 |
return $content;
|
436 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
}
|
438 |
|
439 |
$pod = pods( $pod_name, $pod_id );
|
474 |
/**
|
475 |
* Get list of pod information based on an object or the detected current context.
|
476 |
*
|
477 |
+
* @since 2.7.25
|
478 |
*
|
479 |
* @param null|object $obj The object to get pod information from or null to detect from current context.
|
480 |
*
|
includes/general.php
CHANGED
@@ -532,7 +532,7 @@ function pods_deprecated( $function, $version, $replacement = null ) {
|
|
532 |
function pods_help( $text, $url = null ) {
|
533 |
|
534 |
if ( ! wp_script_is( 'jquery-qtip2', 'registered' ) ) {
|
535 |
-
wp_register_script( 'jquery-qtip2', PODS_URL . 'ui/js/jquery.qtip.min.js', array( 'jquery' ), '
|
536 |
} elseif ( ! wp_script_is( 'jquery-qtip2', 'queue' ) && ! wp_script_is( 'jquery-qtip2', 'to_do' ) && ! wp_script_is( 'jquery-qtip2', 'done' ) ) {
|
537 |
wp_enqueue_script( 'jquery-qtip2' );
|
538 |
}
|
532 |
function pods_help( $text, $url = null ) {
|
533 |
|
534 |
if ( ! wp_script_is( 'jquery-qtip2', 'registered' ) ) {
|
535 |
+
wp_register_script( 'jquery-qtip2', PODS_URL . 'ui/js/qtip/jquery.qtip.min.js', array( 'jquery' ), '3.0.3' );
|
536 |
} elseif ( ! wp_script_is( 'jquery-qtip2', 'queue' ) && ! wp_script_is( 'jquery-qtip2', 'to_do' ) && ! wp_script_is( 'jquery-qtip2', 'done' ) ) {
|
537 |
wp_enqueue_script( 'jquery-qtip2' );
|
538 |
}
|
init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Pods - Custom Content Types and Fields
|
4 |
Plugin URI: https://pods.io/
|
5 |
Description: Pods is a framework for creating, managing, and deploying customized content types and fields
|
6 |
-
Version: 2.7.
|
7 |
Author: Pods Framework Team
|
8 |
Author URI: https://pods.io/about/
|
9 |
Text Domain: pods
|
@@ -37,7 +37,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
|
|
37 |
add_action( 'init', 'pods_deactivate_pods_ui' );
|
38 |
} else {
|
39 |
// Current version
|
40 |
-
define( 'PODS_VERSION', '2.7.
|
41 |
|
42 |
// Version tracking between DB updates themselves
|
43 |
define( 'PODS_DB_VERSION', '2.3.5' );
|
3 |
Plugin Name: Pods - Custom Content Types and Fields
|
4 |
Plugin URI: https://pods.io/
|
5 |
Description: Pods is a framework for creating, managing, and deploying customized content types and fields
|
6 |
+
Version: 2.7.25
|
7 |
Author: Pods Framework Team
|
8 |
Author URI: https://pods.io/about/
|
9 |
Text Domain: pods
|
37 |
add_action( 'init', 'pods_deactivate_pods_ui' );
|
38 |
} else {
|
39 |
// Current version
|
40 |
+
define( 'PODS_VERSION', '2.7.25' );
|
41 |
|
42 |
// Version tracking between DB updates themselves
|
43 |
define( 'PODS_DB_VERSION', '2.3.5' );
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: sc0ttkclark, pglewis, jimtrue, keraweb, quasel, jamesgol, ramoonus
|
|
3 |
Donate link: https://pods.io/friends-of-pods/
|
4 |
Tags: pods, custom post types, custom taxonomies, content types, custom fields, cck, database, user fields, comment fields, media fields, relationships, drupal
|
5 |
Requires at least: 4.5
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 5.3
|
8 |
-
Stable tag: 2.7.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -190,6 +190,24 @@ We are also available through our [Live Slack Chat](https://pods.io/chat/) to he
|
|
190 |
|
191 |
== Changelog ==
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
= 2.7.24 - November 5th 2020 =
|
194 |
|
195 |
**Bug Fixes**
|
3 |
Donate link: https://pods.io/friends-of-pods/
|
4 |
Tags: pods, custom post types, custom taxonomies, content types, custom fields, cck, database, user fields, comment fields, media fields, relationships, drupal
|
5 |
Requires at least: 4.5
|
6 |
+
Tested up to: 5.6
|
7 |
Requires PHP: 5.3
|
8 |
+
Stable tag: 2.7.25
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
190 |
|
191 |
== Changelog ==
|
192 |
|
193 |
+
= 2.7.25 - December 28th 2020 =
|
194 |
+
|
195 |
+
**New Features & Enhancements**
|
196 |
+
|
197 |
+
* Added: Custom no access message for templates. #5875 (@JoryHogeveen)
|
198 |
+
* Added: New filter `pods_field_validate_{$type}`. #1106 (@JoryHogeveen)
|
199 |
+
|
200 |
+
**Bug Fixes**
|
201 |
+
|
202 |
+
* Fixed: Ensure compatibility with the WordPress 5.6 jQuery update. #5892, #5896 & #5897 (@JoryHogeveen)
|
203 |
+
* Fixed: Prevent `wp_unslash()` from unnecessarily over sanitizing input. #5040 & #4424 (@JoryHogeveen)
|
204 |
+
* Fixed: Prevent issues with HTML entities in custom relationship values when it gets to JavaScript. #5894 (@JoryHogeveen)
|
205 |
+
* Fixed: Better support multiple languages in the Relationship AJAX search. #5888 (@JoryHogeveen)
|
206 |
+
* Fixed: Include the `post_type` value in attachment saves so that the more WordPress core actions trigger. #5748 (@JoryHogeveen)
|
207 |
+
* Fixed: Allow `the_excerpt` to be used as custom filter on singular pages. #5899 (@JoryHogeveen)
|
208 |
+
* Fixed: Better support caching of the avatar images/data and integrate with the `get_avatar_data` filter. #5771 (@JoryHogeveen)
|
209 |
+
|
210 |
+
|
211 |
= 2.7.24 - November 5th 2020 =
|
212 |
|
213 |
**Bug Fixes**
|
ui/admin/setup-add.php
CHANGED
@@ -412,8 +412,7 @@
|
|
412 |
|
413 |
if ( !isNaN( id ) ) {
|
414 |
document.location = 'admin.php?page=pods&action=edit&id=' + id + '&do=create';
|
415 |
-
}
|
416 |
-
else {
|
417 |
document.location = 'admin.php?page=pods&do=create';
|
418 |
}
|
419 |
};
|
@@ -423,16 +422,22 @@
|
|
423 |
};
|
424 |
|
425 |
jQuery( function ( $ ) {
|
426 |
-
$
|
427 |
-
|
428 |
-
$
|
429 |
-
$
|
430 |
-
$
|
431 |
-
$
|
432 |
-
$
|
433 |
-
|
434 |
-
$
|
435 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
} );
|
437 |
} );
|
438 |
</script>
|
412 |
|
413 |
if ( !isNaN( id ) ) {
|
414 |
document.location = 'admin.php?page=pods&action=edit&id=' + id + '&do=create';
|
415 |
+
} else {
|
|
|
416 |
document.location = 'admin.php?page=pods&do=create';
|
417 |
}
|
418 |
};
|
422 |
};
|
423 |
|
424 |
jQuery( function ( $ ) {
|
425 |
+
var $document = $( document );
|
426 |
+
|
427 |
+
$document.Pods( 'validate' );
|
428 |
+
$document.Pods( 'submit' );
|
429 |
+
$document.Pods( 'wizard' );
|
430 |
+
$document.Pods( 'dependency' );
|
431 |
+
$document.Pods( 'advanced' );
|
432 |
+
$document.Pods( 'confirm' );
|
433 |
+
$document.Pods( 'sluggable' );
|
434 |
+
|
435 |
+
var $admin = $( '.pods-admin' ),
|
436 |
+
$toggles = $admin.find( '.pods-dependent-toggle[data-name-clean]' );
|
437 |
+
|
438 |
+
$toggles.trigger( 'change' );
|
439 |
+
$admin.on( 'render', '.pods-form-ui-field', function ( e ) {
|
440 |
+
$toggles.trigger( 'change' );
|
441 |
} );
|
442 |
} );
|
443 |
</script>
|
ui/fields/_db.php
CHANGED
@@ -8,7 +8,7 @@ $attributes = PodsForm::merge_attributes( $attributes, $name, $form_
|
|
8 |
<input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> />
|
9 |
<script>
|
10 |
jQuery( function ( $ ) {
|
11 |
-
$( 'input#<?php echo esc_js( $attributes['id'] ); ?>' ).
|
12 |
var newval = $( this ).val().toLowerCase().replace( /(\s)/g, '_' ).replace( /([^0-9a-z_\-])/g, '' ).replace( /(_){2,}/g, '_' ).replace( /_$/, '' );
|
13 |
$( this ).val( newval );
|
14 |
} );
|
8 |
<input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> />
|
9 |
<script>
|
10 |
jQuery( function ( $ ) {
|
11 |
+
$( 'input#<?php echo esc_js( $attributes['id'] ); ?>' ).on( 'change', function () {
|
12 |
var newval = $( this ).val().toLowerCase().replace( /(\s)/g, '_' ).replace( /([^0-9a-z_\-])/g, '' ).replace( /(_){2,}/g, '_' ).replace( /_$/, '' );
|
13 |
$( this ).val( newval );
|
14 |
} );
|
ui/fields/slug.php
CHANGED
@@ -8,7 +8,7 @@ $attributes = PodsForm::merge_attributes( $attributes, $name, $form_
|
|
8 |
<input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> />
|
9 |
<script>
|
10 |
jQuery( function ( $ ) {
|
11 |
-
$( 'input#<?php echo esc_js( $attributes['id'] ); ?>' ).
|
12 |
var newval = $( this )
|
13 |
.val()
|
14 |
.toLowerCase()
|
8 |
<input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> />
|
9 |
<script>
|
10 |
jQuery( function ( $ ) {
|
11 |
+
$( 'input#<?php echo esc_js( $attributes['id'] ); ?>' ).on( 'change', function () {
|
12 |
var newval = $( this )
|
13 |
.val()
|
14 |
.toLowerCase()
|
ui/js/admin-importer.js
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
jQuery(document).ready(function () {
|
2 |
|
3 |
-
jQuery('#filter-right-tables, #filter-left-tables').focus
|
4 |
if (jQuery(this).val() === 'Filter Tables') {
|
5 |
jQuery(this).val('');
|
6 |
}
|
7 |
-
});
|
8 |
|
9 |
-
jQuery('#filter-right-tables, #filter-left-tables').blur
|
10 |
if (jQuery(this).val() === '') {
|
11 |
jQuery(this).val('Filter Tables');
|
12 |
}
|
13 |
-
});
|
14 |
|
15 |
-
jQuery('#filter-right-tables').keyup
|
16 |
var query = jQuery(this).val();
|
17 |
|
18 |
if (query === '') {
|
@@ -25,7 +25,7 @@ jQuery(document).ready(function () {
|
|
25 |
}
|
26 |
});
|
27 |
|
28 |
-
jQuery('#filter-left-tables').keyup
|
29 |
var query = jQuery(this).val();
|
30 |
|
31 |
if (query === '') {
|
@@ -52,7 +52,7 @@ jQuery(document).ready(function () {
|
|
52 |
* and disables all other checkboxes since only one table can be selected
|
53 |
* per import.
|
54 |
*/
|
55 |
-
jQuery('input[type="checkbox"].pods-importable-table').click
|
56 |
var checkedTable = jQuery(this).attr('name');
|
57 |
var checkedValue = jQuery(this).val();
|
58 |
var checked = jQuery(this).is(':checked');
|
@@ -75,7 +75,7 @@ jQuery(document).ready(function () {
|
|
75 |
});
|
76 |
|
77 |
// Step 1 submit
|
78 |
-
jQuery('button#continue-to-field-selection').click
|
79 |
jQuery('form#pods-import-table-selection').submit();
|
80 |
});
|
81 |
|
@@ -84,7 +84,7 @@ jQuery(document).ready(function () {
|
|
84 |
* closest parent tr, and finds all input/select elements within it and disables
|
85 |
* or enables them.
|
86 |
*/
|
87 |
-
jQuery('.enabled-status.status-switcher').click
|
88 |
var enabled = jQuery(this).hasClass('enabled');
|
89 |
|
90 |
if (enabled) {
|
@@ -108,7 +108,7 @@ jQuery(document).ready(function () {
|
|
108 |
* Ensures at least one column is enabled for converting to a pod,
|
109 |
* and that at a minimum the pod name is entered.
|
110 |
*/
|
111 |
-
jQuery('a#pods-import-create-pod').click
|
112 |
if (jQuery('tr.pod-column-row.enabled').length === 0) {
|
113 |
alert('At least one column must be selected to convert.');
|
114 |
} else if (jQuery('input[name="new_pod_data[pod_name]"]').val() == '') {
|
1 |
jQuery(document).ready(function () {
|
2 |
|
3 |
+
jQuery('#filter-right-tables, #filter-left-tables').on( 'focus', function() {
|
4 |
if (jQuery(this).val() === 'Filter Tables') {
|
5 |
jQuery(this).val('');
|
6 |
}
|
7 |
+
} );
|
8 |
|
9 |
+
jQuery('#filter-right-tables, #filter-left-tables').on( 'blur', function() {
|
10 |
if (jQuery(this).val() === '') {
|
11 |
jQuery(this).val('Filter Tables');
|
12 |
}
|
13 |
+
} );
|
14 |
|
15 |
+
jQuery('#filter-right-tables').on( 'keyup', function() {
|
16 |
var query = jQuery(this).val();
|
17 |
|
18 |
if (query === '') {
|
25 |
}
|
26 |
});
|
27 |
|
28 |
+
jQuery('#filter-left-tables').on( 'keyup', function() {
|
29 |
var query = jQuery(this).val();
|
30 |
|
31 |
if (query === '') {
|
52 |
* and disables all other checkboxes since only one table can be selected
|
53 |
* per import.
|
54 |
*/
|
55 |
+
jQuery('input[type="checkbox"].pods-importable-table').on( 'click', function () {
|
56 |
var checkedTable = jQuery(this).attr('name');
|
57 |
var checkedValue = jQuery(this).val();
|
58 |
var checked = jQuery(this).is(':checked');
|
75 |
});
|
76 |
|
77 |
// Step 1 submit
|
78 |
+
jQuery('button#continue-to-field-selection').on( 'click', function () {
|
79 |
jQuery('form#pods-import-table-selection').submit();
|
80 |
});
|
81 |
|
84 |
* closest parent tr, and finds all input/select elements within it and disables
|
85 |
* or enables them.
|
86 |
*/
|
87 |
+
jQuery('.enabled-status.status-switcher').on( 'click', function () {
|
88 |
var enabled = jQuery(this).hasClass('enabled');
|
89 |
|
90 |
if (enabled) {
|
108 |
* Ensures at least one column is enabled for converting to a pod,
|
109 |
* and that at a minimum the pod name is entered.
|
110 |
*/
|
111 |
+
jQuery('a#pods-import-create-pod').on( 'click', function () {
|
112 |
if (jQuery('tr.pod-column-row.enabled').length === 0) {
|
113 |
alert('At least one column must be selected to convert.');
|
114 |
} else if (jQuery('input[name="new_pod_data[pod_name]"]').val() == '') {
|
ui/js/advanced.js
CHANGED
@@ -449,37 +449,37 @@ jQuery(document).ready(function($) {
|
|
449 |
/**
|
450 |
* Event Handlers
|
451 |
*/
|
452 |
-
$('#pods-parts-pages-edit').click
|
453 |
e.preventDefault();
|
454 |
populateEditPages();
|
455 |
$('#pods-parts-popup').dialog({title: 'Select Pods Page to Edit', width: $bigWidth}).dialog('open');
|
456 |
});
|
457 |
|
458 |
-
$('#pods-parts-pages-add').click
|
459 |
e.preventDefault();
|
460 |
populateAddPage();
|
461 |
$('#pods-parts-popup').dialog({title: 'Create New Pods Page', width: $smallWidth}).dialog('open');
|
462 |
});
|
463 |
|
464 |
-
$('#pods-parts-templates-edit').click
|
465 |
e.preventDefault();
|
466 |
populateEditTemplates();
|
467 |
$('#pods-parts-popup').dialog({title: 'Select Pods Template to Edit', width: $bigWidth}).dialog('open');
|
468 |
});
|
469 |
|
470 |
-
$('#pods-parts-templates-add').click
|
471 |
e.preventDefault();
|
472 |
populateAddTemplate();
|
473 |
$('#pods-parts-popup').dialog({title: 'Create New Pods Template', width: $smallWidth}).dialog('open');
|
474 |
});
|
475 |
|
476 |
-
$('#pods-parts-helpers-edit').click
|
477 |
e.preventDefault();
|
478 |
populateEditHelpers();
|
479 |
$('#pods-parts-popup').dialog({title: 'Select Pods Helper to Edit', width: $bigWidth}).dialog('open');
|
480 |
});
|
481 |
|
482 |
-
$('#pods-parts-helpers-add').click
|
483 |
e.preventDefault();
|
484 |
populateAddHelper();
|
485 |
$('#pods-parts-popup').dialog({title: 'Create New Pods Helper', width: $smallWidth}).dialog('open');
|
@@ -497,4 +497,4 @@ jQuery(document).ready(function($) {
|
|
497 |
hide: 'fade',
|
498 |
show: 'fade'
|
499 |
})
|
500 |
-
});
|
449 |
/**
|
450 |
* Event Handlers
|
451 |
*/
|
452 |
+
$('#pods-parts-pages-edit').on( 'click', function(e){
|
453 |
e.preventDefault();
|
454 |
populateEditPages();
|
455 |
$('#pods-parts-popup').dialog({title: 'Select Pods Page to Edit', width: $bigWidth}).dialog('open');
|
456 |
});
|
457 |
|
458 |
+
$('#pods-parts-pages-add').on( 'click', function(e){
|
459 |
e.preventDefault();
|
460 |
populateAddPage();
|
461 |
$('#pods-parts-popup').dialog({title: 'Create New Pods Page', width: $smallWidth}).dialog('open');
|
462 |
});
|
463 |
|
464 |
+
$('#pods-parts-templates-edit').on( 'click', function(e){
|
465 |
e.preventDefault();
|
466 |
populateEditTemplates();
|
467 |
$('#pods-parts-popup').dialog({title: 'Select Pods Template to Edit', width: $bigWidth}).dialog('open');
|
468 |
});
|
469 |
|
470 |
+
$('#pods-parts-templates-add').on( 'click', function(e){
|
471 |
e.preventDefault();
|
472 |
populateAddTemplate();
|
473 |
$('#pods-parts-popup').dialog({title: 'Create New Pods Template', width: $smallWidth}).dialog('open');
|
474 |
});
|
475 |
|
476 |
+
$('#pods-parts-helpers-edit').on( 'click', function(e){
|
477 |
e.preventDefault();
|
478 |
populateEditHelpers();
|
479 |
$('#pods-parts-popup').dialog({title: 'Select Pods Helper to Edit', width: $bigWidth}).dialog('open');
|
480 |
});
|
481 |
|
482 |
+
$('#pods-parts-helpers-add').on( 'click', function(e){
|
483 |
e.preventDefault();
|
484 |
populateAddHelper();
|
485 |
$('#pods-parts-popup').dialog({title: 'Create New Pods Helper', width: $smallWidth}).dialog('open');
|
497 |
hide: 'fade',
|
498 |
show: 'fade'
|
499 |
})
|
500 |
+
});
|
ui/js/cleditor/images/buttons.gif
ADDED
Binary file
|
ui/js/cleditor/images/toolbar.gif
ADDED
Binary file
|
ui/js/cleditor/jquery.cleditor.css
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.cleditorMain {border:1px solid #999; padding:0 1px 1px; background-color:white}
|
2 |
+
.cleditorMain,
|
3 |
+
.cleditorPopup,
|
4 |
+
.cleditorMain * {-moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box}
|
5 |
+
.cleditorMain iframe {border:none; margin:0; padding:0}
|
6 |
+
.cleditorMain textarea {overflow-y:scroll; font:10pt Arial,Verdana; resize:none; outline:none}
|
7 |
+
.cleditorToolbar {background: url('images/toolbar.gif') repeat}
|
8 |
+
.cleditorGroup {float:left; height:26px}
|
9 |
+
.cleditorButton {float:left; width:24px; height:24px; margin:1px 0 1px 0; background: url('images/buttons.gif')}
|
10 |
+
.cleditorDisabled {opacity:0.3; filter:alpha(opacity=30)}
|
11 |
+
.cleditorDivider {float:left; width:1px; height:23px; margin:1px 0 1px 0; background:#CCC}
|
12 |
+
.cleditorPopup {border:solid 1px #999; background-color:white; color:#333333; position:absolute; font:10pt Arial,Verdana; cursor:default; z-index:10000}
|
13 |
+
.cleditorList div {padding:2px 4px 2px 4px}
|
14 |
+
.cleditorList p,
|
15 |
+
.cleditorList h1,
|
16 |
+
.cleditorList h2,
|
17 |
+
.cleditorList h3,
|
18 |
+
.cleditorList h4,
|
19 |
+
.cleditorList h5,
|
20 |
+
.cleditorList h6,
|
21 |
+
.cleditorList font {padding:0; margin:0; background-color:Transparent}
|
22 |
+
.cleditorColor {width:150px; padding:1px 0 0 1px}
|
23 |
+
.cleditorColor div {float:left; width:14px; height:14px; margin:0 1px 1px 0}
|
24 |
+
.cleditorPrompt {background-color:#F6F7F9; padding:8px; font-size:8.5pt}
|
25 |
+
.cleditorPrompt label {padding-bottom:8px}
|
26 |
+
.cleditorMsg {background-color:#FDFCEE; width:150px; padding:4px; font-size:8.5pt}
|
ui/js/cleditor/jquery.cleditor.js
ADDED
@@ -0,0 +1,1190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
CLEditor WYSIWYG HTML Editor v1.4.5
|
3 |
+
http://premiumsoftware.net/CLEditor
|
4 |
+
requires jQuery v1.4.2 or later
|
5 |
+
|
6 |
+
Copyright 2010, Chris Landowski, Premium Software, LLC
|
7 |
+
Dual licensed under the MIT or GPL Version 2 licenses.
|
8 |
+
*/
|
9 |
+
|
10 |
+
(function ($) {
|
11 |
+
|
12 |
+
//==============
|
13 |
+
// jQuery Plugin
|
14 |
+
//==============
|
15 |
+
|
16 |
+
$.cleditor = {
|
17 |
+
|
18 |
+
// Define the defaults used for all new cleditor instances
|
19 |
+
defaultOptions: {
|
20 |
+
width: 'auto', // width not including margins, borders or padding
|
21 |
+
height: 250, // height not including margins, borders or padding
|
22 |
+
controls: // controls to add to the toolbar
|
23 |
+
"bold italic underline strikethrough subscript superscript | font size " +
|
24 |
+
"style | color highlight removeformat | bullets numbering | outdent " +
|
25 |
+
"indent | alignleft center alignright justify | undo redo | " +
|
26 |
+
"rule image link unlink | cut copy paste pastetext | print source",
|
27 |
+
colors: // colors in the color popup
|
28 |
+
"FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF " +
|
29 |
+
"CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F " +
|
30 |
+
"BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C " +
|
31 |
+
"999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C " +
|
32 |
+
"666 900 C60 C93 990 090 399 33F 60C 939 " +
|
33 |
+
"333 600 930 963 660 060 366 009 339 636 " +
|
34 |
+
"000 300 630 633 330 030 033 006 309 303",
|
35 |
+
fonts: // font names in the font popup
|
36 |
+
"Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," +
|
37 |
+
"Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
|
38 |
+
sizes: // sizes in the font size popup
|
39 |
+
"1,2,3,4,5,6,7",
|
40 |
+
styles: // styles in the style popup
|
41 |
+
[["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
|
42 |
+
["Header 3", "<h3>"], ["Header 4", "<h4>"], ["Header 5", "<h5>"],
|
43 |
+
["Header 6", "<h6>"]],
|
44 |
+
useCSS: true, // use CSS to style HTML when possible (not supported in ie)
|
45 |
+
docType: // Document type contained within the editor
|
46 |
+
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
|
47 |
+
docCSSFile: // CSS file used to style the document contained within the editor
|
48 |
+
"",
|
49 |
+
bodyStyle: // style to assign to document body contained within the editor
|
50 |
+
"margin:4px; font:10pt Arial,Verdana; cursor:text"
|
51 |
+
},
|
52 |
+
|
53 |
+
// Define all usable toolbar buttons - the init string property is
|
54 |
+
// expanded during initialization back into the buttons object and
|
55 |
+
// separate object properties are created for each button.
|
56 |
+
// e.g. buttons.size.title = "Font Size"
|
57 |
+
buttons: {
|
58 |
+
// name,title,command,popupName (""=use name)
|
59 |
+
init:
|
60 |
+
"bold,,|" +
|
61 |
+
"italic,,|" +
|
62 |
+
"underline,,|" +
|
63 |
+
"strikethrough,,|" +
|
64 |
+
"subscript,,|" +
|
65 |
+
"superscript,,|" +
|
66 |
+
"font,,fontname,|" +
|
67 |
+
"size,Font Size,fontsize,|" +
|
68 |
+
"style,,formatblock,|" +
|
69 |
+
"color,Font Color,forecolor,|" +
|
70 |
+
"highlight,Text Highlight Color,hilitecolor,color|" +
|
71 |
+
"removeformat,Remove Formatting,|" +
|
72 |
+
"bullets,,insertunorderedlist|" +
|
73 |
+
"numbering,,insertorderedlist|" +
|
74 |
+
"outdent,,|" +
|
75 |
+
"indent,,|" +
|
76 |
+
"alignleft,Align Text Left,justifyleft|" +
|
77 |
+
"center,,justifycenter|" +
|
78 |
+
"alignright,Align Text Right,justifyright|" +
|
79 |
+
"justify,,justifyfull|" +
|
80 |
+
"undo,,|" +
|
81 |
+
"redo,,|" +
|
82 |
+
"rule,Insert Horizontal Rule,inserthorizontalrule|" +
|
83 |
+
"image,Insert Image,insertimage,url|" +
|
84 |
+
"link,Insert Hyperlink,createlink,url|" +
|
85 |
+
"unlink,Remove Hyperlink,|" +
|
86 |
+
"cut,,|" +
|
87 |
+
"copy,,|" +
|
88 |
+
"paste,,|" +
|
89 |
+
"pastetext,Paste as Text,inserthtml,|" +
|
90 |
+
"print,,|" +
|
91 |
+
"source,Show Source"
|
92 |
+
},
|
93 |
+
|
94 |
+
// imagesPath - returns the path to the images folder
|
95 |
+
imagesPath: function () { return imagesPath(); }
|
96 |
+
|
97 |
+
};
|
98 |
+
|
99 |
+
// cleditor - creates a new editor for each of the matched textareas
|
100 |
+
$.fn.cleditor = function (options) {
|
101 |
+
|
102 |
+
// Create a new jQuery object to hold the results
|
103 |
+
var $result = $([]);
|
104 |
+
|
105 |
+
// Loop through all matching textareas and create the editors
|
106 |
+
this.each(function (idx, elem) {
|
107 |
+
if (elem.tagName.toUpperCase() === "TEXTAREA") {
|
108 |
+
var data = $.data(elem, CLEDITOR);
|
109 |
+
if (!data) data = new cleditor(elem, options);
|
110 |
+
$result = $result.add(data);
|
111 |
+
}
|
112 |
+
});
|
113 |
+
|
114 |
+
// return the new jQuery object
|
115 |
+
return $result;
|
116 |
+
|
117 |
+
};
|
118 |
+
|
119 |
+
//==================
|
120 |
+
// Private Variables
|
121 |
+
//==================
|
122 |
+
|
123 |
+
var
|
124 |
+
|
125 |
+
// Misc constants
|
126 |
+
BACKGROUND_COLOR = "backgroundColor",
|
127 |
+
BLURRED = "blurred",
|
128 |
+
BUTTON = "button",
|
129 |
+
BUTTON_NAME = "buttonName",
|
130 |
+
CHANGE = "change",
|
131 |
+
CLEDITOR = "cleditor",
|
132 |
+
CLICK = "click",
|
133 |
+
DISABLED = "disabled",
|
134 |
+
DIV_TAG = "<div>",
|
135 |
+
FOCUSED = "focused",
|
136 |
+
TRANSPARENT = "transparent",
|
137 |
+
UNSELECTABLE = "unselectable",
|
138 |
+
|
139 |
+
// Class name constants
|
140 |
+
MAIN_CLASS = "cleditorMain", // main containing div
|
141 |
+
TOOLBAR_CLASS = "cleditorToolbar", // toolbar div inside main div
|
142 |
+
GROUP_CLASS = "cleditorGroup", // group divs inside the toolbar div
|
143 |
+
BUTTON_CLASS = "cleditorButton", // button divs inside group div
|
144 |
+
DISABLED_CLASS = "cleditorDisabled",// disabled button divs
|
145 |
+
DIVIDER_CLASS = "cleditorDivider", // divider divs inside group div
|
146 |
+
POPUP_CLASS = "cleditorPopup", // popup divs inside body
|
147 |
+
LIST_CLASS = "cleditorList", // list popup divs inside body
|
148 |
+
COLOR_CLASS = "cleditorColor", // color popup div inside body
|
149 |
+
PROMPT_CLASS = "cleditorPrompt", // prompt popup divs inside body
|
150 |
+
MSG_CLASS = "cleditorMsg", // message popup div inside body
|
151 |
+
|
152 |
+
// Browser detection
|
153 |
+
ua = navigator.userAgent.toLowerCase(),
|
154 |
+
ie = /msie/.test(ua),
|
155 |
+
ie6 = /msie\s6/.test(ua),
|
156 |
+
iege11 = /(trident)(?:.*rv:([\w.]+))?/.test(ua),
|
157 |
+
webkit = /webkit/.test(ua),
|
158 |
+
|
159 |
+
// Test for iPhone/iTouch/iPad
|
160 |
+
iOS = /iPhone|iPad|iPod/i.test(ua),
|
161 |
+
|
162 |
+
// Popups are created once as needed and shared by all editor instances
|
163 |
+
popups = {},
|
164 |
+
|
165 |
+
// Used to prevent the document click event from being bound more than once
|
166 |
+
documentClickAssigned,
|
167 |
+
|
168 |
+
// Local copy of the buttons object
|
169 |
+
buttons = $.cleditor.buttons;
|
170 |
+
|
171 |
+
//===============
|
172 |
+
// Initialization
|
173 |
+
//===============
|
174 |
+
|
175 |
+
// Expand the buttons.init string back into the buttons object
|
176 |
+
// and create seperate object properties for each button.
|
177 |
+
// e.g. buttons.size.title = "Font Size"
|
178 |
+
$.each(buttons.init.split("|"), function (idx, button) {
|
179 |
+
var items = button.split(","), name = items[0];
|
180 |
+
buttons[name] = {
|
181 |
+
stripIndex: idx,
|
182 |
+
name: name,
|
183 |
+
title: items[1] === "" ? name.charAt(0).toUpperCase() + name.substr(1) : items[1],
|
184 |
+
command: items[2] === "" ? name : items[2],
|
185 |
+
popupName: items[3] === "" ? name : items[3]
|
186 |
+
};
|
187 |
+
});
|
188 |
+
delete buttons.init;
|
189 |
+
|
190 |
+
//============
|
191 |
+
// Constructor
|
192 |
+
//============
|
193 |
+
|
194 |
+
// cleditor - creates a new editor for the passed in textarea element
|
195 |
+
cleditor = function (area, options) {
|
196 |
+
|
197 |
+
var editor = this;
|
198 |
+
|
199 |
+
// Get the defaults and override with options
|
200 |
+
editor.options = options = $.extend({}, $.cleditor.defaultOptions, options);
|
201 |
+
|
202 |
+
// Hide the textarea and associate it with this editor
|
203 |
+
var $area = editor.$area = $(area)
|
204 |
+
.css({ border: "none", margin: 0, padding: 0 }) // Needed for IE6 & 7 (won't work in CSS file)
|
205 |
+
.hide()
|
206 |
+
.data(CLEDITOR, editor)
|
207 |
+
.blur(function () {
|
208 |
+
// Update the iframe when the textarea loses focus
|
209 |
+
updateFrame(editor, true);
|
210 |
+
});
|
211 |
+
|
212 |
+
// Create the main container
|
213 |
+
var $main = editor.$main = $(DIV_TAG)
|
214 |
+
.addClass(MAIN_CLASS)
|
215 |
+
.width(options.width)
|
216 |
+
.height(options.height);
|
217 |
+
|
218 |
+
// Create the toolbar
|
219 |
+
var $toolbar = editor.$toolbar = $(DIV_TAG)
|
220 |
+
.addClass(TOOLBAR_CLASS)
|
221 |
+
.appendTo($main);
|
222 |
+
|
223 |
+
// Add the first group to the toolbar
|
224 |
+
var $group = $(DIV_TAG)
|
225 |
+
.addClass(GROUP_CLASS)
|
226 |
+
.appendTo($toolbar);
|
227 |
+
|
228 |
+
// Initialize the group width
|
229 |
+
var groupWidth = 0;
|
230 |
+
|
231 |
+
// Add the buttons to the toolbar
|
232 |
+
$.each(options.controls.split(" "), function (idx, buttonName) {
|
233 |
+
if (buttonName === "") return true;
|
234 |
+
|
235 |
+
// Divider
|
236 |
+
if (buttonName === "|") {
|
237 |
+
|
238 |
+
// Add a new divider to the group
|
239 |
+
var $div = $(DIV_TAG)
|
240 |
+
.addClass(DIVIDER_CLASS)
|
241 |
+
.appendTo($group);
|
242 |
+
|
243 |
+
// Update the group width
|
244 |
+
$group.width(groupWidth + 1);
|
245 |
+
groupWidth = 0;
|
246 |
+
|
247 |
+
// Create a new group
|
248 |
+
$group = $(DIV_TAG)
|
249 |
+
.addClass(GROUP_CLASS)
|
250 |
+
.appendTo($toolbar);
|
251 |
+
|
252 |
+
}
|
253 |
+
|
254 |
+
// Button
|
255 |
+
else {
|
256 |
+
|
257 |
+
// Get the button definition
|
258 |
+
var button = buttons[buttonName];
|
259 |
+
|
260 |
+
// Add a new button to the group
|
261 |
+
var $buttonDiv = $(DIV_TAG)
|
262 |
+
.data(BUTTON_NAME, button.name)
|
263 |
+
.addClass(BUTTON_CLASS)
|
264 |
+
.attr("title", button.title)
|
265 |
+
.bind(CLICK, $.proxy(buttonClick, editor))
|
266 |
+
.appendTo($group)
|
267 |
+
.hover(hoverEnter, hoverLeave);
|
268 |
+
|
269 |
+
// Update the group width
|
270 |
+
groupWidth += 24;
|
271 |
+
$group.width(groupWidth + 1);
|
272 |
+
|
273 |
+
// Prepare the button image
|
274 |
+
var map = {};
|
275 |
+
if (button.css) map = button.css;
|
276 |
+
else if (button.image) map.backgroundImage = imageUrl(button.image);
|
277 |
+
if (button.stripIndex) map.backgroundPosition = button.stripIndex * -24;
|
278 |
+
$buttonDiv.css(map);
|
279 |
+
|
280 |
+
// Add the unselectable attribute for ie
|
281 |
+
if (ie)
|
282 |
+
$buttonDiv.attr(UNSELECTABLE, "on");
|
283 |
+
|
284 |
+
// Create the popup
|
285 |
+
if (button.popupName)
|
286 |
+
createPopup(button.popupName, options, button.popupClass,
|
287 |
+
button.popupContent, button.popupHover);
|
288 |
+
|
289 |
+
}
|
290 |
+
|
291 |
+
});
|
292 |
+
|
293 |
+
// Add the main div to the DOM and append the textarea
|
294 |
+
$main.insertBefore($area)
|
295 |
+
.append($area);
|
296 |
+
|
297 |
+
// Bind the document click event handler
|
298 |
+
if (!documentClickAssigned) {
|
299 |
+
$(document).click(function (e) {
|
300 |
+
// Dismiss all non-prompt popups
|
301 |
+
var $target = $(e.target);
|
302 |
+
if (!$target.add($target.parents()).is("." + PROMPT_CLASS))
|
303 |
+
hidePopups();
|
304 |
+
});
|
305 |
+
documentClickAssigned = true;
|
306 |
+
}
|
307 |
+
|
308 |
+
// Bind the window resize event when the width or height is auto or %
|
309 |
+
if (/auto|%/.test("" + options.width + options.height))
|
310 |
+
$(window).bind("resize.cleditor", function () { refresh(editor); });
|
311 |
+
|
312 |
+
// Create the iframe and resize the controls
|
313 |
+
refresh(editor);
|
314 |
+
|
315 |
+
};
|
316 |
+
|
317 |
+
//===============
|
318 |
+
// Public Methods
|
319 |
+
//===============
|
320 |
+
|
321 |
+
var fn = cleditor.prototype,
|
322 |
+
|
323 |
+
// Expose the following private functions as methods on the cleditor object.
|
324 |
+
// The closure compiler will rename the private functions. However, the
|
325 |
+
// exposed method names on the cleditor object will remain fixed.
|
326 |
+
methods = [
|
327 |
+
["clear", clear],
|
328 |
+
["disable", disable],
|
329 |
+
["execCommand", execCommand],
|
330 |
+
["focus", focus],
|
331 |
+
["hidePopups", hidePopups],
|
332 |
+
["sourceMode", sourceMode, true],
|
333 |
+
["refresh", refresh],
|
334 |
+
["select", select],
|
335 |
+
["selectedHTML", selectedHTML, true],
|
336 |
+
["selectedText", selectedText, true],
|
337 |
+
["showMessage", showMessage],
|
338 |
+
["updateFrame", updateFrame],
|
339 |
+
["updateTextArea", updateTextArea]
|
340 |
+
];
|
341 |
+
|
342 |
+
$.each(methods, function (idx, method) {
|
343 |
+
fn[method[0]] = function () {
|
344 |
+
var editor = this, args = [editor];
|
345 |
+
// using each here would cast booleans into objects!
|
346 |
+
for (var x = 0; x < arguments.length; x++) { args.push(arguments[x]); }
|
347 |
+
var result = method[1].apply(editor, args);
|
348 |
+
if (method[2]) return result;
|
349 |
+
return editor;
|
350 |
+
};
|
351 |
+
});
|
352 |
+
|
353 |
+
// blurred - shortcut for .bind("blurred", handler) or .trigger("blurred")
|
354 |
+
fn.blurred = function (handler) {
|
355 |
+
var $this = $(this);
|
356 |
+
return handler ? $this.bind(BLURRED, handler) : $this.trigger(BLURRED);
|
357 |
+
};
|
358 |
+
|
359 |
+
// change - shortcut for .bind("change", handler) or .trigger("change")
|
360 |
+
fn.change = function change(handler) {
|
361 |
+
var $this = $(this);
|
362 |
+
return handler ? $this.bind(CHANGE, handler) : $this.trigger(CHANGE);
|
363 |
+
};
|
364 |
+
|
365 |
+
// focused - shortcut for .bind("focused", handler) or .trigger("focused")
|
366 |
+
fn.focused = function (handler) {
|
367 |
+
var $this = $(this);
|
368 |
+
return handler ? $this.bind(FOCUSED, handler) : $this.trigger(FOCUSED);
|
369 |
+
};
|
370 |
+
|
371 |
+
//===============
|
372 |
+
// Event Handlers
|
373 |
+
//===============
|
374 |
+
|
375 |
+
// buttonClick - click event handler for toolbar buttons
|
376 |
+
function buttonClick(e) {
|
377 |
+
|
378 |
+
var editor = this,
|
379 |
+
buttonDiv = e.target,
|
380 |
+
buttonName = $.data(buttonDiv, BUTTON_NAME),
|
381 |
+
button = buttons[buttonName],
|
382 |
+
popupName = button.popupName,
|
383 |
+
popup = popups[popupName];
|
384 |
+
|
385 |
+
// Check if disabled
|
386 |
+
if (editor.disabled || $(buttonDiv).attr(DISABLED) === DISABLED)
|
387 |
+
return;
|
388 |
+
|
389 |
+
// Fire the buttonClick event
|
390 |
+
var data = {
|
391 |
+
editor: editor,
|
392 |
+
button: buttonDiv,
|
393 |
+
buttonName: buttonName,
|
394 |
+
popup: popup,
|
395 |
+
popupName: popupName,
|
396 |
+
command: button.command,
|
397 |
+
useCSS: editor.options.useCSS
|
398 |
+
};
|
399 |
+
|
400 |
+
if (button.buttonClick && button.buttonClick(e, data) === false)
|
401 |
+
return false;
|
402 |
+
|
403 |
+
// Toggle source
|
404 |
+
if (buttonName === "source") {
|
405 |
+
|
406 |
+
// Show the iframe
|
407 |
+
if (sourceMode(editor)) {
|
408 |
+
delete editor.range;
|
409 |
+
editor.$area.hide();
|
410 |
+
editor.$frame.show();
|
411 |
+
buttonDiv.title = button.title;
|
412 |
+
}
|
413 |
+
|
414 |
+
// Show the textarea
|
415 |
+
else {
|
416 |
+
editor.$frame.hide();
|
417 |
+
editor.$area.show();
|
418 |
+
buttonDiv.title = "Show Rich Text";
|
419 |
+
}
|
420 |
+
|
421 |
+
}
|
422 |
+
|
423 |
+
// Check for rich text mode
|
424 |
+
else if (!sourceMode(editor)) {
|
425 |
+
|
426 |
+
// Handle popups
|
427 |
+
if (popupName) {
|
428 |
+
var $popup = $(popup);
|
429 |
+
|
430 |
+
// URL
|
431 |
+
if (popupName === "url") {
|
432 |
+
|
433 |
+
// Check for selection before showing the link url popup
|
434 |
+
if (buttonName === "link" && selectedText(editor) === "") {
|
435 |
+
showMessage(editor, "A selection is required when inserting a link.", buttonDiv);
|
436 |
+
return false;
|
437 |
+
}
|
438 |
+
|
439 |
+
// Wire up the submit button click event handler
|
440 |
+
$popup.children(":button")
|
441 |
+
.unbind(CLICK)
|
442 |
+
.bind(CLICK, function () {
|
443 |
+
|
444 |
+
// Insert the image or link if a url was entered
|
445 |
+
var $text = $popup.find(":text"),
|
446 |
+
url = $.trim($text.val());
|
447 |
+
if (url !== "")
|
448 |
+
execCommand(editor, data.command, url, null, data.button);
|
449 |
+
|
450 |
+
// Reset the text, hide the popup and set focus
|
451 |
+
$text.val("http://");
|
452 |
+
hidePopups();
|
453 |
+
focus(editor);
|
454 |
+
|
455 |
+
});
|
456 |
+
|
457 |
+
}
|
458 |
+
|
459 |
+
// Paste as Text
|
460 |
+
else if (popupName === "pastetext") {
|
461 |
+
|
462 |
+
// Wire up the submit button click event handler
|
463 |
+
$popup.children(":button")
|
464 |
+
.unbind(CLICK)
|
465 |
+
.bind(CLICK, function () {
|
466 |
+
|
467 |
+
// Insert the unformatted text replacing new lines with break tags
|
468 |
+
var $textarea = $popup.find("textarea"),
|
469 |
+
text = $textarea.val().replace(/\n/g, "<br />");
|
470 |
+
if (text !== "")
|
471 |
+
execCommand(editor, data.command, text, null, data.button);
|
472 |
+
|
473 |
+
// Reset the text, hide the popup and set focus
|
474 |
+
$textarea.val("");
|
475 |
+
hidePopups();
|
476 |
+
focus(editor);
|
477 |
+
|
478 |
+
});
|
479 |
+
|
480 |
+
}
|
481 |
+
|
482 |
+
// Show the popup if not already showing for this button
|
483 |
+
if (buttonDiv !== $.data(popup, BUTTON)) {
|
484 |
+
showPopup(editor, popup, buttonDiv);
|
485 |
+
return false; // stop propagination to document click
|
486 |
+
}
|
487 |
+
|
488 |
+
// propaginate to document click
|
489 |
+
return;
|
490 |
+
|
491 |
+
}
|
492 |
+
|
493 |
+
// Print
|
494 |
+
else if (buttonName === "print")
|
495 |
+
editor.$frame[0].contentWindow.print();
|
496 |
+
|
497 |
+
// All other buttons
|
498 |
+
else if (!execCommand(editor, data.command, data.value, data.useCSS, buttonDiv))
|
499 |
+
return false;
|
500 |
+
|
501 |
+
}
|
502 |
+
|
503 |
+
// Focus the editor
|
504 |
+
focus(editor);
|
505 |
+
|
506 |
+
}
|
507 |
+
|
508 |
+
// hoverEnter - mouseenter event handler for buttons and popup items
|
509 |
+
function hoverEnter(e) {
|
510 |
+
var $div = $(e.target).closest("div");
|
511 |
+
$div.css(BACKGROUND_COLOR, $div.data(BUTTON_NAME) ? "#FFF" : "#FFC");
|
512 |
+
}
|
513 |
+
|
514 |
+
// hoverLeave - mouseleave event handler for buttons and popup items
|
515 |
+
function hoverLeave(e) {
|
516 |
+
$(e.target).closest("div").css(BACKGROUND_COLOR, "transparent");
|
517 |
+
}
|
518 |
+
|
519 |
+
// popupClick - click event handler for popup items
|
520 |
+
function popupClick(e) {
|
521 |
+
|
522 |
+
var editor = this,
|
523 |
+
popup = e.data.popup,
|
524 |
+
target = e.target;
|
525 |
+
|
526 |
+
// Check for message and prompt popups
|
527 |
+
if (popup === popups.msg || $(popup).hasClass(PROMPT_CLASS))
|
528 |
+
return;
|
529 |
+
|
530 |
+
// Get the button info
|
531 |
+
var buttonDiv = $.data(popup, BUTTON),
|
532 |
+
buttonName = $.data(buttonDiv, BUTTON_NAME),
|
533 |
+
button = buttons[buttonName],
|
534 |
+
command = button.command,
|
535 |
+
value,
|
536 |
+
useCSS = editor.options.useCSS;
|
537 |
+
|
538 |
+
// Get the command value
|
539 |
+
if (buttonName === "font")
|
540 |
+
// Opera returns the fontfamily wrapped in quotes
|
541 |
+
value = target.style.fontFamily.replace(/"/g, "");
|
542 |
+
else if (buttonName === "size") {
|
543 |
+
if (target.tagName.toUpperCase() === "DIV")
|
544 |
+
target = target.children[0];
|
545 |
+
value = target.innerHTML;
|
546 |
+
}
|
547 |
+
else if (buttonName === "style")
|
548 |
+
value = "<" + target.tagName + ">";
|
549 |
+
else if (buttonName === "color")
|
550 |
+
value = hex(target.style.backgroundColor);
|
551 |
+
else if (buttonName === "highlight") {
|
552 |
+
value = hex(target.style.backgroundColor);
|
553 |
+
if (ie) command = 'backcolor';
|
554 |
+
else useCSS = true;
|
555 |
+
}
|
556 |
+
|
557 |
+
// Fire the popupClick event
|
558 |
+
var data = {
|
559 |
+
editor: editor,
|
560 |
+
button: buttonDiv,
|
561 |
+
buttonName: buttonName,
|
562 |
+
popup: popup,
|
563 |
+
popupName: button.popupName,
|
564 |
+
command: command,
|
565 |
+
value: value,
|
566 |
+
useCSS: useCSS
|
567 |
+
};
|
568 |
+
|
569 |
+
if (button.popupClick && button.popupClick(e, data) === false)
|
570 |
+
return;
|
571 |
+
|
572 |
+
// Execute the command
|
573 |
+
if (data.command && !execCommand(editor, data.command, data.value, data.useCSS, buttonDiv))
|
574 |
+
return false;
|
575 |
+
|
576 |
+
// Hide the popup and focus the editor
|
577 |
+
hidePopups();
|
578 |
+
focus(editor);
|
579 |
+
|
580 |
+
}
|
581 |
+
|
582 |
+
//==================
|
583 |
+
// Private Functions
|
584 |
+
//==================
|
585 |
+
|
586 |
+
// checksum - returns a checksum using the Adler-32 method
|
587 |
+
function checksum(text) {
|
588 |
+
var a = 1, b = 0;
|
589 |
+
for (var index = 0; index < text.length; ++index) {
|
590 |
+
a = (a + text.charCodeAt(index)) % 65521;
|
591 |
+
b = (b + a) % 65521;
|
592 |
+
}
|
593 |
+
return (b << 16) | a;
|
594 |
+
}
|
595 |
+
|
596 |
+
// clear - clears the contents of the editor
|
597 |
+
function clear(editor) {
|
598 |
+
editor.$area.val("");
|
599 |
+
updateFrame(editor);
|
600 |
+
}
|
601 |
+
|
602 |
+
// createPopup - creates a popup and adds it to the body
|
603 |
+
function createPopup(popupName, options, popupTypeClass, popupContent, popupHover) {
|
604 |
+
|
605 |
+
// Check if popup already exists
|
606 |
+
if (popups[popupName])
|
607 |
+
return popups[popupName];
|
608 |
+
|
609 |
+
// Create the popup
|
610 |
+
var $popup = $(DIV_TAG)
|
611 |
+
.hide()
|
612 |
+
.addClass(POPUP_CLASS)
|
613 |
+
.appendTo("body");
|
614 |
+
|
615 |
+
// Add the content
|
616 |
+
|
617 |
+
// Custom popup
|
618 |
+
if (popupContent)
|
619 |
+
$popup.html(popupContent);
|
620 |
+
|
621 |
+
// Color
|
622 |
+
else if (popupName === "color") {
|
623 |
+
var colors = options.colors.split(" ");
|
624 |
+
if (colors.length < 10)
|
625 |
+
$popup.width("auto");
|
626 |
+
$.each(colors, function (idx, color) {
|
627 |
+
$(DIV_TAG).appendTo($popup)
|
628 |
+
.css(BACKGROUND_COLOR, "#" + color);
|
629 |
+
});
|
630 |
+
popupTypeClass = COLOR_CLASS;
|
631 |
+
}
|
632 |
+
|
633 |
+
// Font
|
634 |
+
else if (popupName === "font")
|
635 |
+
$.each(options.fonts.split(","), function (idx, font) {
|
636 |
+
$(DIV_TAG).appendTo($popup)
|
637 |
+
.css("fontFamily", font)
|
638 |
+
.html(font);
|
639 |
+
});
|
640 |
+
|
641 |
+
// Size
|
642 |
+
else if (popupName === "size")
|
643 |
+
$.each(options.sizes.split(","), function (idx, size) {
|
644 |
+
$(DIV_TAG).appendTo($popup)
|
645 |
+
.html('<font size="' + size + '">' + size + '</font>');
|
646 |
+
});
|
647 |
+
|
648 |
+
// Style
|
649 |
+
else if (popupName === "style")
|
650 |
+
$.each(options.styles, function (idx, style) {
|
651 |
+
$(DIV_TAG).appendTo($popup)
|
652 |
+
.html(style[1] + style[0] + style[1].replace("<", "</"));
|
653 |
+
});
|
654 |
+
|
655 |
+
// URL
|
656 |
+
else if (popupName === "url") {
|
657 |
+
$popup.html('<label>Enter URL:<br /><input type="text" value="http://" style="width:200px" /></label><br /><input type="button" value="Submit" />');
|
658 |
+
popupTypeClass = PROMPT_CLASS;
|
659 |
+
}
|
660 |
+
|
661 |
+
// Paste as Text
|
662 |
+
else if (popupName === "pastetext") {
|
663 |
+
$popup.html('<label>Paste your content here:<br /><textarea rows="3" style="width:200px"></textarea></label><br /><input type="button" value="Submit" />');
|
664 |
+
popupTypeClass = PROMPT_CLASS;
|
665 |
+
}
|
666 |
+
|
667 |
+
// Add the popup type class name
|
668 |
+
if (!popupTypeClass && !popupContent)
|
669 |
+
popupTypeClass = LIST_CLASS;
|
670 |
+
$popup.addClass(popupTypeClass);
|
671 |
+
|
672 |
+
// Add the unselectable attribute to all items
|
673 |
+
if (ie) {
|
674 |
+
$popup.attr(UNSELECTABLE, "on")
|
675 |
+
.find("div,font,p,h1,h2,h3,h4,h5,h6")
|
676 |
+
.attr(UNSELECTABLE, "on");
|
677 |
+
}
|
678 |
+
|
679 |
+
// Add the hover effect to all items
|
680 |
+
if ($popup.hasClass(LIST_CLASS) || popupHover === true)
|
681 |
+
$popup.children().hover(hoverEnter, hoverLeave);
|
682 |
+
|
683 |
+
// Add the popup to the array and return it
|
684 |
+
popups[popupName] = $popup[0];
|
685 |
+
return $popup[0];
|
686 |
+
|
687 |
+
}
|
688 |
+
|
689 |
+
// disable - enables or disables the editor
|
690 |
+
function disable(editor, disabled) {
|
691 |
+
|
692 |
+
// Update the textarea and save the state
|
693 |
+
if (disabled) {
|
694 |
+
editor.$area.attr(DISABLED, DISABLED);
|
695 |
+
editor.disabled = true;
|
696 |
+
}
|
697 |
+
else {
|
698 |
+
editor.$area.removeAttr(DISABLED);
|
699 |
+
delete editor.disabled;
|
700 |
+
}
|
701 |
+
|
702 |
+
// Switch the iframe into design mode.
|
703 |
+
// ie6 does not support designMode.
|
704 |
+
// ie7 & ie8 do not properly support designMode="off".
|
705 |
+
try {
|
706 |
+
if (ie) editor.doc.body.contentEditable = !disabled;
|
707 |
+
else editor.doc.designMode = !disabled ? "on" : "off";
|
708 |
+
}
|
709 |
+
// Firefox 1.5 throws an exception that can be ignored
|
710 |
+
// when toggling designMode from off to on.
|
711 |
+
catch (err) { }
|
712 |
+
|
713 |
+
// Enable or disable the toolbar buttons
|
714 |
+
refreshButtons(editor);
|
715 |
+
|
716 |
+
}
|
717 |
+
|
718 |
+
// execCommand - executes a designMode command
|
719 |
+
function execCommand(editor, command, value, useCSS, button) {
|
720 |
+
|
721 |
+
// Restore the current ie selection
|
722 |
+
restoreRange(editor);
|
723 |
+
|
724 |
+
// Set the styling method
|
725 |
+
if (!ie) {
|
726 |
+
if (useCSS === undefined || useCSS === null)
|
727 |
+
useCSS = editor.options.useCSS;
|
728 |
+
editor.doc.execCommand("styleWithCSS", 0, useCSS.toString());
|
729 |
+
}
|
730 |
+
|
731 |
+
// Execute the command and check for error
|
732 |
+
var inserthtml = command.toLowerCase() === "inserthtml";
|
733 |
+
if (ie && inserthtml)
|
734 |
+
getRange(editor).pasteHTML(value);
|
735 |
+
|
736 |
+
else if (iege11 && inserthtml) {
|
737 |
+
var selection = getSelection(editor),
|
738 |
+
range = selection.getRangeAt(0);
|
739 |
+
range.deleteContents();
|
740 |
+
range.insertNode(range.createContextualFragment(value));
|
741 |
+
selection.removeAllRanges();
|
742 |
+
selection.addRange(range);
|
743 |
+
}
|
744 |
+
|
745 |
+
else {
|
746 |
+
var success = true, message;
|
747 |
+
try { success = editor.doc.execCommand(command, 0, value || null); }
|
748 |
+
catch (err) { message = err.message; success = false; }
|
749 |
+
if (!success) {
|
750 |
+
if ("cutcopypaste".indexOf(command) > -1)
|
751 |
+
showMessage(editor, "For security reasons, your browser does not support the " +
|
752 |
+
command + " command. Try using the keyboard shortcut or context menu instead.",
|
753 |
+
button);
|
754 |
+
else
|
755 |
+
showMessage(editor,
|
756 |
+
(message ? message : "Error executing the " + command + " command."),
|
757 |
+
button);
|
758 |
+
}
|
759 |
+
}
|
760 |
+
|
761 |
+
// Enable the buttons and update the textarea
|
762 |
+
refreshButtons(editor);
|
763 |
+
updateTextArea(editor, true);
|
764 |
+
return success;
|
765 |
+
|
766 |
+
}
|
767 |
+
|
768 |
+
// focus - sets focus to either the textarea or iframe
|
769 |
+
function focus(editor) {
|
770 |
+
setTimeout(function () {
|
771 |
+
if (sourceMode(editor)) editor.$area.focus();
|
772 |
+
else editor.$frame[0].contentWindow.focus();
|
773 |
+
refreshButtons(editor);
|
774 |
+
}, 0);
|
775 |
+
}
|
776 |
+
|
777 |
+
// getRange - gets the current text range object
|
778 |
+
function getRange(editor) {
|
779 |
+
if (ie) return getSelection(editor).createRange();
|
780 |
+
return getSelection(editor).getRangeAt(0);
|
781 |
+
}
|
782 |
+
|
783 |
+
// getSelection - gets the current text range object
|
784 |
+
function getSelection(editor) {
|
785 |
+
if (ie) return editor.doc.selection;
|
786 |
+
return editor.$frame[0].contentWindow.getSelection();
|
787 |
+
}
|
788 |
+
|
789 |
+
// hex - returns the hex value for the passed in color string
|
790 |
+
function hex(s) {
|
791 |
+
|
792 |
+
// hex("rgb(255, 0, 0)") returns #FF0000
|
793 |
+
var m = /rgba?\((\d+), (\d+), (\d+)/.exec(s);
|
794 |
+
if (m) {
|
795 |
+
s = (m[1] << 16 | m[2] << 8 | m[3]).toString(16);
|
796 |
+
while (s.length < 6)
|
797 |
+
s = "0" + s;
|
798 |
+
return "#" + s;
|
799 |
+
}
|
800 |
+
|
801 |
+
// hex("#F00") returns #FF0000
|
802 |
+
var c = s.split("");
|
803 |
+
if (s.length === 4)
|
804 |
+
return "#" + c[1] + c[1] + c[2] + c[2] + c[3] + c[3];
|
805 |
+
|
806 |
+
// hex("#FF0000") returns #FF0000
|
807 |
+
return s;
|
808 |
+
|
809 |
+
}
|
810 |
+
|
811 |
+
// hidePopups - hides all popups
|
812 |
+
function hidePopups() {
|
813 |
+
$.each(popups, function (idx, popup) {
|
814 |
+
$(popup)
|
815 |
+
.hide()
|
816 |
+
.unbind(CLICK)
|
817 |
+
.removeData(BUTTON);
|
818 |
+
});
|
819 |
+
}
|
820 |
+
|
821 |
+
// imagesPath - returns the path to the images folder
|
822 |
+
function imagesPath() {
|
823 |
+
var href = $("link[href*=cleditor]").attr("href");
|
824 |
+
return href.replace(/^(.*\/)[^\/]+$/, '$1') + "images/";
|
825 |
+
}
|
826 |
+
|
827 |
+
// imageUrl - Returns the css url string for a filemane
|
828 |
+
function imageUrl(filename) {
|
829 |
+
return "url(" + imagesPath() + filename + ")";
|
830 |
+
}
|
831 |
+
|
832 |
+
// refresh - creates the iframe and resizes the controls
|
833 |
+
function refresh(editor) {
|
834 |
+
|
835 |
+
var $main = editor.$main,
|
836 |
+
options = editor.options;
|
837 |
+
|
838 |
+
// Remove the old iframe
|
839 |
+
if (editor.$frame)
|
840 |
+
editor.$frame.remove();
|
841 |
+
|
842 |
+
// Create a new iframe
|
843 |
+
var $frame = editor.$frame = $('<iframe frameborder="0" src="javascript:true;" />')
|
844 |
+
.hide()
|
845 |
+
.appendTo($main);
|
846 |
+
|
847 |
+
// Load the iframe document content
|
848 |
+
var contentWindow = $frame[0].contentWindow,
|
849 |
+
doc = editor.doc = contentWindow.document,
|
850 |
+
$doc = $(doc);
|
851 |
+
|
852 |
+
doc.open();
|
853 |
+
doc.write(
|
854 |
+
options.docType +
|
855 |
+
'<html>' +
|
856 |
+
((options.docCSSFile === '') ? '' : '<head><link rel="stylesheet" type="text/css" href="' + options.docCSSFile + '" /></head>') +
|
857 |
+
'<body style="' + options.bodyStyle + '"></body></html>'
|
858 |
+
);
|
859 |
+
doc.close();
|
860 |
+
|
861 |
+
// Work around for bug in IE which causes the editor to lose
|
862 |
+
// focus when clicking below the end of the document.
|
863 |
+
if (ie || iege11)
|
864 |
+
$doc.click(function () { focus(editor); });
|
865 |
+
|
866 |
+
// Load the content
|
867 |
+
updateFrame(editor);
|
868 |
+
|
869 |
+
// Bind the ie specific iframe event handlers
|
870 |
+
if (ie || iege11) {
|
871 |
+
|
872 |
+
// Save the current user selection. This code is needed since IE will
|
873 |
+
// reset the selection just after the beforedeactivate event and just
|
874 |
+
// before the beforeactivate event.
|
875 |
+
$doc.bind("beforedeactivate beforeactivate selectionchange keypress keyup", function (e) {
|
876 |
+
|
877 |
+
// Flag the editor as inactive
|
878 |
+
if (e.type === "beforedeactivate")
|
879 |
+
editor.inactive = true;
|
880 |
+
|
881 |
+
// Get rid of the bogus selection and flag the editor as active
|
882 |
+
else if (e.type === "beforeactivate") {
|
883 |
+
if (!editor.inactive && editor.range && editor.range.length > 1)
|
884 |
+
editor.range.shift();
|
885 |
+
delete editor.inactive;
|
886 |
+
}
|
887 |
+
|
888 |
+
// Save the selection when the editor is active
|
889 |
+
else if (!editor.inactive) {
|
890 |
+
if (!editor.range)
|
891 |
+
editor.range = [];
|
892 |
+
editor.range.unshift(getRange(editor));
|
893 |
+
|
894 |
+
// We only need the last 2 selections
|
895 |
+
while (editor.range.length > 2)
|
896 |
+
editor.range.pop();
|
897 |
+
}
|
898 |
+
|
899 |
+
});
|
900 |
+
|
901 |
+
// Restore the text range and trigger focused event when the iframe gains focus
|
902 |
+
$frame.focus(function () {
|
903 |
+
restoreRange(editor);
|
904 |
+
$(editor).triggerHandler(FOCUSED);
|
905 |
+
});
|
906 |
+
|
907 |
+
// Trigger blurred event when the iframe looses focus
|
908 |
+
$frame.blur(function () {
|
909 |
+
$(editor).triggerHandler(BLURRED);
|
910 |
+
});
|
911 |
+
|
912 |
+
}
|
913 |
+
|
914 |
+
// Trigger focused and blurred events for all other browsers
|
915 |
+
else {
|
916 |
+
$($frame[0].contentWindow)
|
917 |
+
.focus(function () { $(editor).triggerHandler(FOCUSED); })
|
918 |
+
.blur(function () { $(editor).triggerHandler(BLURRED); });
|
919 |
+
}
|
920 |
+
|
921 |
+
// Enable the toolbar buttons and update the textarea as the user types or clicks
|
922 |
+
$doc.click(hidePopups)
|
923 |
+
.keydown(function (e) {
|
924 |
+
// Prevent Internet Explorer from going to prior page when an image
|
925 |
+
// is selected and the backspace key is pressed.
|
926 |
+
if (ie && getSelection(editor).type == "Control" && e.keyCode == 8) {
|
927 |
+
getSelection(editor).clear();
|
928 |
+
e.preventDefault();
|
929 |
+
}
|
930 |
+
})
|
931 |
+
.bind("keyup mouseup", function () {
|
932 |
+
refreshButtons(editor);
|
933 |
+
updateTextArea(editor, true);
|
934 |
+
});
|
935 |
+
|
936 |
+
// Show the textarea for iPhone/iTouch/iPad or
|
937 |
+
// the iframe when design mode is supported.
|
938 |
+
if (iOS) editor.$area.show();
|
939 |
+
else $frame.show();
|
940 |
+
|
941 |
+
// Wait for the layout to finish - shortcut for $(document).ready()
|
942 |
+
$(function () {
|
943 |
+
|
944 |
+
var $toolbar = editor.$toolbar,
|
945 |
+
$group = $toolbar.children("div:last"),
|
946 |
+
wid = $main.width();
|
947 |
+
|
948 |
+
// Resize the toolbar
|
949 |
+
var hgt = $group.offset().top + $group.outerHeight() - $toolbar.offset().top + 1;
|
950 |
+
$toolbar.height(hgt);
|
951 |
+
|
952 |
+
// Resize the iframe
|
953 |
+
hgt = (/%/.test("" + options.height) ? $main.height() : parseInt(options.height, 10)) - hgt;
|
954 |
+
$frame.width(wid).height(hgt);
|
955 |
+
|
956 |
+
// Resize the textarea. IE6 textareas have a 1px top
|
957 |
+
// & bottom margin that cannot be removed using css.
|
958 |
+
editor.$area.width(wid).height(ie6 ? hgt - 2 : hgt);
|
959 |
+
|
960 |
+
// Switch the iframe into design mode if enabled
|
961 |
+
disable(editor, editor.disabled);
|
962 |
+
|
963 |
+
// Enable or disable the toolbar buttons
|
964 |
+
refreshButtons(editor);
|
965 |
+
|
966 |
+
});
|
967 |
+
|
968 |
+
}
|
969 |
+
|
970 |
+
// refreshButtons - enables or disables buttons based on availability
|
971 |
+
function refreshButtons(editor) {
|
972 |
+
|
973 |
+
// Webkit requires focus before queryCommandEnabled will return anything but false
|
974 |
+
if (!iOS && webkit && !editor.focused) {
|
975 |
+
editor.$frame[0].contentWindow.focus();
|
976 |
+
window.focus();
|
977 |
+
editor.focused = true;
|
978 |
+
}
|
979 |
+
|
980 |
+
// Get the object used for checking queryCommandEnabled
|
981 |
+
var queryObj = editor.doc;
|
982 |
+
if (ie) queryObj = getRange(editor);
|
983 |
+
|
984 |
+
// Loop through each button
|
985 |
+
var inSourceMode = sourceMode(editor);
|
986 |
+
$.each(editor.$toolbar.find("." + BUTTON_CLASS), function (idx, elem) {
|
987 |
+
|
988 |
+
var $elem = $(elem),
|
989 |
+
button = $.cleditor.buttons[$.data(elem, BUTTON_NAME)],
|
990 |
+
command = button.command,
|
991 |
+
enabled = true;
|
992 |
+
|
993 |
+
// Determine the state
|
994 |
+
if (editor.disabled)
|
995 |
+
enabled = false;
|
996 |
+
else if (button.getEnabled) {
|
997 |
+
var data = {
|
998 |
+
editor: editor,
|
999 |
+
button: elem,
|
1000 |
+
buttonName: button.name,
|
1001 |
+
popup: popups[button.popupName],
|
1002 |
+
popupName: button.popupName,
|
1003 |
+
command: button.command,
|
1004 |
+
useCSS: editor.options.useCSS
|
1005 |
+
};
|
1006 |
+
enabled = button.getEnabled(data);
|
1007 |
+
if (enabled === undefined)
|
1008 |
+
enabled = true;
|
1009 |
+
}
|
1010 |
+
else if (((inSourceMode || iOS) && button.name !== "source") ||
|
1011 |
+
(ie && (command === "undo" || command === "redo")))
|
1012 |
+
enabled = false;
|
1013 |
+
else if (command && command !== "print") {
|
1014 |
+
if (ie && command === "hilitecolor")
|
1015 |
+
command = "backcolor";
|
1016 |
+
// IE does not support inserthtml, so it's always enabled
|
1017 |
+
if ((!ie && !iege11) || command !== "inserthtml") {
|
1018 |
+
try { enabled = queryObj.queryCommandEnabled(command); }
|
1019 |
+
catch (err) { enabled = false; }
|
1020 |
+
}
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
// Enable or disable the button
|
1024 |
+
if (enabled) {
|
1025 |
+
$elem.removeClass(DISABLED_CLASS);
|
1026 |
+
$elem.removeAttr(DISABLED);
|
1027 |
+
}
|
1028 |
+
else {
|
1029 |
+
$elem.addClass(DISABLED_CLASS);
|
1030 |
+
$elem.attr(DISABLED, DISABLED);
|
1031 |
+
}
|
1032 |
+
|
1033 |
+
});
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
// restoreRange - restores the current ie selection
|
1037 |
+
function restoreRange(editor) {
|
1038 |
+
if (editor.range) {
|
1039 |
+
if (ie)
|
1040 |
+
editor.range[0].select();
|
1041 |
+
else if (iege11)
|
1042 |
+
getSelection(editor).addRange(editor.range[0]);
|
1043 |
+
}
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
// select - selects all the text in either the textarea or iframe
|
1047 |
+
function select(editor) {
|
1048 |
+
setTimeout(function () {
|
1049 |
+
if (sourceMode(editor)) editor.$area.select();
|
1050 |
+
else execCommand(editor, "selectall");
|
1051 |
+
}, 0);
|
1052 |
+
}
|
1053 |
+
|
1054 |
+
// selectedHTML - returns the current HTML selection or and empty string
|
1055 |
+
function selectedHTML(editor) {
|
1056 |
+
restoreRange(editor);
|
1057 |
+
var range = getRange(editor);
|
1058 |
+
if (ie)
|
1059 |
+
return range.htmlText;
|
1060 |
+
var layer = $("<layer>")[0];
|
1061 |
+
layer.appendChild(range.cloneContents());
|
1062 |
+
var html = layer.innerHTML;
|
1063 |
+
layer = null;
|
1064 |
+
return html;
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
// selectedText - returns the current text selection or and empty string
|
1068 |
+
function selectedText(editor) {
|
1069 |
+
restoreRange(editor);
|
1070 |
+
if (ie) return getRange(editor).text;
|
1071 |
+
return getSelection(editor).toString();
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
// showMessage - alert replacement
|
1075 |
+
function showMessage(editor, message, button) {
|
1076 |
+
var popup = createPopup("msg", editor.options, MSG_CLASS);
|
1077 |
+
popup.innerHTML = message;
|
1078 |
+
showPopup(editor, popup, button);
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
// showPopup - shows a popup
|
1082 |
+
function showPopup(editor, popup, button) {
|
1083 |
+
|
1084 |
+
var offset, left, top, $popup = $(popup);
|
1085 |
+
|
1086 |
+
// Determine the popup location
|
1087 |
+
if (button) {
|
1088 |
+
var $button = $(button);
|
1089 |
+
offset = $button.offset();
|
1090 |
+
left = --offset.left;
|
1091 |
+
top = offset.top + $button.height();
|
1092 |
+
}
|
1093 |
+
else {
|
1094 |
+
var $toolbar = editor.$toolbar;
|
1095 |
+
offset = $toolbar.offset();
|
1096 |
+
left = Math.floor(($toolbar.width() - $popup.width()) / 2) + offset.left;
|
1097 |
+
top = offset.top + $toolbar.height() - 2;
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
// Position and show the popup
|
1101 |
+
hidePopups();
|
1102 |
+
$popup.css({ left: left, top: top })
|
1103 |
+
.show();
|
1104 |
+
|
1105 |
+
// Assign the popup button and click event handler
|
1106 |
+
if (button) {
|
1107 |
+
$.data(popup, BUTTON, button);
|
1108 |
+
$popup.bind(CLICK, { popup: popup }, $.proxy(popupClick, editor));
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
// Focus the first input element if any
|
1112 |
+
setTimeout(function () {
|
1113 |
+
$popup.find(":text,textarea").eq(0).focus().select();
|
1114 |
+
}, 100);
|
1115 |
+
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
// sourceMode - returns true if the textarea is showing
|
1119 |
+
function sourceMode(editor) {
|
1120 |
+
return editor.$area.is(":visible");
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
// updateFrame - updates the iframe with the textarea contents
|
1124 |
+
function updateFrame(editor, checkForChange) {
|
1125 |
+
|
1126 |
+
var code = editor.$area.val(),
|
1127 |
+
options = editor.options,
|
1128 |
+
updateFrameCallback = options.updateFrame,
|
1129 |
+
$body = $(editor.doc.body);
|
1130 |
+
|
1131 |
+
// Check for textarea change to avoid unnecessary firing
|
1132 |
+
// of potentially heavy updateFrame callbacks.
|
1133 |
+
if (updateFrameCallback) {
|
1134 |
+
var sum = checksum(code);
|
1135 |
+
if (checkForChange && editor.areaChecksum === sum)
|
1136 |
+
return;
|
1137 |
+
editor.areaChecksum = sum;
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// Convert the textarea source code into iframe html
|
1141 |
+
var html = updateFrameCallback ? updateFrameCallback(code) : code;
|
1142 |
+
|
1143 |
+
// Prevent script injection attacks by html encoding script tags
|
1144 |
+
html = html.replace(/<(?=\/?script)/ig, "<");
|
1145 |
+
|
1146 |
+
// Update the iframe checksum
|
1147 |
+
if (options.updateTextArea)
|
1148 |
+
editor.frameChecksum = checksum(html);
|
1149 |
+
|
1150 |
+
// Update the iframe and trigger the change event
|
1151 |
+
if (html !== $body.html()) {
|
1152 |
+
$body.html(html);
|
1153 |
+
$(editor).triggerHandler(CHANGE);
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
}
|
1157 |
+
|
1158 |
+
// updateTextArea - updates the textarea with the iframe contents
|
1159 |
+
function updateTextArea(editor, checkForChange) {
|
1160 |
+
|
1161 |
+
var html = $(editor.doc.body).html(),
|
1162 |
+
options = editor.options,
|
1163 |
+
updateTextAreaCallback = options.updateTextArea,
|
1164 |
+
$area = editor.$area;
|
1165 |
+
|
1166 |
+
// Check for iframe change to avoid unnecessary firing
|
1167 |
+
// of potentially heavy updateTextArea callbacks.
|
1168 |
+
if (updateTextAreaCallback) {
|
1169 |
+
var sum = checksum(html);
|
1170 |
+
if (checkForChange && editor.frameChecksum === sum)
|
1171 |
+
return;
|
1172 |
+
editor.frameChecksum = sum;
|
1173 |
+
}
|
1174 |
+
|
1175 |
+
// Convert the iframe html into textarea source code
|
1176 |
+
var code = updateTextAreaCallback ? updateTextAreaCallback(html) : html;
|
1177 |
+
|
1178 |
+
// Update the textarea checksum
|
1179 |
+
if (options.updateFrame)
|
1180 |
+
editor.areaChecksum = checksum(code);
|
1181 |
+
|
1182 |
+
// Update the textarea and trigger the change event
|
1183 |
+
if (code !== $area.val()) {
|
1184 |
+
$area.val(code);
|
1185 |
+
$(editor).triggerHandler(CHANGE);
|
1186 |
+
}
|
1187 |
+
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
})(jQuery);
|
ui/js/cleditor/jquery.cleditor.min.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
CLEditor WYSIWYG HTML Editor v1.4.5
|
3 |
+
http://premiumsoftware.net/CLEditor
|
4 |
+
requires jQuery v1.4.2 or later
|
5 |
+
Copyright 2010, Chris Landowski, Premium Software, LLC
|
6 |
+
Dual licensed under the MIT or GPL Version 2 licenses.
|
7 |
+
*/
|
8 |
+
(function(n){function vi(t){var i=this,e=t.target,y=n.data(e,a),p=s[y],w=p.popupName,k=f[w],v,b;if(!i.disabled&&n(e).attr(r)!==r){if(v={editor:i,button:e,buttonName:y,popup:k,popupName:w,command:p.command,useCSS:i.options.useCSS},p.buttonClick&&p.buttonClick(t,v)===!1)return!1;if(y==="source")l(i)?(delete i.range,i.$area.hide(),i.$frame.show(),e.title=p.title):(i.$frame.hide(),i.$area.show(),e.title="Show Rich Text");else if(!l(i)){if(w){if(b=n(k),w==="url"){if(y==="link"&&ri(i)==="")return ut(i,"A selection is required when inserting a link.",e),!1;b.children(":button").unbind(u).bind(u,function(){var t=b.find(":text"),r=n.trim(t.val());r!==""&&h(i,v.command,r,null,v.button);t.val("http://");o();c(i)})}else w==="pastetext"&&b.children(":button").unbind(u).bind(u,function(){var n=b.find("textarea"),t=n.val().replace(/\n/g,"<br />");t!==""&&h(i,v.command,t,null,v.button);n.val("");o();c(i)});return e!==n.data(k,d)?(ui(i,k,e),!1):void 0}if(y==="print")i.$frame[0].contentWindow.print();else if(!h(i,v.command,v.value,v.useCSS,e))return!1}c(i)}}function kt(t){var i=n(t.target).closest("div");i.css(et,i.data(a)?"#FFF":"#FFC")}function dt(t){n(t.target).closest("div").css(et,"transparent")}function yi(i){var v=this,y=i.data.popup,r=i.target,l;if(y!==f.msg&&!n(y).hasClass(tt)){var w=n.data(y,d),u=n.data(w,a),p=s[u],b=p.command,e,k=v.options.useCSS;if(u==="font"?e=r.style.fontFamily.replace(/"/g,""):u==="size"?(r.tagName.toUpperCase()==="DIV"&&(r=r.children[0]),e=r.innerHTML):u==="style"?e="<"+r.tagName+">":u==="color"?e=ti(r.style.backgroundColor):u==="highlight"&&(e=ti(r.style.backgroundColor),t?b="backcolor":k=!0),l={editor:v,button:w,buttonName:u,popup:y,popupName:p.popupName,command:b,value:e,useCSS:k},!p.popupClick||p.popupClick(i,l)!==!1){if(l.command&&!h(v,l.command,l.value,l.useCSS,w))return!1;o();c(v)}}}function it(n){for(var t=1,i=0,r=0;r<n.length;++r)t=(t+n.charCodeAt(r))%65521,i=(i+t)%65521;return i<<16|t}function pi(n){n.$area.val("");ft(n)}function gt(r,u,e,o,s){var h,c;return f[r]?f[r]:(h=n(i).hide().addClass(si).appendTo("body"),o?h.html(o):r==="color"?(c=u.colors.split(" "),c.length<10&&h.width("auto"),n.each(c,function(t,r){n(i).appendTo(h).css(et,"#"+r)}),e=hi):r==="font"?n.each(u.fonts.split(","),function(t,r){n(i).appendTo(h).css("fontFamily",r).html(r)}):r==="size"?n.each(u.sizes.split(","),function(t,r){n(i).appendTo(h).html('<font size="'+r+'">'+r+"<\/font>")}):r==="style"?n.each(u.styles,function(t,r){n(i).appendTo(h).html(r[1]+r[0]+r[1].replace("<","<\/"))}):r==="url"?(h.html('<label>Enter URL:<br /><input type="text" value="http://" style="width:200px" /><\/label><br /><input type="button" value="Submit" />'),e=tt):r==="pastetext"&&(h.html('<label>Paste your content here:<br /><textarea rows="3" style="width:200px"><\/textarea><\/label><br /><input type="button" value="Submit" />'),e=tt),e||o||(e=pt),h.addClass(e),t&&h.attr(ot,"on").find("div,font,p,h1,h2,h3,h4,h5,h6").attr(ot,"on"),(h.hasClass(pt)||s===!0)&&h.children().hover(kt,dt),f[r]=h[0],h[0])}function ni(n,i){i?(n.$area.attr(r,r),n.disabled=!0):(n.$area.removeAttr(r),delete n.disabled);try{t?n.doc.body.contentEditable=!i:n.doc.designMode=i?"off":"on"}catch(u){}b(n)}function h(n,i,r,u,f){var c,h,o,s,l;if(rt(n),t||((u===undefined||u===null)&&(u=n.options.useCSS),n.doc.execCommand("styleWithCSS",0,u.toString())),c=i.toLowerCase()==="inserthtml",t&&c)w(n).pasteHTML(r);else if(y&&c)h=e(n),o=h.getRangeAt(0),o.deleteContents(),o.insertNode(o.createContextualFragment(r)),h.removeAllRanges(),h.addRange(o);else{s=!0;try{s=n.doc.execCommand(i,0,r||null)}catch(a){l=a.message;s=!1}s||("cutcopypaste".indexOf(i)>-1?ut(n,"For security reasons, your browser does not support the "+i+" command. Try using the keyboard shortcut or context menu instead.",f):ut(n,l?l:"Error executing the "+i+" command.",f))}return b(n),ct(n,!0),s}function c(n){setTimeout(function(){l(n)?n.$area.focus():n.$frame[0].contentWindow.focus();b(n)},0)}function w(n){return t?e(n).createRange():e(n).getRangeAt(0)}function e(n){return t?n.doc.selection:n.$frame[0].contentWindow.getSelection()}function ti(n){var i=/rgba?\((\d+), (\d+), (\d+)/.exec(n),t;if(i){for(n=(i[1]<<16|i[2]<<8|i[3]).toString(16);n.length<6;)n="0"+n;return"#"+n}return(t=n.split(""),n.length===4)?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:n}function o(){n.each(f,function(t,i){n(i).hide().unbind(u).removeData(d)})}function ii(){var t=n("link[href*=cleditor]").attr("href");return t.replace(/^(.*\/)[^\/]+$/,"$1")+"images/"}function wi(n){return"url("+ii()+n+")"}function ht(i){var s=i.$main,r=i.options;i.$frame&&i.$frame.remove();var u=i.$frame=n('<iframe frameborder="0" src="javascript:true;" />').hide().appendTo(s),l=u[0].contentWindow,f=i.doc=l.document,h=n(f);f.open();f.write(r.docType+"<html>"+(r.docCSSFile===""?"":'<head><link rel="stylesheet" type="text/css" href="'+r.docCSSFile+'" /><\/head>')+'<body style="'+r.bodyStyle+'"><\/body><\/html>');f.close();(t||y)&&h.click(function(){c(i)});ft(i);t||y?(h.bind("beforedeactivate beforeactivate selectionchange keypress keyup",function(n){if(n.type==="beforedeactivate")i.inactive=!0;else if(n.type==="beforeactivate")!i.inactive&&i.range&&i.range.length>1&&i.range.shift(),delete i.inactive;else if(!i.inactive)for(i.range||(i.range=[]),i.range.unshift(w(i));i.range.length>2;)i.range.pop()}),u.focus(function(){rt(i);n(i).triggerHandler(nt)}),u.blur(function(){n(i).triggerHandler(k)})):n(u[0].contentWindow).focus(function(){n(i).triggerHandler(nt)}).blur(function(){n(i).triggerHandler(k)});h.click(o).keydown(function(n){t&&e(i).type=="Control"&&n.keyCode==8&&(e(i).clear(),n.preventDefault())}).bind("keyup mouseup",function(){b(i);ct(i,!0)});st?i.$area.show():u.show();n(function(){var t=i.$toolbar,f=t.children("div:last"),e=s.width(),n=f.offset().top+f.outerHeight()-t.offset().top+1;t.height(n);n=(/%/.test(""+r.height)?s.height():parseInt(r.height,10))-n;u.width(e).height(n);i.$area.width(e).height(li?n-2:n);ni(i,i.disabled);b(i)})}function b(i){var u,e;st||!ai||i.focused||(i.$frame[0].contentWindow.focus(),window.focus(),i.focused=!0);u=i.doc;t&&(u=w(i));e=l(i);n.each(i.$toolbar.find("."+vt),function(o,s){var v=n(s),h=n.cleditor.buttons[n.data(s,a)],c=h.command,l=!0,p;if(i.disabled)l=!1;else if(h.getEnabled)p={editor:i,button:s,buttonName:h.name,popup:f[h.popupName],popupName:h.popupName,command:h.command,useCSS:i.options.useCSS},l=h.getEnabled(p),l===undefined&&(l=!0);else if((e||st)&&h.name!=="source"||t&&(c==="undo"||c==="redo"))l=!1;else if(c&&c!=="print"&&(t&&c==="hilitecolor"&&(c="backcolor"),!t&&!y||c!=="inserthtml"))try{l=u.queryCommandEnabled(c)}catch(w){l=!1}l?(v.removeClass(yt),v.removeAttr(r)):(v.addClass(yt),v.attr(r,r))})}function rt(n){n.range&&(t?n.range[0].select():y&&e(n).addRange(n.range[0]))}function bi(n){setTimeout(function(){l(n)?n.$area.select():h(n,"selectall")},0)}function ki(i){var u,r,f;return(rt(i),u=w(i),t)?u.htmlText:(r=n("<layer>")[0],r.appendChild(u.cloneContents()),f=r.innerHTML,r=null,f)}function ri(n){return(rt(n),t)?w(n).text:e(n).toString()}function ut(n,t,i){var r=gt("msg",n.options,ci);r.innerHTML=t;ui(n,r,i)}function ui(t,i,r){var f,h,c,e=n(i),l,s;r?(l=n(r),f=l.offset(),h=--f.left,c=f.top+l.height()):(s=t.$toolbar,f=s.offset(),h=Math.floor((s.width()-e.width())/2)+f.left,c=f.top+s.height()-2);o();e.css({left:h,top:c}).show();r&&(n.data(i,d,r),e.bind(u,{popup:i},n.proxy(yi,t)));setTimeout(function(){e.find(":text,textarea").eq(0).focus().select()},100)}function l(n){return n.$area.is(":visible")}function ft(t,i){var u=t.$area.val(),o=t.options,f=o.updateFrame,s=n(t.doc.body),e,r;if(f){if(e=it(u),i&&t.areaChecksum===e)return;t.areaChecksum=e}r=f?f(u):u;r=r.replace(/<(?=\/?script)/ig,"<");o.updateTextArea&&(t.frameChecksum=it(r));r!==s.html()&&(s.html(r),n(t).triggerHandler(g))}function ct(t,i){var u=n(t.doc.body).html(),o=t.options,f=o.updateTextArea,s=t.$area,e,r;if(f){if(e=it(u),i&&t.frameChecksum===e)return;t.frameChecksum=e}r=f?f(u):u;o.updateFrame&&(t.areaChecksum=it(r));r!==s.val()&&(s.val(r),n(t).triggerHandler(g))}var p,bt;n.cleditor={defaultOptions:{width:"auto",height:250,controls:"bold italic underline strikethrough subscript superscript | font size style | color highlight removeformat | bullets numbering | outdent indent | alignleft center alignright justify | undo redo | rule image link unlink | cut copy paste pastetext | print source",colors:"FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C 999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C 666 900 C60 C93 990 090 399 33F 60C 939 333 600 930 963 660 060 366 009 339 636 000 300 630 633 330 030 033 006 309 303",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond,Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",sizes:"1,2,3,4,5,6,7",styles:[["Paragraph","<p>"],["Header 1","<h1>"],["Header 2","<h2>"],["Header 3","<h3>"],["Header 4","<h4>"],["Header 5","<h5>"],["Header 6","<h6>"]],useCSS:!0,docType:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',docCSSFile:"",bodyStyle:"margin:4px; font:10pt Arial,Verdana; cursor:text"},buttons:{init:"bold,,|italic,,|underline,,|strikethrough,,|subscript,,|superscript,,|font,,fontname,|size,Font Size,fontsize,|style,,formatblock,|color,Font Color,forecolor,|highlight,Text Highlight Color,hilitecolor,color|removeformat,Remove Formatting,|bullets,,insertunorderedlist|numbering,,insertorderedlist|outdent,,|indent,,|alignleft,Align Text Left,justifyleft|center,,justifycenter|alignright,Align Text Right,justifyright|justify,,justifyfull|undo,,|redo,,|rule,Insert Horizontal Rule,inserthorizontalrule|image,Insert Image,insertimage,url|link,Insert Hyperlink,createlink,url|unlink,Remove Hyperlink,|cut,,|copy,,|paste,,|pastetext,Paste as Text,inserthtml,|print,,|source,Show Source"},imagesPath:function(){return ii()}};n.fn.cleditor=function(t){var i=n([]);return this.each(function(r,u){if(u.tagName.toUpperCase()==="TEXTAREA"){var f=n.data(u,lt);f||(f=new cleditor(u,t));i=i.add(f)}}),i};var et="backgroundColor",k="blurred",d="button",a="buttonName",g="change",lt="cleditor",u="click",r="disabled",i="<div>",nt="focused",ot="unselectable",fi="cleditorMain",ei="cleditorToolbar",at="cleditorGroup",vt="cleditorButton",yt="cleditorDisabled",oi="cleditorDivider",si="cleditorPopup",pt="cleditorList",hi="cleditorColor",tt="cleditorPrompt",ci="cleditorMsg",v=navigator.userAgent.toLowerCase(),t=/msie/.test(v),li=/msie\s6/.test(v),y=/(trident)(?:.*rv:([\w.]+))?/.test(v),ai=/webkit/.test(v),st=/iPhone|iPad|iPod/i.test(v),f={},wt,s=n.cleditor.buttons;n.each(s.init.split("|"),function(n,t){var i=t.split(","),r=i[0];s[r]={stripIndex:n,name:r,title:i[1]===""?r.charAt(0).toUpperCase()+r.substr(1):i[1],command:i[2]===""?r:i[2],popupName:i[3]===""?r:i[3]}});delete s.init;cleditor=function(r,f){var e=this;e.options=f=n.extend({},n.cleditor.defaultOptions,f);var l=e.$area=n(r).css({border:"none",margin:0,padding:0}).hide().data(lt,e).blur(function(){ft(e,!0)}),v=e.$main=n(i).addClass(fi).width(f.width).height(f.height),y=e.$toolbar=n(i).addClass(ei).appendTo(v),h=n(i).addClass(at).appendTo(y),c=0;n.each(f.controls.split(" "),function(r,o){var w,l,p,v;if(o==="")return!0;o==="|"?(w=n(i).addClass(oi).appendTo(h),h.width(c+1),c=0,h=n(i).addClass(at).appendTo(y)):(l=s[o],p=n(i).data(a,l.name).addClass(vt).attr("title",l.title).bind(u,n.proxy(vi,e)).appendTo(h).hover(kt,dt),c+=24,h.width(c+1),v={},l.css?v=l.css:l.image&&(v.backgroundImage=wi(l.image)),l.stripIndex&&(v.backgroundPosition=l.stripIndex*-24),p.css(v),t&&p.attr(ot,"on"),l.popupName&>(l.popupName,f,l.popupClass,l.popupContent,l.popupHover))});v.insertBefore(l).append(l);wt||(n(document).click(function(t){var i=n(t.target);i.add(i.parents()).is("."+tt)||o()}),wt=!0);/auto|%/.test(""+f.width+f.height)&&n(window).bind("resize.cleditor",function(){ht(e)});ht(e)};p=cleditor.prototype;bt=[["clear",pi],["disable",ni],["execCommand",h],["focus",c],["hidePopups",o],["sourceMode",l,!0],["refresh",ht],["select",bi],["selectedHTML",ki,!0],["selectedText",ri,!0],["showMessage",ut],["updateFrame",ft],["updateTextArea",ct]];n.each(bt,function(n,t){p[t[0]]=function(){for(var u,n=this,r=[n],i=0;i<arguments.length;i++)r.push(arguments[i]);return(u=t[1].apply(n,r),t[2])?u:n}});p.blurred=function(t){var i=n(this);return t?i.bind(k,t):i.trigger(k)};p.change=function(t){var i=n(this);return t?i.bind(g,t):i.trigger(g)};p.focused=function(t){var i=n(this);return t?i.bind(nt,t):i.trigger(nt)}})(jQuery);
|
ui/js/jquery.cleditor.min.js
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
CLEditor WYSIWYG HTML Editor v1.3.0
|
3 |
-
http://premiumsoftware.net/cleditor
|
4 |
-
requires jQuery v1.4.2 or later
|
5 |
-
|
6 |
-
Copyright 2010, Chris Landowski, Premium Software, LLC
|
7 |
-
Dual licensed under the MIT or GPL Version 2 licenses.
|
8 |
-
*/
|
9 |
-
(function(e){function aa(a){var b=this,c=a.target,d=e.data(c,x),h=s[d],f=h.popupName,i=p[f];if(!(b.disabled||e(c).attr(n)==n)){var g={editor:b,button:c,buttonName:d,popup:i,popupName:f,command:h.command,useCSS:b.options.useCSS};if(h.buttonClick&&h.buttonClick(a,g)===false)return false;if(d=="source"){if(t(b)){delete b.range;b.$area.hide();b.$frame.show();c.title=h.title}else{b.$frame.hide();b.$area.show();c.title="Show Rich Text"}setTimeout(function(){u(b)},100)}else if(!t(b))if(f){var j=e(i);if(f==
|
10 |
-
"url"){if(d=="link"&&M(b)===""){z(b,"A selection is required when inserting a link.",c);return false}j.children(":button").unbind(q).bind(q,function(){var k=j.find(":text"),o=e.trim(k.val());o!==""&&v(b,g.command,o,null,g.button);k.val("http://");r();w(b)})}else f=="pastetext"&&j.children(":button").unbind(q).bind(q,function(){var k=j.find("textarea"),o=k.val().replace(/\n/g,"<br />");o!==""&&v(b,g.command,o,null,g.button);k.val("");r();w(b)});if(c!==e.data(i,A)){N(b,i,c);return false}return}else if(d==
|
11 |
-
"print")b.$frame[0].contentWindow.print();else if(!v(b,g.command,g.value,g.useCSS,c))return false;w(b)}}function O(a){a=e(a.target).closest("div");a.css(H,a.data(x)?"#FFF":"#FFC")}function P(a){e(a.target).closest("div").css(H,"transparent")}function ba(a){var b=a.data.popup,c=a.target;if(!(b===p.msg||e(b).hasClass(B))){var d=e.data(b,A),h=e.data(d,x),f=s[h],i=f.command,g,j=this.options.useCSS;if(h=="font")g=c.style.fontFamily.replace(/"/g,"");else if(h=="size"){if(c.tagName=="DIV")c=c.children[0];
|
12 |
-
g=c.innerHTML}else if(h=="style")g="<"+c.tagName+">";else if(h=="color")g=Q(c.style.backgroundColor);else if(h=="highlight"){g=Q(c.style.backgroundColor);if(l)i="backcolor";else j=true}b={editor:this,button:d,buttonName:h,popup:b,popupName:f.popupName,command:i,value:g,useCSS:j};if(!(f.popupClick&&f.popupClick(a,b)===false)){if(b.command&&!v(this,b.command,b.value,b.useCSS,d))return false;r();w(this)}}}function C(a){for(var b=1,c=0,d=0;d<a.length;++d){b=(b+a.charCodeAt(d))%65521;c=(c+b)%65521}return c<<
|
13 |
-
16|b}function R(a,b,c,d,h){if(p[a])return p[a];var f=e(m).hide().addClass(ca).appendTo("body");if(d)f.html(d);else if(a=="color"){b=b.colors.split(" ");b.length<10&&f.width("auto");e.each(b,function(i,g){e(m).appendTo(f).css(H,"#"+g)});c=da}else if(a=="font")e.each(b.fonts.split(","),function(i,g){e(m).appendTo(f).css("fontFamily",g).html(g)});else if(a=="size")e.each(b.sizes.split(","),function(i,g){e(m).appendTo(f).html("<font size="+g+">"+g+"</font>")});else if(a=="style")e.each(b.styles,function(i,
|
14 |
-
g){e(m).appendTo(f).html(g[1]+g[0]+g[1].replace("<","</"))});else if(a=="url"){f.html('Enter URL:<br><input type=text value="http://" size=35><br><input type=button value="Submit">');c=B}else if(a=="pastetext"){f.html("Paste your content here and click submit.<br /><textarea cols=40 rows=3></textarea><br /><input type=button value=Submit>");c=B}if(!c&&!d)c=S;f.addClass(c);l&&f.attr(I,"on").find("div,font,p,h1,h2,h3,h4,h5,h6").attr(I,"on");if(f.hasClass(S)||h===true)f.children().hover(O,P);p[a]=f[0];
|
15 |
-
return f[0]}function T(a,b){if(b){a.$area.attr(n,n);a.disabled=true}else{a.$area.removeAttr(n);delete a.disabled}try{if(l)a.doc.body.contentEditable=!b;else a.doc.designMode=!b?"on":"off"}catch(c){}u(a)}function v(a,b,c,d,h){D(a);if(!l){if(d===undefined||d===null)d=a.options.useCSS;a.doc.execCommand("styleWithCSS",0,d.toString())}d=true;var f;if(l&&b.toLowerCase()=="inserthtml")y(a).pasteHTML(c);else{try{d=a.doc.execCommand(b,0,c||null)}catch(i){f=i.description;d=false}d||("cutcopypaste".indexOf(b)>
|
16 |
-
-1?z(a,"For security reasons, your browser does not support the "+b+" command. Try using the keyboard shortcut or context menu instead.",h):z(a,f?f:"Error executing the "+b+" command.",h))}u(a);return d}function w(a){setTimeout(function(){t(a)?a.$area.focus():a.$frame[0].contentWindow.focus();u(a)},0)}function y(a){if(l)return J(a).createRange();return J(a).getRangeAt(0)}function J(a){if(l)return a.doc.selection;return a.$frame[0].contentWindow.getSelection()}function Q(a){var b=/rgba?\((\d+), (\d+), (\d+)/.exec(a),
|
17 |
-
c=a.split("");if(b)for(a=(b[1]<<16|b[2]<<8|b[3]).toString(16);a.length<6;)a="0"+a;return"#"+(a.length==6?a:c[1]+c[1]+c[2]+c[2]+c[3]+c[3])}function r(){e.each(p,function(a,b){e(b).hide().unbind(q).removeData(A)})}function U(){var a=e("link[href$='jquery.cleditor.css']").attr("href");return a.substr(0,a.length-19)+"images/"}function K(a){var b=a.$main,c=a.options;a.$frame&&a.$frame.remove();var d=a.$frame=e('<iframe frameborder="0" src="javascript:true;">').hide().appendTo(b),h=d[0].contentWindow,f=
|
18 |
-
a.doc=h.document,i=e(f);f.open();f.write(c.docType+"<html>"+(c.docCSSFile===""?"":'<head><link rel="stylesheet" type="text/css" href="'+c.docCSSFile+'" /></head>')+'<body style="'+c.bodyStyle+'"></body></html>');f.close();l&&i.click(function(){w(a)});E(a);if(l){i.bind("beforedeactivate beforeactivate selectionchange keypress",function(g){if(g.type=="beforedeactivate")a.inactive=true;else if(g.type=="beforeactivate"){!a.inactive&&a.range&&a.range.length>1&&a.range.shift();delete a.inactive}else if(!a.inactive){if(!a.range)a.range=
|
19 |
-
[];for(a.range.unshift(y(a));a.range.length>2;)a.range.pop()}});d.focus(function(){D(a)})}(e.browser.mozilla?i:e(h)).blur(function(){V(a,true)});i.click(r).bind("keyup mouseup",function(){u(a)});L?a.$area.show():d.show();e(function(){var g=a.$toolbar,j=g.children("div:last"),k=b.width();j=j.offset().top+j.outerHeight()-g.offset().top+1;g.height(j);j=(/%/.test(""+c.height)?b.height():parseInt(c.height))-j;d.width(k).height(j);a.$area.width(k).height(ea?j-2:j);T(a,a.disabled);u(a)})}function u(a){if(!L&&
|
20 |
-
e.browser.webkit&&!a.focused){a.$frame[0].contentWindow.focus();window.focus();a.focused=true}var b=a.doc;if(l)b=y(a);var c=t(a);e.each(a.$toolbar.find("."+W),function(d,h){var f=e(h),i=e.cleditor.buttons[e.data(h,x)],g=i.command,j=true;if(a.disabled)j=false;else if(i.getEnabled){j=i.getEnabled({editor:a,button:h,buttonName:i.name,popup:p[i.popupName],popupName:i.popupName,command:i.command,useCSS:a.options.useCSS});if(j===undefined)j=true}else if((c||L)&&i.name!="source"||l&&(g=="undo"||g=="redo"))j=
|
21 |
-
false;else if(g&&g!="print"){if(l&&g=="hilitecolor")g="backcolor";if(!l||g!="inserthtml")try{j=b.queryCommandEnabled(g)}catch(k){j=false}}if(j){f.removeClass(X);f.removeAttr(n)}else{f.addClass(X);f.attr(n,n)}})}function D(a){l&&a.range&&a.range[0].select()}function M(a){D(a);if(l)return y(a).text;return J(a).toString()}function z(a,b,c){var d=R("msg",a.options,fa);d.innerHTML=b;N(a,d,c)}function N(a,b,c){var d,h,f=e(b);if(c){var i=e(c);d=i.offset();h=--d.left;d=d.top+i.height()}else{i=a.$toolbar;
|
22 |
-
d=i.offset();h=Math.floor((i.width()-f.width())/2)+d.left;d=d.top+i.height()-2}r();f.css({left:h,top:d}).show();if(c){e.data(b,A,c);f.bind(q,{popup:b},e.proxy(ba,a))}setTimeout(function(){f.find(":text,textarea").eq(0).focus().select()},100)}function t(a){return a.$area.is(":visible")}function E(a,b){var c=a.$area.val(),d=a.options,h=d.updateFrame,f=e(a.doc.body);if(h){var i=C(c);if(b&&a.areaChecksum==i)return;a.areaChecksum=i}c=h?h(c):c;c=c.replace(/<(?=\/?script)/ig,"<");if(d.updateTextArea)a.frameChecksum=
|
23 |
-
C(c);if(c!=f.html()){f.html(c);e(a).triggerHandler(F)}}function V(a,b){var c=e(a.doc.body).html(),d=a.options,h=d.updateTextArea,f=a.$area;if(h){var i=C(c);if(b&&a.frameChecksum==i)return;a.frameChecksum=i}c=h?h(c):c;if(d.updateFrame)a.areaChecksum=C(c);if(c!=f.val()){f.val(c);e(a).triggerHandler(F)}}e.cleditor={defaultOptions:{width:500,height:250,controls:"bold italic underline strikethrough subscript superscript | font size style | color highlight removeformat | bullets numbering | outdent indent | alignleft center alignright justify | undo redo | rule image link unlink | cut copy paste pastetext | print source",
|
24 |
-
colors:"FFF FCC FC9 FF9 FFC 9F9 9FF CFF CCF FCF CCC F66 F96 FF6 FF3 6F9 3FF 6FF 99F F9F BBB F00 F90 FC6 FF0 3F3 6CC 3CF 66C C6C 999 C00 F60 FC3 FC0 3C0 0CC 36F 63F C3C 666 900 C60 C93 990 090 399 33F 60C 939 333 600 930 963 660 060 366 009 339 636 000 300 630 633 330 030 033 006 309 303",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond,Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",sizes:"1,2,3,4,5,6,7",styles:[["Paragraph","<p>"],["Header 1","<h1>"],["Header 2","<h2>"],
|
25 |
-
["Header 3","<h3>"],["Header 4","<h4>"],["Header 5","<h5>"],["Header 6","<h6>"]],useCSS:false,docType:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',docCSSFile:"",bodyStyle:"margin:4px; font:10pt Arial,Verdana; cursor:text"},buttons:{init:"bold,,|italic,,|underline,,|strikethrough,,|subscript,,|superscript,,|font,,fontname,|size,Font Size,fontsize,|style,,formatblock,|color,Font Color,forecolor,|highlight,Text Highlight Color,hilitecolor,color|removeformat,Remove Formatting,|bullets,,insertunorderedlist|numbering,,insertorderedlist|outdent,,|indent,,|alignleft,Align Text Left,justifyleft|center,,justifycenter|alignright,Align Text Right,justifyright|justify,,justifyfull|undo,,|redo,,|rule,Insert Horizontal Rule,inserthorizontalrule|image,Insert Image,insertimage,url|link,Insert Hyperlink,createlink,url|unlink,Remove Hyperlink,|cut,,|copy,,|paste,,|pastetext,Paste as Text,inserthtml,|print,,|source,Show Source"},
|
26 |
-
imagesPath:function(){return U()}};e.fn.cleditor=function(a){var b=e([]);this.each(function(c,d){if(d.tagName=="TEXTAREA"){var h=e.data(d,Y);h||(h=new cleditor(d,a));b=b.add(h)}});return b};var H="backgroundColor",A="button",x="buttonName",F="change",Y="cleditor",q="click",n="disabled",m="<div>",I="unselectable",W="cleditorButton",X="cleditorDisabled",ca="cleditorPopup",S="cleditorList",da="cleditorColor",B="cleditorPrompt",fa="cleditorMsg",l=e.browser.msie,ea=/msie\s6/i.test(navigator.userAgent),
|
27 |
-
L=/iphone|ipad|ipod/i.test(navigator.userAgent),p={},Z,s=e.cleditor.buttons;e.each(s.init.split("|"),function(a,b){var c=b.split(","),d=c[0];s[d]={stripIndex:a,name:d,title:c[1]===""?d.charAt(0).toUpperCase()+d.substr(1):c[1],command:c[2]===""?d:c[2],popupName:c[3]===""?d:c[3]}});delete s.init;cleditor=function(a,b){var c=this;c.options=b=e.extend({},e.cleditor.defaultOptions,b);var d=c.$area=e(a).hide().data(Y,c).blur(function(){E(c,true)}),h=c.$main=e(m).addClass("cleditorMain").width(b.width).height(b.height),
|
28 |
-
f=c.$toolbar=e(m).addClass("cleditorToolbar").appendTo(h),i=e(m).addClass("cleditorGroup").appendTo(f);e.each(b.controls.split(" "),function(g,j){if(j==="")return true;if(j=="|"){e(m).addClass("cleditorDivider").appendTo(i);i=e(m).addClass("cleditorGroup").appendTo(f)}else{var k=s[j],o=e(m).data(x,k.name).addClass(W).attr("title",k.title).bind(q,e.proxy(aa,c)).appendTo(i).hover(O,P),G={};if(k.css)G=k.css;else if(k.image)G.backgroundImage="url("+U()+k.image+")";if(k.stripIndex)G.backgroundPosition=
|
29 |
-
k.stripIndex*-24;o.css(G);l&&o.attr(I,"on");k.popupName&&R(k.popupName,b,k.popupClass,k.popupContent,k.popupHover)}});h.insertBefore(d).append(d);if(!Z){e(document).click(function(g){g=e(g.target);g.add(g.parents()).is("."+B)||r()});Z=true}/auto|%/.test(""+b.width+b.height)&&e(window).resize(function(){K(c)});K(c)};var $=cleditor.prototype;e.each([["clear",function(a){a.$area.val("");E(a)}],["disable",T],["execCommand",v],["focus",w],["hidePopups",r],["sourceMode",t,true],["refresh",K],["select",
|
30 |
-
function(a){setTimeout(function(){t(a)?a.$area.select():v(a,"selectall")},0)}],["selectedHTML",function(a){D(a);a=y(a);if(l)return a.htmlText;var b=e("<layer>")[0];b.appendChild(a.cloneContents());return b.innerHTML},true],["selectedText",M,true],["showMessage",z],["updateFrame",E],["updateTextArea",V]],function(a,b){$[b[0]]=function(){for(var c=[this],d=0;d<arguments.length;d++)c.push(arguments[d]);c=b[1].apply(this,c);if(b[2])return c;return this}});$.change=function(a){var b=e(this);return a?b.bind(F,
|
31 |
-
a):b.trigger(F)}})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui/js/jquery.json.js
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* jQuery JSON Plugin
|
3 |
-
* version: 2.3 (2011-09-17)
|
4 |
-
*
|
5 |
-
* This document is licensed as free software under the terms of the
|
6 |
-
* MIT License: http://www.opensource.org/licenses/mit-license.php
|
7 |
-
*
|
8 |
-
* Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
|
9 |
-
* website's http://www.json.org/json2.js, which proclaims:
|
10 |
-
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
|
11 |
-
* I uphold.
|
12 |
-
*
|
13 |
-
* It is also influenced heavily by MochiKit's serializeJSON, which is
|
14 |
-
* copyrighted 2005 by Bob Ippolito.
|
15 |
-
*/
|
16 |
-
(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
|
17 |
-
var type=typeof o;if(type==='undefined'){return undefined;}
|
18 |
-
if(type==='number'||type==='boolean'){return''+o;}
|
19 |
-
if(type==='string'){return $.quoteString(o);}
|
20 |
-
if(type==='object'){if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());}
|
21 |
-
if(o.constructor===Date){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
|
22 |
-
if(day<10){day='0'+day;}
|
23 |
-
if(hours<10){hours='0'+hours;}
|
24 |
-
if(minutes<10){minutes='0'+minutes;}
|
25 |
-
if(seconds<10){seconds='0'+seconds;}
|
26 |
-
if(milli<100){milli='0'+milli;}
|
27 |
-
if(milli<10){milli='0'+milli;}
|
28 |
-
return'"'+year+'-'+month+'-'+day+'T'+
|
29 |
-
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
|
30 |
-
if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||'null');}
|
31 |
-
return'['+ret.join(',')+']';}
|
32 |
-
var name,val,pairs=[];for(var k in o){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=$.quoteString(k);}else{continue;}
|
33 |
-
type=typeof o[k];if(type==='function'||type==='undefined'){continue;}
|
34 |
-
val=$.toJSON(o[k]);pairs.push(name+':'+val);}
|
35 |
-
return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){return eval('('+src+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+src+')');}else{throw new SyntaxError('Error parsing JSON, source is not valid.');}};$.quoteString=function(string){if(string.match(escapeable)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
|
36 |
-
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
|
37 |
-
return'"'+string+'"';};})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui/js/jquery.maskedinput-1.3.min.js
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
c/*
|
2 |
-
Masked Input plugin for jQuery
|
3 |
-
Copyright (c) 2007-2011 Josh Bush (digitalbush.com)
|
4 |
-
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
|
5 |
-
Version: 1.3
|
6 |
-
*/
|
7 |
-
(function(a){var b=(a.browser.msie?"paste":"input")+".mask",c=window.orientation!=undefined;a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn"},a.fn.extend({caret:function(a,b){if(this.length!=0){if(typeof a=="number"){b=typeof b=="number"?b:a;return this.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}})}if(this[0].setSelectionRange)a=this[0].selectionStart,b=this[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},unmask:function(){return this.trigger("unmask")},mask:function(d,e){if(!d&&this.length>0){var f=a(this[0]);return f.data(a.mask.dataName)()}e=a.extend({placeholder:"_",completed:null},e);var g=a.mask.definitions,h=[],i=d.length,j=null,k=d.length;a.each(d.split(""),function(a,b){b=="?"?(k--,i=a):g[b]?(h.push(new RegExp(g[b])),j==null&&(j=h.length-1)):h.push(null)});return this.trigger("unmask").each(function(){function v(a){var b=f.val(),c=-1;for(var d=0,g=0;d<k;d++)if(h[d]){l[d]=e.placeholder;while(g++<b.length){var m=b.charAt(g-1);if(h[d].test(m)){l[d]=m,c=d;break}}if(g>b.length)break}else l[d]==b.charAt(g)&&d!=i&&(g++,c=d);if(!a&&c+1<i)f.val(""),t(0,k);else if(a||c+1>=i)u(),a||f.val(f.val().substring(0,c+1));return i?d:j}function u(){return f.val(l.join("")).val()}function t(a,b){for(var c=a;c<b&&c<k;c++)h[c]&&(l[c]=e.placeholder)}function s(a){var b=a.which,c=f.caret();if(a.ctrlKey||a.altKey||a.metaKey||b<32)return!0;if(b){c.end-c.begin!=0&&(t(c.begin,c.end),p(c.begin,c.end-1));var d=n(c.begin-1);if(d<k){var g=String.fromCharCode(b);if(h[d].test(g)){q(d),l[d]=g,u();var i=n(d);f.caret(i),e.completed&&i>=k&&e.completed.call(f)}}return!1}}function r(a){var b=a.which;if(b==8||b==46||c&&b==127){var d=f.caret(),e=d.begin,g=d.end;g-e==0&&(e=b!=46?o(e):g=n(e-1),g=b==46?n(g):g),t(e,g),p(e,g-1);return!1}if(b==27){f.val(m),f.caret(0,v());return!1}}function q(a){for(var b=a,c=e.placeholder;b<k;b++)if(h[b]){var d=n(b),f=l[b];l[b]=c;if(d<k&&h[d].test(f))c=f;else break}}function p(a,b){if(!(a<0)){for(var c=a,d=n(b);c<k;c++)if(h[c]){if(d<k&&h[c].test(l[d]))l[c]=l[d],l[d]=e.placeholder;else break;d=n(d)}u(),f.caret(Math.max(j,a))}}function o(a){while(--a>=0&&!h[a]);return a}function n(a){while(++a<=k&&!h[a]);return a}var f=a(this),l=a.map(d.split(""),function(a,b){if(a!="?")return g[a]?e.placeholder:a}),m=f.val();f.data(a.mask.dataName,function(){return a.map(l,function(a,b){return h[b]&&a!=e.placeholder?a:null}).join("")}),f.attr("readonly")||f.one("unmask",function(){f.unbind(".mask").removeData(a.mask.dataName)}).bind("focus.mask",function(){m=f.val();var b=v();u();var c=function(){b==d.length?f.caret(0,b):f.caret(b)};(a.browser.msie?c:function(){setTimeout(c,0)})()}).bind("blur.mask",function(){v(),f.val()!=m&&f.change()}).bind("keydown.mask",r).bind("keypress.mask",s).bind(b,function(){setTimeout(function(){f.caret(v(!0))},0)}),v()})}})})(jQuery)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui/js/jquery.pods.attach.js
CHANGED
@@ -17,7 +17,7 @@ function pods_attachments ( src, file_limit ) {
|
|
17 |
// Create 'Add' link
|
18 |
var pods_file_quick_add = jQuery( '<a href="#">' + PodsI18n.__( 'Add' ) + '</a>' ).addClass( 'pods-quick-add' );
|
19 |
|
20 |
-
pods_file_quick_add.
|
21 |
var item = jQuery( this );
|
22 |
var item_parent = item.parent();
|
23 |
|
@@ -49,7 +49,7 @@ function pods_attachments ( src, file_limit ) {
|
|
49 |
}
|
50 |
}
|
51 |
|
52 |
-
pods_thickbox.find( 'td.savesend input' ).
|
53 |
var wp_media_meta = jQuery( this ).parent().parent().parent();
|
54 |
|
55 |
pods_thickbox_send( wp_media_meta, e );
|
17 |
// Create 'Add' link
|
18 |
var pods_file_quick_add = jQuery( '<a href="#">' + PodsI18n.__( 'Add' ) + '</a>' ).addClass( 'pods-quick-add' );
|
19 |
|
20 |
+
pods_file_quick_add.on( 'click', function( e ) {
|
21 |
var item = jQuery( this );
|
22 |
var item_parent = item.parent();
|
23 |
|
49 |
}
|
50 |
}
|
51 |
|
52 |
+
pods_thickbox.find( 'td.savesend input' ).off( 'click' ).on( 'click', function ( e ) {
|
53 |
var wp_media_meta = jQuery( this ).parent().parent().parent();
|
54 |
|
55 |
pods_thickbox_send( wp_media_meta, e );
|
ui/js/jquery.pods.js
CHANGED
@@ -16,12 +16,13 @@
|
|
16 |
|
17 |
var label = '';
|
18 |
|
19 |
-
if ( 'undefined' != typeof $el.data( 'label' ) )
|
20 |
-
|
21 |
-
else if ( 0 < $el.parent().find( 'label' ).length )
|
22 |
-
|
23 |
-
else
|
24 |
-
|
|
|
25 |
|
26 |
// TinyMCE support
|
27 |
if ( 'object' == typeof tinyMCE && -1 < $el.prop( 'class' ).indexOf( 'pods-ui-field-tinymce' ) )
|
@@ -112,7 +113,7 @@
|
|
112 |
$el.trigger( 'change' );
|
113 |
|
114 |
if ( false !== valid_form )
|
115 |
-
$el.focus
|
116 |
|
117 |
valid_form = false;
|
118 |
}
|
@@ -199,7 +200,7 @@
|
|
199 |
$el.trigger( 'change' );
|
200 |
|
201 |
if ( false !== valid_form )
|
202 |
-
$el.focus
|
203 |
|
204 |
valid_form = false;
|
205 |
}
|
@@ -313,10 +314,11 @@
|
|
313 |
$submitbutton.prop( 'disabled', false );
|
314 |
$submitbutton.parent().find( '.waiting' ).fadeOut();
|
315 |
|
316 |
-
|
317 |
-
|
318 |
-
$
|
319 |
-
$
|
|
|
320 |
}
|
321 |
}
|
322 |
},
|
@@ -335,10 +337,11 @@
|
|
335 |
$submitbutton.prop( 'disabled', false );
|
336 |
$submitbutton.parent().find( '.waiting' ).fadeOut();
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
$
|
341 |
-
$
|
|
|
342 |
}
|
343 |
}
|
344 |
} );
|
@@ -464,44 +467,47 @@
|
|
464 |
|
465 |
// Handle click to edit
|
466 |
$sluggable.on( 'click', '.pods-slug em, .pods-slug input[type=button]', function () {
|
467 |
-
|
468 |
-
$
|
|
|
469 |
|
470 |
-
$
|
471 |
-
$
|
472 |
|
473 |
-
$
|
474 |
-
$
|
475 |
} );
|
476 |
|
477 |
// Handle slug save
|
478 |
$sluggable.on( 'click', '.pods-slug-edit input[type=button]', function () {
|
479 |
-
|
480 |
-
$
|
|
|
481 |
|
482 |
-
last_slug = $
|
483 |
|
484 |
last_slug = last_slug.replace( /<( ?:. )*?>/g, '' ).replace( /([^0-9a-zA-Z\_\- ])/g, '' );
|
485 |
|
486 |
-
$
|
487 |
$( '.pods-slugged-lower:not(.pods-slugged[data-sluggable])' ).html( last_slug.toLowerCase() );
|
488 |
$( '.pods-slugged:not(.pods-slugged[data-sluggable])' ).html( last_slug.charAt( 0 ).toUpperCase() + last_slug.slice( 1 ) );
|
489 |
-
$
|
490 |
|
491 |
-
$
|
492 |
-
$
|
493 |
} );
|
494 |
|
495 |
// Handle cancel slug edit
|
496 |
$sluggable.on( 'click', '.pods-slug-edit a.cancel', function ( e ) {
|
497 |
-
|
498 |
-
$
|
|
|
499 |
|
500 |
-
$
|
501 |
-
$
|
502 |
|
503 |
-
$
|
504 |
-
$
|
505 |
|
506 |
e.preventDefault();
|
507 |
} );
|
@@ -585,26 +591,30 @@
|
|
585 |
},
|
586 |
tabbed : function () {
|
587 |
$( '.pods-admin' ).on( 'click', '.pods-tabs .pods-tab a.pods-tab-link', function ( e ) {
|
588 |
-
|
589 |
-
|
|
|
|
|
590 |
|
591 |
-
|
|
|
592 |
|
593 |
-
if ( 'undefined' != typeof $
|
594 |
-
|
|
|
595 |
|
596 |
-
|
597 |
-
var tab_hash = this.hash;
|
598 |
|
599 |
if ( $tabbed.find( '.pods-tabs .pods-tab a[data-tabs]' )[ 0 ] ) {
|
600 |
$tabbed.find( '.pods-tabs .pods-tab a[data-tabs]' ).each( function () {
|
601 |
var tabs = $( this ).data( 'tabs' ),
|
602 |
this_tab_hash = this.hash;
|
603 |
|
604 |
-
if ( tab_hash != this_tab_hash )
|
605 |
-
|
606 |
-
else
|
607 |
-
|
|
|
608 |
} );
|
609 |
}
|
610 |
else {
|
@@ -612,18 +622,18 @@
|
|
612 |
var $current_tab = $tabbed.find( '.pods-tab-group .pods-tab' + tab_hash );
|
613 |
|
614 |
$( '.pods-dependent-toggle', $current_tab ).each( function () {
|
615 |
-
var elementId = $( this ).attr( 'id' )
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
|
628 |
// Pick multi/single select: Bypass dependency checks on the format of selection types
|
629 |
// that aren't currently chosen. We shouldn't check dependencies against format_single
|
@@ -656,10 +666,10 @@
|
|
656 |
|
657 |
$tabbed.find( '.pods-tabs .pods-tab a' ).removeClass( 'selected' );
|
658 |
|
659 |
-
$
|
660 |
|
661 |
-
$
|
662 |
-
$
|
663 |
|
664 |
e.preventDefault();
|
665 |
} );
|
@@ -669,31 +679,35 @@
|
|
669 |
$( '.pods-tab-group .pods-tab:first' ).each( function () {
|
670 |
$( '.pods-dependent-toggle', this ).trigger( 'change' );
|
671 |
$( this ).show();
|
672 |
-
} )
|
673 |
} );
|
674 |
},
|
675 |
nav_tabbed : function () {
|
676 |
$( '.pods-admin' ).on( 'click', '.pods-nav-tabs a.pods-nav-tab-link', function ( e ) {
|
677 |
-
|
678 |
-
|
|
|
|
|
679 |
|
680 |
-
|
|
|
681 |
|
682 |
-
if ( 'undefined' != typeof $
|
683 |
-
|
|
|
684 |
|
685 |
-
|
686 |
-
var tab_hash = this.hash;
|
687 |
|
688 |
if ( $tabbed.find( '.pods-nav-tabs a.pods-nav-tab-link[data-tabs]' )[ 0 ] ) {
|
689 |
$tabbed.find( '.pods-nav-tabs a.pods-nav-tab-link[data-tabs]' ).each( function () {
|
690 |
var tabs = $( this ).data( 'tabs' ),
|
691 |
this_tab_hash = this.hash;
|
692 |
|
693 |
-
if ( tab_hash != this_tab_hash )
|
694 |
-
|
695 |
-
else
|
696 |
-
|
|
|
697 |
} );
|
698 |
}
|
699 |
else {
|
@@ -710,10 +724,10 @@
|
|
710 |
|
711 |
$tabbed.find( '.pods-nav-tabs a.pods-nav-tab-link' ).removeClass( 'nav-tab-active' );
|
712 |
|
713 |
-
$
|
714 |
|
715 |
-
$
|
716 |
-
$
|
717 |
|
718 |
e.preventDefault();
|
719 |
} );
|
@@ -724,7 +738,7 @@
|
|
724 |
$nav_tabbed.find( '.pods-nav-tab-group .pods-nav-tab:first' ).each( function () {
|
725 |
$( '.pods-dependent-toggle', this ).trigger( 'change' );
|
726 |
$( this ).show();
|
727 |
-
} )
|
728 |
} );
|
729 |
},
|
730 |
wizard : function () {
|
@@ -733,7 +747,7 @@
|
|
733 |
$( '#pods-wizard-next' ).text( $( '#pods-wizard-next' ).data( 'finished' ) );
|
734 |
},
|
735 |
setProgress : function () {
|
736 |
-
$( '#pods-wizard-next' ).text( $( '#pods-wizard-next' ).data( 'next
|
737 |
},
|
738 |
stepBackward : function () {
|
739 |
$( '#pods-wizard-next' )
|
@@ -755,18 +769,16 @@
|
|
755 |
step = $( 'li.pods-wizard-menu-current' ).data( 'step' );
|
756 |
|
757 |
// Show start over button
|
758 |
-
if ( 1 == step )
|
759 |
-
|
760 |
-
else
|
761 |
-
|
|
|
762 |
|
763 |
// Check if last step
|
764 |
if ( $( 'div.pods-wizard-panel:visible' ).prev( 'div.pods-wizard-panel' ).length ) {
|
765 |
// Show next panel
|
766 |
-
$( 'div.pods-wizard-panel:visible' )
|
767 |
-
.hide()
|
768 |
-
.prev()
|
769 |
-
.show();
|
770 |
}
|
771 |
|
772 |
window.location.hash = '';
|
@@ -785,32 +797,29 @@
|
|
785 |
.next( 'li' )
|
786 |
.addClass( 'pods-wizard-menu-current' );
|
787 |
|
788 |
-
// Get current step
|
789 |
-
|
790 |
|
791 |
-
if ( $( 'li.pods-wizard-menu-current[data-step]' )[ 0 ] )
|
792 |
-
|
|
|
793 |
|
794 |
-
// Show start over button
|
795 |
$( '#pods-wizard-start' ).show();
|
796 |
|
797 |
-
//
|
798 |
-
var check = true;
|
799 |
-
|
800 |
-
// Check if last step
|
801 |
if ( $( 'div.pods-wizard-panel:visible' ).next( 'div.pods-wizard-panel' ).length ) {
|
802 |
// Show next panel
|
803 |
-
$( 'div.pods-wizard-panel:visible' )
|
804 |
-
.hide()
|
805 |
-
.next()
|
806 |
-
.show();
|
807 |
|
808 |
// Allow for override
|
809 |
-
if ( 'undefined' != typeof pods_admin_wizard_callback )
|
810 |
-
|
|
|
811 |
|
812 |
-
if ( false === check )
|
813 |
-
|
|
|
814 |
|
815 |
window.location.hash = '';
|
816 |
}
|
@@ -821,11 +830,13 @@
|
|
821 |
.text( $( '#pods-wizard-next' ).data( 'processing' ) );
|
822 |
|
823 |
// Allow for override
|
824 |
-
if ( 'undefined' != typeof pods_admin_wizard_callback )
|
825 |
-
|
|
|
826 |
|
827 |
-
if ( false === check )
|
828 |
-
|
|
|
829 |
|
830 |
$( '#pods-wizard-box' ).closest( 'form' ).submit();
|
831 |
|
@@ -840,14 +851,15 @@
|
|
840 |
.removeClass( 'pods-wizard-menu-complete' )
|
841 |
.addClass( 'pods-wizard-menu-current' )
|
842 |
}
|
843 |
-
}
|
844 |
-
else {
|
845 |
// Allow for override
|
846 |
-
if ( 'undefined' != typeof pods_admin_wizard_callback )
|
847 |
-
|
|
|
848 |
|
849 |
-
if ( false === check )
|
850 |
-
|
|
|
851 |
|
852 |
methods.setFinished();
|
853 |
|
@@ -860,8 +872,9 @@
|
|
860 |
|
861 |
// If first panel and action bar is supposed to be hidden, hide it.
|
862 |
var $box = $( '#pods-wizard-box' );
|
863 |
-
if ( $box.data( 'hide' ) )
|
864 |
-
|
|
|
865 |
|
866 |
// Revert to first current menu item
|
867 |
$( '#pods-wizard-heading ul li' )
|
@@ -870,10 +883,7 @@
|
|
870 |
.addClass( 'pods-wizard-menu-current' );
|
871 |
|
872 |
// Revert to first panel
|
873 |
-
$( 'div.pods-wizard-panel' )
|
874 |
-
.hide()
|
875 |
-
.first()
|
876 |
-
.show();
|
877 |
|
878 |
// Hide start over button
|
879 |
$( '.pods-wizard-option-selected' ).removeClass();
|
@@ -881,8 +891,9 @@
|
|
881 |
$( 'div.pods-wizard-option-cont' ).hide();
|
882 |
$( '#pods-wizard-choices' ).fadeIn( 'fast' );
|
883 |
|
884 |
-
if ( 'undefined' != typeof pods_admin_wizard_startover_callback )
|
885 |
-
|
|
|
886 |
|
887 |
window.location.hash = '';
|
888 |
}
|
@@ -890,8 +901,9 @@
|
|
890 |
|
891 |
// Next button event binding
|
892 |
$( '#pods-wizard-next' ).on( 'click', function ( e ) {
|
893 |
-
if ( $( this ).is( ':disabled' ) )
|
894 |
-
|
|
|
895 |
|
896 |
e.preventDefault();
|
897 |
|
@@ -924,8 +936,9 @@
|
|
924 |
$( target ).show();
|
925 |
$( '.pods-wizard-option-content-' + target.replace( '#pods-wizard-', '' ) ).show();
|
926 |
|
927 |
-
if ( 'undefined' != typeof pods_admin_option_select_callback )
|
928 |
-
|
|
|
929 |
|
930 |
methods.stepForward();
|
931 |
} );
|
@@ -966,6 +979,7 @@
|
|
966 |
*
|
967 |
* @todo Validate & improve this
|
968 |
*/
|
|
|
969 |
// Are we in the "Fields" tab?
|
970 |
if ( $current.parents('#pods-manage-fields').length ) {
|
971 |
// And are we also in the "Additional Field Options" tab?
|
@@ -988,108 +1002,98 @@
|
|
988 |
dependent_specific = dependent_flag + '-' + val.replace( /\_/gi, '-' );
|
989 |
|
990 |
$current.find( dependent_flag ).each( function () {
|
991 |
-
var $
|
992 |
dependency_trigger;
|
993 |
|
994 |
-
if ( $
|
995 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
996 |
-
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $
|
997 |
-
if ( $
|
998 |
-
|
999 |
-
else
|
1000 |
-
|
|
|
1001 |
|
1002 |
-
$
|
1003 |
-
$
|
1004 |
|
1005 |
-
$
|
1006 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1007 |
} );
|
1008 |
|
1009 |
-
if ( $
|
1010 |
-
dependency_trigger = $
|
1011 |
-
|
1012 |
-
dependency_trigger = window[ dependency_trigger ];
|
1013 |
-
|
1014 |
-
dependency_trigger( $dependent_el );
|
1015 |
}
|
1016 |
}
|
1017 |
-
else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $
|
1018 |
-
if ( $
|
1019 |
-
|
1020 |
-
else
|
1021 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1022 |
}
|
1023 |
-
}
|
1024 |
-
else if ( $dependent_el.is( dependent_specific ) ) {
|
1025 |
-
if ( $dependent_el.is( 'tr' ) )
|
1026 |
-
$dependent_el.show().addClass( 'pods-dependent-visible' );
|
1027 |
-
else
|
1028 |
-
$dependent_el.slideDown().addClass( 'pods-dependent-visible' );
|
1029 |
|
1030 |
-
$
|
1031 |
-
$
|
1032 |
|
1033 |
-
$
|
1034 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1035 |
} );
|
1036 |
|
1037 |
-
if ( $
|
1038 |
-
dependency_trigger = $
|
1039 |
-
|
1040 |
-
dependency_trigger = window[ dependency_trigger ];
|
1041 |
-
|
1042 |
-
dependency_trigger( $dependent_el );
|
1043 |
}
|
1044 |
}
|
1045 |
else {
|
1046 |
-
if ( $
|
1047 |
-
|
1048 |
-
else
|
1049 |
-
|
|
|
1050 |
}
|
1051 |
}
|
1052 |
else {
|
1053 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1054 |
-
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $
|
1055 |
-
$
|
1056 |
-
$
|
1057 |
-
$
|
1058 |
|
1059 |
-
$
|
1060 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1061 |
} );
|
1062 |
|
1063 |
-
if ( $
|
1064 |
-
dependency_trigger = $
|
1065 |
-
|
1066 |
-
dependency_trigger = window[ dependency_trigger ];
|
1067 |
-
|
1068 |
-
dependency_trigger( $dependent_el );
|
1069 |
}
|
|
|
|
|
1070 |
}
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
$dependent_el.show().addClass( 'pods-dependent-visible' );
|
1076 |
-
$dependent_el.find( '.pods-dependency .pods-depends-on' ).hide();
|
1077 |
-
$dependent_el.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1078 |
|
1079 |
-
$
|
1080 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1081 |
} );
|
1082 |
|
1083 |
-
if ( $
|
1084 |
-
dependency_trigger = $
|
1085 |
-
|
1086 |
-
dependency_trigger = window[ dependency_trigger ];
|
1087 |
-
|
1088 |
-
dependency_trigger( $dependent_el );
|
1089 |
}
|
|
|
|
|
1090 |
}
|
1091 |
-
else
|
1092 |
-
$dependent_el.hide().removeClass( 'pods-dependent-visible' );
|
1093 |
}
|
1094 |
} );
|
1095 |
|
@@ -1097,106 +1101,97 @@
|
|
1097 |
exclude_specific = exclude_flag + '-' + val.replace( /\_/gi, '-' );
|
1098 |
|
1099 |
$current.find( exclude_flag ).each( function () {
|
1100 |
-
var $
|
1101 |
dependency_trigger;
|
1102 |
|
1103 |
-
if ( $
|
1104 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1105 |
-
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $
|
1106 |
-
if ( $
|
1107 |
-
|
1108 |
-
else
|
1109 |
-
|
|
|
1110 |
}
|
1111 |
-
else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $
|
1112 |
-
if ( $
|
1113 |
-
|
1114 |
-
else
|
1115 |
-
|
|
|
1116 |
|
1117 |
-
$
|
1118 |
-
$
|
1119 |
|
1120 |
-
$
|
1121 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1122 |
} );
|
1123 |
|
1124 |
-
if ( $
|
1125 |
-
dependency_trigger = $
|
1126 |
-
|
1127 |
-
dependency_trigger = window[ dependency_trigger ];
|
1128 |
-
|
1129 |
-
dependency_trigger( $dependent_el );
|
1130 |
}
|
1131 |
}
|
1132 |
}
|
1133 |
-
else if ( $
|
1134 |
-
if ( $
|
1135 |
-
|
1136 |
-
else
|
1137 |
-
|
|
|
1138 |
}
|
1139 |
else {
|
1140 |
-
if ( $
|
1141 |
-
|
1142 |
-
else
|
1143 |
-
|
|
|
1144 |
|
1145 |
-
$
|
1146 |
-
$
|
1147 |
|
1148 |
-
$
|
1149 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1150 |
} );
|
1151 |
|
1152 |
-
if ( $
|
1153 |
-
dependency_trigger = $
|
1154 |
-
|
1155 |
-
dependency_trigger = window[ dependency_trigger ];
|
1156 |
-
|
1157 |
-
dependency_trigger( $dependent_el );
|
1158 |
}
|
1159 |
}
|
1160 |
}
|
1161 |
else {
|
1162 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1163 |
-
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $
|
1164 |
-
|
1165 |
-
else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $
|
1166 |
-
$
|
1167 |
-
$
|
1168 |
-
$
|
1169 |
-
|
1170 |
-
$
|
1171 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1172 |
} );
|
1173 |
|
1174 |
-
if ( $
|
1175 |
-
dependency_trigger = $
|
1176 |
-
|
1177 |
-
dependency_trigger = window[ dependency_trigger ];
|
1178 |
-
|
1179 |
-
dependency_trigger( $dependent_el );
|
1180 |
}
|
1181 |
}
|
1182 |
-
}
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
$
|
1187 |
-
$
|
1188 |
-
|
1189 |
-
|
1190 |
-
$dependent_el.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1191 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1192 |
} );
|
1193 |
|
1194 |
-
if ( $
|
1195 |
-
dependency_trigger = $
|
1196 |
-
|
1197 |
-
dependency_trigger = window[ dependency_trigger ];
|
1198 |
-
|
1199 |
-
dependency_trigger( $dependent_el );
|
1200 |
}
|
1201 |
}
|
1202 |
}
|
@@ -1207,9 +1202,9 @@
|
|
1207 |
wildcard_target_value = val.replace( /\_/gi, '-' );
|
1208 |
|
1209 |
$current.find( wildcard_target ).each( function () {
|
1210 |
-
var $
|
1211 |
data_attribute = 'pods-wildcard-' + $field.data( 'name-clean' ),
|
1212 |
-
wildcard_data = $
|
1213 |
match_found,
|
1214 |
dependency_trigger;
|
1215 |
|
@@ -1228,61 +1223,54 @@
|
|
1228 |
} );
|
1229 |
|
1230 |
// Set the state of the dependent element
|
1231 |
-
if ( $
|
1232 |
if ( match_found ) {
|
1233 |
-
if ( $
|
1234 |
-
$
|
1235 |
-
}
|
1236 |
-
|
1237 |
-
$dependent_el.slideDown().addClass( 'pods-dependent-visible' );
|
1238 |
}
|
1239 |
|
1240 |
-
$
|
1241 |
-
$
|
1242 |
-
$
|
1243 |
|
1244 |
-
$
|
1245 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1246 |
} );
|
1247 |
|
1248 |
-
if ( $
|
1249 |
-
dependency_trigger = $
|
1250 |
-
|
1251 |
-
dependency_trigger = window[ dependency_trigger ];
|
1252 |
-
|
1253 |
-
dependency_trigger( $dependent_el );
|
1254 |
}
|
1255 |
}
|
1256 |
else { // No wildcard matches
|
1257 |
-
if ( $
|
1258 |
-
$
|
1259 |
}
|
1260 |
else {
|
1261 |
-
$
|
1262 |
}
|
1263 |
}
|
1264 |
}
|
1265 |
else { // Parent element wasn't visible
|
1266 |
if ( match_found ) {
|
1267 |
-
$
|
1268 |
-
$
|
1269 |
-
$
|
1270 |
-
$
|
1271 |
|
1272 |
-
$
|
1273 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1274 |
} );
|
1275 |
|
1276 |
-
if ( $
|
1277 |
-
dependency_trigger = $
|
1278 |
-
|
1279 |
-
dependency_trigger = window[ dependency_trigger ];
|
1280 |
-
|
1281 |
-
dependency_trigger( $dependent_el );
|
1282 |
}
|
1283 |
}
|
1284 |
else { // No wildcard matches
|
1285 |
-
$
|
1286 |
}
|
1287 |
}
|
1288 |
} );
|
@@ -1293,9 +1281,9 @@
|
|
1293 |
|
1294 |
// Handle dependent toggle
|
1295 |
$( '.pods-admin, .pods-form-front' ).on( 'change', '.pods-dependent-toggle[data-name-clean]', function ( e ) {
|
1296 |
-
var selectionTypeRegex = /pick-format-type$/g
|
1297 |
-
|
1298 |
-
|
1299 |
|
1300 |
// Setup dependencies for the field that changed
|
1301 |
methods[ 'setup_dependencies' ]( $( this ) );
|
@@ -1323,71 +1311,73 @@
|
|
1323 |
|
1324 |
// Handle dependent toggle
|
1325 |
$( '.pods-admin' ).on( 'click', '.pods-dependency-tabs .pods-dependent-tab', function ( e ) {
|
1326 |
-
var $el = $( this )
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
var dependent_specific = dependent_flag + '-' + $el.val().replace( /\_/gi, '-' );
|
1332 |
|
1333 |
$current.find( dependent_flag ).each( function () {
|
1334 |
-
var $
|
1335 |
|
1336 |
-
if ( $
|
1337 |
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1338 |
-
if ( $
|
1339 |
-
|
1340 |
-
else
|
1341 |
-
|
|
|
1342 |
|
1343 |
-
$
|
1344 |
-
$
|
1345 |
|
1346 |
-
$
|
1347 |
$( this ).trigger( 'click' );
|
1348 |
} );
|
1349 |
}
|
1350 |
-
else if ( $
|
1351 |
-
if ( $
|
1352 |
-
|
1353 |
-
else
|
1354 |
-
|
|
|
1355 |
|
1356 |
-
$
|
1357 |
-
$
|
1358 |
|
1359 |
-
$
|
1360 |
$( this ).trigger( 'click' );
|
1361 |
} );
|
1362 |
}
|
1363 |
else {
|
1364 |
-
if ( $
|
1365 |
-
|
1366 |
-
else
|
1367 |
-
|
|
|
1368 |
}
|
1369 |
}
|
1370 |
else {
|
1371 |
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1372 |
-
$
|
1373 |
-
$
|
1374 |
-
$
|
1375 |
|
1376 |
-
$
|
1377 |
$( this ).trigger( 'click' );
|
1378 |
} );
|
1379 |
}
|
1380 |
-
else if ( $
|
1381 |
-
$
|
1382 |
-
$
|
1383 |
-
$
|
1384 |
|
1385 |
-
$
|
1386 |
$( this ).trigger( 'click' );
|
1387 |
} );
|
1388 |
}
|
1389 |
else
|
1390 |
-
$
|
1391 |
}
|
1392 |
} );
|
1393 |
|
@@ -1395,46 +1385,48 @@
|
|
1395 |
var exclude_specific = exclude_flag + '-' + $el.val().replace( /\_/gi, '-' );
|
1396 |
|
1397 |
$current.find( exclude_flag ).each( function () {
|
1398 |
-
var $
|
1399 |
|
1400 |
-
if ( $
|
1401 |
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1402 |
-
if ( $
|
1403 |
-
|
1404 |
-
else
|
1405 |
-
|
1406 |
-
|
1407 |
-
else if ( $
|
1408 |
-
if ( $
|
1409 |
-
|
1410 |
-
else
|
1411 |
-
|
|
|
1412 |
}
|
1413 |
else {
|
1414 |
-
if ( $
|
1415 |
-
|
1416 |
-
else
|
1417 |
-
|
|
|
1418 |
|
1419 |
-
$
|
1420 |
-
$
|
1421 |
|
1422 |
-
$
|
1423 |
$( this ).trigger( 'click' );
|
1424 |
} );
|
1425 |
}
|
1426 |
}
|
1427 |
else {
|
1428 |
-
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() )
|
1429 |
-
|
1430 |
-
else if ( $
|
1431 |
-
|
1432 |
-
else {
|
1433 |
-
$
|
1434 |
-
$
|
1435 |
-
$
|
1436 |
|
1437 |
-
$
|
1438 |
$( this ).trigger( 'click' );
|
1439 |
} );
|
1440 |
}
|
@@ -1443,7 +1435,7 @@
|
|
1443 |
} );
|
1444 |
|
1445 |
$( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1446 |
-
$( this ).click
|
1447 |
} );
|
1448 |
},
|
1449 |
sortable : function () {
|
@@ -1462,13 +1454,12 @@
|
|
1462 |
$( '.pods-advanced' ).hide();
|
1463 |
|
1464 |
$( '.pods-admin' ).on( 'click', '.pods-advanced-toggle', function ( e ) {
|
1465 |
-
$advanced = $( this ).closest( 'div' ).find( '.pods-advanced' );
|
1466 |
|
1467 |
if ( $advanced.is( ':visible' ) ) {
|
1468 |
$( this ).text( $( this ).text().replace( '-', '+' ) );
|
1469 |
$advanced.slideUp();
|
1470 |
-
}
|
1471 |
-
else {
|
1472 |
$( this ).text( $( this ).text().replace( '+', '-' ) );
|
1473 |
$advanced.slideDown();
|
1474 |
}
|
@@ -1477,27 +1468,26 @@
|
|
1477 |
} );
|
1478 |
},
|
1479 |
collapsible : function ( row ) {
|
1480 |
-
var new_row,
|
1481 |
-
|
1482 |
-
new_row = row;
|
1483 |
|
1484 |
-
if ( new_row[ 0 ] )
|
1485 |
-
|
|
|
1486 |
|
1487 |
// Hide all rows
|
1488 |
$( 'div.pods-manage-row-wrapper' ).hide();
|
1489 |
|
1490 |
-
orig_fields = {};
|
1491 |
-
|
1492 |
// Handle 'Edit' action
|
1493 |
$( 'tbody.pods-manage-list' ).on( 'click', 'a.pods-manage-row-edit', function ( e ) {
|
1494 |
-
var $
|
1495 |
-
|
|
|
1496 |
|
1497 |
-
$
|
1498 |
-
$
|
1499 |
|
1500 |
-
$row = $
|
1501 |
$row_label = $row.find( 'td.pods-manage-row-label' );
|
1502 |
$row_content = $row_label.find( 'div.pods-manage-row-wrapper' );
|
1503 |
|
@@ -1512,28 +1502,31 @@
|
|
1512 |
$row_label.prop( 'colspan', '1' );
|
1513 |
|
1514 |
$row_content.find( 'input, select, textarea' ).each( function () {
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
|
|
1518 |
else
|
1519 |
-
$
|
1520 |
}
|
1521 |
} );
|
1522 |
} );
|
1523 |
}
|
1524 |
else {
|
1525 |
-
$tbody = $
|
1526 |
|
1527 |
$row.animate( {backgroundColor : '#B80000'} );
|
1528 |
|
1529 |
$row.fadeOut( 'slow', function () {
|
1530 |
$( this ).remove();
|
1531 |
-
if ( 0 === $( 'tbody.pods-manage-list tr.pods-manage-row' ).length )
|
1532 |
-
|
|
|
1533 |
} );
|
1534 |
|
1535 |
-
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) )
|
1536 |
-
|
|
|
1537 |
}
|
1538 |
}
|
1539 |
// Row inactive, show it
|
@@ -1565,37 +1558,38 @@
|
|
1565 |
field_array_counter = 0;
|
1566 |
|
1567 |
$field_wrapper.find( 'input, select, textarea' ).each( function () {
|
1568 |
-
|
|
|
|
|
1569 |
|
1570 |
if ( 'undefined' == typeof field_data[ json_name ] )
|
1571 |
return;
|
1572 |
|
1573 |
-
if ( 0 < $
|
1574 |
-
if ( $
|
1575 |
-
$
|
1576 |
|
1577 |
-
orig_fields[ $row.data( 'id' ) ][ $
|
1578 |
-
|
1579 |
-
else if ( 'undefined' != typeof field_data[ json_name ][ field_array_counter ] ) {
|
1580 |
-
$
|
1581 |
|
1582 |
-
orig_fields[ $row.data( 'id' ) ][ $
|
1583 |
}
|
1584 |
|
1585 |
field_array_counter++;
|
1586 |
-
}
|
1587 |
-
else {
|
1588 |
field_array_counter = 0;
|
1589 |
|
1590 |
-
if ( $
|
1591 |
-
$
|
1592 |
|
1593 |
-
orig_fields[ $row.data( 'id' ) ][ $
|
1594 |
-
|
1595 |
-
else {
|
1596 |
-
$
|
1597 |
|
1598 |
-
orig_fields[ $row.data( 'id' ) ][ $
|
1599 |
}
|
1600 |
}
|
1601 |
} );
|
@@ -1609,10 +1603,11 @@
|
|
1609 |
}
|
1610 |
else {
|
1611 |
$row_content.find( 'input, select, textarea' ).each( function () {
|
1612 |
-
if ( $( this ).is( 'input[type=checkbox]' ) )
|
1613 |
-
|
1614 |
-
else
|
1615 |
-
|
|
|
1616 |
} );
|
1617 |
}
|
1618 |
|
@@ -1621,45 +1616,41 @@
|
|
1621 |
|
1622 |
methods[ 'scroll' ]( $row );
|
1623 |
|
1624 |
-
$row_content.slideDown()
|
1625 |
-
|
1626 |
-
|
1627 |
-
$row_content.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1628 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1629 |
} );
|
1630 |
-
|
1631 |
}
|
1632 |
|
1633 |
-
$
|
1634 |
-
$
|
1635 |
|
1636 |
e.preventDefault();
|
1637 |
} )
|
1638 |
// Handle 'Save' action
|
1639 |
.on( 'click', '.pods-manage-row-save a.button-primary', function ( e ) {
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
|
|
|
|
1651 |
|
1652 |
if ( 'undefined' != typeof $row_value && null != $row_value && '' !== $row_value ) {
|
1653 |
field_data = jQuery.parseJSON( $row_value );
|
1654 |
}
|
1655 |
|
1656 |
-
var valid_form = true;
|
1657 |
-
|
1658 |
$field_wrapper.find( 'input, select, textarea' ).each( function () {
|
1659 |
var $el = $( this );
|
1660 |
|
1661 |
if ( '' !== $el.prop( 'name' ) ) {
|
1662 |
-
// TinyMCE support
|
1663 |
if ( 'object' == typeof( tinyMCE ) && -1 < $el.prop( 'class' ).indexOf( 'pods-ui-field-tinymce' ) ) {
|
1664 |
var ed = tinyMCE.get( $el.prop( 'id' ) );
|
1665 |
|
@@ -1671,66 +1662,67 @@
|
|
1671 |
field_name = ( ( null != field_array && 1 < field_array.length ) ? field_array[ 1 ].replace( '[', '' ).replace( ']', '' ) : '' ),
|
1672 |
field_found = -1;
|
1673 |
|
1674 |
-
if ( '' == field_name )
|
1675 |
-
|
|
|
1676 |
|
1677 |
if ( $el.is( 'input[type=checkbox]' ) && $el.is( '.pods-form-ui-field-type-pick' ) ) {
|
1678 |
if ( 'object' == typeof field_data[ field_name ] || 'array' == typeof field_data[ field_name ] ) {
|
1679 |
field_found = jQuery.inArray( val, field_data[ field_name ] );
|
1680 |
|
1681 |
if ( -1 < field_found ) {
|
1682 |
-
if ( !$el.is( ':checked' ) )
|
1683 |
-
|
|
|
|
|
|
|
1684 |
}
|
1685 |
-
|
1686 |
-
field_data[ field_name ].push( val );
|
1687 |
-
}
|
1688 |
-
else {
|
1689 |
field_data[ field_name ] = [];
|
1690 |
|
1691 |
-
if ( $el.is( ':checked' ) )
|
1692 |
-
|
|
|
1693 |
}
|
1694 |
|
1695 |
return;
|
|
|
|
|
|
|
|
|
1696 |
}
|
1697 |
-
else if ( $el.is( 'input[type=checkbox]' ) && !$el.is( ':checked' ) ) {
|
1698 |
-
if ( 1 == val )
|
1699 |
-
val = 0;
|
1700 |
-
else
|
1701 |
-
val = '';
|
1702 |
-
}
|
1703 |
-
else if ( $el.is( 'input[type=radio]' ) && !$el.is( ':checked' ) )
|
1704 |
-
val = '';
|
1705 |
|
1706 |
if ( $el.is( ':visible' ) && $el.hasClass( 'pods-validate pods-validate-required' ) && '' === $el.val() ) {
|
1707 |
$el.trigger( 'change' );
|
1708 |
|
1709 |
-
if ( false !== valid_form )
|
1710 |
-
|
|
|
1711 |
|
1712 |
valid_form = false;
|
1713 |
}
|
1714 |
|
1715 |
if ( $el.is( 'input[type=checkbox]' ) && $el.is( '.pods-form-ui-field-type-pick' ) ) {
|
1716 |
if ( -1 == field_found ) {
|
1717 |
-
if ( 'object' != typeof field_data[ field_name ] && 'array' != typeof field_data[ field_name ] )
|
1718 |
-
|
|
|
1719 |
|
1720 |
-
if ( '' != val )
|
1721 |
-
|
|
|
1722 |
}
|
1723 |
-
}
|
1724 |
-
|
1725 |
-
|
1726 |
-
else if ( 3 == field_array.length ) {
|
1727 |
the_field = parseInt( field_array[ 2 ].replace( '[', '' ).replace( ']', '' ) );
|
1728 |
|
1729 |
-
if ( isNaN( the_field ) )
|
1730 |
-
|
1731 |
-
else {
|
1732 |
-
if ( 'undefined' == typeof field_data[ field_name ] )
|
1733 |
-
|
|
|
1734 |
|
1735 |
while ( 'undefined' != typeof( field_data[ field_name ][ the_field ] ) ) {
|
1736 |
the_field++;
|
@@ -1743,7 +1735,7 @@
|
|
1743 |
} );
|
1744 |
|
1745 |
if ( valid_form ) {
|
1746 |
-
$row_content.find( 'input.field_data' ).val(
|
1747 |
|
1748 |
$row.css( 'backgroundColor', '#FFFF33' ).animate(
|
1749 |
{ backgroundColor : color },
|
@@ -1758,16 +1750,17 @@
|
|
1758 |
if ( 'undefined' != typeof pods_field_types && null !== pods_field_types ) {
|
1759 |
$row.find( 'td.pods-manage-row-label a.row-label' ).html( $row_content.find( 'input#pods-form-ui-field-data-' + row_id + '-label' ).val() );
|
1760 |
|
1761 |
-
if ( $row_content.find( 'input#pods-form-ui-field-data-' + row_id + '-required' ).is( ':checked' ) )
|
1762 |
-
|
1763 |
-
else
|
1764 |
-
|
|
|
1765 |
|
1766 |
$row.find( 'td.pods-manage-row-name a' ).html( $row_content.find( 'input#pods-form-ui-field-data-' + row_id + '-name' ).val() );
|
1767 |
|
1768 |
-
var field_type = $row_content.find( 'select#pods-form-ui-field-data-' + row_id + '-type' ).val()
|
1769 |
-
|
1770 |
-
|
1771 |
|
1772 |
if ( 'pick' == field_type && 0 != pick_object ) {
|
1773 |
$.each( pods_pick_objects, function ( i, n ) {
|
@@ -1777,6 +1770,7 @@
|
|
1777 |
}
|
1778 |
} );
|
1779 |
}
|
|
|
1780 |
$.each( pods_field_types, function ( i, n ) {
|
1781 |
if ( field_type == i ) {
|
1782 |
field_type = n;
|
@@ -1790,8 +1784,8 @@
|
|
1790 |
} );
|
1791 |
|
1792 |
$row.find( 'td.pods-manage-row-type' ).html( field_type
|
1793 |
-
|
1794 |
-
|
1795 |
}
|
1796 |
|
1797 |
$row_content.slideUp( 'slow', function () {
|
@@ -1802,14 +1796,14 @@
|
|
1802 |
} );
|
1803 |
}
|
1804 |
|
1805 |
-
$
|
1806 |
-
$
|
1807 |
|
1808 |
e.preventDefault();
|
1809 |
} )
|
1810 |
// Handle 'Cancel' action
|
1811 |
.on( 'click', '.pods-manage-row-actions a.pods-manage-row-cancel', function ( e ) {
|
1812 |
-
$( this ).closest( 'tr.pods-manage-row' ).find( 'a.pods-manage-row-edit' ).click
|
1813 |
|
1814 |
e.preventDefault();
|
1815 |
} );
|
@@ -1836,17 +1830,18 @@
|
|
1836 |
if ( 'undefined' != typeof new_row && null !== new_row ) {
|
1837 |
// Handle 'Add' action
|
1838 |
$( '.pods-manage-row-add' ).on( 'click', 'a', function ( e ) {
|
1839 |
-
var
|
|
|
1840 |
|
1841 |
e.preventDefault();
|
1842 |
|
1843 |
-
$
|
1844 |
-
$
|
1845 |
|
1846 |
row_counter++;
|
1847 |
|
1848 |
add_row = new_row.replace( /__1/gi, row_counter ).replace( /--1/gi, row_counter );
|
1849 |
-
$tbody = $
|
1850 |
|
1851 |
$tbody.find( 'tr.no-items' ).hide();
|
1852 |
$tbody.append( '<tr id="row-' + row_counter + '" class="pods-manage-row pods-field-new pods-field-' + row_counter + ' pods-submittable-fields" valign="top">' + add_row + '</tr>' );
|
@@ -1861,22 +1856,23 @@
|
|
1861 |
$new_row.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1862 |
|
1863 |
$new_row.find( '.pods-manage-row-wrapper' ).hide( 0, function () {
|
1864 |
-
$new_row.find( 'a.row-label.pods-manage-row-edit' ).click
|
1865 |
} );
|
1866 |
|
1867 |
$( '.pods-tabs .pods-tab:first a', $new_row ).addClass( 'selected' );
|
1868 |
$( '.pods-tab-group', $new_row ).find( '.pods-tab:first' ).show();
|
1869 |
|
1870 |
-
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) )
|
1871 |
-
|
|
|
1872 |
|
1873 |
$( 'tr.pods-manage-row' ).removeClass( 'alternate' );
|
1874 |
$( 'tr.pods-manage-row:even' ).addClass( 'alternate' );
|
1875 |
|
1876 |
methods[ 'sluggables' ]( $new_row );
|
1877 |
|
1878 |
-
$
|
1879 |
-
$
|
1880 |
|
1881 |
$( document ).Pods( 'qtip', $new_row );
|
1882 |
|
@@ -1885,15 +1881,16 @@
|
|
1885 |
|
1886 |
// Handle 'Duplicate' action
|
1887 |
$( 'tbody.pods-manage-list' ).on( 'click', 'a.pods-manage-row-duplicate', function ( e ) {
|
1888 |
-
var
|
1889 |
-
|
|
|
1890 |
|
1891 |
e.preventDefault();
|
1892 |
|
1893 |
-
$
|
1894 |
-
$
|
1895 |
|
1896 |
-
$row = $
|
1897 |
$row_label = $row.find( 'td.pods-manage-row-label' );
|
1898 |
$row_content = $row_label.find( 'div.pods-manage-row-wrapper' );
|
1899 |
|
@@ -1902,7 +1899,7 @@
|
|
1902 |
row_counter++;
|
1903 |
|
1904 |
add_row = new_row.replace( /__1/gi, row_counter ).replace( /--1/gi, row_counter );
|
1905 |
-
$tbody = $
|
1906 |
|
1907 |
$tbody.find( 'tr.no-items' ).hide();
|
1908 |
$tbody.append( '<tr id="row-' + row_counter + '" class="pods-manage-row pods-field-init pods-field-new pods-field-duplicated pods-field-' + row_counter + ' pods-submittable-fields" valign="top">' + add_row + '</tr>' );
|
@@ -1920,7 +1917,7 @@
|
|
1920 |
|
1921 |
$new_row_label.find( 'a.pods-manage-row-edit.row-label' ).html( field_data[ 'label' ] );
|
1922 |
|
1923 |
-
$new_row_content.find( 'input.field_data' ).val(
|
1924 |
|
1925 |
$new_row.data( 'row', row_counter );
|
1926 |
$new_row.find( '.pods-dependency .pods-depends-on' ).hide();
|
@@ -1931,22 +1928,23 @@
|
|
1931 |
} );
|
1932 |
|
1933 |
$new_row.find( '.pods-manage-row-wrapper' ).hide( 0, function () {
|
1934 |
-
$new_row.find( 'a.pods-manage-row-edit' ).click
|
1935 |
} );
|
1936 |
|
1937 |
$( '.pods-tabs .pods-tab:first a', $new_row ).addClass( 'selected' );
|
1938 |
$( '.pods-tab-group', $new_row ).find( '.pods-tab:first' ).show();
|
1939 |
|
1940 |
-
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) )
|
1941 |
-
|
|
|
1942 |
|
1943 |
$( 'tr.pods-manage-row' ).removeClass( 'alternate' );
|
1944 |
$( 'tr.pods-manage-row:even' ).addClass( 'alternate' );
|
1945 |
|
1946 |
methods[ 'sluggables' ]( $new_row );
|
1947 |
|
1948 |
-
$
|
1949 |
-
$
|
1950 |
|
1951 |
$( document ).Pods( 'qtip', $new_row );
|
1952 |
|
@@ -1956,13 +1954,15 @@
|
|
1956 |
|
1957 |
// Handle 'Delete' action
|
1958 |
$( 'tbody.pods-manage-list' ).on( 'click', 'a.submitdelete', function ( e ) {
|
1959 |
-
|
1960 |
-
|
|
|
|
|
1961 |
|
1962 |
// @todo: Make this confirm pretty so that it's inline instead of JS confirm
|
1963 |
if ( confirm( 'Are you sure you want to delete this field?' ) ) {
|
1964 |
-
var $row = $
|
1965 |
-
|
1966 |
|
1967 |
$row.animate( {backgroundColor : '#B80000'} );
|
1968 |
|
@@ -1972,16 +1972,17 @@
|
|
1972 |
$tbody.find( 'tr.no-items' ).show();
|
1973 |
} );
|
1974 |
|
1975 |
-
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) )
|
1976 |
-
|
|
|
1977 |
|
1978 |
pods_changed = true;
|
1979 |
|
1980 |
//row_counter--;
|
1981 |
}
|
1982 |
|
1983 |
-
$
|
1984 |
-
$
|
1985 |
|
1986 |
e.preventDefault();
|
1987 |
} );
|
@@ -1990,8 +1991,9 @@
|
|
1990 |
$( 'a.pods-confirm' ).on( 'click', function ( e ) {
|
1991 |
var $el = $( this );
|
1992 |
|
1993 |
-
if ( 'undefined' != typeof $el.data( 'confirm' ) && !confirm( $el.data( 'confirm' ) ) )
|
1994 |
-
|
|
|
1995 |
} );
|
1996 |
},
|
1997 |
exit_confirm : function () {
|
16 |
|
17 |
var label = '';
|
18 |
|
19 |
+
if ( 'undefined' != typeof $el.data( 'label' ) ) {
|
20 |
+
label = $el.data( 'label' );
|
21 |
+
} else if ( 0 < $el.parent().find( 'label' ).length ) {
|
22 |
+
label = $el.parent().find( 'label' ).html().trim();
|
23 |
+
} else {
|
24 |
+
label = $el.prop( 'name' ).trim().replace( '_', ' ' );
|
25 |
+
}
|
26 |
|
27 |
// TinyMCE support
|
28 |
if ( 'object' == typeof tinyMCE && -1 < $el.prop( 'class' ).indexOf( 'pods-ui-field-tinymce' ) )
|
113 |
$el.trigger( 'change' );
|
114 |
|
115 |
if ( false !== valid_form )
|
116 |
+
$el.trigger( 'focus' );
|
117 |
|
118 |
valid_form = false;
|
119 |
}
|
200 |
$el.trigger( 'change' );
|
201 |
|
202 |
if ( false !== valid_form )
|
203 |
+
$el.trigger( 'focus' );
|
204 |
|
205 |
valid_form = false;
|
206 |
}
|
314 |
$submitbutton.prop( 'disabled', false );
|
315 |
$submitbutton.parent().find( '.waiting' ).fadeOut();
|
316 |
|
317 |
+
var $next = $( '#pods-wizard-next' );
|
318 |
+
if ( $next.length ) {
|
319 |
+
$next.css( 'cursor', 'pointer' );
|
320 |
+
$next.prop( 'disabled', false );
|
321 |
+
$next.text( $next.data( 'next' ) );
|
322 |
}
|
323 |
}
|
324 |
},
|
337 |
$submitbutton.prop( 'disabled', false );
|
338 |
$submitbutton.parent().find( '.waiting' ).fadeOut();
|
339 |
|
340 |
+
var $next = $( '#pods-wizard-next' );
|
341 |
+
if ( $next.length ) {
|
342 |
+
$next.css( 'cursor', 'pointer' );
|
343 |
+
$next.prop( 'disabled', false );
|
344 |
+
$next.text( $next.data( 'next' ) );
|
345 |
}
|
346 |
}
|
347 |
} );
|
467 |
|
468 |
// Handle click to edit
|
469 |
$sluggable.on( 'click', '.pods-slug em, .pods-slug input[type=button]', function () {
|
470 |
+
var $this = $( this );
|
471 |
+
$this.css( 'cursor', 'default' );
|
472 |
+
$this.prop( 'disabled', true );
|
473 |
|
474 |
+
$this.closest( '.pods-sluggable' ).find( '.pods-slug, .pods-slug-edit' ).toggle();
|
475 |
+
$this.closest( '.pods-sluggable' ).find( '.pods-slug-edit input[type=text]' ).trigger( 'focus' );
|
476 |
|
477 |
+
$this.css( 'cursor', 'pointer' );
|
478 |
+
$this.prop( 'disabled', false );
|
479 |
} );
|
480 |
|
481 |
// Handle slug save
|
482 |
$sluggable.on( 'click', '.pods-slug-edit input[type=button]', function () {
|
483 |
+
var $this = $( this );
|
484 |
+
$this.css( 'cursor', 'default' );
|
485 |
+
$this.prop( 'disabled', true );
|
486 |
|
487 |
+
last_slug = $this.parent().find( 'input[type=text]' ).val();
|
488 |
|
489 |
last_slug = last_slug.replace( /<( ?:. )*?>/g, '' ).replace( /([^0-9a-zA-Z\_\- ])/g, '' );
|
490 |
|
491 |
+
$this.closest( '.pods-sluggable' ).find( '.pods-slug em' ).html( last_slug );
|
492 |
$( '.pods-slugged-lower:not(.pods-slugged[data-sluggable])' ).html( last_slug.toLowerCase() );
|
493 |
$( '.pods-slugged:not(.pods-slugged[data-sluggable])' ).html( last_slug.charAt( 0 ).toUpperCase() + last_slug.slice( 1 ) );
|
494 |
+
$this.closest( '.pods-sluggable' ).find( '.pods-slug, .pods-slug-edit' ).toggle();
|
495 |
|
496 |
+
$this.css( 'cursor', 'pointer' );
|
497 |
+
$this.prop( 'disabled', false );
|
498 |
} );
|
499 |
|
500 |
// Handle cancel slug edit
|
501 |
$sluggable.on( 'click', '.pods-slug-edit a.cancel', function ( e ) {
|
502 |
+
var $this = $( this );
|
503 |
+
$this.css( 'cursor', 'default' );
|
504 |
+
$this.prop( 'disabled', true );
|
505 |
|
506 |
+
$this.parent().find( 'input[type=text]' ).val( last_slug );
|
507 |
+
$this.closest( '.pods-sluggable' ).find( '.pods-slug, .pods-slug-edit' ).toggle();
|
508 |
|
509 |
+
$this.css( 'cursor', 'pointer' );
|
510 |
+
$this.prop( 'disabled', false );
|
511 |
|
512 |
e.preventDefault();
|
513 |
} );
|
591 |
},
|
592 |
tabbed : function () {
|
593 |
$( '.pods-admin' ).on( 'click', '.pods-tabs .pods-tab a.pods-tab-link', function ( e ) {
|
594 |
+
var $this = $( this ),
|
595 |
+
tab_class = '.pods-tabbed',
|
596 |
+
tab_hash = this.hash,
|
597 |
+
$tabbed;
|
598 |
|
599 |
+
$this.css( 'cursor', 'default' );
|
600 |
+
$this.prop( 'disabled', true );
|
601 |
|
602 |
+
if ( 'undefined' != typeof $this.closest( '.pods-tabs' ).data( 'tabbed' ) ) {
|
603 |
+
tab_class = $this.closest( '.pods-tabs' ).data( 'tabbed' );
|
604 |
+
}
|
605 |
|
606 |
+
$tabbed = $this.closest( tab_class );
|
|
|
607 |
|
608 |
if ( $tabbed.find( '.pods-tabs .pods-tab a[data-tabs]' )[ 0 ] ) {
|
609 |
$tabbed.find( '.pods-tabs .pods-tab a[data-tabs]' ).each( function () {
|
610 |
var tabs = $( this ).data( 'tabs' ),
|
611 |
this_tab_hash = this.hash;
|
612 |
|
613 |
+
if ( tab_hash != this_tab_hash ) {
|
614 |
+
$tabbed.find( tabs ).hide();
|
615 |
+
} else {
|
616 |
+
$tabbed.find( tabs ).show();
|
617 |
+
}
|
618 |
} );
|
619 |
}
|
620 |
else {
|
622 |
var $current_tab = $tabbed.find( '.pods-tab-group .pods-tab' + tab_hash );
|
623 |
|
624 |
$( '.pods-dependent-toggle', $current_tab ).each( function () {
|
625 |
+
var elementId = $( this ).attr( 'id' ),
|
626 |
+
runDependencies = true,
|
627 |
+
selectionTypes = [
|
628 |
+
{
|
629 |
+
name : 'single',
|
630 |
+
pickFormatRegex: /pick-format-single$/g
|
631 |
+
},
|
632 |
+
{
|
633 |
+
name : 'multi',
|
634 |
+
pickFormatRegex: /pick-format-multi$/g
|
635 |
+
}
|
636 |
+
];
|
637 |
|
638 |
// Pick multi/single select: Bypass dependency checks on the format of selection types
|
639 |
// that aren't currently chosen. We shouldn't check dependencies against format_single
|
666 |
|
667 |
$tabbed.find( '.pods-tabs .pods-tab a' ).removeClass( 'selected' );
|
668 |
|
669 |
+
$this.addClass( 'selected' );
|
670 |
|
671 |
+
$this.css( 'cursor', 'pointer' );
|
672 |
+
$this.prop( 'disabled', false );
|
673 |
|
674 |
e.preventDefault();
|
675 |
} );
|
679 |
$( '.pods-tab-group .pods-tab:first' ).each( function () {
|
680 |
$( '.pods-dependent-toggle', this ).trigger( 'change' );
|
681 |
$( this ).show();
|
682 |
+
} );
|
683 |
} );
|
684 |
},
|
685 |
nav_tabbed : function () {
|
686 |
$( '.pods-admin' ).on( 'click', '.pods-nav-tabs a.pods-nav-tab-link', function ( e ) {
|
687 |
+
var $this = $( this ),
|
688 |
+
tab_class = '.pods-nav-tabbed',
|
689 |
+
tab_hash = this.hash,
|
690 |
+
$tabbed;
|
691 |
|
692 |
+
$this.css( 'cursor', 'default' );
|
693 |
+
$this.prop( 'disabled', true );
|
694 |
|
695 |
+
if ( 'undefined' != typeof $this.closest( '.pods-nav-tabs' ).data( 'tabbed' ) ) {
|
696 |
+
tab_class = $this.closest( '.pods-nav-tabs' ).data( 'tabbed' );
|
697 |
+
}
|
698 |
|
699 |
+
$tabbed = $this.closest( tab_class );
|
|
|
700 |
|
701 |
if ( $tabbed.find( '.pods-nav-tabs a.pods-nav-tab-link[data-tabs]' )[ 0 ] ) {
|
702 |
$tabbed.find( '.pods-nav-tabs a.pods-nav-tab-link[data-tabs]' ).each( function () {
|
703 |
var tabs = $( this ).data( 'tabs' ),
|
704 |
this_tab_hash = this.hash;
|
705 |
|
706 |
+
if ( tab_hash != this_tab_hash ) {
|
707 |
+
$tabbed.find( tabs ).hide();
|
708 |
+
} else {
|
709 |
+
$tabbed.find( tabs ).show();
|
710 |
+
}
|
711 |
} );
|
712 |
}
|
713 |
else {
|
724 |
|
725 |
$tabbed.find( '.pods-nav-tabs a.pods-nav-tab-link' ).removeClass( 'nav-tab-active' );
|
726 |
|
727 |
+
$this.addClass( 'nav-tab-active' );
|
728 |
|
729 |
+
$this.css( 'cursor', 'pointer' );
|
730 |
+
$this.prop( 'disabled', false );
|
731 |
|
732 |
e.preventDefault();
|
733 |
} );
|
738 |
$nav_tabbed.find( '.pods-nav-tab-group .pods-nav-tab:first' ).each( function () {
|
739 |
$( '.pods-dependent-toggle', this ).trigger( 'change' );
|
740 |
$( this ).show();
|
741 |
+
} );
|
742 |
} );
|
743 |
},
|
744 |
wizard : function () {
|
747 |
$( '#pods-wizard-next' ).text( $( '#pods-wizard-next' ).data( 'finished' ) );
|
748 |
},
|
749 |
setProgress : function () {
|
750 |
+
$( '#pods-wizard-next' ).text( $( '#pods-wizard-next' ).data( 'next' ) );
|
751 |
},
|
752 |
stepBackward : function () {
|
753 |
$( '#pods-wizard-next' )
|
769 |
step = $( 'li.pods-wizard-menu-current' ).data( 'step' );
|
770 |
|
771 |
// Show start over button
|
772 |
+
if ( 1 == step ) {
|
773 |
+
$( '#pods-wizard-start' ).hide();
|
774 |
+
} else {
|
775 |
+
$( '#pods-wizard-start' ).show();
|
776 |
+
}
|
777 |
|
778 |
// Check if last step
|
779 |
if ( $( 'div.pods-wizard-panel:visible' ).prev( 'div.pods-wizard-panel' ).length ) {
|
780 |
// Show next panel
|
781 |
+
$( 'div.pods-wizard-panel:visible' ).hide().prev().show();
|
|
|
|
|
|
|
782 |
}
|
783 |
|
784 |
window.location.hash = '';
|
797 |
.next( 'li' )
|
798 |
.addClass( 'pods-wizard-menu-current' );
|
799 |
|
800 |
+
var step = false, // Get current step #.
|
801 |
+
check = true; // Allow for override.
|
802 |
|
803 |
+
if ( $( 'li.pods-wizard-menu-current[data-step]' )[ 0 ] ) {
|
804 |
+
step = $( 'li.pods-wizard-menu-current' ).data( 'step' );
|
805 |
+
}
|
806 |
|
807 |
+
// Show start over button.
|
808 |
$( '#pods-wizard-start' ).show();
|
809 |
|
810 |
+
// Check if last step.
|
|
|
|
|
|
|
811 |
if ( $( 'div.pods-wizard-panel:visible' ).next( 'div.pods-wizard-panel' ).length ) {
|
812 |
// Show next panel
|
813 |
+
$( 'div.pods-wizard-panel:visible' ).hide().next().show();
|
|
|
|
|
|
|
814 |
|
815 |
// Allow for override
|
816 |
+
if ( 'undefined' != typeof pods_admin_wizard_callback ) {
|
817 |
+
check = pods_admin_wizard_callback( step, false );
|
818 |
+
}
|
819 |
|
820 |
+
if ( false === check ) {
|
821 |
+
return check;
|
822 |
+
}
|
823 |
|
824 |
window.location.hash = '';
|
825 |
}
|
830 |
.text( $( '#pods-wizard-next' ).data( 'processing' ) );
|
831 |
|
832 |
// Allow for override
|
833 |
+
if ( 'undefined' != typeof pods_admin_wizard_callback ) {
|
834 |
+
check = pods_admin_wizard_callback( step, true );
|
835 |
+
}
|
836 |
|
837 |
+
if ( false === check ) {
|
838 |
+
return check;
|
839 |
+
}
|
840 |
|
841 |
$( '#pods-wizard-box' ).closest( 'form' ).submit();
|
842 |
|
851 |
.removeClass( 'pods-wizard-menu-complete' )
|
852 |
.addClass( 'pods-wizard-menu-current' )
|
853 |
}
|
854 |
+
} else {
|
|
|
855 |
// Allow for override
|
856 |
+
if ( 'undefined' != typeof pods_admin_wizard_callback ) {
|
857 |
+
check = pods_admin_wizard_callback( step, true );
|
858 |
+
}
|
859 |
|
860 |
+
if ( false === check ) {
|
861 |
+
return check;
|
862 |
+
}
|
863 |
|
864 |
methods.setFinished();
|
865 |
|
872 |
|
873 |
// If first panel and action bar is supposed to be hidden, hide it.
|
874 |
var $box = $( '#pods-wizard-box' );
|
875 |
+
if ( $box.data( 'hide' ) ) {
|
876 |
+
$box.addClass( 'pods-wizard-hide-first' );
|
877 |
+
}
|
878 |
|
879 |
// Revert to first current menu item
|
880 |
$( '#pods-wizard-heading ul li' )
|
883 |
.addClass( 'pods-wizard-menu-current' );
|
884 |
|
885 |
// Revert to first panel
|
886 |
+
$( 'div.pods-wizard-panel' ).hide().first().show();
|
|
|
|
|
|
|
887 |
|
888 |
// Hide start over button
|
889 |
$( '.pods-wizard-option-selected' ).removeClass();
|
891 |
$( 'div.pods-wizard-option-cont' ).hide();
|
892 |
$( '#pods-wizard-choices' ).fadeIn( 'fast' );
|
893 |
|
894 |
+
if ( 'undefined' != typeof pods_admin_wizard_startover_callback ) {
|
895 |
+
pods_admin_wizard_startover_callback( $( this ) );
|
896 |
+
}
|
897 |
|
898 |
window.location.hash = '';
|
899 |
}
|
901 |
|
902 |
// Next button event binding
|
903 |
$( '#pods-wizard-next' ).on( 'click', function ( e ) {
|
904 |
+
if ( $( this ).is( ':disabled' ) ) {
|
905 |
+
return;
|
906 |
+
}
|
907 |
|
908 |
e.preventDefault();
|
909 |
|
936 |
$( target ).show();
|
937 |
$( '.pods-wizard-option-content-' + target.replace( '#pods-wizard-', '' ) ).show();
|
938 |
|
939 |
+
if ( 'undefined' != typeof pods_admin_option_select_callback ) {
|
940 |
+
pods_admin_option_select_callback( $( this ) );
|
941 |
+
}
|
942 |
|
943 |
methods.stepForward();
|
944 |
} );
|
979 |
*
|
980 |
* @todo Validate & improve this
|
981 |
*/
|
982 |
+
|
983 |
// Are we in the "Fields" tab?
|
984 |
if ( $current.parents('#pods-manage-fields').length ) {
|
985 |
// And are we also in the "Additional Field Options" tab?
|
1002 |
dependent_specific = dependent_flag + '-' + val.replace( /\_/gi, '-' );
|
1003 |
|
1004 |
$current.find( dependent_flag ).each( function () {
|
1005 |
+
var $dependent = $( this ),
|
1006 |
dependency_trigger;
|
1007 |
|
1008 |
+
if ( $dependent.parent().is( ':visible' ) ) {
|
1009 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1010 |
+
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $dependent.is( dependent_specific ) ) ) {
|
1011 |
+
if ( $dependent.is( 'tr' ) ) {
|
1012 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1013 |
+
} else {
|
1014 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1015 |
+
}
|
1016 |
|
1017 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1018 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1019 |
|
1020 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1021 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1022 |
} );
|
1023 |
|
1024 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1025 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1026 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1027 |
}
|
1028 |
}
|
1029 |
+
else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $dependent.is( dependent_specific ) ) ) {
|
1030 |
+
if ( $dependent.is( 'tr' ) ) {
|
1031 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1032 |
+
} else {
|
1033 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
} else if ( $dependent.is( dependent_specific ) ) {
|
1037 |
+
if ( $dependent.is( 'tr' ) ) {
|
1038 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1039 |
+
} else {
|
1040 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1041 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
|
1043 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1044 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1045 |
|
1046 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1047 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1048 |
} );
|
1049 |
|
1050 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1051 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1052 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1053 |
}
|
1054 |
}
|
1055 |
else {
|
1056 |
+
if ( $dependent.is( 'tr' ) ) {
|
1057 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1058 |
+
} else {
|
1059 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1060 |
+
}
|
1061 |
}
|
1062 |
}
|
1063 |
else {
|
1064 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1065 |
+
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $dependent.is( dependent_specific ) ) ) {
|
1066 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1067 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1068 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1069 |
|
1070 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1071 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1072 |
} );
|
1073 |
|
1074 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1075 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1076 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1077 |
}
|
1078 |
+
} else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $dependent.is( dependent_specific ) ) ) {
|
1079 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1080 |
}
|
1081 |
+
} else if ( $dependent.is( dependent_specific ) ) {
|
1082 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1083 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1084 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
|
|
|
|
|
|
1085 |
|
1086 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1087 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1088 |
} );
|
1089 |
|
1090 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1091 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1092 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1093 |
}
|
1094 |
+
} else {
|
1095 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1096 |
}
|
|
|
|
|
1097 |
}
|
1098 |
} );
|
1099 |
|
1101 |
exclude_specific = exclude_flag + '-' + val.replace( /\_/gi, '-' );
|
1102 |
|
1103 |
$current.find( exclude_flag ).each( function () {
|
1104 |
+
var $dependent = $( this ),
|
1105 |
dependency_trigger;
|
1106 |
|
1107 |
+
if ( $dependent.parent().is( ':visible' ) ) {
|
1108 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1109 |
+
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $dependent.is( exclude_specific ) ) ) {
|
1110 |
+
if ( $dependent.is( 'tr' ) ) {
|
1111 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1112 |
+
} else {
|
1113 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1114 |
+
}
|
1115 |
}
|
1116 |
+
else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $dependent.is( exclude_specific ) ) ) {
|
1117 |
+
if ( $dependent.is( 'tr' ) ) {
|
1118 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1119 |
+
} else {
|
1120 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1121 |
+
}
|
1122 |
|
1123 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1124 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1125 |
|
1126 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1127 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1128 |
} );
|
1129 |
|
1130 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1131 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1132 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1133 |
}
|
1134 |
}
|
1135 |
}
|
1136 |
+
else if ( $dependent.is( exclude_specific ) ) {
|
1137 |
+
if ( $dependent.is( 'tr' ) ) {
|
1138 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1139 |
+
} else {
|
1140 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1141 |
+
}
|
1142 |
}
|
1143 |
else {
|
1144 |
+
if ( $dependent.is( 'tr' ) ) {
|
1145 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1146 |
+
} else {
|
1147 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1148 |
+
}
|
1149 |
|
1150 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1151 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1152 |
|
1153 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1154 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1155 |
} );
|
1156 |
|
1157 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1158 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1159 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1160 |
}
|
1161 |
}
|
1162 |
}
|
1163 |
else {
|
1164 |
if ( $field.is( 'input[type=checkbox]' ) ) {
|
1165 |
+
if ( $field.is( ':checked' ) && ( 1 == $field.val() || $dependent.is( exclude_specific ) ) ) {
|
1166 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1167 |
+
} else if ( !$field.is( ':checked' ) && ( !$field.is( '.pods-dependent-multi' ) || $dependent.is( exclude_specific ) ) ) {
|
1168 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1169 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1170 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1171 |
+
|
1172 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1173 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1174 |
} );
|
1175 |
|
1176 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1177 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1178 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1179 |
}
|
1180 |
}
|
1181 |
+
} else if ( $dependent.is( exclude_specific ) ) {
|
1182 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1183 |
+
} else {
|
1184 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1185 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1186 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1187 |
+
|
1188 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
|
|
1189 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1190 |
} );
|
1191 |
|
1192 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1193 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1194 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1195 |
}
|
1196 |
}
|
1197 |
}
|
1202 |
wildcard_target_value = val.replace( /\_/gi, '-' );
|
1203 |
|
1204 |
$current.find( wildcard_target ).each( function () {
|
1205 |
+
var $dependent = $( this ),
|
1206 |
data_attribute = 'pods-wildcard-' + $field.data( 'name-clean' ),
|
1207 |
+
wildcard_data = $dependent.data( data_attribute ),
|
1208 |
match_found,
|
1209 |
dependency_trigger;
|
1210 |
|
1223 |
} );
|
1224 |
|
1225 |
// Set the state of the dependent element
|
1226 |
+
if ( $dependent.parent().is( ':visible' ) ) {
|
1227 |
if ( match_found ) {
|
1228 |
+
if ( $dependent.is( 'tr' ) ) {
|
1229 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1230 |
+
} else {
|
1231 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
|
|
1232 |
}
|
1233 |
|
1234 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1235 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1236 |
+
$dependent.find( '.pods-dependency .pods-wildcard-on' ).hide();
|
1237 |
|
1238 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1239 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1240 |
} );
|
1241 |
|
1242 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1243 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1244 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1245 |
}
|
1246 |
}
|
1247 |
else { // No wildcard matches
|
1248 |
+
if ( $dependent.is( 'tr' ) ) {
|
1249 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1250 |
}
|
1251 |
else {
|
1252 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1253 |
}
|
1254 |
}
|
1255 |
}
|
1256 |
else { // Parent element wasn't visible
|
1257 |
if ( match_found ) {
|
1258 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1259 |
+
$dependent.find( '.pods-dependency .pods-depends-on' ).hide();
|
1260 |
+
$dependent.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1261 |
+
$dependent.find( '.pods-dependency .pods-wildcard-on' ).hide();
|
1262 |
|
1263 |
+
$dependent.find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
1264 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1265 |
} );
|
1266 |
|
1267 |
+
if ( $dependent.is( '[data-dependency-trigger]' ) ) {
|
1268 |
+
dependency_trigger = window[ $dependent.data( 'dependency-trigger' ) ];
|
1269 |
+
dependency_trigger( $dependent );
|
|
|
|
|
|
|
1270 |
}
|
1271 |
}
|
1272 |
else { // No wildcard matches
|
1273 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1274 |
}
|
1275 |
}
|
1276 |
} );
|
1281 |
|
1282 |
// Handle dependent toggle
|
1283 |
$( '.pods-admin, .pods-form-front' ).on( 'change', '.pods-dependent-toggle[data-name-clean]', function ( e ) {
|
1284 |
+
var selectionTypeRegex = /pick-format-type$/g,
|
1285 |
+
elementId = $( this ).attr( 'id' ),
|
1286 |
+
selectionType, selectionFormatId;
|
1287 |
|
1288 |
// Setup dependencies for the field that changed
|
1289 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1311 |
|
1312 |
// Handle dependent toggle
|
1313 |
$( '.pods-admin' ).on( 'click', '.pods-dependency-tabs .pods-dependent-tab', function ( e ) {
|
1314 |
+
var $el = $( this ),
|
1315 |
+
$current = $el.closest( '.pods-dependency-tabs' ),
|
1316 |
+
$field = $el,
|
1317 |
+
dependent_flag = '.pods-depends-on-' + $el.data( 'name-clean' ).replace( /\_/gi, '-' ),
|
1318 |
+
dependent_specific = dependent_flag + '-' + $el.val().replace( /\_/gi, '-' );
|
|
|
1319 |
|
1320 |
$current.find( dependent_flag ).each( function () {
|
1321 |
+
var $dependent = $( this );
|
1322 |
|
1323 |
+
if ( $dependent.parent().is( ':visible' ) ) {
|
1324 |
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1325 |
+
if ( $dependent.is( 'tr' ) ) {
|
1326 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1327 |
+
} else {
|
1328 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1329 |
+
}
|
1330 |
|
1331 |
+
$dependent.find( '.pods-dependency-tabs .pods-depends-on' ).hide();
|
1332 |
+
$dependent.find( '.pods-dependency-tabs .pods-excludes-on' ).hide();
|
1333 |
|
1334 |
+
$dependent.find( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1335 |
$( this ).trigger( 'click' );
|
1336 |
} );
|
1337 |
}
|
1338 |
+
else if ( $dependent.is( dependent_specific ) ) {
|
1339 |
+
if ( $dependent.is( 'tr' ) ) {
|
1340 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1341 |
+
} else {
|
1342 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1343 |
+
}
|
1344 |
|
1345 |
+
$dependent.find( '.pods-dependency-tabs .pods-depends-on' ).hide();
|
1346 |
+
$dependent.find( '.pods-dependency-tabs .pods-excludes-on' ).hide();
|
1347 |
|
1348 |
+
$dependent.find( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1349 |
$( this ).trigger( 'click' );
|
1350 |
} );
|
1351 |
}
|
1352 |
else {
|
1353 |
+
if ( $dependent.is( 'tr' ) ) {
|
1354 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1355 |
+
} else {
|
1356 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1357 |
+
}
|
1358 |
}
|
1359 |
}
|
1360 |
else {
|
1361 |
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1362 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1363 |
+
$dependent.find( '.pods-dependency-tabs .pods-depends-on' ).hide();
|
1364 |
+
$dependent.find( '.pods-dependency-tabs .pods-excludes-on' ).hide();
|
1365 |
|
1366 |
+
$dependent.find( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1367 |
$( this ).trigger( 'click' );
|
1368 |
} );
|
1369 |
}
|
1370 |
+
else if ( $dependent.is( dependent_specific ) ) {
|
1371 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1372 |
+
$dependent.find( '.pods-dependency-tabs .pods-depends-on' ).hide();
|
1373 |
+
$dependent.find( '.pods-dependency-tabs .pods-excludes-on' ).hide();
|
1374 |
|
1375 |
+
$dependent.find( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1376 |
$( this ).trigger( 'click' );
|
1377 |
} );
|
1378 |
}
|
1379 |
else
|
1380 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1381 |
}
|
1382 |
} );
|
1383 |
|
1385 |
var exclude_specific = exclude_flag + '-' + $el.val().replace( /\_/gi, '-' );
|
1386 |
|
1387 |
$current.find( exclude_flag ).each( function () {
|
1388 |
+
var $dependent = $( this );
|
1389 |
|
1390 |
+
if ( $dependent.parent().is( ':visible' ) ) {
|
1391 |
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1392 |
+
if ( $dependent.is( 'tr' ) ) {
|
1393 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1394 |
+
} else {
|
1395 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1396 |
+
}
|
1397 |
+
} else if ( $dependent.is( exclude_specific ) ) {
|
1398 |
+
if ( $dependent.is( 'tr' ) ) {
|
1399 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1400 |
+
} else {
|
1401 |
+
$dependent.slideUp().removeClass( 'pods-dependent-visible' );
|
1402 |
+
}
|
1403 |
}
|
1404 |
else {
|
1405 |
+
if ( $dependent.is( 'tr' ) ) {
|
1406 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1407 |
+
} else {
|
1408 |
+
$dependent.slideDown().addClass( 'pods-dependent-visible' );
|
1409 |
+
}
|
1410 |
|
1411 |
+
$dependent.find( '.pods-dependency-tabs .pods-depends-on' ).hide();
|
1412 |
+
$dependent.find( '.pods-dependency-tabs .pods-excludes-on' ).hide();
|
1413 |
|
1414 |
+
$dependent.find( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1415 |
$( this ).trigger( 'click' );
|
1416 |
} );
|
1417 |
}
|
1418 |
}
|
1419 |
else {
|
1420 |
+
if ( $field.is( 'input[type=checkbox]' ) && $field.is( ':checked' ) && 1 == $field.val() ) {
|
1421 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1422 |
+
} else if ( $dependent.is( exclude_specific ) ) {
|
1423 |
+
$dependent.hide().removeClass( 'pods-dependent-visible' );
|
1424 |
+
} else {
|
1425 |
+
$dependent.show().addClass( 'pods-dependent-visible' );
|
1426 |
+
$dependent.find( '.pods-dependency-tabs .pods-depends-on' ).hide();
|
1427 |
+
$dependent.find( '.pods-dependency-tabs .pods-excludes-on' ).hide();
|
1428 |
|
1429 |
+
$dependent.find( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1430 |
$( this ).trigger( 'click' );
|
1431 |
} );
|
1432 |
}
|
1435 |
} );
|
1436 |
|
1437 |
$( '.pods-dependency-tabs .pods-dependent-tab.pods-dependent-tab-active' ).each( function () {
|
1438 |
+
$( this ).trigger( 'click' );
|
1439 |
} );
|
1440 |
},
|
1441 |
sortable : function () {
|
1454 |
$( '.pods-advanced' ).hide();
|
1455 |
|
1456 |
$( '.pods-admin' ).on( 'click', '.pods-advanced-toggle', function ( e ) {
|
1457 |
+
var $advanced = $( this ).closest( 'div' ).find( '.pods-advanced' );
|
1458 |
|
1459 |
if ( $advanced.is( ':visible' ) ) {
|
1460 |
$( this ).text( $( this ).text().replace( '-', '+' ) );
|
1461 |
$advanced.slideUp();
|
1462 |
+
} else {
|
|
|
1463 |
$( this ).text( $( this ).text().replace( '+', '-' ) );
|
1464 |
$advanced.slideDown();
|
1465 |
}
|
1468 |
} );
|
1469 |
},
|
1470 |
collapsible : function ( row ) {
|
1471 |
+
var new_row = row,
|
1472 |
+
orig_fields = {};
|
|
|
1473 |
|
1474 |
+
if ( new_row[ 0 ] ) {
|
1475 |
+
new_row = new_row.html();
|
1476 |
+
}
|
1477 |
|
1478 |
// Hide all rows
|
1479 |
$( 'div.pods-manage-row-wrapper' ).hide();
|
1480 |
|
|
|
|
|
1481 |
// Handle 'Edit' action
|
1482 |
$( 'tbody.pods-manage-list' ).on( 'click', 'a.pods-manage-row-edit', function ( e ) {
|
1483 |
+
var $this = $( this ),
|
1484 |
+
$row, $row_label, $row_content, $tbody,
|
1485 |
+
row_counter, edit_row, $field_wrapper, field_data, field_array_counter, json_name;
|
1486 |
|
1487 |
+
$this.css( 'cursor', 'default' );
|
1488 |
+
$this.prop( 'disabled', true );
|
1489 |
|
1490 |
+
$row = $this.closest( 'tr.pods-manage-row' );
|
1491 |
$row_label = $row.find( 'td.pods-manage-row-label' );
|
1492 |
$row_content = $row_label.find( 'div.pods-manage-row-wrapper' );
|
1493 |
|
1502 |
$row_label.prop( 'colspan', '1' );
|
1503 |
|
1504 |
$row_content.find( 'input, select, textarea' ).each( function () {
|
1505 |
+
var $this = $( this );
|
1506 |
+
if ( 'undefined' != typeof orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] ) {
|
1507 |
+
if ( $this.is( 'input[type=checkbox]' ) )
|
1508 |
+
$this.prop( 'checked', orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] );
|
1509 |
else
|
1510 |
+
$this.val( orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] );
|
1511 |
}
|
1512 |
} );
|
1513 |
} );
|
1514 |
}
|
1515 |
else {
|
1516 |
+
$tbody = $this.closest( 'tbody.pods-manage-list' );
|
1517 |
|
1518 |
$row.animate( {backgroundColor : '#B80000'} );
|
1519 |
|
1520 |
$row.fadeOut( 'slow', function () {
|
1521 |
$( this ).remove();
|
1522 |
+
if ( 0 === $( 'tbody.pods-manage-list tr.pods-manage-row' ).length ) {
|
1523 |
+
$tbody.find( 'tr.no-items' ).show();
|
1524 |
+
}
|
1525 |
} );
|
1526 |
|
1527 |
+
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) ) {
|
1528 |
+
$this.closest( 'tbody.pods-manage-list' ).sortable( 'refresh' );
|
1529 |
+
}
|
1530 |
}
|
1531 |
}
|
1532 |
// Row inactive, show it
|
1558 |
field_array_counter = 0;
|
1559 |
|
1560 |
$field_wrapper.find( 'input, select, textarea' ).each( function () {
|
1561 |
+
var $this = $( this );
|
1562 |
+
|
1563 |
+
json_name = $this.prop( 'name' ).replace( 'field_data[' + row_counter + '][', '' ).replace( /\[\d*\]/gi, '' ).replace( '[', '' ).replace( ']', '' );
|
1564 |
|
1565 |
if ( 'undefined' == typeof field_data[ json_name ] )
|
1566 |
return;
|
1567 |
|
1568 |
+
if ( 0 < $this.prop( 'name' ).indexOf( '[]' ) || $this.prop( 'name' ).replace( 'field_data[' + row_counter + ']', '' ).match( /\[\d*\]/ ) ) {
|
1569 |
+
if ( $this.is( 'input[type=checkbox]' ) ) {
|
1570 |
+
$this.prop( 'checked', ( -1 < jQuery.inArray( $this.val(), field_data[ json_name ] ) ) );
|
1571 |
|
1572 |
+
orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] = $this.prop( 'checked' );
|
1573 |
+
|
1574 |
+
} else if ( 'undefined' != typeof field_data[ json_name ][ field_array_counter ] ) {
|
1575 |
+
$this.val( field_data[ json_name ][ field_array_counter ] );
|
1576 |
|
1577 |
+
orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] = $this.val();
|
1578 |
}
|
1579 |
|
1580 |
field_array_counter++;
|
1581 |
+
} else {
|
|
|
1582 |
field_array_counter = 0;
|
1583 |
|
1584 |
+
if ( $this.is( 'input[type=checkbox]' ) ) {
|
1585 |
+
$this.prop( 'checked', ( $this.val() == field_data[ json_name ] ) );
|
1586 |
|
1587 |
+
orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] = $this.prop( 'checked' );
|
1588 |
+
|
1589 |
+
} else {
|
1590 |
+
$this.val( field_data[ json_name ] );
|
1591 |
|
1592 |
+
orig_fields[ $row.data( 'id' ) ][ $this.prop( 'name' ) ] = $( this ).val();
|
1593 |
}
|
1594 |
}
|
1595 |
} );
|
1603 |
}
|
1604 |
else {
|
1605 |
$row_content.find( 'input, select, textarea' ).each( function () {
|
1606 |
+
if ( $( this ).is( 'input[type=checkbox]' ) ) {
|
1607 |
+
orig_fields[ $row.data( 'id' ) ][ $( this ).prop( 'name' ) ] = $( this ).prop( 'checked' );
|
1608 |
+
} else {
|
1609 |
+
orig_fields[ $row.data( 'id' ) ][ $( this ).prop( 'name' ) ] = $( this ).val();
|
1610 |
+
}
|
1611 |
} );
|
1612 |
}
|
1613 |
|
1616 |
|
1617 |
methods[ 'scroll' ]( $row );
|
1618 |
|
1619 |
+
$row_content.slideDown().find( '.pods-dependency .pods-dependent-toggle' ).each( function () {
|
|
|
|
|
|
|
1620 |
methods[ 'setup_dependencies' ]( $( this ) );
|
1621 |
} );
|
|
|
1622 |
}
|
1623 |
|
1624 |
+
$this.css( 'cursor', 'pointer' );
|
1625 |
+
$this.prop( 'disabled', false );
|
1626 |
|
1627 |
e.preventDefault();
|
1628 |
} )
|
1629 |
// Handle 'Save' action
|
1630 |
.on( 'click', '.pods-manage-row-save a.button-primary', function ( e ) {
|
1631 |
+
var $this = $( this ),
|
1632 |
+
$row = $this.closest( 'tr.pods-manage-row' ),
|
1633 |
+
$row_label = $row.find( 'td.pods-manage-row-label' ),
|
1634 |
+
$row_content = $row_label.find( 'div.pods-manage-row-wrapper' ),
|
1635 |
+
$field_wrapper = $row_content.find( 'div.pods-manage-field' ),
|
1636 |
+
$row_value = $row_content.find( 'input.field_data' ).val(),
|
1637 |
+
color = ( $row.hasClass( 'alternate' ) ? '#F1F1F1' : '#FFFFFF' ),
|
1638 |
+
row_id = $row.data( 'row' ),
|
1639 |
+
field_data = {},
|
1640 |
+
valid_form = true;
|
1641 |
+
|
1642 |
+
$this.css( 'cursor', 'default' );
|
1643 |
+
$this.prop( 'disabled', true );
|
1644 |
|
1645 |
if ( 'undefined' != typeof $row_value && null != $row_value && '' !== $row_value ) {
|
1646 |
field_data = jQuery.parseJSON( $row_value );
|
1647 |
}
|
1648 |
|
|
|
|
|
1649 |
$field_wrapper.find( 'input, select, textarea' ).each( function () {
|
1650 |
var $el = $( this );
|
1651 |
|
1652 |
if ( '' !== $el.prop( 'name' ) ) {
|
1653 |
+
// TinyMCE support.
|
1654 |
if ( 'object' == typeof( tinyMCE ) && -1 < $el.prop( 'class' ).indexOf( 'pods-ui-field-tinymce' ) ) {
|
1655 |
var ed = tinyMCE.get( $el.prop( 'id' ) );
|
1656 |
|
1662 |
field_name = ( ( null != field_array && 1 < field_array.length ) ? field_array[ 1 ].replace( '[', '' ).replace( ']', '' ) : '' ),
|
1663 |
field_found = -1;
|
1664 |
|
1665 |
+
if ( '' == field_name ) {
|
1666 |
+
return;
|
1667 |
+
}
|
1668 |
|
1669 |
if ( $el.is( 'input[type=checkbox]' ) && $el.is( '.pods-form-ui-field-type-pick' ) ) {
|
1670 |
if ( 'object' == typeof field_data[ field_name ] || 'array' == typeof field_data[ field_name ] ) {
|
1671 |
field_found = jQuery.inArray( val, field_data[ field_name ] );
|
1672 |
|
1673 |
if ( -1 < field_found ) {
|
1674 |
+
if ( !$el.is( ':checked' ) ) {
|
1675 |
+
field_data[ field_name ].splice( field_found, 1 );
|
1676 |
+
}
|
1677 |
+
} else if ( $el.is( ':checked' ) ) {
|
1678 |
+
field_data[ field_name ].push( val );
|
1679 |
}
|
1680 |
+
} else {
|
|
|
|
|
|
|
1681 |
field_data[ field_name ] = [];
|
1682 |
|
1683 |
+
if ( $el.is( ':checked' ) ) {
|
1684 |
+
field_data[ field_name ].push( val );
|
1685 |
+
}
|
1686 |
}
|
1687 |
|
1688 |
return;
|
1689 |
+
} else if ( $el.is( 'input[type=checkbox]' ) && !$el.is( ':checked' ) ) {
|
1690 |
+
val = ( 1 == val ) ? 0 : '';
|
1691 |
+
} else if ( $el.is( 'input[type=radio]' ) && !$el.is( ':checked' ) ) {
|
1692 |
+
val = '';
|
1693 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1694 |
|
1695 |
if ( $el.is( ':visible' ) && $el.hasClass( 'pods-validate pods-validate-required' ) && '' === $el.val() ) {
|
1696 |
$el.trigger( 'change' );
|
1697 |
|
1698 |
+
if ( false !== valid_form ) {
|
1699 |
+
$el.trigger( 'focus' );
|
1700 |
+
}
|
1701 |
|
1702 |
valid_form = false;
|
1703 |
}
|
1704 |
|
1705 |
if ( $el.is( 'input[type=checkbox]' ) && $el.is( '.pods-form-ui-field-type-pick' ) ) {
|
1706 |
if ( -1 == field_found ) {
|
1707 |
+
if ( 'object' != typeof field_data[ field_name ] && 'array' != typeof field_data[ field_name ] ) {
|
1708 |
+
field_data[ field_name ] = [];
|
1709 |
+
}
|
1710 |
|
1711 |
+
if ( '' != val ) {
|
1712 |
+
field_data[ field_name ].push( val );
|
1713 |
+
}
|
1714 |
}
|
1715 |
+
} else if ( 2 == field_array.length ) {
|
1716 |
+
field_data[ field_name ] = val;
|
1717 |
+
} else if ( 3 == field_array.length ) {
|
|
|
1718 |
the_field = parseInt( field_array[ 2 ].replace( '[', '' ).replace( ']', '' ) );
|
1719 |
|
1720 |
+
if ( isNaN( the_field ) ) {
|
1721 |
+
field_data[ field_name ] = val;
|
1722 |
+
} else {
|
1723 |
+
if ( 'undefined' == typeof field_data[ field_name ] ) {
|
1724 |
+
field_data[ field_name ] = {};
|
1725 |
+
}
|
1726 |
|
1727 |
while ( 'undefined' != typeof( field_data[ field_name ][ the_field ] ) ) {
|
1728 |
the_field++;
|
1735 |
} );
|
1736 |
|
1737 |
if ( valid_form ) {
|
1738 |
+
$row_content.find( 'input.field_data' ).val( JSON.stringify( field_data ) );
|
1739 |
|
1740 |
$row.css( 'backgroundColor', '#FFFF33' ).animate(
|
1741 |
{ backgroundColor : color },
|
1750 |
if ( 'undefined' != typeof pods_field_types && null !== pods_field_types ) {
|
1751 |
$row.find( 'td.pods-manage-row-label a.row-label' ).html( $row_content.find( 'input#pods-form-ui-field-data-' + row_id + '-label' ).val() );
|
1752 |
|
1753 |
+
if ( $row_content.find( 'input#pods-form-ui-field-data-' + row_id + '-required' ).is( ':checked' ) ) {
|
1754 |
+
$row.find( 'td.pods-manage-row-label abbr.required' ).show();
|
1755 |
+
} else {
|
1756 |
+
$row.find( 'td.pods-manage-row-label abbr.required' ).hide();
|
1757 |
+
}
|
1758 |
|
1759 |
$row.find( 'td.pods-manage-row-name a' ).html( $row_content.find( 'input#pods-form-ui-field-data-' + row_id + '-name' ).val() );
|
1760 |
|
1761 |
+
var field_type = $row_content.find( 'select#pods-form-ui-field-data-' + row_id + '-type' ).val(),
|
1762 |
+
pick_object = $row_content.find( 'select#pods-form-ui-field-data-' + row_id + '-pick-object' ).val(),
|
1763 |
+
field_type_desc = '';
|
1764 |
|
1765 |
if ( 'pick' == field_type && 0 != pick_object ) {
|
1766 |
$.each( pods_pick_objects, function ( i, n ) {
|
1770 |
}
|
1771 |
} );
|
1772 |
}
|
1773 |
+
|
1774 |
$.each( pods_field_types, function ( i, n ) {
|
1775 |
if ( field_type == i ) {
|
1776 |
field_type = n;
|
1784 |
} );
|
1785 |
|
1786 |
$row.find( 'td.pods-manage-row-type' ).html( field_type
|
1787 |
+
+ field_type_desc
|
1788 |
+
+ ' <span class="pods-manage-row-more">[type: ' + $row_content.find( 'select#pods-form-ui-field-data-' + row_id + '-type' ).val() + ']</span>' );
|
1789 |
}
|
1790 |
|
1791 |
$row_content.slideUp( 'slow', function () {
|
1796 |
} );
|
1797 |
}
|
1798 |
|
1799 |
+
$this.css( 'cursor', 'pointer' );
|
1800 |
+
$this.prop( 'disabled', false );
|
1801 |
|
1802 |
e.preventDefault();
|
1803 |
} )
|
1804 |
// Handle 'Cancel' action
|
1805 |
.on( 'click', '.pods-manage-row-actions a.pods-manage-row-cancel', function ( e ) {
|
1806 |
+
$( this ).closest( 'tr.pods-manage-row' ).find( 'a.pods-manage-row-edit' ).trigger( 'click' );
|
1807 |
|
1808 |
e.preventDefault();
|
1809 |
} );
|
1830 |
if ( 'undefined' != typeof new_row && null !== new_row ) {
|
1831 |
// Handle 'Add' action
|
1832 |
$( '.pods-manage-row-add' ).on( 'click', 'a', function ( e ) {
|
1833 |
+
var $this = $( this ),
|
1834 |
+
add_row, $new_row, $tbody;
|
1835 |
|
1836 |
e.preventDefault();
|
1837 |
|
1838 |
+
$this.css( 'cursor', 'default' );
|
1839 |
+
$this.prop( 'disabled', true );
|
1840 |
|
1841 |
row_counter++;
|
1842 |
|
1843 |
add_row = new_row.replace( /__1/gi, row_counter ).replace( /--1/gi, row_counter );
|
1844 |
+
$tbody = $this.parent().parent().find( 'tbody.pods-manage-list' );
|
1845 |
|
1846 |
$tbody.find( 'tr.no-items' ).hide();
|
1847 |
$tbody.append( '<tr id="row-' + row_counter + '" class="pods-manage-row pods-field-new pods-field-' + row_counter + ' pods-submittable-fields" valign="top">' + add_row + '</tr>' );
|
1856 |
$new_row.find( '.pods-dependency .pods-excludes-on' ).hide();
|
1857 |
|
1858 |
$new_row.find( '.pods-manage-row-wrapper' ).hide( 0, function () {
|
1859 |
+
$new_row.find( 'a.row-label.pods-manage-row-edit' ).trigger( 'click' );
|
1860 |
} );
|
1861 |
|
1862 |
$( '.pods-tabs .pods-tab:first a', $new_row ).addClass( 'selected' );
|
1863 |
$( '.pods-tab-group', $new_row ).find( '.pods-tab:first' ).show();
|
1864 |
|
1865 |
+
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) ) {
|
1866 |
+
$tbody.sortable( 'refresh' );
|
1867 |
+
}
|
1868 |
|
1869 |
$( 'tr.pods-manage-row' ).removeClass( 'alternate' );
|
1870 |
$( 'tr.pods-manage-row:even' ).addClass( 'alternate' );
|
1871 |
|
1872 |
methods[ 'sluggables' ]( $new_row );
|
1873 |
|
1874 |
+
$this.css( 'cursor', 'pointer' );
|
1875 |
+
$this.prop( 'disabled', false );
|
1876 |
|
1877 |
$( document ).Pods( 'qtip', $new_row );
|
1878 |
|
1881 |
|
1882 |
// Handle 'Duplicate' action
|
1883 |
$( 'tbody.pods-manage-list' ).on( 'click', 'a.pods-manage-row-duplicate', function ( e ) {
|
1884 |
+
var $this = $( this ),
|
1885 |
+
add_row, field_data,
|
1886 |
+
$tbody, $row, $row_label, $row_content, $new_row, $new_row_label, $new_row_content;
|
1887 |
|
1888 |
e.preventDefault();
|
1889 |
|
1890 |
+
$this.css( 'cursor', 'default' );
|
1891 |
+
$this.prop( 'disabled', true );
|
1892 |
|
1893 |
+
$row = $this.closest( 'tr.pods-manage-row' );
|
1894 |
$row_label = $row.find( 'td.pods-manage-row-label' );
|
1895 |
$row_content = $row_label.find( 'div.pods-manage-row-wrapper' );
|
1896 |
|
1899 |
row_counter++;
|
1900 |
|
1901 |
add_row = new_row.replace( /__1/gi, row_counter ).replace( /--1/gi, row_counter );
|
1902 |
+
$tbody = $this.closest( 'tbody.pods-manage-list' );
|
1903 |
|
1904 |
$tbody.find( 'tr.no-items' ).hide();
|
1905 |
$tbody.append( '<tr id="row-' + row_counter + '" class="pods-manage-row pods-field-init pods-field-new pods-field-duplicated pods-field-' + row_counter + ' pods-submittable-fields" valign="top">' + add_row + '</tr>' );
|
1917 |
|
1918 |
$new_row_label.find( 'a.pods-manage-row-edit.row-label' ).html( field_data[ 'label' ] );
|
1919 |
|
1920 |
+
$new_row_content.find( 'input.field_data' ).val( JSON.stringify( field_data ) );
|
1921 |
|
1922 |
$new_row.data( 'row', row_counter );
|
1923 |
$new_row.find( '.pods-dependency .pods-depends-on' ).hide();
|
1928 |
} );
|
1929 |
|
1930 |
$new_row.find( '.pods-manage-row-wrapper' ).hide( 0, function () {
|
1931 |
+
$new_row.find( 'a.pods-manage-row-edit' ).trigger( 'click' );
|
1932 |
} );
|
1933 |
|
1934 |
$( '.pods-tabs .pods-tab:first a', $new_row ).addClass( 'selected' );
|
1935 |
$( '.pods-tab-group', $new_row ).find( '.pods-tab:first' ).show();
|
1936 |
|
1937 |
+
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) ) {
|
1938 |
+
$tbody.sortable( 'refresh' );
|
1939 |
+
}
|
1940 |
|
1941 |
$( 'tr.pods-manage-row' ).removeClass( 'alternate' );
|
1942 |
$( 'tr.pods-manage-row:even' ).addClass( 'alternate' );
|
1943 |
|
1944 |
methods[ 'sluggables' ]( $new_row );
|
1945 |
|
1946 |
+
$this.css( 'cursor', 'pointer' );
|
1947 |
+
$this.prop( 'disabled', false );
|
1948 |
|
1949 |
$( document ).Pods( 'qtip', $new_row );
|
1950 |
|
1954 |
|
1955 |
// Handle 'Delete' action
|
1956 |
$( 'tbody.pods-manage-list' ).on( 'click', 'a.submitdelete', function ( e ) {
|
1957 |
+
var $this = $( this );
|
1958 |
+
|
1959 |
+
$this.css( 'cursor', 'default' );
|
1960 |
+
$this.prop( 'disabled', true );
|
1961 |
|
1962 |
// @todo: Make this confirm pretty so that it's inline instead of JS confirm
|
1963 |
if ( confirm( 'Are you sure you want to delete this field?' ) ) {
|
1964 |
+
var $row = $this.closest( 'tr.pods-manage-row' ),
|
1965 |
+
$tbody = $this.closest( 'tbody.pods-manage-list' );
|
1966 |
|
1967 |
$row.animate( {backgroundColor : '#B80000'} );
|
1968 |
|
1972 |
$tbody.find( 'tr.no-items' ).show();
|
1973 |
} );
|
1974 |
|
1975 |
+
if ( $.fn.sortable && $tbody.hasClass( 'pods-manage-sortable' ) ) {
|
1976 |
+
$this.closest( 'tbody.pods-manage-list' ).sortable( 'refresh' );
|
1977 |
+
}
|
1978 |
|
1979 |
pods_changed = true;
|
1980 |
|
1981 |
//row_counter--;
|
1982 |
}
|
1983 |
|
1984 |
+
$this.css( 'cursor', 'pointer' );
|
1985 |
+
$this.prop( 'disabled', false );
|
1986 |
|
1987 |
e.preventDefault();
|
1988 |
} );
|
1991 |
$( 'a.pods-confirm' ).on( 'click', function ( e ) {
|
1992 |
var $el = $( this );
|
1993 |
|
1994 |
+
if ( 'undefined' != typeof $el.data( 'confirm' ) && !confirm( $el.data( 'confirm' ) ) ) {
|
1995 |
+
return false;
|
1996 |
+
}
|
1997 |
} );
|
1998 |
},
|
1999 |
exit_confirm : function () {
|
ui/js/jquery.pods.upgrade.js
CHANGED
@@ -157,7 +157,7 @@
|
|
157 |
} );
|
158 |
}
|
159 |
else {
|
160 |
-
$( '#pods-wizard-next' ).click
|
161 |
$( '#pods-wizard-next' ).off( 'click' );
|
162 |
$( '#pods-wizard-next' ).prop( 'href', 'admin.php?page=pods' );
|
163 |
$( '#pods-wizard-next' ).show();
|
@@ -170,4 +170,4 @@
|
|
170 |
return methods[ method ]();
|
171 |
// go through tr by tr, run if/else checks
|
172 |
};
|
173 |
-
})( jQuery );
|
157 |
} );
|
158 |
}
|
159 |
else {
|
160 |
+
$( '#pods-wizard-next' ).trigger( 'click' ).text( 'Start using Pods' ).addClass( 'finished' );
|
161 |
$( '#pods-wizard-next' ).off( 'click' );
|
162 |
$( '#pods-wizard-next' ).prop( 'href', 'admin.php?page=pods' );
|
163 |
$( '#pods-wizard-next' ).show();
|
170 |
return methods[ method ]();
|
171 |
// go through tr by tr, run if/else checks
|
172 |
};
|
173 |
+
})( jQuery );
|
ui/js/jquery.qtip.min.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
/* qTip2 v2.2.0 tips viewport | qtip2.com | Licensed MIT, GPL | Sun Mar 16 2014 17:53:29 */
|
2 |
-
|
3 |
-
!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=E,this.elements={target:a},this._id=R+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:D,attr:e,onTooltip:D,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=D}function f(a){return a===E||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?D:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?D:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==D,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,E,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||D)&&(b.title=D))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===C?{ready:C}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(Q,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return U.concat("").join(a?"-"+a+" ":" ")}function l(c){return c&&{type:c.type,pageX:c.pageX,pageY:c.pageY,target:c.target,relatedTarget:c.relatedTarget,scrollX:c.scrollX||a.pageXOffset||b.body.scrollLeft||b.documentElement.scrollLeft,scrollY:c.scrollY||a.pageYOffset||b.body.scrollTop||b.documentElement.scrollTop}||{}}function m(a,b){return b>0?setTimeout(d.proxy(a,this),b):(a.call(this),void 0)}function n(a){return this.tooltip.hasClass(_)?D:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=m.call(this,function(){this.toggle(C,a)},this.options.show.delay),void 0)}function o(a){if(this.tooltip.hasClass(_))return D;var b=d(a.relatedTarget),c=b.closest(V)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(D,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(_)||!this.options.hide.inactive?D:(clearTimeout(this.timers.inactive),this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive),void 0)}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join(gb+" "))+gb,function(){var a=x.api[d.attr(this,T)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):E,p="html5"===f.metadata.type&&o?o[f.metadata.name]:E,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(C,{},x.defaults,f,"object"==typeof q?h(q):E,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===D||!j)return D;k.content.text=j}if(i.container.length||(i.container=m),i.target===D&&(i.target=n),k.show.target===D&&(k.show.target=n),k.show.solo===C&&(k.show.solo=i.container.closest("body")),k.hide.target===D&&(k.hide.target=n),k.position.viewport===C&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new z(i.at,C),i.my=new z(i.my),a.data(R))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===D)return D;return a.attr(S,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(bb,l).attr("title",""),g=new e(a,k,c,!!j),a.data(R,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(R))&&a.destroy(!0)}),g}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function u(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+rb.join(f+" ")+f).split(" "),h=0;if(qb[b])return a.css(qb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return qb[b]=d,e}function v(a,b){return Math.ceil(parseFloat(u(a,b)))}function w(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}var x,y,z,A,B,C=!0,D=!1,E=null,F="x",G="y",H="width",I="height",J="top",K="left",L="bottom",M="right",N="center",O="flipinvert",P="shift",Q={},R="qtip",S="data-hasqtip",T="data-qtip-id",U=["ui-widget","ui-tooltip"],V="."+R,W="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),X=R+"-fixed",Y=R+"-default",Z=R+"-focus",$=R+"-hover",_=R+"-disabled",ab="_replacedByqTip",bb="oldtitle",cb={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||D};y=e.prototype,y._when=function(a){return d.when.apply(d,a)},y.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[R,Y,e.style.classes,R+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":D,"aria-describedby":this._id+"-content","aria-hidden":C}).toggleClass(_,this.disabled).attr(T,this.id).data(R,this).appendTo(k.container).append(g.content=d("<div />",{"class":R+"-content",id:this._id+"-content","aria-atomic":C})),this.rendered=-1,this.positioning=C,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,D))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,D)),this.rendered=C,this._setWidget(),d.each(Q,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=D,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(C,f.event,D),c.hiddenDuringWait=D}),x.api[this.id]=this,this},y.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=C;var a=this.target,b=a.attr(bb);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(R).removeAttr(T).removeAttr(S).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(bb),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=E,delete x.api[this.id]}}return this.destroyed?this.target:(a===C&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},A=y.checks={builtin:{"^id$":function(a,b,c,e){var f=c===C?x.nextid:c,g=R+"-"+f;f!==D&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),this._updateTitle(c),void 0):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new z(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(C)||this.toggle(C))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Y,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},y.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var db=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,eb=/^prerender|show\.ready/i;y.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=D,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&eb.test(b))return delete a[b],void 0;var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=db.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=C,d.each(a,d.proxy(j,this)),this.positioning=D,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?E:this.cache.event),this},y._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=C,a.then(function(a){return e.waiting=D,c._update(a,b)},E,function(a){return c._update(a,b)})):a===D||!a&&""!==a?D:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):D},y._waitForContent=function(a){var b=this.cache;return b.waiting=C,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=D}).promise()},y._updateContent=function(a,b){this._update(a,this.elements.content,b)},y._updateTitle=function(a,b){this._update(a,this.elements.title,b)===D&&this._removeTitle(D)},y._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":R+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":R+"-title","aria-atomic":C})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},y._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=E,a!==D&&this.reposition())},y.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=C;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(D),s=i.outerHeight(D),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,y=c&&"scroll"===c.type,z=d(a),A=o[0].ownerDocument,B=this.mouse;if(d.isArray(k)&&2===k.length)m={x:K,y:J},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:K,y:J},!B||!B.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=B,"static"!==v&&(w=o.offset()),A.body.offsetWidth!==(a.innerWidth||A.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&y&&B&&(w.left-=(B.scrollX||0)-z.scrollLeft(),w.top-=(B.scrollY||0)-z.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=cb.iOS?a.innerWidth:k.width(),u=cb.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):Q.imagemap&&k.is("area")?f=Q.imagemap(this,k,m,Q.viewport?q:D):Q.svg&&k&&k[0].ownerSVGElement?f=Q.svg(this,k,m,Q.viewport?q:D):(t=k.outerWidth(D),u=k.outerHeight(D),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(cb.iOS>3.1&&cb.iOS<4.1||cb.iOS>=4.3&&cb.iOS<4.33||!cb.iOS&&"fixed"===v)&&(w.left-=z.scrollLeft(),w.top-=z.scrollTop()),(!f||f&&f.adjustable!==D)&&(w.left+=m.x===M?t:m.x===N?t/2:0,w.top+=m.y===L?u:m.y===N?u/2:0)}return w.left+=p.x+(l.x===M?-r:l.x===N?-r/2:0),w.top+=p.y+(l.y===L?-s:l.y===N?-s/2:0),Q.viewport?(w.adjusted=Q.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===D||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),cb.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=D,this):this},y.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!cb.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var fb=(z=y.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,N).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?G:F}).prototype;fb.invert=function(a,b){this[a]=this[a]===K?M:this[a]===M?K:b||this[a]},fb.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===G||this.forceY&&"center"!==b?b+" "+a:a+" "+b},fb.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},fb.clone=function(){return new z(this.string(),this.forceY)},y.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=C),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?E:!!this._trigger(k,[90]),this.destroyed?this:(i!==D&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,D),d.isFunction(o.title)&&this._updateTitle(o.title,D),!B&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+R,this._storeMouse),B=C),p||g.css("width",g.outerWidth(D)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(V,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,B&&!d(V+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+R),B=D),this.blur(c)),j=d.proxy(function(){a?(cb.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===D||r===D?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},y.show=function(a){return this.toggle(C,a)},y.hide=function(a){return this.toggle(D,a)},y.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(V),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=x.zindex+b.length;return c.hasClass(Z)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+Z).qtip("blur",a)),c.addClass(Z)[0].style.zIndex=f),this},y.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(Z),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},y.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(_):this.disabled):"boolean"!=typeof a&&(a=C),this.rendered&&this.tooltip.toggleClass(_,a).attr("aria-disabled",a),this.disabled=!!a,this)},y.enable=function(){return this.disable(D)},y._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":R+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(_)||a.hide(b),D})},y._updateButton=function(a){if(!this.rendered)return D;var b=this.elements.button;a?this._createButton():b.remove()},y._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(_);c.removeClass(_),_=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(_,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Y,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(R+"-icon",!a)},y._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},y._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},y._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var gb="."+R;d(function(){r(V,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(X)&&!c.hasClass(_)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass($,b)}),r("["+T+"]",W,p)}),y._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||E,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=D,!e.isDefaultPrevented()},y._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?(h.push(a.splice(c,1)[0]),void 0):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},y._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?D:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay),void 0)}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=C}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},y._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(X)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(_)&&this.tooltip[0].offsetWidth>0,e=b.parents(V).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),x.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(_)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},y._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},x=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=E,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],R):E;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,R);if(!a)return C;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),D;a.set(b,e)}}),g!==E?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(C,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===D||c.length<1||x.api[c]?x.nextid++:c,b=s(d(this),c,k),b===D?C:(x.api[c]=b,d.each(Q,function(){"initialize"===this.initialize&&this(b)}),b._assignInitialEvents(j),void 0)}))},d.qtip=e,x.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,bb):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(bb,b))}return d.fn["attr"+ab].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+ab].apply(this,arguments));return a||b.filter("["+bb+"]").attr("title",function(){return d.attr(this,bb)}).removeAttr(bb),b}},function(a,b){if(!b||d.fn[a+ab])return C;var c=d.fn[a+ab]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ab]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(S))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ab].apply(this,arguments)}),x.version="2.2.0",x.nextid=0,x.inactiveEvents=W,x.zindex=15e3,x.defaults={prerender:D,id:D,overwrite:C,suppress:C,content:{text:C,attr:"title",title:D,button:D},position:{my:"top left",at:"bottom right",target:D,container:D,viewport:D,adjust:{x:0,y:0,mouse:C,scroll:C,resize:C,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:D})}},show:{target:D,event:"mouseenter",effect:C,delay:90,solo:D,ready:D,autofocus:D},hide:{target:D,event:"mouseleave",effect:C,delay:0,fixed:D,inactive:D,leave:"window",distance:D},style:{classes:"",widget:D,width:D,height:D,def:C},events:{render:E,move:E,show:E,hide:E,toggle:E,visible:E,hidden:E,focus:E,blur:E}};var hb,ib="margin",jb="border",kb="color",lb="background-color",mb="transparent",nb=" !important",ob=!!b.createElement("canvas").getContext,pb=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,qb={},rb=["Webkit","O","Moz","ms"];if(ob)var sb=a.devicePixelRatio||1,tb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),ub=sb/tb;else var vb=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'};d.extend(w.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":R+"-tip"}).prependTo(a.tooltip),ob?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=vb("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===J||a.y===N&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(C))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===D||b===D?a=D:a===C?a=new z(b.string()):a.string||(a=new z(a),a.fixed=C),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=jb+t(b)+"Width";return(c?v(c,e):v(d.content,e)||v(this._useTitle(a)&&d.titlebar||d.content,e)||v(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=jb+t(a.y)+t(a.x)+"Radius";return cb.ie<9?0:v(this._useTitle(a)&&b.titlebar||b.content,c)||v(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||pb.test(d)?D:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=jb+t(a[a.precedance])+t(kb),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,lb)||g(f,lb)||g(b.content,lb)||g(b.tooltip,lb)||c.css(lb),h[1]=g(c,e,kb)||g(f,e,kb)||g(b.content,e,kb)||g(b.tooltip,e,kb)||b.tooltip.css(e),d("*",c).add(c).css("cssText",lb+":"+mb+nb+";"+jb+":0"+nb+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===G,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(ob||cb.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===D?r=b:(r=new z(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===F?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==mb?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!pb.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==C?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===G?[s(r.x===K?l:r.x===M?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===J?k[1]-q[1]:0)]:[s(r.x===K?k[0]-q[0]:0),s(r.y===J?l:r.y===L?k[1]-q[1]-l:(k[1]-q[1])/2)],ob?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,ub),i=this._calculateTip(r,this.size,ub),o.attr(H,k[0]*ub).attr(I,k[1]*ub),o.css(H,k[0]).css(I,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*ub,j[1]*ub),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===cb.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(N)>-1),left:j[0]-j[2]*Number(f===F),top:j[1]-j[2]*Number(f===G),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(vb("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==D&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return D;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===F&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===N?(h=c===G?K:J,j[h]="50%",j[ib+"-"+h]=-Math.round(b[c===G?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===F?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j
|
4 |
-
},reposition:function(a,b,d){function e(a,b,c,d,e){a===P&&j.precedance===b&&k[d]&&j[c]!==N?j.precedance=j.precedance===F?G:F:a!==P&&k[d]&&(j[b]=j[b]===N?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===N?p[ib+"-"+b]=o[a]=g[ib+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=D),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:D,top:D,x:0,y:0},p={};this.corner.fixed!==C&&(e(m,F,G,K,M),e(n,G,F,J,L),j.string()===i.corner.string()||i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,D)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===P&&!!k.left)&&f(F,K,M),(o.top=n===P&&!!k.top)&&f(G,J,L),this.element.css(p).toggle(!(o.x&&o.y||j.x===N&&o.y||j.y===N&&o.x)),d.left-=g.left.charAt?g.user:m!==P||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==P||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),hb=Q.tip=function(a){return new w(a,a.options.style.tip)},hb.initialize="render",hb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=C)}},A.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(C,x.defaults,{style:{tip:{corner:C,mimic:D,width:6,height:6,border:C,offset:0}}}),Q.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],m=v[a],t=w[a],u=c===P,x=m===f?j:m===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=r[f]+s[f]-(o?0:n[f]),A=z-k,B=k+j-(h===H?p:q)-z,C=x-(v.precedance===a||m===v[b]?y:0)-(t===N?i/2:0);return u?(C=(m===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-n[f]+s[f],k-C,Math.min(Math.max(-n[f]+s[f]+(h===H?p:q),k+C),d[f],"center"===m?k-x:1e9))):(e*=c===O?2:0,A>0&&(m!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(m!==g||A>0)&&(d[f]-=(m===N?-C:C)+e,l.invert(a,g)),d[f]<r&&-d[f]>B&&(d[f]=k,l=v.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s,t=e.target,u=c.elements.tooltip,v=e.my,w=e.at,x=e.adjust,y=x.method.split(" "),z=y[0],A=y[1]||y[0],B=e.viewport,C=e.container,E=c.cache,Q={left:0,top:0};return B.jquery&&t[0]!==a&&t[0]!==b.body&&"none"!==x.method?(n=C.offset()||Q,o="static"===C.css("position"),k="fixed"===u.css("position"),p=B[0]===a?B.width():B.outerWidth(D),q=B[0]===a?B.height():B.outerHeight(D),r={left:k?0:B.scrollLeft(),top:k?0:B.scrollTop()},s=B.offset()||Q,("shift"!==z||"shift"!==A)&&(l=v.clone()),Q={left:"none"!==z?j(F,G,z,x.x,K,M,H,f,h):0,top:"none"!==A?j(G,F,A,x.y,J,L,I,g,i):0},l&&E.lastClass!==(m=R+"-pos-"+l.abbrev())&&u.removeClass(c.cache.lastClass).addClass(c.cache.lastClass=m),Q):Q}})}(window,document);
|
|
|
|
|
|
|
|
ui/js/pods-dfv/_src/core/iframe-frame.js
CHANGED
@@ -10,7 +10,7 @@ import { PodsDFVModal } from 'pods-dfv/_src/core/dfv-modal';
|
|
10 |
export const IframeFrame = wp.media.view.Frame.extend( {
|
11 |
className: 'pods-modal-frame',
|
12 |
|
13 |
-
template: _.template( '<div class="media-frame-title"
|
14 |
|
15 |
regions: [ 'title', 'iframe' ],
|
16 |
|
10 |
export const IframeFrame = wp.media.view.Frame.extend( {
|
11 |
className: 'pods-modal-frame',
|
12 |
|
13 |
+
template: _.template( '<div class="media-frame-title"></div><div class="media-frame-iframe"></div>' ),
|
14 |
|
15 |
regions: [ 'title', 'iframe' ],
|
16 |
|
ui/js/pods-dfv/pods-dfv.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var PodsDFV=function(){"use strict";var o=Backbone.Model.extend({defaults:{htmlAttr:{},fieldConfig:{}}}),n=wp.data&&wp.data.select("core/editor"),e=void 0,i=function(){e=n.isCurrentPostPublished()?wp.data.subscribe(d):wp.data.subscribe(l)};function t(){var e=n.getCurrentPostAttribute("featured_media"),i="";if(!e)return i;var t=wp.data.select("core").getMedia(e);if(t){var l=wp.hooks.applyFilters("editor.PostFeaturedImage.imageSize","post-thumbnail","");i=t.media_details&&t.media_details.sizes&&t.media_details.sizes[l]?t.media_details.sizes[l].source_url:t.source_url}return i}function l(){n.isCurrentPostPublished()&&(e(),s({icon:t(),link:n.getPermalink(),edit_link:"post.php?post="+n.getCurrentPostId()+"&action=edit&pods_modal=1",selected:!0}))}function d(){d.wasSaving?n.isSavingPost()||(d.wasSaving=!1,n.didPostSaveRequestSucceed()&&(e(),s({icon:t()}))):d.wasSaving=!(!n.isSavingPost()||n.isAutosavingPost())}function s(e){var i={id:n.getCurrentPostId(),name:n.getCurrentPostAttribute("title")},t=Object.assign(i,e);window.parent.jQuery(window.parent).trigger("dfv:modal:update",t)}var a=PodsMn.CollectionView.extend({childViewEventPrefix:!1,initialize:function(e){this.fieldModel=e.fieldModel,this.childViewOptions={fieldModel:e.fieldModel}}}),r=PodsMn.View.extend({childViewEventPrefix:!1,serializeData:function(){var e=this.options.fieldModel,i=this.model?this.model.toJSON():{};return i.htmlAttr=e.get("htmlAttr"),i.fieldConfig=e.get("fieldConfig"),i}}),c=PodsMn.View.extend({childViewEventPrefix:!1,initialize:function(e){this.fieldItemData=e.fieldItemData}}),f=Backbone.Model.extend({defaults:{id:0,icon:"",name:"",edit_link:"",link:"",download:""}}),h=Backbone.Collection.extend({model:f}),m=r.extend({childViewEventPrefix:!1,tagName:"li",template:_.template('<input name="<%- htmlAttr.name %>[<%- id %>][id]" data-name-clean="<%- htmlAttr.name_clean %>-id" id="<%- htmlAttr.id %>-<%- id %>-id" class="<%- htmlAttr.class %>" type="hidden" value="<%- id %>">\r\n<ul class="pods-dfv-list-meta media-item">\r\n\t<% if ( 1 != fieldConfig.file_limit ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-handle"><span><%- PodsI18n.__( \'Reorder\' ) %></span></li>\r\n\t<% } %>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-icon"><img class="pinkynail" src="<%- icon %>" alt="<%- PodsI18n.__( \'Icon\' ) %>"></li>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-name">\r\n\t\t<% if ( 0 != fieldConfig.file_edit_title ) { %>\r\n\t\t\t<input name="<%- htmlAttr.name %>[<%- id %>][title]" data-name-clean="<%- htmlAttr.name_clean %>-title" id="pods-form-ui-<%- htmlAttr.name_clean %>-<%- id %>-title" class="pods-form-ui-field-type-text pods-form-ui-field-name-<%- htmlAttr.name_clean %>-title" type="text" value="<%- name %>" tabindex="2" maxlength="255">\r\n\t\t<% } else { %>\r\n\t\t\t<%- name %>\r\n\t\t<% } %>\r\n\t</li>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-actions">\r\n\t\t<ul>\r\n\t\t\t<li class="pods-dfv-list-col pods-dfv-list-remove">\r\n\t\t\t\t<a href="#remove" title="<%- PodsI18n.__( \'Deselect\' ) %>"><%- PodsI18n.__( \'Deselect\' ) %></a>\r\n\t\t\t</li>\r\n\t\t\t<% if ( 1 == fieldConfig.file_linked && \'\' != download ) { %>\r\n\t\t\t\t<li class="pods-dfv-list-col pods-dfv-list-download">\r\n\t\t\t\t\t<a href="<%- download %>" target="_blank" rel="noopener noreferrer" title="<%- PodsI18n.__( \'Download\' ) %>"><%- PodsI18n.__( \'Download\' ) %></a>\r\n\t\t\t\t</li>\r\n\t\t\t<% } %>\r\n\t\t\t<% if ( 1 == fieldConfig.file_show_edit_link && \'\' != edit_link ) { %>\r\n\t\t\t\t<li class="pods-dfv-list-col pods-dfv-list-edit">\r\n\t\t\t\t\t<a href="<%- edit_link %>" target="_blank" rel="noopener noreferrer" title="<%- PodsI18n.__( \'Edit\' ) %>"><%- PodsI18n.__( \'Edit\' ) %></a>\r\n\t\t\t\t</li>\r\n\t\t\t<% } %>\r\n\t\t</ul>\r\n\t</li>\r\n</ul>\r\n'),className:"pods-dfv-list-item",ui:{dragHandle:".pods-dfv-list-handle",editLink:".pods-dfv-list-edit-link",viewLink:".pods-dfv-list-link",downloadLink:".pods-dfv-list-download",removeButton:".pods-dfv-list-remove",itemName:".pods-dfv-list-name"},triggers:{"click @ui.removeButton":"remove:file:click"}}),p=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-dfv-list",childView:m,childViewTriggers:{"remove:file:click":"childview:remove:file:click"},onAttach:function(){var e=this.options.fieldModel.get("fieldConfig"),i="y";1!=e.file_limit&&("tiles"==e.file_field_template&&(i=""),this.$el.sortable({containment:"parent",axis:i,scrollSensitivity:40,tolerance:"pointer",opacity:.6}))}}),u=r.extend({childViewEventPrefix:!1,tagName:"div",template:_.template('<a class="button pods-dfv-list-add" href="#" tabindex="2"><%= fieldConfig.file_add_button %></a>'),ui:{addButton:".pods-dfv-list-add"},triggers:{"click @ui.addButton":"childview:add:file:click"}}),v=PodsMn.Object.extend({constructor:function(e){this.browseButton=e.browseButton,this.uiRegion=e.uiRegion,this.fieldConfig=e.fieldConfig,PodsMn.Object.call(this,e)}}),g=Backbone.Model.extend({defaults:{id:0,filename:"",progress:0,errorMsg:""}}),w=PodsMn.View.extend({model:g,tagName:"li",template:_.template('<ul class="pods-dfv-list-meta media-item">\r\n\t<% if ( \'\' === errorMsg ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-progress"><div class="progress-bar" style="width: <%- progress %>%;"></div></li>\r\n\t<% } %>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-name"><%- filename %></li>\r\n</ul>\r\n<% if ( \'\' !== errorMsg ) { %>\r\n\t<div class="error"><%- errorMsg %></div>\r\n<% } %>\r\n'),attributes:function(){return{class:"pods-dfv-list-item",id:this.model.get("id")}},modelEvents:{change:"onModelChanged"},onModelChanged:function(){this.render()}}),C=PodsMn.CollectionView.extend({tagName:"ul",className:"pods-dfv-list pods-dfv-list-queue",childView:w}),b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k=[v.extend({plupload:{},fileUploader:"plupload",initialize:function(){this.fieldConfig.plupload_init.browse_button=this.browseButton,this.plupload=new plupload.Uploader(this.fieldConfig.plupload_init),this.plupload.init(),this.plupload.bind("FilesAdded",this.onFilesAdded,this),this.plupload.bind("UploadProgress",this.onUploadProgress,this),this.plupload.bind("FileUploaded",this.onFileUploaded,this)},onFilesAdded:function(e,i){var t=void 0,l=void 0,n=void 0;l=new Backbone.Collection,jQuery.each(i,function(e,i){t=new g({id:i.id,filename:i.name}),l.add(t)}),(n=new C({collection:l})).render(),this.uiRegion.reset(),this.uiRegion.show(n),this.queueCollection=l,e.refresh(),e.start()},onUploadProgress:function(e,i){this.queueCollection.get(i.id).set({progress:i.percent})},onFileUploaded:function(e,i,t){var l=this.queueCollection.get(i.id),n=t.response,o=[],d=void 0;if("Error: "===t.response.substr(0,7))n=n.substr(7),window.console&&console.log(n),l.set({progress:0,errorMsg:n});else if("<e>"===t.response.substr(0,3))n=jQuery(n).text(),window.console&&console.log(n),l.set({progress:0,errorMsg:n});else{if("object"!==(void 0===(d=null!==(d=n.match(/{.*}$/))&&0<d.length?jQuery.parseJSON(d[0]):{})?"undefined":b(d))||jQuery.isEmptyObject(d))return window.console&&console.log(n),window.console&&console.log(d),void l.set({progress:0,errorMsg:PodsI18n.__("Error uploading file: ")+i.name});o={id:d.ID,icon:d.thumbnail,name:d.post_title,edit_link:d.edit_link,link:d.link,download:d.download},l.trigger("destroy",l),this.trigger("added:files",o)}}}),v.extend({mediaObject:{},fileUploader:"attachment",invoke:function(){void 0===wp.Uploader.defaults.filters.mime_types&&(wp.Uploader.defaults.filters.mime_types=[{title:PodsI18n.__("Allowed Files"),extensions:"*"}]);var e=wp.Uploader.defaults.filters.mime_types[0].extensions;wp.Uploader.defaults.filters.mime_types[0].extensions=this.fieldConfig.limit_extensions,this.mediaObject=wp.media({title:this.fieldConfig.file_modal_title,multiple:1!=this.fieldConfig.file_limit,library:{type:this.fieldConfig.limit_types},button:{text:this.fieldConfig.file_modal_add_button}}),this.mediaObject.once("select",this.onMediaSelect,this),this.mediaObject.open(),this.mediaObject.content.mode(this.fieldConfig.file_attachment_tab),wp.Uploader.defaults.filters.mime_types[0].extensions=e},onMediaSelect:function(){var e=this.mediaObject.state().get("selection"),l=[];e&&(e.each(function(e){var i=e.attributes.sizes,t=void 0;t=e.attributes.icon,void 0!==i&&(void 0!==i.thumbnail&&void 0!==i.thumbnail.url?t=i.thumbnail.url:void 0!==i.full&&void 0!==i.full.url&&(t=i.full.url)),l.push({id:e.attributes.id,icon:t,name:e.attributes.title,edit_link:e.attributes.editLink,link:e.attributes.link,download:e.attributes.url})}),this.trigger("added:files",l))}})],y=c.extend({childViewEventPrefix:!1,template:_.template('<div class="pods-ui-file-list pods-field-template-<%- fieldConfig.file_field_template %>"></div>\r\n<div class="pods-ui-region"></div>\r\n<div class="pods-ui-form"></div>\r\n'),regions:{list:".pods-ui-file-list",uiRegion:".pods-ui-region",form:".pods-ui-form"},childViewEvents:{"childview:remove:file:click":"onChildviewRemoveFileClick","childview:add:file:click":"onChildviewAddFileClick"},uploader:{},onBeforeRender:function(){void 0===this.collection&&(this.collection=new h(this.fieldItemData))},onRender:function(){var e=new p({collection:this.collection,fieldModel:this.model}),i=new u({fieldModel:this.model});this.showChildView("list",e),this.showChildView("form",i),this.uploader=this.createUploader(),this.listenTo(this.uploader,"added:files",this.onAddedFiles)},onChildviewRemoveFileClick:function(e){this.collection.remove(e.model)},onChildviewAddFileClick:function(){"function"==typeof this.uploader.invoke&&this.uploader.invoke()},onAddedFiles:function(e){var i=+this.model.get("fieldConfig").file_limit,t=void 0,l=void 0;(t=this.collection.clone()).add(e),l=0===i?t.models:t.filter(function(e){return t.indexOf(e)>=t.length-i}),this.collection.reset(l)},createUploader:function(){var e=this.model.get("fieldConfig"),t=e.file_uploader,l=void 0;if(jQuery.each(k,function(e,i){if(t===i.prototype.fileUploader)return l=i,!1}),void 0!==l)return this.uploader=new l({browseButton:this.getRegion("form").getEl(".pods-dfv-list-add").get(),uiRegion:this.getRegion("uiRegion"),fieldConfig:e}),this.uploader;throw"Could not locate file uploader '"+t+"'"}}),x=wp.media.view.Modal.extend({close:function(e){var i=wp.media.view.Modal.prototype.close.apply(this,e);return e&&e.escape&&window.parent.jQuery(window.parent).trigger("dfv:modal:cancel"),i}}),P=wp.media.view.Frame.extend({className:"pods-modal-frame",template:_.template('<div class="media-frame-title" /><div class="media-frame-iframe" />'),regions:["title","iframe"],initialize:function(){wp.media.view.Frame.prototype.initialize.apply(this,arguments),this.$el.addClass("wp-core-ui"),this.initState(),this.initModal(),this.on("iframe:create:default",this.iframeContent,this),this.iframe.mode("default"),this.on("title:create:default",this.createTitle,this),this.title.mode("default")},initState:function(){var e=this.options.title||PodsI18n.__("Add New Record"),i=this.options.src||"/";this.states.add([new wp.media.controller.State({id:"default",title:e,src:i})]),this.options.state="default"},initModal:function(){this.modal=new x({controller:this}),this.modal.content(this)},render:function(){return!this.state()&&this.options.state&&this.setState(this.options.state),wp.media.view.Frame.prototype.render.apply(this,arguments)},iframeContent:function(e){e.view=new wp.media.view.Iframe({controller:this})},createTitle:function(e){e.view=new wp.media.View({controller:this,tagName:"h1"})}}),S=Backbone.Model.extend({defaults:{id:0,name:"",icon:"",link:"",edit_link:"",selected:!1},toggleSelected:function(){this.set("selected",!this.get("selected"))}}),M=Backbone.Collection.extend({model:S,setSelected:function(t){this.map(function(e){var i=_.contains(t,e.get("id")+"");e.set("selected",i)})},filterBySelected:function(){var e=this.filter(function(e){return e.get("selected")});return new M(e)},filterByUnselected:function(){var e=this.filter(function(e){return!e.get("selected")});return new M(e)}}),A=Backbone.Model.extend({defaults:{view_name:"select",iframe_src:"",pick_format_type:"single",pick_show_icon:!1,pick_show_view_link:!1,pick_show_edit_link:!1}}),V=r.extend({childViewEventPrefix:!1,tagName:"li",template:_.template('<div class="pods-field pods-boolean">\r\n\t<input name="<%- htmlAttr.name %>" data-name-clean="<%- htmlAttr.name_clean %>" data-label="<%- fieldConfig.label %>" id="<%- htmlAttr.id %><%= ordinal %>" class="pods-form-ui-field-type-pick pods-form-ui-field-name-<%- htmlAttr.name_clean %>" type="radio"\r\n\t\t\t<% if ( selected ) { %>\r\n\t\t\t\tchecked="CHECKED"\r\n\t\t\t<% } %>\r\n\t\t\tvalue="<%- id %>" tabindex="2">\r\n\t<label class="pods-form-ui-label pods-form-ui-label-<%- htmlAttr.id %><%= ordinal %>" for="<%- htmlAttr.id %><%= ordinal %>">\r\n\t\t<%= name %>\r\n\t</label>\r\n</div>\r\n'),templateContext:function(){return{ordinal:this.model.collection.indexOf(this.model)+1}},modelChanged:function(){this.render()}}),j=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-radio",childView:V}),L=r.extend({childViewEventPrefix:!1,tagName:"li",template:_.template('<div class="pods-field pods-boolean">\r\n\t<input name="<%- htmlAttr.name %>[<%= ordinal %>]"\r\n\t\t<%= selected ? \'checked="checked"\' : \'\' %>\r\n\t\tdata-name-clean="<%- htmlAttr.name_clean %>" data-label="<%- fieldConfig.label %>" id="<%- htmlAttr.id %><%= ordinal %>" class="pods-form-ui-field-type-pick" type="checkbox" tabindex="2" value="<%- id %>">\r\n\t<label class="pods-form-ui-label" for="<%- htmlAttr.id %><%= ordinal %>">\r\n\t\t<%= name %>\r\n\t</label>\r\n</div>\r\n'),className:"pods-pick",ui:{checkbox:"input.pods-form-ui-field-type-pick"},triggers:{"click @ui.checkbox":"toggle:selected"},modelEvents:{change:"modelChanged"},templateContext:function(){return{ordinal:this.model.collection.indexOf(this.model)}},modelChanged:function(){this.render()}}),I=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-checkbox-view",childView:L,childViewEvents:{"toggle:selected":"onChildviewToggleSelected"},onAttach:function(){this.validateSelectionLimit()||this.selectionLimitOver()},onChildviewToggleSelected:function(e){e.model.toggleSelected(),this.validateSelectionLimit()?this.selectionLimitUnder():this.selectionLimitOver()},validateSelectionLimit:function(){var e,i;return e=+this.fieldModel.get("fieldConfig").pick_limit,i=this.collection.filterBySelected().length,0===e||i<e},selectionLimitOver:function(){this.$el.find("input:checkbox:not(:checked)").prop("disabled",!0),this.trigger("selection:limit:over",this)},selectionLimitUnder:function(){this.$el.find("input:checkbox").prop("disabled",!1),this.trigger("selection:limit:under",this)}}),N=r.extend({childViewEventPrefix:!1,tagName:"option",template:!1,initialize:function(e){this.$el.val(this.model.get("id")),this.$el.text(this.model.get("name")),this.model.get("selected")&&this.$el.prop("selected","selected")}}),E=a.extend({childViewEventPrefix:!1,tagName:"optgroup",childView:N,attributes:function(){return{label:this.model.get("label")}}}),B=PodsMn.CollectionView.extend({childViewEventPrefix:!1,tagName:"select",triggers:{change:{event:"change:selected",stopPropagation:!1}},multiLastValidSelection:[],setCollection:function(e){this.collection=e},initialize:function(e){this.fieldModel=e.fieldModel,this.fieldConfig=this.fieldModel.get("fieldConfig")},childView:function(e){return this.fieldConfig.optgroup?E:N},childViewOptions:function(e,i){var t={fieldModel:this.fieldModel};return this.fieldConfig.optgroup&&(t.collection=new M(e.get("collection"))),t},serializeData:function(){var e=this.options.fieldModel,i=this.model?this.model.toJSON():{};return i.htmlAttr=e.get("attributes"),i.fieldConfig=e.get("fieldConfig"),i},attributes:function(){var e=this.options.fieldModel,i=e.get("htmlAttr"),t=e.get("fieldConfig"),l=i.name;return"multi"===t.pick_format_type&&(l+="[]"),{name:l,class:i.class,"data-name-clean":i.name_clean,id:i.id,tabindex:"2",multiple:"multi"===t.pick_format_type}},onAttach:function(){var e=this.fieldConfig.view_name,i=this.fieldConfig.pick_format_type;"select2"===e&&this.setupSelect2(),"select"===e&&"multi"===i&&(this.multiLastValidSelection=this.$el.val()),this.validateSelectionLimit()||this.selectionLimitOver()},onChangeSelected:function(){var e=+this.fieldConfig.pick_limit,i=this.fieldConfig.view_name,t=this.fieldConfig.pick_format_type;if("select"===i&&"multi"===t&&null!==this.$el.val()&&0!==e&&e<this.$el.val().length)return this.$el.val(this.multiLastValidSelection),window.alert(PodsI18n.__("You can only select")+" "+sprintf(PodsI18n._n("%s item","%s items",e),e)),void this.trigger("childview:change:selected",this);this.collection.setSelected(this.$el.val()),this.multiLastValidSelection=this.$el.val(),this.validateSelectionLimit()?this.selectionLimitUnder():this.selectionLimitOver(),this.trigger("childview:change:selected",this)},onBeforeDetach:function(){this.$el.selectWoo("destroy")},validateSelectionLimit:function(){var e,i,t=this.fieldConfig.pick_format_type,l=this.fieldConfig.pick_format_single;return""===this.$el.val()&&"single"===t&&"dropdown"===l||(e=+this.fieldConfig.pick_limit,i=this.collection.filterBySelected().length,0===e||i<e)},selectionLimitOver:function(){var e=this.fieldConfig.view_name,i=this.fieldConfig.pick_format_type;"select"===e&&"multi"===i&&this.$el.find("option:not(:selected)").prop("disabled",!0),this.trigger("childview:selection:limit:over",this)},selectionLimitUnder:function(){var e=this.fieldConfig.view_name,i=this.fieldConfig.pick_format_type;"select"===e&&"multi"===i&&this.$el.find("option").prop("disabled",!1),this.trigger("childview:selection:limit:under",this)},filterAjaxList:function(e){var i=this.collection.filterBySelected(),t=[];return _.each(e.results,function(e){e.text=e.name,i.get(e.id)||t.push(e)}),{results:t}},setupSelect2:function(){var e,t=this,l=this.$el,i=this.options.fieldModel.get("fieldConfig"),n=i.ajax_data,o=i.select2_overrides,d=i.pick_limit,s="single"===i.pick_format_type,a=this.collection.filterBySelected().length,r=void 0;0===a&&s&&l.prepend('<option selected="selected">'),e={maximumSelectionLength:s?void 0:d,placeholder:i.limitDisable?""+sprintf(PodsI18n._n("You can only select %s item","You can only select %s items",d),d):sprintf(PodsI18n.__("Search %s"),i.label)+"...",allowClear:s,disabled:i.limitDisable,tags:i.pick_taggable,escapeMarkup:function(e){return"string"!=typeof e?e:String(e).replace(/<script|<\/script/g,function(e){var i={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return i[e]})})}},n.ajax&&jQuery.extend(e,{minimumInputLength:n.minimum_input_length,ajax:{url:ajaxurl+"?pods_ajax=1",type:"POST",dataType:"json",delay:n.delay,data:function(e){return{_wpnonce:n._wpnonce,action:"pods_relationship",method:"select2",pod:n.pod,field:n.field,uri:n.uri,id:n.id,query:e.term}},processResults:function(e,i){return t.filterAjaxList(e,i)}}}),l.selectWoo(jQuery.extend(!0,e,o)),(r=l.parent().find("ul.select2-selection__rendered")).sortable({containment:"parent"}),r.on("sortstop",function(){var e=r.find(".select2-selection__choice").get().reverse();jQuery(e).each(function(){var e=jQuery(this).data("data").id,i=l.find('option[value="'+e+'"]')[0];l.prepend(i)})})}}),O=r.extend({childViewEventPrefix:!1,tagName:"li",className:"pods-dfv-list-item pods-relationship",template:_.template('<input\r\n\t\t<% if ( \'single\' === fieldConfig.pick_format_type ) { %>\r\n\t\t\tname="<%- htmlAttr.name %>" id="<%- htmlAttr.id %>"\r\n\t\t<% } else { %>\r\n\t\t\tname="<%- htmlAttr.name %>[<%= ordinal %>]" id="<%- htmlAttr.id %><%= ordinal %>"\r\n\t\t<% } %>\r\n\t\tdata-name-clean="<%- htmlAttr.name_clean %>" type="hidden" value="<%- id %>">\r\n<ul class="pods-dfv-list-meta relationship-item">\r\n\t<% if ( 1 != fieldConfig.pick_limit ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-handle"><span><%- PodsI18n.__( \'Reorder\' ) %></span></li>\r\n\t<% } %>\r\n\t<% if ( 1 == fieldConfig.pick_show_icon ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-icon">\r\n\t\t\t<% if ( \'\' == icon ) { %>\r\n\t\t\t\t<% if ( /^dashicons/.test( fieldConfig.default_icon ) ) { %>\r\n\t\t\t\t\t<span class="pinkynail dashicons <%- fieldConfig.default_icon %>"></span>\r\n\t\t\t\t<% } else { %>\r\n\t\t\t\t\t<img class="pinkynail" src="<%- fieldConfig.default_icon %>" alt="Icon">\r\n\t\t\t\t<% } %>\r\n\t\t\t<% } else { %>\r\n\t\t\t\t<% if ( /^dashicons/.test( icon ) ) { %>\r\n\t\t\t\t\t<span class="pinkynail dashicons <%- icon %>"></span>\r\n\t\t\t\t<% } else { %>\r\n\t\t\t\t\t<img class="pinkynail" src="<%- icon %>" alt="Icon">\r\n\t\t\t\t<% } %>\r\n\t\t\t<% } %>\r\n\t\t</li>\r\n\t<% } %>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-name">\r\n\t\t<%= name %>\r\n\t</li>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-remove"><a href="#remove" title="<%- PodsI18n.__( \'Deselect\' ) %>"><%- PodsI18n.__( \'Deselect\' ) %></a></li>\r\n\t<% if ( 1 == fieldConfig.pick_show_view_link && \'\' != link ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-link"><a href="<%- link %>" title="<%- PodsI18n.__( \'View\' ) %>" target="_blank" rel="noopener noreferrer"><%- PodsI18n.__( \'View\' ) %></a></li>\r\n\t<% } %>\r\n\t<% if ( 1 == fieldConfig.pick_show_edit_link && \'\' != edit_link ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-edit"><a href="<%- edit_link %>" title="<%- PodsI18n.__( \'Edit\' ) %>" target="_blank" rel="noopener noreferrer"><%- PodsI18n.__( \'Edit\' ) %></a></li>\r\n\t<% } %>\r\n</ul>\r\n'),ui:{removeButton:".pods-dfv-list-remove a",editButton:".pods-dfv-list-edit a"},triggers:{"click @ui.removeButton":"remove:item:click","click @ui.editButton":"edit:item:click"},templateContext:function(){return{ordinal:this.model.collection.indexOf(this.model)}}}),U=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-dfv-list pods-relationship",childView:O,childViewTriggers:{"remove:item:click":"childview:remove:item:click","edit:item:click":"childview:edit:item:click"},filter:function(e,i,t){return e.attributes.selected},onAttach:function(){1!==this.options.fieldModel.get("fieldConfig").pick_limit&&this.$el.sortable({containment:"parent",axis:"y",scrollSensitivity:40,tolerance:"pointer",opacity:.6})}}),F="button-disabled",R=r.extend({childViewEventPrefix:!1,tagName:"div",className:"podsform-dfv-list-relationship-container",ui:{addButton:"a.pods-related-add-new"},template:_.template('<a href="/wp-admin/?pods_modal=1" class="button pods-related-add-new pods-modal" data-pod-id="<%- fieldConfig.pod_id %>" data-field-id="<%- fieldConfig.id %>" data-item-id="<%- fieldConfig.item_id %>">\r\n\t<%- PodsI18n.__( \'Add New\' ) %>\r\n</a>'),triggers:{"click @ui.addButton":"add:new:click"},disable:function(){this.getUI("addButton").addClass(F)},enable:function(){this.getUI("addButton").removeClass(F)},onAddNewClick:function(){this.getUI("addButton").hasClass(F)||this.trigger("childview:add:new",this)}}),D={checkbox:I,select:B,select2:B,radio:j,list:U},Q=void 0,$=c.extend({childViewEventPrefix:!1,template:_.template('<%if ( fieldConfig.view_name === \'list\' ) { %>\r\n\t<div class="pods-ui-list-autocomplete"></div>\r\n<% } %>\r\n\r\n<div class="pods-pick-values"></div>\r\n\r\n<% if ( fieldConfig.iframe_src != \'\' ) { %>\r\n\t<div class="pods-ui-add-new"></div>\r\n<% } %>'),regions:{autocomplete:".pods-ui-list-autocomplete",list:".pods-pick-values",addNew:".pods-ui-add-new"},childViewEvents:{"childview:remove:item:click":"onChildviewRemoveItemClick","childview:edit:item:click":"onChildviewEditItemClick","childview:selection:limit:over":"onChildviewSelectionLimitOver","childview:selection:limit:under":"onChildviewSelectionLimitUnder","childview:change:selected":"onChildviewChangeSelected","childview:add:new":"onChildviewAddNew"},onBeforeRender:function(){void 0===this.collection&&(this.collection=new M(this.fieldItemData))},onRender:function(){this.fieldConfig=new A(this.model.get("fieldConfig")),""!==this.fieldConfig.get("iframe_src")&&1==this.fieldConfig.get("pick_allow_add_new")&&this.showAddNew(),"list"===this.fieldConfig.get("view_name")&&this.buildAutocomplete(),this.showList()},buildAutocomplete:function(){var e,i,t=void 0,l=void 0,n=+this.fieldConfig.get("pick_limit");t={view_name:"select2",pick_format_type:"multi",selectFromExisting:!0,ajax_data:this.fieldConfig.get("ajax_data"),select2_overrides:this.fieldConfig.get("select2_overrides"),label:this.fieldConfig.get("label"),pick_limit:n},this.collection.filterBySelected().length>=n&&0!==n?(t.limitDisable=!0,this.onChildviewSelectionLimitOver()):this.onChildviewSelectionLimitUnder(),e=new o({fieldConfig:t}),i=this.collection.filterByUnselected(),(l=new B({collection:i,fieldModel:e})).filterAjaxList=this.filterAjaxList.bind(this),this.showChildView("autocomplete",l)},showList:function(){var e,i;if(e=this.fieldConfig.get("view_name"),void 0===D[e])throw new Error('Invalid view name "'+e+'"');i=new D[e]({collection:this.collection,fieldModel:this.model}),this.showChildView("list",i)},showAddNew:function(){var e=new R({fieldModel:this.model});this.showChildView("addNew",e)},filterAjaxList:function(e){var i=this.collection.filterBySelected(),t=[];return _.each(e.results,function(e){e.text=e.name,i.get(e.id)||t.push(e)}),this.collection.add(t),this.getChildView("autocomplete").setCollection(this.collection.filterByUnselected()),{results:t}},onChildviewSelectionLimitOver:function(e){var i=this.getChildView("addNew");i&&i.disable()},onChildviewSelectionLimitUnder:function(e){var i=this.getChildView("addNew");i&&i.enable()},onChildviewRemoveItemClick:function(e){e.model.toggleSelected(),this.getChildView("list").render(),"list"===this.fieldConfig.get("view_name")&&this.buildAutocomplete()},onChildviewAddNew:function(e){var i=this.model.get("fieldConfig");Q=new P({title:i.iframe_title_add,src:i.iframe_src}),this.setModalListeners(),Q.modal.open()},onChildviewEditItemClick:function(e){var i=this.model.get("fieldConfig");Q=new P({title:i.iframe_title_edit,src:e.ui.editButton.attr("href")}),this.setModalListeners(),Q.modal.open()},onChildviewChangeSelected:function(e){e.fieldConfig.selectFromExisting&&(_.defer(this.buildAutocomplete.bind(this)),this.getChildView("list").render())},setModalListeners:function(){jQuery(window).on("dfv:modal:update",this.modalSuccess.bind(this)),jQuery(window).on("dfv:modal:cancel",this.modalCancel.bind(this))},clearModalListeners:function(){jQuery(window).off("dfv:modal:update"),jQuery(window).off("dfv:modal:cancel")},modalSuccess:function(e,i){var t=this.collection.get(i.id);t?(t.set(i),this.getChildView("list").render()):this.collection.add(i),this.clearModalListeners(),Q.modal.close({})},modalCancel:function(){this.clearModalListeners()}}),z={file:y,avatar:y,pick:$},T={fields:Object.freeze({FileUpload:y,Pick:$}),models:Object.freeze({PodsDFVFieldModel:o,RelationshipModel:S,RelationshipCollection:M,FileUploadModel:f,FileUploadCollection:h}),fieldInstances:{},init:function(){var l=this;jQuery(".pods-form-ui-field").each(function(){var e=void 0,i=void 0,t={fieldType:void 0};jQuery(this).find("script.pods-dfv-field-data").each(function(){var e=jQuery.parseJSON(jQuery(this).html());jQuery(this).parents(".media-modal-content").length&&(e.fieldConfig.pick_allow_add_new=0),jQuery.extend(t,e),jQuery(this).remove()}),void 0!==t.fieldType&&void 0!==(e=z[t.fieldType])&&((i=new e({el:this,model:new o({htmlAttr:t.htmlAttr,fieldConfig:t.fieldConfig}),fieldItemData:t.fieldItemData})).render(),jQuery(this).trigger("render"),l.fieldInstances[t.htmlAttr.id]=i)})},isModalWindow:function(){return-1!==location.search.indexOf("pods_modal=")},isGutenbergEditorLoaded:function(){return void 0!==wp.data&&void 0!==wp.data.select("core/editor")}};return document.addEventListener("DOMContentLoaded",function(){T.init(),T.isModalWindow()&&T.isGutenbergEditorLoaded()&&i()}),T}();
|
1 |
+
var PodsDFV=function(){"use strict";var o=Backbone.Model.extend({defaults:{htmlAttr:{},fieldConfig:{}}}),n=wp.data&&wp.data.select("core/editor"),e=void 0,i=function(){e=n.isCurrentPostPublished()?wp.data.subscribe(d):wp.data.subscribe(l)};function t(){var e=n.getCurrentPostAttribute("featured_media"),i="";if(!e)return i;var t=wp.data.select("core").getMedia(e);if(t){var l=wp.hooks.applyFilters("editor.PostFeaturedImage.imageSize","post-thumbnail","");i=t.media_details&&t.media_details.sizes&&t.media_details.sizes[l]?t.media_details.sizes[l].source_url:t.source_url}return i}function l(){n.isCurrentPostPublished()&&(e(),s({icon:t(),link:n.getPermalink(),edit_link:"post.php?post="+n.getCurrentPostId()+"&action=edit&pods_modal=1",selected:!0}))}function d(){d.wasSaving?n.isSavingPost()||(d.wasSaving=!1,n.didPostSaveRequestSucceed()&&(e(),s({icon:t()}))):d.wasSaving=!(!n.isSavingPost()||n.isAutosavingPost())}function s(e){var i={id:n.getCurrentPostId(),name:n.getCurrentPostAttribute("title")},t=Object.assign(i,e);window.parent.jQuery(window.parent).trigger("dfv:modal:update",t)}var a=PodsMn.CollectionView.extend({childViewEventPrefix:!1,initialize:function(e){this.fieldModel=e.fieldModel,this.childViewOptions={fieldModel:e.fieldModel}}}),r=PodsMn.View.extend({childViewEventPrefix:!1,serializeData:function(){var e=this.options.fieldModel,i=this.model?this.model.toJSON():{};return i.htmlAttr=e.get("htmlAttr"),i.fieldConfig=e.get("fieldConfig"),i}}),c=PodsMn.View.extend({childViewEventPrefix:!1,initialize:function(e){this.fieldItemData=e.fieldItemData}}),f=Backbone.Model.extend({defaults:{id:0,icon:"",name:"",edit_link:"",link:"",download:""}}),h=Backbone.Collection.extend({model:f}),m=r.extend({childViewEventPrefix:!1,tagName:"li",template:_.template('<input name="<%- htmlAttr.name %>[<%- id %>][id]" data-name-clean="<%- htmlAttr.name_clean %>-id" id="<%- htmlAttr.id %>-<%- id %>-id" class="<%- htmlAttr.class %>" type="hidden" value="<%- id %>">\r\n<ul class="pods-dfv-list-meta media-item">\r\n\t<% if ( 1 != fieldConfig.file_limit ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-handle"><span><%- PodsI18n.__( \'Reorder\' ) %></span></li>\r\n\t<% } %>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-icon"><img class="pinkynail" src="<%- icon %>" alt="<%- PodsI18n.__( \'Icon\' ) %>"></li>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-name">\r\n\t\t<% if ( 0 != fieldConfig.file_edit_title ) { %>\r\n\t\t\t<input name="<%- htmlAttr.name %>[<%- id %>][title]" data-name-clean="<%- htmlAttr.name_clean %>-title" id="pods-form-ui-<%- htmlAttr.name_clean %>-<%- id %>-title" class="pods-form-ui-field-type-text pods-form-ui-field-name-<%- htmlAttr.name_clean %>-title" type="text" value="<%- name %>" tabindex="2" maxlength="255">\r\n\t\t<% } else { %>\r\n\t\t\t<%- name %>\r\n\t\t<% } %>\r\n\t</li>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-actions">\r\n\t\t<ul>\r\n\t\t\t<li class="pods-dfv-list-col pods-dfv-list-remove">\r\n\t\t\t\t<a href="#remove" title="<%- PodsI18n.__( \'Deselect\' ) %>"><%- PodsI18n.__( \'Deselect\' ) %></a>\r\n\t\t\t</li>\r\n\t\t\t<% if ( 1 == fieldConfig.file_linked && \'\' != download ) { %>\r\n\t\t\t\t<li class="pods-dfv-list-col pods-dfv-list-download">\r\n\t\t\t\t\t<a href="<%- download %>" target="_blank" rel="noopener noreferrer" title="<%- PodsI18n.__( \'Download\' ) %>"><%- PodsI18n.__( \'Download\' ) %></a>\r\n\t\t\t\t</li>\r\n\t\t\t<% } %>\r\n\t\t\t<% if ( 1 == fieldConfig.file_show_edit_link && \'\' != edit_link ) { %>\r\n\t\t\t\t<li class="pods-dfv-list-col pods-dfv-list-edit">\r\n\t\t\t\t\t<a href="<%- edit_link %>" target="_blank" rel="noopener noreferrer" title="<%- PodsI18n.__( \'Edit\' ) %>"><%- PodsI18n.__( \'Edit\' ) %></a>\r\n\t\t\t\t</li>\r\n\t\t\t<% } %>\r\n\t\t</ul>\r\n\t</li>\r\n</ul>\r\n'),className:"pods-dfv-list-item",ui:{dragHandle:".pods-dfv-list-handle",editLink:".pods-dfv-list-edit-link",viewLink:".pods-dfv-list-link",downloadLink:".pods-dfv-list-download",removeButton:".pods-dfv-list-remove",itemName:".pods-dfv-list-name"},triggers:{"click @ui.removeButton":"remove:file:click"}}),p=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-dfv-list",childView:m,childViewTriggers:{"remove:file:click":"childview:remove:file:click"},onAttach:function(){var e=this.options.fieldModel.get("fieldConfig"),i="y";1!=e.file_limit&&("tiles"==e.file_field_template&&(i=""),this.$el.sortable({containment:"parent",axis:i,scrollSensitivity:40,tolerance:"pointer",opacity:.6}))}}),u=r.extend({childViewEventPrefix:!1,tagName:"div",template:_.template('<a class="button pods-dfv-list-add" href="#" tabindex="2"><%= fieldConfig.file_add_button %></a>'),ui:{addButton:".pods-dfv-list-add"},triggers:{"click @ui.addButton":"childview:add:file:click"}}),v=PodsMn.Object.extend({constructor:function(e){this.browseButton=e.browseButton,this.uiRegion=e.uiRegion,this.fieldConfig=e.fieldConfig,PodsMn.Object.call(this,e)}}),g=Backbone.Model.extend({defaults:{id:0,filename:"",progress:0,errorMsg:""}}),w=PodsMn.View.extend({model:g,tagName:"li",template:_.template('<ul class="pods-dfv-list-meta media-item">\r\n\t<% if ( \'\' === errorMsg ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-progress"><div class="progress-bar" style="width: <%- progress %>%;"></div></li>\r\n\t<% } %>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-name"><%- filename %></li>\r\n</ul>\r\n<% if ( \'\' !== errorMsg ) { %>\r\n\t<div class="error"><%- errorMsg %></div>\r\n<% } %>\r\n'),attributes:function(){return{class:"pods-dfv-list-item",id:this.model.get("id")}},modelEvents:{change:"onModelChanged"},onModelChanged:function(){this.render()}}),C=PodsMn.CollectionView.extend({tagName:"ul",className:"pods-dfv-list pods-dfv-list-queue",childView:w}),b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k=[v.extend({plupload:{},fileUploader:"plupload",initialize:function(){this.fieldConfig.plupload_init.browse_button=this.browseButton,this.plupload=new plupload.Uploader(this.fieldConfig.plupload_init),this.plupload.init(),this.plupload.bind("FilesAdded",this.onFilesAdded,this),this.plupload.bind("UploadProgress",this.onUploadProgress,this),this.plupload.bind("FileUploaded",this.onFileUploaded,this)},onFilesAdded:function(e,i){var t=void 0,l=void 0,n=void 0;l=new Backbone.Collection,jQuery.each(i,function(e,i){t=new g({id:i.id,filename:i.name}),l.add(t)}),(n=new C({collection:l})).render(),this.uiRegion.reset(),this.uiRegion.show(n),this.queueCollection=l,e.refresh(),e.start()},onUploadProgress:function(e,i){this.queueCollection.get(i.id).set({progress:i.percent})},onFileUploaded:function(e,i,t){var l=this.queueCollection.get(i.id),n=t.response,o=[],d=void 0;if("Error: "===t.response.substr(0,7))n=n.substr(7),window.console&&console.log(n),l.set({progress:0,errorMsg:n});else if("<e>"===t.response.substr(0,3))n=jQuery(n).text(),window.console&&console.log(n),l.set({progress:0,errorMsg:n});else{if("object"!==(void 0===(d=null!==(d=n.match(/{.*}$/))&&0<d.length?jQuery.parseJSON(d[0]):{})?"undefined":b(d))||jQuery.isEmptyObject(d))return window.console&&console.log(n),window.console&&console.log(d),void l.set({progress:0,errorMsg:PodsI18n.__("Error uploading file: ")+i.name});o={id:d.ID,icon:d.thumbnail,name:d.post_title,edit_link:d.edit_link,link:d.link,download:d.download},l.trigger("destroy",l),this.trigger("added:files",o)}}}),v.extend({mediaObject:{},fileUploader:"attachment",invoke:function(){void 0===wp.Uploader.defaults.filters.mime_types&&(wp.Uploader.defaults.filters.mime_types=[{title:PodsI18n.__("Allowed Files"),extensions:"*"}]);var e=wp.Uploader.defaults.filters.mime_types[0].extensions;wp.Uploader.defaults.filters.mime_types[0].extensions=this.fieldConfig.limit_extensions,this.mediaObject=wp.media({title:this.fieldConfig.file_modal_title,multiple:1!=this.fieldConfig.file_limit,library:{type:this.fieldConfig.limit_types},button:{text:this.fieldConfig.file_modal_add_button}}),this.mediaObject.once("select",this.onMediaSelect,this),this.mediaObject.open(),this.mediaObject.content.mode(this.fieldConfig.file_attachment_tab),wp.Uploader.defaults.filters.mime_types[0].extensions=e},onMediaSelect:function(){var e=this.mediaObject.state().get("selection"),l=[];e&&(e.each(function(e){var i=e.attributes.sizes,t=void 0;t=e.attributes.icon,void 0!==i&&(void 0!==i.thumbnail&&void 0!==i.thumbnail.url?t=i.thumbnail.url:void 0!==i.full&&void 0!==i.full.url&&(t=i.full.url)),l.push({id:e.attributes.id,icon:t,name:e.attributes.title,edit_link:e.attributes.editLink,link:e.attributes.link,download:e.attributes.url})}),this.trigger("added:files",l))}})],y=c.extend({childViewEventPrefix:!1,template:_.template('<div class="pods-ui-file-list pods-field-template-<%- fieldConfig.file_field_template %>"></div>\r\n<div class="pods-ui-region"></div>\r\n<div class="pods-ui-form"></div>\r\n'),regions:{list:".pods-ui-file-list",uiRegion:".pods-ui-region",form:".pods-ui-form"},childViewEvents:{"childview:remove:file:click":"onChildviewRemoveFileClick","childview:add:file:click":"onChildviewAddFileClick"},uploader:{},onBeforeRender:function(){void 0===this.collection&&(this.collection=new h(this.fieldItemData))},onRender:function(){var e=new p({collection:this.collection,fieldModel:this.model}),i=new u({fieldModel:this.model});this.showChildView("list",e),this.showChildView("form",i),this.uploader=this.createUploader(),this.listenTo(this.uploader,"added:files",this.onAddedFiles)},onChildviewRemoveFileClick:function(e){this.collection.remove(e.model)},onChildviewAddFileClick:function(){"function"==typeof this.uploader.invoke&&this.uploader.invoke()},onAddedFiles:function(e){var i=+this.model.get("fieldConfig").file_limit,t=void 0,l=void 0;(t=this.collection.clone()).add(e),l=0===i?t.models:t.filter(function(e){return t.indexOf(e)>=t.length-i}),this.collection.reset(l)},createUploader:function(){var e=this.model.get("fieldConfig"),t=e.file_uploader,l=void 0;if(jQuery.each(k,function(e,i){if(t===i.prototype.fileUploader)return l=i,!1}),void 0!==l)return this.uploader=new l({browseButton:this.getRegion("form").getEl(".pods-dfv-list-add").get(),uiRegion:this.getRegion("uiRegion"),fieldConfig:e}),this.uploader;throw"Could not locate file uploader '"+t+"'"}}),x=wp.media.view.Modal.extend({close:function(e){var i=wp.media.view.Modal.prototype.close.apply(this,e);return e&&e.escape&&window.parent.jQuery(window.parent).trigger("dfv:modal:cancel"),i}}),P=wp.media.view.Frame.extend({className:"pods-modal-frame",template:_.template('<div class="media-frame-title"></div><div class="media-frame-iframe"></div>'),regions:["title","iframe"],initialize:function(){wp.media.view.Frame.prototype.initialize.apply(this,arguments),this.$el.addClass("wp-core-ui"),this.initState(),this.initModal(),this.on("iframe:create:default",this.iframeContent,this),this.iframe.mode("default"),this.on("title:create:default",this.createTitle,this),this.title.mode("default")},initState:function(){var e=this.options.title||PodsI18n.__("Add New Record"),i=this.options.src||"/";this.states.add([new wp.media.controller.State({id:"default",title:e,src:i})]),this.options.state="default"},initModal:function(){this.modal=new x({controller:this}),this.modal.content(this)},render:function(){return!this.state()&&this.options.state&&this.setState(this.options.state),wp.media.view.Frame.prototype.render.apply(this,arguments)},iframeContent:function(e){e.view=new wp.media.view.Iframe({controller:this})},createTitle:function(e){e.view=new wp.media.View({controller:this,tagName:"h1"})}}),S=Backbone.Model.extend({defaults:{id:0,name:"",icon:"",link:"",edit_link:"",selected:!1},toggleSelected:function(){this.set("selected",!this.get("selected"))}}),M=Backbone.Collection.extend({model:S,setSelected:function(t){this.map(function(e){var i=_.contains(t,e.get("id")+"");e.set("selected",i)})},filterBySelected:function(){var e=this.filter(function(e){return e.get("selected")});return new M(e)},filterByUnselected:function(){var e=this.filter(function(e){return!e.get("selected")});return new M(e)}}),A=Backbone.Model.extend({defaults:{view_name:"select",iframe_src:"",pick_format_type:"single",pick_show_icon:!1,pick_show_view_link:!1,pick_show_edit_link:!1}}),V=r.extend({childViewEventPrefix:!1,tagName:"li",template:_.template('<div class="pods-field pods-boolean">\r\n\t<input name="<%- htmlAttr.name %>" data-name-clean="<%- htmlAttr.name_clean %>" data-label="<%- fieldConfig.label %>" id="<%- htmlAttr.id %><%= ordinal %>" class="pods-form-ui-field-type-pick pods-form-ui-field-name-<%- htmlAttr.name_clean %>" type="radio"\r\n\t\t\t<% if ( selected ) { %>\r\n\t\t\t\tchecked="CHECKED"\r\n\t\t\t<% } %>\r\n\t\t\tvalue="<%- id %>" tabindex="2">\r\n\t<label class="pods-form-ui-label pods-form-ui-label-<%- htmlAttr.id %><%= ordinal %>" for="<%- htmlAttr.id %><%= ordinal %>">\r\n\t\t<%= name %>\r\n\t</label>\r\n</div>\r\n'),templateContext:function(){return{ordinal:this.model.collection.indexOf(this.model)+1}},modelChanged:function(){this.render()}}),j=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-radio",childView:V}),L=r.extend({childViewEventPrefix:!1,tagName:"li",template:_.template('<div class="pods-field pods-boolean">\r\n\t<input name="<%- htmlAttr.name %>[<%= ordinal %>]"\r\n\t\t<%= selected ? \'checked="checked"\' : \'\' %>\r\n\t\tdata-name-clean="<%- htmlAttr.name_clean %>" data-label="<%- fieldConfig.label %>" id="<%- htmlAttr.id %><%= ordinal %>" class="pods-form-ui-field-type-pick" type="checkbox" tabindex="2" value="<%- id %>">\r\n\t<label class="pods-form-ui-label" for="<%- htmlAttr.id %><%= ordinal %>">\r\n\t\t<%= name %>\r\n\t</label>\r\n</div>\r\n'),className:"pods-pick",ui:{checkbox:"input.pods-form-ui-field-type-pick"},triggers:{"click @ui.checkbox":"toggle:selected"},modelEvents:{change:"modelChanged"},templateContext:function(){return{ordinal:this.model.collection.indexOf(this.model)}},modelChanged:function(){this.render()}}),I=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-checkbox-view",childView:L,childViewEvents:{"toggle:selected":"onChildviewToggleSelected"},onAttach:function(){this.validateSelectionLimit()||this.selectionLimitOver()},onChildviewToggleSelected:function(e){e.model.toggleSelected(),this.validateSelectionLimit()?this.selectionLimitUnder():this.selectionLimitOver()},validateSelectionLimit:function(){var e,i;return e=+this.fieldModel.get("fieldConfig").pick_limit,i=this.collection.filterBySelected().length,0===e||i<e},selectionLimitOver:function(){this.$el.find("input:checkbox:not(:checked)").prop("disabled",!0),this.trigger("selection:limit:over",this)},selectionLimitUnder:function(){this.$el.find("input:checkbox").prop("disabled",!1),this.trigger("selection:limit:under",this)}}),N=r.extend({childViewEventPrefix:!1,tagName:"option",template:!1,initialize:function(e){this.$el.val(this.model.get("id")),this.$el.text(this.model.get("name")),this.model.get("selected")&&this.$el.prop("selected","selected")}}),E=a.extend({childViewEventPrefix:!1,tagName:"optgroup",childView:N,attributes:function(){return{label:this.model.get("label")}}}),B=PodsMn.CollectionView.extend({childViewEventPrefix:!1,tagName:"select",triggers:{change:{event:"change:selected",stopPropagation:!1}},multiLastValidSelection:[],setCollection:function(e){this.collection=e},initialize:function(e){this.fieldModel=e.fieldModel,this.fieldConfig=this.fieldModel.get("fieldConfig")},childView:function(e){return this.fieldConfig.optgroup?E:N},childViewOptions:function(e,i){var t={fieldModel:this.fieldModel};return this.fieldConfig.optgroup&&(t.collection=new M(e.get("collection"))),t},serializeData:function(){var e=this.options.fieldModel,i=this.model?this.model.toJSON():{};return i.htmlAttr=e.get("attributes"),i.fieldConfig=e.get("fieldConfig"),i},attributes:function(){var e=this.options.fieldModel,i=e.get("htmlAttr"),t=e.get("fieldConfig"),l=i.name;return"multi"===t.pick_format_type&&(l+="[]"),{name:l,class:i.class,"data-name-clean":i.name_clean,id:i.id,tabindex:"2",multiple:"multi"===t.pick_format_type}},onAttach:function(){var e=this.fieldConfig.view_name,i=this.fieldConfig.pick_format_type;"select2"===e&&this.setupSelect2(),"select"===e&&"multi"===i&&(this.multiLastValidSelection=this.$el.val()),this.validateSelectionLimit()||this.selectionLimitOver()},onChangeSelected:function(){var e=+this.fieldConfig.pick_limit,i=this.fieldConfig.view_name,t=this.fieldConfig.pick_format_type;if("select"===i&&"multi"===t&&null!==this.$el.val()&&0!==e&&e<this.$el.val().length)return this.$el.val(this.multiLastValidSelection),window.alert(PodsI18n.__("You can only select")+" "+sprintf(PodsI18n._n("%s item","%s items",e),e)),void this.trigger("childview:change:selected",this);this.collection.setSelected(this.$el.val()),this.multiLastValidSelection=this.$el.val(),this.validateSelectionLimit()?this.selectionLimitUnder():this.selectionLimitOver(),this.trigger("childview:change:selected",this)},onBeforeDetach:function(){this.$el.selectWoo("destroy")},validateSelectionLimit:function(){var e,i,t=this.fieldConfig.pick_format_type,l=this.fieldConfig.pick_format_single;return""===this.$el.val()&&"single"===t&&"dropdown"===l||(e=+this.fieldConfig.pick_limit,i=this.collection.filterBySelected().length,0===e||i<e)},selectionLimitOver:function(){var e=this.fieldConfig.view_name,i=this.fieldConfig.pick_format_type;"select"===e&&"multi"===i&&this.$el.find("option:not(:selected)").prop("disabled",!0),this.trigger("childview:selection:limit:over",this)},selectionLimitUnder:function(){var e=this.fieldConfig.view_name,i=this.fieldConfig.pick_format_type;"select"===e&&"multi"===i&&this.$el.find("option").prop("disabled",!1),this.trigger("childview:selection:limit:under",this)},filterAjaxList:function(e){var i=this.collection.filterBySelected(),t=[];return _.each(e.results,function(e){e.text=e.name,i.get(e.id)||t.push(e)}),{results:t}},setupSelect2:function(){var e,t=this,l=this.$el,i=this.options.fieldModel.get("fieldConfig"),n=i.ajax_data,o=i.select2_overrides,d=i.pick_limit,s="single"===i.pick_format_type,a=this.collection.filterBySelected().length,r=void 0;0===a&&s&&l.prepend('<option selected="selected">'),e={maximumSelectionLength:s?void 0:d,placeholder:i.limitDisable?""+sprintf(PodsI18n._n("You can only select %s item","You can only select %s items",d),d):sprintf(PodsI18n.__("Search %s"),i.label)+"...",allowClear:s,disabled:i.limitDisable,tags:i.pick_taggable,escapeMarkup:function(e){return"string"!=typeof e?e:String(e).replace(/<script|<\/script/g,function(e){var i={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return i[e]})})}},n.ajax&&jQuery.extend(e,{minimumInputLength:n.minimum_input_length,ajax:{url:ajaxurl+"?pods_ajax=1",type:"POST",dataType:"json",delay:n.delay,data:function(e){return{_wpnonce:n._wpnonce,action:"pods_relationship",method:"select2",pod:n.pod,field:n.field,uri:n.uri,id:n.id,query:e.term}},processResults:function(e,i){return t.filterAjaxList(e,i)}}}),l.selectWoo(jQuery.extend(!0,e,o)),(r=l.parent().find("ul.select2-selection__rendered")).sortable({containment:"parent"}),r.on("sortstop",function(){var e=r.find(".select2-selection__choice").get().reverse();jQuery(e).each(function(){var e=jQuery(this).data("data").id,i=l.find('option[value="'+e+'"]')[0];l.prepend(i)})})}}),O=r.extend({childViewEventPrefix:!1,tagName:"li",className:"pods-dfv-list-item pods-relationship",template:_.template('<input\r\n\t\t<% if ( \'single\' === fieldConfig.pick_format_type ) { %>\r\n\t\t\tname="<%- htmlAttr.name %>" id="<%- htmlAttr.id %>"\r\n\t\t<% } else { %>\r\n\t\t\tname="<%- htmlAttr.name %>[<%= ordinal %>]" id="<%- htmlAttr.id %><%= ordinal %>"\r\n\t\t<% } %>\r\n\t\tdata-name-clean="<%- htmlAttr.name_clean %>" type="hidden" value="<%- id %>">\r\n<ul class="pods-dfv-list-meta relationship-item">\r\n\t<% if ( 1 != fieldConfig.pick_limit ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-handle"><span><%- PodsI18n.__( \'Reorder\' ) %></span></li>\r\n\t<% } %>\r\n\t<% if ( 1 == fieldConfig.pick_show_icon ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-icon">\r\n\t\t\t<% if ( \'\' == icon ) { %>\r\n\t\t\t\t<% if ( /^dashicons/.test( fieldConfig.default_icon ) ) { %>\r\n\t\t\t\t\t<span class="pinkynail dashicons <%- fieldConfig.default_icon %>"></span>\r\n\t\t\t\t<% } else { %>\r\n\t\t\t\t\t<img class="pinkynail" src="<%- fieldConfig.default_icon %>" alt="Icon">\r\n\t\t\t\t<% } %>\r\n\t\t\t<% } else { %>\r\n\t\t\t\t<% if ( /^dashicons/.test( icon ) ) { %>\r\n\t\t\t\t\t<span class="pinkynail dashicons <%- icon %>"></span>\r\n\t\t\t\t<% } else { %>\r\n\t\t\t\t\t<img class="pinkynail" src="<%- icon %>" alt="Icon">\r\n\t\t\t\t<% } %>\r\n\t\t\t<% } %>\r\n\t\t</li>\r\n\t<% } %>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-name">\r\n\t\t<%= name %>\r\n\t</li>\r\n\t<li class="pods-dfv-list-col pods-dfv-list-remove"><a href="#remove" title="<%- PodsI18n.__( \'Deselect\' ) %>"><%- PodsI18n.__( \'Deselect\' ) %></a></li>\r\n\t<% if ( 1 == fieldConfig.pick_show_view_link && \'\' != link ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-link"><a href="<%- link %>" title="<%- PodsI18n.__( \'View\' ) %>" target="_blank" rel="noopener noreferrer"><%- PodsI18n.__( \'View\' ) %></a></li>\r\n\t<% } %>\r\n\t<% if ( 1 == fieldConfig.pick_show_edit_link && \'\' != edit_link ) { %>\r\n\t\t<li class="pods-dfv-list-col pods-dfv-list-edit"><a href="<%- edit_link %>" title="<%- PodsI18n.__( \'Edit\' ) %>" target="_blank" rel="noopener noreferrer"><%- PodsI18n.__( \'Edit\' ) %></a></li>\r\n\t<% } %>\r\n</ul>\r\n'),ui:{removeButton:".pods-dfv-list-remove a",editButton:".pods-dfv-list-edit a"},triggers:{"click @ui.removeButton":"remove:item:click","click @ui.editButton":"edit:item:click"},templateContext:function(){return{ordinal:this.model.collection.indexOf(this.model)}}}),U=a.extend({childViewEventPrefix:!1,tagName:"ul",className:"pods-dfv-list pods-relationship",childView:O,childViewTriggers:{"remove:item:click":"childview:remove:item:click","edit:item:click":"childview:edit:item:click"},filter:function(e,i,t){return e.attributes.selected},onAttach:function(){1!==this.options.fieldModel.get("fieldConfig").pick_limit&&this.$el.sortable({containment:"parent",axis:"y",scrollSensitivity:40,tolerance:"pointer",opacity:.6})}}),F="button-disabled",R=r.extend({childViewEventPrefix:!1,tagName:"div",className:"podsform-dfv-list-relationship-container",ui:{addButton:"a.pods-related-add-new"},template:_.template('<a href="/wp-admin/?pods_modal=1" class="button pods-related-add-new pods-modal" data-pod-id="<%- fieldConfig.pod_id %>" data-field-id="<%- fieldConfig.id %>" data-item-id="<%- fieldConfig.item_id %>">\r\n\t<%- PodsI18n.__( \'Add New\' ) %>\r\n</a>'),triggers:{"click @ui.addButton":"add:new:click"},disable:function(){this.getUI("addButton").addClass(F)},enable:function(){this.getUI("addButton").removeClass(F)},onAddNewClick:function(){this.getUI("addButton").hasClass(F)||this.trigger("childview:add:new",this)}}),D={checkbox:I,select:B,select2:B,radio:j,list:U},Q=void 0,$=c.extend({childViewEventPrefix:!1,template:_.template('<%if ( fieldConfig.view_name === \'list\' ) { %>\r\n\t<div class="pods-ui-list-autocomplete"></div>\r\n<% } %>\r\n\r\n<div class="pods-pick-values"></div>\r\n\r\n<% if ( fieldConfig.iframe_src != \'\' ) { %>\r\n\t<div class="pods-ui-add-new"></div>\r\n<% } %>'),regions:{autocomplete:".pods-ui-list-autocomplete",list:".pods-pick-values",addNew:".pods-ui-add-new"},childViewEvents:{"childview:remove:item:click":"onChildviewRemoveItemClick","childview:edit:item:click":"onChildviewEditItemClick","childview:selection:limit:over":"onChildviewSelectionLimitOver","childview:selection:limit:under":"onChildviewSelectionLimitUnder","childview:change:selected":"onChildviewChangeSelected","childview:add:new":"onChildviewAddNew"},onBeforeRender:function(){void 0===this.collection&&(this.collection=new M(this.fieldItemData))},onRender:function(){this.fieldConfig=new A(this.model.get("fieldConfig")),""!==this.fieldConfig.get("iframe_src")&&1==this.fieldConfig.get("pick_allow_add_new")&&this.showAddNew(),"list"===this.fieldConfig.get("view_name")&&this.buildAutocomplete(),this.showList()},buildAutocomplete:function(){var e,i,t=void 0,l=void 0,n=+this.fieldConfig.get("pick_limit");t={view_name:"select2",pick_format_type:"multi",selectFromExisting:!0,ajax_data:this.fieldConfig.get("ajax_data"),select2_overrides:this.fieldConfig.get("select2_overrides"),label:this.fieldConfig.get("label"),pick_limit:n},this.collection.filterBySelected().length>=n&&0!==n?(t.limitDisable=!0,this.onChildviewSelectionLimitOver()):this.onChildviewSelectionLimitUnder(),e=new o({fieldConfig:t}),i=this.collection.filterByUnselected(),(l=new B({collection:i,fieldModel:e})).filterAjaxList=this.filterAjaxList.bind(this),this.showChildView("autocomplete",l)},showList:function(){var e,i;if(e=this.fieldConfig.get("view_name"),void 0===D[e])throw new Error('Invalid view name "'+e+'"');i=new D[e]({collection:this.collection,fieldModel:this.model}),this.showChildView("list",i)},showAddNew:function(){var e=new R({fieldModel:this.model});this.showChildView("addNew",e)},filterAjaxList:function(e){var i=this.collection.filterBySelected(),t=[];return _.each(e.results,function(e){e.text=e.name,i.get(e.id)||t.push(e)}),this.collection.add(t),this.getChildView("autocomplete").setCollection(this.collection.filterByUnselected()),{results:t}},onChildviewSelectionLimitOver:function(e){var i=this.getChildView("addNew");i&&i.disable()},onChildviewSelectionLimitUnder:function(e){var i=this.getChildView("addNew");i&&i.enable()},onChildviewRemoveItemClick:function(e){e.model.toggleSelected(),this.getChildView("list").render(),"list"===this.fieldConfig.get("view_name")&&this.buildAutocomplete()},onChildviewAddNew:function(e){var i=this.model.get("fieldConfig");Q=new P({title:i.iframe_title_add,src:i.iframe_src}),this.setModalListeners(),Q.modal.open()},onChildviewEditItemClick:function(e){var i=this.model.get("fieldConfig");Q=new P({title:i.iframe_title_edit,src:e.ui.editButton.attr("href")}),this.setModalListeners(),Q.modal.open()},onChildviewChangeSelected:function(e){e.fieldConfig.selectFromExisting&&(_.defer(this.buildAutocomplete.bind(this)),this.getChildView("list").render())},setModalListeners:function(){jQuery(window).on("dfv:modal:update",this.modalSuccess.bind(this)),jQuery(window).on("dfv:modal:cancel",this.modalCancel.bind(this))},clearModalListeners:function(){jQuery(window).off("dfv:modal:update"),jQuery(window).off("dfv:modal:cancel")},modalSuccess:function(e,i){var t=this.collection.get(i.id);t?(t.set(i),this.getChildView("list").render()):this.collection.add(i),this.clearModalListeners(),Q.modal.close({})},modalCancel:function(){this.clearModalListeners()}}),z={file:y,avatar:y,pick:$},T={fields:Object.freeze({FileUpload:y,Pick:$}),models:Object.freeze({PodsDFVFieldModel:o,RelationshipModel:S,RelationshipCollection:M,FileUploadModel:f,FileUploadCollection:h}),fieldInstances:{},init:function(){var l=this;jQuery(".pods-form-ui-field").each(function(){var e=void 0,i=void 0,t={fieldType:void 0};jQuery(this).find("script.pods-dfv-field-data").each(function(){var e=jQuery.parseJSON(jQuery(this).html());jQuery(this).parents(".media-modal-content").length&&(e.fieldConfig.pick_allow_add_new=0),jQuery.extend(t,e),jQuery(this).remove()}),void 0!==t.fieldType&&void 0!==(e=z[t.fieldType])&&((i=new e({el:this,model:new o({htmlAttr:t.htmlAttr,fieldConfig:t.fieldConfig}),fieldItemData:t.fieldItemData})).render(),jQuery(this).trigger("render"),l.fieldInstances[t.htmlAttr.id]=i)})},isModalWindow:function(){return-1!==location.search.indexOf("pods_modal=")},isGutenbergEditorLoaded:function(){return void 0!==wp.data&&void 0!==wp.data.select("core/editor")}};return document.addEventListener("DOMContentLoaded",function(){T.init(),T.isModalWindow()&&T.isGutenbergEditorLoaded()&&i()}),T}();
|
ui/js/qtip/jquery.qtip.css
ADDED
@@ -0,0 +1,617 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* qTip2 - Pretty powerful tooltips - v3.0.3
|
3 |
+
* http://qtip2.com
|
4 |
+
*
|
5 |
+
* Copyright (c) 2016
|
6 |
+
* Released under the MIT licenses
|
7 |
+
* http://jquery.org/license
|
8 |
+
*
|
9 |
+
* Date: Wed May 11 2016 10:31 GMT+0100+0100
|
10 |
+
* Plugins: tips modal viewport svg imagemap ie6
|
11 |
+
* Styles: core basic css3
|
12 |
+
*/
|
13 |
+
.qtip{
|
14 |
+
position: absolute;
|
15 |
+
left: -28000px;
|
16 |
+
top: -28000px;
|
17 |
+
display: none;
|
18 |
+
|
19 |
+
max-width: 280px;
|
20 |
+
min-width: 50px;
|
21 |
+
|
22 |
+
font-size: 10.5px;
|
23 |
+
line-height: 12px;
|
24 |
+
|
25 |
+
direction: ltr;
|
26 |
+
|
27 |
+
box-shadow: none;
|
28 |
+
padding: 0;
|
29 |
+
}
|
30 |
+
|
31 |
+
.qtip-content{
|
32 |
+
position: relative;
|
33 |
+
padding: 5px 9px;
|
34 |
+
overflow: hidden;
|
35 |
+
|
36 |
+
text-align: left;
|
37 |
+
word-wrap: break-word;
|
38 |
+
}
|
39 |
+
|
40 |
+
.qtip-titlebar{
|
41 |
+
position: relative;
|
42 |
+
padding: 5px 35px 5px 10px;
|
43 |
+
overflow: hidden;
|
44 |
+
|
45 |
+
border-width: 0 0 1px;
|
46 |
+
font-weight: bold;
|
47 |
+
}
|
48 |
+
|
49 |
+
.qtip-titlebar + .qtip-content{ border-top-width: 0 !important; }
|
50 |
+
|
51 |
+
/* Default close button class */
|
52 |
+
.qtip-close{
|
53 |
+
position: absolute;
|
54 |
+
right: -9px; top: -9px;
|
55 |
+
z-index: 11; /* Overlap .qtip-tip */
|
56 |
+
|
57 |
+
cursor: pointer;
|
58 |
+
outline: medium none;
|
59 |
+
|
60 |
+
border: 1px solid transparent;
|
61 |
+
}
|
62 |
+
|
63 |
+
.qtip-titlebar .qtip-close{
|
64 |
+
right: 4px; top: 50%;
|
65 |
+
margin-top: -9px;
|
66 |
+
}
|
67 |
+
|
68 |
+
* html .qtip-titlebar .qtip-close{ top: 16px; } /* IE fix */
|
69 |
+
|
70 |
+
.qtip-titlebar .ui-icon,
|
71 |
+
.qtip-icon .ui-icon{
|
72 |
+
display: block;
|
73 |
+
text-indent: -1000em;
|
74 |
+
direction: ltr;
|
75 |
+
}
|
76 |
+
|
77 |
+
.qtip-icon, .qtip-icon .ui-icon{
|
78 |
+
-moz-border-radius: 3px;
|
79 |
+
-webkit-border-radius: 3px;
|
80 |
+
border-radius: 3px;
|
81 |
+
text-decoration: none;
|
82 |
+
}
|
83 |
+
|
84 |
+
.qtip-icon .ui-icon{
|
85 |
+
width: 18px;
|
86 |
+
height: 14px;
|
87 |
+
|
88 |
+
line-height: 14px;
|
89 |
+
text-align: center;
|
90 |
+
text-indent: 0;
|
91 |
+
font: normal bold 10px/13px Tahoma,sans-serif;
|
92 |
+
|
93 |
+
color: inherit;
|
94 |
+
background: transparent none no-repeat -100em -100em;
|
95 |
+
}
|
96 |
+
|
97 |
+
/* Applied to 'focused' tooltips e.g. most recently displayed/interacted with */
|
98 |
+
.qtip-focus{}
|
99 |
+
|
100 |
+
/* Applied on hover of tooltips i.e. added/removed on mouseenter/mouseleave respectively */
|
101 |
+
.qtip-hover{}
|
102 |
+
|
103 |
+
/* Default tooltip style */
|
104 |
+
.qtip-default{
|
105 |
+
border: 1px solid #F1D031;
|
106 |
+
|
107 |
+
background-color: #FFFFA3;
|
108 |
+
color: #555;
|
109 |
+
}
|
110 |
+
|
111 |
+
.qtip-default .qtip-titlebar{
|
112 |
+
background-color: #FFEF93;
|
113 |
+
}
|
114 |
+
|
115 |
+
.qtip-default .qtip-icon{
|
116 |
+
border-color: #CCC;
|
117 |
+
background: #F1F1F1;
|
118 |
+
color: #777;
|
119 |
+
}
|
120 |
+
|
121 |
+
.qtip-default .qtip-titlebar .qtip-close{
|
122 |
+
border-color: #AAA;
|
123 |
+
color: #111;
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
/*! Light tooltip style */
|
128 |
+
.qtip-light{
|
129 |
+
background-color: white;
|
130 |
+
border-color: #E2E2E2;
|
131 |
+
color: #454545;
|
132 |
+
}
|
133 |
+
|
134 |
+
.qtip-light .qtip-titlebar{
|
135 |
+
background-color: #f1f1f1;
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
/*! Dark tooltip style */
|
140 |
+
.qtip-dark{
|
141 |
+
background-color: #505050;
|
142 |
+
border-color: #303030;
|
143 |
+
color: #f3f3f3;
|
144 |
+
}
|
145 |
+
|
146 |
+
.qtip-dark .qtip-titlebar{
|
147 |
+
background-color: #404040;
|
148 |
+
}
|
149 |
+
|
150 |
+
.qtip-dark .qtip-icon{
|
151 |
+
border-color: #444;
|
152 |
+
}
|
153 |
+
|
154 |
+
.qtip-dark .qtip-titlebar .ui-state-hover{
|
155 |
+
border-color: #303030;
|
156 |
+
}
|
157 |
+
|
158 |
+
|
159 |
+
/*! Cream tooltip style */
|
160 |
+
.qtip-cream{
|
161 |
+
background-color: #FBF7AA;
|
162 |
+
border-color: #F9E98E;
|
163 |
+
color: #A27D35;
|
164 |
+
}
|
165 |
+
|
166 |
+
.qtip-cream .qtip-titlebar{
|
167 |
+
background-color: #F0DE7D;
|
168 |
+
}
|
169 |
+
|
170 |
+
.qtip-cream .qtip-close .qtip-icon{
|
171 |
+
background-position: -82px 0;
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
+
/*! Red tooltip style */
|
176 |
+
.qtip-red{
|
177 |
+
background-color: #F78B83;
|
178 |
+
border-color: #D95252;
|
179 |
+
color: #912323;
|
180 |
+
}
|
181 |
+
|
182 |
+
.qtip-red .qtip-titlebar{
|
183 |
+
background-color: #F06D65;
|
184 |
+
}
|
185 |
+
|
186 |
+
.qtip-red .qtip-close .qtip-icon{
|
187 |
+
background-position: -102px 0;
|
188 |
+
}
|
189 |
+
|
190 |
+
.qtip-red .qtip-icon{
|
191 |
+
border-color: #D95252;
|
192 |
+
}
|
193 |
+
|
194 |
+
.qtip-red .qtip-titlebar .ui-state-hover{
|
195 |
+
border-color: #D95252;
|
196 |
+
}
|
197 |
+
|
198 |
+
|
199 |
+
/*! Green tooltip style */
|
200 |
+
.qtip-green{
|
201 |
+
background-color: #CAED9E;
|
202 |
+
border-color: #90D93F;
|
203 |
+
color: #3F6219;
|
204 |
+
}
|
205 |
+
|
206 |
+
.qtip-green .qtip-titlebar{
|
207 |
+
background-color: #B0DE78;
|
208 |
+
}
|
209 |
+
|
210 |
+
.qtip-green .qtip-close .qtip-icon{
|
211 |
+
background-position: -42px 0;
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
/*! Blue tooltip style */
|
216 |
+
.qtip-blue{
|
217 |
+
background-color: #E5F6FE;
|
218 |
+
border-color: #ADD9ED;
|
219 |
+
color: #5E99BD;
|
220 |
+
}
|
221 |
+
|
222 |
+
.qtip-blue .qtip-titlebar{
|
223 |
+
background-color: #D0E9F5;
|
224 |
+
}
|
225 |
+
|
226 |
+
.qtip-blue .qtip-close .qtip-icon{
|
227 |
+
background-position: -2px 0;
|
228 |
+
}
|
229 |
+
|
230 |
+
|
231 |
+
.qtip-shadow{
|
232 |
+
-webkit-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
233 |
+
-moz-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
234 |
+
box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15);
|
235 |
+
}
|
236 |
+
|
237 |
+
/* Add rounded corners to your tooltips in: FF3+, Chrome 2+, Opera 10.6+, IE9+, Safari 2+ */
|
238 |
+
.qtip-rounded,
|
239 |
+
.qtip-tipsy,
|
240 |
+
.qtip-bootstrap{
|
241 |
+
-moz-border-radius: 5px;
|
242 |
+
-webkit-border-radius: 5px;
|
243 |
+
border-radius: 5px;
|
244 |
+
}
|
245 |
+
|
246 |
+
.qtip-rounded .qtip-titlebar{
|
247 |
+
-moz-border-radius: 4px 4px 0 0;
|
248 |
+
-webkit-border-radius: 4px 4px 0 0;
|
249 |
+
border-radius: 4px 4px 0 0;
|
250 |
+
}
|
251 |
+
|
252 |
+
/* Youtube tooltip style */
|
253 |
+
.qtip-youtube{
|
254 |
+
-moz-border-radius: 2px;
|
255 |
+
-webkit-border-radius: 2px;
|
256 |
+
border-radius: 2px;
|
257 |
+
|
258 |
+
-webkit-box-shadow: 0 0 3px #333;
|
259 |
+
-moz-box-shadow: 0 0 3px #333;
|
260 |
+
box-shadow: 0 0 3px #333;
|
261 |
+
|
262 |
+
color: white;
|
263 |
+
border: 0 solid transparent;
|
264 |
+
|
265 |
+
background: #4A4A4A;
|
266 |
+
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,black));
|
267 |
+
background-image: -webkit-linear-gradient(top,#4A4A4A 0,black 100%);
|
268 |
+
background-image: -moz-linear-gradient(top,#4A4A4A 0,black 100%);
|
269 |
+
background-image: -ms-linear-gradient(top,#4A4A4A 0,black 100%);
|
270 |
+
background-image: -o-linear-gradient(top,#4A4A4A 0,black 100%);
|
271 |
+
}
|
272 |
+
|
273 |
+
.qtip-youtube .qtip-titlebar{
|
274 |
+
background-color: #4A4A4A;
|
275 |
+
background-color: rgba(0,0,0,0);
|
276 |
+
}
|
277 |
+
|
278 |
+
.qtip-youtube .qtip-content{
|
279 |
+
padding: .75em;
|
280 |
+
font: 12px arial,sans-serif;
|
281 |
+
|
282 |
+
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);
|
283 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);";
|
284 |
+
}
|
285 |
+
|
286 |
+
.qtip-youtube .qtip-icon{
|
287 |
+
border-color: #222;
|
288 |
+
}
|
289 |
+
|
290 |
+
.qtip-youtube .qtip-titlebar .ui-state-hover{
|
291 |
+
border-color: #303030;
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
/* jQuery TOOLS Tooltip style */
|
296 |
+
.qtip-jtools{
|
297 |
+
background: #232323;
|
298 |
+
background: rgba(0, 0, 0, 0.7);
|
299 |
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#717171), to(#232323));
|
300 |
+
background-image: -moz-linear-gradient(top, #717171, #232323);
|
301 |
+
background-image: -webkit-linear-gradient(top, #717171, #232323);
|
302 |
+
background-image: -ms-linear-gradient(top, #717171, #232323);
|
303 |
+
background-image: -o-linear-gradient(top, #717171, #232323);
|
304 |
+
|
305 |
+
border: 2px solid #ddd;
|
306 |
+
border: 2px solid rgba(241,241,241,1);
|
307 |
+
|
308 |
+
-moz-border-radius: 2px;
|
309 |
+
-webkit-border-radius: 2px;
|
310 |
+
border-radius: 2px;
|
311 |
+
|
312 |
+
-webkit-box-shadow: 0 0 12px #333;
|
313 |
+
-moz-box-shadow: 0 0 12px #333;
|
314 |
+
box-shadow: 0 0 12px #333;
|
315 |
+
}
|
316 |
+
|
317 |
+
/* IE Specific */
|
318 |
+
.qtip-jtools .qtip-titlebar{
|
319 |
+
background-color: transparent;
|
320 |
+
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A);
|
321 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)";
|
322 |
+
}
|
323 |
+
.qtip-jtools .qtip-content{
|
324 |
+
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323);
|
325 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)";
|
326 |
+
}
|
327 |
+
|
328 |
+
.qtip-jtools .qtip-titlebar,
|
329 |
+
.qtip-jtools .qtip-content{
|
330 |
+
background: transparent;
|
331 |
+
color: white;
|
332 |
+
border: 0 dashed transparent;
|
333 |
+
}
|
334 |
+
|
335 |
+
.qtip-jtools .qtip-icon{
|
336 |
+
border-color: #555;
|
337 |
+
}
|
338 |
+
|
339 |
+
.qtip-jtools .qtip-titlebar .ui-state-hover{
|
340 |
+
border-color: #333;
|
341 |
+
}
|
342 |
+
|
343 |
+
|
344 |
+
/* Cluetip style */
|
345 |
+
.qtip-cluetip{
|
346 |
+
-webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
|
347 |
+
-moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
|
348 |
+
box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
|
349 |
+
|
350 |
+
background-color: #D9D9C2;
|
351 |
+
color: #111;
|
352 |
+
border: 0 dashed transparent;
|
353 |
+
}
|
354 |
+
|
355 |
+
.qtip-cluetip .qtip-titlebar{
|
356 |
+
background-color: #87876A;
|
357 |
+
color: white;
|
358 |
+
border: 0 dashed transparent;
|
359 |
+
}
|
360 |
+
|
361 |
+
.qtip-cluetip .qtip-icon{
|
362 |
+
border-color: #808064;
|
363 |
+
}
|
364 |
+
|
365 |
+
.qtip-cluetip .qtip-titlebar .ui-state-hover{
|
366 |
+
border-color: #696952;
|
367 |
+
color: #696952;
|
368 |
+
}
|
369 |
+
|
370 |
+
|
371 |
+
/* Tipsy style */
|
372 |
+
.qtip-tipsy{
|
373 |
+
background: black;
|
374 |
+
background: rgba(0, 0, 0, .87);
|
375 |
+
|
376 |
+
color: white;
|
377 |
+
border: 0 solid transparent;
|
378 |
+
|
379 |
+
font-size: 11px;
|
380 |
+
font-family: 'Lucida Grande', sans-serif;
|
381 |
+
font-weight: bold;
|
382 |
+
line-height: 16px;
|
383 |
+
text-shadow: 0 1px black;
|
384 |
+
}
|
385 |
+
|
386 |
+
.qtip-tipsy .qtip-titlebar{
|
387 |
+
padding: 6px 35px 0 10px;
|
388 |
+
background-color: transparent;
|
389 |
+
}
|
390 |
+
|
391 |
+
.qtip-tipsy .qtip-content{
|
392 |
+
padding: 6px 10px;
|
393 |
+
}
|
394 |
+
|
395 |
+
.qtip-tipsy .qtip-icon{
|
396 |
+
border-color: #222;
|
397 |
+
text-shadow: none;
|
398 |
+
}
|
399 |
+
|
400 |
+
.qtip-tipsy .qtip-titlebar .ui-state-hover{
|
401 |
+
border-color: #303030;
|
402 |
+
}
|
403 |
+
|
404 |
+
|
405 |
+
/* Tipped style */
|
406 |
+
.qtip-tipped{
|
407 |
+
border: 3px solid #959FA9;
|
408 |
+
|
409 |
+
-moz-border-radius: 3px;
|
410 |
+
-webkit-border-radius: 3px;
|
411 |
+
border-radius: 3px;
|
412 |
+
|
413 |
+
background-color: #F9F9F9;
|
414 |
+
color: #454545;
|
415 |
+
|
416 |
+
font-weight: normal;
|
417 |
+
font-family: serif;
|
418 |
+
}
|
419 |
+
|
420 |
+
.qtip-tipped .qtip-titlebar{
|
421 |
+
border-bottom-width: 0;
|
422 |
+
|
423 |
+
color: white;
|
424 |
+
background: #3A79B8;
|
425 |
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#3A79B8), to(#2E629D));
|
426 |
+
background-image: -webkit-linear-gradient(top, #3A79B8, #2E629D);
|
427 |
+
background-image: -moz-linear-gradient(top, #3A79B8, #2E629D);
|
428 |
+
background-image: -ms-linear-gradient(top, #3A79B8, #2E629D);
|
429 |
+
background-image: -o-linear-gradient(top, #3A79B8, #2E629D);
|
430 |
+
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D);
|
431 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)";
|
432 |
+
}
|
433 |
+
|
434 |
+
.qtip-tipped .qtip-icon{
|
435 |
+
border: 2px solid #285589;
|
436 |
+
background: #285589;
|
437 |
+
}
|
438 |
+
|
439 |
+
.qtip-tipped .qtip-icon .ui-icon{
|
440 |
+
background-color: #FBFBFB;
|
441 |
+
color: #555;
|
442 |
+
}
|
443 |
+
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Twitter Bootstrap style.
|
447 |
+
*
|
448 |
+
* Tested with IE 8, IE 9, Chrome 18, Firefox 9, Opera 11.
|
449 |
+
* Does not work with IE 7.
|
450 |
+
*/
|
451 |
+
.qtip-bootstrap{
|
452 |
+
/** Taken from Bootstrap body */
|
453 |
+
font-size: 14px;
|
454 |
+
line-height: 20px;
|
455 |
+
color: #333333;
|
456 |
+
|
457 |
+
/** Taken from Bootstrap .popover */
|
458 |
+
padding: 1px;
|
459 |
+
background-color: #ffffff;
|
460 |
+
border: 1px solid #ccc;
|
461 |
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
462 |
+
-webkit-border-radius: 6px;
|
463 |
+
-moz-border-radius: 6px;
|
464 |
+
border-radius: 6px;
|
465 |
+
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
466 |
+
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
467 |
+
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
468 |
+
-webkit-background-clip: padding-box;
|
469 |
+
-moz-background-clip: padding;
|
470 |
+
background-clip: padding-box;
|
471 |
+
}
|
472 |
+
|
473 |
+
.qtip-bootstrap .qtip-titlebar{
|
474 |
+
/** Taken from Bootstrap .popover-title */
|
475 |
+
padding: 8px 14px;
|
476 |
+
margin: 0;
|
477 |
+
font-size: 14px;
|
478 |
+
font-weight: normal;
|
479 |
+
line-height: 18px;
|
480 |
+
background-color: #f7f7f7;
|
481 |
+
border-bottom: 1px solid #ebebeb;
|
482 |
+
-webkit-border-radius: 5px 5px 0 0;
|
483 |
+
-moz-border-radius: 5px 5px 0 0;
|
484 |
+
border-radius: 5px 5px 0 0;
|
485 |
+
}
|
486 |
+
|
487 |
+
.qtip-bootstrap .qtip-titlebar .qtip-close{
|
488 |
+
/**
|
489 |
+
* Overrides qTip2:
|
490 |
+
* .qtip-titlebar .qtip-close{
|
491 |
+
* [...]
|
492 |
+
* right: 4px;
|
493 |
+
* top: 50%;
|
494 |
+
* [...]
|
495 |
+
* border-style: solid;
|
496 |
+
* }
|
497 |
+
*/
|
498 |
+
right: 11px;
|
499 |
+
top: 45%;
|
500 |
+
border-style: none;
|
501 |
+
}
|
502 |
+
|
503 |
+
.qtip-bootstrap .qtip-content{
|
504 |
+
/** Taken from Bootstrap .popover-content */
|
505 |
+
padding: 9px 14px;
|
506 |
+
}
|
507 |
+
|
508 |
+
.qtip-bootstrap .qtip-icon{
|
509 |
+
/**
|
510 |
+
* Overrides qTip2:
|
511 |
+
* .qtip-default .qtip-icon {
|
512 |
+
* border-color: #CCC;
|
513 |
+
* background: #F1F1F1;
|
514 |
+
* color: #777;
|
515 |
+
* }
|
516 |
+
*/
|
517 |
+
background: transparent;
|
518 |
+
}
|
519 |
+
|
520 |
+
.qtip-bootstrap .qtip-icon .ui-icon{
|
521 |
+
/**
|
522 |
+
* Overrides qTip2:
|
523 |
+
* .qtip-icon .ui-icon{
|
524 |
+
* width: 18px;
|
525 |
+
* height: 14px;
|
526 |
+
* }
|
527 |
+
*/
|
528 |
+
width: auto;
|
529 |
+
height: auto;
|
530 |
+
|
531 |
+
/* Taken from Bootstrap .close */
|
532 |
+
float: right;
|
533 |
+
font-size: 20px;
|
534 |
+
font-weight: bold;
|
535 |
+
line-height: 18px;
|
536 |
+
color: #000000;
|
537 |
+
text-shadow: 0 1px 0 #ffffff;
|
538 |
+
opacity: 0.2;
|
539 |
+
filter: alpha(opacity=20);
|
540 |
+
}
|
541 |
+
|
542 |
+
.qtip-bootstrap .qtip-icon .ui-icon:hover{
|
543 |
+
/* Taken from Bootstrap .close:hover */
|
544 |
+
color: #000000;
|
545 |
+
text-decoration: none;
|
546 |
+
cursor: pointer;
|
547 |
+
opacity: 0.4;
|
548 |
+
filter: alpha(opacity=40);
|
549 |
+
}
|
550 |
+
|
551 |
+
|
552 |
+
/* IE9 fix - removes all filters */
|
553 |
+
.qtip:not(.ie9haxors) div.qtip-content,
|
554 |
+
.qtip:not(.ie9haxors) div.qtip-titlebar{
|
555 |
+
filter: none;
|
556 |
+
-ms-filter: none;
|
557 |
+
}
|
558 |
+
|
559 |
+
|
560 |
+
.qtip .qtip-tip{
|
561 |
+
margin: 0 auto;
|
562 |
+
overflow: hidden;
|
563 |
+
z-index: 10;
|
564 |
+
|
565 |
+
}
|
566 |
+
|
567 |
+
/* Opera bug #357 - Incorrect tip position
|
568 |
+
https://github.com/Craga89/qTip2/issues/367 */
|
569 |
+
x:-o-prefocus, .qtip .qtip-tip{
|
570 |
+
visibility: hidden;
|
571 |
+
}
|
572 |
+
|
573 |
+
.qtip .qtip-tip,
|
574 |
+
.qtip .qtip-tip .qtip-vml,
|
575 |
+
.qtip .qtip-tip canvas{
|
576 |
+
position: absolute;
|
577 |
+
|
578 |
+
color: #123456;
|
579 |
+
background: transparent;
|
580 |
+
border: 0 dashed transparent;
|
581 |
+
}
|
582 |
+
|
583 |
+
.qtip .qtip-tip canvas{ top: 0; left: 0; }
|
584 |
+
|
585 |
+
.qtip .qtip-tip .qtip-vml{
|
586 |
+
behavior: url(#default#VML);
|
587 |
+
display: inline-block;
|
588 |
+
visibility: visible;
|
589 |
+
}
|
590 |
+
|
591 |
+
|
592 |
+
#qtip-overlay{
|
593 |
+
position: fixed;
|
594 |
+
left: 0; top: 0;
|
595 |
+
width: 100%; height: 100%;
|
596 |
+
}
|
597 |
+
|
598 |
+
/* Applied to modals with show.modal.blur set to true */
|
599 |
+
#qtip-overlay.blurs{ cursor: pointer; }
|
600 |
+
|
601 |
+
/* Change opacity of overlay here */
|
602 |
+
#qtip-overlay div{
|
603 |
+
position: absolute;
|
604 |
+
left: 0; top: 0;
|
605 |
+
width: 100%; height: 100%;
|
606 |
+
|
607 |
+
background-color: black;
|
608 |
+
|
609 |
+
opacity: 0.7;
|
610 |
+
filter:alpha(opacity=70);
|
611 |
+
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
612 |
+
}
|
613 |
+
|
614 |
+
|
615 |
+
.qtipmodal-ie6fix{
|
616 |
+
position: absolute !important;
|
617 |
+
}
|
ui/js/qtip/jquery.qtip.js
ADDED
@@ -0,0 +1,3487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* qTip2 - Pretty powerful tooltips - v3.0.3
|
3 |
+
* http://qtip2.com
|
4 |
+
*
|
5 |
+
* Copyright (c) 2016
|
6 |
+
* Released under the MIT licenses
|
7 |
+
* http://jquery.org/license
|
8 |
+
*
|
9 |
+
* Date: Wed May 11 2016 10:31 GMT+0100+0100
|
10 |
+
* Plugins: tips modal viewport svg imagemap ie6
|
11 |
+
* Styles: core basic css3
|
12 |
+
*/
|
13 |
+
/*global window: false, jQuery: false, console: false, define: false */
|
14 |
+
|
15 |
+
/* Cache window, document, undefined */
|
16 |
+
(function( window, document, undefined ) {
|
17 |
+
|
18 |
+
// Uses AMD or browser globals to create a jQuery plugin.
|
19 |
+
(function( factory ) {
|
20 |
+
"use strict";
|
21 |
+
if(typeof define === 'function' && define.amd) {
|
22 |
+
define(['jquery'], factory);
|
23 |
+
}
|
24 |
+
else if(jQuery && !jQuery.fn.qtip) {
|
25 |
+
factory(jQuery);
|
26 |
+
}
|
27 |
+
}
|
28 |
+
(function($) {
|
29 |
+
"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
|
30 |
+
;// Munge the primitives - Paul Irish tip
|
31 |
+
var TRUE = true,
|
32 |
+
FALSE = false,
|
33 |
+
NULL = null,
|
34 |
+
|
35 |
+
// Common variables
|
36 |
+
X = 'x', Y = 'y',
|
37 |
+
WIDTH = 'width',
|
38 |
+
HEIGHT = 'height',
|
39 |
+
|
40 |
+
// Positioning sides
|
41 |
+
TOP = 'top',
|
42 |
+
LEFT = 'left',
|
43 |
+
BOTTOM = 'bottom',
|
44 |
+
RIGHT = 'right',
|
45 |
+
CENTER = 'center',
|
46 |
+
|
47 |
+
// Position adjustment types
|
48 |
+
FLIP = 'flip',
|
49 |
+
FLIPINVERT = 'flipinvert',
|
50 |
+
SHIFT = 'shift',
|
51 |
+
|
52 |
+
// Shortcut vars
|
53 |
+
QTIP, PROTOTYPE, CORNER, CHECKS,
|
54 |
+
PLUGINS = {},
|
55 |
+
NAMESPACE = 'qtip',
|
56 |
+
ATTR_HAS = 'data-hasqtip',
|
57 |
+
ATTR_ID = 'data-qtip-id',
|
58 |
+
WIDGET = ['ui-widget', 'ui-tooltip'],
|
59 |
+
SELECTOR = '.'+NAMESPACE,
|
60 |
+
INACTIVE_EVENTS = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '),
|
61 |
+
|
62 |
+
CLASS_FIXED = NAMESPACE+'-fixed',
|
63 |
+
CLASS_DEFAULT = NAMESPACE + '-default',
|
64 |
+
CLASS_FOCUS = NAMESPACE + '-focus',
|
65 |
+
CLASS_HOVER = NAMESPACE + '-hover',
|
66 |
+
CLASS_DISABLED = NAMESPACE+'-disabled',
|
67 |
+
|
68 |
+
replaceSuffix = '_replacedByqTip',
|
69 |
+
oldtitle = 'oldtitle',
|
70 |
+
trackingBound,
|
71 |
+
|
72 |
+
// Browser detection
|
73 |
+
BROWSER = {
|
74 |
+
/*
|
75 |
+
* IE version detection
|
76 |
+
*
|
77 |
+
* Adapted from: http://ajaxian.com/archives/attack-of-the-ie-conditional-comment
|
78 |
+
* Credit to James Padolsey for the original implemntation!
|
79 |
+
*/
|
80 |
+
ie: (function() {
|
81 |
+
/* eslint-disable no-empty */
|
82 |
+
var v, i;
|
83 |
+
for (
|
84 |
+
v = 4, i = document.createElement('div');
|
85 |
+
(i.innerHTML = '<!--[if gt IE ' + v + ']><i></i><![endif]-->') && i.getElementsByTagName('i')[0];
|
86 |
+
v+=1
|
87 |
+
) {}
|
88 |
+
return v > 4 ? v : NaN;
|
89 |
+
/* eslint-enable no-empty */
|
90 |
+
})(),
|
91 |
+
|
92 |
+
/*
|
93 |
+
* iOS version detection
|
94 |
+
*/
|
95 |
+
iOS: parseFloat(
|
96 |
+
('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
|
97 |
+
.replace('undefined', '3_2').replace('_', '.').replace('_', '')
|
98 |
+
) || FALSE
|
99 |
+
};
|
100 |
+
;function QTip(target, options, id, attr) {
|
101 |
+
// Elements and ID
|
102 |
+
this.id = id;
|
103 |
+
this.target = target;
|
104 |
+
this.tooltip = NULL;
|
105 |
+
this.elements = { target: target };
|
106 |
+
|
107 |
+
// Internal constructs
|
108 |
+
this._id = NAMESPACE + '-' + id;
|
109 |
+
this.timers = { img: {} };
|
110 |
+
this.options = options;
|
111 |
+
this.plugins = {};
|
112 |
+
|
113 |
+
// Cache object
|
114 |
+
this.cache = {
|
115 |
+
event: {},
|
116 |
+
target: $(),
|
117 |
+
disabled: FALSE,
|
118 |
+
attr: attr,
|
119 |
+
onTooltip: FALSE,
|
120 |
+
lastClass: ''
|
121 |
+
};
|
122 |
+
|
123 |
+
// Set the initial flags
|
124 |
+
this.rendered = this.destroyed = this.disabled = this.waiting =
|
125 |
+
this.hiddenDuringWait = this.positioning = this.triggering = FALSE;
|
126 |
+
}
|
127 |
+
PROTOTYPE = QTip.prototype;
|
128 |
+
|
129 |
+
PROTOTYPE._when = function(deferreds) {
|
130 |
+
return $.when.apply($, deferreds);
|
131 |
+
};
|
132 |
+
|
133 |
+
PROTOTYPE.render = function(show) {
|
134 |
+
if(this.rendered || this.destroyed) { return this; } // If tooltip has already been rendered, exit
|
135 |
+
|
136 |
+
var self = this,
|
137 |
+
options = this.options,
|
138 |
+
cache = this.cache,
|
139 |
+
elements = this.elements,
|
140 |
+
text = options.content.text,
|
141 |
+
title = options.content.title,
|
142 |
+
button = options.content.button,
|
143 |
+
posOptions = options.position,
|
144 |
+
deferreds = [];
|
145 |
+
|
146 |
+
// Add ARIA attributes to target
|
147 |
+
$.attr(this.target[0], 'aria-describedby', this._id);
|
148 |
+
|
149 |
+
// Create public position object that tracks current position corners
|
150 |
+
cache.posClass = this._createPosClass(
|
151 |
+
(this.position = { my: posOptions.my, at: posOptions.at }).my
|
152 |
+
);
|
153 |
+
|
154 |
+
// Create tooltip element
|
155 |
+
this.tooltip = elements.tooltip = $('<div/>', {
|
156 |
+
'id': this._id,
|
157 |
+
'class': [ NAMESPACE, CLASS_DEFAULT, options.style.classes, cache.posClass ].join(' '),
|
158 |
+
'width': options.style.width || '',
|
159 |
+
'height': options.style.height || '',
|
160 |
+
'tracking': posOptions.target === 'mouse' && posOptions.adjust.mouse,
|
161 |
+
|
162 |
+
/* ARIA specific attributes */
|
163 |
+
'role': 'alert',
|
164 |
+
'aria-live': 'polite',
|
165 |
+
'aria-atomic': FALSE,
|
166 |
+
'aria-describedby': this._id + '-content',
|
167 |
+
'aria-hidden': TRUE
|
168 |
+
})
|
169 |
+
.toggleClass(CLASS_DISABLED, this.disabled)
|
170 |
+
.attr(ATTR_ID, this.id)
|
171 |
+
.data(NAMESPACE, this)
|
172 |
+
.appendTo(posOptions.container)
|
173 |
+
.append(
|
174 |
+
// Create content element
|
175 |
+
elements.content = $('<div />', {
|
176 |
+
'class': NAMESPACE + '-content',
|
177 |
+
'id': this._id + '-content',
|
178 |
+
'aria-atomic': TRUE
|
179 |
+
})
|
180 |
+
);
|
181 |
+
|
182 |
+
// Set rendered flag and prevent redundant reposition calls for now
|
183 |
+
this.rendered = -1;
|
184 |
+
this.positioning = TRUE;
|
185 |
+
|
186 |
+
// Create title...
|
187 |
+
if(title) {
|
188 |
+
this._createTitle();
|
189 |
+
|
190 |
+
// Update title only if its not a callback (called in toggle if so)
|
191 |
+
if(!$.isFunction(title)) {
|
192 |
+
deferreds.push( this._updateTitle(title, FALSE) );
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
// Create button
|
197 |
+
if(button) { this._createButton(); }
|
198 |
+
|
199 |
+
// Set proper rendered flag and update content if not a callback function (called in toggle)
|
200 |
+
if(!$.isFunction(text)) {
|
201 |
+
deferreds.push( this._updateContent(text, FALSE) );
|
202 |
+
}
|
203 |
+
this.rendered = TRUE;
|
204 |
+
|
205 |
+
// Setup widget classes
|
206 |
+
this._setWidget();
|
207 |
+
|
208 |
+
// Initialize 'render' plugins
|
209 |
+
$.each(PLUGINS, function(name) {
|
210 |
+
var instance;
|
211 |
+
if(this.initialize === 'render' && (instance = this(self))) {
|
212 |
+
self.plugins[name] = instance;
|
213 |
+
}
|
214 |
+
});
|
215 |
+
|
216 |
+
// Unassign initial events and assign proper events
|
217 |
+
this._unassignEvents();
|
218 |
+
this._assignEvents();
|
219 |
+
|
220 |
+
// When deferreds have completed
|
221 |
+
this._when(deferreds).then(function() {
|
222 |
+
// tooltiprender event
|
223 |
+
self._trigger('render');
|
224 |
+
|
225 |
+
// Reset flags
|
226 |
+
self.positioning = FALSE;
|
227 |
+
|
228 |
+
// Show tooltip if not hidden during wait period
|
229 |
+
if(!self.hiddenDuringWait && (options.show.ready || show)) {
|
230 |
+
self.toggle(TRUE, cache.event, FALSE);
|
231 |
+
}
|
232 |
+
self.hiddenDuringWait = FALSE;
|
233 |
+
});
|
234 |
+
|
235 |
+
// Expose API
|
236 |
+
QTIP.api[this.id] = this;
|
237 |
+
|
238 |
+
return this;
|
239 |
+
};
|
240 |
+
|
241 |
+
PROTOTYPE.destroy = function(immediate) {
|
242 |
+
// Set flag the signify destroy is taking place to plugins
|
243 |
+
// and ensure it only gets destroyed once!
|
244 |
+
if(this.destroyed) { return this.target; }
|
245 |
+
|
246 |
+
function process() {
|
247 |
+
if(this.destroyed) { return; }
|
248 |
+
this.destroyed = TRUE;
|
249 |
+
|
250 |
+
var target = this.target,
|
251 |
+
title = target.attr(oldtitle),
|
252 |
+
timer;
|
253 |
+
|
254 |
+
// Destroy tooltip if rendered
|
255 |
+
if(this.rendered) {
|
256 |
+
this.tooltip.stop(1,0).find('*').remove().end().remove();
|
257 |
+
}
|
258 |
+
|
259 |
+
// Destroy all plugins
|
260 |
+
$.each(this.plugins, function() {
|
261 |
+
this.destroy && this.destroy();
|
262 |
+
});
|
263 |
+
|
264 |
+
// Clear timers
|
265 |
+
for (timer in this.timers) {
|
266 |
+
if (this.timers.hasOwnProperty(timer)) {
|
267 |
+
clearTimeout(this.timers[timer]);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
// Remove api object and ARIA attributes
|
272 |
+
target.removeData(NAMESPACE)
|
273 |
+
.removeAttr(ATTR_ID)
|
274 |
+
.removeAttr(ATTR_HAS)
|
275 |
+
.removeAttr('aria-describedby');
|
276 |
+
|
277 |
+
// Reset old title attribute if removed
|
278 |
+
if(this.options.suppress && title) {
|
279 |
+
target.attr('title', title).removeAttr(oldtitle);
|
280 |
+
}
|
281 |
+
|
282 |
+
// Remove qTip events associated with this API
|
283 |
+
this._unassignEvents();
|
284 |
+
|
285 |
+
// Remove ID from used id objects, and delete object references
|
286 |
+
// for better garbage collection and leak protection
|
287 |
+
this.options = this.elements = this.cache = this.timers =
|
288 |
+
this.plugins = this.mouse = NULL;
|
289 |
+
|
290 |
+
// Delete epoxsed API object
|
291 |
+
delete QTIP.api[this.id];
|
292 |
+
}
|
293 |
+
|
294 |
+
// If an immediate destroy is needed
|
295 |
+
if((immediate !== TRUE || this.triggering === 'hide') && this.rendered) {
|
296 |
+
this.tooltip.one('tooltiphidden', $.proxy(process, this));
|
297 |
+
!this.triggering && this.hide();
|
298 |
+
}
|
299 |
+
|
300 |
+
// If we're not in the process of hiding... process
|
301 |
+
else { process.call(this); }
|
302 |
+
|
303 |
+
return this.target;
|
304 |
+
};
|
305 |
+
;function invalidOpt(a) {
|
306 |
+
return a === NULL || $.type(a) !== 'object';
|
307 |
+
}
|
308 |
+
|
309 |
+
function invalidContent(c) {
|
310 |
+
return !($.isFunction(c) ||
|
311 |
+
c && c.attr ||
|
312 |
+
c.length ||
|
313 |
+
$.type(c) === 'object' && (c.jquery || c.then));
|
314 |
+
}
|
315 |
+
|
316 |
+
// Option object sanitizer
|
317 |
+
function sanitizeOptions(opts) {
|
318 |
+
var content, text, ajax, once;
|
319 |
+
|
320 |
+
if(invalidOpt(opts)) { return FALSE; }
|
321 |
+
|
322 |
+
if(invalidOpt(opts.metadata)) {
|
323 |
+
opts.metadata = { type: opts.metadata };
|
324 |
+
}
|
325 |
+
|
326 |
+
if('content' in opts) {
|
327 |
+
content = opts.content;
|
328 |
+
|
329 |
+
if(invalidOpt(content) || content.jquery || content.done) {
|
330 |
+
text = invalidContent(content) ? FALSE : content;
|
331 |
+
content = opts.content = {
|
332 |
+
text: text
|
333 |
+
};
|
334 |
+
}
|
335 |
+
else { text = content.text; }
|
336 |
+
|
337 |
+
// DEPRECATED - Old content.ajax plugin functionality
|
338 |
+
// Converts it into the proper Deferred syntax
|
339 |
+
if('ajax' in content) {
|
340 |
+
ajax = content.ajax;
|
341 |
+
once = ajax && ajax.once !== FALSE;
|
342 |
+
delete content.ajax;
|
343 |
+
|
344 |
+
content.text = function(event, api) {
|
345 |
+
var loading = text || $(this).attr(api.options.content.attr) || 'Loading...',
|
346 |
+
|
347 |
+
deferred = $.ajax(
|
348 |
+
$.extend({}, ajax, { context: api })
|
349 |
+
)
|
350 |
+
.then(ajax.success, NULL, ajax.error)
|
351 |
+
.then(function(newContent) {
|
352 |
+
if(newContent && once) { api.set('content.text', newContent); }
|
353 |
+
return newContent;
|
354 |
+
},
|
355 |
+
function(xhr, status, error) {
|
356 |
+
if(api.destroyed || xhr.status === 0) { return; }
|
357 |
+
api.set('content.text', status + ': ' + error);
|
358 |
+
});
|
359 |
+
|
360 |
+
return !once ? (api.set('content.text', loading), deferred) : loading;
|
361 |
+
};
|
362 |
+
}
|
363 |
+
|
364 |
+
if('title' in content) {
|
365 |
+
if($.isPlainObject(content.title)) {
|
366 |
+
content.button = content.title.button;
|
367 |
+
content.title = content.title.text;
|
368 |
+
}
|
369 |
+
|
370 |
+
if(invalidContent(content.title || FALSE)) {
|
371 |
+
content.title = FALSE;
|
372 |
+
}
|
373 |
+
}
|
374 |
+
}
|
375 |
+
|
376 |
+
if('position' in opts && invalidOpt(opts.position)) {
|
377 |
+
opts.position = { my: opts.position, at: opts.position };
|
378 |
+
}
|
379 |
+
|
380 |
+
if('show' in opts && invalidOpt(opts.show)) {
|
381 |
+
opts.show = opts.show.jquery ? { target: opts.show } :
|
382 |
+
opts.show === TRUE ? { ready: TRUE } : { event: opts.show };
|
383 |
+
}
|
384 |
+
|
385 |
+
if('hide' in opts && invalidOpt(opts.hide)) {
|
386 |
+
opts.hide = opts.hide.jquery ? { target: opts.hide } : { event: opts.hide };
|
387 |
+
}
|
388 |
+
|
389 |
+
if('style' in opts && invalidOpt(opts.style)) {
|
390 |
+
opts.style = { classes: opts.style };
|
391 |
+
}
|
392 |
+
|
393 |
+
// Sanitize plugin options
|
394 |
+
$.each(PLUGINS, function() {
|
395 |
+
this.sanitize && this.sanitize(opts);
|
396 |
+
});
|
397 |
+
|
398 |
+
return opts;
|
399 |
+
}
|
400 |
+
|
401 |
+
// Setup builtin .set() option checks
|
402 |
+
CHECKS = PROTOTYPE.checks = {
|
403 |
+
builtin: {
|
404 |
+
// Core checks
|
405 |
+
'^id$': function(obj, o, v, prev) {
|
406 |
+
var id = v === TRUE ? QTIP.nextid : v,
|
407 |
+
newId = NAMESPACE + '-' + id;
|
408 |
+
|
409 |
+
if(id !== FALSE && id.length > 0 && !$('#'+newId).length) {
|
410 |
+
this._id = newId;
|
411 |
+
|
412 |
+
if(this.rendered) {
|
413 |
+
this.tooltip[0].id = this._id;
|
414 |
+
this.elements.content[0].id = this._id + '-content';
|
415 |
+
this.elements.title[0].id = this._id + '-title';
|
416 |
+
}
|
417 |
+
}
|
418 |
+
else { obj[o] = prev; }
|
419 |
+
},
|
420 |
+
'^prerender': function(obj, o, v) {
|
421 |
+
v && !this.rendered && this.render(this.options.show.ready);
|
422 |
+
},
|
423 |
+
|
424 |
+
// Content checks
|
425 |
+
'^content.text$': function(obj, o, v) {
|
426 |
+
this._updateContent(v);
|
427 |
+
},
|
428 |
+
'^content.attr$': function(obj, o, v, prev) {
|
429 |
+
if(this.options.content.text === this.target.attr(prev)) {
|
430 |
+
this._updateContent( this.target.attr(v) );
|
431 |
+
}
|
432 |
+
},
|
433 |
+
'^content.title$': function(obj, o, v) {
|
434 |
+
// Remove title if content is null
|
435 |
+
if(!v) { return this._removeTitle(); }
|
436 |
+
|
437 |
+
// If title isn't already created, create it now and update
|
438 |
+
v && !this.elements.title && this._createTitle();
|
439 |
+
this._updateTitle(v);
|
440 |
+
},
|
441 |
+
'^content.button$': function(obj, o, v) {
|
442 |
+
this._updateButton(v);
|
443 |
+
},
|
444 |
+
'^content.title.(text|button)$': function(obj, o, v) {
|
445 |
+
this.set('content.'+o, v); // Backwards title.text/button compat
|
446 |
+
},
|
447 |
+
|
448 |
+
// Position checks
|
449 |
+
'^position.(my|at)$': function(obj, o, v){
|
450 |
+
if('string' === typeof v) {
|
451 |
+
this.position[o] = obj[o] = new CORNER(v, o === 'at');
|
452 |
+
}
|
453 |
+
},
|
454 |
+
'^position.container$': function(obj, o, v){
|
455 |
+
this.rendered && this.tooltip.appendTo(v);
|
456 |
+
},
|
457 |
+
|
458 |
+
// Show checks
|
459 |
+
'^show.ready$': function(obj, o, v) {
|
460 |
+
v && (!this.rendered && this.render(TRUE) || this.toggle(TRUE));
|
461 |
+
},
|
462 |
+
|
463 |
+
// Style checks
|
464 |
+
'^style.classes$': function(obj, o, v, p) {
|
465 |
+
this.rendered && this.tooltip.removeClass(p).addClass(v);
|
466 |
+
},
|
467 |
+
'^style.(width|height)': function(obj, o, v) {
|
468 |
+
this.rendered && this.tooltip.css(o, v);
|
469 |
+
},
|
470 |
+
'^style.widget|content.title': function() {
|
471 |
+
this.rendered && this._setWidget();
|
472 |
+
},
|
473 |
+
'^style.def': function(obj, o, v) {
|
474 |
+
this.rendered && this.tooltip.toggleClass(CLASS_DEFAULT, !!v);
|
475 |
+
},
|
476 |
+
|
477 |
+
// Events check
|
478 |
+
'^events.(render|show|move|hide|focus|blur)$': function(obj, o, v) {
|
479 |
+
this.rendered && this.tooltip[($.isFunction(v) ? '' : 'un') + 'bind']('tooltip'+o, v);
|
480 |
+
},
|
481 |
+
|
482 |
+
// Properties which require event reassignment
|
483 |
+
'^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)': function() {
|
484 |
+
if(!this.rendered) { return; }
|
485 |
+
|
486 |
+
// Set tracking flag
|
487 |
+
var posOptions = this.options.position;
|
488 |
+
this.tooltip.attr('tracking', posOptions.target === 'mouse' && posOptions.adjust.mouse);
|
489 |
+
|
490 |
+
// Reassign events
|
491 |
+
this._unassignEvents();
|
492 |
+
this._assignEvents();
|
493 |
+
}
|
494 |
+
}
|
495 |
+
};
|
496 |
+
|
497 |
+
// Dot notation converter
|
498 |
+
function convertNotation(options, notation) {
|
499 |
+
var i = 0, obj, option = options,
|
500 |
+
|
501 |
+
// Split notation into array
|
502 |
+
levels = notation.split('.');
|
503 |
+
|
504 |
+
// Loop through
|
505 |
+
while(option = option[ levels[i++] ]) {
|
506 |
+
if(i < levels.length) { obj = option; }
|
507 |
+
}
|
508 |
+
|
509 |
+
return [obj || options, levels.pop()];
|
510 |
+
}
|
511 |
+
|
512 |
+
PROTOTYPE.get = function(notation) {
|
513 |
+
if(this.destroyed) { return this; }
|
514 |
+
|
515 |
+
var o = convertNotation(this.options, notation.toLowerCase()),
|
516 |
+
result = o[0][ o[1] ];
|
517 |
+
|
518 |
+
return result.precedance ? result.string() : result;
|
519 |
+
};
|
520 |
+
|
521 |
+
function setCallback(notation, args) {
|
522 |
+
var category, rule, match;
|
523 |
+
|
524 |
+
for(category in this.checks) {
|
525 |
+
if (!this.checks.hasOwnProperty(category)) { continue; }
|
526 |
+
|
527 |
+
for(rule in this.checks[category]) {
|
528 |
+
if (!this.checks[category].hasOwnProperty(rule)) { continue; }
|
529 |
+
|
530 |
+
if(match = (new RegExp(rule, 'i')).exec(notation)) {
|
531 |
+
args.push(match);
|
532 |
+
|
533 |
+
if(category === 'builtin' || this.plugins[category]) {
|
534 |
+
this.checks[category][rule].apply(
|
535 |
+
this.plugins[category] || this, args
|
536 |
+
);
|
537 |
+
}
|
538 |
+
}
|
539 |
+
}
|
540 |
+
}
|
541 |
+
}
|
542 |
+
|
543 |
+
var rmove = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,
|
544 |
+
rrender = /^prerender|show\.ready/i;
|
545 |
+
|
546 |
+
PROTOTYPE.set = function(option, value) {
|
547 |
+
if(this.destroyed) { return this; }
|
548 |
+
|
549 |
+
var rendered = this.rendered,
|
550 |
+
reposition = FALSE,
|
551 |
+
options = this.options,
|
552 |
+
name;
|
553 |
+
|
554 |
+
// Convert singular option/value pair into object form
|
555 |
+
if('string' === typeof option) {
|
556 |
+
name = option; option = {}; option[name] = value;
|
557 |
+
}
|
558 |
+
else { option = $.extend({}, option); }
|
559 |
+
|
560 |
+
// Set all of the defined options to their new values
|
561 |
+
$.each(option, function(notation, val) {
|
562 |
+
if(rendered && rrender.test(notation)) {
|
563 |
+
delete option[notation]; return;
|
564 |
+
}
|
565 |
+
|
566 |
+
// Set new obj value
|
567 |
+
var obj = convertNotation(options, notation.toLowerCase()), previous;
|
568 |
+
previous = obj[0][ obj[1] ];
|
569 |
+
obj[0][ obj[1] ] = val && val.nodeType ? $(val) : val;
|
570 |
+
|
571 |
+
// Also check if we need to reposition
|
572 |
+
reposition = rmove.test(notation) || reposition;
|
573 |
+
|
574 |
+
// Set the new params for the callback
|
575 |
+
option[notation] = [obj[0], obj[1], val, previous];
|
576 |
+
});
|
577 |
+
|
578 |
+
// Re-sanitize options
|
579 |
+
sanitizeOptions(options);
|
580 |
+
|
581 |
+
/*
|
582 |
+
* Execute any valid callbacks for the set options
|
583 |
+
* Also set positioning flag so we don't get loads of redundant repositioning calls.
|
584 |
+
*/
|
585 |
+
this.positioning = TRUE;
|
586 |
+
$.each(option, $.proxy(setCallback, this));
|
587 |
+
this.positioning = FALSE;
|
588 |
+
|
589 |
+
// Update position if needed
|
590 |
+
if(this.rendered && this.tooltip[0].offsetWidth > 0 && reposition) {
|
591 |
+
this.reposition( options.position.target === 'mouse' ? NULL : this.cache.event );
|
592 |
+
}
|
593 |
+
|
594 |
+
return this;
|
595 |
+
};
|
596 |
+
;PROTOTYPE._update = function(content, element) {
|
597 |
+
var self = this,
|
598 |
+
cache = this.cache;
|
599 |
+
|
600 |
+
// Make sure tooltip is rendered and content is defined. If not return
|
601 |
+
if(!this.rendered || !content) { return FALSE; }
|
602 |
+
|
603 |
+
// Use function to parse content
|
604 |
+
if($.isFunction(content)) {
|
605 |
+
content = content.call(this.elements.target, cache.event, this) || '';
|
606 |
+
}
|
607 |
+
|
608 |
+
// Handle deferred content
|
609 |
+
if($.isFunction(content.then)) {
|
610 |
+
cache.waiting = TRUE;
|
611 |
+
return content.then(function(c) {
|
612 |
+
cache.waiting = FALSE;
|
613 |
+
return self._update(c, element);
|
614 |
+
}, NULL, function(e) {
|
615 |
+
return self._update(e, element);
|
616 |
+
});
|
617 |
+
}
|
618 |
+
|
619 |
+
// If content is null... return false
|
620 |
+
if(content === FALSE || !content && content !== '') { return FALSE; }
|
621 |
+
|
622 |
+
// Append new content if its a DOM array and show it if hidden
|
623 |
+
if(content.jquery && content.length > 0) {
|
624 |
+
element.empty().append(
|
625 |
+
content.css({ display: 'block', visibility: 'visible' })
|
626 |
+
);
|
627 |
+
}
|
628 |
+
|
629 |
+
// Content is a regular string, insert the new content
|
630 |
+
else { element.html(content); }
|
631 |
+
|
632 |
+
// Wait for content to be loaded, and reposition
|
633 |
+
return this._waitForContent(element).then(function(images) {
|
634 |
+
if(self.rendered && self.tooltip[0].offsetWidth > 0) {
|
635 |
+
self.reposition(cache.event, !images.length);
|
636 |
+
}
|
637 |
+
});
|
638 |
+
};
|
639 |
+
|
640 |
+
PROTOTYPE._waitForContent = function(element) {
|
641 |
+
var cache = this.cache;
|
642 |
+
|
643 |
+
// Set flag
|
644 |
+
cache.waiting = TRUE;
|
645 |
+
|
646 |
+
// If imagesLoaded is included, ensure images have loaded and return promise
|
647 |
+
return ( $.fn.imagesLoaded ? element.imagesLoaded() : new $.Deferred().resolve([]) )
|
648 |
+
.done(function() { cache.waiting = FALSE; })
|
649 |
+
.promise();
|
650 |
+
};
|
651 |
+
|
652 |
+
PROTOTYPE._updateContent = function(content, reposition) {
|
653 |
+
this._update(content, this.elements.content, reposition);
|
654 |
+
};
|
655 |
+
|
656 |
+
PROTOTYPE._updateTitle = function(content, reposition) {
|
657 |
+
if(this._update(content, this.elements.title, reposition) === FALSE) {
|
658 |
+
this._removeTitle(FALSE);
|
659 |
+
}
|
660 |
+
};
|
661 |
+
|
662 |
+
PROTOTYPE._createTitle = function()
|
663 |
+
{
|
664 |
+
var elements = this.elements,
|
665 |
+
id = this._id+'-title';
|
666 |
+
|
667 |
+
// Destroy previous title element, if present
|
668 |
+
if(elements.titlebar) { this._removeTitle(); }
|
669 |
+
|
670 |
+
// Create title bar and title elements
|
671 |
+
elements.titlebar = $('<div />', {
|
672 |
+
'class': NAMESPACE + '-titlebar ' + (this.options.style.widget ? createWidgetClass('header') : '')
|
673 |
+
})
|
674 |
+
.append(
|
675 |
+
elements.title = $('<div />', {
|
676 |
+
'id': id,
|
677 |
+
'class': NAMESPACE + '-title',
|
678 |
+
'aria-atomic': TRUE
|
679 |
+
})
|
680 |
+
)
|
681 |
+
.insertBefore(elements.content)
|
682 |
+
|
683 |
+
// Button-specific events
|
684 |
+
.delegate('.qtip-close', 'mousedown keydown mouseup keyup mouseout', function(event) {
|
685 |
+
$(this).toggleClass('ui-state-active ui-state-focus', event.type.substr(-4) === 'down');
|
686 |
+
})
|
687 |
+
.delegate('.qtip-close', 'mouseover mouseout', function(event){
|
688 |
+
$(this).toggleClass('ui-state-hover', event.type === 'mouseover');
|
689 |
+
});
|
690 |
+
|
691 |
+
// Create button if enabled
|
692 |
+
if(this.options.content.button) { this._createButton(); }
|
693 |
+
};
|
694 |
+
|
695 |
+
PROTOTYPE._removeTitle = function(reposition)
|
696 |
+
{
|
697 |
+
var elements = this.elements;
|
698 |
+
|
699 |
+
if(elements.title) {
|
700 |
+
elements.titlebar.remove();
|
701 |
+
elements.titlebar = elements.title = elements.button = NULL;
|
702 |
+
|
703 |
+
// Reposition if enabled
|
704 |
+
if(reposition !== FALSE) { this.reposition(); }
|
705 |
+
}
|
706 |
+
};
|
707 |
+
;PROTOTYPE._createPosClass = function(my) {
|
708 |
+
return NAMESPACE + '-pos-' + (my || this.options.position.my).abbrev();
|
709 |
+
};
|
710 |
+
|
711 |
+
PROTOTYPE.reposition = function(event, effect) {
|
712 |
+
if(!this.rendered || this.positioning || this.destroyed) { return this; }
|
713 |
+
|
714 |
+
// Set positioning flag
|
715 |
+
this.positioning = TRUE;
|
716 |
+
|
717 |
+
var cache = this.cache,
|
718 |
+
tooltip = this.tooltip,
|
719 |
+
posOptions = this.options.position,
|
720 |
+
target = posOptions.target,
|
721 |
+
my = posOptions.my,
|
722 |
+
at = posOptions.at,
|
723 |
+
viewport = posOptions.viewport,
|
724 |
+
container = posOptions.container,
|
725 |
+
adjust = posOptions.adjust,
|
726 |
+
method = adjust.method.split(' '),
|
727 |
+
tooltipWidth = tooltip.outerWidth(FALSE),
|
728 |
+
tooltipHeight = tooltip.outerHeight(FALSE),
|
729 |
+
targetWidth = 0,
|
730 |
+
targetHeight = 0,
|
731 |
+
type = tooltip.css('position'),
|
732 |
+
position = { left: 0, top: 0 },
|
733 |
+
visible = tooltip[0].offsetWidth > 0,
|
734 |
+
isScroll = event && event.type === 'scroll',
|
735 |
+
win = $(window),
|
736 |
+
doc = container[0].ownerDocument,
|
737 |
+
mouse = this.mouse,
|
738 |
+
pluginCalculations, offset, adjusted, newClass;
|
739 |
+
|
740 |
+
// Check if absolute position was passed
|
741 |
+
if($.isArray(target) && target.length === 2) {
|
742 |
+
// Force left top and set position
|
743 |
+
at = { x: LEFT, y: TOP };
|
744 |
+
position = { left: target[0], top: target[1] };
|
745 |
+
}
|
746 |
+
|
747 |
+
// Check if mouse was the target
|
748 |
+
else if(target === 'mouse') {
|
749 |
+
// Force left top to allow flipping
|
750 |
+
at = { x: LEFT, y: TOP };
|
751 |
+
|
752 |
+
// Use the mouse origin that caused the show event, if distance hiding is enabled
|
753 |
+
if((!adjust.mouse || this.options.hide.distance) && cache.origin && cache.origin.pageX) {
|
754 |
+
event = cache.origin;
|
755 |
+
}
|
756 |
+
|
757 |
+
// Use cached event for resize/scroll events
|
758 |
+
else if(!event || event && (event.type === 'resize' || event.type === 'scroll')) {
|
759 |
+
event = cache.event;
|
760 |
+
}
|
761 |
+
|
762 |
+
// Otherwise, use the cached mouse coordinates if available
|
763 |
+
else if(mouse && mouse.pageX) {
|
764 |
+
event = mouse;
|
765 |
+
}
|
766 |
+
|
767 |
+
// Calculate body and container offset and take them into account below
|
768 |
+
if(type !== 'static') { position = container.offset(); }
|
769 |
+
if(doc.body.offsetWidth !== (window.innerWidth || doc.documentElement.clientWidth)) {
|
770 |
+
offset = $(document.body).offset();
|
771 |
+
}
|
772 |
+
|
773 |
+
// Use event coordinates for position
|
774 |
+
position = {
|
775 |
+
left: event.pageX - position.left + (offset && offset.left || 0),
|
776 |
+
top: event.pageY - position.top + (offset && offset.top || 0)
|
777 |
+
};
|
778 |
+
|
779 |
+
// Scroll events are a pain, some browsers
|
780 |
+
if(adjust.mouse && isScroll && mouse) {
|
781 |
+
position.left -= (mouse.scrollX || 0) - win.scrollLeft();
|
782 |
+
position.top -= (mouse.scrollY || 0) - win.scrollTop();
|
783 |
+
}
|
784 |
+
}
|
785 |
+
|
786 |
+
// Target wasn't mouse or absolute...
|
787 |
+
else {
|
788 |
+
// Check if event targetting is being used
|
789 |
+
if(target === 'event') {
|
790 |
+
if(event && event.target && event.type !== 'scroll' && event.type !== 'resize') {
|
791 |
+
cache.target = $(event.target);
|
792 |
+
}
|
793 |
+
else if(!event.target) {
|
794 |
+
cache.target = this.elements.target;
|
795 |
+
}
|
796 |
+
}
|
797 |
+
else if(target !== 'event'){
|
798 |
+
cache.target = $(target.jquery ? target : this.elements.target);
|
799 |
+
}
|
800 |
+
target = cache.target;
|
801 |
+
|
802 |
+
// Parse the target into a jQuery object and make sure there's an element present
|
803 |
+
target = $(target).eq(0);
|
804 |
+
if(target.length === 0) { return this; }
|
805 |
+
|
806 |
+
// Check if window or document is the target
|
807 |
+
else if(target[0] === document || target[0] === window) {
|
808 |
+
targetWidth = BROWSER.iOS ? window.innerWidth : target.width();
|
809 |
+
targetHeight = BROWSER.iOS ? window.innerHeight : target.height();
|
810 |
+
|
811 |
+
if(target[0] === window) {
|
812 |
+
position = {
|
813 |
+
top: (viewport || target).scrollTop(),
|
814 |
+
left: (viewport || target).scrollLeft()
|
815 |
+
};
|
816 |
+
}
|
817 |
+
}
|
818 |
+
|
819 |
+
// Check if the target is an <AREA> element
|
820 |
+
else if(PLUGINS.imagemap && target.is('area')) {
|
821 |
+
pluginCalculations = PLUGINS.imagemap(this, target, at, PLUGINS.viewport ? method : FALSE);
|
822 |
+
}
|
823 |
+
|
824 |
+
// Check if the target is an SVG element
|
825 |
+
else if(PLUGINS.svg && target && target[0].ownerSVGElement) {
|
826 |
+
pluginCalculations = PLUGINS.svg(this, target, at, PLUGINS.viewport ? method : FALSE);
|
827 |
+
}
|
828 |
+
|
829 |
+
// Otherwise use regular jQuery methods
|
830 |
+
else {
|
831 |
+
targetWidth = target.outerWidth(FALSE);
|
832 |
+
targetHeight = target.outerHeight(FALSE);
|
833 |
+
position = target.offset();
|
834 |
+
}
|
835 |
+
|
836 |
+
// Parse returned plugin values into proper variables
|
837 |
+
if(pluginCalculations) {
|
838 |
+
targetWidth = pluginCalculations.width;
|
839 |
+
targetHeight = pluginCalculations.height;
|
840 |
+
offset = pluginCalculations.offset;
|
841 |
+
position = pluginCalculations.position;
|
842 |
+
}
|
843 |
+
|
844 |
+
// Adjust position to take into account offset parents
|
845 |
+
position = this.reposition.offset(target, position, container);
|
846 |
+
|
847 |
+
// Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2-4.0 & v4.3-4.3.2)
|
848 |
+
if(BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1 ||
|
849 |
+
BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33 ||
|
850 |
+
!BROWSER.iOS && type === 'fixed'
|
851 |
+
){
|
852 |
+
position.left -= win.scrollLeft();
|
853 |
+
position.top -= win.scrollTop();
|
854 |
+
}
|
855 |
+
|
856 |
+
// Adjust position relative to target
|
857 |
+
if(!pluginCalculations || pluginCalculations && pluginCalculations.adjustable !== FALSE) {
|
858 |
+
position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0;
|
859 |
+
position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0;
|
860 |
+
}
|
861 |
+
}
|
862 |
+
|
863 |
+
// Adjust position relative to tooltip
|
864 |
+
position.left += adjust.x + (my.x === RIGHT ? -tooltipWidth : my.x === CENTER ? -tooltipWidth / 2 : 0);
|
865 |
+
position.top += adjust.y + (my.y === BOTTOM ? -tooltipHeight : my.y === CENTER ? -tooltipHeight / 2 : 0);
|
866 |
+
|
867 |
+
// Use viewport adjustment plugin if enabled
|
868 |
+
if(PLUGINS.viewport) {
|
869 |
+
adjusted = position.adjusted = PLUGINS.viewport(
|
870 |
+
this, position, posOptions, targetWidth, targetHeight, tooltipWidth, tooltipHeight
|
871 |
+
);
|
872 |
+
|
873 |
+
// Apply offsets supplied by positioning plugin (if used)
|
874 |
+
if(offset && adjusted.left) { position.left += offset.left; }
|
875 |
+
if(offset && adjusted.top) { position.top += offset.top; }
|
876 |
+
|
877 |
+
// Apply any new 'my' position
|
878 |
+
if(adjusted.my) { this.position.my = adjusted.my; }
|
879 |
+
}
|
880 |
+
|
881 |
+
// Viewport adjustment is disabled, set values to zero
|
882 |
+
else { position.adjusted = { left: 0, top: 0 }; }
|
883 |
+
|
884 |
+
// Set tooltip position class if it's changed
|
885 |
+
if(cache.posClass !== (newClass = this._createPosClass(this.position.my))) {
|
886 |
+
cache.posClass = newClass;
|
887 |
+
tooltip.removeClass(cache.posClass).addClass(newClass);
|
888 |
+
}
|
889 |
+
|
890 |
+
// tooltipmove event
|
891 |
+
if(!this._trigger('move', [position, viewport.elem || viewport], event)) { return this; }
|
892 |
+
delete position.adjusted;
|
893 |
+
|
894 |
+
// If effect is disabled, target it mouse, no animation is defined or positioning gives NaN out, set CSS directly
|
895 |
+
if(effect === FALSE || !visible || isNaN(position.left) || isNaN(position.top) || target === 'mouse' || !$.isFunction(posOptions.effect)) {
|
896 |
+
tooltip.css(position);
|
897 |
+
}
|
898 |
+
|
899 |
+
// Use custom function if provided
|
900 |
+
else if($.isFunction(posOptions.effect)) {
|
901 |
+
posOptions.effect.call(tooltip, this, $.extend({}, position));
|
902 |
+
tooltip.queue(function(next) {
|
903 |
+
// Reset attributes to avoid cross-browser rendering bugs
|
904 |
+
$(this).css({ opacity: '', height: '' });
|
905 |
+
if(BROWSER.ie) { this.style.removeAttribute('filter'); }
|
906 |
+
|
907 |
+
next();
|
908 |
+
});
|
909 |
+
}
|
910 |
+
|
911 |
+
// Set positioning flag
|
912 |
+
this.positioning = FALSE;
|
913 |
+
|
914 |
+
return this;
|
915 |
+
};
|
916 |
+
|
917 |
+
// Custom (more correct for qTip!) offset calculator
|
918 |
+
PROTOTYPE.reposition.offset = function(elem, pos, container) {
|
919 |
+
if(!container[0]) { return pos; }
|
920 |
+
|
921 |
+
var ownerDocument = $(elem[0].ownerDocument),
|
922 |
+
quirks = !!BROWSER.ie && document.compatMode !== 'CSS1Compat',
|
923 |
+
parent = container[0],
|
924 |
+
scrolled, position, parentOffset, overflow;
|
925 |
+
|
926 |
+
function scroll(e, i) {
|
927 |
+
pos.left += i * e.scrollLeft();
|
928 |
+
pos.top += i * e.scrollTop();
|
929 |
+
}
|
930 |
+
|
931 |
+
// Compensate for non-static containers offset
|
932 |
+
do {
|
933 |
+
if((position = $.css(parent, 'position')) !== 'static') {
|
934 |
+
if(position === 'fixed') {
|
935 |
+
parentOffset = parent.getBoundingClientRect();
|
936 |
+
scroll(ownerDocument, -1);
|
937 |
+
}
|
938 |
+
else {
|
939 |
+
parentOffset = $(parent).position();
|
940 |
+
parentOffset.left += parseFloat($.css(parent, 'borderLeftWidth')) || 0;
|
941 |
+
parentOffset.top += parseFloat($.css(parent, 'borderTopWidth')) || 0;
|
942 |
+
}
|
943 |
+
|
944 |
+
pos.left -= parentOffset.left + (parseFloat($.css(parent, 'marginLeft')) || 0);
|
945 |
+
pos.top -= parentOffset.top + (parseFloat($.css(parent, 'marginTop')) || 0);
|
946 |
+
|
947 |
+
// If this is the first parent element with an overflow of "scroll" or "auto", store it
|
948 |
+
if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = $(parent); }
|
949 |
+
}
|
950 |
+
}
|
951 |
+
while(parent = parent.offsetParent);
|
952 |
+
|
953 |
+
// Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode)
|
954 |
+
if(scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) {
|
955 |
+
scroll(scrolled, 1);
|
956 |
+
}
|
957 |
+
|
958 |
+
return pos;
|
959 |
+
};
|
960 |
+
|
961 |
+
// Corner class
|
962 |
+
var C = (CORNER = PROTOTYPE.reposition.Corner = function(corner, forceY) {
|
963 |
+
corner = ('' + corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, CENTER).toLowerCase();
|
964 |
+
this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
|
965 |
+
this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();
|
966 |
+
this.forceY = !!forceY;
|
967 |
+
|
968 |
+
var f = corner.charAt(0);
|
969 |
+
this.precedance = f === 't' || f === 'b' ? Y : X;
|
970 |
+
}).prototype;
|
971 |
+
|
972 |
+
C.invert = function(z, center) {
|
973 |
+
this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z];
|
974 |
+
};
|
975 |
+
|
976 |
+
C.string = function(join) {
|
977 |
+
var x = this.x, y = this.y;
|
978 |
+
|
979 |
+
var result = x !== y ?
|
980 |
+
x === 'center' || y !== 'center' && (this.precedance === Y || this.forceY) ?
|
981 |
+
[y,x] :
|
982 |
+
[x,y] :
|
983 |
+
[x];
|
984 |
+
|
985 |
+
return join !== false ? result.join(' ') : result;
|
986 |
+
};
|
987 |
+
|
988 |
+
C.abbrev = function() {
|
989 |
+
var result = this.string(false);
|
990 |
+
return result[0].charAt(0) + (result[1] && result[1].charAt(0) || '');
|
991 |
+
};
|
992 |
+
|
993 |
+
C.clone = function() {
|
994 |
+
return new CORNER( this.string(), this.forceY );
|
995 |
+
};
|
996 |
+
|
997 |
+
;
|
998 |
+
PROTOTYPE.toggle = function(state, event) {
|
999 |
+
var cache = this.cache,
|
1000 |
+
options = this.options,
|
1001 |
+
tooltip = this.tooltip;
|
1002 |
+
|
1003 |
+
// Try to prevent flickering when tooltip overlaps show element
|
1004 |
+
if(event) {
|
1005 |
+
if((/over|enter/).test(event.type) && cache.event && (/out|leave/).test(cache.event.type) &&
|
1006 |
+
options.show.target.add(event.target).length === options.show.target.length &&
|
1007 |
+
tooltip.has(event.relatedTarget).length) {
|
1008 |
+
return this;
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
// Cache event
|
1012 |
+
cache.event = $.event.fix(event);
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
// If we're currently waiting and we've just hidden... stop it
|
1016 |
+
this.waiting && !state && (this.hiddenDuringWait = TRUE);
|
1017 |
+
|
1018 |
+
// Render the tooltip if showing and it isn't already
|
1019 |
+
if(!this.rendered) { return state ? this.render(1) : this; }
|
1020 |
+
else if(this.destroyed || this.disabled) { return this; }
|
1021 |
+
|
1022 |
+
var type = state ? 'show' : 'hide',
|
1023 |
+
opts = this.options[type],
|
1024 |
+
posOptions = this.options.position,
|
1025 |
+
contentOptions = this.options.content,
|
1026 |
+
width = this.tooltip.css('width'),
|
1027 |
+
visible = this.tooltip.is(':visible'),
|
1028 |
+
animate = state || opts.target.length === 1,
|
1029 |
+
sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target,
|
1030 |
+
identicalState, allow, after;
|
1031 |
+
|
1032 |
+
// Detect state if valid one isn't provided
|
1033 |
+
if((typeof state).search('boolean|number')) { state = !visible; }
|
1034 |
+
|
1035 |
+
// Check if the tooltip is in an identical state to the new would-be state
|
1036 |
+
identicalState = !tooltip.is(':animated') && visible === state && sameTarget;
|
1037 |
+
|
1038 |
+
// Fire tooltip(show/hide) event and check if destroyed
|
1039 |
+
allow = !identicalState ? !!this._trigger(type, [90]) : NULL;
|
1040 |
+
|
1041 |
+
// Check to make sure the tooltip wasn't destroyed in the callback
|
1042 |
+
if(this.destroyed) { return this; }
|
1043 |
+
|
1044 |
+
// If the user didn't stop the method prematurely and we're showing the tooltip, focus it
|
1045 |
+
if(allow !== FALSE && state) { this.focus(event); }
|
1046 |
+
|
1047 |
+
// If the state hasn't changed or the user stopped it, return early
|
1048 |
+
if(!allow || identicalState) { return this; }
|
1049 |
+
|
1050 |
+
// Set ARIA hidden attribute
|
1051 |
+
$.attr(tooltip[0], 'aria-hidden', !!!state);
|
1052 |
+
|
1053 |
+
// Execute state specific properties
|
1054 |
+
if(state) {
|
1055 |
+
// Store show origin coordinates
|
1056 |
+
this.mouse && (cache.origin = $.event.fix(this.mouse));
|
1057 |
+
|
1058 |
+
// Update tooltip content & title if it's a dynamic function
|
1059 |
+
if($.isFunction(contentOptions.text)) { this._updateContent(contentOptions.text, FALSE); }
|
1060 |
+
if($.isFunction(contentOptions.title)) { this._updateTitle(contentOptions.title, FALSE); }
|
1061 |
+
|
1062 |
+
// Cache mousemove events for positioning purposes (if not already tracking)
|
1063 |
+
if(!trackingBound && posOptions.target === 'mouse' && posOptions.adjust.mouse) {
|
1064 |
+
$(document).on('mousemove.'+NAMESPACE, this._storeMouse);
|
1065 |
+
trackingBound = TRUE;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
// Update the tooltip position (set width first to prevent viewport/max-width issues)
|
1069 |
+
if(!width) { tooltip.css('width', tooltip.outerWidth(FALSE)); }
|
1070 |
+
this.reposition(event, arguments[2]);
|
1071 |
+
if(!width) { tooltip.css('width', ''); }
|
1072 |
+
|
1073 |
+
// Hide other tooltips if tooltip is solo
|
1074 |
+
if(!!opts.solo) {
|
1075 |
+
(typeof opts.solo === 'string' ? $(opts.solo) : $(SELECTOR, opts.solo))
|
1076 |
+
.not(tooltip).not(opts.target).qtip('hide', new $.Event('tooltipsolo'));
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
else {
|
1080 |
+
// Clear show timer if we're hiding
|
1081 |
+
clearTimeout(this.timers.show);
|
1082 |
+
|
1083 |
+
// Remove cached origin on hide
|
1084 |
+
delete cache.origin;
|
1085 |
+
|
1086 |
+
// Remove mouse tracking event if not needed (all tracking qTips are hidden)
|
1087 |
+
if(trackingBound && !$(SELECTOR+'[tracking="true"]:visible', opts.solo).not(tooltip).length) {
|
1088 |
+
$(document).off('mousemove.'+NAMESPACE);
|
1089 |
+
trackingBound = FALSE;
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
// Blur the tooltip
|
1093 |
+
this.blur(event);
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
// Define post-animation, state specific properties
|
1097 |
+
after = $.proxy(function() {
|
1098 |
+
if(state) {
|
1099 |
+
// Prevent antialias from disappearing in IE by removing filter
|
1100 |
+
if(BROWSER.ie) { tooltip[0].style.removeAttribute('filter'); }
|
1101 |
+
|
1102 |
+
// Remove overflow setting to prevent tip bugs
|
1103 |
+
tooltip.css('overflow', '');
|
1104 |
+
|
1105 |
+
// Autofocus elements if enabled
|
1106 |
+
if('string' === typeof opts.autofocus) {
|
1107 |
+
$(this.options.show.autofocus, tooltip).focus();
|
1108 |
+
}
|
1109 |
+
|
1110 |
+
// If set, hide tooltip when inactive for delay period
|
1111 |
+
this.options.show.target.trigger('qtip-'+this.id+'-inactive');
|
1112 |
+
}
|
1113 |
+
else {
|
1114 |
+
// Reset CSS states
|
1115 |
+
tooltip.css({
|
1116 |
+
display: '',
|
1117 |
+
visibility: '',
|
1118 |
+
opacity: '',
|
1119 |
+
left: '',
|
1120 |
+
top: ''
|
1121 |
+
});
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
// tooltipvisible/tooltiphidden events
|
1125 |
+
this._trigger(state ? 'visible' : 'hidden');
|
1126 |
+
}, this);
|
1127 |
+
|
1128 |
+
// If no effect type is supplied, use a simple toggle
|
1129 |
+
if(opts.effect === FALSE || animate === FALSE) {
|
1130 |
+
tooltip[ type ]();
|
1131 |
+
after();
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
// Use custom function if provided
|
1135 |
+
else if($.isFunction(opts.effect)) {
|
1136 |
+
tooltip.stop(1, 1);
|
1137 |
+
opts.effect.call(tooltip, this);
|
1138 |
+
tooltip.queue('fx', function(n) {
|
1139 |
+
after(); n();
|
1140 |
+
});
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
// Use basic fade function by default
|
1144 |
+
else { tooltip.fadeTo(90, state ? 1 : 0, after); }
|
1145 |
+
|
1146 |
+
// If inactive hide method is set, active it
|
1147 |
+
if(state) { opts.target.trigger('qtip-'+this.id+'-inactive'); }
|
1148 |
+
|
1149 |
+
return this;
|
1150 |
+
};
|
1151 |
+
|
1152 |
+
PROTOTYPE.show = function(event) { return this.toggle(TRUE, event); };
|
1153 |
+
|
1154 |
+
PROTOTYPE.hide = function(event) { return this.toggle(FALSE, event); };
|
1155 |
+
;PROTOTYPE.focus = function(event) {
|
1156 |
+
if(!this.rendered || this.destroyed) { return this; }
|
1157 |
+
|
1158 |
+
var qtips = $(SELECTOR),
|
1159 |
+
tooltip = this.tooltip,
|
1160 |
+
curIndex = parseInt(tooltip[0].style.zIndex, 10),
|
1161 |
+
newIndex = QTIP.zindex + qtips.length;
|
1162 |
+
|
1163 |
+
// Only update the z-index if it has changed and tooltip is not already focused
|
1164 |
+
if(!tooltip.hasClass(CLASS_FOCUS)) {
|
1165 |
+
// tooltipfocus event
|
1166 |
+
if(this._trigger('focus', [newIndex], event)) {
|
1167 |
+
// Only update z-index's if they've changed
|
1168 |
+
if(curIndex !== newIndex) {
|
1169 |
+
// Reduce our z-index's and keep them properly ordered
|
1170 |
+
qtips.each(function() {
|
1171 |
+
if(this.style.zIndex > curIndex) {
|
1172 |
+
this.style.zIndex = this.style.zIndex - 1;
|
1173 |
+
}
|
1174 |
+
});
|
1175 |
+
|
1176 |
+
// Fire blur event for focused tooltip
|
1177 |
+
qtips.filter('.' + CLASS_FOCUS).qtip('blur', event);
|
1178 |
+
}
|
1179 |
+
|
1180 |
+
// Set the new z-index
|
1181 |
+
tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex;
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
|
1185 |
+
return this;
|
1186 |
+
};
|
1187 |
+
|
1188 |
+
PROTOTYPE.blur = function(event) {
|
1189 |
+
if(!this.rendered || this.destroyed) { return this; }
|
1190 |
+
|
1191 |
+
// Set focused status to FALSE
|
1192 |
+
this.tooltip.removeClass(CLASS_FOCUS);
|
1193 |
+
|
1194 |
+
// tooltipblur event
|
1195 |
+
this._trigger('blur', [ this.tooltip.css('zIndex') ], event);
|
1196 |
+
|
1197 |
+
return this;
|
1198 |
+
};
|
1199 |
+
;PROTOTYPE.disable = function(state) {
|
1200 |
+
if(this.destroyed) { return this; }
|
1201 |
+
|
1202 |
+
// If 'toggle' is passed, toggle the current state
|
1203 |
+
if(state === 'toggle') {
|
1204 |
+
state = !(this.rendered ? this.tooltip.hasClass(CLASS_DISABLED) : this.disabled);
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
// Disable if no state passed
|
1208 |
+
else if('boolean' !== typeof state) {
|
1209 |
+
state = TRUE;
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
if(this.rendered) {
|
1213 |
+
this.tooltip.toggleClass(CLASS_DISABLED, state)
|
1214 |
+
.attr('aria-disabled', state);
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
this.disabled = !!state;
|
1218 |
+
|
1219 |
+
return this;
|
1220 |
+
};
|
1221 |
+
|
1222 |
+
PROTOTYPE.enable = function() { return this.disable(FALSE); };
|
1223 |
+
;PROTOTYPE._createButton = function()
|
1224 |
+
{
|
1225 |
+
var self = this,
|
1226 |
+
elements = this.elements,
|
1227 |
+
tooltip = elements.tooltip,
|
1228 |
+
button = this.options.content.button,
|
1229 |
+
isString = typeof button === 'string',
|
1230 |
+
close = isString ? button : 'Close tooltip';
|
1231 |
+
|
1232 |
+
if(elements.button) { elements.button.remove(); }
|
1233 |
+
|
1234 |
+
// Use custom button if one was supplied by user, else use default
|
1235 |
+
if(button.jquery) {
|
1236 |
+
elements.button = button;
|
1237 |
+
}
|
1238 |
+
else {
|
1239 |
+
elements.button = $('<a />', {
|
1240 |
+
'class': 'qtip-close ' + (this.options.style.widget ? '' : NAMESPACE+'-icon'),
|
1241 |
+
'title': close,
|
1242 |
+
'aria-label': close
|
1243 |
+
})
|
1244 |
+
.prepend(
|
1245 |
+
$('<span />', {
|
1246 |
+
'class': 'ui-icon ui-icon-close',
|
1247 |
+
'html': '×'
|
1248 |
+
})
|
1249 |
+
);
|
1250 |
+
}
|
1251 |
+
|
1252 |
+
// Create button and setup attributes
|
1253 |
+
elements.button.appendTo(elements.titlebar || tooltip)
|
1254 |
+
.attr('role', 'button')
|
1255 |
+
.click(function(event) {
|
1256 |
+
if(!tooltip.hasClass(CLASS_DISABLED)) { self.hide(event); }
|
1257 |
+
return FALSE;
|
1258 |
+
});
|
1259 |
+
};
|
1260 |
+
|
1261 |
+
PROTOTYPE._updateButton = function(button)
|
1262 |
+
{
|
1263 |
+
// Make sure tooltip is rendered and if not, return
|
1264 |
+
if(!this.rendered) { return FALSE; }
|
1265 |
+
|
1266 |
+
var elem = this.elements.button;
|
1267 |
+
if(button) { this._createButton(); }
|
1268 |
+
else { elem.remove(); }
|
1269 |
+
};
|
1270 |
+
;// Widget class creator
|
1271 |
+
function createWidgetClass(cls) {
|
1272 |
+
return WIDGET.concat('').join(cls ? '-'+cls+' ' : ' ');
|
1273 |
+
}
|
1274 |
+
|
1275 |
+
// Widget class setter method
|
1276 |
+
PROTOTYPE._setWidget = function()
|
1277 |
+
{
|
1278 |
+
var on = this.options.style.widget,
|
1279 |
+
elements = this.elements,
|
1280 |
+
tooltip = elements.tooltip,
|
1281 |
+
disabled = tooltip.hasClass(CLASS_DISABLED);
|
1282 |
+
|
1283 |
+
tooltip.removeClass(CLASS_DISABLED);
|
1284 |
+
CLASS_DISABLED = on ? 'ui-state-disabled' : 'qtip-disabled';
|
1285 |
+
tooltip.toggleClass(CLASS_DISABLED, disabled);
|
1286 |
+
|
1287 |
+
tooltip.toggleClass('ui-helper-reset '+createWidgetClass(), on).toggleClass(CLASS_DEFAULT, this.options.style.def && !on);
|
1288 |
+
|
1289 |
+
if(elements.content) {
|
1290 |
+
elements.content.toggleClass( createWidgetClass('content'), on);
|
1291 |
+
}
|
1292 |
+
if(elements.titlebar) {
|
1293 |
+
elements.titlebar.toggleClass( createWidgetClass('header'), on);
|
1294 |
+
}
|
1295 |
+
if(elements.button) {
|
1296 |
+
elements.button.toggleClass(NAMESPACE+'-icon', !on);
|
1297 |
+
}
|
1298 |
+
};
|
1299 |
+
;function delay(callback, duration) {
|
1300 |
+
// If tooltip has displayed, start hide timer
|
1301 |
+
if(duration > 0) {
|
1302 |
+
return setTimeout(
|
1303 |
+
$.proxy(callback, this), duration
|
1304 |
+
);
|
1305 |
+
}
|
1306 |
+
else{ callback.call(this); }
|
1307 |
+
}
|
1308 |
+
|
1309 |
+
function showMethod(event) {
|
1310 |
+
if(this.tooltip.hasClass(CLASS_DISABLED)) { return; }
|
1311 |
+
|
1312 |
+
// Clear hide timers
|
1313 |
+
clearTimeout(this.timers.show);
|
1314 |
+
clearTimeout(this.timers.hide);
|
1315 |
+
|
1316 |
+
// Start show timer
|
1317 |
+
this.timers.show = delay.call(this,
|
1318 |
+
function() { this.toggle(TRUE, event); },
|
1319 |
+
this.options.show.delay
|
1320 |
+
);
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
function hideMethod(event) {
|
1324 |
+
if(this.tooltip.hasClass(CLASS_DISABLED) || this.destroyed) { return; }
|
1325 |
+
|
1326 |
+
// Check if new target was actually the tooltip element
|
1327 |
+
var relatedTarget = $(event.relatedTarget),
|
1328 |
+
ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0],
|
1329 |
+
ontoTarget = relatedTarget[0] === this.options.show.target[0];
|
1330 |
+
|
1331 |
+
// Clear timers and stop animation queue
|
1332 |
+
clearTimeout(this.timers.show);
|
1333 |
+
clearTimeout(this.timers.hide);
|
1334 |
+
|
1335 |
+
// Prevent hiding if tooltip is fixed and event target is the tooltip.
|
1336 |
+
// Or if mouse positioning is enabled and cursor momentarily overlaps
|
1337 |
+
if(this !== relatedTarget[0] &&
|
1338 |
+
(this.options.position.target === 'mouse' && ontoTooltip) ||
|
1339 |
+
this.options.hide.fixed && (
|
1340 |
+
(/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget))
|
1341 |
+
)
|
1342 |
+
{
|
1343 |
+
/* eslint-disable no-empty */
|
1344 |
+
try {
|
1345 |
+
event.preventDefault();
|
1346 |
+
event.stopImmediatePropagation();
|
1347 |
+
} catch(e) {}
|
1348 |
+
/* eslint-enable no-empty */
|
1349 |
+
|
1350 |
+
return;
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
// If tooltip has displayed, start hide timer
|
1354 |
+
this.timers.hide = delay.call(this,
|
1355 |
+
function() { this.toggle(FALSE, event); },
|
1356 |
+
this.options.hide.delay,
|
1357 |
+
this
|
1358 |
+
);
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
function inactiveMethod(event) {
|
1362 |
+
if(this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) { return; }
|
1363 |
+
|
1364 |
+
// Clear timer
|
1365 |
+
clearTimeout(this.timers.inactive);
|
1366 |
+
|
1367 |
+
this.timers.inactive = delay.call(this,
|
1368 |
+
function(){ this.hide(event); },
|
1369 |
+
this.options.hide.inactive
|
1370 |
+
);
|
1371 |
+
}
|
1372 |
+
|
1373 |
+
function repositionMethod(event) {
|
1374 |
+
if(this.rendered && this.tooltip[0].offsetWidth > 0) { this.reposition(event); }
|
1375 |
+
}
|
1376 |
+
|
1377 |
+
// Store mouse coordinates
|
1378 |
+
PROTOTYPE._storeMouse = function(event) {
|
1379 |
+
(this.mouse = $.event.fix(event)).type = 'mousemove';
|
1380 |
+
return this;
|
1381 |
+
};
|
1382 |
+
|
1383 |
+
// Bind events
|
1384 |
+
PROTOTYPE._bind = function(targets, events, method, suffix, context) {
|
1385 |
+
if(!targets || !method || !events.length) { return; }
|
1386 |
+
var ns = '.' + this._id + (suffix ? '-'+suffix : '');
|
1387 |
+
$(targets).on(
|
1388 |
+
(events.split ? events : events.join(ns + ' ')) + ns,
|
1389 |
+
$.proxy(method, context || this)
|
1390 |
+
);
|
1391 |
+
return this;
|
1392 |
+
};
|
1393 |
+
PROTOTYPE._unbind = function(targets, suffix) {
|
1394 |
+
targets && $(targets).off('.' + this._id + (suffix ? '-'+suffix : ''));
|
1395 |
+
return this;
|
1396 |
+
};
|
1397 |
+
|
1398 |
+
// Global delegation helper
|
1399 |
+
function delegate(selector, events, method) {
|
1400 |
+
$(document.body).delegate(selector,
|
1401 |
+
(events.split ? events : events.join('.'+NAMESPACE + ' ')) + '.'+NAMESPACE,
|
1402 |
+
function() {
|
1403 |
+
var api = QTIP.api[ $.attr(this, ATTR_ID) ];
|
1404 |
+
api && !api.disabled && method.apply(api, arguments);
|
1405 |
+
}
|
1406 |
+
);
|
1407 |
+
}
|
1408 |
+
// Event trigger
|
1409 |
+
PROTOTYPE._trigger = function(type, args, event) {
|
1410 |
+
var callback = new $.Event('tooltip'+type);
|
1411 |
+
callback.originalEvent = event && $.extend({}, event) || this.cache.event || NULL;
|
1412 |
+
|
1413 |
+
this.triggering = type;
|
1414 |
+
this.tooltip.trigger(callback, [this].concat(args || []));
|
1415 |
+
this.triggering = FALSE;
|
1416 |
+
|
1417 |
+
return !callback.isDefaultPrevented();
|
1418 |
+
};
|
1419 |
+
|
1420 |
+
PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTargets, showCallback, hideCallback) {
|
1421 |
+
// Get tasrgets that lye within both
|
1422 |
+
var similarTargets = showTargets.filter( hideTargets ).add( hideTargets.filter(showTargets) ),
|
1423 |
+
toggleEvents = [];
|
1424 |
+
|
1425 |
+
// If hide and show targets are the same...
|
1426 |
+
if(similarTargets.length) {
|
1427 |
+
|
1428 |
+
// Filter identical show/hide events
|
1429 |
+
$.each(hideEvents, function(i, type) {
|
1430 |
+
var showIndex = $.inArray(type, showEvents);
|
1431 |
+
|
1432 |
+
// Both events are identical, remove from both hide and show events
|
1433 |
+
// and append to toggleEvents
|
1434 |
+
showIndex > -1 && toggleEvents.push( showEvents.splice( showIndex, 1 )[0] );
|
1435 |
+
});
|
1436 |
+
|
1437 |
+
// Toggle events are special case of identical show/hide events, which happen in sequence
|
1438 |
+
if(toggleEvents.length) {
|
1439 |
+
// Bind toggle events to the similar targets
|
1440 |
+
this._bind(similarTargets, toggleEvents, function(event) {
|
1441 |
+
var state = this.rendered ? this.tooltip[0].offsetWidth > 0 : false;
|
1442 |
+
(state ? hideCallback : showCallback).call(this, event);
|
1443 |
+
});
|
1444 |
+
|
1445 |
+
// Remove the similar targets from the regular show/hide bindings
|
1446 |
+
showTargets = showTargets.not(similarTargets);
|
1447 |
+
hideTargets = hideTargets.not(similarTargets);
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
+
|
1451 |
+
// Apply show/hide/toggle events
|
1452 |
+
this._bind(showTargets, showEvents, showCallback);
|
1453 |
+
this._bind(hideTargets, hideEvents, hideCallback);
|
1454 |
+
};
|
1455 |
+
|
1456 |
+
PROTOTYPE._assignInitialEvents = function(event) {
|
1457 |
+
var options = this.options,
|
1458 |
+
showTarget = options.show.target,
|
1459 |
+
hideTarget = options.hide.target,
|
1460 |
+
showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
|
1461 |
+
hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
|
1462 |
+
|
1463 |
+
// Catch remove/removeqtip events on target element to destroy redundant tooltips
|
1464 |
+
this._bind(this.elements.target, ['remove', 'removeqtip'], function() {
|
1465 |
+
this.destroy(true);
|
1466 |
+
}, 'destroy');
|
1467 |
+
|
1468 |
+
/*
|
1469 |
+
* Make sure hoverIntent functions properly by using mouseleave as a hide event if
|
1470 |
+
* mouseenter/mouseout is used for show.event, even if it isn't in the users options.
|
1471 |
+
*/
|
1472 |
+
if(/mouse(over|enter)/i.test(options.show.event) && !/mouse(out|leave)/i.test(options.hide.event)) {
|
1473 |
+
hideEvents.push('mouseleave');
|
1474 |
+
}
|
1475 |
+
|
1476 |
+
/*
|
1477 |
+
* Also make sure initial mouse targetting works correctly by caching mousemove coords
|
1478 |
+
* on show targets before the tooltip has rendered. Also set onTarget when triggered to
|
1479 |
+
* keep mouse tracking working.
|
1480 |
+
*/
|
1481 |
+
this._bind(showTarget, 'mousemove', function(moveEvent) {
|
1482 |
+
this._storeMouse(moveEvent);
|
1483 |
+
this.cache.onTarget = TRUE;
|
1484 |
+
});
|
1485 |
+
|
1486 |
+
// Define hoverIntent function
|
1487 |
+
function hoverIntent(hoverEvent) {
|
1488 |
+
// Only continue if tooltip isn't disabled
|
1489 |
+
if(this.disabled || this.destroyed) { return FALSE; }
|
1490 |
+
|
1491 |
+
// Cache the event data
|
1492 |
+
this.cache.event = hoverEvent && $.event.fix(hoverEvent);
|
1493 |
+
this.cache.target = hoverEvent && $(hoverEvent.target);
|
1494 |
+
|
1495 |
+
// Start the event sequence
|
1496 |
+
clearTimeout(this.timers.show);
|
1497 |
+
this.timers.show = delay.call(this,
|
1498 |
+
function() { this.render(typeof hoverEvent === 'object' || options.show.ready); },
|
1499 |
+
options.prerender ? 0 : options.show.delay
|
1500 |
+
);
|
1501 |
+
}
|
1502 |
+
|
1503 |
+
// Filter and bind events
|
1504 |
+
this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, hoverIntent, function() {
|
1505 |
+
if(!this.timers) { return FALSE; }
|
1506 |
+
clearTimeout(this.timers.show);
|
1507 |
+
});
|
1508 |
+
|
1509 |
+
// Prerendering is enabled, create tooltip now
|
1510 |
+
if(options.show.ready || options.prerender) { hoverIntent.call(this, event); }
|
1511 |
+
};
|
1512 |
+
|
1513 |
+
// Event assignment method
|
1514 |
+
PROTOTYPE._assignEvents = function() {
|
1515 |
+
var self = this,
|
1516 |
+
options = this.options,
|
1517 |
+
posOptions = options.position,
|
1518 |
+
|
1519 |
+
tooltip = this.tooltip,
|
1520 |
+
showTarget = options.show.target,
|
1521 |
+
hideTarget = options.hide.target,
|
1522 |
+
containerTarget = posOptions.container,
|
1523 |
+
viewportTarget = posOptions.viewport,
|
1524 |
+
documentTarget = $(document),
|
1525 |
+
windowTarget = $(window),
|
1526 |
+
|
1527 |
+
showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
|
1528 |
+
hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
|
1529 |
+
|
1530 |
+
|
1531 |
+
// Assign passed event callbacks
|
1532 |
+
$.each(options.events, function(name, callback) {
|
1533 |
+
self._bind(tooltip, name === 'toggle' ? ['tooltipshow','tooltiphide'] : ['tooltip'+name], callback, null, tooltip);
|
1534 |
+
});
|
1535 |
+
|
1536 |
+
// Hide tooltips when leaving current window/frame (but not select/option elements)
|
1537 |
+
if(/mouse(out|leave)/i.test(options.hide.event) && options.hide.leave === 'window') {
|
1538 |
+
this._bind(documentTarget, ['mouseout', 'blur'], function(event) {
|
1539 |
+
if(!/select|option/.test(event.target.nodeName) && !event.relatedTarget) {
|
1540 |
+
this.hide(event);
|
1541 |
+
}
|
1542 |
+
});
|
1543 |
+
}
|
1544 |
+
|
1545 |
+
// Enable hide.fixed by adding appropriate class
|
1546 |
+
if(options.hide.fixed) {
|
1547 |
+
hideTarget = hideTarget.add( tooltip.addClass(CLASS_FIXED) );
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
/*
|
1551 |
+
* Make sure hoverIntent functions properly by using mouseleave to clear show timer if
|
1552 |
+
* mouseenter/mouseout is used for show.event, even if it isn't in the users options.
|
1553 |
+
*/
|
1554 |
+
else if(/mouse(over|enter)/i.test(options.show.event)) {
|
1555 |
+
this._bind(hideTarget, 'mouseleave', function() {
|
1556 |
+
clearTimeout(this.timers.show);
|
1557 |
+
});
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
// Hide tooltip on document mousedown if unfocus events are enabled
|
1561 |
+
if(('' + options.hide.event).indexOf('unfocus') > -1) {
|
1562 |
+
this._bind(containerTarget.closest('html'), ['mousedown', 'touchstart'], function(event) {
|
1563 |
+
var elem = $(event.target),
|
1564 |
+
enabled = this.rendered && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0,
|
1565 |
+
isAncestor = elem.parents(SELECTOR).filter(this.tooltip[0]).length > 0;
|
1566 |
+
|
1567 |
+
if(elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor &&
|
1568 |
+
!this.target.has(elem[0]).length && enabled
|
1569 |
+
) {
|
1570 |
+
this.hide(event);
|
1571 |
+
}
|
1572 |
+
});
|
1573 |
+
}
|
1574 |
+
|
1575 |
+
// Check if the tooltip hides when inactive
|
1576 |
+
if('number' === typeof options.hide.inactive) {
|
1577 |
+
// Bind inactive method to show target(s) as a custom event
|
1578 |
+
this._bind(showTarget, 'qtip-'+this.id+'-inactive', inactiveMethod, 'inactive');
|
1579 |
+
|
1580 |
+
// Define events which reset the 'inactive' event handler
|
1581 |
+
this._bind(hideTarget.add(tooltip), QTIP.inactiveEvents, inactiveMethod);
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
// Filter and bind events
|
1585 |
+
this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod);
|
1586 |
+
|
1587 |
+
// Mouse movement bindings
|
1588 |
+
this._bind(showTarget.add(tooltip), 'mousemove', function(event) {
|
1589 |
+
// Check if the tooltip hides when mouse is moved a certain distance
|
1590 |
+
if('number' === typeof options.hide.distance) {
|
1591 |
+
var origin = this.cache.origin || {},
|
1592 |
+
limit = this.options.hide.distance,
|
1593 |
+
abs = Math.abs;
|
1594 |
+
|
1595 |
+
// Check if the movement has gone beyond the limit, and hide it if so
|
1596 |
+
if(abs(event.pageX - origin.pageX) >= limit || abs(event.pageY - origin.pageY) >= limit) {
|
1597 |
+
this.hide(event);
|
1598 |
+
}
|
1599 |
+
}
|
1600 |
+
|
1601 |
+
// Cache mousemove coords on show targets
|
1602 |
+
this._storeMouse(event);
|
1603 |
+
});
|
1604 |
+
|
1605 |
+
// Mouse positioning events
|
1606 |
+
if(posOptions.target === 'mouse') {
|
1607 |
+
// If mouse adjustment is on...
|
1608 |
+
if(posOptions.adjust.mouse) {
|
1609 |
+
// Apply a mouseleave event so we don't get problems with overlapping
|
1610 |
+
if(options.hide.event) {
|
1611 |
+
// Track if we're on the target or not
|
1612 |
+
this._bind(showTarget, ['mouseenter', 'mouseleave'], function(event) {
|
1613 |
+
if(!this.cache) {return FALSE; }
|
1614 |
+
this.cache.onTarget = event.type === 'mouseenter';
|
1615 |
+
});
|
1616 |
+
}
|
1617 |
+
|
1618 |
+
// Update tooltip position on mousemove
|
1619 |
+
this._bind(documentTarget, 'mousemove', function(event) {
|
1620 |
+
// Update the tooltip position only if the tooltip is visible and adjustment is enabled
|
1621 |
+
if(this.rendered && this.cache.onTarget && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0) {
|
1622 |
+
this.reposition(event);
|
1623 |
+
}
|
1624 |
+
});
|
1625 |
+
}
|
1626 |
+
}
|
1627 |
+
|
1628 |
+
// Adjust positions of the tooltip on window resize if enabled
|
1629 |
+
if(posOptions.adjust.resize || viewportTarget.length) {
|
1630 |
+
this._bind( $.event.special.resize ? viewportTarget : windowTarget, 'resize', repositionMethod );
|
1631 |
+
}
|
1632 |
+
|
1633 |
+
// Adjust tooltip position on scroll of the window or viewport element if present
|
1634 |
+
if(posOptions.adjust.scroll) {
|
1635 |
+
this._bind( windowTarget.add(posOptions.container), 'scroll', repositionMethod );
|
1636 |
+
}
|
1637 |
+
};
|
1638 |
+
|
1639 |
+
// Un-assignment method
|
1640 |
+
PROTOTYPE._unassignEvents = function() {
|
1641 |
+
var options = this.options,
|
1642 |
+
showTargets = options.show.target,
|
1643 |
+
hideTargets = options.hide.target,
|
1644 |
+
targets = $.grep([
|
1645 |
+
this.elements.target[0],
|
1646 |
+
this.rendered && this.tooltip[0],
|
1647 |
+
options.position.container[0],
|
1648 |
+
options.position.viewport[0],
|
1649 |
+
options.position.container.closest('html')[0], // unfocus
|
1650 |
+
window,
|
1651 |
+
document
|
1652 |
+
], function(i) {
|
1653 |
+
return typeof i === 'object';
|
1654 |
+
});
|
1655 |
+
|
1656 |
+
// Add show and hide targets if they're valid
|
1657 |
+
if(showTargets && showTargets.toArray) {
|
1658 |
+
targets = targets.concat(showTargets.toArray());
|
1659 |
+
}
|
1660 |
+
if(hideTargets && hideTargets.toArray) {
|
1661 |
+
targets = targets.concat(hideTargets.toArray());
|
1662 |
+
}
|
1663 |
+
|
1664 |
+
// Unbind the events
|
1665 |
+
this._unbind(targets)
|
1666 |
+
._unbind(targets, 'destroy')
|
1667 |
+
._unbind(targets, 'inactive');
|
1668 |
+
};
|
1669 |
+
|
1670 |
+
// Apply common event handlers using delegate (avoids excessive .on calls!)
|
1671 |
+
$(function() {
|
1672 |
+
delegate(SELECTOR, ['mouseenter', 'mouseleave'], function(event) {
|
1673 |
+
var state = event.type === 'mouseenter',
|
1674 |
+
tooltip = $(event.currentTarget),
|
1675 |
+
target = $(event.relatedTarget || event.target),
|
1676 |
+
options = this.options;
|
1677 |
+
|
1678 |
+
// On mouseenter...
|
1679 |
+
if(state) {
|
1680 |
+
// Focus the tooltip on mouseenter (z-index stacking)
|
1681 |
+
this.focus(event);
|
1682 |
+
|
1683 |
+
// Clear hide timer on tooltip hover to prevent it from closing
|
1684 |
+
tooltip.hasClass(CLASS_FIXED) && !tooltip.hasClass(CLASS_DISABLED) && clearTimeout(this.timers.hide);
|
1685 |
+
}
|
1686 |
+
|
1687 |
+
// On mouseleave...
|
1688 |
+
else {
|
1689 |
+
// When mouse tracking is enabled, hide when we leave the tooltip and not onto the show target (if a hide event is set)
|
1690 |
+
if(options.position.target === 'mouse' && options.position.adjust.mouse &&
|
1691 |
+
options.hide.event && options.show.target && !target.closest(options.show.target[0]).length) {
|
1692 |
+
this.hide(event);
|
1693 |
+
}
|
1694 |
+
}
|
1695 |
+
|
1696 |
+
// Add hover class
|
1697 |
+
tooltip.toggleClass(CLASS_HOVER, state);
|
1698 |
+
});
|
1699 |
+
|
1700 |
+
// Define events which reset the 'inactive' event handler
|
1701 |
+
delegate('['+ATTR_ID+']', INACTIVE_EVENTS, inactiveMethod);
|
1702 |
+
});
|
1703 |
+
;// Initialization method
|
1704 |
+
function init(elem, id, opts) {
|
1705 |
+
var obj, posOptions, attr, config, title,
|
1706 |
+
|
1707 |
+
// Setup element references
|
1708 |
+
docBody = $(document.body),
|
1709 |
+
|
1710 |
+
// Use document body instead of document element if needed
|
1711 |
+
newTarget = elem[0] === document ? docBody : elem,
|
1712 |
+
|
1713 |
+
// Grab metadata from element if plugin is present
|
1714 |
+
metadata = elem.metadata ? elem.metadata(opts.metadata) : NULL,
|
1715 |
+
|
1716 |
+
// If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise
|
1717 |
+
metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL,
|
1718 |
+
|
1719 |
+
// Grab data from metadata.name (or data-qtipopts as fallback) using .data() method,
|
1720 |
+
html5 = elem.data(opts.metadata.name || 'qtipopts');
|
1721 |
+
|
1722 |
+
// If we don't get an object returned attempt to parse it manualyl without parseJSON
|
1723 |
+
/* eslint-disable no-empty */
|
1724 |
+
try { html5 = typeof html5 === 'string' ? $.parseJSON(html5) : html5; }
|
1725 |
+
catch(e) {}
|
1726 |
+
/* eslint-enable no-empty */
|
1727 |
+
|
1728 |
+
// Merge in and sanitize metadata
|
1729 |
+
config = $.extend(TRUE, {}, QTIP.defaults, opts,
|
1730 |
+
typeof html5 === 'object' ? sanitizeOptions(html5) : NULL,
|
1731 |
+
sanitizeOptions(metadata5 || metadata));
|
1732 |
+
|
1733 |
+
// Re-grab our positioning options now we've merged our metadata and set id to passed value
|
1734 |
+
posOptions = config.position;
|
1735 |
+
config.id = id;
|
1736 |
+
|
1737 |
+
// Setup missing content if none is detected
|
1738 |
+
if('boolean' === typeof config.content.text) {
|
1739 |
+
attr = elem.attr(config.content.attr);
|
1740 |
+
|
1741 |
+
// Grab from supplied attribute if available
|
1742 |
+
if(config.content.attr !== FALSE && attr) { config.content.text = attr; }
|
1743 |
+
|
1744 |
+
// No valid content was found, abort render
|
1745 |
+
else { return FALSE; }
|
1746 |
+
}
|
1747 |
+
|
1748 |
+
// Setup target options
|
1749 |
+
if(!posOptions.container.length) { posOptions.container = docBody; }
|
1750 |
+
if(posOptions.target === FALSE) { posOptions.target = newTarget; }
|
1751 |
+
if(config.show.target === FALSE) { config.show.target = newTarget; }
|
1752 |
+
if(config.show.solo === TRUE) { config.show.solo = posOptions.container.closest('body'); }
|
1753 |
+
if(config.hide.target === FALSE) { config.hide.target = newTarget; }
|
1754 |
+
if(config.position.viewport === TRUE) { config.position.viewport = posOptions.container; }
|
1755 |
+
|
1756 |
+
// Ensure we only use a single container
|
1757 |
+
posOptions.container = posOptions.container.eq(0);
|
1758 |
+
|
1759 |
+
// Convert position corner values into x and y strings
|
1760 |
+
posOptions.at = new CORNER(posOptions.at, TRUE);
|
1761 |
+
posOptions.my = new CORNER(posOptions.my);
|
1762 |
+
|
1763 |
+
// Destroy previous tooltip if overwrite is enabled, or skip element if not
|
1764 |
+
if(elem.data(NAMESPACE)) {
|
1765 |
+
if(config.overwrite) {
|
1766 |
+
elem.qtip('destroy', true);
|
1767 |
+
}
|
1768 |
+
else if(config.overwrite === FALSE) {
|
1769 |
+
return FALSE;
|
1770 |
+
}
|
1771 |
+
}
|
1772 |
+
|
1773 |
+
// Add has-qtip attribute
|
1774 |
+
elem.attr(ATTR_HAS, id);
|
1775 |
+
|
1776 |
+
// Remove title attribute and store it if present
|
1777 |
+
if(config.suppress && (title = elem.attr('title'))) {
|
1778 |
+
// Final attr call fixes event delegatiom and IE default tooltip showing problem
|
1779 |
+
elem.removeAttr('title').attr(oldtitle, title).attr('title', '');
|
1780 |
+
}
|
1781 |
+
|
1782 |
+
// Initialize the tooltip and add API reference
|
1783 |
+
obj = new QTip(elem, config, id, !!attr);
|
1784 |
+
elem.data(NAMESPACE, obj);
|
1785 |
+
|
1786 |
+
return obj;
|
1787 |
+
}
|
1788 |
+
|
1789 |
+
// jQuery $.fn extension method
|
1790 |
+
QTIP = $.fn.qtip = function(options, notation, newValue)
|
1791 |
+
{
|
1792 |
+
var command = ('' + options).toLowerCase(), // Parse command
|
1793 |
+
returned = NULL,
|
1794 |
+
args = $.makeArray(arguments).slice(1),
|
1795 |
+
event = args[args.length - 1],
|
1796 |
+
opts = this[0] ? $.data(this[0], NAMESPACE) : NULL;
|
1797 |
+
|
1798 |
+
// Check for API request
|
1799 |
+
if(!arguments.length && opts || command === 'api') {
|
1800 |
+
return opts;
|
1801 |
+
}
|
1802 |
+
|
1803 |
+
// Execute API command if present
|
1804 |
+
else if('string' === typeof options) {
|
1805 |
+
this.each(function() {
|
1806 |
+
var api = $.data(this, NAMESPACE);
|
1807 |
+
if(!api) { return TRUE; }
|
1808 |
+
|
1809 |
+
// Cache the event if possible
|
1810 |
+
if(event && event.timeStamp) { api.cache.event = event; }
|
1811 |
+
|
1812 |
+
// Check for specific API commands
|
1813 |
+
if(notation && (command === 'option' || command === 'options')) {
|
1814 |
+
if(newValue !== undefined || $.isPlainObject(notation)) {
|
1815 |
+
api.set(notation, newValue);
|
1816 |
+
}
|
1817 |
+
else {
|
1818 |
+
returned = api.get(notation);
|
1819 |
+
return FALSE;
|
1820 |
+
}
|
1821 |
+
}
|
1822 |
+
|
1823 |
+
// Execute API command
|
1824 |
+
else if(api[command]) {
|
1825 |
+
api[command].apply(api, args);
|
1826 |
+
}
|
1827 |
+
});
|
1828 |
+
|
1829 |
+
return returned !== NULL ? returned : this;
|
1830 |
+
}
|
1831 |
+
|
1832 |
+
// No API commands. validate provided options and setup qTips
|
1833 |
+
else if('object' === typeof options || !arguments.length) {
|
1834 |
+
// Sanitize options first
|
1835 |
+
opts = sanitizeOptions($.extend(TRUE, {}, options));
|
1836 |
+
|
1837 |
+
return this.each(function(i) {
|
1838 |
+
var api, id;
|
1839 |
+
|
1840 |
+
// Find next available ID, or use custom ID if provided
|
1841 |
+
id = $.isArray(opts.id) ? opts.id[i] : opts.id;
|
1842 |
+
id = !id || id === FALSE || id.length < 1 || QTIP.api[id] ? QTIP.nextid++ : id;
|
1843 |
+
|
1844 |
+
// Initialize the qTip and re-grab newly sanitized options
|
1845 |
+
api = init($(this), id, opts);
|
1846 |
+
if(api === FALSE) { return TRUE; }
|
1847 |
+
else { QTIP.api[id] = api; }
|
1848 |
+
|
1849 |
+
// Initialize plugins
|
1850 |
+
$.each(PLUGINS, function() {
|
1851 |
+
if(this.initialize === 'initialize') { this(api); }
|
1852 |
+
});
|
1853 |
+
|
1854 |
+
// Assign initial pre-render events
|
1855 |
+
api._assignInitialEvents(event);
|
1856 |
+
});
|
1857 |
+
}
|
1858 |
+
};
|
1859 |
+
|
1860 |
+
// Expose class
|
1861 |
+
$.qtip = QTip;
|
1862 |
+
|
1863 |
+
// Populated in render method
|
1864 |
+
QTIP.api = {};
|
1865 |
+
;$.each({
|
1866 |
+
/* Allow other plugins to successfully retrieve the title of an element with a qTip applied */
|
1867 |
+
attr: function(attr, val) {
|
1868 |
+
if(this.length) {
|
1869 |
+
var self = this[0],
|
1870 |
+
title = 'title',
|
1871 |
+
api = $.data(self, 'qtip');
|
1872 |
+
|
1873 |
+
if(attr === title && api && api.options && 'object' === typeof api && 'object' === typeof api.options && api.options.suppress) {
|
1874 |
+
if(arguments.length < 2) {
|
1875 |
+
return $.attr(self, oldtitle);
|
1876 |
+
}
|
1877 |
+
|
1878 |
+
// If qTip is rendered and title was originally used as content, update it
|
1879 |
+
if(api && api.options.content.attr === title && api.cache.attr) {
|
1880 |
+
api.set('content.text', val);
|
1881 |
+
}
|
1882 |
+
|
1883 |
+
// Use the regular attr method to set, then cache the result
|
1884 |
+
return this.attr(oldtitle, val);
|
1885 |
+
}
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
return $.fn['attr'+replaceSuffix].apply(this, arguments);
|
1889 |
+
},
|
1890 |
+
|
1891 |
+
/* Allow clone to correctly retrieve cached title attributes */
|
1892 |
+
clone: function(keepData) {
|
1893 |
+
// Clone our element using the real clone method
|
1894 |
+
var elems = $.fn['clone'+replaceSuffix].apply(this, arguments);
|
1895 |
+
|
1896 |
+
// Grab all elements with an oldtitle set, and change it to regular title attribute, if keepData is false
|
1897 |
+
if(!keepData) {
|
1898 |
+
elems.filter('['+oldtitle+']').attr('title', function() {
|
1899 |
+
return $.attr(this, oldtitle);
|
1900 |
+
})
|
1901 |
+
.removeAttr(oldtitle);
|
1902 |
+
}
|
1903 |
+
|
1904 |
+
return elems;
|
1905 |
+
}
|
1906 |
+
}, function(name, func) {
|
1907 |
+
if(!func || $.fn[name+replaceSuffix]) { return TRUE; }
|
1908 |
+
|
1909 |
+
var old = $.fn[name+replaceSuffix] = $.fn[name];
|
1910 |
+
$.fn[name] = function() {
|
1911 |
+
return func.apply(this, arguments) || old.apply(this, arguments);
|
1912 |
+
};
|
1913 |
+
});
|
1914 |
+
|
1915 |
+
/* Fire off 'removeqtip' handler in $.cleanData if jQuery UI not present (it already does similar).
|
1916 |
+
* This snippet is taken directly from jQuery UI source code found here:
|
1917 |
+
* http://code.jquery.com/ui/jquery-ui-git.js
|
1918 |
+
*/
|
1919 |
+
if(!$.ui) {
|
1920 |
+
$['cleanData'+replaceSuffix] = $.cleanData;
|
1921 |
+
$.cleanData = function( elems ) {
|
1922 |
+
for(var i = 0, elem; (elem = $( elems[i] )).length; i++) {
|
1923 |
+
if(elem.attr(ATTR_HAS)) {
|
1924 |
+
/* eslint-disable no-empty */
|
1925 |
+
try { elem.triggerHandler('removeqtip'); }
|
1926 |
+
catch( e ) {}
|
1927 |
+
/* eslint-enable no-empty */
|
1928 |
+
}
|
1929 |
+
}
|
1930 |
+
$['cleanData'+replaceSuffix].apply(this, arguments);
|
1931 |
+
};
|
1932 |
+
}
|
1933 |
+
;// qTip version
|
1934 |
+
QTIP.version = '3.0.3';
|
1935 |
+
|
1936 |
+
// Base ID for all qTips
|
1937 |
+
QTIP.nextid = 0;
|
1938 |
+
|
1939 |
+
// Inactive events array
|
1940 |
+
QTIP.inactiveEvents = INACTIVE_EVENTS;
|
1941 |
+
|
1942 |
+
// Base z-index for all qTips
|
1943 |
+
QTIP.zindex = 15000;
|
1944 |
+
|
1945 |
+
// Define configuration defaults
|
1946 |
+
QTIP.defaults = {
|
1947 |
+
prerender: FALSE,
|
1948 |
+
id: FALSE,
|
1949 |
+
overwrite: TRUE,
|
1950 |
+
suppress: TRUE,
|
1951 |
+
content: {
|
1952 |
+
text: TRUE,
|
1953 |
+
attr: 'title',
|
1954 |
+
title: FALSE,
|
1955 |
+
button: FALSE
|
1956 |
+
},
|
1957 |
+
position: {
|
1958 |
+
my: 'top left',
|
1959 |
+
at: 'bottom right',
|
1960 |
+
target: FALSE,
|
1961 |
+
container: FALSE,
|
1962 |
+
viewport: FALSE,
|
1963 |
+
adjust: {
|
1964 |
+
x: 0, y: 0,
|
1965 |
+
mouse: TRUE,
|
1966 |
+
scroll: TRUE,
|
1967 |
+
resize: TRUE,
|
1968 |
+
method: 'flipinvert flipinvert'
|
1969 |
+
},
|
1970 |
+
effect: function(api, pos) {
|
1971 |
+
$(this).animate(pos, {
|
1972 |
+
duration: 200,
|
1973 |
+
queue: FALSE
|
1974 |
+
});
|
1975 |
+
}
|
1976 |
+
},
|
1977 |
+
show: {
|
1978 |
+
target: FALSE,
|
1979 |
+
event: 'mouseenter',
|
1980 |
+
effect: TRUE,
|
1981 |
+
delay: 90,
|
1982 |
+
solo: FALSE,
|
1983 |
+
ready: FALSE,
|
1984 |
+
autofocus: FALSE
|
1985 |
+
},
|
1986 |
+
hide: {
|
1987 |
+
target: FALSE,
|
1988 |
+
event: 'mouseleave',
|
1989 |
+
effect: TRUE,
|
1990 |
+
delay: 0,
|
1991 |
+
fixed: FALSE,
|
1992 |
+
inactive: FALSE,
|
1993 |
+
leave: 'window',
|
1994 |
+
distance: FALSE
|
1995 |
+
},
|
1996 |
+
style: {
|
1997 |
+
classes: '',
|
1998 |
+
widget: FALSE,
|
1999 |
+
width: FALSE,
|
2000 |
+
height: FALSE,
|
2001 |
+
def: TRUE
|
2002 |
+
},
|
2003 |
+
events: {
|
2004 |
+
render: NULL,
|
2005 |
+
move: NULL,
|
2006 |
+
show: NULL,
|
2007 |
+
hide: NULL,
|
2008 |
+
toggle: NULL,
|
2009 |
+
visible: NULL,
|
2010 |
+
hidden: NULL,
|
2011 |
+
focus: NULL,
|
2012 |
+
blur: NULL
|
2013 |
+
}
|
2014 |
+
};
|
2015 |
+
;var TIP,
|
2016 |
+
createVML,
|
2017 |
+
SCALE,
|
2018 |
+
PIXEL_RATIO,
|
2019 |
+
BACKING_STORE_RATIO,
|
2020 |
+
|
2021 |
+
// Common CSS strings
|
2022 |
+
MARGIN = 'margin',
|
2023 |
+
BORDER = 'border',
|
2024 |
+
COLOR = 'color',
|
2025 |
+
BG_COLOR = 'background-color',
|
2026 |
+
TRANSPARENT = 'transparent',
|
2027 |
+
IMPORTANT = ' !important',
|
2028 |
+
|
2029 |
+
// Check if the browser supports <canvas/> elements
|
2030 |
+
HASCANVAS = !!document.createElement('canvas').getContext,
|
2031 |
+
|
2032 |
+
// Invalid colour values used in parseColours()
|
2033 |
+
INVALID = /rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i;
|
2034 |
+
|
2035 |
+
// Camel-case method, taken from jQuery source
|
2036 |
+
// http://code.jquery.com/jquery-1.8.0.js
|
2037 |
+
function camel(s) { return s.charAt(0).toUpperCase() + s.slice(1); }
|
2038 |
+
|
2039 |
+
/*
|
2040 |
+
* Modified from Modernizr's testPropsAll()
|
2041 |
+
* http://modernizr.com/downloads/modernizr-latest.js
|
2042 |
+
*/
|
2043 |
+
var cssProps = {}, cssPrefixes = ['Webkit', 'O', 'Moz', 'ms'];
|
2044 |
+
function vendorCss(elem, prop) {
|
2045 |
+
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
2046 |
+
props = (prop + ' ' + cssPrefixes.join(ucProp + ' ') + ucProp).split(' '),
|
2047 |
+
cur, val, i = 0;
|
2048 |
+
|
2049 |
+
// If the property has already been mapped...
|
2050 |
+
if(cssProps[prop]) { return elem.css(cssProps[prop]); }
|
2051 |
+
|
2052 |
+
while(cur = props[i++]) {
|
2053 |
+
if((val = elem.css(cur)) !== undefined) {
|
2054 |
+
cssProps[prop] = cur;
|
2055 |
+
return val;
|
2056 |
+
}
|
2057 |
+
}
|
2058 |
+
}
|
2059 |
+
|
2060 |
+
// Parse a given elements CSS property into an int
|
2061 |
+
function intCss(elem, prop) {
|
2062 |
+
return Math.ceil(parseFloat(vendorCss(elem, prop)));
|
2063 |
+
}
|
2064 |
+
|
2065 |
+
|
2066 |
+
// VML creation (for IE only)
|
2067 |
+
if(!HASCANVAS) {
|
2068 |
+
createVML = function(tag, props, style) {
|
2069 |
+
return '<qtipvml:'+tag+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(props||'')+
|
2070 |
+
' style="behavior: url(#default#VML); '+(style||'')+ '" />';
|
2071 |
+
};
|
2072 |
+
}
|
2073 |
+
|
2074 |
+
// Canvas only definitions
|
2075 |
+
else {
|
2076 |
+
PIXEL_RATIO = window.devicePixelRatio || 1;
|
2077 |
+
BACKING_STORE_RATIO = (function() {
|
2078 |
+
var context = document.createElement('canvas').getContext('2d');
|
2079 |
+
return context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio ||
|
2080 |
+
context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1;
|
2081 |
+
})();
|
2082 |
+
SCALE = PIXEL_RATIO / BACKING_STORE_RATIO;
|
2083 |
+
}
|
2084 |
+
|
2085 |
+
|
2086 |
+
function Tip(qtip, options) {
|
2087 |
+
this._ns = 'tip';
|
2088 |
+
this.options = options;
|
2089 |
+
this.offset = options.offset;
|
2090 |
+
this.size = [ options.width, options.height ];
|
2091 |
+
|
2092 |
+
// Initialize
|
2093 |
+
this.qtip = qtip;
|
2094 |
+
this.init(qtip);
|
2095 |
+
}
|
2096 |
+
|
2097 |
+
$.extend(Tip.prototype, {
|
2098 |
+
init: function(qtip) {
|
2099 |
+
var context, tip;
|
2100 |
+
|
2101 |
+
// Create tip element and prepend to the tooltip
|
2102 |
+
tip = this.element = qtip.elements.tip = $('<div />', { 'class': NAMESPACE+'-tip' }).prependTo(qtip.tooltip);
|
2103 |
+
|
2104 |
+
// Create tip drawing element(s)
|
2105 |
+
if(HASCANVAS) {
|
2106 |
+
// save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()!
|
2107 |
+
context = $('<canvas />').appendTo(this.element)[0].getContext('2d');
|
2108 |
+
|
2109 |
+
// Setup constant parameters
|
2110 |
+
context.lineJoin = 'miter';
|
2111 |
+
context.miterLimit = 100000;
|
2112 |
+
context.save();
|
2113 |
+
}
|
2114 |
+
else {
|
2115 |
+
context = createVML('shape', 'coordorigin="0,0"', 'position:absolute;');
|
2116 |
+
this.element.html(context + context);
|
2117 |
+
|
2118 |
+
// Prevent mousing down on the tip since it causes problems with .live() handling in IE due to VML
|
2119 |
+
qtip._bind( $('*', tip).add(tip), ['click', 'mousedown'], function(event) { event.stopPropagation(); }, this._ns);
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
// Bind update events
|
2123 |
+
qtip._bind(qtip.tooltip, 'tooltipmove', this.reposition, this._ns, this);
|
2124 |
+
|
2125 |
+
// Create it
|
2126 |
+
this.create();
|
2127 |
+
},
|
2128 |
+
|
2129 |
+
_swapDimensions: function() {
|
2130 |
+
this.size[0] = this.options.height;
|
2131 |
+
this.size[1] = this.options.width;
|
2132 |
+
},
|
2133 |
+
_resetDimensions: function() {
|
2134 |
+
this.size[0] = this.options.width;
|
2135 |
+
this.size[1] = this.options.height;
|
2136 |
+
},
|
2137 |
+
|
2138 |
+
_useTitle: function(corner) {
|
2139 |
+
var titlebar = this.qtip.elements.titlebar;
|
2140 |
+
return titlebar && (
|
2141 |
+
corner.y === TOP || corner.y === CENTER && this.element.position().top + this.size[1] / 2 + this.options.offset < titlebar.outerHeight(TRUE)
|
2142 |
+
);
|
2143 |
+
},
|
2144 |
+
|
2145 |
+
_parseCorner: function(corner) {
|
2146 |
+
var my = this.qtip.options.position.my;
|
2147 |
+
|
2148 |
+
// Detect corner and mimic properties
|
2149 |
+
if(corner === FALSE || my === FALSE) {
|
2150 |
+
corner = FALSE;
|
2151 |
+
}
|
2152 |
+
else if(corner === TRUE) {
|
2153 |
+
corner = new CORNER( my.string() );
|
2154 |
+
}
|
2155 |
+
else if(!corner.string) {
|
2156 |
+
corner = new CORNER(corner);
|
2157 |
+
corner.fixed = TRUE;
|
2158 |
+
}
|
2159 |
+
|
2160 |
+
return corner;
|
2161 |
+
},
|
2162 |
+
|
2163 |
+
_parseWidth: function(corner, side, use) {
|
2164 |
+
var elements = this.qtip.elements,
|
2165 |
+
prop = BORDER + camel(side) + 'Width';
|
2166 |
+
|
2167 |
+
return (use ? intCss(use, prop) :
|
2168 |
+
intCss(elements.content, prop) ||
|
2169 |
+
intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) ||
|
2170 |
+
intCss(elements.tooltip, prop)
|
2171 |
+
) || 0;
|
2172 |
+
},
|
2173 |
+
|
2174 |
+
_parseRadius: function(corner) {
|
2175 |
+
var elements = this.qtip.elements,
|
2176 |
+
prop = BORDER + camel(corner.y) + camel(corner.x) + 'Radius';
|
2177 |
+
|
2178 |
+
return BROWSER.ie < 9 ? 0 :
|
2179 |
+
intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) ||
|
2180 |
+
intCss(elements.tooltip, prop) || 0;
|
2181 |
+
},
|
2182 |
+
|
2183 |
+
_invalidColour: function(elem, prop, compare) {
|
2184 |
+
var val = elem.css(prop);
|
2185 |
+
return !val || compare && val === elem.css(compare) || INVALID.test(val) ? FALSE : val;
|
2186 |
+
},
|
2187 |
+
|
2188 |
+
_parseColours: function(corner) {
|
2189 |
+
var elements = this.qtip.elements,
|
2190 |
+
tip = this.element.css('cssText', ''),
|
2191 |
+
borderSide = BORDER + camel(corner[ corner.precedance ]) + camel(COLOR),
|
2192 |
+
colorElem = this._useTitle(corner) && elements.titlebar || elements.content,
|
2193 |
+
css = this._invalidColour, color = [];
|
2194 |
+
|
2195 |
+
// Attempt to detect the background colour from various elements, left-to-right precedance
|
2196 |
+
color[0] = css(tip, BG_COLOR) || css(colorElem, BG_COLOR) || css(elements.content, BG_COLOR) ||
|
2197 |
+
css(elements.tooltip, BG_COLOR) || tip.css(BG_COLOR);
|
2198 |
+
|
2199 |
+
// Attempt to detect the correct border side colour from various elements, left-to-right precedance
|
2200 |
+
color[1] = css(tip, borderSide, COLOR) || css(colorElem, borderSide, COLOR) ||
|
2201 |
+
css(elements.content, borderSide, COLOR) || css(elements.tooltip, borderSide, COLOR) || elements.tooltip.css(borderSide);
|
2202 |
+
|
2203 |
+
// Reset background and border colours
|
2204 |
+
$('*', tip).add(tip).css('cssText', BG_COLOR+':'+TRANSPARENT+IMPORTANT+';'+BORDER+':0'+IMPORTANT+';');
|
2205 |
+
|
2206 |
+
return color;
|
2207 |
+
},
|
2208 |
+
|
2209 |
+
_calculateSize: function(corner) {
|
2210 |
+
var y = corner.precedance === Y,
|
2211 |
+
width = this.options.width,
|
2212 |
+
height = this.options.height,
|
2213 |
+
isCenter = corner.abbrev() === 'c',
|
2214 |
+
base = (y ? width: height) * (isCenter ? 0.5 : 1),
|
2215 |
+
pow = Math.pow,
|
2216 |
+
round = Math.round,
|
2217 |
+
bigHyp, ratio, result,
|
2218 |
+
|
2219 |
+
smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ),
|
2220 |
+
hyp = [
|
2221 |
+
this.border / base * smallHyp,
|
2222 |
+
this.border / height * smallHyp
|
2223 |
+
];
|
2224 |
+
|
2225 |
+
hyp[2] = Math.sqrt( pow(hyp[0], 2) - pow(this.border, 2) );
|
2226 |
+
hyp[3] = Math.sqrt( pow(hyp[1], 2) - pow(this.border, 2) );
|
2227 |
+
|
2228 |
+
bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]);
|
2229 |
+
ratio = bigHyp / smallHyp;
|
2230 |
+
|
2231 |
+
result = [ round(ratio * width), round(ratio * height) ];
|
2232 |
+
return y ? result : result.reverse();
|
2233 |
+
},
|
2234 |
+
|
2235 |
+
// Tip coordinates calculator
|
2236 |
+
_calculateTip: function(corner, size, scale) {
|
2237 |
+
scale = scale || 1;
|
2238 |
+
size = size || this.size;
|
2239 |
+
|
2240 |
+
var width = size[0] * scale,
|
2241 |
+
height = size[1] * scale,
|
2242 |
+
width2 = Math.ceil(width / 2), height2 = Math.ceil(height / 2),
|
2243 |
+
|
2244 |
+
// Define tip coordinates in terms of height and width values
|
2245 |
+
tips = {
|
2246 |
+
br: [0,0, width,height, width,0],
|
2247 |
+
bl: [0,0, width,0, 0,height],
|
2248 |
+
tr: [0,height, width,0, width,height],
|
2249 |
+
tl: [0,0, 0,height, width,height],
|
2250 |
+
tc: [0,height, width2,0, width,height],
|
2251 |
+
bc: [0,0, width,0, width2,height],
|
2252 |
+
rc: [0,0, width,height2, 0,height],
|
2253 |
+
lc: [width,0, width,height, 0,height2]
|
2254 |
+
};
|
2255 |
+
|
2256 |
+
// Set common side shapes
|
2257 |
+
tips.lt = tips.br; tips.rt = tips.bl;
|
2258 |
+
tips.lb = tips.tr; tips.rb = tips.tl;
|
2259 |
+
|
2260 |
+
return tips[ corner.abbrev() ];
|
2261 |
+
},
|
2262 |
+
|
2263 |
+
// Tip coordinates drawer (canvas)
|
2264 |
+
_drawCoords: function(context, coords) {
|
2265 |
+
context.beginPath();
|
2266 |
+
context.moveTo(coords[0], coords[1]);
|
2267 |
+
context.lineTo(coords[2], coords[3]);
|
2268 |
+
context.lineTo(coords[4], coords[5]);
|
2269 |
+
context.closePath();
|
2270 |
+
},
|
2271 |
+
|
2272 |
+
create: function() {
|
2273 |
+
// Determine tip corner
|
2274 |
+
var c = this.corner = (HASCANVAS || BROWSER.ie) && this._parseCorner(this.options.corner);
|
2275 |
+
|
2276 |
+
// If we have a tip corner...
|
2277 |
+
this.enabled = !!this.corner && this.corner.abbrev() !== 'c';
|
2278 |
+
if(this.enabled) {
|
2279 |
+
// Cache it
|
2280 |
+
this.qtip.cache.corner = c.clone();
|
2281 |
+
|
2282 |
+
// Create it
|
2283 |
+
this.update();
|
2284 |
+
}
|
2285 |
+
|
2286 |
+
// Toggle tip element
|
2287 |
+
this.element.toggle(this.enabled);
|
2288 |
+
|
2289 |
+
return this.corner;
|
2290 |
+
},
|
2291 |
+
|
2292 |
+
update: function(corner, position) {
|
2293 |
+
if(!this.enabled) { return this; }
|
2294 |
+
|
2295 |
+
var elements = this.qtip.elements,
|
2296 |
+
tip = this.element,
|
2297 |
+
inner = tip.children(),
|
2298 |
+
options = this.options,
|
2299 |
+
curSize = this.size,
|
2300 |
+
mimic = options.mimic,
|
2301 |
+
round = Math.round,
|
2302 |
+
color, precedance, context,
|
2303 |
+
coords, bigCoords, translate, newSize, border;
|
2304 |
+
|
2305 |
+
// Re-determine tip if not already set
|
2306 |
+
if(!corner) { corner = this.qtip.cache.corner || this.corner; }
|
2307 |
+
|
2308 |
+
// Use corner property if we detect an invalid mimic value
|
2309 |
+
if(mimic === FALSE) { mimic = corner; }
|
2310 |
+
|
2311 |
+
// Otherwise inherit mimic properties from the corner object as necessary
|
2312 |
+
else {
|
2313 |
+
mimic = new CORNER(mimic);
|
2314 |
+
mimic.precedance = corner.precedance;
|
2315 |
+
|
2316 |
+
if(mimic.x === 'inherit') { mimic.x = corner.x; }
|
2317 |
+
else if(mimic.y === 'inherit') { mimic.y = corner.y; }
|
2318 |
+
else if(mimic.x === mimic.y) {
|
2319 |
+
mimic[ corner.precedance ] = corner[ corner.precedance ];
|
2320 |
+
}
|
2321 |
+
}
|
2322 |
+
precedance = mimic.precedance;
|
2323 |
+
|
2324 |
+
// Ensure the tip width.height are relative to the tip position
|
2325 |
+
if(corner.precedance === X) { this._swapDimensions(); }
|
2326 |
+
else { this._resetDimensions(); }
|
2327 |
+
|
2328 |
+
// Update our colours
|
2329 |
+
color = this.color = this._parseColours(corner);
|
2330 |
+
|
2331 |
+
// Detect border width, taking into account colours
|
2332 |
+
if(color[1] !== TRANSPARENT) {
|
2333 |
+
// Grab border width
|
2334 |
+
border = this.border = this._parseWidth(corner, corner[corner.precedance]);
|
2335 |
+
|
2336 |
+
// If border width isn't zero, use border color as fill if it's not invalid (1.0 style tips)
|
2337 |
+
if(options.border && border < 1 && !INVALID.test(color[1])) { color[0] = color[1]; }
|
2338 |
+
|
2339 |
+
// Set border width (use detected border width if options.border is true)
|
2340 |
+
this.border = border = options.border !== TRUE ? options.border : border;
|
2341 |
+
}
|
2342 |
+
|
2343 |
+
// Border colour was invalid, set border to zero
|
2344 |
+
else { this.border = border = 0; }
|
2345 |
+
|
2346 |
+
// Determine tip size
|
2347 |
+
newSize = this.size = this._calculateSize(corner);
|
2348 |
+
tip.css({
|
2349 |
+
width: newSize[0],
|
2350 |
+
height: newSize[1],
|
2351 |
+
lineHeight: newSize[1]+'px'
|
2352 |
+
});
|
2353 |
+
|
2354 |
+
// Calculate tip translation
|
2355 |
+
if(corner.precedance === Y) {
|
2356 |
+
translate = [
|
2357 |
+
round(mimic.x === LEFT ? border : mimic.x === RIGHT ? newSize[0] - curSize[0] - border : (newSize[0] - curSize[0]) / 2),
|
2358 |
+
round(mimic.y === TOP ? newSize[1] - curSize[1] : 0)
|
2359 |
+
];
|
2360 |
+
}
|
2361 |
+
else {
|
2362 |
+
translate = [
|
2363 |
+
round(mimic.x === LEFT ? newSize[0] - curSize[0] : 0),
|
2364 |
+
round(mimic.y === TOP ? border : mimic.y === BOTTOM ? newSize[1] - curSize[1] - border : (newSize[1] - curSize[1]) / 2)
|
2365 |
+
];
|
2366 |
+
}
|
2367 |
+
|
2368 |
+
// Canvas drawing implementation
|
2369 |
+
if(HASCANVAS) {
|
2370 |
+
// Grab canvas context and clear/save it
|
2371 |
+
context = inner[0].getContext('2d');
|
2372 |
+
context.restore(); context.save();
|
2373 |
+
context.clearRect(0,0,6000,6000);
|
2374 |
+
|
2375 |
+
// Calculate coordinates
|
2376 |
+
coords = this._calculateTip(mimic, curSize, SCALE);
|
2377 |
+
bigCoords = this._calculateTip(mimic, this.size, SCALE);
|
2378 |
+
|
2379 |
+
// Set the canvas size using calculated size
|
2380 |
+
inner.attr(WIDTH, newSize[0] * SCALE).attr(HEIGHT, newSize[1] * SCALE);
|
2381 |
+
inner.css(WIDTH, newSize[0]).css(HEIGHT, newSize[1]);
|
2382 |
+
|
2383 |
+
// Draw the outer-stroke tip
|
2384 |
+
this._drawCoords(context, bigCoords);
|
2385 |
+
context.fillStyle = color[1];
|
2386 |
+
context.fill();
|
2387 |
+
|
2388 |
+
// Draw the actual tip
|
2389 |
+
context.translate(translate[0] * SCALE, translate[1] * SCALE);
|
2390 |
+
this._drawCoords(context, coords);
|
2391 |
+
context.fillStyle = color[0];
|
2392 |
+
context.fill();
|
2393 |
+
}
|
2394 |
+
|
2395 |
+
// VML (IE Proprietary implementation)
|
2396 |
+
else {
|
2397 |
+
// Calculate coordinates
|
2398 |
+
coords = this._calculateTip(mimic);
|
2399 |
+
|
2400 |
+
// Setup coordinates string
|
2401 |
+
coords = 'm' + coords[0] + ',' + coords[1] + ' l' + coords[2] +
|
2402 |
+
',' + coords[3] + ' ' + coords[4] + ',' + coords[5] + ' xe';
|
2403 |
+
|
2404 |
+
// Setup VML-specific offset for pixel-perfection
|
2405 |
+
translate[2] = border && /^(r|b)/i.test(corner.string()) ?
|
2406 |
+
BROWSER.ie === 8 ? 2 : 1 : 0;
|
2407 |
+
|
2408 |
+
// Set initial CSS
|
2409 |
+
inner.css({
|
2410 |
+
coordsize: newSize[0]+border + ' ' + newSize[1]+border,
|
2411 |
+
antialias: ''+(mimic.string().indexOf(CENTER) > -1),
|
2412 |
+
left: translate[0] - translate[2] * Number(precedance === X),
|
2413 |
+
top: translate[1] - translate[2] * Number(precedance === Y),
|
2414 |
+
width: newSize[0] + border,
|
2415 |
+
height: newSize[1] + border
|
2416 |
+
})
|
2417 |
+
.each(function(i) {
|
2418 |
+
var $this = $(this);
|
2419 |
+
|
2420 |
+
// Set shape specific attributes
|
2421 |
+
$this[ $this.prop ? 'prop' : 'attr' ]({
|
2422 |
+
coordsize: newSize[0]+border + ' ' + newSize[1]+border,
|
2423 |
+
path: coords,
|
2424 |
+
fillcolor: color[0],
|
2425 |
+
filled: !!i,
|
2426 |
+
stroked: !i
|
2427 |
+
})
|
2428 |
+
.toggle(!!(border || i));
|
2429 |
+
|
2430 |
+
// Check if border is enabled and add stroke element
|
2431 |
+
!i && $this.html( createVML(
|
2432 |
+
'stroke', 'weight="'+border*2+'px" color="'+color[1]+'" miterlimit="1000" joinstyle="miter"'
|
2433 |
+
) );
|
2434 |
+
});
|
2435 |
+
}
|
2436 |
+
|
2437 |
+
// Opera bug #357 - Incorrect tip position
|
2438 |
+
// https://github.com/Craga89/qTip2/issues/367
|
2439 |
+
window.opera && setTimeout(function() {
|
2440 |
+
elements.tip.css({
|
2441 |
+
display: 'inline-block',
|
2442 |
+
visibility: 'visible'
|
2443 |
+
});
|
2444 |
+
}, 1);
|
2445 |
+
|
2446 |
+
// Position if needed
|
2447 |
+
if(position !== FALSE) { this.calculate(corner, newSize); }
|
2448 |
+
},
|
2449 |
+
|
2450 |
+
calculate: function(corner, size) {
|
2451 |
+
if(!this.enabled) { return FALSE; }
|
2452 |
+
|
2453 |
+
var self = this,
|
2454 |
+
elements = this.qtip.elements,
|
2455 |
+
tip = this.element,
|
2456 |
+
userOffset = this.options.offset,
|
2457 |
+
position = {},
|
2458 |
+
precedance, corners;
|
2459 |
+
|
2460 |
+
// Inherit corner if not provided
|
2461 |
+
corner = corner || this.corner;
|
2462 |
+
precedance = corner.precedance;
|
2463 |
+
|
2464 |
+
// Determine which tip dimension to use for adjustment
|
2465 |
+
size = size || this._calculateSize(corner);
|
2466 |
+
|
2467 |
+
// Setup corners and offset array
|
2468 |
+
corners = [ corner.x, corner.y ];
|
2469 |
+
if(precedance === X) { corners.reverse(); }
|
2470 |
+
|
2471 |
+
// Calculate tip position
|
2472 |
+
$.each(corners, function(i, side) {
|
2473 |
+
var b, bc, br;
|
2474 |
+
|
2475 |
+
if(side === CENTER) {
|
2476 |
+
b = precedance === Y ? LEFT : TOP;
|
2477 |
+
position[ b ] = '50%';
|
2478 |
+
position[MARGIN+'-' + b] = -Math.round(size[ precedance === Y ? 0 : 1 ] / 2) + userOffset;
|
2479 |
+
}
|
2480 |
+
else {
|
2481 |
+
b = self._parseWidth(corner, side, elements.tooltip);
|
2482 |
+
bc = self._parseWidth(corner, side, elements.content);
|
2483 |
+
br = self._parseRadius(corner);
|
2484 |
+
|
2485 |
+
position[ side ] = Math.max(-self.border, i ? bc : userOffset + (br > b ? br : -b));
|
2486 |
+
}
|
2487 |
+
});
|
2488 |
+
|
2489 |
+
// Adjust for tip size
|
2490 |
+
position[ corner[precedance] ] -= size[ precedance === X ? 0 : 1 ];
|
2491 |
+
|
2492 |
+
// Set and return new position
|
2493 |
+
tip.css({ margin: '', top: '', bottom: '', left: '', right: '' }).css(position);
|
2494 |
+
return position;
|
2495 |
+
},
|
2496 |
+
|
2497 |
+
reposition: function(event, api, pos) {
|
2498 |
+
if(!this.enabled) { return; }
|
2499 |
+
|
2500 |
+
var cache = api.cache,
|
2501 |
+
newCorner = this.corner.clone(),
|
2502 |
+
adjust = pos.adjusted,
|
2503 |
+
method = api.options.position.adjust.method.split(' '),
|
2504 |
+
horizontal = method[0],
|
2505 |
+
vertical = method[1] || method[0],
|
2506 |
+
shift = { left: FALSE, top: FALSE, x: 0, y: 0 },
|
2507 |
+
offset, css = {}, props;
|
2508 |
+
|
2509 |
+
function shiftflip(direction, precedance, popposite, side, opposite) {
|
2510 |
+
// Horizontal - Shift or flip method
|
2511 |
+
if(direction === SHIFT && newCorner.precedance === precedance && adjust[side] && newCorner[popposite] !== CENTER) {
|
2512 |
+
newCorner.precedance = newCorner.precedance === X ? Y : X;
|
2513 |
+
}
|
2514 |
+
else if(direction !== SHIFT && adjust[side]){
|
2515 |
+
newCorner[precedance] = newCorner[precedance] === CENTER ?
|
2516 |
+
adjust[side] > 0 ? side : opposite :
|
2517 |
+
newCorner[precedance] === side ? opposite : side;
|
2518 |
+
}
|
2519 |
+
}
|
2520 |
+
|
2521 |
+
function shiftonly(xy, side, opposite) {
|
2522 |
+
if(newCorner[xy] === CENTER) {
|
2523 |
+
css[MARGIN+'-'+side] = shift[xy] = offset[MARGIN+'-'+side] - adjust[side];
|
2524 |
+
}
|
2525 |
+
else {
|
2526 |
+
props = offset[opposite] !== undefined ?
|
2527 |
+
[ adjust[side], -offset[side] ] : [ -adjust[side], offset[side] ];
|
2528 |
+
|
2529 |
+
if( (shift[xy] = Math.max(props[0], props[1])) > props[0] ) {
|
2530 |
+
pos[side] -= adjust[side];
|
2531 |
+
shift[side] = FALSE;
|
2532 |
+
}
|
2533 |
+
|
2534 |
+
css[ offset[opposite] !== undefined ? opposite : side ] = shift[xy];
|
2535 |
+
}
|
2536 |
+
}
|
2537 |
+
|
2538 |
+
// If our tip position isn't fixed e.g. doesn't adjust with viewport...
|
2539 |
+
if(this.corner.fixed !== TRUE) {
|
2540 |
+
// Perform shift/flip adjustments
|
2541 |
+
shiftflip(horizontal, X, Y, LEFT, RIGHT);
|
2542 |
+
shiftflip(vertical, Y, X, TOP, BOTTOM);
|
2543 |
+
|
2544 |
+
// Update and redraw the tip if needed (check cached details of last drawn tip)
|
2545 |
+
if(newCorner.string() !== cache.corner.string() || cache.cornerTop !== adjust.top || cache.cornerLeft !== adjust.left) {
|
2546 |
+
this.update(newCorner, FALSE);
|
2547 |
+
}
|
2548 |
+
}
|
2549 |
+
|
2550 |
+
// Setup tip offset properties
|
2551 |
+
offset = this.calculate(newCorner);
|
2552 |
+
|
2553 |
+
// Readjust offset object to make it left/top
|
2554 |
+
if(offset.right !== undefined) { offset.left = -offset.right; }
|
2555 |
+
if(offset.bottom !== undefined) { offset.top = -offset.bottom; }
|
2556 |
+
offset.user = this.offset;
|
2557 |
+
|
2558 |
+
// Perform shift adjustments
|
2559 |
+
shift.left = horizontal === SHIFT && !!adjust.left;
|
2560 |
+
if(shift.left) {
|
2561 |
+
shiftonly(X, LEFT, RIGHT);
|
2562 |
+
}
|
2563 |
+
shift.top = vertical === SHIFT && !!adjust.top;
|
2564 |
+
if(shift.top) {
|
2565 |
+
shiftonly(Y, TOP, BOTTOM);
|
2566 |
+
}
|
2567 |
+
|
2568 |
+
/*
|
2569 |
+
* If the tip is adjusted in both dimensions, or in a
|
2570 |
+
* direction that would cause it to be anywhere but the
|
2571 |
+
* outer border, hide it!
|
2572 |
+
*/
|
2573 |
+
this.element.css(css).toggle(
|
2574 |
+
!(shift.x && shift.y || newCorner.x === CENTER && shift.y || newCorner.y === CENTER && shift.x)
|
2575 |
+
);
|
2576 |
+
|
2577 |
+
// Adjust position to accomodate tip dimensions
|
2578 |
+
pos.left -= offset.left.charAt ? offset.user :
|
2579 |
+
horizontal !== SHIFT || shift.top || !shift.left && !shift.top ? offset.left + this.border : 0;
|
2580 |
+
pos.top -= offset.top.charAt ? offset.user :
|
2581 |
+
vertical !== SHIFT || shift.left || !shift.left && !shift.top ? offset.top + this.border : 0;
|
2582 |
+
|
2583 |
+
// Cache details
|
2584 |
+
cache.cornerLeft = adjust.left; cache.cornerTop = adjust.top;
|
2585 |
+
cache.corner = newCorner.clone();
|
2586 |
+
},
|
2587 |
+
|
2588 |
+
destroy: function() {
|
2589 |
+
// Unbind events
|
2590 |
+
this.qtip._unbind(this.qtip.tooltip, this._ns);
|
2591 |
+
|
2592 |
+
// Remove the tip element(s)
|
2593 |
+
if(this.qtip.elements.tip) {
|
2594 |
+
this.qtip.elements.tip.find('*')
|
2595 |
+
.remove().end().remove();
|
2596 |
+
}
|
2597 |
+
}
|
2598 |
+
});
|
2599 |
+
|
2600 |
+
TIP = PLUGINS.tip = function(api) {
|
2601 |
+
return new Tip(api, api.options.style.tip);
|
2602 |
+
};
|
2603 |
+
|
2604 |
+
// Initialize tip on render
|
2605 |
+
TIP.initialize = 'render';
|
2606 |
+
|
2607 |
+
// Setup plugin sanitization options
|
2608 |
+
TIP.sanitize = function(options) {
|
2609 |
+
if(options.style && 'tip' in options.style) {
|
2610 |
+
var opts = options.style.tip;
|
2611 |
+
if(typeof opts !== 'object') { opts = options.style.tip = { corner: opts }; }
|
2612 |
+
if(!(/string|boolean/i).test(typeof opts.corner)) { opts.corner = TRUE; }
|
2613 |
+
}
|
2614 |
+
};
|
2615 |
+
|
2616 |
+
// Add new option checks for the plugin
|
2617 |
+
CHECKS.tip = {
|
2618 |
+
'^position.my|style.tip.(corner|mimic|border)$': function() {
|
2619 |
+
// Make sure a tip can be drawn
|
2620 |
+
this.create();
|
2621 |
+
|
2622 |
+
// Reposition the tooltip
|
2623 |
+
this.qtip.reposition();
|
2624 |
+
},
|
2625 |
+
'^style.tip.(height|width)$': function(obj) {
|
2626 |
+
// Re-set dimensions and redraw the tip
|
2627 |
+
this.size = [ obj.width, obj.height ];
|
2628 |
+
this.update();
|
2629 |
+
|
2630 |
+
// Reposition the tooltip
|
2631 |
+
this.qtip.reposition();
|
2632 |
+
},
|
2633 |
+
'^content.title|style.(classes|widget)$': function() {
|
2634 |
+
this.update();
|
2635 |
+
}
|
2636 |
+
};
|
2637 |
+
|
2638 |
+
// Extend original qTip defaults
|
2639 |
+
$.extend(TRUE, QTIP.defaults, {
|
2640 |
+
style: {
|
2641 |
+
tip: {
|
2642 |
+
corner: TRUE,
|
2643 |
+
mimic: FALSE,
|
2644 |
+
width: 6,
|
2645 |
+
height: 6,
|
2646 |
+
border: TRUE,
|
2647 |
+
offset: 0
|
2648 |
+
}
|
2649 |
+
}
|
2650 |
+
});
|
2651 |
+
;var MODAL, OVERLAY,
|
2652 |
+
MODALCLASS = 'qtip-modal',
|
2653 |
+
MODALSELECTOR = '.'+MODALCLASS;
|
2654 |
+
|
2655 |
+
OVERLAY = function()
|
2656 |
+
{
|
2657 |
+
var self = this,
|
2658 |
+
focusableElems = {},
|
2659 |
+
current,
|
2660 |
+
prevState,
|
2661 |
+
elem;
|
2662 |
+
|
2663 |
+
// Modified code from jQuery UI 1.10.0 source
|
2664 |
+
// http://code.jquery.com/ui/1.10.0/jquery-ui.js
|
2665 |
+
function focusable(element) {
|
2666 |
+
// Use the defined focusable checker when possible
|
2667 |
+
if($.expr[':'].focusable) { return $.expr[':'].focusable; }
|
2668 |
+
|
2669 |
+
var isTabIndexNotNaN = !isNaN($.attr(element, 'tabindex')),
|
2670 |
+
nodeName = element.nodeName && element.nodeName.toLowerCase(),
|
2671 |
+
map, mapName, img;
|
2672 |
+
|
2673 |
+
if('area' === nodeName) {
|
2674 |
+
map = element.parentNode;
|
2675 |
+
mapName = map.name;
|
2676 |
+
if(!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {
|
2677 |
+
return false;
|
2678 |
+
}
|
2679 |
+
img = $('img[usemap=#' + mapName + ']')[0];
|
2680 |
+
return !!img && img.is(':visible');
|
2681 |
+
}
|
2682 |
+
|
2683 |
+
return /input|select|textarea|button|object/.test( nodeName ) ?
|
2684 |
+
!element.disabled :
|
2685 |
+
'a' === nodeName ?
|
2686 |
+
element.href || isTabIndexNotNaN :
|
2687 |
+
isTabIndexNotNaN
|
2688 |
+
;
|
2689 |
+
}
|
2690 |
+
|
2691 |
+
// Focus inputs using cached focusable elements (see update())
|
2692 |
+
function focusInputs(blurElems) {
|
2693 |
+
// Blurring body element in IE causes window.open windows to unfocus!
|
2694 |
+
if(focusableElems.length < 1 && blurElems.length) { blurElems.not('body').blur(); }
|
2695 |
+
|
2696 |
+
// Focus the inputs
|
2697 |
+
else { focusableElems.first().focus(); }
|
2698 |
+
}
|
2699 |
+
|
2700 |
+
// Steal focus from elements outside tooltip
|
2701 |
+
function stealFocus(event) {
|
2702 |
+
if(!elem.is(':visible')) { return; }
|
2703 |
+
|
2704 |
+
var target = $(event.target),
|
2705 |
+
tooltip = current.tooltip,
|
2706 |
+
container = target.closest(SELECTOR),
|
2707 |
+
targetOnTop;
|
2708 |
+
|
2709 |
+
// Determine if input container target is above this
|
2710 |
+
targetOnTop = container.length < 1 ? FALSE :
|
2711 |
+
parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10);
|
2712 |
+
|
2713 |
+
// If we're showing a modal, but focus has landed on an input below
|
2714 |
+
// this modal, divert focus to the first visible input in this modal
|
2715 |
+
// or if we can't find one... the tooltip itself
|
2716 |
+
if(!targetOnTop && target.closest(SELECTOR)[0] !== tooltip[0]) {
|
2717 |
+
focusInputs(target);
|
2718 |
+
}
|
2719 |
+
}
|
2720 |
+
|
2721 |
+
$.extend(self, {
|
2722 |
+
init: function() {
|
2723 |
+
// Create document overlay
|
2724 |
+
elem = self.elem = $('<div />', {
|
2725 |
+
id: 'qtip-overlay',
|
2726 |
+
html: '<div></div>',
|
2727 |
+
mousedown: function() { return FALSE; }
|
2728 |
+
})
|
2729 |
+
.hide();
|
2730 |
+
|
2731 |
+
// Make sure we can't focus anything outside the tooltip
|
2732 |
+
$(document.body).on('focusin'+MODALSELECTOR, stealFocus);
|
2733 |
+
|
2734 |
+
// Apply keyboard "Escape key" close handler
|
2735 |
+
$(document).on('keydown'+MODALSELECTOR, function(event) {
|
2736 |
+
if(current && current.options.show.modal.escape && event.keyCode === 27) {
|
2737 |
+
current.hide(event);
|
2738 |
+
}
|
2739 |
+
});
|
2740 |
+
|
2741 |
+
// Apply click handler for blur option
|
2742 |
+
elem.on('click'+MODALSELECTOR, function(event) {
|
2743 |
+
if(current && current.options.show.modal.blur) {
|
2744 |
+
current.hide(event);
|
2745 |
+
}
|
2746 |
+
});
|
2747 |
+
|
2748 |
+
return self;
|
2749 |
+
},
|
2750 |
+
|
2751 |
+
update: function(api) {
|
2752 |
+
// Update current API reference
|
2753 |
+
current = api;
|
2754 |
+
|
2755 |
+
// Update focusable elements if enabled
|
2756 |
+
if(api.options.show.modal.stealfocus !== FALSE) {
|
2757 |
+
focusableElems = api.tooltip.find('*').filter(function() {
|
2758 |
+
return focusable(this);
|
2759 |
+
});
|
2760 |
+
}
|
2761 |
+
else { focusableElems = []; }
|
2762 |
+
},
|
2763 |
+
|
2764 |
+
toggle: function(api, state, duration) {
|
2765 |
+
var tooltip = api.tooltip,
|
2766 |
+
options = api.options.show.modal,
|
2767 |
+
effect = options.effect,
|
2768 |
+
type = state ? 'show': 'hide',
|
2769 |
+
visible = elem.is(':visible'),
|
2770 |
+
visibleModals = $(MODALSELECTOR).filter(':visible:not(:animated)').not(tooltip);
|
2771 |
+
|
2772 |
+
// Set active tooltip API reference
|
2773 |
+
self.update(api);
|
2774 |
+
|
2775 |
+
// If the modal can steal the focus...
|
2776 |
+
// Blur the current item and focus anything in the modal we an
|
2777 |
+
if(state && options.stealfocus !== FALSE) {
|
2778 |
+
focusInputs( $(':focus') );
|
2779 |
+
}
|
2780 |
+
|
2781 |
+
// Toggle backdrop cursor style on show
|
2782 |
+
elem.toggleClass('blurs', options.blur);
|
2783 |
+
|
2784 |
+
// Append to body on show
|
2785 |
+
if(state) {
|
2786 |
+
elem.appendTo(document.body);
|
2787 |
+
}
|
2788 |
+
|
2789 |
+
// Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible
|
2790 |
+
if(elem.is(':animated') && visible === state && prevState !== FALSE || !state && visibleModals.length) {
|
2791 |
+
return self;
|
2792 |
+
}
|
2793 |
+
|
2794 |
+
// Stop all animations
|
2795 |
+
elem.stop(TRUE, FALSE);
|
2796 |
+
|
2797 |
+
// Use custom function if provided
|
2798 |
+
if($.isFunction(effect)) {
|
2799 |
+
effect.call(elem, state);
|
2800 |
+
}
|
2801 |
+
|
2802 |
+
// If no effect type is supplied, use a simple toggle
|
2803 |
+
else if(effect === FALSE) {
|
2804 |
+
elem[ type ]();
|
2805 |
+
}
|
2806 |
+
|
2807 |
+
// Use basic fade function
|
2808 |
+
else {
|
2809 |
+
elem.fadeTo( parseInt(duration, 10) || 90, state ? 1 : 0, function() {
|
2810 |
+
if(!state) { elem.hide(); }
|
2811 |
+
});
|
2812 |
+
}
|
2813 |
+
|
2814 |
+
// Reset position and detach from body on hide
|
2815 |
+
if(!state) {
|
2816 |
+
elem.queue(function(next) {
|
2817 |
+
elem.css({ left: '', top: '' });
|
2818 |
+
if(!$(MODALSELECTOR).length) { elem.detach(); }
|
2819 |
+
next();
|
2820 |
+
});
|
2821 |
+
}
|
2822 |
+
|
2823 |
+
// Cache the state
|
2824 |
+
prevState = state;
|
2825 |
+
|
2826 |
+
// If the tooltip is destroyed, set reference to null
|
2827 |
+
if(current.destroyed) { current = NULL; }
|
2828 |
+
|
2829 |
+
return self;
|
2830 |
+
}
|
2831 |
+
});
|
2832 |
+
|
2833 |
+
self.init();
|
2834 |
+
};
|
2835 |
+
OVERLAY = new OVERLAY();
|
2836 |
+
|
2837 |
+
function Modal(api, options) {
|
2838 |
+
this.options = options;
|
2839 |
+
this._ns = '-modal';
|
2840 |
+
|
2841 |
+
this.qtip = api;
|
2842 |
+
this.init(api);
|
2843 |
+
}
|
2844 |
+
|
2845 |
+
$.extend(Modal.prototype, {
|
2846 |
+
init: function(qtip) {
|
2847 |
+
var tooltip = qtip.tooltip;
|
2848 |
+
|
2849 |
+
// If modal is disabled... return
|
2850 |
+
if(!this.options.on) { return this; }
|
2851 |
+
|
2852 |
+
// Set overlay reference
|
2853 |
+
qtip.elements.overlay = OVERLAY.elem;
|
2854 |
+
|
2855 |
+
// Add unique attribute so we can grab modal tooltips easily via a SELECTOR, and set z-index
|
2856 |
+
tooltip.addClass(MODALCLASS).css('z-index', QTIP.modal_zindex + $(MODALSELECTOR).length);
|
2857 |
+
|
2858 |
+
// Apply our show/hide/focus modal events
|
2859 |
+
qtip._bind(tooltip, ['tooltipshow', 'tooltiphide'], function(event, api, duration) {
|
2860 |
+
var oEvent = event.originalEvent;
|
2861 |
+
|
2862 |
+
// Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop
|
2863 |
+
if(event.target === tooltip[0]) {
|
2864 |
+
if(oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(OVERLAY.elem[0]).length) {
|
2865 |
+
/* eslint-disable no-empty */
|
2866 |
+
try { event.preventDefault(); }
|
2867 |
+
catch(e) {}
|
2868 |
+
/* eslint-enable no-empty */
|
2869 |
+
}
|
2870 |
+
else if(!oEvent || oEvent && oEvent.type !== 'tooltipsolo') {
|
2871 |
+
this.toggle(event, event.type === 'tooltipshow', duration);
|
2872 |
+
}
|
2873 |
+
}
|
2874 |
+
}, this._ns, this);
|
2875 |
+
|
2876 |
+
// Adjust modal z-index on tooltip focus
|
2877 |
+
qtip._bind(tooltip, 'tooltipfocus', function(event, api) {
|
2878 |
+
// If focus was cancelled before it reached us, don't do anything
|
2879 |
+
if(event.isDefaultPrevented() || event.target !== tooltip[0]) { return; }
|
2880 |
+
|
2881 |
+
var qtips = $(MODALSELECTOR),
|
2882 |
+
|
2883 |
+
// Keep the modal's lower than other, regular qtips
|
2884 |
+
newIndex = QTIP.modal_zindex + qtips.length,
|
2885 |
+
curIndex = parseInt(tooltip[0].style.zIndex, 10);
|
2886 |
+
|
2887 |
+
// Set overlay z-index
|
2888 |
+
OVERLAY.elem[0].style.zIndex = newIndex - 1;
|
2889 |
+
|
2890 |
+
// Reduce modal z-index's and keep them properly ordered
|
2891 |
+
qtips.each(function() {
|
2892 |
+
if(this.style.zIndex > curIndex) {
|
2893 |
+
this.style.zIndex -= 1;
|
2894 |
+
}
|
2895 |
+
});
|
2896 |
+
|
2897 |
+
// Fire blur event for focused tooltip
|
2898 |
+
qtips.filter('.' + CLASS_FOCUS).qtip('blur', event.originalEvent);
|
2899 |
+
|
2900 |
+
// Set the new z-index
|
2901 |
+
tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex;
|
2902 |
+
|
2903 |
+
// Set current
|
2904 |
+
OVERLAY.update(api);
|
2905 |
+
|
2906 |
+
// Prevent default handling
|
2907 |
+
/* eslint-disable no-empty */
|
2908 |
+
try { event.preventDefault(); }
|
2909 |
+
catch(e) {}
|
2910 |
+
/* eslint-enable no-empty */
|
2911 |
+
}, this._ns, this);
|
2912 |
+
|
2913 |
+
// Focus any other visible modals when this one hides
|
2914 |
+
qtip._bind(tooltip, 'tooltiphide', function(event) {
|
2915 |
+
if(event.target === tooltip[0]) {
|
2916 |
+
$(MODALSELECTOR).filter(':visible').not(tooltip).last().qtip('focus', event);
|
2917 |
+
}
|
2918 |
+
}, this._ns, this);
|
2919 |
+
},
|
2920 |
+
|
2921 |
+
toggle: function(event, state, duration) {
|
2922 |
+
// Make sure default event hasn't been prevented
|
2923 |
+
if(event && event.isDefaultPrevented()) { return this; }
|
2924 |
+
|
2925 |
+
// Toggle it
|
2926 |
+
OVERLAY.toggle(this.qtip, !!state, duration);
|
2927 |
+
},
|
2928 |
+
|
2929 |
+
destroy: function() {
|
2930 |
+
// Remove modal class
|
2931 |
+
this.qtip.tooltip.removeClass(MODALCLASS);
|
2932 |
+
|
2933 |
+
// Remove bound events
|
2934 |
+
this.qtip._unbind(this.qtip.tooltip, this._ns);
|
2935 |
+
|
2936 |
+
// Delete element reference
|
2937 |
+
OVERLAY.toggle(this.qtip, FALSE);
|
2938 |
+
delete this.qtip.elements.overlay;
|
2939 |
+
}
|
2940 |
+
});
|
2941 |
+
|
2942 |
+
|
2943 |
+
MODAL = PLUGINS.modal = function(api) {
|
2944 |
+
return new Modal(api, api.options.show.modal);
|
2945 |
+
};
|
2946 |
+
|
2947 |
+
// Setup sanitiztion rules
|
2948 |
+
MODAL.sanitize = function(opts) {
|
2949 |
+
if(opts.show) {
|
2950 |
+
if(typeof opts.show.modal !== 'object') { opts.show.modal = { on: !!opts.show.modal }; }
|
2951 |
+
else if(typeof opts.show.modal.on === 'undefined') { opts.show.modal.on = TRUE; }
|
2952 |
+
}
|
2953 |
+
};
|
2954 |
+
|
2955 |
+
// Base z-index for all modal tooltips (use qTip core z-index as a base)
|
2956 |
+
/* eslint-disable camelcase */
|
2957 |
+
QTIP.modal_zindex = QTIP.zindex - 200;
|
2958 |
+
/* eslint-enable camelcase */
|
2959 |
+
|
2960 |
+
// Plugin needs to be initialized on render
|
2961 |
+
MODAL.initialize = 'render';
|
2962 |
+
|
2963 |
+
// Setup option set checks
|
2964 |
+
CHECKS.modal = {
|
2965 |
+
'^show.modal.(on|blur)$': function() {
|
2966 |
+
// Initialise
|
2967 |
+
this.destroy();
|
2968 |
+
this.init();
|
2969 |
+
|
2970 |
+
// Show the modal if not visible already and tooltip is visible
|
2971 |
+
this.qtip.elems.overlay.toggle(
|
2972 |
+
this.qtip.tooltip[0].offsetWidth > 0
|
2973 |
+
);
|
2974 |
+
}
|
2975 |
+
};
|
2976 |
+
|
2977 |
+
// Extend original api defaults
|
2978 |
+
$.extend(TRUE, QTIP.defaults, {
|
2979 |
+
show: {
|
2980 |
+
modal: {
|
2981 |
+
on: FALSE,
|
2982 |
+
effect: TRUE,
|
2983 |
+
blur: TRUE,
|
2984 |
+
stealfocus: TRUE,
|
2985 |
+
escape: TRUE
|
2986 |
+
}
|
2987 |
+
}
|
2988 |
+
});
|
2989 |
+
;PLUGINS.viewport = function(api, position, posOptions, targetWidth, targetHeight, elemWidth, elemHeight)
|
2990 |
+
{
|
2991 |
+
var target = posOptions.target,
|
2992 |
+
tooltip = api.elements.tooltip,
|
2993 |
+
my = posOptions.my,
|
2994 |
+
at = posOptions.at,
|
2995 |
+
adjust = posOptions.adjust,
|
2996 |
+
method = adjust.method.split(' '),
|
2997 |
+
methodX = method[0],
|
2998 |
+
methodY = method[1] || method[0],
|
2999 |
+
viewport = posOptions.viewport,
|
3000 |
+
container = posOptions.container,
|
3001 |
+
adjusted = { left: 0, top: 0 },
|
3002 |
+
fixed, newMy, containerOffset, containerStatic,
|
3003 |
+
viewportWidth, viewportHeight, viewportScroll, viewportOffset;
|
3004 |
+
|
3005 |
+
// If viewport is not a jQuery element, or it's the window/document, or no adjustment method is used... return
|
3006 |
+
if(!viewport.jquery || target[0] === window || target[0] === document.body || adjust.method === 'none') {
|
3007 |
+
return adjusted;
|
3008 |
+
}
|
3009 |
+
|
3010 |
+
// Cach container details
|
3011 |
+
containerOffset = container.offset() || adjusted;
|
3012 |
+
containerStatic = container.css('position') === 'static';
|
3013 |
+
|
3014 |
+
// Cache our viewport details
|
3015 |
+
fixed = tooltip.css('position') === 'fixed';
|
3016 |
+
viewportWidth = viewport[0] === window ? viewport.width() : viewport.outerWidth(FALSE);
|
3017 |
+
viewportHeight = viewport[0] === window ? viewport.height() : viewport.outerHeight(FALSE);
|
3018 |
+
viewportScroll = { left: fixed ? 0 : viewport.scrollLeft(), top: fixed ? 0 : viewport.scrollTop() };
|
3019 |
+
viewportOffset = viewport.offset() || adjusted;
|
3020 |
+
|
3021 |
+
// Generic calculation method
|
3022 |
+
function calculate(side, otherSide, type, adjustment, side1, side2, lengthName, targetLength, elemLength) {
|
3023 |
+
var initialPos = position[side1],
|
3024 |
+
mySide = my[side],
|
3025 |
+
atSide = at[side],
|
3026 |
+
isShift = type === SHIFT,
|
3027 |
+
myLength = mySide === side1 ? elemLength : mySide === side2 ? -elemLength : -elemLength / 2,
|
3028 |
+
atLength = atSide === side1 ? targetLength : atSide === side2 ? -targetLength : -targetLength / 2,
|
3029 |
+
sideOffset = viewportScroll[side1] + viewportOffset[side1] - (containerStatic ? 0 : containerOffset[side1]),
|
3030 |
+
overflow1 = sideOffset - initialPos,
|
3031 |
+
overflow2 = initialPos + elemLength - (lengthName === WIDTH ? viewportWidth : viewportHeight) - sideOffset,
|
3032 |
+
offset = myLength - (my.precedance === side || mySide === my[otherSide] ? atLength : 0) - (atSide === CENTER ? targetLength / 2 : 0);
|
3033 |
+
|
3034 |
+
// shift
|
3035 |
+
if(isShift) {
|
3036 |
+
offset = (mySide === side1 ? 1 : -1) * myLength;
|
3037 |
+
|
3038 |
+
// Adjust position but keep it within viewport dimensions
|
3039 |
+
position[side1] += overflow1 > 0 ? overflow1 : overflow2 > 0 ? -overflow2 : 0;
|
3040 |
+
position[side1] = Math.max(
|
3041 |
+
-containerOffset[side1] + viewportOffset[side1],
|
3042 |
+
initialPos - offset,
|
3043 |
+
Math.min(
|
3044 |
+
Math.max(
|
3045 |
+
-containerOffset[side1] + viewportOffset[side1] + (lengthName === WIDTH ? viewportWidth : viewportHeight),
|
3046 |
+
initialPos + offset
|
3047 |
+
),
|
3048 |
+
position[side1],
|
3049 |
+
|
3050 |
+
// Make sure we don't adjust complete off the element when using 'center'
|
3051 |
+
mySide === 'center' ? initialPos - myLength : 1E9
|
3052 |
+
)
|
3053 |
+
);
|
3054 |
+
|
3055 |
+
}
|
3056 |
+
|
3057 |
+
// flip/flipinvert
|
3058 |
+
else {
|
3059 |
+
// Update adjustment amount depending on if using flipinvert or flip
|
3060 |
+
adjustment *= type === FLIPINVERT ? 2 : 0;
|
3061 |
+
|
3062 |
+
// Check for overflow on the left/top
|
3063 |
+
if(overflow1 > 0 && (mySide !== side1 || overflow2 > 0)) {
|
3064 |
+
position[side1] -= offset + adjustment;
|
3065 |
+
newMy.invert(side, side1);
|
3066 |
+
}
|
3067 |
+
|
3068 |
+
// Check for overflow on the bottom/right
|
3069 |
+
else if(overflow2 > 0 && (mySide !== side2 || overflow1 > 0) ) {
|
3070 |
+
position[side1] -= (mySide === CENTER ? -offset : offset) + adjustment;
|
3071 |
+
newMy.invert(side, side2);
|
3072 |
+
}
|
3073 |
+
|
3074 |
+
// Make sure we haven't made things worse with the adjustment and reset if so
|
3075 |
+
if(position[side1] < viewportScroll[side1] && -position[side1] > overflow2) {
|
3076 |
+
position[side1] = initialPos; newMy = my.clone();
|
3077 |
+
}
|
3078 |
+
}
|
3079 |
+
|
3080 |
+
return position[side1] - initialPos;
|
3081 |
+
}
|
3082 |
+
|
3083 |
+
// Set newMy if using flip or flipinvert methods
|
3084 |
+
if(methodX !== 'shift' || methodY !== 'shift') { newMy = my.clone(); }
|
3085 |
+
|
3086 |
+
// Adjust position based onviewport and adjustment options
|
3087 |
+
adjusted = {
|
3088 |
+
left: methodX !== 'none' ? calculate( X, Y, methodX, adjust.x, LEFT, RIGHT, WIDTH, targetWidth, elemWidth ) : 0,
|
3089 |
+
top: methodY !== 'none' ? calculate( Y, X, methodY, adjust.y, TOP, BOTTOM, HEIGHT, targetHeight, elemHeight ) : 0,
|
3090 |
+
my: newMy
|
3091 |
+
};
|
3092 |
+
|
3093 |
+
return adjusted;
|
3094 |
+
};
|
3095 |
+
;PLUGINS.polys = {
|
3096 |
+
// POLY area coordinate calculator
|
3097 |
+
// Special thanks to Ed Cradock for helping out with this.
|
3098 |
+
// Uses a binary search algorithm to find suitable coordinates.
|
3099 |
+
polygon: function(baseCoords, corner) {
|
3100 |
+
var result = {
|
3101 |
+
width: 0, height: 0,
|
3102 |
+
position: {
|
3103 |
+
top: 1e10, right: 0,
|
3104 |
+
bottom: 0, left: 1e10
|
3105 |
+
},
|
3106 |
+
adjustable: FALSE
|
3107 |
+
},
|
3108 |
+
i = 0, next,
|
3109 |
+
coords = [],
|
3110 |
+
compareX = 1, compareY = 1,
|
3111 |
+
realX = 0, realY = 0,
|
3112 |
+
newWidth, newHeight;
|
3113 |
+
|
3114 |
+
// First pass, sanitize coords and determine outer edges
|
3115 |
+
i = baseCoords.length;
|
3116 |
+
while(i--) {
|
3117 |
+
next = [ parseInt(baseCoords[--i], 10), parseInt(baseCoords[i+1], 10) ];
|
3118 |
+
|
3119 |
+
if(next[0] > result.position.right){ result.position.right = next[0]; }
|
3120 |
+
if(next[0] < result.position.left){ result.position.left = next[0]; }
|
3121 |
+
if(next[1] > result.position.bottom){ result.position.bottom = next[1]; }
|
3122 |
+
if(next[1] < result.position.top){ result.position.top = next[1]; }
|
3123 |
+
|
3124 |
+
coords.push(next);
|
3125 |
+
}
|
3126 |
+
|
3127 |
+
// Calculate height and width from outer edges
|
3128 |
+
newWidth = result.width = Math.abs(result.position.right - result.position.left);
|
3129 |
+
newHeight = result.height = Math.abs(result.position.bottom - result.position.top);
|
3130 |
+
|
3131 |
+
// If it's the center corner...
|
3132 |
+
if(corner.abbrev() === 'c') {
|
3133 |
+
result.position = {
|
3134 |
+
left: result.position.left + result.width / 2,
|
3135 |
+
top: result.position.top + result.height / 2
|
3136 |
+
};
|
3137 |
+
}
|
3138 |
+
else {
|
3139 |
+
// Second pass, use a binary search algorithm to locate most suitable coordinate
|
3140 |
+
while(newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0)
|
3141 |
+
{
|
3142 |
+
newWidth = Math.floor(newWidth / 2);
|
3143 |
+
newHeight = Math.floor(newHeight / 2);
|
3144 |
+
|
3145 |
+
if(corner.x === LEFT){ compareX = newWidth; }
|
3146 |
+
else if(corner.x === RIGHT){ compareX = result.width - newWidth; }
|
3147 |
+
else{ compareX += Math.floor(newWidth / 2); }
|
3148 |
+
|
3149 |
+
if(corner.y === TOP){ compareY = newHeight; }
|
3150 |
+
else if(corner.y === BOTTOM){ compareY = result.height - newHeight; }
|
3151 |
+
else{ compareY += Math.floor(newHeight / 2); }
|
3152 |
+
|
3153 |
+
i = coords.length;
|
3154 |
+
while(i--)
|
3155 |
+
{
|
3156 |
+
if(coords.length < 2){ break; }
|
3157 |
+
|
3158 |
+
realX = coords[i][0] - result.position.left;
|
3159 |
+
realY = coords[i][1] - result.position.top;
|
3160 |
+
|
3161 |
+
if(
|
3162 |
+
corner.x === LEFT && realX >= compareX ||
|
3163 |
+
corner.x === RIGHT && realX <= compareX ||
|
3164 |
+
corner.x === CENTER && (realX < compareX || realX > result.width - compareX) ||
|
3165 |
+
corner.y === TOP && realY >= compareY ||
|
3166 |
+
corner.y === BOTTOM && realY <= compareY ||
|
3167 |
+
corner.y === CENTER && (realY < compareY || realY > result.height - compareY)) {
|
3168 |
+
coords.splice(i, 1);
|
3169 |
+
}
|
3170 |
+
}
|
3171 |
+
}
|
3172 |
+
result.position = { left: coords[0][0], top: coords[0][1] };
|
3173 |
+
}
|
3174 |
+
|
3175 |
+
return result;
|
3176 |
+
},
|
3177 |
+
|
3178 |
+
rect: function(ax, ay, bx, by) {
|
3179 |
+
return {
|
3180 |
+
width: Math.abs(bx - ax),
|
3181 |
+
height: Math.abs(by - ay),
|
3182 |
+
position: {
|
3183 |
+
left: Math.min(ax, bx),
|
3184 |
+
top: Math.min(ay, by)
|
3185 |
+
}
|
3186 |
+
};
|
3187 |
+
},
|
3188 |
+
|
3189 |
+
_angles: {
|
3190 |
+
tc: 3 / 2, tr: 7 / 4, tl: 5 / 4,
|
3191 |
+
bc: 1 / 2, br: 1 / 4, bl: 3 / 4,
|
3192 |
+
rc: 2, lc: 1, c: 0
|
3193 |
+
},
|
3194 |
+
ellipse: function(cx, cy, rx, ry, corner) {
|
3195 |
+
var c = PLUGINS.polys._angles[ corner.abbrev() ],
|
3196 |
+
rxc = c === 0 ? 0 : rx * Math.cos( c * Math.PI ),
|
3197 |
+
rys = ry * Math.sin( c * Math.PI );
|
3198 |
+
|
3199 |
+
return {
|
3200 |
+
width: rx * 2 - Math.abs(rxc),
|
3201 |
+
height: ry * 2 - Math.abs(rys),
|
3202 |
+
position: {
|
3203 |
+
left: cx + rxc,
|
3204 |
+
top: cy + rys
|
3205 |
+
},
|
3206 |
+
adjustable: FALSE
|
3207 |
+
};
|
3208 |
+
},
|
3209 |
+
circle: function(cx, cy, r, corner) {
|
3210 |
+
return PLUGINS.polys.ellipse(cx, cy, r, r, corner);
|
3211 |
+
}
|
3212 |
+
};
|
3213 |
+
;PLUGINS.svg = function(api, svg, corner)
|
3214 |
+
{
|
3215 |
+
var elem = svg[0],
|
3216 |
+
root = $(elem.ownerSVGElement),
|
3217 |
+
ownerDocument = elem.ownerDocument,
|
3218 |
+
strokeWidth2 = (parseInt(svg.css('stroke-width'), 10) || 0) / 2,
|
3219 |
+
frameOffset, mtx, transformed,
|
3220 |
+
len, next, i, points,
|
3221 |
+
result, position;
|
3222 |
+
|
3223 |
+
// Ascend the parentNode chain until we find an element with getBBox()
|
3224 |
+
while(!elem.getBBox) { elem = elem.parentNode; }
|
3225 |
+
if(!elem.getBBox || !elem.parentNode) { return FALSE; }
|
3226 |
+
|
3227 |
+
// Determine which shape calculation to use
|
3228 |
+
switch(elem.nodeName) {
|
3229 |
+
case 'ellipse':
|
3230 |
+
case 'circle':
|
3231 |
+
result = PLUGINS.polys.ellipse(
|
3232 |
+
elem.cx.baseVal.value,
|
3233 |
+
elem.cy.baseVal.value,
|
3234 |
+
(elem.rx || elem.r).baseVal.value + strokeWidth2,
|
3235 |
+
(elem.ry || elem.r).baseVal.value + strokeWidth2,
|
3236 |
+
corner
|
3237 |
+
);
|
3238 |
+
break;
|
3239 |
+
|
3240 |
+
case 'line':
|
3241 |
+
case 'polygon':
|
3242 |
+
case 'polyline':
|
3243 |
+
// Determine points object (line has none, so mimic using array)
|
3244 |
+
points = elem.points || [
|
3245 |
+
{ x: elem.x1.baseVal.value, y: elem.y1.baseVal.value },
|
3246 |
+
{ x: elem.x2.baseVal.value, y: elem.y2.baseVal.value }
|
3247 |
+
];
|
3248 |
+
|
3249 |
+
for(result = [], i = -1, len = points.numberOfItems || points.length; ++i < len;) {
|
3250 |
+
next = points.getItem ? points.getItem(i) : points[i];
|
3251 |
+
result.push.apply(result, [next.x, next.y]);
|
3252 |
+
}
|
3253 |
+
|
3254 |
+
result = PLUGINS.polys.polygon(result, corner);
|
3255 |
+
break;
|
3256 |
+
|
3257 |
+
// Unknown shape or rectangle? Use bounding box
|
3258 |
+
default:
|
3259 |
+
result = elem.getBBox();
|
3260 |
+
result = {
|
3261 |
+
width: result.width,
|
3262 |
+
height: result.height,
|
3263 |
+
position: {
|
3264 |
+
left: result.x,
|
3265 |
+
top: result.y
|
3266 |
+
}
|
3267 |
+
};
|
3268 |
+
break;
|
3269 |
+
}
|
3270 |
+
|
3271 |
+
// Shortcut assignments
|
3272 |
+
position = result.position;
|
3273 |
+
root = root[0];
|
3274 |
+
|
3275 |
+
// Convert position into a pixel value
|
3276 |
+
if(root.createSVGPoint) {
|
3277 |
+
mtx = elem.getScreenCTM();
|
3278 |
+
points = root.createSVGPoint();
|
3279 |
+
|
3280 |
+
points.x = position.left;
|
3281 |
+
points.y = position.top;
|
3282 |
+
transformed = points.matrixTransform( mtx );
|
3283 |
+
position.left = transformed.x;
|
3284 |
+
position.top = transformed.y;
|
3285 |
+
}
|
3286 |
+
|
3287 |
+
// Check the element is not in a child document, and if so, adjust for frame elements offset
|
3288 |
+
if(ownerDocument !== document && api.position.target !== 'mouse') {
|
3289 |
+
frameOffset = $((ownerDocument.defaultView || ownerDocument.parentWindow).frameElement).offset();
|
3290 |
+
if(frameOffset) {
|
3291 |
+
position.left += frameOffset.left;
|
3292 |
+
position.top += frameOffset.top;
|
3293 |
+
}
|
3294 |
+
}
|
3295 |
+
|
3296 |
+
// Adjust by scroll offset of owner document
|
3297 |
+
ownerDocument = $(ownerDocument);
|
3298 |
+
position.left += ownerDocument.scrollLeft();
|
3299 |
+
position.top += ownerDocument.scrollTop();
|
3300 |
+
|
3301 |
+
return result;
|
3302 |
+
};
|
3303 |
+
;PLUGINS.imagemap = function(api, area, corner)
|
3304 |
+
{
|
3305 |
+
if(!area.jquery) { area = $(area); }
|
3306 |
+
|
3307 |
+
var shape = (area.attr('shape') || 'rect').toLowerCase().replace('poly', 'polygon'),
|
3308 |
+
image = $('img[usemap="#'+area.parent('map').attr('name')+'"]'),
|
3309 |
+
coordsString = $.trim(area.attr('coords')),
|
3310 |
+
coordsArray = coordsString.replace(/,$/, '').split(','),
|
3311 |
+
imageOffset, coords, i, result, len;
|
3312 |
+
|
3313 |
+
// If we can't find the image using the map...
|
3314 |
+
if(!image.length) { return FALSE; }
|
3315 |
+
|
3316 |
+
// Pass coordinates string if polygon
|
3317 |
+
if(shape === 'polygon') {
|
3318 |
+
result = PLUGINS.polys.polygon(coordsArray, corner);
|
3319 |
+
}
|
3320 |
+
|
3321 |
+
// Otherwise parse the coordinates and pass them as arguments
|
3322 |
+
else if(PLUGINS.polys[shape]) {
|
3323 |
+
for(i = -1, len = coordsArray.length, coords = []; ++i < len;) {
|
3324 |
+
coords.push( parseInt(coordsArray[i], 10) );
|
3325 |
+
}
|
3326 |
+
|
3327 |
+
result = PLUGINS.polys[shape].apply(
|
3328 |
+
this, coords.concat(corner)
|
3329 |
+
);
|
3330 |
+
}
|
3331 |
+
|
3332 |
+
// If no shapre calculation method was found, return false
|
3333 |
+
else { return FALSE; }
|
3334 |
+
|
3335 |
+
// Make sure we account for padding and borders on the image
|
3336 |
+
imageOffset = image.offset();
|
3337 |
+
imageOffset.left += Math.ceil((image.outerWidth(FALSE) - image.width()) / 2);
|
3338 |
+
imageOffset.top += Math.ceil((image.outerHeight(FALSE) - image.height()) / 2);
|
3339 |
+
|
3340 |
+
// Add image position to offset coordinates
|
3341 |
+
result.position.left += imageOffset.left;
|
3342 |
+
result.position.top += imageOffset.top;
|
3343 |
+
|
3344 |
+
return result;
|
3345 |
+
};
|
3346 |
+
;var IE6,
|
3347 |
+
|
3348 |
+
/*
|
3349 |
+
* BGIFrame adaption (http://plugins.jquery.com/project/bgiframe)
|
3350 |
+
* Special thanks to Brandon Aaron
|
3351 |
+
*/
|
3352 |
+
BGIFRAME = '<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" ' +
|
3353 |
+
' style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); ' +
|
3354 |
+
'-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';
|
3355 |
+
|
3356 |
+
function Ie6(api) {
|
3357 |
+
this._ns = 'ie6';
|
3358 |
+
|
3359 |
+
this.qtip = api;
|
3360 |
+
this.init(api);
|
3361 |
+
}
|
3362 |
+
|
3363 |
+
$.extend(Ie6.prototype, {
|
3364 |
+
_scroll : function() {
|
3365 |
+
var overlay = this.qtip.elements.overlay;
|
3366 |
+
overlay && (overlay[0].style.top = $(window).scrollTop() + 'px');
|
3367 |
+
},
|
3368 |
+
|
3369 |
+
init: function(qtip) {
|
3370 |
+
var tooltip = qtip.tooltip;
|
3371 |
+
|
3372 |
+
// Create the BGIFrame element if needed
|
3373 |
+
if($('select, object').length < 1) {
|
3374 |
+
this.bgiframe = qtip.elements.bgiframe = $(BGIFRAME).appendTo(tooltip);
|
3375 |
+
|
3376 |
+
// Update BGIFrame on tooltip move
|
3377 |
+
qtip._bind(tooltip, 'tooltipmove', this.adjustBGIFrame, this._ns, this);
|
3378 |
+
}
|
3379 |
+
|
3380 |
+
// redraw() container for width/height calculations
|
3381 |
+
this.redrawContainer = $('<div/>', { id: NAMESPACE+'-rcontainer' })
|
3382 |
+
.appendTo(document.body);
|
3383 |
+
|
3384 |
+
// Fixup modal plugin if present too
|
3385 |
+
if( qtip.elements.overlay && qtip.elements.overlay.addClass('qtipmodal-ie6fix') ) {
|
3386 |
+
qtip._bind(window, ['scroll', 'resize'], this._scroll, this._ns, this);
|
3387 |
+
qtip._bind(tooltip, ['tooltipshow'], this._scroll, this._ns, this);
|
3388 |
+
}
|
3389 |
+
|
3390 |
+
// Set dimensions
|
3391 |
+
this.redraw();
|
3392 |
+
},
|
3393 |
+
|
3394 |
+
adjustBGIFrame: function() {
|
3395 |
+
var tooltip = this.qtip.tooltip,
|
3396 |
+
dimensions = {
|
3397 |
+
height: tooltip.outerHeight(FALSE),
|
3398 |
+
width: tooltip.outerWidth(FALSE)
|
3399 |
+
},
|
3400 |
+
plugin = this.qtip.plugins.tip,
|
3401 |
+
tip = this.qtip.elements.tip,
|
3402 |
+
tipAdjust, offset;
|
3403 |
+
|
3404 |
+
// Adjust border offset
|
3405 |
+
offset = parseInt(tooltip.css('borderLeftWidth'), 10) || 0;
|
3406 |
+
offset = { left: -offset, top: -offset };
|
3407 |
+
|
3408 |
+
// Adjust for tips plugin
|
3409 |
+
if(plugin && tip) {
|
3410 |
+
tipAdjust = plugin.corner.precedance === 'x' ? [WIDTH, LEFT] : [HEIGHT, TOP];
|
3411 |
+
offset[ tipAdjust[1] ] -= tip[ tipAdjust[0] ]();
|
3412 |
+
}
|
3413 |
+
|
3414 |
+
// Update bgiframe
|
3415 |
+
this.bgiframe.css(offset).css(dimensions);
|
3416 |
+
},
|
3417 |
+
|
3418 |
+
// Max/min width simulator function
|
3419 |
+
redraw: function() {
|
3420 |
+
if(this.qtip.rendered < 1 || this.drawing) { return this; }
|
3421 |
+
|
3422 |
+
var tooltip = this.qtip.tooltip,
|
3423 |
+
style = this.qtip.options.style,
|
3424 |
+
container = this.qtip.options.position.container,
|
3425 |
+
perc, width, max, min;
|
3426 |
+
|
3427 |
+
// Set drawing flag
|
3428 |
+
this.qtip.drawing = 1;
|
3429 |
+
|
3430 |
+
// If tooltip has a set height/width, just set it... like a boss!
|
3431 |
+
if(style.height) { tooltip.css(HEIGHT, style.height); }
|
3432 |
+
if(style.width) { tooltip.css(WIDTH, style.width); }
|
3433 |
+
|
3434 |
+
// Simulate max/min width if not set width present...
|
3435 |
+
else {
|
3436 |
+
// Reset width and add fluid class
|
3437 |
+
tooltip.css(WIDTH, '').appendTo(this.redrawContainer);
|
3438 |
+
|
3439 |
+
// Grab our tooltip width (add 1 if odd so we don't get wrapping problems.. huzzah!)
|
3440 |
+
width = tooltip.width();
|
3441 |
+
if(width % 2 < 1) { width += 1; }
|
3442 |
+
|
3443 |
+
// Grab our max/min properties
|
3444 |
+
max = tooltip.css('maxWidth') || '';
|
3445 |
+
min = tooltip.css('minWidth') || '';
|
3446 |
+
|
3447 |
+
// Parse into proper pixel values
|
3448 |
+
perc = (max + min).indexOf('%') > -1 ? container.width() / 100 : 0;
|
3449 |
+
max = (max.indexOf('%') > -1 ? perc : 1 * parseInt(max, 10)) || width;
|
3450 |
+
min = (min.indexOf('%') > -1 ? perc : 1 * parseInt(min, 10)) || 0;
|
3451 |
+
|
3452 |
+
// Determine new dimension size based on max/min/current values
|
3453 |
+
width = max + min ? Math.min(Math.max(width, min), max) : width;
|
3454 |
+
|
3455 |
+
// Set the newly calculated width and remvoe fluid class
|
3456 |
+
tooltip.css(WIDTH, Math.round(width)).appendTo(container);
|
3457 |
+
}
|
3458 |
+
|
3459 |
+
// Set drawing flag
|
3460 |
+
this.drawing = 0;
|
3461 |
+
|
3462 |
+
return this;
|
3463 |
+
},
|
3464 |
+
|
3465 |
+
destroy: function() {
|
3466 |
+
// Remove iframe
|
3467 |
+
this.bgiframe && this.bgiframe.remove();
|
3468 |
+
|
3469 |
+
// Remove bound events
|
3470 |
+
this.qtip._unbind([window, this.qtip.tooltip], this._ns);
|
3471 |
+
}
|
3472 |
+
});
|
3473 |
+
|
3474 |
+
IE6 = PLUGINS.ie6 = function(api) {
|
3475 |
+
// Proceed only if the browser is IE6
|
3476 |
+
return BROWSER.ie === 6 ? new Ie6(api) : FALSE;
|
3477 |
+
};
|
3478 |
+
|
3479 |
+
IE6.initialize = 'render';
|
3480 |
+
|
3481 |
+
CHECKS.ie6 = {
|
3482 |
+
'^content|style$': function() {
|
3483 |
+
this.redraw();
|
3484 |
+
}
|
3485 |
+
};
|
3486 |
+
;}));
|
3487 |
+
}( window, document ));
|
ui/js/qtip/jquery.qtip.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#qtip-overlay.blurs,.qtip-close{cursor:pointer}.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content,.qtip-titlebar{position:relative;overflow:hidden}.qtip-content{padding:5px 9px;text-align:left;word-wrap:break-word}.qtip-titlebar{padding:5px 35px 5px 10px;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;z-index:11;outline:0;border:1px solid transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-icon .ui-icon,.qtip-titlebar .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:normal 700 10px/13px Tahoma,sans-serif;color:inherit;background:-100em -100em no-repeat}.qtip-default{border:1px solid #F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-red,.qtip-red .qtip-icon,.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}.qtip-red{background-color:#F78B83;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-bootstrap,.qtip-rounded,.qtip-tipsy{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border:0 solid transparent;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)"}.qtip-jtools .qtip-content,.qtip-jtools .qtip-titlebar{background:0 0;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:0 0}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}#qtip-overlay,#qtip-overlay div{left:0;top:0;width:100%;height:100%}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}.qtip .qtip-tip,x:-o-prefocus{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:0 0;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed}#qtip-overlay div{position:absolute;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}
|
ui/js/qtip/jquery.qtip.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/* qtip2 v3.0.3 | Plugins: tips modal viewport svg imagemap ie6 | Styles: core basic css3 | qtip2.com | Licensed MIT | Wed May 11 2016 22:31:31 */
|
2 |
+
|
3 |
+
!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=F,this.elements={target:a},this._id=S+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:E,attr:e,onTooltip:E,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=E}function f(a){return a===F||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?E:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?(c=g(b)?E:b,b=a.content={text:c}):c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==E,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,F,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||E)&&(b.title=E))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===D?{ready:D}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(R,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)if(this.checks.hasOwnProperty(c))for(d in this.checks[c])this.checks[c].hasOwnProperty(d)&&(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return V.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(aa)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(D,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(aa)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(W)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(E,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(aa)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+S+" "))+"."+S,function(){var a=y.api[d.attr(this,U)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):F,p="html5"===f.metadata.type&&o?o[f.metadata.name]:F,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(D,{},y.defaults,f,"object"==typeof q?h(q):F,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===E||!j)return E;k.content.text=j}if(i.container.length||(i.container=m),i.target===E&&(i.target=n),k.show.target===E&&(k.show.target=n),k.show.solo===D&&(k.show.solo=i.container.closest("body")),k.hide.target===E&&(k.hide.target=n),k.position.viewport===D&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new A(i.at,D),i.my=new A(i.my),a.data(S))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===E)return E;return a.attr(T,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(ca,l).attr("title",""),g=new e(a,k,c,!!j),a.data(S,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+va.join(f+" ")+f).split(" "),h=0;if(ua[b])return a.css(ua[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return ua[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.qtip=a,this.init(a)}function w(a,b){this.options=b,this._ns="-modal",this.qtip=a,this.init(a)}function x(a){this._ns="ie6",this.qtip=a,this.init(a)}var y,z,A,B,C,D=!0,E=!1,F=null,G="x",H="y",I="width",J="height",K="top",L="left",M="bottom",N="right",O="center",P="flipinvert",Q="shift",R={},S="qtip",T="data-hasqtip",U="data-qtip-id",V=["ui-widget","ui-tooltip"],W="."+S,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Y=S+"-fixed",Z=S+"-default",$=S+"-focus",_=S+"-hover",aa=S+"-disabled",ba="_replacedByqTip",ca="oldtitle",da={ie:function(){var a,c;for(a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||E};z=e.prototype,z._when=function(a){return d.when.apply(d,a)},z.render=function(a){if(this.rendered||this.destroyed)return this;var b=this,c=this.options,e=this.cache,f=this.elements,g=c.content.text,h=c.content.title,i=c.content.button,j=c.position,k=[];return d.attr(this.target[0],"aria-describedby",this._id),e.posClass=this._createPosClass((this.position={my:j.my,at:j.at}).my),this.tooltip=f.tooltip=d("<div/>",{id:this._id,"class":[S,Z,c.style.classes,e.posClass].join(" "),width:c.style.width||"",height:c.style.height||"",tracking:"mouse"===j.target&&j.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":E,"aria-describedby":this._id+"-content","aria-hidden":D}).toggleClass(aa,this.disabled).attr(U,this.id).data(S,this).appendTo(j.container).append(f.content=d("<div />",{"class":S+"-content",id:this._id+"-content","aria-atomic":D})),this.rendered=-1,this.positioning=D,h&&(this._createTitle(),d.isFunction(h)||k.push(this._updateTitle(h,E))),i&&this._createButton(),d.isFunction(g)||k.push(this._updateContent(g,E)),this.rendered=D,this._setWidget(),d.each(R,function(a){var c;"render"===this.initialize&&(c=this(b))&&(b.plugins[a]=c)}),this._unassignEvents(),this._assignEvents(),this._when(k).then(function(){b._trigger("render"),b.positioning=E,b.hiddenDuringWait||!c.show.ready&&!a||b.toggle(D,e.event,E),b.hiddenDuringWait=E}),y.api[this.id]=this,this},z.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=D;var a,b=this.target,c=b.attr(ca);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)this.timers.hasOwnProperty(a)&&clearTimeout(this.timers[a]);b.removeData(S).removeAttr(U).removeAttr(T).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(ca),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=F,delete y.api[this.id]}}return this.destroyed?this.target:(a===D&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},B=z.checks={builtin:{"^id$":function(a,b,c,e){var f=c===D?y.nextid:c,g=S+"-"+f;f!==E&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new A(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(D)||this.toggle(D))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Z,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},z.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var ea=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,fa=/^prerender|show\.ready/i;z.set=function(a,b){if(this.destroyed)return this;var c,e=this.rendered,f=E,g=this.options;return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&fa.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=ea.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=D,d.each(a,d.proxy(j,this)),this.positioning=E,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?F:this.cache.event),this},z._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=D,a.then(function(a){return e.waiting=E,c._update(a,b)},F,function(a){return c._update(a,b)})):a===E||!a&&""!==a?E:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):E},z._waitForContent=function(a){var b=this.cache;return b.waiting=D,(d.fn.imagesLoaded?a.imagesLoaded():(new d.Deferred).resolve([])).done(function(){b.waiting=E}).promise()},z._updateContent=function(a,b){this._update(a,this.elements.content,b)},z._updateTitle=function(a,b){this._update(a,this.elements.title,b)===E&&this._removeTitle(E)},z._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":S+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":S+"-title","aria-atomic":D})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},z._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=F,a!==E&&this.reposition())},z._createPosClass=function(a){return S+"-pos-"+(a||this.options.position.my).abbrev()},z.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=D;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(E),u=k.outerHeight(E),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:L,y:K},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:L,y:K},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=da.iOS?a.innerWidth:m.width(),w=da.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):R.imagemap&&m.is("area")?f=R.imagemap(this,m,o,R.viewport?s:E):R.svg&&m&&m[0].ownerSVGElement?f=R.svg(this,m,o,R.viewport?s:E):(v=m.outerWidth(E),w=m.outerHeight(E),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(da.iOS>3.1&&da.iOS<4.1||da.iOS>=4.3&&da.iOS<4.33||!da.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==E)&&(y.left+=o.x===N?v:o.x===O?v/2:0,y.top+=o.y===M?w:o.y===O?w/2:0)}return y.left+=r.x+(n.x===N?-t:n.x===O?-t/2:0),y.top+=r.y+(n.y===M?-u:n.y===O?-u/2:0),R.viewport?(h=y.adjusted=R.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&(j.posClass=i,k.removeClass(j.posClass).addClass(i)),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===E||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),da.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=E,this):this},z.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!da.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var ga=(A=z.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,O).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?H:G}).prototype;ga.invert=function(a,b){this[a]=this[a]===L?N:this[a]===N?L:b||this[a]},ga.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===H||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},ga.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},ga.clone=function(){return new A(this.string(),this.forceY)},z.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=D),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=this.options.position,n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?F:!!this._trigger(k,[90]),this.destroyed?this:(i!==E&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,E),d.isFunction(n.title)&&this._updateTitle(n.title,E),!C&&"mouse"===m.target&&m.adjust.mouse&&(d(b).on("mousemove."+S,this._storeMouse),C=D),o||g.css("width",g.outerWidth(E)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(W,l.solo)).not(g).not(l.target).qtip("hide",new d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,C&&!d(W+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).off("mousemove."+S),C=E),this.blur(c)),j=d.proxy(function(){a?(da.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===E||q===E?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},z.show=function(a){return this.toggle(D,a)},z.hide=function(a){return this.toggle(E,a)},z.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(W),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=y.zindex+b.length;return c.hasClass($)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+$).qtip("blur",a)),c.addClass($)[0].style.zIndex=f),this},z.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass($),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},z.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(aa):this.disabled):"boolean"!=typeof a&&(a=D),this.rendered&&this.tooltip.toggleClass(aa,a).attr("aria-disabled",a),this.disabled=!!a,this)},z.enable=function(){return this.disable(E)},z._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),e.jquery?b.button=e:b.button=d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":S+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(aa)||a.hide(b),E})},z._updateButton=function(a){if(!this.rendered)return E;var b=this.elements.button;a?this._createButton():b.remove()},z._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(aa);c.removeClass(aa),aa=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(aa,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Z,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(S+"-icon",!a)},z._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},z._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).on((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},z._unbind=function(a,b){return a&&d(a).off("."+this._id+(b?"-"+b:"")),this},z._trigger=function(a,b,c){var e=new d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||F,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=E,!e.isDefaultPrevented()},z._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},z._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?E:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=D}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):E}),(c.show.ready||c.prerender)&&b.call(this,a)},z._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=d(a),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Y)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0,e=b.parents(W).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),y.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):E}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(aa)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},z._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(W,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Y)&&!c.hasClass(aa)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(_,b)}),q("["+U+"]",X,o)}),y=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=F,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],S):F;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,S);if(!a)return D;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),E;a.set(b,e)}}),g!==F?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(D,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===E||c.length<1||y.api[c]?y.nextid++:c,b=r(d(this),c,k),b===E?D:(y.api[c]=b,d.each(R,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,y.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&f.options&&"object"==typeof f&&"object"==typeof f.options&&f.options.suppress)return arguments.length<2?d.attr(c,ca):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(ca,b))}return d.fn["attr"+ba].apply(this,arguments)},clone:function(a){var b=d.fn["clone"+ba].apply(this,arguments);return a||b.filter("["+ca+"]").attr("title",function(){return d.attr(this,ca)}).removeAttr(ca),b}},function(a,b){if(!b||d.fn[a+ba])return D;var c=d.fn[a+ba]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ba]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(T))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ba].apply(this,arguments)}),y.version="3.0.3",y.nextid=0,y.inactiveEvents=X,y.zindex=15e3,y.defaults={prerender:E,id:E,overwrite:D,suppress:D,content:{text:D,attr:"title",title:E,button:E},position:{my:"top left",at:"bottom right",target:E,container:E,viewport:E,adjust:{x:0,y:0,mouse:D,scroll:D,resize:D,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:E})}},show:{target:E,event:"mouseenter",effect:D,delay:90,solo:E,ready:E,autofocus:E},hide:{target:E,event:"mouseleave",effect:D,delay:0,fixed:E,inactive:E,leave:"window",distance:E},style:{classes:"",widget:E,width:E,height:E,def:D},events:{render:F,move:F,show:F,hide:F,toggle:F,visible:F,hidden:F,focus:F,blur:F}};var ha,ia,ja,ka,la,ma="margin",na="border",oa="color",pa="background-color",qa="transparent",ra=" !important",sa=!!b.createElement("canvas").getContext,ta=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ua={},va=["Webkit","O","Moz","ms"];sa?(ka=a.devicePixelRatio||1,la=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),ja=ka/la):ia=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'},d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":S+"-tip"}).prependTo(a.tooltip),sa?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=ia("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===K||a.y===O&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(D))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===E||b===E?a=E:a===D?a=new A(b.string()):a.string||(a=new A(a),a.fixed=D),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=na+s(b)+"Width";return(c?u(c,e):u(d.content,e)||u(this._useTitle(a)&&d.titlebar||d.content,e)||u(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=na+s(a.y)+s(a.x)+"Radius";return da.ie<9?0:u(this._useTitle(a)&&b.titlebar||b.content,c)||u(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||ta.test(d)?E:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=na+s(a[a.precedance])+s(oa),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,pa)||g(f,pa)||g(b.content,pa)||g(b.tooltip,pa)||c.css(pa),h[1]=g(c,e,oa)||g(f,e,oa)||g(b.content,e,oa)||g(b.tooltip,e,oa)||b.tooltip.css(e),d("*",c).add(c).css("cssText",pa+":"+qa+ra+";"+na+":0"+ra+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===H,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(sa||da.ie)&&this._parseCorner(this.options.corner);return this.enabled=!!this.corner&&"c"!==this.corner.abbrev(),this.enabled&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===E?r=b:(r=new A(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===G?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==qa?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!ta.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==D?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===H?[s(r.x===L?l:r.x===N?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===K?k[1]-q[1]:0)]:[s(r.x===L?k[0]-q[0]:0),s(r.y===K?l:r.y===M?k[1]-q[1]-l:(k[1]-q[1])/2)],sa?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,ja),i=this._calculateTip(r,this.size,ja),o.attr(I,k[0]*ja).attr(J,k[1]*ja),o.css(I,k[0]).css(J,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*ja,j[1]*ja),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===da.ie?2:1:0,o.css({coordsize:k[0]+l+" "+k[1]+l,antialias:""+(r.string().indexOf(O)>-1),left:j[0]-j[2]*Number(f===G),top:j[1]-j[2]*Number(f===H),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+k[1]+l,path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(ia("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==E&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return E;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j={};
|
4 |
+
return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===G&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===O?(h=c===H?L:K,j[h]="50%",j[ma+"-"+h]=-Math.round(b[c===H?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===G?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===Q&&j.precedance===b&&k[d]&&j[c]!==O?j.precedance=j.precedance===G?H:G:a!==Q&&k[d]&&(j[b]=j[b]===O?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===O?p[ma+"-"+b]=o[a]=g[ma+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=E),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:E,top:E,x:0,y:0},p={};this.corner.fixed!==D&&(e(m,G,H,L,N),e(n,H,G,K,M),j.string()===i.corner.string()&&i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,E)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,o.left=m===Q&&!!k.left,o.left&&f(G,L,N),o.top=n===Q&&!!k.top,o.top&&f(H,K,M),this.element.css(p).toggle(!(o.x&&o.y||j.x===O&&o.y||j.y===O&&o.x)),d.left-=g.left.charAt?g.user:m!==Q||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==Q||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),ha=R.tip=function(a){return new v(a,a.options.style.tip)},ha.initialize="render",ha.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=D)}},B.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(D,y.defaults,{style:{tip:{corner:D,mimic:E,width:6,height:6,border:D,offset:0}}});var wa,xa,ya="qtip-modal",za="."+ya;xa=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){j.length<1&&a.length?a.not("body").blur():j.first().focus()}function e(a){if(h.is(":visible")){var b,e=d(a.target),g=f.tooltip,i=e.closest(W);b=i.length<1?E:parseInt(i[0].style.zIndex,10)>parseInt(g[0].style.zIndex,10),b||e.closest(W)[0]===g[0]||c(e)}}var f,g,h,i=this,j={};d.extend(i,{init:function(){return h=i.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return E}}).hide(),d(b.body).on("focusin"+za,e),d(b).on("keydown"+za,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),h.on("click"+za,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),i},update:function(b){f=b,j=b.options.show.modal.stealfocus!==E?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,j){var k=a.tooltip,l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=h.is(":visible"),p=d(za).filter(":visible:not(:animated)").not(k);return i.update(a),e&&l.stealfocus!==E&&c(d(":focus")),h.toggleClass("blurs",l.blur),e&&h.appendTo(b.body),h.is(":animated")&&o===e&&g!==E||!e&&p.length?i:(h.stop(D,E),d.isFunction(m)?m.call(h,e):m===E?h[n]():h.fadeTo(parseInt(j,10)||90,e?1:0,function(){e||h.hide()}),e||h.queue(function(a){h.css({left:"",top:""}),d(za).length||h.detach(),a()}),g=e,f.destroyed&&(f=F),i)}}),i.init()},xa=new xa,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=xa.elem,b.addClass(ya).css("z-index",y.modal_zindex+d(za).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(xa.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(za),f=y.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);xa.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+$).qtip("blur",a.originalEvent),b.addClass($)[0].style.zIndex=f,xa.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(za).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void xa.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(ya),this.qtip._unbind(this.qtip.tooltip,this._ns),xa.toggle(this.qtip,E),delete this.qtip.elements.overlay}}),wa=R.modal=function(a){return new w(a,a.options.show.modal)},wa.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=D))},y.modal_zindex=y.zindex-200,wa.initialize="render",B.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(D,y.defaults,{show:{modal:{on:E,effect:D,blur:D,stealfocus:D,escape:D}}}),R.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===Q,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===I?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===O?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===I?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===P?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===O?-C:C)+e,l.invert(a,g)),d[f]<q[f]&&-d[f]>B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C={left:0,top:0};return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(E),p=A[0]===a?A.height():A.outerHeight(E),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,"shift"===y&&"shift"===z||(l=u.clone()),C={left:"none"!==y?j(G,H,y,w.x,L,N,I,f,h):0,top:"none"!==z?j(H,G,z,w.y,K,M,J,g,i):0,my:l}):C},R.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:E},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]<f.position.left&&(f.position.left=c[0]),c[1]>f.position.bottom&&(f.position.bottom=c[1]),c[1]<f.position.top&&(f.position.top=c[1]),h.push(c);if(d=f.width=Math.abs(f.position.right-f.position.left),e=f.height=Math.abs(f.position.bottom-f.position.top),"c"===b.abbrev())f.position={left:f.position.left+f.width/2,top:f.position.top+f.height/2};else{for(;d>0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===L?i=d:b.x===N?i=f.width-d:i+=Math.floor(d/2),b.y===K?j=e:b.y===M?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===L&&k>=i||b.x===N&&i>=k||b.x===O&&(i>k||k>f.width-i)||b.y===K&&l>=j||b.y===M&&j>=l||b.y===O&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=R.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:E}},circle:function(a,b,c,d){return R.polys.ellipse(a,b,c,c,d)}},R.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o=c[0],p=d(o.ownerSVGElement),q=o.ownerDocument,r=(parseInt(c.css("stroke-width"),10)||0)/2;!o.getBBox;)o=o.parentNode;if(!o.getBBox||!o.parentNode)return E;switch(o.nodeName){case"ellipse":case"circle":m=R.polys.ellipse(o.cx.baseVal.value,o.cy.baseVal.value,(o.rx||o.r).baseVal.value+r,(o.ry||o.r).baseVal.value+r,e);break;case"line":case"polygon":case"polyline":for(l=o.points||[{x:o.x1.baseVal.value,y:o.y1.baseVal.value},{x:o.x2.baseVal.value,y:o.y2.baseVal.value}],m=[],k=-1,i=l.numberOfItems||l.length;++k<i;)j=l.getItem?l.getItem(k):l[k],m.push.apply(m,[j.x,j.y]);m=R.polys.polygon(m,e);break;default:m=o.getBBox(),m={width:m.width,height:m.height,position:{left:m.x,top:m.y}}}return n=m.position,p=p[0],p.createSVGPoint&&(g=o.getScreenCTM(),l=p.createSVGPoint(),l.x=n.left,l.y=n.top,h=l.matrixTransform(g),n.left=h.x,n.top=h.y),q!==b&&"mouse"!==a.position.target&&(f=d((q.defaultView||q.parentWindow).frameElement).offset(),f&&(n.left+=f.left,n.top+=f.top)),q=d(q),n.left+=q.scrollLeft(),n.top+=q.scrollTop(),m},R.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=(b.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return E;if("polygon"===j)h=R.polys.polygon(m,c);else{if(!R.polys[j])return E;for(g=-1,i=m.length,f=[];++g<i;)f.push(parseInt(m[g],10));h=R.polys[j].apply(this,f.concat(c))}return e=k.offset(),e.left+=Math.ceil((k.outerWidth(E)-k.width())/2),e.top+=Math.ceil((k.outerHeight(E)-k.height())/2),h.position.left+=e.left,h.position.top+=e.top,h};var Aa,Ba='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';d.extend(x.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Ba).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("<div/>",{id:S+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(E),width:c.outerWidth(E)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[I,L]:[J,K],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(J,f.height),f.width?e.css(I,f.width):(e.css(I,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1*parseInt(c,10))||b,d=(d.indexOf("%")>-1?a:1*parseInt(d,10))||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(I,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Aa=R.ie6=function(a){return 6===da.ie?new x(a):E},Aa.initialize="render",B.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);
|
ui/js/selectWoo/i18n/af.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
+
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Verwyders asseblief "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Voer asseblief "+t+" of meer karakters";return n},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var t="Kies asseblief net "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ar.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum;return"الرجاء حذف "+t+" عناصر"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"الرجاء إضافة "+t+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){return"تستطيع إختيار "+e.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum;return"الرجاء حذف "+t+" عناصر"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"الرجاء إضافة "+t+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){return"تستطيع إختيار "+e.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/az.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/bg.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/bs.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
+
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bs",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ca.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/cs.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadejte o jeden znak méně.":n<=4?"Prosím, zadejte o "+e(n,!0)+" znaky méně.":"Prosím, zadejte o "+n+" znaků méně."},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadejte ještě jeden znak.":n<=4?"Prosím, zadejte ještě další "+e(n,!0)+" znaky.":"Prosím, zadejte ještě dalších "+n+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku.":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky.":"Můžete zvolit maximálně "+n+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/da.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/de.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/dsb.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
+
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/dsb",[],function(){var e=["znamuško","znamušce","znamuška","znamuškow"],t=["zapisk","zapiska","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Pšosym lašuj "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Pšosym zapódaj nanejmjenjej "+r+" "+n(r,e)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(e){return"Móžoš jano "+e.maximum+" "+n(e.maximum,t)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/el.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/en.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/es.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/et.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/eu.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/fa.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها میتوانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجهای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها میتوانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجهای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/fi.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/fr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Supprimez "+t+" caractère"+(t>1)?"s":""},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Saisissez au moins "+t+" caractère"+(t>1)?"s":""},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1)?"s":""},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/gl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/he.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/hi.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/hr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/hsb.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
+
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hsb",[],function(){var e=["znamješko","znamješce","znamješka","znamješkow"],t=["zapisk","zapiskaj","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Prošu zhašej "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Prošu zapodaj znajmjeńša "+r+" "+n(r,e)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(e){return"Móžeš jenož "+e.maximum+" "+n(e.maximum,t)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/hu.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/hy.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Խնդրում ենք հեռացնել "+t+" նշան";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Խնդրում ենք մուտքագրել "+t+" կամ ավել նշաններ";return n},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(e){var t="Դուք կարող եք ընտրել առավելագույնը "+e.maximum+" կետ";return t},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Խնդրում ենք հեռացնել "+t+" նշան";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Խնդրում ենք մուտքագրել "+t+" կամ ավել նշաններ";return n},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(e){var t="Դուք կարող եք ընտրել առավելագույնը "+e.maximum+" կետ";return t},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/id.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/is.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/it.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ja.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/km.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ko.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/lt.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/lv.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/mk.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ms.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/nb.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=t:n+="ett",n+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/nl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/pl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ps.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
+
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="د مهربانۍ لمخي "+t+" توری ړنګ کړئ";return t!=1&&(n=n.replace("توری","توري")),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لږ تر لږه "+t+" يا ډېر توري وليکئ";return n},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(e){var t="تاسو يوازي "+e.maximum+" قلم په نښه کولای سی";return e.maximum!=1&&(t=t.replace("قلم","قلمونه")),t},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/pt-BR.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/pt.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ro.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+" sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/ru.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/sk.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/sl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbrišite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpišite še "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var t="Označite lahko največ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbrišite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpišite še "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var t="Označite lahko največ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/sr-Cyrl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/sr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/sv.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/th.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/tr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/uk.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/vi.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
-
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
+
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+" ký tự";return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/zh-CN.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/i18n/zh-TW.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 1.0.
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2 |
|
3 |
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
|
ui/js/selectWoo/selectWoo.full.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*!
|
2 |
-
* SelectWoo 1.0.
|
3 |
* https://github.com/woocommerce/selectWoo
|
4 |
*
|
5 |
* Released under the MIT license
|
@@ -755,6 +755,12 @@ S2.define('select2/utils',[
|
|
755 |
});
|
756 |
};
|
757 |
|
|
|
|
|
|
|
|
|
|
|
|
|
758 |
// Append an array of jQuery nodes to a given element.
|
759 |
Utils.appendMany = function ($element, $nodes) {
|
760 |
// jQuery 1.7.x does not support $.fn.append() with an array
|
@@ -1611,9 +1617,9 @@ S2.define('select2/selection/single',[
|
|
1611 |
var selection = data[0];
|
1612 |
|
1613 |
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1614 |
-
var formatted = this.display(selection, $rendered);
|
1615 |
|
1616 |
-
$rendered.empty().
|
1617 |
$rendered.prop('title', selection.title || selection.text);
|
1618 |
};
|
1619 |
|
@@ -1742,12 +1748,14 @@ S2.define('select2/selection/multiple',[
|
|
1742 |
var selection = data[d];
|
1743 |
|
1744 |
var $selection = this.selectionContainer();
|
|
|
1745 |
var formatted = this.display(selection, $selection);
|
1746 |
if ('string' === typeof formatted) {
|
1747 |
-
formatted = formatted.trim();
|
1748 |
}
|
1749 |
|
1750 |
-
$selection.
|
|
|
1751 |
$selection.prop('title', selection.title || selection.text);
|
1752 |
|
1753 |
$selection.data('data', selection);
|
@@ -1786,7 +1794,7 @@ S2.define('select2/selection/placeholder',[
|
|
1786 |
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1787 |
var $placeholder = this.selectionContainer();
|
1788 |
|
1789 |
-
$placeholder.
|
1790 |
$placeholder.addClass('select2-selection__placeholder')
|
1791 |
.removeClass('select2-selection__choice');
|
1792 |
|
@@ -1924,7 +1932,7 @@ S2.define('select2/selection/search',[
|
|
1924 |
var $search = $(
|
1925 |
'<li class="select2-search select2-search--inline">' +
|
1926 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
1927 |
-
' autocomplete="off" autocorrect="off" autocapitalize="
|
1928 |
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1929 |
'</li>'
|
1930 |
);
|
@@ -3992,7 +4000,7 @@ S2.define('select2/dropdown/search',[
|
|
3992 |
var $search = $(
|
3993 |
'<span class="select2-search select2-search--dropdown">' +
|
3994 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
3995 |
-
' autocomplete="off" autocorrect="off" autocapitalize="
|
3996 |
' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
|
3997 |
'</span>'
|
3998 |
);
|
@@ -4047,7 +4055,7 @@ S2.define('select2/dropdown/search',[
|
|
4047 |
});
|
4048 |
|
4049 |
container.on('focus', function () {
|
4050 |
-
if (container.isOpen()) {
|
4051 |
self.$search.focus();
|
4052 |
}
|
4053 |
});
|
@@ -5465,12 +5473,11 @@ S2.define('select2/core',[
|
|
5465 |
$(document).on('keydown', function (evt) {
|
5466 |
var key = evt.which;
|
5467 |
if (self.isOpen()) {
|
5468 |
-
if (key === KEYS.ESC || key === KEYS.
|
5469 |
-
(key === KEYS.UP && evt.altKey)) {
|
5470 |
self.close();
|
5471 |
|
5472 |
evt.preventDefault();
|
5473 |
-
} else if (key === KEYS.ENTER) {
|
5474 |
self.trigger('results:select', {});
|
5475 |
|
5476 |
evt.preventDefault();
|
1 |
/*!
|
2 |
+
* SelectWoo 1.0.8
|
3 |
* https://github.com/woocommerce/selectWoo
|
4 |
*
|
5 |
* Released under the MIT license
|
755 |
});
|
756 |
};
|
757 |
|
758 |
+
Utils.entityDecode = function (html) {
|
759 |
+
var txt = document.createElement('textarea');
|
760 |
+
txt.innerHTML = html;
|
761 |
+
return txt.value;
|
762 |
+
}
|
763 |
+
|
764 |
// Append an array of jQuery nodes to a given element.
|
765 |
Utils.appendMany = function ($element, $nodes) {
|
766 |
// jQuery 1.7.x does not support $.fn.append() with an array
|
1617 |
var selection = data[0];
|
1618 |
|
1619 |
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1620 |
+
var formatted = Utils.entityDecode(this.display(selection, $rendered));
|
1621 |
|
1622 |
+
$rendered.empty().text(formatted);
|
1623 |
$rendered.prop('title', selection.title || selection.text);
|
1624 |
};
|
1625 |
|
1748 |
var selection = data[d];
|
1749 |
|
1750 |
var $selection = this.selectionContainer();
|
1751 |
+
var removeItemTag = $selection.html();
|
1752 |
var formatted = this.display(selection, $selection);
|
1753 |
if ('string' === typeof formatted) {
|
1754 |
+
formatted = Utils.entityDecode(formatted.trim());
|
1755 |
}
|
1756 |
|
1757 |
+
$selection.text(formatted);
|
1758 |
+
$selection.prepend(removeItemTag);
|
1759 |
$selection.prop('title', selection.title || selection.text);
|
1760 |
|
1761 |
$selection.data('data', selection);
|
1794 |
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1795 |
var $placeholder = this.selectionContainer();
|
1796 |
|
1797 |
+
$placeholder.text(Utils.entityDecode(this.display(placeholder)));
|
1798 |
$placeholder.addClass('select2-selection__placeholder')
|
1799 |
.removeClass('select2-selection__choice');
|
1800 |
|
1932 |
var $search = $(
|
1933 |
'<li class="select2-search select2-search--inline">' +
|
1934 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
1935 |
+
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
1936 |
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1937 |
'</li>'
|
1938 |
);
|
4000 |
var $search = $(
|
4001 |
'<span class="select2-search select2-search--dropdown">' +
|
4002 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
4003 |
+
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
4004 |
' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
|
4005 |
'</span>'
|
4006 |
);
|
4055 |
});
|
4056 |
|
4057 |
container.on('focus', function () {
|
4058 |
+
if (!container.isOpen()) {
|
4059 |
self.$search.focus();
|
4060 |
}
|
4061 |
});
|
5473 |
$(document).on('keydown', function (evt) {
|
5474 |
var key = evt.which;
|
5475 |
if (self.isOpen()) {
|
5476 |
+
if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
|
|
|
5477 |
self.close();
|
5478 |
|
5479 |
evt.preventDefault();
|
5480 |
+
} else if (key === KEYS.ENTER || key === KEYS.TAB) {
|
5481 |
self.trigger('results:select', {});
|
5482 |
|
5483 |
evt.preventDefault();
|
ui/js/selectWoo/selectWoo.full.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[data-selected]"),b=a.filter("[data-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k<b.children.length;k++){var l=b.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">×</span></li>')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);"string"==typeof g&&(g=g.trim()),f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n<f)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.entityDecode=function(a){var b=document.createElement("textarea");return b.innerHTML=a,b.value},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[data-selected]"),b=a.filter("[data-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k<b.children.length;k++){var l=b.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],d=this.$selection.find(".select2-selection__rendered"),e=c.entityDecode(this.display(b,d));d.empty().text(e),d.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">×</span></li>')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=f.html(),h=this.display(e,f);"string"==typeof h&&(h=c.entityDecode(h.trim())),f.text(h),f.prepend(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var i=this.$selection.find(".select2-selection__rendered");c.appendMany(i,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(b,c){var d=this.selectionContainer();return d.text(a.entityDecode(this.display(c))),d.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),d},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER||c===d.TAB?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n<f)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
|
ui/js/selectWoo/selectWoo.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*!
|
2 |
-
* SelectWoo 1.0.
|
3 |
* https://github.com/woocommerce/selectWoo
|
4 |
*
|
5 |
* Released under the MIT license
|
@@ -755,6 +755,12 @@ S2.define('select2/utils',[
|
|
755 |
});
|
756 |
};
|
757 |
|
|
|
|
|
|
|
|
|
|
|
|
|
758 |
// Append an array of jQuery nodes to a given element.
|
759 |
Utils.appendMany = function ($element, $nodes) {
|
760 |
// jQuery 1.7.x does not support $.fn.append() with an array
|
@@ -1611,9 +1617,9 @@ S2.define('select2/selection/single',[
|
|
1611 |
var selection = data[0];
|
1612 |
|
1613 |
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1614 |
-
var formatted = this.display(selection, $rendered);
|
1615 |
|
1616 |
-
$rendered.empty().
|
1617 |
$rendered.prop('title', selection.title || selection.text);
|
1618 |
};
|
1619 |
|
@@ -1742,12 +1748,14 @@ S2.define('select2/selection/multiple',[
|
|
1742 |
var selection = data[d];
|
1743 |
|
1744 |
var $selection = this.selectionContainer();
|
|
|
1745 |
var formatted = this.display(selection, $selection);
|
1746 |
if ('string' === typeof formatted) {
|
1747 |
-
formatted = formatted.trim();
|
1748 |
}
|
1749 |
|
1750 |
-
$selection.
|
|
|
1751 |
$selection.prop('title', selection.title || selection.text);
|
1752 |
|
1753 |
$selection.data('data', selection);
|
@@ -1786,7 +1794,7 @@ S2.define('select2/selection/placeholder',[
|
|
1786 |
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1787 |
var $placeholder = this.selectionContainer();
|
1788 |
|
1789 |
-
$placeholder.
|
1790 |
$placeholder.addClass('select2-selection__placeholder')
|
1791 |
.removeClass('select2-selection__choice');
|
1792 |
|
@@ -1924,7 +1932,7 @@ S2.define('select2/selection/search',[
|
|
1924 |
var $search = $(
|
1925 |
'<li class="select2-search select2-search--inline">' +
|
1926 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
1927 |
-
' autocomplete="off" autocorrect="off" autocapitalize="
|
1928 |
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1929 |
'</li>'
|
1930 |
);
|
@@ -3992,7 +4000,7 @@ S2.define('select2/dropdown/search',[
|
|
3992 |
var $search = $(
|
3993 |
'<span class="select2-search select2-search--dropdown">' +
|
3994 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
3995 |
-
' autocomplete="off" autocorrect="off" autocapitalize="
|
3996 |
' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
|
3997 |
'</span>'
|
3998 |
);
|
@@ -4047,7 +4055,7 @@ S2.define('select2/dropdown/search',[
|
|
4047 |
});
|
4048 |
|
4049 |
container.on('focus', function () {
|
4050 |
-
if (container.isOpen()) {
|
4051 |
self.$search.focus();
|
4052 |
}
|
4053 |
});
|
@@ -5465,12 +5473,11 @@ S2.define('select2/core',[
|
|
5465 |
$(document).on('keydown', function (evt) {
|
5466 |
var key = evt.which;
|
5467 |
if (self.isOpen()) {
|
5468 |
-
if (key === KEYS.ESC || key === KEYS.
|
5469 |
-
(key === KEYS.UP && evt.altKey)) {
|
5470 |
self.close();
|
5471 |
|
5472 |
evt.preventDefault();
|
5473 |
-
} else if (key === KEYS.ENTER) {
|
5474 |
self.trigger('results:select', {});
|
5475 |
|
5476 |
evt.preventDefault();
|
1 |
/*!
|
2 |
+
* SelectWoo 1.0.8
|
3 |
* https://github.com/woocommerce/selectWoo
|
4 |
*
|
5 |
* Released under the MIT license
|
755 |
});
|
756 |
};
|
757 |
|
758 |
+
Utils.entityDecode = function (html) {
|
759 |
+
var txt = document.createElement('textarea');
|
760 |
+
txt.innerHTML = html;
|
761 |
+
return txt.value;
|
762 |
+
}
|
763 |
+
|
764 |
// Append an array of jQuery nodes to a given element.
|
765 |
Utils.appendMany = function ($element, $nodes) {
|
766 |
// jQuery 1.7.x does not support $.fn.append() with an array
|
1617 |
var selection = data[0];
|
1618 |
|
1619 |
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1620 |
+
var formatted = Utils.entityDecode(this.display(selection, $rendered));
|
1621 |
|
1622 |
+
$rendered.empty().text(formatted);
|
1623 |
$rendered.prop('title', selection.title || selection.text);
|
1624 |
};
|
1625 |
|
1748 |
var selection = data[d];
|
1749 |
|
1750 |
var $selection = this.selectionContainer();
|
1751 |
+
var removeItemTag = $selection.html();
|
1752 |
var formatted = this.display(selection, $selection);
|
1753 |
if ('string' === typeof formatted) {
|
1754 |
+
formatted = Utils.entityDecode(formatted.trim());
|
1755 |
}
|
1756 |
|
1757 |
+
$selection.text(formatted);
|
1758 |
+
$selection.prepend(removeItemTag);
|
1759 |
$selection.prop('title', selection.title || selection.text);
|
1760 |
|
1761 |
$selection.data('data', selection);
|
1794 |
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1795 |
var $placeholder = this.selectionContainer();
|
1796 |
|
1797 |
+
$placeholder.text(Utils.entityDecode(this.display(placeholder)));
|
1798 |
$placeholder.addClass('select2-selection__placeholder')
|
1799 |
.removeClass('select2-selection__choice');
|
1800 |
|
1932 |
var $search = $(
|
1933 |
'<li class="select2-search select2-search--inline">' +
|
1934 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
1935 |
+
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
1936 |
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1937 |
'</li>'
|
1938 |
);
|
4000 |
var $search = $(
|
4001 |
'<span class="select2-search select2-search--dropdown">' +
|
4002 |
'<input class="select2-search__field" type="text" tabindex="-1"' +
|
4003 |
+
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
4004 |
' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
|
4005 |
'</span>'
|
4006 |
);
|
4055 |
});
|
4056 |
|
4057 |
container.on('focus', function () {
|
4058 |
+
if (!container.isOpen()) {
|
4059 |
self.$search.focus();
|
4060 |
}
|
4061 |
});
|
5473 |
$(document).on('keydown', function (evt) {
|
5474 |
var key = evt.which;
|
5475 |
if (self.isOpen()) {
|
5476 |
+
if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
|
|
|
5477 |
self.close();
|
5478 |
|
5479 |
evt.preventDefault();
|
5480 |
+
} else if (key === KEYS.ENTER || key === KEYS.TAB) {
|
5481 |
self.trigger('results:select', {});
|
5482 |
|
5483 |
evt.preventDefault();
|
ui/js/selectWoo/selectWoo.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[data-selected]"),b=a.filter("[data-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k<b.children.length;k++){var l=b.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">×</span></li>')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);"string"==typeof g&&(g=g.trim()),f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
|
1 |
+
/*! Select2 1.0.8 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.entityDecode=function(a){var b=document.createElement("textarea");return b.innerHTML=a,b.value},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[data-selected]"),b=a.filter("[data-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k<b.children.length;k++){var l=b.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],d=this.$selection.find(".select2-selection__rendered"),e=c.entityDecode(this.display(b,d));d.empty().text(e),d.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">×</span></li>')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=f.html(),h=this.display(e,f);"string"==typeof h&&(h=c.entityDecode(h.trim())),f.text(h),f.prepend(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var i=this.$selection.find(".select2-selection__rendered");c.appendMany(i,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(b,c){var d=this.selectionContainer();return d.text(a.entityDecode(this.display(c))),d.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),d},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER||c===d.TAB?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
|